bugfix workitem 111 - "the site crashed when click the media folder name"

--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-10-14 12:55:47 -07:00
parent 1e5ef6fc3e
commit e9dd611630
2 changed files with 97 additions and 90 deletions

View File

@@ -9,84 +9,88 @@
<p>@Html.ActionLink(T("Media Folders").ToString(), "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}) new {name = navigation.FolderName, mediaPath = navigation.FolderPath})
} }
@T("Manage Folder")</p> @T("Manage Folder")</p>
</div> </div>
<div class="folderProperties"> <div class="folderProperties">
<p>@Html.ActionLink(T("Folder Properties").ToString(), "EditProperties", new { folderName = Model.FolderName, mediaPath = Model.MediaPath })</p> <p>@Html.ActionLink(T("Folder Properties").ToString(), "EditProperties", new { folderName = Model.FolderName, mediaPath = Model.MediaPath })</p>
</div> </div>
<div class="clearBoth"></div>
<div class="clearBoth"></div>
@using(Html.BeginFormAntiForgeryPost()) { @using(Html.BeginFormAntiForgeryPost()) {
<fieldset class="bulk-actions"> <fieldset class="bulk-actions">
<label for="publishActions">@T("Actions:")</label> <label for="publishActions">@T("Actions:")</label>
<select id="Select1" name="publishActions"> <select id="Select1" name="publishActions">
<option value="1">@T("Remove")</option> <option value="1">@T("Remove")</option>
</select> </select>
<input class="button" type="submit" value="@T("Apply")" /> <input class="button" type="submit" value="@T("Apply")" />
</fieldset> </fieldset>
<div class="manage">
@Html.ActionLink(T("Add media").ToString(), "Add", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button primaryAction" }) <div class="manage">
@Html.ActionLink(T("Add a folder").ToString(), "Create", new { Model.MediaPath }, new { @class = "button" }) @Html.ActionLink(T("Add media").ToString(), "Add", new { folderName = Model.FolderName, mediaPath = Model.MediaPath }, new { @class = "button primaryAction" })
@Html.ActionLink(T("Add a folder").ToString(), "Create", new { Model.MediaPath }, new { @class = "button" })
</div> </div>
<fieldset> <fieldset>
<table class="items" summary="@T("This is a table of the pages currently available for use in your application.")"> <table class="items" summary="@T("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" />
<col id="Col3" /> <col id="Col3" />
<col id="Col4" /> <col id="Col4" />
<col id="Col5" /> <col id="Col5" />
<col id="Col6" /> <col id="Col6" />
</colgroup> </colgroup>
<thead>
<tr> <thead>
<th scope="col">&nbsp;&darr;<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th> <tr>
<th scope="col">@T("Name")</th> <th scope="col">&nbsp;&darr;@{/* todo: (heskew) something more appropriate for "this applies to the bulk actions */ }</th>
<th scope="col">@T("Author")</th> <th scope="col">@T("Name")</th>
<th scope="col">@T("Last Updated")</th> <th scope="col">@T("Author")</th>
<th scope="col">@T("Type")</th> <th scope="col">@T("Last Updated")</th>
<th scope="col">@T("Size")</th> <th scope="col">@T("Type")</th>
</tr> <th scope="col">@T("Size")</th>
</thead> </tr>
@foreach (var mediaFile in Model.MediaFiles) { </thead>
<tr>
<td> @foreach (var mediaFile in Model.MediaFiles) {
<input type="checkbox" value="true" name="@T("Checkbox.File.{0}", mediaFile.Name)"/> <tr>
<input type="hidden" value="@T(Model.MediaPath)" name="@T(mediaFile.Name)" /> <td>
</td> <input type="checkbox" value="true" name="@T("Checkbox.File.{0}", mediaFile.Name)"/>
<td> <input type="hidden" value="@T(Model.MediaPath)" name="@T(mediaFile.Name)" />
@Html.ActionLink(mediaFile.Name, "EditMedia", new { name = mediaFile.Name, </td>
lastUpdated = mediaFile.LastUpdated, <td>
size = mediaFile.Size, @Html.ActionLink(mediaFile.Name, "EditMedia", new { name = mediaFile.Name,
folderName = mediaFile.FolderName, lastUpdated = mediaFile.LastUpdated,
mediaPath = Model.MediaPath }) size = mediaFile.Size,
</td> folderName = mediaFile.FolderName,
<td>@T("Orchard User")</td> mediaPath = Model.MediaPath })
<td>@mediaFile.LastUpdated</td> </td>
<td>@mediaFile.Type</td> <td>@T("Orchard User")</td>
<td>@mediaFile.Size</td> <td>@mediaFile.LastUpdated</td>
<td>@mediaFile.Type</td>
<td>@mediaFile.Size</td>
</tr>
}
@foreach (var mediaFolder in Model.MediaFolders) {
<tr>
<td>
<input type="checkbox" value="true" name="@T("Checkbox.Folder.{0}", mediaFolder.Name)"/>
<input type="hidden" value="@mediaFolder.MediaPath" name="@mediaFolder.Name" />
</td>
<td>
<img src="<%=ResolveUrl("~/Modules/Orchard.Media/Content/Admin/images/folder.gif")%>" height="16" width="16" class="mediaTypeIcon" alt="@T("Folder")" />
@Html.ActionLink(mediaFolder.Name, "Edit", new { name = mediaFolder.Name, mediaPath = mediaFolder.MediaPath})
</td>
<td>@T("Orchard User")</td>
<td>@mediaFolder.LastUpdated</td>
<td>@T("Folder")</td>
<td>@mediaFolder.Size</td>
</tr> </tr>
} }
@foreach (var mediaFolder in Model.MediaFolders) {
<tr>
<td>
<input type="checkbox" value="true" name="@T("Checkbox.Folder.{0}", mediaFolder.Name)"/>
<input type="hidden" value="@mediaFolder.MediaPath" name="@mediaFolder.Name" />
</td>
<td>
<img src="<%=ResolveUrl("~/Modules/Orchard.Media/Content/Admin/images/folder.gif")%>" height="16" width="16" class="mediaTypeIcon" alt="@T("Folder")" />
@Html.ActionLink(mediaFolder.Name, "Edit", new { name = mediaFolder.Name, mediaPath = mediaFolder.MediaPath})
</td>
<td>@T("Orchard User")</td>
<td>@mediaFolder.LastUpdated</td>
<td>@T("Folder")</td>
<td>@mediaFolder.Size</td>
</tr>
}
</table> </table>
</fieldset> </fieldset>
} }

View File

@@ -2,34 +2,37 @@
<h1>@Html.TitleForPage(T("Manage Media Folders").ToString())</h1> <h1>@Html.TitleForPage(T("Manage Media Folders").ToString())</h1>
@Html.ValidationSummary() @Html.ValidationSummary()
<fieldset class="bulk-actions"> <fieldset class="bulk-actions">
<label for="publishActions">@T("Actions:")</label> <label for="publishActions">@T("Actions:")</label>
<select id="Select1" name="publishActions"> <select id="Select1" name="publishActions">
<option value="1">@T("Remove")</option> <option value="1">@T("Remove")</option>
</select> </select>
<input class="button roundCorners" type="submit" value="@T("Apply")" /> <input class="button roundCorners" type="submit" value="@T("Apply")" />
</fieldset> </fieldset>
<div class="manage">@Html.ActionLink(T("Add a folder").ToString(), "Create", new { }, new { @class = "button primaryAction" })</div> <div class="manage">@Html.ActionLink(T("Add a folder").ToString(), "Create", new { }, new { @class = "button primaryAction" })</div>
<fieldset> <fieldset>
<table class="items" summary="@T("This is a table of the media folders currently available for use in your application.")"> <table class="items" summary="@T("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" />
<col id="Col3" /> <col id="Col3" />
<col id="Col4" /> <col id="Col4" />
<col id="Col5" /> <col id="Col5" />
<col id="Col6" /> <col id="Col6" />
</colgroup> </colgroup>
<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">@T("Name")</th> <th scope="col">@T("Name")</th>
<th scope="col">@T("Author")</th> <th scope="col">@T("Author")</th>
<th scope="col">@T("Last Updated")</th> <th scope="col">@T("Last Updated")</th>
<th scope="col">@T("Type")</th> <th scope="col">@T("Type")</th>
<th scope="col">@T("Size")</th> <th scope="col">@T("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="@T("Checkbox.{0}", mediaFolder.Name)"/></td> <td><input type="checkbox" value="true" name="@T("Checkbox.{0}", mediaFolder.Name)"/></td>
@@ -45,4 +48,4 @@
</tr> </tr>
} }
</table> </table>
</fieldset> </fieldset>