* Presta.csproj: A first class

* AssemblyInfo.cs: initial commit

* NpgsqlCircleProvider.cs: circle members are now stored in bd upon
  their user's name

* InputCircle.cs: fixes the new CircleManager interface usage

* Yavsc.sln: Adds the `Presta` project

* CircleController.cs: * Authorize some Http methods
* Lists circles as circles

* style.css: Fixes the missing "hidden" css class

* AccountController.cs: using the new Circle provider interface

* BlogsController.cs: * using the new Circle provider interface
* do not test blog entry collections in order to group them by a
  unique user name or title, it's too bad,
instead, keep user's request id as guide to model and view.

* YavscHelpers.cs: Adds a Circle Html formatter

* Circles.aspx: List of circles is now given as a list of `Circle`
  objects

* instdbws.sql: fixes the db in order to store user names in circle
  member's records.

* BlogEntryCollection.cs: ConcernsAUniqueTitle and ConcernsAUniqueUser
  are now Obsoletes

* UUTBlogEntryCollection.cs: Drops a useless ctor

* CircleProvider.cs: The `CircleManager` now delivers the user's
  circle as a `Circle` object collection.
This commit is contained in:
Paul Schneider 2015-08-20 20:02:46 +02:00
commit bdbda2a21f
21 changed files with 322 additions and 82 deletions

View file

@ -13,6 +13,7 @@ using Yavsc.Helpers;
using System.Web.Mvc;
using Yavsc.Model.Circles;
using System.Collections.Specialized;
using System.Text;
namespace Yavsc.Controllers
{
@ -309,12 +310,10 @@ namespace Yavsc.Controllers
public ActionResult Circles ()
{
string user = Membership.GetUser ().UserName;
ViewData["Circles"] = CircleManager.DefaultProvider.List (user).Select (x => new SelectListItem {
Value = x.Value,
Text = x.Text
});;
ViewData["Circles"] = CircleManager.DefaultProvider.List (user);
return View ();
}
/// <summary>
/// Logout the specified returnUrl.
/// </summary>

View file

@ -18,6 +18,7 @@ using Yavsc.Model.RolesAndMembers;
using System.Net;
using System.Web.Mvc;
using Yavsc.Model.Circles;
using Yavsc.Helpers;
namespace Yavsc.Controllers
{
@ -131,11 +132,6 @@ namespace Yavsc.Controllers
ViewData ["Avatar"] = bupr.avatar;
ViewData ["RecordCount"] = tr;
UUBlogEntryCollection uuc = new UUBlogEntryCollection (user, c);
if (uuc.ConcernsAUniqueTitle) {
var uutc = new UUTBlogEntryCollection (uuc.UserName,
uuc [0].Title, uuc);
return View ("UserPost", uutc );
}
return View ("UserPosts", uuc);
}
@ -259,8 +255,8 @@ namespace Yavsc.Controllers
title = "";
ViewData ["UserName"] = un;
ViewData ["AllowedCircles"] = CircleManager.DefaultProvider.List (Membership.GetUser ().UserName).Select (x => new SelectListItem {
Value = x.Value,
Text = x.Text
Value = x.Id.ToString(),
Text = YavscHelpers.FormatCircle(x).ToHtmlString()
});
return View ("Edit", new BlogEntry { Title = title });
@ -306,9 +302,9 @@ namespace Yavsc.Controllers
e.AllowedCircles = new long[0];
ViewData ["AllowedCircles"] = CircleManager.DefaultProvider.List (Membership.GetUser ().UserName).Select (x => new SelectListItem {
Value = x.Value,
Text = x.Text,
Selected = e.AllowedCircles.Contains (long.Parse (x.Value))
Value = x.Id.ToString(),
Text = YavscHelpers.FormatCircle(x).ToHtmlString(),
Selected = e.AllowedCircles.Contains (x.Id)
});
return View (e);
}