refactoring
This commit is contained in:
14
web/Views/Admin/AddRole.aspx
Normal file
14
web/Views/Admin/AddRole.aspx
Normal file
@ -0,0 +1,14 @@
|
||||
<%@ Page Title="Ajout d'un role" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
<%= Html.ValidationSummary() %>
|
||||
<% using(Html.BeginForm("DoAddRole")) %>
|
||||
<% { %>
|
||||
Nom du rôle :
|
||||
<%= Html.TextBox( "RoleName" ) %>
|
||||
<%= Html.ValidationMessage("RoleName", "*") %><br/>
|
||||
<input class="actionlink" type="submit"/>
|
||||
<% } %>
|
||||
</asp:Content>
|
||||
|
||||
|
31
web/Views/Admin/Admin.aspx
Normal file
31
web/Views/Admin/Admin.aspx
Normal file
@ -0,0 +1,31 @@
|
||||
<%@ Page Title="Liste des administrateurs" Language="C#" Inherits="System.Web.Mvc.ViewPage<NewAdminModel>" MasterPageFile="~/Models/App.master" %>
|
||||
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
|
||||
<table>
|
||||
<% foreach (string u in (string[])ViewData["admins"]) { %>
|
||||
<tr><td>
|
||||
<%= u %> </td><td><%= Html.ActionLink("Remove","RemoveFromRole",new { username = u, rolename="Admin", returnUrl = Request.Url.PathAndQuery })%>
|
||||
</td></tr>
|
||||
|
||||
<% } %>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Ajout d'un administrateur
|
||||
</h2>
|
||||
<p><%= Html.ValidationSummary() %> </p>
|
||||
|
||||
<% using ( Html.BeginForm("Admin", "Admin") ) { %>
|
||||
|
||||
<%= Html.LabelFor(model => model.UserName) %> :
|
||||
<%= Html.DropDownListFor(model => model.UserName, (List<SelectListItem>)ViewData["useritems"] ) %>
|
||||
<%= Html.ValidationMessage("UserName", "*") %>
|
||||
|
||||
<input type="submit"/>
|
||||
<% } %>
|
||||
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
7
web/Views/Admin/BackupCreated.aspx
Normal file
7
web/Views/Admin/BackupCreated.aspx
Normal file
@ -0,0 +1,7 @@
|
||||
<%@ Page Title="Backup created" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<Export>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<div><h2>Error message </h2> <%= Html.Encode(Model.Error) %></div>
|
||||
<div><h2>Message </h2> <%= Html.Encode(Model.Message) %></div>
|
||||
<div><h2>File name</h2> <%= Html.Encode(Model.FileName) %></div>
|
||||
<div><h2>Exit Code</h2> <%= Html.Encode(Model.ExitCode) %></div>
|
||||
</asp:Content>
|
6
web/Views/Admin/Backups.aspx
Normal file
6
web/Views/Admin/Backups.aspx
Normal file
@ -0,0 +1,6 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
|
||||
<%=Html.ActionLink("Create a database backup", "CreateBackup")%><br/>
|
||||
<%=Html.ActionLink("Restaurations", "Restore")%><br/>
|
||||
</asp:Content>
|
23
web/Views/Admin/CreateBackup.aspx
Normal file
23
web/Views/Admin/CreateBackup.aspx
Normal file
@ -0,0 +1,23 @@
|
||||
<%@ Page Title="Backup creation" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ValidationSummary("CreateBackup") %>
|
||||
<% using (Html.BeginForm("CreateBackup")) { %>
|
||||
|
||||
<%= Html.LabelFor(model => model.Host) %>:
|
||||
<%= Html.TextBox( "Host" ) %>
|
||||
<%= Html.ValidationMessage("Host", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Port) %>:
|
||||
<%= Html.TextBox( "Port" ) %>
|
||||
<%= Html.ValidationMessage("Port", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Dbname) %>:
|
||||
<%= Html.TextBox( "Dbname" ) %>
|
||||
<%= Html.ValidationMessage("Dbname", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Dbuser) %>:
|
||||
<%= Html.TextBox( "Dbuser" ) %>
|
||||
<%= Html.ValidationMessage("Dbuser", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Password) %>:
|
||||
<%= Html.Password( "Password" ) %>
|
||||
<%= Html.ValidationMessage("Password", "*") %><br/>
|
||||
<input type="submit"/>
|
||||
<% } %>
|
||||
</asp:Content>
|
4
web/Views/Admin/Index.aspx
Normal file
4
web/Views/Admin/Index.aspx
Normal file
@ -0,0 +1,4 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ActionLink("Backups","Backups") %>
|
||||
</asp:Content>
|
17
web/Views/Admin/RemoveRoleQuery.aspx
Normal file
17
web/Views/Admin/RemoveRoleQuery.aspx
Normal file
@ -0,0 +1,17 @@
|
||||
<%@ Page Title="User removal" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
<%= Html.ValidationSummary() %>
|
||||
<% using ( Html.BeginForm("RemoveRole") ) { %>
|
||||
Supprimer le rôle
|
||||
<%= Html.Encode( ViewData["roletoremove"] ) %> ?
|
||||
<br/>
|
||||
<input type="hidden" name="rolename" value="<%=ViewData["roletoremove"]%>"/>
|
||||
<input class="actionlink" type="submit" name="submitbutton" value="Supprimer"/>
|
||||
<input class="actionlink" type="submit" name="submitbutton" value="Annuler" />
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
22
web/Views/Admin/RemoveUserQuery.aspx
Normal file
22
web/Views/Admin/RemoveUserQuery.aspx
Normal file
@ -0,0 +1,22 @@
|
||||
<%@ Page Title="User removal" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="header" ID="headerContent" runat="server">
|
||||
<h2>Suppression d'un utilisateur</h2>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
<div>
|
||||
<%= Html.ValidationSummary() %>
|
||||
<% using ( Html.BeginForm("RemoveUser") ) { %>
|
||||
Supprimer l'utilisateur
|
||||
<%= Html.Encode( ViewData["usertoremove"] ) %> ?
|
||||
<br/>
|
||||
<input type="hidden" name="username" value="<%=ViewData["usertoremove"]%>"/>
|
||||
<input class="actionlink" type="submit" name="submitbutton" value="Supprimer"/>
|
||||
<input class="actionlink" type="submit" name="submitbutton" value="Annuler" />
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
37
web/Views/Admin/Restore.aspx
Normal file
37
web/Views/Admin/Restore.aspx
Normal file
@ -0,0 +1,37 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ValidationSummary("Restore a database backup") %>
|
||||
<% using (Html.BeginForm("Restore")) { %>
|
||||
|
||||
<% string [] bckdirs = Model.GetBackupDirs(); %>
|
||||
<select name="backupName">
|
||||
<% foreach (string s in bckdirs)
|
||||
{
|
||||
%>
|
||||
<option value="<%=s%>"><%=s%></option>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</select>
|
||||
<label for="dataOnly">Data only :</label>
|
||||
<%= Html.CheckBox("dataOnly")%>
|
||||
|
||||
<%= Html.LabelFor(model => model.Host) %>:
|
||||
<%= Html.TextBox( "Host" ) %>
|
||||
<%= Html.ValidationMessage("Host", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Port) %>:
|
||||
<%= Html.TextBox( "Port" ) %>
|
||||
<%= Html.ValidationMessage("Port", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Dbname) %>:
|
||||
<%= Html.TextBox( "Dbname" ) %>
|
||||
<%= Html.ValidationMessage("Dbname", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Dbuser) %>:
|
||||
<%= Html.TextBox( "Dbuser" ) %>
|
||||
<%= Html.ValidationMessage("Dbuser", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Password) %>:
|
||||
<%= Html.Password( "Password" ) %>
|
||||
<%= Html.ValidationMessage("Password", "*") %><br/>
|
||||
|
||||
<input type="submit"/>
|
||||
<% } %>
|
||||
</asp:Content>
|
8
web/Views/Admin/Restored.aspx
Normal file
8
web/Views/Admin/Restored.aspx
Normal file
@ -0,0 +1,8 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<TaskOutput>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h1><%=Html.Encode(ViewData["BackupName"])%> Restauration</h1>
|
||||
<div><h2>Error message </h2> <%= Html.Encode(Model.Error) %></div>
|
||||
<div><h2>Message </h2> <%= Html.Encode(Model.Message) %></div>
|
||||
<div><h2>Exit Code</h2> <%= Html.Encode(Model.ExitCode) %></div>
|
||||
|
||||
</asp:Content>
|
18
web/Views/Admin/RoleList.aspx
Normal file
18
web/Views/Admin/RoleList.aspx
Normal file
@ -0,0 +1,18 @@
|
||||
<%@ Page Title="Liste des rôles" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
Roles:
|
||||
<ul>
|
||||
<%foreach (string rolename in (string[]) Model){ %>
|
||||
|
||||
<li><%=rolename%> <% if (Roles.IsUserInRole("Admin")) { %>
|
||||
<%= Html.ActionLink("Supprimer","RemoveRole", new { rolename = rolename }, new { @class="actionlink" } ) %>
|
||||
<% } %></li>
|
||||
<% } %>
|
||||
|
||||
</ul>
|
||||
<% if (Roles.IsUserInRole("Admin")) { %>
|
||||
<%= Html.ActionLink("Ajouter un rôle","AddRole", null, new { @class="actionlink" } ) %>
|
||||
<% } %>
|
||||
</asp:Content>
|
||||
|
||||
|
17
web/Views/Admin/UserList.aspx
Normal file
17
web/Views/Admin/UserList.aspx
Normal file
@ -0,0 +1,17 @@
|
||||
<%@ Page Title="User List" Language="C#" Inherits="System.Web.Mvc.ViewPage<System.Web.Security.MembershipUserCollection>" MasterPageFile="~/Models/App.master" %>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||
|
||||
<ul>
|
||||
<%foreach (MembershipUser user in Model){ %>
|
||||
|
||||
<li><%=user.UserName%> <%=user.Email%> <%=(!user.IsApproved)?"(Not Approuved)":""%> <%=user.IsOnline?"Online":"Offline"%>
|
||||
<% if (Roles.IsUserInRole("Admin")) { %>
|
||||
<%= Html.ActionLink("Supprimer","RemoveUserQuery", new { username = user.UserName }, new { @class="actionlink" } ) %>
|
||||
<% } %>
|
||||
</li>
|
||||
|
||||
<% }%>
|
||||
</ul>
|
||||
|
||||
</asp:Content>
|
||||
|
Reference in New Issue
Block a user