From 679a249faf1a9e32b4f734497772239b3d25fa22 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Wed, 5 Aug 2015 20:17:50 +0200 Subject: [PATCH] * style.css: Gives a margin to the login panel * BlogsController.cs: Simplifies the code and method * UserList.aspx: Displays the creation date * BlogEntryCollection.cs: adds xml doc * UUBlogEntryCollection.cs: * UUTBlogEntryCollection.cs: fixes a creation from a post array --- web/App_Themes/style.css | 7 ++++--- web/ChangeLog | 8 ++++++++ web/Controllers/BlogsController.cs | 13 +++++++------ web/Views/Admin/UserList.aspx | 2 +- yavscModel/Blogs/BlogEntryCollection.cs | 11 ++++++++++- yavscModel/Blogs/UUBlogEntryCollection.cs | 8 ++++++-- yavscModel/Blogs/UUTBlogEntryCollection.cs | 2 +- yavscModel/ChangeLog | 8 ++++++++ 8 files changed, 45 insertions(+), 14 deletions(-) diff --git a/web/App_Themes/style.css b/web/App_Themes/style.css index 764bd2b6..0fa25916 100644 --- a/web/App_Themes/style.css +++ b/web/App_Themes/style.css @@ -73,10 +73,11 @@ footer { .bsh { float: right; } #login { - background-color: rgba(32,0,0,.5); + margin: .5em; + padding: .5em; + border-radius:10px; + background-color: rgba(32,16,16,.6); position: fixed; - margin:0em; - padding:0em; top:0; right:0; justify-content: space-around; diff --git a/web/ChangeLog b/web/ChangeLog index a74a700c..5a5f7064 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,3 +1,11 @@ +2015-08-05 Paul Schneider + + * style.css: Gives a margin to the login panel + + * BlogsController.cs: Simplifies the code and method + + * UserList.aspx: Displays the creation date + 2015-08-05 Paul Schneider * style.css: the style changes ... diff --git a/web/Controllers/BlogsController.cs b/web/Controllers/BlogsController.cs index c437d0ce..75177b5a 100644 --- a/web/Controllers/BlogsController.cs +++ b/web/Controllers/BlogsController.cs @@ -131,10 +131,11 @@ namespace Yavsc.Controllers ViewData ["Avatar"] = bupr.avatar; ViewData ["RecordCount"] = tr; UUBlogEntryCollection uuc = new UUBlogEntryCollection (user, c); - if (uuc.ConcernsAUniqueTitle) - if (uuc.Count>0) - return View ("UserPost", new UUTBlogEntryCollection(uuc.UserName, - uuc[0].Title,uuc)); + if (uuc.ConcernsAUniqueTitle) { + var uutc = new UUTBlogEntryCollection (uuc.UserName, + uuc [0].Title, uuc); + return View ("UserPost", uutc ); + } return View ("UserPosts", uuc); } @@ -182,7 +183,7 @@ namespace Yavsc.Controllers /// /// The post. /// Bec. - private ActionResult UserPosts (UUTBlogEntryCollection bec) + private ActionResult UserPost (UUTBlogEntryCollection bec) { if (ModelState.IsValid) if (bec.Count > 0) { @@ -208,7 +209,7 @@ namespace Yavsc.Controllers } } } - return View (BlogManager.FilterOnReadAccess(bec as UUTBlogEntryCollection)); + return View ("UserPost",bec); } /// diff --git a/web/Views/Admin/UserList.aspx b/web/Views/Admin/UserList.aspx index 1fa1224c..87a9437f 100644 --- a/web/Views/Admin/UserList.aspx +++ b/web/Views/Admin/UserList.aspx @@ -5,7 +5,7 @@
    <%foreach (MembershipUser user in Model){ %> -
  • <%=user.UserName%> <%=user.Email%> <%=(user.IsApproved)?"":"("+LocalizedText.Not_Approuved+")"%> <%=user.IsOnline?LocalizedText.Online:LocalizedText.Offline%> +
  • <%=user.UserName%> (created <%=user.CreationDate.ToString("D")%>) <%=user.Email%> <%=(user.IsApproved)?"":"("+LocalizedText.Not_Approuved+")"%> <%=user.IsOnline?LocalizedText.Online:LocalizedText.Offline%> <% if (Roles.IsUserInRole("Admin")) { %> <%= Html.ActionLink(LocalizedText.Remove,"RemoveUser", new { username = user.UserName }, new { @class="actionlink" } ) %> <% } %> diff --git a/yavscModel/Blogs/BlogEntryCollection.cs b/yavscModel/Blogs/BlogEntryCollection.cs index d5c49680..7993f14c 100644 --- a/yavscModel/Blogs/BlogEntryCollection.cs +++ b/yavscModel/Blogs/BlogEntryCollection.cs @@ -11,10 +11,16 @@ namespace Yavsc.Model.Blogs ///
public class BlogEntryCollection : List { + /// + /// Initializes a new instance of the class. + /// public BlogEntryCollection () { } - + /// + /// Initializes a new instance of the class. + /// + /// Items. public BlogEntryCollection(IEnumerable items) { if (items!=null) @@ -73,6 +79,9 @@ namespace Yavsc.Model.Blogs public DateTime Modified; } + /// + /// Post info by user. + /// public struct PostInfoByUser { /// diff --git a/yavscModel/Blogs/UUBlogEntryCollection.cs b/yavscModel/Blogs/UUBlogEntryCollection.cs index 922765d7..f44c7ba2 100644 --- a/yavscModel/Blogs/UUBlogEntryCollection.cs +++ b/yavscModel/Blogs/UUBlogEntryCollection.cs @@ -20,6 +20,7 @@ // along with this program. If not, see . using System; +using System.Collections.Generic; namespace Yavsc.Model.Blogs { @@ -34,7 +35,7 @@ namespace Yavsc.Model.Blogs /// Username. /// Items. public UUBlogEntryCollection(string username, - BlogEntryCollection items = null) : base(items) { + IEnumerable items = null) : base(items) { _username = username; } private string _username; @@ -43,7 +44,10 @@ namespace Yavsc.Model.Blogs /// /// The name of the user. public string UserName { get { return _username; } } - + /// + /// Returns a that represents the current . + /// + /// A that represents the current . public override string ToString () { return string.Format ("[UUBlogEntryCollection: UserName={0} Count={1}]", UserName, Count); diff --git a/yavscModel/Blogs/UUTBlogEntryCollection.cs b/yavscModel/Blogs/UUTBlogEntryCollection.cs index 92c0c8be..dcd97852 100644 --- a/yavscModel/Blogs/UUTBlogEntryCollection.cs +++ b/yavscModel/Blogs/UUTBlogEntryCollection.cs @@ -34,7 +34,7 @@ namespace Yavsc.Model.Blogs /// Title. /// Items. public UUTBlogEntryCollection(string username, string title, - IEnumerable items = null) : base(username) { + IEnumerable items = null) : base(username,items) { if (Count>0) { if (!(ConcernsAUniqueTitle && ConcernsAUniqueTitle)) throw new InvalidOperationException (); diff --git a/yavscModel/ChangeLog b/yavscModel/ChangeLog index 0be30ea0..c1c4323e 100644 --- a/yavscModel/ChangeLog +++ b/yavscModel/ChangeLog @@ -1,3 +1,11 @@ +2015-08-05 Paul Schneider + + * BlogEntryCollection.cs: adds xml doc + + * UUBlogEntryCollection.cs: + * UUTBlogEntryCollection.cs: fixes a creation from a post + array + 2015-08-05 Paul Schneider * BlogManager.cs: fixes the comment posting