Migrating Orchard.Modules and Orchard.Packaging

--HG--
branch : theming
This commit is contained in:
Sebastien Ros
2010-09-10 13:14:07 -07:00
parent 2c19ba8ed2
commit f9de6ec621
32 changed files with 283 additions and 270 deletions

View File

@@ -1,14 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Packaging.ViewModels.PackagingAddSourceViewModel>" %>
<h1>
<%: Html.TitleForPage(T("Add a Feed").ToString())%></h1>
<%using ( Html.BeginFormAntiForgeryPost(Url.Action("AddSource")) ) { %>
<%: Html.ValidationSummary() %>
<fieldset>
<label for="Url"><%: T("Feed Url") %></label>
<input id="Url" class="textMedium" name="Url" type="text" value="<%: Model.Url %>"/>
</fieldset>
<fieldset>
<input type="submit" class="button primaryAction" value="<%: T("Add Feed") %>" />
</fieldset>
<% } %>

View File

@@ -0,0 +1,14 @@
@model Orchard.Packaging.ViewModels.PackagingAddSourceViewModel
<h1>
@Html.TitleForPage(T("Add a Feed").ToString())</h1>
@using ( Html.BeginFormAntiForgeryPost(Url.Action("AddSource")) ) {
@Html.ValidationSummary()
<fieldset>
<label for="Url">@T("Feed Url")</label>
<input id="Url" class="textMedium" name="Url" type="text" value="@Model.Url"/>
</fieldset>
<fieldset>
<input type="submit" class="button primaryAction" value="@T("Add Feed")" />
</fieldset>
}

View File

@@ -1,28 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Packaging.ViewModels.PackagingHarvestViewModel>" %>
<h1>
<%: Html.TitleForPage(T("Packaging").ToString(), T("Harvest Packages").ToString())%></h1>
<%: Html.Partial("_Subnav", Model) %>
<%using (Html.BeginFormAntiForgeryPost()) {%>
<%: Html.ValidationSummary(T("Package creation was unsuccessful. Please correct the errors and try again.").ToString()) %>
<%foreach (var group in Model.Extensions.Where(x => !x.Location.StartsWith("~/Core")).GroupBy(x => x.ExtensionType)) {%>
<fieldset>
<legend><%: T("Harvest") %>
<%:group.Key %></legend>
<ul>
<%foreach (var item in group) {%>
<li>
<label>
<%:Html.RadioButtonFor(m=>m.ExtensionName, item.Name, new Dictionary<string, object>{{"id",item.Name}}) %>
<%:item.DisplayName%></label></li><%
}%></ul>
<%} %>
<%: Html.ValidationMessageFor(m => m.ExtensionName)%>
</fieldset>
<fieldset>
<%: Html.LabelFor(m=>m.FeedUrl)%>
<%: Html.DropDownListFor(m => m.FeedUrl, new[]{new SelectListItem{Text=T("Download").ToString(),Value="Download"}}.Concat( Model.Sources.Select(x => new SelectListItem { Text = T("Push to {0}", x.FeedUrl).ToString(), Value = x.FeedUrl })))%>
<%: Html.ValidationMessageFor(m=>m.FeedUrl) %>
</fieldset>
<input type="submit" value="Harvest" />
<%} %>

View File

@@ -0,0 +1,30 @@
@model Orchard.Packaging.ViewModels.PackagingHarvestViewModel
<h1>
@Html.TitleForPage(T("Packaging").ToString(), T("Harvest Packages").ToString())</h1>
@Html.Partial("_Subnav", Model)
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary(T("Package creation was unsuccessful. Please correct the errors and try again.").ToString())
@foreach (var group in Model.Extensions.Where(x => !x.Location.StartsWith("~/Core")).GroupBy(x => x.ExtensionType)) {
<fieldset>
<legend>@T("Harvest") @group.Key</legend>
<ul>
@foreach (var item in group) {
<li>
<label>
@Html.RadioButtonFor(m=>m.ExtensionName, item.Name, new Dictionary<string, object>{{"id",item.Name}})
@item.DisplayName
</label>
</li>
}
</ul>
}
@Html.ValidationMessageFor(m => m.ExtensionName)
</fieldset>
<fieldset>
@Html.LabelFor(m=>m.FeedUrl)
@Html.DropDownListFor(m => m.FeedUrl, new[]{new SelectListItem{Text=T("Download").ToString(),Value="Download"}}.Concat( Model.Sources.Select(x => new SelectListItem { Text = T("Push to {0}", x.FeedUrl).ToString(), Value = x.FeedUrl })))
@Html.ValidationMessageFor(m=>m.FeedUrl)
</fieldset>
<input type="submit" value="Harvest" />
}

View File

