* 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
This commit is contained in:
Paul Schneider
2015-08-05 20:17:50 +02:00
parent 33e93dfbfa
commit 679a249faf
8 changed files with 45 additions and 14 deletions

View File

@ -73,10 +73,11 @@ footer {
.bsh { float: right; } .bsh { float: right; }
#login { #login {
background-color: rgba(32,0,0,.5); margin: .5em;
padding: .5em;
border-radius:10px;
background-color: rgba(32,16,16,.6);
position: fixed; position: fixed;
margin:0em;
padding:0em;
top:0; top:0;
right:0; right:0;
justify-content: space-around; justify-content: space-around;

View File

@ -1,3 +1,11 @@
2015-08-05 Paul Schneider <paul@pschneider.fr>
* 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 <paul@pschneider.fr> 2015-08-05 Paul Schneider <paul@pschneider.fr>
* style.css: the style changes ... * style.css: the style changes ...

View File

@ -131,10 +131,11 @@ namespace Yavsc.Controllers
ViewData ["Avatar"] = bupr.avatar; ViewData ["Avatar"] = bupr.avatar;
ViewData ["RecordCount"] = tr; ViewData ["RecordCount"] = tr;
UUBlogEntryCollection uuc = new UUBlogEntryCollection (user, c); UUBlogEntryCollection uuc = new UUBlogEntryCollection (user, c);
if (uuc.ConcernsAUniqueTitle) if (uuc.ConcernsAUniqueTitle) {
if (uuc.Count>0) var uutc = new UUTBlogEntryCollection (uuc.UserName,
return View ("UserPost", new UUTBlogEntryCollection(uuc.UserName, uuc [0].Title, uuc);
uuc[0].Title,uuc)); return View ("UserPost", uutc );
}
return View ("UserPosts", uuc); return View ("UserPosts", uuc);
} }
@ -182,7 +183,7 @@ namespace Yavsc.Controllers
/// </summary> /// </summary>
/// <returns>The post.</returns> /// <returns>The post.</returns>
/// <param name="bec">Bec.</param> /// <param name="bec">Bec.</param>
private ActionResult UserPosts (UUTBlogEntryCollection bec) private ActionResult UserPost (UUTBlogEntryCollection bec)
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
if (bec.Count > 0) { if (bec.Count > 0) {
@ -208,7 +209,7 @@ namespace Yavsc.Controllers
} }
} }
} }
return View (BlogManager.FilterOnReadAccess(bec as UUTBlogEntryCollection)); return View ("UserPost",bec);
} }
/// <summary> /// <summary>

View File

@ -5,7 +5,7 @@
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<ul> <ul>
<%foreach (MembershipUser user in Model){ %> <%foreach (MembershipUser user in Model){ %>
<li><%=user.UserName%> <%=user.Email%> <%=(user.IsApproved)?"":"("+LocalizedText.Not_Approuved+")"%> <%=user.IsOnline?LocalizedText.Online:LocalizedText.Offline%> <li><%=user.UserName%> (created <%=user.CreationDate.ToString("D")%>) <%=user.Email%> <%=(user.IsApproved)?"":"("+LocalizedText.Not_Approuved+")"%> <%=user.IsOnline?LocalizedText.Online:LocalizedText.Offline%>
<% if (Roles.IsUserInRole("Admin")) { %> <% if (Roles.IsUserInRole("Admin")) { %>
<%= Html.ActionLink(LocalizedText.Remove,"RemoveUser", new { username = user.UserName }, new { @class="actionlink" } ) %> <%= Html.ActionLink(LocalizedText.Remove,"RemoveUser", new { username = user.UserName }, new { @class="actionlink" } ) %>
<% } %> <% } %>

View File

@ -11,10 +11,16 @@ namespace Yavsc.Model.Blogs
/// </summary> /// </summary>
public class BlogEntryCollection : List<BlogEntry> public class BlogEntryCollection : List<BlogEntry>
{ {
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Blogs.BlogEntryCollection"/> class.
/// </summary>
public BlogEntryCollection () public BlogEntryCollection ()
{ {
} }
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.Blogs.BlogEntryCollection"/> class.
/// </summary>
/// <param name="items">Items.</param>
public BlogEntryCollection(IEnumerable<BlogEntry> items) public BlogEntryCollection(IEnumerable<BlogEntry> items)
{ {
if (items!=null) if (items!=null)
@ -73,6 +79,9 @@ namespace Yavsc.Model.Blogs
public DateTime Modified; public DateTime Modified;
} }
/// <summary>
/// Post info by user.
/// </summary>
public struct PostInfoByUser { public struct PostInfoByUser {
/// <summary> /// <summary>

View File

@ -20,6 +20,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
using System; using System;
using System.Collections.Generic;
namespace Yavsc.Model.Blogs namespace Yavsc.Model.Blogs
{ {
@ -34,7 +35,7 @@ namespace Yavsc.Model.Blogs
/// <param name="username">Username.</param> /// <param name="username">Username.</param>
/// <param name="items">Items.</param> /// <param name="items">Items.</param>
public UUBlogEntryCollection(string username, public UUBlogEntryCollection(string username,
BlogEntryCollection items = null) : base(items) { IEnumerable<BlogEntry> items = null) : base(items) {
_username = username; _username = username;
} }
private string _username; private string _username;
@ -43,7 +44,10 @@ namespace Yavsc.Model.Blogs
/// </summary> /// </summary>
/// <value>The name of the user.</value> /// <value>The name of the user.</value>
public string UserName { get { return _username; } } public string UserName { get { return _username; } }
/// <summary>
/// Returns a <see cref="System.String"/> that represents the current <see cref="Yavsc.Model.Blogs.UUBlogEntryCollection"/>.
/// </summary>
/// <returns>A <see cref="System.String"/> that represents the current <see cref="Yavsc.Model.Blogs.UUBlogEntryCollection"/>.</returns>
public override string ToString () public override string ToString ()
{ {
return string.Format ("[UUBlogEntryCollection: UserName={0} Count={1}]", UserName, Count); return string.Format ("[UUBlogEntryCollection: UserName={0} Count={1}]", UserName, Count);

View File

@ -34,7 +34,7 @@ namespace Yavsc.Model.Blogs
/// <param name="title">Title.</param> /// <param name="title">Title.</param>
/// <param name="items">Items.</param> /// <param name="items">Items.</param>
public UUTBlogEntryCollection(string username, string title, public UUTBlogEntryCollection(string username, string title,
IEnumerable<BlogEntry> items = null) : base(username) { IEnumerable<BlogEntry> items = null) : base(username,items) {
if (Count>0) { if (Count>0) {
if (!(ConcernsAUniqueTitle && ConcernsAUniqueTitle)) if (!(ConcernsAUniqueTitle && ConcernsAUniqueTitle))
throw new InvalidOperationException (); throw new InvalidOperationException ();

View File

@ -1,3 +1,11 @@
2015-08-05 Paul Schneider <paul@pschneider.fr>
* BlogEntryCollection.cs: adds xml doc
* UUBlogEntryCollection.cs:
* UUTBlogEntryCollection.cs: fixes a creation from a post
array
2015-08-05 Paul Schneider <paul@pschneider.fr> 2015-08-05 Paul Schneider <paul@pschneider.fr>
* BlogManager.cs: fixes the comment posting * BlogManager.cs: fixes the comment posting