Starting to test some controller

* BlogUnitTest.cs: Should test the user registration

* NpgsqlBlogProvider.cs: Fixes usage of Npgsql upgrade to latest
  version

* TestAPI.csproj: switch to .Net framework 4.5.1

* AccountController.cs: refactoring password validation

* CalendarController.cs:
* WorkFlowController.cs: SendActivationMessage became an extension
  method

* style.css: menu items already have a background and color, since
  they're `<A>` tags

* Unregister.aspx:
* AccountController.cs: refactoring user registration

* BlogsController.cs: Fixes a confusion between Author and reader ...

* YavscHelpers.cs: refactoring the password reset

* App.master: no more <div class="menuitem">, they're hyperlinks

* Login.aspx:
* Profile.aspx: refactoring the user registration

* BlogEntryCollection.cs: implements a method to filter a given post
  collection in order to be displayed tu a given user or anonymous
This commit is contained in:
Paul Schneider 2015-10-07 11:50:44 +02:00
commit 303aaa5e1b
19 changed files with 218 additions and 65 deletions

View file

@ -3,6 +3,7 @@ using System.Configuration;
using System.Collections.Generic;
using Yavsc.Model.Blogs;
using System.Linq;
using Yavsc.Model.Circles;
namespace Yavsc.Model.Blogs
{
@ -56,7 +57,25 @@ namespace Yavsc.Model.Blogs
{
return this.Where (x => x.Title == title).ToArray ();
}
/// <summary>
/// Filters the current collection for a given user by its name.
/// Assumes that this user is not an author of any of these posts.
/// </summary>
/// <param name="username">Username.</param>
public BlogEntryCollection FilterFor(string username)
{
BlogEntryCollection res = new BlogEntryCollection ();
foreach (BlogEntry be in this) {
if (be.Visible &&
(be.AllowedCircles == null ||
(username!= null && CircleManager.DefaultProvider.Matches
(be.AllowedCircles,username))))
{
res.Add(be);
}
}
return res;
}
/// <summary>
/// Base post info.
/// </summary>

View file

@ -1,3 +1,9 @@
2015-10-07 Paul Schneider <paul@pschneider.fr>
* BlogEntryCollection.cs: implements a method to filter a
given post collection in order to be displayed tu a given user
or anonymous
2015-10-04 Paul Schneider <paul@pschneider.fr>
* MarkdownHelper.cs: