* style.css:
* style.css:
* UsersInRole.aspx: refactoring

* HomeController.cs: Fixes the restricted area error page

* PostActions.ascx: html structure

* TagControl.ascx: Tags reside in a list here, treat it as an Html one

* RestrictedArea.aspx: Shows allowed users or/and roles in the error
  page

* Web.csproj: cleaning
This commit is contained in:
Paul Schneider 2015-11-18 00:30:07 +01:00
commit a62cff223c
10 changed files with 60 additions and 21 deletions

View file

@ -11,11 +11,10 @@
</h1>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<ul>
<ul class="editablelist userlist">
<%foreach (string username in (string[]) ViewData["UsersInRole"]){ %>
<li><%= username %></li>
<% } %>
</ul>
<%= Html.Partial("AddUserToRole") %>
</asp:Content>

View file

@ -10,15 +10,14 @@
<%= Html.Partial("TagControl",Model)%>
<% if (Model is BlogEntry) { %>
<i class="fa fa-pencil"><%=Html.Translate("DoComment")%></i>
<aside class="control" class="hidden">
<% using (Html.BeginForm("Comment","Blogs")) { %>
<filedset>
<%=Html.Hidden("Author")%>
<%=Html.Hidden("Title")%>
<%=Html.TextArea("CommentText","")%>
<%=Html.Hidden("PostId",Model.Id)%>
<input type="submit" value="Poster un commentaire"/>
<% } %>
</aside>
</filedset> <% } %>
<% } %>
<a href="<%= Url.RouteUrl("Default", new { action = "EditId", postid = Model.Id })%>" class="actionlink">
<i class="fa fa-pencil"><%=Html.Translate("Edit")%></i>

View file

@ -1,10 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BasePost>" %>
<p id="tags<%=Model.Id%>" data-postid="<%=Model.Id%>" class="fa fa-tag">
<ul id="tags<%=Model.Id%>" data-postid="<%=Model.Id%>" class="editablelist ">
<% if (Model.Tags != null) {
foreach ( var tagname in Model.Tags) { %>
<span class="tagname"><%=tagname%></span> <%
<li class="tagname fa fa-tag"><%=tagname%></li> <%
%><% } } %>
</p>
</ul>
<% if (Membership.GetUser()!=null) { %>
<% if (Membership.GetUser().UserName==Model.Author || Roles.IsUserInRole("Admin"))
{ // grant all permissions: to choose a given set of tags, also create some new tags %>

View file

@ -1,7 +1,11 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogEntryCollection>" MasterPageFile="~/Models/App.master"%>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
Ce contenu est d'accès restreint : &lt;<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>&gt;
Ce contenu est d'accès restreint :<br>
&lt;<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>&gt;<br>
Demandez à l'administrateur les autorisations suffisantes pour accèder à cet emplacement.
Ci après les tièrces parties autorisée actuellement :<br>
Roles autorisés :<%= Html.Encode(ViewData["Roles"]) %><br>
Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %><br>
</asp:Content>