* yavsc.js:

* yavsc.circles.js: js refactoring

* Credits.aspx: A credit about to add

* CircleBase.cs: The Circle base

* NpgsqlCircleProvider.cs: * refactoring
* updates the circle

* InputCircle.cs: using the new CircleBase class

* ResultPages.cs: Using a new "None" attribute

* CircleController.cs: refactoring : drops the NewCircle class The
  `List` method now resterns collection of circlebase

* style.css: * a new `dirty` css class, could be used to tag data to
  validate ala ajax
* removed quite all of the `float` usages

* AccountController.cs: xml doc

* BlogsController.cs: Avatar method moved to the Account controller

* YavscHelpers.cs: An avatar url

* App.master: Login div moved up

* Circles.aspx: a new `private` filed in the `Circle` object, in order
  to keep circle names from being published as user's information,
should be true by default

* Profile.aspx: removed the tables

* Index.aspx: Un message plus explicite

* Web.config: nothing to view

* Web.csproj: * new page : Credit
* new script: yavsc.circle.js

* instdbws.sql: circles are uniques for a given user against a given
  app

* Circle.cs: Now inherits CircleBase to implement a member list

* CircleProvider.cs: implements a circle update method

* LocalizedText.resx:
* LocalizedText.Designer.cs: no content!!!

* LocalizedText.fr.resx:
* LocalizedText.fr.Designer.cs: pas content

* YavscModel.csproj: a new CircleBAse class
This commit is contained in:
Paul Schneider
2015-09-10 00:55:19 +02:00
parent 37188df28a
commit b7fa996dbc
30 changed files with 731 additions and 461 deletions

View File

@ -58,7 +58,7 @@ namespace Yavsc.ApiControllers
public void Add(long id, string username)
{
checkIsOwner (CircleManager.DefaultProvider.Get (id));
CircleManager.DefaultProvider.Add (id, username);
CircleManager.DefaultProvider.AddMember (id, username);
}
@ -70,7 +70,7 @@ namespace Yavsc.ApiControllers
AcceptVerbs ("GET")]
public void Delete(long id)
{
checkIsOwner (CircleManager.DefaultProvider.Get(id));
checkIsOwner (CircleManager.DefaultProvider.Get (id));
CircleManager.DefaultProvider.Delete (id);
}
@ -88,7 +88,7 @@ namespace Yavsc.ApiControllers
CircleManager.DefaultProvider.RemoveMembership (id,username);
}
private void checkIsOwner(Circle c)
private void checkIsOwner(CircleBase c)
{
string user = Membership.GetUser ().UserName;
if (c.Owner != user)
@ -103,7 +103,7 @@ namespace Yavsc.ApiControllers
AcceptVerbs ("GET")]
public Circle Get(long id)
{
var c = CircleManager.DefaultProvider.Get (id);
var c = CircleManager.DefaultProvider.GetMembers (id);
checkIsOwner (c);
return c;
}
@ -113,11 +113,26 @@ namespace Yavsc.ApiControllers
/// </summary>
[Authorize,
AcceptVerbs ("GET")]
public IEnumerable<Circle> List()
public IEnumerable<CircleBase> List()
{
string user = Membership.GetUser ().UserName;
return CircleManager.DefaultProvider.List (user);
}
/// <summary>
/// List the circles
/// </summary>
[Authorize,
AcceptVerbs ("POST")]
public void Update(CircleBase circle)
{
string user = Membership.GetUser ().UserName;
CircleBase current = CircleManager.DefaultProvider.Get (circle.Id);
if (current.Owner != user)
throw new AuthorizationDenied ("Your not owner of circle at id "+circle.Id);
CircleManager.DefaultProvider.UpdateCircle (circle);
}
}
}