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)]
public ActionResult Create(FormCollection input) {
public ActionResult Create() {
var viewModel = new MediaFolderCreateViewModel();
try {
UpdateModel(viewModel, input.ToValueProvider());
UpdateModel(viewModel);
if (!_authorizer.Authorize(Permissions.CreateMediaFolder, T("Couldn't create media folder")))
return new HttpUnauthorizedResult();
_mediaService.CreateFolder(viewModel.MediaPath, viewModel.Name);
@@ -109,10 +109,10 @@ namespace Orchard.Media.Controllers {
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult EditProperties(FormCollection input) {
public ActionResult EditProperties() {
var viewModel = new MediaFolderEditPropertiesViewModel();
try {
UpdateModel(viewModel, input.ToValueProvider());
UpdateModel(viewModel);
//TODO: There may be better ways to do this.
// Delete
if (!String.IsNullOrEmpty(HttpContext.Request.Form["submit.Delete"])) {
@@ -141,10 +141,10 @@ namespace Orchard.Media.Controllers {
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Add(FormCollection input) {
public ActionResult Add() {
var viewModel = new MediaItemAddViewModel();
try {
UpdateModel(viewModel, input.ToValueProvider());
UpdateModel(viewModel);
if (!_authorizer.Authorize(Permissions.UploadMedia, T("Couldn't upload media file")))
return new HttpUnauthorizedResult();
@@ -176,7 +176,7 @@ namespace Orchard.Media.Controllers {
public ActionResult EditMedia(FormCollection input) {
var viewModel = new MediaItemEditViewModel();
try {
UpdateModel(viewModel, input.ToValueProvider());
UpdateModel(viewModel);
if (!_authorizer.Authorize(Permissions.ModifyMedia, T("Couldn't modify media file")))
return new HttpUnauthorizedResult();
// 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.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Add Media")%></h2>
<p>
<%=Html.ActionLink("Media Folders", "Index")%> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<h1><%=Html.TitleForPage(T("Add Media").ToString()) %></h1>
<p><%=Html.ActionLink(T("Media Folders").ToString(), "Index") %> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) { %>
<%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62;
<% } %>
Add Media</p>
<% using (Html.BeginForm("Add", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {%>
<%=_Encoded("Add Media") %></p>
<% using (Html.BeginForm("Add", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) { %>
<%= Html.ValidationSummary() %>
<fieldset>
<label for="pageTitle">File Path - Multiple files must be in a zipped folder:</label>
<input id="FolderName" name="FolderName" type="hidden" value="<%= Model.FolderName %>" />
<input id="MediaPath" name="MediaPath" type="hidden" value="<%= Model.MediaPath %>" />
<input id="MediaItemPath" name="MediaItemPath" type="file" class="text" value="Browse" size="64"/>
<input type="submit" class="button" value="Upload" /><br />
<span>After your files have been uploaded, you can edit the titles and descriptions.</span>
<label for="pageTitle"><%=T("File Path <span> - multiple files must be in a zipped folder</span>")%></label>
<input id="MediaItemPath" name="MediaItemPath" type="file" class="text" value="<%=_Encoded("Browse") %>" size="64"/>
<span class="hint"><%=_Encoded("After your files have been uploaded, you can edit the titles and descriptions.")%></span>
<input type="hidden" id="FolderName" name="FolderName" value="<%=Html.Encode(Model.FolderName) %>" />
<input type="hidden" id="MediaPath" name="MediaPath" value="<%=Html.Encode(Model.MediaPath) %>" />
</fieldset>
<fieldset>
<input type="submit" class="button" value="<%=_Encoded("Upload") %>" />
<%=Html.AntiForgeryTokenOrchard() %>
</fieldset>
<% } %>

View File

@@ -1,20 +1,20 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MediaFolderCreateViewModel>" %>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderCreateViewModel>" %>
<%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Add a Folder")%></h2>
<p><%=Html.ActionLink("Media Folders", "Index")%> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<h1><%=Html.TitleForPage(T("Add a Folder").ToString()) %></h1>
<p><%=Html.ActionLink(T("Media Folders").ToString(), "Index") %> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) { %>
<%=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()) { %>
<%= Html.ValidationSummary() %>
<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="MediaPath" name="MediaPath" type="hidden" value="<%= Model.MediaPath %>" />
<input type="submit" class="button" value="Save" />
<input type="hidden" id="MediaPath" name="MediaPath" value="<%=Html.Encode(Model.MediaPath) %>" />
<input type="submit" class="button" value="<%=_Encoded("Save") %>" />
</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.Helpers"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Manage Folder")%></h2>
<div class="manage"><%=Html.ActionLink("Folder Properties", "EditProperties", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button"})%></div>
<p><%=Html.ActionLink("Media Folders", "Index")%> &#62;
<h1><%=Html.TitleForPage(T("Manage Folder").ToString())%></h1>
<div class="manage"><%=Html.ActionLink(T("Folder Properties").ToString(), "EditProperties", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button"})%></div>
<p><%=Html.ActionLink(T("Media Folders").ToString(), "Index")%> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62;
<% } %>
Manage Folder</p>
<%=_Encoded("Manage Folder")%></p>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<fieldset class="actions bulk">
<label for="publishActions">Actions: </label>
<label for="publishActions"><%=_Encoded("Actions:")%></label>
<select id="Select1" name="publishActions">
<option value="1">Delete</option>
<option value="1"><%=_Encoded("Delete")%></option>
</select>
<input class="button roundCorners" type="submit" value="Apply" />
<input class="button roundCorners" type="submit" value="<%=_Encoded("Apply") %>" />
</fieldset>
<div class="manage">
<%=Html.ActionLink("Add media", "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 media").ToString(), "Add", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button" })%>
<%=Html.ActionLink(T("Add a folder").ToString(), "Create", new { Model.MediaPath }, new { @class = "button" })%>
</div>
<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>
<col id="Col1" />
<col id="Col2" />
@@ -36,19 +36,19 @@
<thead>
<tr>
<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">Author</th>
<th scope="col">Last Updated</th>
<th scope="col">Type</th>
<th scope="col">Size</th>
<th scope="col"><%=_Encoded("Name") %></th>
<th scope="col"><%=_Encoded("Author") %></th>
<th scope="col"><%=_Encoded("Last Updated") %></th>
<th scope="col"><%=_Encoded("Type") %></th>
<th scope="col"><%=_Encoded("Size") %></th>
</tr>
</thead>
<%foreach (var mediaFile in Model.MediaFiles) {
%>
<tr>
<td>
<input type="checkbox" value="true" name="<%= "Checkbox.File." + mediaFile.Name %>"/>
<input type="hidden" value="<%= Model.MediaPath %>" name="<%= mediaFile.Name %>" />
<input type="checkbox" value="true" name="<%=_Encoded("Checkbox.File.{0}", mediaFile.Name) %>"/>
<input type="hidden" value="<%=_Encoded("Model.MediaPath") %>" name="<%=_Encoded("mediaFile.Name") %>" />
</td>
<td>
<%=Html.ActionLink(mediaFile.Name, "EditMedia", new { name = mediaFile.Name,
@@ -57,34 +57,33 @@
folderName = mediaFile.FolderName,
mediaPath = Model.MediaPath })%>
</td>
<td>Orchard User</td>
<td><%= mediaFile.LastUpdated %></td>
<td><%= mediaFile.Type %></td>
<td><%= mediaFile.Size %></td>
<td><%=_Encoded("Orchard User")%></td>
<td><%=mediaFile.LastUpdated %></td>
<td><%=Html.Encode(mediaFile.Type) %></td>
<td><%=mediaFile.Size %></td>
</tr>
<%}%>
<%foreach (var mediaFolder in Model.MediaFolders) {
%>
<tr>
<td>
<input type="checkbox" value="true" name="<%= "Checkbox.Folder." + mediaFolder.Name %>"/>
<input type="hidden" value="<%= mediaFolder.MediaPath %>" name="<%= mediaFolder.Name %>" />
<input type="checkbox" value="true" name="<%=_Encoded("Checkbox.Folder.{0}", mediaFolder.Name) %>"/>
<input type="hidden" value="<%=Html.Encode(mediaFolder.MediaPath) %>" name="<%=Html.Encode(mediaFolder.Name) %>" />
</td>
<td>
<img src="<%=ResolveUrl("~/Packages/Orchard.Media/Content/Admin/images/folder.gif")%>" height="16px" width="16px" class="mediaTypeIcon" alt="Folder" />
<%=Html.ActionLink(mediaFolder.Name, "Edit", new { name = mediaFolder.Name,
mediaPath = mediaFolder.MediaPath})%>
<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})%>
</td>
<td>Orchard User</td>
<td><%= mediaFolder.LastUpdated %></td>
<td>Folder</td>
<td><%= mediaFolder.Size %></td>
<td><%=_Encoded("Orchard User")%></td>
<td><%=mediaFolder.LastUpdated %></td>
<td><%=_Encoded("Folder")%></td>
<td><%=mediaFolder.Size %></td>
</tr>
<%}%>
</table>
</fieldset>
<div class="manage">
<%=Html.ActionLink("Add media", "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 media").ToString(), "Add", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button" })%>
<%=Html.ActionLink(T("Add a folder").ToString(), "Create", new { Model.MediaPath }, new { @class = "button" })%>
</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.Helpers"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Edit Media - {0}", Model.Name)%></h2>
<p>
<%=Html.ActionLink("Media Folders", "Index")%> &#62;
<h1><%=Html.TitleForPage(T("Edit Media - {0}", Model.Name).ToString())%></h1>
<p><%=Html.ActionLink(T("Media Folders").ToString(), "Index")%> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62;
<% } %>
Edit Media </p>
<%=_Encoded("Edit Media")%></p>
<div class="sections">
<%using (Html.BeginFormAntiForgeryPost()) { %>
<%= Html.ValidationSummary() %>
<div class="primary">
<h3>About this media</h3>
<h2><%=_Encoded("About this media")%></h2>
<fieldset>
<label for="Name">Name:</label>
<input id="Name" name="Name" type="hidden" value="<%= Model.Name %>"/>
<input id="NewName" class="text" name="NewName" type="text" value="<%= Model.Name %>"/>
<label for="Caption">Caption:</label>
<input id="Caption" class="text" name="Caption" type="text" value="<%= Model.Caption %>"/>
<input id="LastUpdated" name="LastUpdated" type="hidden" value="<%= Model.LastUpdated %>"/>
<input id="Size" name="Size" type="hidden" value="<%= Model.Size %>"/>
<input id="FolderName" name="FolderName" type="hidden" value="<%= Model.FolderName %>"/>
<input id="MediaPath" name="MediaPath" type="hidden" value="<%= Model.MediaPath %>" />
<span>This will be used for the image alt tag.</span>
<div>
<label for="Name"><%=_Encoded("Name")%></label>
<input id="Name" name="Name" type="hidden" value="<%=Html.Encode(Model.Name) %>"/>
<input id="NewName" class="text" name="NewName" type="text" value="<%=Html.Encode(Model.Name) %>"/>
</div>
<div>
<label for="Caption"><%=_Encoded("Caption")%></label>
<input id="Caption" class="text" name="Caption" type="text" value="<%= Model.Caption %>"/>
<span class="hint"><%=_Encoded("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>
<input type="submit" class="button" name="submit.Save" value="Save" />
<%--<input type="submit" class="button" name="submit.Delete" value="Delete" />--%>
<input type="submit" class="button" name="submit.Save" value="<%=_Encoded("Save") %>" />
<%--<input type="submit" class="button" name="submit.Delete" value="<%=_Encoded("Delete") %>" />--%>
</fieldset>
</div>
<div class="secondary">
<h3>Preview</h3>
<div><img src="<%=ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name)%>" class="previewImage" alt="<%= Model.Caption %>" /></div>
<h2><%=_Encoded("Preview")%></h2>
<div><img src="<%=ResolveUrl("~/Media/" + Html.Encode(Model.RelativePath + "/" + Model.Name))%>" class="previewImage" alt="<%=Html.Encode(Model.Caption) %>" /></div>
<ul>
<li><strong>Dimensions:</strong> 500 x 375 pixels</li>
<li><strong>Size:</strong> <%= Model.Size %></li>
<li><strong>Added on:</strong> <%= Model.LastUpdated %> by Orchard User</li>
<%-- todo: make these real (including markup) --%>
<li><label><%=T("Dimensions: <span>500 x 375 pixels</span>")%></label></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>
<label for="embedPath">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;" />
<p class="helperText">Copy this html to add this image to your site.</p>
<label for="embedPath"><%=_Encoded("Embed:")%></label>
<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) %>" />
<span class="hint"><%=_Encoded("Copy this html to add this image to your site.") %></p>
</li>
</ul>
</div>

View File

@@ -1,22 +1,22 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MediaFolderEditPropertiesViewModel>" %>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderEditPropertiesViewModel>" %>
<%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%>
<h2><%=Html.TitleForPage("Folder Properties")%></h2>
<p><%=Html.ActionLink("Media Folders", "Index")%> &#62;
<h1><%=Html.TitleForPage(T("Folder Properties").ToString())%></h1>
<p><%=Html.ActionLink(T("Media Folders").ToString(), "Index")%> &#62;
<%foreach (FolderNavigation navigation in MediaHelpers.GetFolderNavigationHierarchy(Model.MediaPath)) {%>
<%=Html.ActionLink(navigation.FolderName, "Edit",
new {name = navigation.FolderName, mediaPath = navigation.FolderPath})%> &#62;
<% } %>
Folder Properties</p>
<%=_Encoded("Folder Properties")%></p>
<% using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<fieldset>
<label for="Name">Folder Name:</label>
<input id="MediaPath" name="MediaPath" type="hidden" value="<%=Model.MediaPath %>" />
<input id="Name" class="text" name="Name" type="text" value="<%= Model.Name %>" />
<input type="submit" class="button buttonFocus roundCorners" name="submit.Save" value="Save" />
<%--<input type="submit" class="button buttonFocus roundCorners" name="submit.Delete" value="Delete" />--%>
<label for="Name"><%=_Encoded("Folder Name:") %></label>
<input id="MediaPath" name="MediaPath" type="hidden" value="<%=Html.Encode(Model.MediaPath) %>" />
<input id="Name" class="text" name="Name" type="text" value="<%=Html.Encode(Model.Name) %>" />
<input type="submit" class="button" name="submit.Save" value="<%=_Encoded("Save") %>" />
<%--<input type="submit" class="button buttonFocus roundCorners" name="submit.Delete" value="<%=_Encoded("Delete") %>" />--%>
</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"%>
<h2><%=Html.TitleForPage("Manage Media Folders")%></h2>
<p><%=Html.ActionLink("Media Folders", "Index")%> &#62; Manage Media Folders</p>
<h1><%=Html.TitleForPage(T("Manage Media Folders").ToString()) %></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<fieldset class="actions bulk">
<label for="publishActions">Actions: </label>
<label for="publishActions"><%=_Encoded("Actions:") %></label>
<select id="Select1" name="publishActions">
<option value="1">Delete</option>
<option value="1"><%=_Encoded("Delete")%></option>
</select>
<input class="button roundCorners" type="submit" value="Apply" />
<input class="button roundCorners" type="submit" value="<%=_Encoded("Apply") %>" />
</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>
<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>
<col id="Col1" />
<col id="Col2" />
@@ -25,27 +24,29 @@
<thead>
<tr>
<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">Author</th>
<th scope="col">Last Updated</th>
<th scope="col">Type</th>
<th scope="col">Size</th>
<th scope="col"><%=_Encoded("Name")%></th>
<th scope="col"><%=_Encoded("Author") %></th>
<th scope="col"><%=_Encoded("Last Updated") %></th>
<th scope="col"><%=_Encoded("Type") %></th>
<th scope="col"><%=_Encoded("Size") %></th>
</tr>
</thead>
<%foreach (var mediaFolder in Model.MediaFolders) {
%>
<tr>
<td><input type="checkbox" value="true" name="<%= "Checkbox." + mediaFolder.Name %>"/></td>
<td><img src="<%=ResolveUrl("~/Packages/Orchard.Media/Content/Admin/images/folder.gif")%>" height="16px" width="16px" class="mediaTypeIcon" alt="Folder" />
<td><input type="checkbox" value="true" name="<%=_Encoded("Checkbox.{0}", mediaFolder.Name) %>"/></td>
<%-- 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 })%>
</td>
<td>Orchard User</td>
<td><%=_Encoded("Orchard User")%></td>
<td><%=mediaFolder.LastUpdated %></td>
<td>Folder</td>
<td><%=_Encoded("Folder")%></td>
<td><%=mediaFolder.Size %></td>
</tr>
<%}%>
</table>
</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"%>
<h3>Media</h3>
<ol>
<li>
<%= Html.LabelFor(x=>x.RootMediaFolder) %>
<%= Html.EditorFor(x=>x.RootMediaFolder) %>
<%= Html.ValidationMessage("RootMediaFolder", "*")%>
</li>
</ol>
<fieldset>
<legend><%=_Encoded("Media")%></legend>
<div>
<label for="MediaSettings_RootMediaFolder">Media folder</label>
<%=Html.EditorFor(x=>x.RootMediaFolder) %>
<%=Html.ValidationMessage("RootMediaFolder", "*")%>
</div>
</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"%>
<h2><%=Html.TitleForPage("Add Role")%></h2>
<h1><%=Html.TitleForPage(T("Add Role").ToString()) %></h1>
<% using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary()%>
<fieldset>
<legend>Information</legend>
<label for="pageTitle">Role Name:</label>
<input id="Name" class="inputText inputTextLarge" name="Name" type="text" value="<%= Model.Name %>" />
<legend><%=_Encoded("Information") %></legend>
<label for="pageTitle"><%=_Encoded("Role Name:") %></label>
<input id="Name" class="text" name="Name" type="text" value="<%=Html.Encode(Model.Name) %>" />
</fieldset>
<fieldset>
<legend>Permissions</legend>
<legend><%=_Encoded("Permissions") %></legend>
<% foreach (var packageName in Model.PackagePermissions.Keys) { %>
<fieldset>
<legend><%=packageName%> Module</legend>
<legend><%=_Encoded("{0} Module", packageName) %></legend>
<table class="items">
<colgroup>
<col id="Permission" />
@@ -20,14 +20,14 @@
</colgroup>
<thead>
<tr>
<th scope="col">Permission</th>
<th scope="col">Allow</th>
<th scope="col"><%=_Encoded("Permission") %></th>
<th scope="col"><%=_Encoded("Allow") %></th>
</tr>
</thead>
<% foreach (var permission in Model.PackagePermissions[packageName]) {%>
<% foreach (var permission in Model.PackagePermissions[packageName]) { %>
<tr>
<td><%=permission.Description%></td>
<td style="width:60px;/* todo: (heskew) make not inline :("><input type="checkbox" value="true" name="<%="Checkbox." + permission.Name%>"/></td>
<td><%=Html.Encode(permission.Description) %></td>
<td style="width:60px;/* todo: (heskew) make not inline :( */"><input type="checkbox" value="true" name="<%=_Encoded("Checkbox.{0}", permission.Name) %>"/></td>
</tr>
<% } %>
</table>
@@ -35,6 +35,6 @@
<% } %>
</fieldset>
<fieldset>
<input type="submit" class="button" value="Save" />
<input type="submit" class="button" value="<%=_Encoded("Save") %>" />
</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"%>
<h2><%=Html.TitleForPage("Edit Role")%></h2>
<h1><%=Html.TitleForPage(T("Edit Role").ToString()) %></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<fieldset>
<legend>Information</legend>
<label for="pageTitle">Role Name:</label>
<input id="Name" class="inputText inputTextLarge" name="Name" type="text" value="<%=Model.Name %>"/>
<input type="hidden" value="<%= Model.Id %>" name="Id" />
<legend><%=_Encoded("Information") %></legend>
<label for="pageTitle"><%=_Encoded("Role Name:") %></label>
<input id="Name" class="text" name="Name" type="text" value="<%=Html.Encode(Model.Name) %>" />
<input type="hidden" value="<%=Model.Id %>" name="Id" />
</fieldset>
<fieldset>
<legend>Permissions</legend>
<legend><%=_Encoded("Permissions") %></legend>
<% foreach (var packageName in Model.PackagePermissions.Keys) { %>
<fieldset>
<legend><%=packageName%> Module</legend>
<legend><%=_Encoded("{0} Module", packageName) %></legend>
<table class="items">
<colgroup>
<col id="Col1" />
@@ -21,18 +21,18 @@
</colgroup>
<thead>
<tr>
<th scope="col">Permission</th>
<th scope="col">Allow</th>
<th scope="col"><%=_Encoded("Permission") %></th>
<th scope="col"><%=_Encoded("Allow") %></th>
</tr>
</thead>
<% foreach (var permission in Model.PackagePermissions[packageName]) {%>
<% foreach (var permission in Model.PackagePermissions[packageName]) { %>
<tr>
<td><%=permission.Description%></td>
<td><%=Html.Encode(permission.Description) %></td>
<td style="width:60px;/* todo: (heskew) make not inline :(">
<% if (Model.CurrentPermissions.Contains(permission.Name)) {%>
<input type="checkbox" value="true" name="<%="Checkbox." + permission.Name%>" checked="checked"/>
<% if (Model.CurrentPermissions.Contains(permission.Name)) { %>
<input type="checkbox" value="true" name="<%=_Encoded("Checkbox.{0}", permission.Name) %>" checked="checked"/>
<% } else {%>
<input type="checkbox" value="true" name="<%="Checkbox." + permission.Name%>"/>
<input type="checkbox" value="true" name="<%=_Encoded("Checkbox.{0}", permission.Name) %>"/>
<% }%>
</td>
</tr>
@@ -42,7 +42,7 @@
<% } %>
</fieldset>
<fieldset>
<input type="submit" class="button" name="submit.Save" value="Save" />
<input type="submit" class="button" name="submit.Delete" value="Delete" />
<input type="submit" class="button" name="submit.Save" value="<%=_Encoded("Save") %>" />
<input type="submit" class="button remove" name="submit.Delete" value="<%=_Encoded("Delete") %>" />
</fieldset>
<% } %>

View File

@@ -1,17 +1,18 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Orchard.Roles.ViewModels.RolesIndexViewModel>" %>
<h2><%=Html.TitleForPage("Manage Roles")%></h2>
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<RolesIndexViewModel>" %>
<%@ Import Namespace="Orchard.Roles.ViewModels"%>
<h1><%=Html.TitleForPage(T("Manage Roles").ToString())%></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<fieldset class="actions bulk">
<label for="publishActions">Actions: </label>
<label for="publishActions"><%=_Encoded("Actions:") %></label>
<select id="Select1" name="roleActions">
<option value="1">Delete</option>
<option value="1"><%=_Encoded("Delete") %></option>
</select>
<input class="button" type="submit" value="Apply" />
<input class="button" type="submit" value="<%=_Encoded("Apply") %>" />
</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>
<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>
<col id="Col1" />
<col id="Col2" />
@@ -20,15 +21,15 @@
<thead>
<tr>
<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>
</tr>
</thead>
<%foreach (var row in Model.Rows) { %>
<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.ActionLink("Edit", "Edit", new { row.Id })%></td>
<td><%=Html.ActionLink(T("Edit").ToString(), "Edit", new { row.Id })%></td>
</tr>
<%}%>
</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>
<legend>Roles</legend>
<legend><%=_Encoded("Roles")%></legend>
<% if (Model.Roles.Count > 0) {
var index = 0;
foreach (var entry in Model.Roles) {%>
<%=Html.Hidden("Roles[" + index + "].RoleId", entry.RoleId)%>
<%=Html.Hidden("Roles[" + index + "].Name", entry.Name)%>
<label for="<%="Roles[" + index + "]_Granted"%>">
<%= Html.CheckBox("Roles[" + index + "].Granted", entry.Granted)%>
<%=Html.Encode(entry.Name)%></label>
<%=Html.CheckBox("Roles[" + index + "].Granted", entry.Granted)%>
<label class="forcheckbox" for="<%="Roles[" + index + "]_Granted"%>"><%=Html.Encode(entry.Name) %></label>
<%++index;
}
}
else {
%><p>There are no roles</p><%
%><p><%=_Encoded("There are no roles.")%></p><%
} %>
</fieldset>

View File

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

View File

@@ -21,7 +21,7 @@ namespace Orchard.Mvc {
public MvcHtmlString _Encoded(string 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)));
}
}