UI cleanup pass (progress - Orchard.Roles and Orchard.Media)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045138
This commit is contained in:
skewed
2010-01-08 08:38:07 +00:00
parent aa3082a69e
commit ea4e400809
14 changed files with 182 additions and 177 deletions

View File

@@ -54,10 +54,10 @@ namespace Orchard.Media.Controllers {
} }
[AcceptVerbs(HttpVerbs.Post)] [AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(FormCollection input) { public ActionResult Create() {
var viewModel = new MediaFolderCreateViewModel(); var viewModel = new MediaFolderCreateViewModel();
try { try {
UpdateModel(viewModel, input.ToValueProvider()); UpdateModel(viewModel);
if (!_authorizer.Authorize(Permissions.CreateMediaFolder, T("Couldn't create media folder"))) if (!_authorizer.Authorize(Permissions.CreateMediaFolder, T("Couldn't create media folder")))
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_mediaService.CreateFolder(viewModel.MediaPath, viewModel.Name); _mediaService.CreateFolder(viewModel.MediaPath, viewModel.Name);
@@ -109,10 +109,10 @@ namespace Orchard.Media.Controllers {
} }
[AcceptVerbs(HttpVerbs.Post)] [AcceptVerbs(HttpVerbs.Post)]
public ActionResult EditProperties(FormCollection input) { public ActionResult EditProperties() {
var viewModel = new MediaFolderEditPropertiesViewModel(); var viewModel = new MediaFolderEditPropertiesViewModel();
try { try {
UpdateModel(viewModel, input.ToValueProvider()); UpdateModel(viewModel);
//TODO: There may be better ways to do this. //TODO: There may be better ways to do this.
// Delete // Delete
if (!String.IsNullOrEmpty(HttpContext.Request.Form["submit.Delete"])) { if (!String.IsNullOrEmpty(HttpContext.Request.Form["submit.Delete"])) {
@@ -141,10 +141,10 @@ namespace Orchard.Media.Controllers {
} }
[AcceptVerbs(HttpVerbs.Post)] [AcceptVerbs(HttpVerbs.Post)]
public ActionResult Add(FormCollection input) { public ActionResult Add() {
var viewModel = new MediaItemAddViewModel(); var viewModel = new MediaItemAddViewModel();
try { try {
UpdateModel(viewModel, input.ToValueProvider()); UpdateModel(viewModel);
if (!_authorizer.Authorize(Permissions.UploadMedia, T("Couldn't upload media file"))) if (!_authorizer.Authorize(Permissions.UploadMedia, T("Couldn't upload media file")))
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
@@ -176,7 +176,7 @@ namespace Orchard.Media.Controllers {
public ActionResult EditMedia(FormCollection input) { public ActionResult EditMedia(FormCollection input) {
var viewModel = new MediaItemEditViewModel(); var viewModel = new MediaItemEditViewModel();
try { try {
UpdateModel(viewModel, input.ToValueProvider()); UpdateModel(viewModel);
if (!_authorizer.Authorize(Permissions.ModifyMedia, T("Couldn't modify media file"))) if (!_authorizer.Authorize(Permissions.ModifyMedia, T("Couldn't modify media file")))
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
// Delete // Delete

View File

@@ -1,25 +1,26 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MediaItemAddViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaItemAddViewModel>" %>
<%@ Import Namespace="Orchard.Media.Helpers"%> <%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.Models"%> <%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%> <%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Add Media")%></h2> <h1><%=Html.TitleForPage(T("Add Media").ToString()) %></h1>
<p> <p><%=Html.ActionLink(T("Media Folders").ToString(), "Index") %> &#62;
<%=Html.ActionLink("Media Folders", "Index")%> &#62; <%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) { %>
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<%=Html.ActionLink(navigation.FolderName, "Edit", <%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62; new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62;
<% } %> <% } %>
Add Media</p> <%=_Encoded("Add Media") %></p>
<% using (Html.BeginForm("Add", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {%> <% using (Html.BeginForm("Add", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) { %>
<%= Html.ValidationSummary() %> <%= Html.ValidationSummary() %>
<fieldset> <fieldset>
<label for="pageTitle">File Path - Multiple files must be in a zipped folder:</label> <label for="pageTitle"><%=T("File Path <span> - multiple files must be in a zipped folder</span>")%></label>
<input id="FolderName" name="FolderName" type="hidden" value="<%= Model.FolderName %>" /> <input id="MediaItemPath" name="MediaItemPath" type="file" class="text" value="<%=_Encoded("Browse") %>" size="64"/>
<input id="MediaPath" name="MediaPath" type="hidden" value="<%= Model.MediaPath %>" /> <span class="hint"><%=_Encoded("After your files have been uploaded, you can edit the titles and descriptions.")%></span>
<input id="MediaItemPath" name="MediaItemPath" type="file" class="text" value="Browse" size="64"/> <input type="hidden" id="FolderName" name="FolderName" value="<%=Html.Encode(Model.FolderName) %>" />
<input type="submit" class="button" value="Upload" /><br /> <input type="hidden" id="MediaPath" name="MediaPath" value="<%=Html.Encode(Model.MediaPath) %>" />
<span>After your files have been uploaded, you can edit the titles and descriptions.</span> </fieldset>
<fieldset>
<input type="submit" class="button" value="<%=_Encoded("Upload") %>" />
<%=Html.AntiForgeryTokenOrchard() %> <%=Html.AntiForgeryTokenOrchard() %>
</fieldset> </fieldset>
<% } %> <% } %>

View File

@@ -1,20 +1,20 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MediaFolderCreateViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderCreateViewModel>" %>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.Helpers"%> <%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%> <%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Add a Folder")%></h2> <h1><%=Html.TitleForPage(T("Add a Folder").ToString()) %></h1>
<p><%=Html.ActionLink("Media Folders", "Index")%> &#62; <p><%=Html.ActionLink(T("Media Folders").ToString(), "Index") %> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%> <%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) { %>
<%=Html.ActionLink(navigation.FolderName, "Edit", <%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62; new {name = navigation.FolderName, mediaPath = navigation.FolderPath}) %> &#62;
<% } %> <% } %>
Add a Folder</p> <%=_Encoded("Add a Folder") %></p>
<%using (Html.BeginFormAntiForgeryPost()) { %> <%using (Html.BeginFormAntiForgeryPost()) { %>
<%= Html.ValidationSummary() %> <%= Html.ValidationSummary() %>
<fieldset> <fieldset>
<label for="Name">Folder Name:</label> <label for="Name"><%=_Encoded("Folder Name") %></label>
<input id="Name" class="text" name="Name" type="text" /> <input id="Name" class="text" name="Name" type="text" />
<input id="MediaPath" name="MediaPath" type="hidden" value="<%= Model.MediaPath %>" /> <input type="hidden" id="MediaPath" name="MediaPath" value="<%=Html.Encode(Model.MediaPath) %>" />
<input type="submit" class="button" value="Save" /> <input type="submit" class="button" value="<%=_Encoded("Save") %>" />
</fieldset> </fieldset>
<% } %> <% } %>

View File

@@ -1,30 +1,30 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MediaFolderEditViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderEditViewModel>" %>
<%@ Import Namespace="Orchard.Media.Models"%> <%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.Helpers"%> <%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%> <%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Manage Folder")%></h2> <h1><%=Html.TitleForPage(T("Manage Folder").ToString())%></h1>
<div class="manage"><%=Html.ActionLink("Folder Properties", "EditProperties", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button"})%></div> <div class="manage"><%=Html.ActionLink(T("Folder Properties").ToString(), "EditProperties", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button"})%></div>
<p><%=Html.ActionLink("Media Folders", "Index")%> &#62; <p><%=Html.ActionLink(T("Media Folders").ToString(), "Index")%> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%> <%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<%=Html.ActionLink(navigation.FolderName, "Edit", <%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62; new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62;
<% } %> <% } %>
Manage Folder</p> <%=_Encoded("Manage Folder")%></p>
<% using(Html.BeginFormAntiForgeryPost()) { %> <% using(Html.BeginFormAntiForgeryPost()) { %>
<fieldset class="actions bulk"> <fieldset class="actions bulk">
<label for="publishActions">Actions: </label> <label for="publishActions"><%=_Encoded("Actions:")%></label>
<select id="Select1" name="publishActions"> <select id="Select1" name="publishActions">
<option value="1">Delete</option> <option value="1"><%=_Encoded("Delete")%></option>
</select> </select>
<input class="button roundCorners" type="submit" value="Apply" /> <input class="button roundCorners" type="submit" value="<%=_Encoded("Apply") %>" />
</fieldset> </fieldset>
<div class="manage"> <div class="manage">
<%=Html.ActionLink("Add media", "Add", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button" })%> <%=Html.ActionLink(T("Add media").ToString(), "Add", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button" })%>
<%=Html.ActionLink("Add a folder", "Create", new { Model.MediaPath }, new { @class = "button" })%> <%=Html.ActionLink(T("Add a folder").ToString(), "Create", new { Model.MediaPath }, new { @class = "button" })%>
</div> </div>
<fieldset> <fieldset>
<table class="items" summary="This is a table of the pages currently available for use in your application."> <table class="items" summary="<%=_Encoded("This is a table of the pages currently available for use in your application.") %>">
<colgroup> <colgroup>
<col id="Col1" /> <col id="Col1" />
<col id="Col2" /> <col id="Col2" />
@@ -36,19 +36,19 @@
<thead> <thead>
<tr> <tr>
<th scope="col">&nbsp;&darr;<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th> <th scope="col">&nbsp;&darr;<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th>
<th scope="col">Name</th> <th scope="col"><%=_Encoded("Name") %></th>
<th scope="col">Author</th> <th scope="col"><%=_Encoded("Author") %></th>
<th scope="col">Last Updated</th> <th scope="col"><%=_Encoded("Last Updated") %></th>
<th scope="col">Type</th> <th scope="col"><%=_Encoded("Type") %></th>
<th scope="col">Size</th> <th scope="col"><%=_Encoded("Size") %></th>
</tr> </tr>
</thead> </thead>
<%foreach (var mediaFile in Model.MediaFiles) { <%foreach (var mediaFile in Model.MediaFiles) {
%> %>
<tr> <tr>
<td> <td>
<input type="checkbox" value="true" name="<%= "Checkbox.File." + mediaFile.Name %>"/> <input type="checkbox" value="true" name="<%=_Encoded("Checkbox.File.{0}", mediaFile.Name) %>"/>
<input type="hidden" value="<%= Model.MediaPath %>" name="<%= mediaFile.Name %>" /> <input type="hidden" value="<%=_Encoded("Model.MediaPath") %>" name="<%=_Encoded("mediaFile.Name") %>" />
</td> </td>
<td> <td>
<%=Html.ActionLink(mediaFile.Name, "EditMedia", new { name = mediaFile.Name, <%=Html.ActionLink(mediaFile.Name, "EditMedia", new { name = mediaFile.Name,
@@ -57,34 +57,33 @@
folderName = mediaFile.FolderName, folderName = mediaFile.FolderName,
mediaPath = Model.MediaPath })%> mediaPath = Model.MediaPath })%>
</td> </td>
<td>Orchard User</td> <td><%=_Encoded("Orchard User")%></td>
<td><%= mediaFile.LastUpdated %></td> <td><%=mediaFile.LastUpdated %></td>
<td><%= mediaFile.Type %></td> <td><%=Html.Encode(mediaFile.Type) %></td>
<td><%= mediaFile.Size %></td> <td><%=mediaFile.Size %></td>
</tr> </tr>
<%}%> <%}%>
<%foreach (var mediaFolder in Model.MediaFolders) { <%foreach (var mediaFolder in Model.MediaFolders) {
%> %>
<tr> <tr>
<td> <td>
<input type="checkbox" value="true" name="<%= "Checkbox.Folder." + mediaFolder.Name %>"/> <input type="checkbox" value="true" name="<%=_Encoded("Checkbox.Folder.{0}", mediaFolder.Name) %>"/>
<input type="hidden" value="<%= mediaFolder.MediaPath %>" name="<%= mediaFolder.Name %>" /> <input type="hidden" value="<%=Html.Encode(mediaFolder.MediaPath) %>" name="<%=Html.Encode(mediaFolder.Name) %>" />
</td> </td>
<td> <td>
<img src="<%=ResolveUrl("~/Packages/Orchard.Media/Content/Admin/images/folder.gif")%>" height="16px" width="16px" class="mediaTypeIcon" alt="Folder" /> <img src="<%=ResolveUrl("~/Packages/Orchard.Media/Content/Admin/images/folder.gif")%>" height="16" width="16" class="mediaTypeIcon" alt="<%=_Encoded("Folder") %>" />
<%=Html.ActionLink(mediaFolder.Name, "Edit", new { name = mediaFolder.Name, <%=Html.ActionLink(mediaFolder.Name, "Edit", new { name = mediaFolder.Name, mediaPath = mediaFolder.MediaPath})%>
mediaPath = mediaFolder.MediaPath})%>
</td> </td>
<td>Orchard User</td> <td><%=_Encoded("Orchard User")%></td>
<td><%= mediaFolder.LastUpdated %></td> <td><%=mediaFolder.LastUpdated %></td>
<td>Folder</td> <td><%=_Encoded("Folder")%></td>
<td><%= mediaFolder.Size %></td> <td><%=mediaFolder.Size %></td>
</tr> </tr>
<%}%> <%}%>
</table> </table>
</fieldset> </fieldset>
<div class="manage"> <div class="manage">
<%=Html.ActionLink("Add media", "Add", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button" })%> <%=Html.ActionLink(T("Add media").ToString(), "Add", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button" })%>
<%=Html.ActionLink("Add a folder", "Create", new { Model.MediaPath }, new { @class = "button" })%> <%=Html.ActionLink(T("Add a folder").ToString(), "Create", new { Model.MediaPath }, new { @class = "button" })%>
</div> </div>
<% } %> <% } %>

View File

@@ -1,49 +1,52 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MediaItemEditViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaItemEditViewModel>" %>
<%@ Import Namespace="Orchard.Media.Models"%> <%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.Helpers"%> <%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%> <%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Edit Media - {0}", Model.Name)%></h2> <h1><%=Html.TitleForPage(T("Edit Media - {0}", Model.Name).ToString())%></h1>
<p> <p><%=Html.ActionLink(T("Media Folders").ToString(), "Index")%> &#62;
<%=Html.ActionLink("Media Folders", "Index")%> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%> <%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<%=Html.ActionLink(navigation.FolderName, "Edit", <%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62; new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62;
<% } %> <% } %>
Edit Media </p> <%=_Encoded("Edit Media")%></p>
<div class="sections"> <div class="sections">
<%using (Html.BeginFormAntiForgeryPost()) { %> <%using (Html.BeginFormAntiForgeryPost()) { %>
<%= Html.ValidationSummary() %> <%= Html.ValidationSummary() %>
<div class="primary"> <div class="primary">
<h3>About this media</h3> <h2><%=_Encoded("About this media")%></h2>
<fieldset> <fieldset>
<label for="Name">Name:</label> <div>
<input id="Name" name="Name" type="hidden" value="<%= Model.Name %>"/> <label for="Name"><%=_Encoded("Name")%></label>
<input id="NewName" class="text" name="NewName" type="text" value="<%= Model.Name %>"/> <input id="Name" name="Name" type="hidden" value="<%=Html.Encode(Model.Name) %>"/>
<label for="Caption">Caption:</label> <input id="NewName" class="text" name="NewName" type="text" value="<%=Html.Encode(Model.Name) %>"/>
<input id="Caption" class="text" name="Caption" type="text" value="<%= Model.Caption %>"/> </div>
<input id="LastUpdated" name="LastUpdated" type="hidden" value="<%= Model.LastUpdated %>"/> <div>
<input id="Size" name="Size" type="hidden" value="<%= Model.Size %>"/> <label for="Caption"><%=_Encoded("Caption")%></label>
<input id="FolderName" name="FolderName" type="hidden" value="<%= Model.FolderName %>"/> <input id="Caption" class="text" name="Caption" type="text" value="<%= Model.Caption %>"/>
<input id="MediaPath" name="MediaPath" type="hidden" value="<%= Model.MediaPath %>" /> <span class="hint"><%=_Encoded("This will be used for the image alt tag.")%></span>
<span>This will be used for the image alt tag.</span> <input type="hidden" id="LastUpdated" name="LastUpdated" value="<%= Model.LastUpdated %>"/>
<input type="hidden" id="Size" name="Size" value="<%= Model.Size %>"/>
<input type="hidden" id="FolderName" name="FolderName" value="<%= Model.FolderName %>"/>
<input type="hidden" id="MediaPath" name="MediaPath" value="<%= Model.MediaPath %>" />
</div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<input type="submit" class="button" name="submit.Save" value="Save" /> <input type="submit" class="button" name="submit.Save" value="<%=_Encoded("Save") %>" />
<%--<input type="submit" class="button" name="submit.Delete" value="Delete" />--%> <%--<input type="submit" class="button" name="submit.Delete" value="<%=_Encoded("Delete") %>" />--%>
</fieldset> </fieldset>
</div> </div>
<div class="secondary"> <div class="secondary">
<h3>Preview</h3> <h2><%=_Encoded("Preview")%></h2>
<div><img src="<%=ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name)%>" class="previewImage" alt="<%= Model.Caption %>" /></div> <div><img src="<%=ResolveUrl("~/Media/" + Html.Encode(Model.RelativePath + "/" + Model.Name))%>" class="previewImage" alt="<%=Html.Encode(Model.Caption) %>" /></div>
<ul> <ul>
<li><strong>Dimensions:</strong> 500 x 375 pixels</li> <%-- todo: make these real (including markup) --%>
<li><strong>Size:</strong> <%= Model.Size %></li> <li><label><%=T("Dimensions: <span>500 x 375 pixels</span>")%></label></li>
<li><strong>Added on:</strong> <%= Model.LastUpdated %> by Orchard User</li> <li><label><%=T("Size: <span>{0}</span>", Model.Size)%></label></li>
<li><label><%=T("Added on: <span>{0} by Orchard User</span>", Model.LastUpdated)%></label></li>
<li> <li>
<label for="embedPath">Embed:</label> <label for="embedPath"><%=_Encoded("Embed:")%></label>
<input id="embedPath" class="inputText" name="embedPath" type="text" readonly="readonly" value="&lt;img src=&quot;<%=ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name)%>&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;<%= Model.Caption %>&quot; /&gt;" /> <input id="embedPath" class="text" name="embedPath" type="text" readonly="readonly" value="<%=_Encoded("<img src=\"{0}\" width=\"{1}\" height=\"{2}\" alt=\"{3}\" />", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375, Model.Caption) %>" />
<p class="helperText">Copy this html to add this image to your site.</p> <span class="hint"><%=_Encoded("Copy this html to add this image to your site.") %></p>
</li> </li>
</ul> </ul>
</div> </div>

View File

@@ -1,22 +1,22 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MediaFolderEditPropertiesViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderEditPropertiesViewModel>" %>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.Helpers"%> <%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%> <%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Folder Properties")%></h2> <h1><%=Html.TitleForPage(T("Folder Properties").ToString())%></h1>
<p><%=Html.ActionLink("Media Folders", "Index")%> &#62; <p><%=Html.ActionLink(T("Media Folders").ToString(), "Index")%> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%> <%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<%=Html.ActionLink(navigation.FolderName, "Edit", <%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62; new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62;
<% } %> <% } %>
Folder Properties</p> <%=_Encoded("Folder Properties")%></p>
<% using (Html.BeginFormAntiForgeryPost()) { %> <% using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %> <%=Html.ValidationSummary() %>
<fieldset> <fieldset>
<label for="Name">Folder Name:</label> <label for="Name"><%=_Encoded("Folder Name:") %></label>
<input id="MediaPath" name="MediaPath" type="hidden" value="<%=Model.MediaPath %>" /> <input id="MediaPath" name="MediaPath" type="hidden" value="<%=Html.Encode(Model.MediaPath) %>" />
<input id="Name" class="text" name="Name" type="text" value="<%= Model.Name %>" /> <input id="Name" class="text" name="Name" type="text" value="<%=Html.Encode(Model.Name) %>" />
<input type="submit" class="button buttonFocus roundCorners" name="submit.Save" value="Save" /> <input type="submit" class="button" name="submit.Save" value="<%=_Encoded("Save") %>" />
<%--<input type="submit" class="button buttonFocus roundCorners" name="submit.Delete" value="Delete" />--%> <%--<input type="submit" class="button buttonFocus roundCorners" name="submit.Delete" value="<%=_Encoded("Delete") %>" />--%>
</fieldset> </fieldset>
<% } %> <% } %>

View File

@@ -1,19 +1,18 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MediaFolderIndexViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderIndexViewModel>" %>
<%@ Import Namespace="Orchard.Media.ViewModels"%> <%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Manage Media Folders")%></h2> <h1><%=Html.TitleForPage(T("Manage Media Folders").ToString()) %></h1>
<p><%=Html.ActionLink("Media Folders", "Index")%> &#62; Manage Media Folders</p>
<% using(Html.BeginFormAntiForgeryPost()) { %> <% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %> <%=Html.ValidationSummary() %>
<fieldset class="actions bulk"> <fieldset class="actions bulk">
<label for="publishActions">Actions: </label> <label for="publishActions"><%=_Encoded("Actions:") %></label>
<select id="Select1" name="publishActions"> <select id="Select1" name="publishActions">
<option value="1">Delete</option> <option value="1"><%=_Encoded("Delete")%></option>
</select> </select>
<input class="button roundCorners" type="submit" value="Apply" /> <input class="button roundCorners" type="submit" value="<%=_Encoded("Apply") %>" />
</fieldset> </fieldset>
<div class="manage"><%=Html.ActionLink("Add a folder", "Create", new {}, new { @class = "button"}) %></div> <div class="manage"><%=Html.ActionLink(T("Add a folder").ToString(), "Create", new {}, new { @class = "button"}) %></div>
<fieldset> <fieldset>
<table class="items" summary="This is a table of the media folders currently available for use in your application."> <table class="items" summary="<%=_Encoded("This is a table of the media folders currently available for use in your application.") %>">
<colgroup> <colgroup>
<col id="Col1" /> <col id="Col1" />
<col id="Col2" /> <col id="Col2" />
@@ -25,27 +24,29 @@
<thead> <thead>
<tr> <tr>
<th scope="col">&nbsp;&darr;<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th> <th scope="col">&nbsp;&darr;<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th>
<th scope="col">Name</th> <th scope="col"><%=_Encoded("Name")%></th>
<th scope="col">Author</th> <th scope="col"><%=_Encoded("Author") %></th>
<th scope="col">Last Updated</th> <th scope="col"><%=_Encoded("Last Updated") %></th>
<th scope="col">Type</th> <th scope="col"><%=_Encoded("Type") %></th>
<th scope="col">Size</th> <th scope="col"><%=_Encoded("Size") %></th>
</tr> </tr>
</thead> </thead>
<%foreach (var mediaFolder in Model.MediaFolders) { <%foreach (var mediaFolder in Model.MediaFolders) {
%> %>
<tr> <tr>
<td><input type="checkbox" value="true" name="<%= "Checkbox." + mediaFolder.Name %>"/></td> <td><input type="checkbox" value="true" name="<%=_Encoded("Checkbox.{0}", mediaFolder.Name) %>"/></td>
<td><img src="<%=ResolveUrl("~/Packages/Orchard.Media/Content/Admin/images/folder.gif")%>" height="16px" width="16px" class="mediaTypeIcon" alt="Folder" /> <%-- todo: (heskew) this URL needs to be determined from current package location --%>
<td>
<img src="<%=ResolveUrl("~/Packages/Orchard.Media/Content/Admin/images/folder.gif")%>" height="16" width="16" class="mediaTypeIcon" alt="<%=_Encoded("Folder") %>" />
<%=Html.ActionLink(mediaFolder.Name, "Edit", new { name = mediaFolder.Name, mediaPath = mediaFolder.MediaPath })%> <%=Html.ActionLink(mediaFolder.Name, "Edit", new { name = mediaFolder.Name, mediaPath = mediaFolder.MediaPath })%>
</td> </td>
<td>Orchard User</td> <td><%=_Encoded("Orchard User")%></td>
<td><%=mediaFolder.LastUpdated %></td> <td><%=mediaFolder.LastUpdated %></td>
<td>Folder</td> <td><%=_Encoded("Folder")%></td>
<td><%=mediaFolder.Size %></td> <td><%=mediaFolder.Size %></td>
</tr> </tr>
<%}%> <%}%>
</table> </table>
</fieldset> </fieldset>
<div class="manage"><%=Html.ActionLink("Add a folder", "Create", new {}, new { @class = "button"}) %></div> <div class="manage"><%=Html.ActionLink(T("Add a folder").ToString(), "Create", new {}, new { @class = "button"}) %></div>
<% } %> <% } %>

View File

@@ -1,10 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MediaSettingsRecord>" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<MediaSettingsRecord>" %>
<%@ Import Namespace="Orchard.Media.Models"%> <%@ Import Namespace="Orchard.Media.Models"%>
<h3>Media</h3> <fieldset>
<ol> <legend><%=_Encoded("Media")%></legend>
<li> <div>
<%= Html.LabelFor(x=>x.RootMediaFolder) %> <label for="MediaSettings_RootMediaFolder">Media folder</label>
<%= Html.EditorFor(x=>x.RootMediaFolder) %> <%=Html.EditorFor(x=>x.RootMediaFolder) %>
<%= Html.ValidationMessage("RootMediaFolder", "*")%> <%=Html.ValidationMessage("RootMediaFolder", "*")%>
</li> </div>
</ol> </fieldset>

View File

@@ -1,18 +1,18 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<RoleCreateViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<RoleCreateViewModel>" %>
<%@ Import Namespace="Orchard.Roles.ViewModels"%> <%@ Import Namespace="Orchard.Roles.ViewModels"%>
<h2><%=Html.TitleForPage("Add Role")%></h2> <h1><%=Html.TitleForPage(T("Add Role").ToString()) %></h1>
<% using (Html.BeginFormAntiForgeryPost()) { %> <% using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary()%> <%=Html.ValidationSummary()%>
<fieldset> <fieldset>
<legend>Information</legend> <legend><%=_Encoded("Information") %></legend>
<label for="pageTitle">Role Name:</label> <label for="pageTitle"><%=_Encoded("Role Name:") %></label>
<input id="Name" class="inputText inputTextLarge" name="Name" type="text" value="<%= Model.Name %>" /> <input id="Name" class="text" name="Name" type="text" value="<%=Html.Encode(Model.Name) %>" />
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>Permissions</legend> <legend><%=_Encoded("Permissions") %></legend>
<% foreach (var packageName in Model.PackagePermissions.Keys) { %> <% foreach (var packageName in Model.PackagePermissions.Keys) { %>
<fieldset> <fieldset>
<legend><%=packageName%> Module</legend> <legend><%=_Encoded("{0} Module", packageName) %></legend>
<table class="items"> <table class="items">
<colgroup> <colgroup>
<col id="Permission" /> <col id="Permission" />
@@ -20,14 +20,14 @@
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th scope="col">Permission</th> <th scope="col"><%=_Encoded("Permission") %></th>
<th scope="col">Allow</th> <th scope="col"><%=_Encoded("Allow") %></th>
</tr> </tr>
</thead> </thead>
<% foreach (var permission in Model.PackagePermissions[packageName]) {%> <% foreach (var permission in Model.PackagePermissions[packageName]) { %>
<tr> <tr>
<td><%=permission.Description%></td> <td><%=Html.Encode(permission.Description) %></td>
<td style="width:60px;/* todo: (heskew) make not inline :("><input type="checkbox" value="true" name="<%="Checkbox." + permission.Name%>"/></td> <td style="width:60px;/* todo: (heskew) make not inline :( */"><input type="checkbox" value="true" name="<%=_Encoded("Checkbox.{0}", permission.Name) %>"/></td>
</tr> </tr>
<% } %> <% } %>
</table> </table>
@@ -35,6 +35,6 @@
<% } %> <% } %>
</fieldset> </fieldset>
<fieldset> <fieldset>
<input type="submit" class="button" value="Save" /> <input type="submit" class="button" value="<%=_Encoded("Save") %>" />
</fieldset> </fieldset>
<% } %> <% } %>

View File

@@ -1,19 +1,19 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<RoleEditViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<RoleEditViewModel>" %>
<%@ Import Namespace="Orchard.Roles.ViewModels"%> <%@ Import Namespace="Orchard.Roles.ViewModels"%>
<h2><%=Html.TitleForPage("Edit Role")%></h2> <h1><%=Html.TitleForPage(T("Edit Role").ToString()) %></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %> <% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %> <%=Html.ValidationSummary() %>
<fieldset> <fieldset>
<legend>Information</legend> <legend><%=_Encoded("Information") %></legend>
<label for="pageTitle">Role Name:</label> <label for="pageTitle"><%=_Encoded("Role Name:") %></label>
<input id="Name" class="inputText inputTextLarge" name="Name" type="text" value="<%=Model.Name %>"/> <input id="Name" class="text" name="Name" type="text" value="<%=Html.Encode(Model.Name) %>" />
<input type="hidden" value="<%= Model.Id %>" name="Id" /> <input type="hidden" value="<%=Model.Id %>" name="Id" />
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>Permissions</legend> <legend><%=_Encoded("Permissions") %></legend>
<% foreach (var packageName in Model.PackagePermissions.Keys) { %> <% foreach (var packageName in Model.PackagePermissions.Keys) { %>
<fieldset> <fieldset>
<legend><%=packageName%> Module</legend> <legend><%=_Encoded("{0} Module", packageName) %></legend>
<table class="items"> <table class="items">
<colgroup> <colgroup>
<col id="Col1" /> <col id="Col1" />
@@ -21,18 +21,18 @@
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th scope="col">Permission</th> <th scope="col"><%=_Encoded("Permission") %></th>
<th scope="col">Allow</th> <th scope="col"><%=_Encoded("Allow") %></th>
</tr> </tr>
</thead> </thead>
<% foreach (var permission in Model.PackagePermissions[packageName]) {%> <% foreach (var permission in Model.PackagePermissions[packageName]) { %>
<tr> <tr>
<td><%=permission.Description%></td> <td><%=Html.Encode(permission.Description) %></td>
<td style="width:60px;/* todo: (heskew) make not inline :("> <td style="width:60px;/* todo: (heskew) make not inline :(">
<% if (Model.CurrentPermissions.Contains(permission.Name)) {%> <% if (Model.CurrentPermissions.Contains(permission.Name)) { %>
<input type="checkbox" value="true" name="<%="Checkbox." + permission.Name%>" checked="checked"/> <input type="checkbox" value="true" name="<%=_Encoded("Checkbox.{0}", permission.Name) %>" checked="checked"/>
<% } else {%> <% } else {%>
<input type="checkbox" value="true" name="<%="Checkbox." + permission.Name%>"/> <input type="checkbox" value="true" name="<%=_Encoded("Checkbox.{0}", permission.Name) %>"/>
<% }%> <% }%>
</td> </td>
</tr> </tr>
@@ -42,7 +42,7 @@
<% } %> <% } %>
</fieldset> </fieldset>
<fieldset> <fieldset>
<input type="submit" class="button" name="submit.Save" value="Save" /> <input type="submit" class="button" name="submit.Save" value="<%=_Encoded("Save") %>" />
<input type="submit" class="button" name="submit.Delete" value="Delete" /> <input type="submit" class="button remove" name="submit.Delete" value="<%=_Encoded("Delete") %>" />
</fieldset> </fieldset>
<% } %> <% } %>

View File

@@ -1,17 +1,18 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Orchard.Roles.ViewModels.RolesIndexViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<RolesIndexViewModel>" %>
<h2><%=Html.TitleForPage("Manage Roles")%></h2> <%@ Import Namespace="Orchard.Roles.ViewModels"%>
<h1><%=Html.TitleForPage(T("Manage Roles").ToString())%></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %> <% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %> <%=Html.ValidationSummary() %>
<fieldset class="actions bulk"> <fieldset class="actions bulk">
<label for="publishActions">Actions: </label> <label for="publishActions"><%=_Encoded("Actions:") %></label>
<select id="Select1" name="roleActions"> <select id="Select1" name="roleActions">
<option value="1">Delete</option> <option value="1"><%=_Encoded("Delete") %></option>
</select> </select>
<input class="button" type="submit" value="Apply" /> <input class="button" type="submit" value="<%=_Encoded("Apply") %>" />
</fieldset> </fieldset>
<div class="manage"><%=Html.ActionLink("Add a role", "Create", new {}, new { @class = "button" }) %></div> <div class="manage"><%=Html.ActionLink(T("Add a role").ToString(), "Create", new {}, new { @class = "button" }) %></div>
<fieldset> <fieldset>
<table class="items" summary="This is a table of the roles currently available for use in your application."> <table class="items" summary="<%=_Encoded("This is a table of the roles currently available for use in your application.") %>">
<colgroup> <colgroup>
<col id="Col1" /> <col id="Col1" />
<col id="Col2" /> <col id="Col2" />
@@ -20,15 +21,15 @@
<thead> <thead>
<tr> <tr>
<th scope="col">&nbsp;&darr;<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th> <th scope="col">&nbsp;&darr;<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th>
<th scope="col">Name</th> <th scope="col"><%=_Encoded("Name")%></th>
<th scope="col"></th> <th scope="col"></th>
</tr> </tr>
</thead> </thead>
<%foreach (var row in Model.Rows) { %> <%foreach (var row in Model.Rows) { %>
<tr> <tr>
<td><input type="checkbox" value="true" name="<%= "Checkbox." + row.Id %>"/></td> <td><input type="checkbox" value="true" name="<%="Checkbox." + row.Id %>"/></td>
<td><%=Html.Encode(row.Name) %></td> <td><%=Html.Encode(row.Name) %></td>
<td><%=Html.ActionLink("Edit", "Edit", new { row.Id })%></td> <td><%=Html.ActionLink(T("Edit").ToString(), "Edit", new { row.Id })%></td>
</tr> </tr>
<%}%> <%}%>
</table> </table>

View File

@@ -1,18 +1,18 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Orchard.Roles.ViewModels.UserRolesViewModel>" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<UserRolesViewModel>" %>
<%@ Import Namespace="Orchard.Roles.ViewModels"%>
<fieldset> <fieldset>
<legend>Roles</legend> <legend><%=_Encoded("Roles")%></legend>
<% if (Model.Roles.Count > 0) { <% if (Model.Roles.Count > 0) {
var index = 0; var index = 0;
foreach (var entry in Model.Roles) {%> foreach (var entry in Model.Roles) {%>
<%=Html.Hidden("Roles[" + index + "].RoleId", entry.RoleId)%> <%=Html.Hidden("Roles[" + index + "].RoleId", entry.RoleId)%>
<%=Html.Hidden("Roles[" + index + "].Name", entry.Name)%> <%=Html.Hidden("Roles[" + index + "].Name", entry.Name)%>
<label for="<%="Roles[" + index + "]_Granted"%>"> <%=Html.CheckBox("Roles[" + index + "].Granted", entry.Granted)%>
<%= Html.CheckBox("Roles[" + index + "].Granted", entry.Granted)%> <label class="forcheckbox" for="<%="Roles[" + index + "]_Granted"%>"><%=Html.Encode(entry.Name) %></label>
<%=Html.Encode(entry.Name)%></label>
<%++index; <%++index;
} }
} }
else { else {
%><p>There are no roles</p><% %><p><%=_Encoded("There are no roles.")%></p><%
} %> } %>
</fieldset> </fieldset>

View File

@@ -52,7 +52,7 @@ namespace Orchard.Tags.Controllers {
[HttpPost] [HttpPost]
public ActionResult Index(FormCollection input) { public ActionResult Index(FormCollection input) {
var viewModel = new TagsAdminIndexViewModel { Tags = new List<TagEntry>(), BulkAction = new TagAdminIndexBulkAction() }; var viewModel = new TagsAdminIndexViewModel { Tags = new List<TagEntry>(), BulkAction = new TagAdminIndexBulkAction() };
UpdateModel(viewModel, input.ToValueProvider()); UpdateModel(viewModel);
try { try {
IEnumerable<TagEntry> checkedEntries = viewModel.Tags.Where(t => t.IsChecked); IEnumerable<TagEntry> checkedEntries = viewModel.Tags.Where(t => t.IsChecked);
@@ -88,7 +88,7 @@ namespace Orchard.Tags.Controllers {
public ActionResult Create(FormCollection input) { public ActionResult Create(FormCollection input) {
var viewModel = new TagsAdminCreateViewModel(); var viewModel = new TagsAdminCreateViewModel();
try { try {
UpdateModel(viewModel, input.ToValueProvider()); UpdateModel(viewModel);
if (!_authorizer.Authorize(Permissions.CreateTag, T("Couldn't create tag"))) if (!_authorizer.Authorize(Permissions.CreateTag, T("Couldn't create tag")))
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_tagService.CreateTag(viewModel.TagName); _tagService.CreateTag(viewModel.TagName);
@@ -120,7 +120,7 @@ namespace Orchard.Tags.Controllers {
public ActionResult Edit(FormCollection input) { public ActionResult Edit(FormCollection input) {
var viewModel = new TagsAdminEditViewModel(); var viewModel = new TagsAdminEditViewModel();
try { try {
UpdateModel(viewModel, input.ToValueProvider()); UpdateModel(viewModel);
if (!_authorizer.Authorize(Permissions.RenameTag, T("Couldn't edit tag"))) if (!_authorizer.Authorize(Permissions.RenameTag, T("Couldn't edit tag")))
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();

View File

@@ -21,7 +21,7 @@ namespace Orchard.Mvc {
public MvcHtmlString _Encoded(string textHint) { public MvcHtmlString _Encoded(string textHint) {
return MvcHtmlString.Create(Html.Encode(T(textHint))); return MvcHtmlString.Create(Html.Encode(T(textHint)));
} }
public MvcHtmlString _Encoded(string textHint, params string[] formatTokens) { public MvcHtmlString _Encoded(string textHint, params object[] formatTokens) {
return MvcHtmlString.Create(Html.Encode(T(textHint, formatTokens))); return MvcHtmlString.Create(Html.Encode(T(textHint, formatTokens)));
} }
} }