@@ -1,50 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Packaging.ViewModels.PackagingModulesViewModel>" %>
<% Html.RegisterStyle("admin.css"); %>
<h1>
<%: Html.TitleForPage(T("Browse Gallery").ToString())%></h1>
<div class="manage">
<%:Html.ActionLink(T("Refresh").ToString(), "Update", new object{}, new { @class = "button primaryAction" }) %>
</div>
<% using ( Html.BeginFormAntiForgeryPost(Url.Action("Modules", "Gallery")) ) {%>
<fieldset class="bulk-actions">
<label for="filterResults" class="bulk-filter"><%:T("Feed:")%></label>
<select id="sourceId" name="sourceId">
<%:Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())%>
<%
foreach (var source in Model.Sources) {%>
<%:Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle)%><%
}%>
</select>
<button type="submit"><%:T("Apply")%></button>
</fieldset>
<%
} %>
<% if (Model.Modules.Count() > 0) { %>
<ul class="contentItems">
<%foreach (var item in Model.Modules) {%>
<li>
<div class="moduleName">
<h2><%: (item.SyndicationItem.Title == null ? T("(No title)").Text : item.SyndicationItem.Title.Text)%><span> - <%: T("Version: {0}", "1.0")%></span></h2>
</div>
<div class="related">
<%:Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"SyndicationId",item.SyndicationItem.Id}})%><%:T(" | ") %>
<a href="<%:item.PackageStreamUri%>"><%: T("Download") %></a>
</div>
<div class="properties">
<p><%: (item.SyndicationItem.Summary == null ? T("(No description").Text : item.SyndicationItem.Summary.Text) %></p>
<ul class="pageStatus">
<li><%: T("Last Updated: {0}", item.SyndicationItem.LastUpdatedTime.ToLocalTime()) %></li>
<li>&nbsp;&#124;&nbsp;<%: T("Author: {0}", item.SyndicationItem.Authors.Any() ? String.Join(", ", item.SyndicationItem.Authors.Select(a => a.Name)) : T("Unknown").Text)%></li>
</ul>
</div>
</li><%
}%>
</ul><%
}%>

View File

@@ -0,0 +1,44 @@
@model Orchard.Packaging.ViewModels.PackagingModulesViewModel
@Html.RegisterStyle("admin.css");
<h1>@Html.TitleForPage(T("Browse Gallery").ToString())</h1>
<div class="manage">@Html.ActionLink(T("Refresh").ToString(), "Update", new object{}, new { @class = "button primaryAction" })</div>
@using ( Html.BeginFormAntiForgeryPost(Url.Action("Modules", "Gallery")) ) {
<fieldset class="bulk-actions">
<label for="filterResults" class="bulk-filter">@T("Feed:")</label>
<select id="sourceId" name="sourceId">
@Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())
@foreach (var source in Model.Sources) {
Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle);
}
</select>
<button type="submit">@T("Apply")</button>
</fieldset>
}
@if (Model.Modules.Count() > 0) {
<ul class="contentItems">
@foreach (var item in Model.Modules) {
<li>
<div class="moduleName">
<h2>@(item.SyndicationItem.Title == null ? T("(No title)").Text : item.SyndicationItem.Title.Text)<span> - @T("Version: {0}", "1.0")</span></h2>
</div>
<div class="related">
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"SyndicationId",item.SyndicationItem.Id}})@T(" | ")
<a href="@item.PackageStreamUri">@T("Download")</a>
</div>
<div class="properties">
<p>@(item.SyndicationItem.Summary == null ? T("(No description").Text : item.SyndicationItem.Summary.Text)</p>
<ul class="pageStatus">
<li>@T("Last Updated: {0}", item.SyndicationItem.LastUpdatedTime.ToLocalTime())</li>
<li>&nbsp;&#124;&nbsp;@T("Author: {0}", item.SyndicationItem.Authors.Any() ? String.Join(", ", item.SyndicationItem.Authors.Select(a => a.Name)) : T("Unknown").Text)</li>
</ul>
</div>
</li>}
</ul>
}

View File

@@ -1,39 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Packaging.ViewModels.PackagingSourcesViewModel>" %>
<h1>
<%: Html.TitleForPage(T("Gallery Feeds").ToString())%></h1>
<div class="manage">
<%:Html.ActionLink(T("Add Feed").Text, "AddSource", new { }, new { @class = "button primaryAction" }) %>
</div>
<fieldset>
<table class="items" summary="<%: T("This is a table of the gallery feeds in your application") %>">
<colgroup>
<col id="Col1" />
<col id="Col2" />
<col id="Col3" />
</colgroup>
<thead>
<tr>
<th scope="col"><%: T("Title")%></th>
<th scope="col"><%: T("Url")%></th>
<th scope="col"></th>
</tr>
</thead>
<%
foreach ( var item in Model.Sources ) {
%>
<tr>
<td>
<%: item.FeedTitle %>
</td>
<td>
<%:Html.Link(item.FeedUrl, item.FeedUrl)%>
</td>
<td>
<%: Html.ActionLink(T("Remove").ToString(), "Remove", new { id = item.Id })%>
</td>
</tr>
<% } %>
</table>
</fieldset>

View File

@@ -0,0 +1,31 @@
@model Orchard.Packaging.ViewModels.PackagingSourcesViewModel
<h1>
@Html.TitleForPage(T("Gallery Feeds").ToString())</h1>
<div class="manage">
@Html.ActionLink(T("Add Feed").Text, "AddSource", new { }, new { @class = "button primaryAction" })
</div>
<fieldset>
<table class="items" summary="@T("This is a table of the gallery feeds in your application")">
<colgroup>
<col id="Col1" />
<col id="Col2" />
<col id="Col3" />
</colgroup>
<thead>
<tr>
<th scope="col">@T("Title")</th>
<th scope="col">@T("Url")</th>
<th scope="col"></th>
</tr>
</thead>
@foreach ( var item in Model.Sources ) {
<tr>
<td>@item.FeedTitle</td>
<td>@Html.Link(item.FeedUrl, item.FeedUrl)</td>
<td>@Html.ActionLink(T("Remove").ToString(), "Remove", new { id = item.Id })</td>
</tr>
}
</table>
</fieldset>