- Bringing Orchard.Media

--HG--
branch : dev
This commit is contained in:
Suha Can
2010-09-14 15:39:11 -07:00
parent 6652ec0ae7
commit cfd3b5fa48
25 changed files with 344 additions and 345 deletions

View File

@@ -95,13 +95,6 @@
<Content Include="Content\Admin\images\folder.gif" /> <Content Include="Content\Admin\images\folder.gif" />
<Content Include="Module.txt" /> <Content Include="Module.txt" />
<Content Include="Styles\admin.css" /> <Content Include="Styles\admin.css" />
<Content Include="Views\Admin\Add.aspx" />
<Content Include="Views\Admin\Create.aspx" />
<Content Include="Views\Admin\Edit.aspx" />
<Content Include="Views\Admin\EditMedia.aspx" />
<Content Include="Views\Admin\EditProperties.aspx" />
<Content Include="Views\Admin\Index.aspx" />
<Content Include="Views\EditorTemplates\Parts\Media.SiteSettings.ascx" />
<Content Include="Web.config" /> <Content Include="Web.config" />
<Content Include="Content\Site.css" /> <Content Include="Content\Site.css" />
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
@@ -116,6 +109,15 @@
<Name>Orchard.Core</Name> <Name>Orchard.Core</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Views\Admin\Add.cshtml" />
<None Include="Views\Admin\Create.cshtml" />
<None Include="Views\Admin\Edit.cshtml" />
<None Include="Views\Admin\EditMedia.cshtml" />
<None Include="Views\Admin\EditProperties.cshtml" />
<None Include="Views\Admin\Index.cshtml" />
<None Include="Views\EditorTemplates\Parts\Media.SiteSettings.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -1,9 +1,8 @@
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Orchard.Mvc.ViewModels;
namespace Orchard.Media.ViewModels { namespace Orchard.Media.ViewModels {
public class MediaFolderCreateViewModel : BaseViewModel { public class MediaFolderCreateViewModel {
[Required, DisplayName("Folder Name:")] [Required, DisplayName("Folder Name:")]
public string Name { get; set; } public string Name { get; set; }
public string MediaPath { get; set; } public string MediaPath { get; set; }

View File

@@ -1,7 +1,5 @@
using Orchard.Mvc.ViewModels; namespace Orchard.Media.ViewModels {
public class MediaFolderEditPropertiesViewModel {
namespace Orchard.Media.ViewModels {
public class MediaFolderEditPropertiesViewModel : BaseViewModel {
public string Name { get; set; } public string Name { get; set; }
public string MediaPath { get; set; } public string MediaPath { get; set; }
} }

View File

@@ -1,9 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using Orchard.Media.Models; using Orchard.Media.Models;
using Orchard.Mvc.ViewModels;
namespace Orchard.Media.ViewModels { namespace Orchard.Media.ViewModels {
public class MediaFolderEditViewModel : BaseViewModel { public class MediaFolderEditViewModel {
public string FolderName { get; set; } public string FolderName { get; set; }
public string MediaPath { get; set; } public string MediaPath { get; set; }
public IEnumerable<MediaFolder> MediaFolders { get; set; } public IEnumerable<MediaFolder> MediaFolders { get; set; }

View File

@@ -1,9 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using Orchard.Mvc.ViewModels;
using Orchard.Media.Models; using Orchard.Media.Models;
namespace Orchard.Media.ViewModels { namespace Orchard.Media.ViewModels {
public class MediaFolderIndexViewModel : BaseViewModel { public class MediaFolderIndexViewModel {
public IEnumerable<MediaFolder> MediaFolders { get; set; } public IEnumerable<MediaFolder> MediaFolders { get; set; }
} }
} }

View File

@@ -1,7 +1,5 @@
using Orchard.Mvc.ViewModels; namespace Orchard.Media.ViewModels {
public class MediaItemAddViewModel {
namespace Orchard.Media.ViewModels {
public class MediaItemAddViewModel : BaseViewModel {
public string FolderName { get; set; } public string FolderName { get; set; }
public string MediaPath { get; set; } public string MediaPath { get; set; }
} }

View File

@@ -1,8 +1,7 @@
using System; using System;
using Orchard.Mvc.ViewModels;
namespace Orchard.Media.ViewModels { namespace Orchard.Media.ViewModels {
public class MediaItemEditViewModel : BaseViewModel { public class MediaItemEditViewModel {
public string Name { get; set; } public string Name { get; set; }
public string Caption { get; set; } public string Caption { get; set; }
public long Size { get; set; } public long Size { get; set; }

View File

@@ -1,31 +0,0 @@
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaItemAddViewModel>" %>
<%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%>
<%Html.RegisterStyle("admin.css"); %>
<h1><%: Html.TitleForPage(T("Add Media").ToString()) %></h1>
<div class="breadCrumbs">
<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;
<% } %>
<%: T("Add Media") %></p>
</div>
<% using (Html.BeginForm("Add", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) { %>
<%: Html.ValidationSummary() %>
<fieldset>
<label for="pageTitle"><%: T("File Path <span> - multiple files must be in a zipped folder</span>")%></label>
<input id="MediaItemPath" name="MediaItemPath" type="file" value="<%: T("Browse") %>" size="64"/>
<span class="hint"><%: T("After your files have been uploaded, you can edit the titles and descriptions.")%></span>
<input type="hidden" id="FolderName" name="FolderName" value="<%: Model.FolderName %>" />
<input type="hidden" id="MediaPath" name="MediaPath" value="<%: Model.MediaPath %>" />
</fieldset>
<fieldset>
<input type="submit" class="button primaryAction" value="<%: T("Upload") %>" />
<%: Html.AntiForgeryTokenOrchard() %>
</fieldset>
<% } %>

View File

@@ -0,0 +1,30 @@
@model Orchard.Media.ViewModels.MediaItemAddViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
<h1>@Html.TitleForPage(T("Add Media").ToString())</h1>
<div class="breadCrumbs">
<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;
}
@T("Add Media")</p>
</div>
@using (Html.BeginForm("Add", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {
@Html.ValidationSummary()
<fieldset>
<label for="pageTitle">@T("File Path <span> - multiple files must be in a zipped folder</span>")</label>
<input id="MediaItemPath" name="MediaItemPath" type="file" value="@T("Browse")" size="64"/>
<span class="hint">@T("After your files have been uploaded, you can edit the titles and descriptions.")</span>
<input type="hidden" id="FolderName" name="FolderName" value="@Model.FolderName" />
<input type="hidden" id="MediaPath" name="MediaPath" value="@Model.MediaPath" />
</fieldset>
<fieldset>
<input type="submit" class="button primaryAction" value="@T("Upload")" />
@Html.AntiForgeryTokenOrchard()
</fieldset>
}

View File

@@ -1,26 +0,0 @@
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderCreateViewModel>" %>
<%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%><%
Html.RegisterStyle("admin.css"); %>
<h1><%: Html.TitleForPage(T("Add a Folder").ToString()) %></h1>
<div class="breadCrumbs">
<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;
<% } %>
<%: T("Add a Folder") %></p>
</div>
<%using (Html.BeginFormAntiForgeryPost()) { %>
<%: Html.ValidationSummary() %>
<fieldset>
<label for="Name"><%: T("Folder Name") %></label>
<input id="Name" class="textMedium" name="Name" type="text" />
<input type="hidden" id="MediaPath" name="MediaPath" value="<%: Model.MediaPath %>" />
</fieldset>
<fieldset>
<input type="submit" class="button primaryAction" value="<%: T("Save") %>" />
</fieldset>
<% } %>

View File

@@ -0,0 +1,26 @@
@model Orchard.Media.ViewModels.MediaFolderCreateViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
<h1>@Html.TitleForPage(T("Add a Folder").ToString())</h1>
<div class="breadCrumbs">
<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;
}
@T("Add a Folder") </p>
</div>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
<fieldset>
<label for="Name">@T("Folder Name")</label>
<input id="Name" class="textMedium" name="Name" type="text" />
<input type="hidden" id="MediaPath" name="MediaPath" value="@Model.MediaPath" />
</fieldset>
<fieldset>
<input type="submit" class="button primaryAction" value="@T("Save")" />
</fieldset>
}

View File

@@ -1,97 +0,0 @@
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderEditViewModel>" %>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%><%
Html.RegisterStyle("admin.css"); %>
<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>--%>
<div class="breadCrumbs">
<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;
<% } %>
<%: T("Manage Folder")%></p>
</div>
<div class="folderProperties">
<p><%: Html.ActionLink(T("Folder Properties").ToString(), "EditProperties", new { folderName = Model.FolderName, mediaPath = Model.MediaPath })%></p>
</div>
<div class="clearBoth"></div>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<fieldset class="bulk-actions">
<label for="publishActions"><%: T("Actions:")%></label>
<select id="Select1" name="publishActions">
<option value="1"><%: T("Remove")%></option>
</select>
<input class="button" type="submit" value="<%: T("Apply") %>" />
</fieldset>
<div class="manage">
<%: 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>
<fieldset>
<table class="items" summary="<%: T("This is a table of the pages currently available for use in your application.") %>">
<colgroup>
<col id="Col1" />
<col id="Col2" />
<col id="Col3" />
<col id="Col4" />
<col id="Col5" />
<col id="Col6" />
</colgroup>
<thead>
<tr>
<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("Author") %></th>
<th scope="col"><%: T("Last Updated") %></th>
<th scope="col"><%: T("Type") %></th>
<th scope="col"><%: T("Size") %></th>
</tr>
</thead>
<%foreach (var mediaFile in Model.MediaFiles) {
%>
<tr>
<td>
<input type="checkbox" value="true" name="<%: T("Checkbox.File.{0}", mediaFile.Name) %>"/>
<input type="hidden" value="<%: T(Model.MediaPath) %>" name="<%: T(mediaFile.Name) %>" />
</td>
<td>
<%: Html.ActionLink(mediaFile.Name, "EditMedia", new { name = mediaFile.Name,
lastUpdated = mediaFile.LastUpdated,
size = mediaFile.Size,
folderName = mediaFile.FolderName,
mediaPath = Model.MediaPath })%>
</td>
<td><%: T("Orchard User")%></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>
<%}%>
</table>
</fieldset>
<% } %>

View File

@@ -0,0 +1,92 @@
@model Orchard.Media.ViewModels.MediaFolderEditViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
<h1>@Html.TitleForPage(T("Manage Folder").ToString())</h1>
<div class="breadCrumbs">
<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;
}
@T("Manage Folder")</p>
</div>
<div class="folderProperties">
<p>@Html.ActionLink(T("Folder Properties").ToString(), "EditProperties", new { folderName = Model.FolderName, mediaPath = Model.MediaPath })</p>
</div>
<div class="clearBoth"></div>
@using(Html.BeginFormAntiForgeryPost()) {
<fieldset class="bulk-actions">
<label for="publishActions">@T("Actions:")</label>
<select id="Select1" name="publishActions">
<option value="1">@T("Remove")</option>
</select>
<input class="button" type="submit" value="@T("Apply")" />
</fieldset>
<div class="manage">
@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>
<fieldset>
<table class="items" summary="@T("This is a table of the pages currently available for use in your application.")">
<colgroup>
<col id="Col1" />
<col id="Col2" />
<col id="Col3" />
<col id="Col4" />
<col id="Col5" />
<col id="Col6" />
</colgroup>
<thead>
<tr>
<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("Author")</th>
<th scope="col">@T("Last Updated")</th>
<th scope="col">@T("Type")</th>
<th scope="col">@T("Size")</th>
</tr>
</thead>
@foreach (var mediaFile in Model.MediaFiles) {
<tr>
<td>
<input type="checkbox" value="true" name="@T("Checkbox.File.{0}", mediaFile.Name)"/>
<input type="hidden" value="@T(Model.MediaPath)" name="@T(mediaFile.Name)" />
</td>
<td>
@Html.ActionLink(mediaFile.Name, "EditMedia", new { name = mediaFile.Name,
lastUpdated = mediaFile.LastUpdated,
size = mediaFile.Size,
folderName = mediaFile.FolderName,
mediaPath = Model.MediaPath })
</td>
<td>@T("Orchard User")</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>
}
</table>
</fieldset>
}

View File

@@ -1,75 +0,0 @@
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaItemEditViewModel>" %>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%><%
Html.RegisterStyle("admin.css"); %>
<h1><%: Html.TitleForPage(T("Edit Media - {0}", Model.Name).ToString())%></h1>
<div class="breadCrumbs">
<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;
<% } %>
<%: T("Edit Media")%></p>
</div>
<div class="sections clearBoth">
<%using (Html.BeginFormAntiForgeryPost()) { %>
<%: Html.ValidationSummary() %>
<div class="primary">
<div>
<img src="<%=Model.PublicUrl%>" class="previewImage" alt="<%: Model.Caption %>" />
</div>
<fieldset>
<%-- todo: make these real (including markup) --%>
<div>
<label><%: T("Dimensions: <span>500 x 375 pixels</span>")%></label>
<label><%: T("Size: <span>{0}</span>", Model.Size)%></label>
<label><%: T("Added on: <span>{0} by Orchard User</span>", Model.LastUpdated)%></label>
</div>
<div>
<label for="embedPath"><%: T("Embed:")%></label>
<input id="embedPath" class="textMedium" name="embedPath" type="text" readonly="readonly" value="<%: string.Format("<img src=\"{0}\" width=\"{1}\" height=\"{2}\" alt=\"{3}\" />", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375, Model.Caption)%>" />
<span class="hint"><%: T("Copy this html to add this image to your site.") %></span>
</div>
<div>
<label for="Name"><%: T("Name")%></label>
<input id="Name" name="Name" type="hidden" value="<%: Model.Name %>"/>
<input id="NewName" class="textMedium" name="NewName" type="text" value="<%: Model.Name %>"/>
</div>
<div>
<label for="Caption"><%: T("Caption")%></label>
<input id="Caption" class="textMedium" name="Caption" type="text" value="<%= Model.Caption %>"/>
<span class="hint"><%: T("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 primaryAction" name="submit.Save" value="<%: T("Save") %>" />
<%--<input type="submit" class="button" name="submit.Delete" value="<%: T("Remove") %>" />--%>
</fieldset>
</div>
<%--<div class="secondary" style="border:1px solid #ff0000;">
<h2><%: T("Preview")%></h2>
<div><img src="<%=ResolveUrl("~/Media/" + Html.Encode(Model.RelativePath + "/" + Model.Name))%>" class="previewImage" alt="<%: Model.Caption %>" /></div>
<ul>
<%-- 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"><%: T("Embed:")%></label>
<input id="embedPath" class="text" name="embedPath" type="text" readonly="readonly" value="<%: T("<img src=\"{0}\" width=\"{1}\" height=\"{2}\" alt=\"{3}\" />", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375, Model.Caption) %>" />
<span class="hint"><%: T("Copy this html to add this image to your site.") %></p>
</li>
</ul>
</div>--%>
<% } %>
</div>

View File

@@ -0,0 +1,74 @@
@model Orchard.Media.ViewModels.MediaItemEditViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
<h1>@Html.TitleForPage(T("Edit Media - {0}", Model.Name).ToString())</h1>
<div class="breadCrumbs">
<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;
}
@T("Edit Media")</p>
</div>
<div class="sections clearBoth">
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
<div class="primary">
<div>
<img src="@Model.PublicUrl" class="previewImage" alt="@Model.Caption" />
</div>
<fieldset>
<%-- todo: make these real (including markup) --%>
<div>
<label>@T("Dimensions: <span>500 x 375 pixels</span>")</label>
<label>@T("Size: <span>{0}</span>", Model.Size)</label>
<label>@T("Added on: <span>{0} by Orchard User</span>", Model.LastUpdated)</label>
</div>
<div>
<label for="embedPath">@T("Embed:")</label>
<input id="embedPath" class="textMedium" name="embedPath" type="text" readonly="readonly" value="<%: string.Format("<img src=\"{0}\" width=\"{1}\" height=\"{2}\" alt=\"{3}\" />", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375, Model.Caption)%>" />
<span class="hint">@T("Copy this html to add this image to your site.")</span>
</div>
<div>
<label for="Name">@T("Name")</label>
<input id="Name" name="Name" type="hidden" value="@Model.Name"/>
<input id="NewName" class="textMedium" name="NewName" type="text" value="@Model.Name"/>
</div>
<div>
<label for="Caption">@T("Caption")</label>
<input id="Caption" class="textMedium" name="Caption" type="text" value="@Model.Caption"/>
<span class="hint">@T("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 primaryAction" name="submit.Save" value="@T("Save")" />
</fieldset>
</div>
<%--<div class="secondary" style="border:1px solid #ff0000;">
<h2>@T("Preview")</h2>
<div><img src="<%=ResolveUrl("~/Media/" + Html.Encode(Model.RelativePath + "/" + Model.Name))%>" class="previewImage" alt="@Model.Caption" /></div>
<ul>
<%-- 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">@T("Embed:")</label>
<input id="embedPath" class="text" name="embedPath" type="text" readonly="readonly" value="@T("<img src=\"{0}\" width=\"{1}\" height=\"{2}\" alt=\"{3}\" />", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375, Model.Caption)" />
<span class="hint">@T("Copy this html to add this image to your site.")</p>
</li>
</ul>
</div>--%>
}
</div>

View File

@@ -1,28 +0,0 @@
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderEditPropertiesViewModel>" %>
<%@ Import Namespace="Orchard.Media.Helpers"%>
<%@ Import Namespace="Orchard.Media.Models"%>
<%@ Import Namespace="Orchard.Media.ViewModels"%><%
Html.RegisterStyle("admin.css"); %>
<h1><%: Html.TitleForPage(T("Folder Properties").ToString())%></h1>
<div class="breadCrumbs">
<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;
<% } %>
<%: T("Folder Properties")%></p>
</div>
<% using (Html.BeginFormAntiForgeryPost()) { %>
<%: Html.ValidationSummary() %>
<fieldset>
<label for="Name"><%: T("Folder Name:") %></label>
<input id="MediaPath" name="MediaPath" type="hidden" value="<%: Model.MediaPath %>" />
<input id="Name" class="textMedium" name="Name" type="text" value="<%: Model.Name %>" />
</fieldset>
<fieldset>
<input type="submit" class="button primaryAction" name="submit.Save" value="<%: T("Save") %>" />
<%--<input type="submit" class="button buttonFocus roundCorners" name="submit.Delete" value="<%: T("Remove") %>" />--%>
</fieldset>
<% } %>

View File

@@ -0,0 +1,28 @@
@model Orchard.Media.ViewModels.MediaFolderEditPropertiesViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
<h1>@Html.TitleForPage(T("Folder Properties").ToString())</h1>
<div class="breadCrumbs">
<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;
}
@T("Folder Properties")</p>
</div>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
<fieldset>
<label for="Name">@T("Folder Name:")</label>
<input id="MediaPath" name="MediaPath" type="hidden" value="@Model.MediaPath" />
<input id="Name" class="textMedium" name="Name" type="text" value="@Model.Name" />
</fieldset>
<fieldset>
<input type="submit" class="button primaryAction" name="submit.Save" value="@T("Save")" />
<%--<input type="submit" class="button buttonFocus roundCorners" name="submit.Delete" value="@T("Remove")" />--%>
</fieldset>
}

View File

@@ -1,51 +0,0 @@
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<MediaFolderIndexViewModel>" %>
<%@ Import Namespace="Orchard.Media.ViewModels"%>
<h1><%: Html.TitleForPage(T("Manage Media Folders").ToString()) %></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<%: Html.ValidationSummary() %>
<fieldset class="bulk-actions">
<label for="publishActions"><%: T("Actions:") %></label>
<select id="Select1" name="publishActions">
<option value="1"><%: T("Remove")%></option>
</select>
<input class="button roundCorners" type="submit" value="<%: T("Apply") %>" />
</fieldset>
<div class="manage"><%: Html.ActionLink(T("Add a folder").ToString(), "Create", new { }, new { @class = "button primaryAction" })%></div>
<fieldset>
<table class="items" summary="<%: T("This is a table of the media folders currently available for use in your application.") %>">
<colgroup>
<col id="Col1" />
<col id="Col2" />
<col id="Col3" />
<col id="Col4" />
<col id="Col5" />
<col id="Col6" />
</colgroup>
<thead>
<tr>
<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("Author") %></th>
<th scope="col"><%: T("Last Updated") %></th>
<th scope="col"><%: T("Type") %></th>
<th scope="col"><%: T("Size") %></th>
</tr>
</thead>
<%foreach (var mediaFolder in Model.MediaFolders) {
%>
<tr>
<td><input type="checkbox" value="true" name="<%: T("Checkbox.{0}", mediaFolder.Name) %>"/></td>
<%-- todo: (heskew) this URL needs to be determined from current module location --%>
<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>
</fieldset>
<% } %>

View File

@@ -0,0 +1,50 @@
@model Orchard.Media.ViewModels.MediaFolderIndexViewModel
<h1>@Html.TitleForPage(T("Manage Media Folders").ToString())</h1>
@using(Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
<fieldset class="bulk-actions">
<label for="publishActions">@T("Actions:")</label>
<select id="Select1" name="publishActions">
<option value="1">@T("Remove")</option>
</select>
<input class="button roundCorners" type="submit" value="@T("Apply")" />
</fieldset>
<div class="manage">@Html.ActionLink(T("Add a folder").ToString(), "Create", new { }, new { @class = "button primaryAction" })</div>
<fieldset>
<table class="items" summary="@T("This is a table of the media folders currently available for use in your application.")">
<colgroup>
<col id="Col1" />
<col id="Col2" />
<col id="Col3" />
<col id="Col4" />
<col id="Col5" />
<col id="Col6" />
</colgroup>
<thead>
<tr>
<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("Author")</th>
<th scope="col">@T("Last Updated")</th>
<th scope="col">@T("Type")</th>
<th scope="col">@T("Size")</th>
</tr>
</thead>
@foreach (var mediaFolder in Model.MediaFolders) {
<tr>
<td><input type="checkbox" value="true" name="@T("Checkbox.{0}", mediaFolder.Name)"/></td>
<%-- todo: (heskew) this URL needs to be determined from current module location --%>
<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>
</fieldset>
}

View File

@@ -1,10 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<MediaSettingsPartRecord>" %>
<%@ Import Namespace="Orchard.Media.Models"%>
<fieldset>
<legend><%: T("Media")%></legend>
<div>
<label for="MediaSettings_RootMediaFolder">Media folder</label>
<%: Html.EditorFor(x=>x.RootMediaFolder) %>
<%: Html.ValidationMessage("RootMediaFolder", "*")%>
</div>
</fieldset>

View File

@@ -0,0 +1,10 @@
@model Orchard.Media.Models.MediaSettingsPartRecord
<fieldset>
<legend>@T("Media")</legend>
<div>
<label for="MediaSettings_RootMediaFolder">Media folder</label>
@Html.EditorFor(x=>x.RootMediaFolder)
@Html.ValidationMessage("RootMediaFolder", "*")
</div>
</fieldset>

View File

@@ -89,7 +89,7 @@ namespace Orchard.Setup.Services {
//"Orchard.Blogs", //"Orchard.Blogs",
//"Orchard.Comments", //"Orchard.Comments",
"Orchard.Tags", "Orchard.Tags",
//"Orchard.Media", "Orchard.Media",
//"Futures.Widgets" //"Futures.Widgets"
"Orchard.DevTools" "Orchard.DevTools"

View File

@@ -1,7 +1,7 @@
@model Orchard.Tags.ViewModels.TagsAdminIndexViewModel @model Orchard.Tags.ViewModels.TagsAdminIndexViewModel
<h1>@Html.TitleForPage(T("Manage Tags").ToString()) </h1> <h1>@Html.TitleForPage(T("Manage Tags").ToString()) </h1>
@using (Html.BeginFormAntiForgeryPost()) { @using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary() @Html.ValidationSummary()
<fieldset class="bulk-actions"> <fieldset class="bulk-actions">
@@ -29,7 +29,7 @@
@foreach (var tagEntry in Model.Tags) { @foreach (var tagEntry in Model.Tags) {
<tr> <tr>
<td> <td>
<input type="hidden" value="<%=Model.Tags[tagIndex].Tag.Id%>" name="@Html.NameOf(m => m.Tags[ti].Tag.Id)"/> <input type="hidden" value="@Model.Tags[tagIndex].Tag.Id" name="@Html.NameOf(m => m.Tags[ti].Tag.Id)"/>
<input type="checkbox" value="true" name="@Html.NameOf(m => m.Tags[ti].IsChecked)"/> <input type="checkbox" value="true" name="@Html.NameOf(m => m.Tags[ti].IsChecked)"/>
</td> </td>
<td> <td>
@@ -42,4 +42,4 @@
} }
</table> </table>
</fieldset> </fieldset>
} }

View File

@@ -62,6 +62,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Tags", "Orchard.Web
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyMce", "Orchard.Web\Modules\TinyMce\TinyMce.csproj", "{954CA994-D204-468B-9D69-51F6AD3E1C29}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyMce", "Orchard.Web\Modules\TinyMce\TinyMce.csproj", "{954CA994-D204-468B-9D69-51F6AD3E1C29}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Media", "Orchard.Web\Modules\Orchard.Media\Orchard.Media.csproj", "{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
CodeCoverage|Any CPU = CodeCoverage|Any CPU CodeCoverage|Any CPU = CodeCoverage|Any CPU
@@ -311,6 +313,16 @@ Global
{954CA994-D204-468B-9D69-51F6AD3E1C29}.FxCop|Any CPU.Build.0 = Release|Any CPU {954CA994-D204-468B-9D69-51F6AD3E1C29}.FxCop|Any CPU.Build.0 = Release|Any CPU
{954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.ActiveCfg = Release|Any CPU {954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.Build.0 = Release|Any CPU {954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.Build.0 = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Coverage|Any CPU.Build.0 = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.FxCop|Any CPU.Build.0 = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@@ -326,6 +338,7 @@ Global
{0E7646E8-FE8F-43C1-8799-D97860925EC4} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {0E7646E8-FE8F-43C1-8799-D97860925EC4} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{5D0F00F0-26C9-4785-AD61-B85710C60EB0} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {5D0F00F0-26C9-4785-AD61-B85710C60EB0} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{954CA994-D204-468B-9D69-51F6AD3E1C29} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {954CA994-D204-468B-9D69-51F6AD3E1C29} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA} {ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA} {F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA} {6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}