--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-10-07 12:58:25 -07:00
163 changed files with 729 additions and 521 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -26,6 +26,7 @@ using Orchard.Mvc.Routes;
using Orchard.Tests.Environment.TestDependencies;
using Orchard.Tests.Stubs;
using Orchard.Tests.Utility;
using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider;
namespace Orchard.Tests.Environment {
[TestFixture]

View File

@@ -8,6 +8,7 @@ using NUnit.Framework;
using Orchard.Environment;
using Orchard.Mvc.ModelBinders;
using Orchard.Mvc.Routes;
using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider;
namespace Orchard.Tests.Environment {
[TestFixture]

View File

@@ -22,7 +22,7 @@ namespace Orchard.Tests.UI {
builder.RegisterType<DefaultWorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
builder.RegisterType<PageWorkContext>().As<IWorkContextStateProvider>();
builder.RegisterType<LayoutWorkContext>().As<IWorkContextStateProvider>();
//builder.RegisterType<CoreShapes>().As<IShapeTableProvider>();
builder.RegisterType<NumberIsAlwaysFortyTwo>().As<IShapeFactoryEvents>();
@@ -35,74 +35,74 @@ namespace Orchard.Tests.UI {
[Test, Ignore("implementation pending")]
public void WorkContextPageIsLayoutShape() {
var page = _workContext.Page;
ShapeMetadata pageMetadata = page.Metadata;
var layout = _workContext.Layout;
ShapeMetadata pageMetadata = layout.Metadata;
Assert.That(pageMetadata.Type, Is.EqualTo("Layout"));
Assert.That(page.Metadata.Type, Is.EqualTo("Layout"));
Assert.That(layout.Metadata.Type, Is.EqualTo("Layout"));
}
[Test, Ignore("implementation pending")]
public void PagePropertiesAreNil() {
var page = _workContext.Page;
var pageFoo = page.Foo;
var layout = _workContext.Layout;
var pageFoo = layout.Foo;
Assert.That(pageFoo == null);
}
[Test, Ignore("implementation pending")]
public void PageZonesPropertyIsNotNil() {
var page = _workContext.Page;
var pageZones = page.Zones;
var layout = _workContext.Layout;
var pageZones = layout.Zones;
Assert.That(pageZones != null);
Assert.That(pageZones.Foo == null);
}
[Test, Ignore("implementation pending")]
public void AddingToZonePropertyMakesItExist() {
var page = _workContext.Page;
Assert.That(page.Zones.Foo == null);
var layout = _workContext.Layout;
Assert.That(layout.Zones.Foo == null);
var pageZonesFoo = page.Zones.Foo;
var pageZonesFoo = layout.Zones.Foo;
pageZonesFoo.Add("hello");
Assert.That(page.Zones.Foo != null);
Assert.That(page.Foo != null);
Assert.That(page.Foo.Metadata.Type, Is.EqualTo("Zone"));
Assert.That(layout.Zones.Foo != null);
Assert.That(layout.Foo != null);
Assert.That(layout.Foo.Metadata.Type, Is.EqualTo("Zone"));
}
[Test, Ignore("implementation pending")]
public void AddingToZoneIndexedMakesItExist() {
var page = _workContext.Page;
Assert.That(page.Zones["Foo"] == null);
var layout = _workContext.Layout;
Assert.That(layout.Zones["Foo"] == null);
var pageZonesFoo = page.Zones["Foo"];
var pageZonesFoo = layout.Zones["Foo"];
pageZonesFoo.Add("hello");
Assert.That(page.Zones["Foo"] != null);
Assert.That(page["Foo"] != null);
Assert.That(page["Foo"].Metadata.Type, Is.EqualTo("Zone"));
Assert.That(layout.Zones["Foo"] != null);
Assert.That(layout["Foo"] != null);
Assert.That(layout["Foo"].Metadata.Type, Is.EqualTo("Zone"));
}
[Test, Ignore("implementation pending")]
public void CallingAddOnNilPropertyMakesItBecomeZone() {
var page = _workContext.Page;
Assert.That(page.Foo == null);
var layout = _workContext.Layout;
Assert.That(layout.Foo == null);
page.Foo.Add("hello");
layout.Foo.Add("hello");
Assert.That(page.Foo != null);
Assert.That(page.Foo.Metadata.Type, Is.EqualTo("Zone"));
Assert.That(layout.Foo != null);
Assert.That(layout.Foo.Metadata.Type, Is.EqualTo("Zone"));
}
[Test, Ignore("implementation pending")]
public void ZoneContentsAreEnumerable() {
var page = _workContext.Page;
Assert.That(page.Foo == null);
var layout = _workContext.Layout;
Assert.That(layout.Foo == null);
page.Foo.Add("hello");
page.Foo.Add("world");
layout.Foo.Add("hello");
layout.Foo.Add("world");
var list = new List<object>();
foreach (var item in page.Foo) {
foreach (var item in layout.Foo) {
list.Add(item);
}
@@ -126,11 +126,11 @@ namespace Orchard.Tests.UI {
[Test, Ignore("implementation pending")]
public void NumberIsFortyTwo() {
var page = _workContext.Page;
Assert.That(page.Number, Is.EqualTo(42));
Assert.That(page.Foo.Number == null);
page.Foo.Add("yarg");
Assert.That(page.Foo.Number, Is.EqualTo(42));
var layout = _workContext.Layout;
Assert.That(layout.Number, Is.EqualTo(42));
Assert.That(layout.Foo.Number == null);
layout.Foo.Add("yarg");
Assert.That(layout.Foo.Number, Is.EqualTo(42));
}
}

View File

@@ -1,3 +1,3 @@
@model Orchard.Core.Common.Fields.TextField
@using Orchard.Utility.Extensions
@using Orchard.Utility.Extensions;
<p class="text-field"><span class="name">@Model.Name.CamelFriendly():</span> @Model.Value</p>

View File

@@ -1,5 +1,5 @@
@model BodyDisplayViewModel
@using Orchard.Core.Common.ViewModels
@using Orchard.Core.Common.ViewModels;
<div class="manage">
@Html.ItemEditLinkWithReturnUrl(T("Edit").ToString(), Model.BodyPart.ContentItem)
</div>

View File

@@ -1,7 +1,7 @@
@model BodyDisplayViewModel
@using Orchard.Core.Common.ViewModels
@/* begin: knowingly broken HTML (hence the ManageWrapperPre and ManageWrapperPost templates)
@using Orchard.Core.Common.ViewModels;
@* begin: knowingly broken HTML (hence the ManageWrapperPre and ManageWrapperPost templates)
we need "wrapper templates" (among other functionality) in the future of UI composition
please do not delete or the front end will be broken when the user is authenticated. */
please do not delete or the front end will be broken when the user is authenticated. *@
</div>
@/* begin: knowingly broken HTML */
@* begin: knowingly broken HTML *@

View File

@@ -1,3 +1,3 @@
@model BodyDisplayViewModel
@using Orchard.Core.Common.ViewModels
@using Orchard.Core.Common.ViewModels;
<div class="managewrapper">

View File

@@ -1,8 +1,8 @@
@model BodyDisplayViewModel
@using Orchard.Core.Common.ViewModels
@/*//doing excerpt generation on the way out for now so we don't stick ourselves with needing to regen excerpts for existing data
//also, doing this here, inline, until we have a pluggable processing model (both in and out)
//also, ...this is ugly*/
@using Orchard.Core.Common.ViewModels;
@*doing excerpt generation on the way out for now so we don't stick ourselves with needing to regen excerpts for existing data
also, doing this here, inline, until we have a pluggable processing model (both in and out)
also, ...this is ugly *@
@{
var body = new HtmlString(Html.Excerpt(Model.Html.ToString(), 200).ToString().Replace(Environment.NewLine, "</p>" + Environment.NewLine + "<p>"));
}

View File

@@ -1,3 +1,3 @@
@model BodyDisplayViewModel
@using Orchard.Core.Common.ViewModels
@using Orchard.Core.Common.ViewModels;
@Model.Html

View File

@@ -1,5 +1,5 @@
@model Orchard.Core.Common.ViewModels.CommonMetadataViewModel
@using Orchard.Core.Common.Extensions
@using Orchard.Core.Common.Extensions;
@if (Model.Creator != null) {
<div class="metadata">
<div class="posted">@T("Published by {0} {1}", Model.Creator.UserName, Html.PublishedWhen(Model, T))</div>

View File

@@ -1,5 +1,5 @@
@model BodyEditorViewModel
@using Orchard.Core.Common.ViewModels
@using Orchard.Core.Common.ViewModels;
<fieldset>
<label>@T("Body")</label>
@Html.Partial("EditorTemplates/" + Model.TextEditorTemplate, Model)

View File

@@ -1,5 +1,5 @@
@model ContainerEditorViewModel
@using Orchard.Core.Common.ViewModels
@using Orchard.Core.Common.ViewModels;
<fieldset>
@Html.HiddenFor(m=>m.ContainerId)
</fieldset>

View File

@@ -1,5 +1,5 @@
@model OwnerEditorViewModel
@using Orchard.Core.Common.ViewModels
@using Orchard.Core.Common.ViewModels;
<fieldset>
@Html.LabelFor(m=>m.Owner)
@Html.EditorFor(m=>m.Owner)

View File

@@ -1,3 +1,3 @@
@model BodyEditorViewModel
@using Orchard.Core.Common.ViewModels
@using Orchard.Core.Common.ViewModels;
@Html.TextArea("Text", Model.Text, 25, 80, new { @class = Model.Format })

View File

@@ -1,4 +1,4 @@
@using Orchard.Core.Contents.ViewModels
@using Orchard.Core.Contents.ViewModels;
@{
var typeDisplayName = Model.TypeDisplayName;
var pageTitle = T("Manage Content");

View File

@@ -1,5 +1,5 @@
@using Orchard.ContentManagement
@using Orchard.Utility.Extensions
@using Orchard.ContentManagement;
@using Orchard.Utility.Extensions;
@{
Script.Require("ShapesBase");
}

View File

@@ -1,5 +1,5 @@
@using Orchard.ContentManagement
@using Orchard.Utility.Extensions
@using Orchard.ContentManagement;
@using Orchard.Utility.Extensions;
@{
ContentItem contentItem = Model.ContentItem;
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();

View File

@@ -18,10 +18,10 @@ namespace Orchard.Core.Feeds.Services {
dynamic Shape { get; set; }
public void OnResultExecuting(ResultExecutingContext filterContext) {
var page =_workContextAccessor.GetContext(filterContext).Page;
var layout = _workContextAccessor.GetContext(filterContext).Layout;
var feed = Shape.Feed()
.FeedManager(_feedManager);
page.Zones.Head.Add(feed, ":after");
layout.Zones.Head.Add(feed, ":after");
}
public void OnResultExecuted(ResultExecutedContext filterContext) {}

View File

@@ -1,5 +1,5 @@
@model AddLocalizationViewModel
@using Orchard.Core.Localization.ViewModels
@using Orchard.Core.Localization.ViewModels;
@{
dynamic content = Model.Content;
content.Zones.primary.Add(New.Partial(TemplateName: "CultureSelection", Model: Model), "0");

View File

@@ -1,6 +1,6 @@
@model MessageSettingsPartViewModel
@using Orchard.Core.Messaging.Models
@using Orchard.Core.Messaging.ViewModels
@using Orchard.Core.Messaging.Models;
@using Orchard.Core.Messaging.ViewModels;
<fieldset>
<legend>@T("Messaging")</legend>
<div>

View File

@@ -1,7 +1,7 @@
@model NavigationManagementViewModel
@using Orchard.ContentManagement
@using Orchard.Core.Navigation.Models
@using Orchard.Core.Navigation.ViewModels
@using Orchard.ContentManagement;
@using Orchard.Core.Navigation.Models;
@using Orchard.Core.Navigation.ViewModels;
<h1>@Html.TitleForPage(T("Manage Main Menu").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {

View File

@@ -1,6 +1,6 @@
@model MenuPart
@using Orchard.Core.Navigation.Models
@using Orchard.Core.Navigation.ViewModels
@using Orchard.Core.Navigation.Models;
@using Orchard.Core.Navigation.ViewModels;
@{
Script.Require("ShapesBase");
}

View File

@@ -1,6 +1,6 @@
@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel
<ul class="pageStatus">
<li>@// Published or not
<li>@* Published or not *@
@if (Model.HasPublished) {
<img class="icon" src="@Href("~/Core/PublishLater/Content/Admin/images/online.gif")" alt="@T("Online")" title="@T("The page is currently online")" /> <text>@T("Published")&nbsp;&#124;&nbsp;</text>
}
@@ -9,7 +9,7 @@
}
</li>
<li>
@// Does the page have a draft
@* Does the page have a draft *@
@if (Model.HasDraft) {
<img class="icon" src="@Href("~/Core/PublishLater/Content/Admin/images/draft.gif")" alt="@T("Draft")" title="@T("The page has a draft")" /><text> @T("Draft")&nbsp;&#124;&nbsp;</text>
}

View File

@@ -28,7 +28,7 @@
</div>
</fieldset>
<script type="text/javascript"> $(function () {
@//todo: (heskew) make a plugin
@* todo: (heskew) make a plugin *@
$("label.forpicker").each(function () {
var $this = $(this);
var pickerInput = $("#" + $this.attr("for"));

View File

@@ -1,5 +1,5 @@
@model DisplayReportViewModel
@using Orchard.Core.Reports.ViewModels
@using Orchard.Core.Reports.ViewModels;
<h1>@Html.TitleForPage(T("Display Report").ToString())</h1>
@using(Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()

View File

@@ -1,5 +1,5 @@
@model ReportsAdminIndexViewModel
@using Orchard.Core.Reports.ViewModels
@using Orchard.Core.Reports.ViewModels;
<h1>@Html.TitleForPage(T("Manage Reports").ToString())</h1>
@using(Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()

View File

@@ -1,5 +1,5 @@
@model Orchard.Core.Routable.ViewModels.RoutableEditorViewModel
@using Orchard.Utility.Extensions
@using Orchard.Utility.Extensions;
@{ Script.Require("Slugify"); }
<fieldset>

View File

@@ -1,5 +1,5 @@
@model SiteCulturesViewModel
@using Orchard.Core.Settings.ViewModels
@using Orchard.Core.Settings.ViewModels;
<h1>@Html.TitleForPage(T("Cultures").ToString())</h1>
<p class="breadcrumb">@Html.ActionLink(T("Manage Settings").Text, "index")@T(" &#62; ")@T("Supported Cultures")</p>
<h3>@T("Available Cultures")</h3>

View File

@@ -1,5 +1,5 @@
@model Orchard.Core.Settings.ViewModels.SiteSettingsPartViewModel
@using Orchard.Settings
@using Orchard.Settings;
@{
var resourceDebugMode = new SelectList(new object[] {
new { Id = (int)ResourceDebugMode.FromAppSetting, Text = "Use web.config setting" },

View File

@@ -36,14 +36,14 @@ namespace Orchard.Core.Shapes {
.Configure(descriptor => descriptor.Wrappers.Add("Document"))
.OnCreating(creating => creating.Behaviors.Add(new ZoneHoldingBehavior(name => CreateZone(creating, name))))
.OnCreated(created => {
var page = created.Shape;
page.Head = created.New.DocumentZone();
page.Body = created.New.DocumentZone();
page.Tail = created.New.DocumentZone();
page.Content = created.New.Zone();
var layout = created.Shape;
layout.Head = created.New.DocumentZone();
layout.Body = created.New.DocumentZone();
layout.Tail = created.New.DocumentZone();
layout.Content = created.New.Zone();
page.Body.Add(created.New.PlaceChildContent(Source: page));
page.Content.Add(created.New.PlaceChildContent(Source: page));
layout.Body.Add(created.New.PlaceChildContent(Source: layout));
layout.Content.Add(created.New.PlaceChildContent(Source: layout));
});
// 'Zone' shapes are built on the Zone base class
@@ -64,7 +64,6 @@ namespace Orchard.Core.Shapes {
var zone = context.New.Zone();
zone.Id = "zone-" + name;
zone.Classes.Add(zone.Id);
zone.Classes.Add("zone");
return zone;
}

View File

@@ -1,5 +1,5 @@
@using Orchard.Mvc.Html
@using Orchard.UI.Resources
@using Orchard.Mvc.Html;
@using Orchard.UI.Resources;
@{
RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content("~/modules/orchard.themes/Content/orchard.ico")});
}
@@ -12,8 +12,8 @@
//todo: (heskew) have resource modules that can be leaned on (like a jQuery module that knows about various CDNs and jQuery's version and min naming schemes)
//todo: (heskew) this is an interim solution to inlude jQuery in every page and still allow that to be overriden in some theme by it containing a headScripts partial
}
@//Model.Zones.AddRenderPartial("head:before", "HeadPreload", Model);
@//Html.Zone("head", ":metas :styles :scripts"); %>
@* Model.Zones.AddRenderPartial("head:before", "HeadPreload", Model); *@
@* Html.Zone("head", ":metas :styles :scripts"); %> *@
@Display(Model.Head)
<script>(function(d){d.className="dyn"+d.className.substring(6,d.className.length);})(document.documentElement);</script>
</head>

View File

@@ -1,4 +1,4 @@
@// Html.RegisterStyle("site.css");
@* Html.RegisterStyle("site.css"); *@
@{
Model.Header.Add(Display.Header(), "5");
Model.Header.Add(Display.User(), "10");

View File

@@ -1,4 +1,4 @@
@using System.Web.Mvc
@using System.Web.Mvc;
<div class="user-display">
@if (Request.IsAuthenticated) {
@T("Welcome, <strong>{0}</strong>!", WorkContext.CurrentUser.UserName)

View File

@@ -3,6 +3,7 @@ using System.Web.Mvc;
using System.Xml;
using System.Xml.Linq;
using Orchard.Mvc.ModelBinders;
using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider;
namespace Orchard.Core.XmlRpc.Models {
public class ModelBinderProvider : IModelBinderProvider, IModelBinder {

View File

@@ -1,5 +1,5 @@
@model Orchard.ArchiveLater.ViewModels.ArchiveLaterViewModel
@using Orchard.Mvc.Html
@using Orchard.Mvc.Html;
@if ((Model.IsPublished && Model.ScheduledArchiveUtc.HasValue && Model.ScheduledArchiveUtc.Value > DateTime.UtcNow)) {
<ul class="pageStatus">

View File

@@ -1,5 +1,5 @@
@model Orchard.ArchiveLater.ViewModels.ArchiveLaterViewModel
@using System.Web.Mvc.Html
@using System.Web.Mvc.Html;
@{
Style.Require("jQueryUtils_TimePicker");
Style.Require("jQueryUI_DatePicker");

View File

@@ -35,7 +35,7 @@ namespace Orchard.Blogs.Filters {
BlogPart blog = model.ContentItem.Get(typeof (BlogPart));
var blogArchives = shape.BlogArchives()
.Archives(new BlogPostArchiveViewModel { BlogPart = blog, Archives = _blogPostService.GetArchives(blog) });
workContext.Page.Sidebar.Add(blogArchives);
workContext.Layout.Sidebar.Add(blogArchives);
return;
}
@@ -43,7 +43,7 @@ namespace Orchard.Blogs.Filters {
BlogPart blog = model.Blog.ContentItem.Get(typeof (BlogPart));
var blogArchives = shape.BlogArchives()
.Archives(new BlogPostArchiveViewModel { BlogPart = blog, Archives = _blogPostService.GetArchives(blog) });
workContext.Page.Sidebar.Add(blogArchives);
workContext.Layout.Sidebar.Add(blogArchives);
return;
}
}

View File

@@ -1,4 +1,4 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.Extensions;
<h1>@Html.TitleForPage(T("Manage Blogs").ToString())</h1>
@if (Model.ContentItems.Items.Count > 0) {
<div class="actions"><a class="add button primaryAction" href="@Url.BlogCreate()">@T("New Blog")</a></div>

View File

@@ -1,5 +1,5 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.ViewModels
@using Orchard.Blogs.Extensions;
@using Orchard.Blogs.ViewModels;
@{
BlogPostArchiveViewModel model = Model.Archives;
Style.Require("BlogsArchives");

View File

@@ -1,4 +1,4 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.Extensions;
<h1 class="page-title">@Html.TitleForPage(T("Archives").Text, (string)Model.ArchiveData.Year.ToString(), (string)(Model.ArchiveData.Month > 0 ? new DateTime(Model.ArchiveData.Year, Model.ArchiveData.Month, 1).ToString("MMMM") : null), (string)(Model.ArchiveData.Day > 0 ? Model.ArchiveData.Day.ToString() : null))</h1>
<div class="archive-trail">
@T("Archives") /

View File

@@ -1,4 +1,4 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.Extensions;
@{
Style.Require("BlogsAdmin");
}

View File

@@ -1,5 +1,5 @@
@using Orchard.Core.Contents.ViewModels
@using Orchard.Utility.Extensions
@using Orchard.Core.Contents.ViewModels;
@using Orchard.Utility.Extensions;
@if (Model.Items.Count > 0) {
using (Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" }))) {
<fieldset class="bulk-actions">

View File

@@ -1,5 +1,5 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.Models
@using Orchard.Blogs.Extensions;
@using Orchard.Blogs.Models;
<h1><a href="@Url.BlogForAdmin((string)Model.Slug)">@Html.TitleForPage((string)Model.Title)</a></h1>
@Display(Model.manage)
<div class="manage"><a href="@Url.BlogPostCreate((BlogPart)Model.ContentItem.Get(typeof(BlogPart)))" class="add button primaryAction">@T("New Post")</a></div>

View File

@@ -1,5 +1,5 @@
@using Orchard.Blogs.Extensions
@using Orchard.UI.Resources
@using Orchard.Blogs.Extensions;
@using Orchard.UI.Resources;
@{
RegisterLink(new LinkEntry { Rel = "wlwmanifest", Type = "application/wlwmanifest+xml", Href = Url.BlogLiveWriterManifest((string)Model.Slug) });
RegisterLink(new LinkEntry { Rel = "EditURI", Type = "application/rsd+xml", Title = "RSD", Href = Url.BlogRsd((string)Model.Slug) });

View File

@@ -1,4 +1,4 @@
@using Orchard.Blogs.Models
@using Orchard.Blogs.Models;
@{
Html.AddTitleParts((string)Model.Title);
BlogPostPart blogPost = Model.ContentItem.Get(typeof(BlogPostPart));
@@ -11,7 +11,7 @@
@Display(Model.secondary)
<fieldset>
<input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/>
@//TODO: (erikpo) In the future, remove the HasPublished check so the user can delete the content item from here if the choose to
@* TODO: (erikpo) In the future, remove the HasPublished check so the user can delete the content item from here if the choose to *@
@if (blogPost.HasDraft && blogPost.HasPublished) {
@Html.AntiForgeryTokenValueOrchardLink(T("Discard Draft").ToString(), Url.Action("DiscardDraft", new {Area = "Orchard.Blogs", Controller = "BlogPostAdmin", id = Model.Item.Id}), new {@class = "button"})
}

View File

@@ -1,5 +1,5 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.Models
@using Orchard.Blogs.Extensions;
@using Orchard.Blogs.Models;
<h2>@Html.Link((string)Model.Title, Url.Blog((string)Model.Slug))</h2>
@if (!string.IsNullOrEmpty((string)Model.Description)) {
<p>@Model.Description</p>

View File

@@ -1,8 +1,8 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.Models
@using Orchard.Core.Common.Extensions
@using Orchard.Core.Common.Models
@using Orchard.Core.Common.ViewModels
@using Orchard.Blogs.Extensions;
@using Orchard.Blogs.Models;
@using Orchard.Core.Common.Extensions;
@using Orchard.Core.Common.Models;
@using Orchard.Core.Common.ViewModels;
<h2>@Html.Link((string)Model.Title, Url.BlogPost((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart))))</h2>
<div class="meta">@Html.PublishedState(new CommonMetadataViewModel((CommonPart)Model.ContentItem.Get(typeof(CommonPart))), T) | @Display(Model.meta)</div>
<div class="content">@Display(Model.primary)</div>

View File

@@ -1,12 +1,12 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.Models
@using Orchard.Blogs.Extensions;
@using Orchard.Blogs.Models;
<div class="summary">
<div class="related">
<a href="@Url.Blog((string)Model.Slug)" title="@T("View")">@T("View")</a>@T(" | ")
<a href="@Url.BlogForAdmin((string)Model.Slug)" title="@T("List Posts")">@T("List Posts")</a>@T(" | ")
<a href="@Url.BlogPostCreate((BlogPart)Model.ContentItem.Get(typeof(BlogPart)))" title="@T("New Post")">@T("New Post")</a>@T(" | ")
<a href="@Url.BlogEdit((string)Model.Slug)" title="@T("Edit")">@T("Edit")</a>@T(" | ")
@//todo: (heskew) this is a bit too verbose. need template helpers for all ibuttons
@* todo: (heskew) this is a bit too verbose. need template helpers for all ibuttons *@
@using (Html.BeginFormAntiForgeryPost(Url.BlogRemove((string)Model.Slug), FormMethod.Post, new { @class = "inline link" })) {
<button type="submit" class="linkButton" title="@T("Remove")">@T("Remove")</button>
}
@@ -14,7 +14,7 @@
<div class="properties">
<h3>@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))</h3>
<p>@Display(Model.meta)</p>
@//<p>[list of authors] [modify blog access]</p>
@* <p>[list of authors] [modify blog access]</p> *@
<p>@Model.Description</p>
</div>
<div style="clear:both;"></div>

View File

@@ -1,7 +1,7 @@
@using Orchard.Blogs.Extensions
@using Orchard.Blogs.Models
@using Orchard.ContentManagement
@using Orchard.Utility.Extensions
@using Orchard.Blogs.Extensions;
@using Orchard.Blogs.Models;
@using Orchard.ContentManagement;
@using Orchard.Utility.Extensions;
@{
ContentItem contentItem = Model.ContentItem;
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();

View File

@@ -1,6 +1,6 @@
@model Orchard.Comments.ViewModels.CommentsDetailsViewModel
@using Orchard.Comments.Models
@using Orchard.Comments.ViewModels
@using Orchard.Comments.Models;
@using Orchard.Comments.ViewModels;
<h1>@Html.TitleForPage(T("Comments for {0}", Model.DisplayNameForCommentedItem).ToString())</h1>
<div class="manage">

View File

@@ -1,5 +1,5 @@
@model Orchard.Comments.ViewModels.CommentsEditViewModel
@using Orchard.Comments.Models
@using Orchard.Comments.Models;
<h1>@Html.TitleForPage(T("Edit Comment").ToString())</h1>
@using(Html.BeginFormAntiForgeryPost()) {

View File

@@ -1,6 +1,6 @@
@model Orchard.Comments.ViewModels.CommentsIndexViewModel
@using Orchard.Comments.Models
@using Orchard.Comments.ViewModels
@using Orchard.Comments.Models;
@using Orchard.Comments.ViewModels;
<h1>@Html.TitleForPage(T("Manage Comments").ToString())</h1>
@using(Html.BeginFormAntiForgeryPost()) {

View File

@@ -1,8 +1,8 @@
@model Orchard.Comments.Models.CommentsPart
@using Orchard.Comments.Models
@using Orchard.Comments
@using Orchard.Security
@using Orchard.Utility.Extensions
@using Orchard.Comments.Models;
@using Orchard.Comments;
@using Orchard.Security;
@using Orchard.Utility.Extensions;
@if (Model.Comments.Count > 0) {
<h2 id="comments">@T.Plural("1 Comment", "{0} Comments", Model.Comments.Count)</h2>

View File

@@ -1,4 +1,4 @@
@model Orchard.Comments.ViewModels.CommentCountViewModel
@using Orchard.Comments.ViewModels
@using Orchard.Comments.ViewModels;
<span class="commentcount">@T.Plural("1 Comment", "{0} Comments", Model.CommentCount)</span>

View File

@@ -1,5 +1,5 @@
@model Orchard.Comments.ViewModels.CommentCountViewModel
@using Orchard.Comments.ViewModels
@using Orchard.Comments.Extensions
@using Orchard.Comments.ViewModels;
@using Orchard.Comments.Extensions;
<span class="commentcount">@Html.CommentSummaryLinks(T, Model.Item, Model.CommentCount, Model.PendingCount)</span>

View File

@@ -1,7 +1,7 @@
@model Orchard.Comments.Models.CommentsPart
@using Orchard.Comments.Models
@using Orchard.Comments.Extensions
@using Orchard.Localization
@using Orchard.Comments.Models;
@using Orchard.Comments.Extensions;
@using Orchard.Localization;
<fieldset>
<legend>@T("Comments")

View File

@@ -1,5 +1,5 @@
@model Orchard.Comments.Models.CommentSettingsPartRecord
@using Orchard.Comments.Models
@using Orchard.Comments.Models;
<fieldset>
<legend>@T("Comments")</legend>

View File

@@ -1,5 +1,5 @@
@model IEnumerable<Orchard.Comments.Models.CommentPart>
@using Orchard.Comments.Models
@using Orchard.Comments.Models;
<ul class="comments">
@foreach (var comment in Model) {

View File

@@ -9,9 +9,9 @@
<fieldset>
<label for="DisplayName">@T("Display Name")</label>
@Html.TextBoxFor(m => m.DisplayName, new { @class = "textMedium" })
@// todo: if we continue to go down the midrodata route, some helpers would be nice
@* todo: if we continue to go down the midrodata route, some helpers would be nice *@
<meta itemprop="DisplayName" content="@Model.DisplayName" />
@// has unintended consequences (renamging the type) - changing the name creates a new type of that name
@* has unintended consequences (renamging the type) - changing the name creates a new type of that name *@
<meta itemprop="Name" content="@Model.Name" />
@Html.HiddenFor(m => m.Name)
</fieldset>

View File

@@ -6,7 +6,7 @@
@Html.ValidationSummary()
<fieldset>
<label for="Name">@T("Name")</label>
@// has unintended consequences (renamging the part) - changing the name creates a new part of that name
@* has unintended consequences (renamging the part) - changing the name creates a new part of that name *@
@Html.TextBoxFor(m => m.Name, new {@class = "textMedium", disabled = "disabled"})
@Html.HiddenFor(m => m.Name)
</fieldset>

View File

@@ -1,5 +1,5 @@
@model Orchard.ContentTypes.ViewModels.EditTypeViewModel
@using Orchard.Core.Contents.Settings
@using Orchard.Core.Contents.Settings;
<div class="summary">
<div class="properties">
<h3>@Model.DisplayName</h3>@{ var creatable = Model.Settings.GetModel<ContentTypeSettings>().Creatable; }

View File

@@ -1,7 +1,7 @@
@model SettingsDictionary
@using Orchard.ContentManagement.MetaData.Models
@using Orchard.ContentManagement.MetaData.Models;
@if (Model.Any()) {
@/*<h4>@T("Global Settings")</h4>*/
@*<h4>@T("Global Settings")</h4>*@
<dl class="settings">@foreach (var setting in Model) {
<dt>@setting.Key</dt>
<dd>@setting.Value</dd>}

View File

@@ -2,7 +2,7 @@
<fieldset class="manage-field">
<h3>@Model.Name <span>(@Model.FieldDefinition.Name)</span></h3>
<div class="manage">
@Html.ActionLink(T("Remove").Text, "RemoveFieldFrom", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name }, new { itemprop = "RemoveUrl UnsafeUrl" }) @// <- some experimentation
@Html.ActionLink(T("Remove").Text, "RemoveFieldFrom", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name }, new { itemprop = "RemoveUrl UnsafeUrl" }) @* <- some experimentation *@
</div>
<div class="details">
@{Html.RenderTemplates(Model.Templates);}

View File

@@ -1,5 +1,5 @@
@model SettingsDictionary
@using Orchard.ContentManagement.MetaData.Models
@using Orchard.ContentManagement.MetaData.Models;
@if (Model.Any()) {
<fieldset>
@{

View File

@@ -2,7 +2,7 @@
<fieldset class="manage-part" itemscope="itemscope" itemid="@Model.PartDefinition.Name" itemtype="http://orchardproject.net/data/ContentTypePart">
<h3 itemprop="Name">@Model.PartDefinition.DisplayName</h3>
<div class="manage">
@Html.ActionLink(T("Remove").Text, "RemovePartFrom", new { area = "Orchard.ContentTypes", id = Model.Type.Name, Model.PartDefinition.Name }, new { itemprop = "RemoveUrl UnsafeUrl" }) @// <- some experimentation
@Html.ActionLink(T("Remove").Text, "RemovePartFrom", new { area = "Orchard.ContentTypes", id = Model.Type.Name, Model.PartDefinition.Name }, new { itemprop = "RemoveUrl UnsafeUrl" }) @* <- some experimentation *@
</div>
<div class="details">@Html.EditorFor(m => m.PartDefinition.Fields, "TypePartFields", "PartDefinition")
@if (Model.Templates.Any()) {
@@ -13,7 +13,7 @@
}
</div>
}
@//don't show global part settings for now - @Html.DisplayFor(m => m.PartDefinition.Settings, "Settings", "PartDefinition")
@* don't show global part settings for now - @Html.DisplayFor(m => m.PartDefinition.Settings, "Settings", "PartDefinition") *@
@Html.HiddenFor(m => m.PartDefinition.Name)
@Html.HiddenFor(m => m.Index)
</div>

View File

@@ -1,5 +1,5 @@
@model Orchard.Email.Models.SmtpSettingsPart
@using System.Net.Mail
@using System.Net.Mail;
<fieldset>
<legend>@T("SMTP")</legend>

View File

@@ -1,5 +1,5 @@
@using Orchard
@using Orchard.DisplayManagement.Descriptors
@using Orchard;
@using Orchard.DisplayManagement.Descriptors;
@{
var workContext = ViewContext.GetWorkContext();
var shapeTable = workContext.Resolve<IShapeTableManager>().GetShapeTable(workContext.CurrentTheme.ThemeName);

View File

@@ -1,6 +1,6 @@
@model Orchard.Media.ViewModels.MediaItemAddViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
@using Orchard.Media.Helpers;
@using Orchard.Media.Models;
@{ Style.Require("MediaAdmin"); }
<h1>@Html.TitleForPage(T("Add Media").ToString())</h1>

View File

@@ -1,6 +1,6 @@
@model Orchard.Media.ViewModels.MediaFolderCreateViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
@using Orchard.Media.Helpers;
@using Orchard.Media.Models;
@{ Style.Require("MediaAdmin"); }
<h1>@Html.TitleForPage(T("Add a Folder").ToString())</h1>

View File

@@ -1,6 +1,6 @@
@model Orchard.Media.ViewModels.MediaFolderEditViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
@using Orchard.Media.Helpers;
@using Orchard.Media.Models;
@{ Style.Require("MediaAdmin"); }
<h1>@Html.TitleForPage(T("Manage Folder").ToString())</h1>

View File

@@ -1,6 +1,6 @@
@model Orchard.Media.ViewModels.MediaItemEditViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
@using Orchard.Media.Helpers;
@using Orchard.Media.Models;
@{ Style.Require("MediaAdmin"); }
<h1>@Html.TitleForPage(T("Edit Media - {0}", Model.Name).ToString())</h1>

View File

@@ -1,6 +1,6 @@
@model Orchard.Media.ViewModels.MediaFolderEditPropertiesViewModel
@using Orchard.Media.Helpers
@using Orchard.Media.Models
@using Orchard.Media.Helpers;
@using Orchard.Media.Models;
@{ Style.Require("MediaAdmin"); }
<h1>@Html.TitleForPage(T("Folder Properties").ToString())</h1>

View File

@@ -1,5 +1,5 @@
@model ModuleAddViewModel
@using Orchard.Modules.ViewModels
@using Orchard.Modules.ViewModels;
@{
Style.Require("ModulesAdmin");
}

View File

@@ -1,9 +1,9 @@
@model FeaturesViewModel
@using Orchard.Localization
@using Orchard.Modules.Extensions
@using Orchard.Modules.ViewModels
@using Orchard.Utility.Extensions
@using Orchard.Modules.Models
@using Orchard.Localization;
@using Orchard.Modules.Extensions;
@using Orchard.Modules.ViewModels;
@using Orchard.Utility.Extensions;
@using Orchard.Modules.Models;
@{
Style.Require("ModulesAdmin");

View File

@@ -1,7 +1,7 @@
@model ModulesIndexViewModel
@using Orchard.Modules.Extensions
@using Orchard.Mvc.Html
@using Orchard.Modules.ViewModels
@using Orchard.Modules.Extensions;
@using Orchard.Mvc.Html;
@using Orchard.Modules.ViewModels;
@{
Style.Require("ModulesAdmin");

View File

@@ -1,5 +1,5 @@
@model Orchard.Environment.Configuration.ShellSettings
@using Orchard.MultiTenancy.Extensions
@using Orchard.MultiTenancy.Extensions;
@using(Html.BeginFormAntiForgeryPost(Url.Action("enable", new {area = "Orchard.MultiTenancy"}), FormMethod.Post, new {@class = "inline link"})) {
@Html.HiddenFor(ss => ss.Name)

View File

@@ -1,4 +1,4 @@
@model Orchard.Environment.Configuration.ShellSettings
@using Orchard.MultiTenancy.Extensions
@using Orchard.MultiTenancy.Extensions;
@Html.ActionLink(T("Make Valid*").ToString(), "_setup", new {tenantName = Model.Name, area = "Orchard.MultiTenancy"})

View File

@@ -1,5 +1,5 @@
@model Orchard.Environment.Configuration.ShellSettings
@using Orchard.MultiTenancy.Extensions
@using Orchard.MultiTenancy.Extensions;
@using(Html.BeginFormAntiForgeryPost(Url.Action("disable", new {area = "Orchard.MultiTenancy"}), FormMethod.Post, new {@class = "inline link"})) {
@Html.HiddenFor(ss => ss.Name)

View File

@@ -1,4 +1,4 @@
@model Orchard.Environment.Configuration.ShellSettings
@using Orchard.MultiTenancy.Extensions
@using Orchard.MultiTenancy.Extensions;
@Html.Link(T("Set Up").ToString(), Url.Tenant(Model))

View File

@@ -1,5 +1,5 @@
@model Orchard.MultiTenancy.ViewModels.TenantEditViewModel
@using Orchard.Environment.Configuration
@using Orchard.Environment.Configuration;
<h1>@Html.TitleForPage(T("Edit Tenant").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {

View File

@@ -1,5 +1,5 @@
@model Orchard.MultiTenancy.ViewModels.TenantsIndexViewModel
@using Orchard.MultiTenancy.Extensions
@using Orchard.MultiTenancy.Extensions;
@{ Style.Require("MultiTenancyAdmin"); }

View File

@@ -11,9 +11,11 @@ namespace Orchard.Packaging {
public void GetNavigation(NavigationBuilder builder) {
builder.Add(T("Gallery"), "5", menu => menu
.Add(T("Browse Gallery"), "1.0", item => item
.Action("Index", "Gallery", new { area = "Orchard.Packaging" }))
.Add(T("Gallery Feeds"), "2.0", item => item
.Add(T("Browse Modules"), "1.0", item => item
.Action("ModulesIndex", "Gallery", new { area = "Orchard.Packaging" }))
.Add(T("Browse Themes"), "2.0", item => item
.Action("ThemesIndex", "Gallery", new { area = "Orchard.Packaging" }))
.Add(T("Gallery Feeds"), "3.0", item => item
.Action("Sources", "Gallery", new { area = "Orchard.Packaging" })));
}
}

View File

@@ -63,7 +63,10 @@ namespace Orchard.Packaging.Commands {
Context.Output.WriteLine(T("Success"));
}
catch (WebException webException) {
var text = new StreamReader(webException.Response.GetResponseStream()).ReadToEnd();
string text = "";
if (webException.Response != null) {
text = new StreamReader(webException.Response.GetResponseStream()).ReadToEnd();
}
throw new ApplicationException(text);
}
}

View File

@@ -34,10 +34,14 @@ namespace Orchard.Packaging.Controllers {
Localizer T { get; set; }
public ActionResult Index() {
public ActionResult ModulesIndex() {
return Modules(Guid.Empty);
}
public ActionResult ThemesIndex() {
return Themes(Guid.Empty);
}
public ActionResult Sources() {
return View("Sources", new PackagingSourcesViewModel {
Sources = _packagingSourceManager.GetSources(),
@@ -47,7 +51,7 @@ namespace Orchard.Packaging.Controllers {
public ActionResult Remove(Guid id) {
_packagingSourceManager.RemoveSource(id);
_notifier.Information(T("The feed has been removed successfully."));
Update();
Update(null);
return RedirectToAction("Sources");
}
@@ -90,7 +94,7 @@ namespace Orchard.Packaging.Controllers {
_packagingSourceManager.AddSource(new PackagingSource { Id = Guid.NewGuid(), FeedUrl = url, FeedTitle = title });
_notifier.Information(T("The feed has been added successfully."));
Update();
Update(null);
return RedirectToAction("Sources");
}
catch ( Exception exception ) {
@@ -104,16 +108,26 @@ namespace Orchard.Packaging.Controllers {
var selectedSource = _packagingSourceManager.GetSources().Where(s => s.Id == sourceId).FirstOrDefault();
return View("Modules", new PackagingModulesViewModel {
Modules = _packagingSourceManager.GetModuleList(selectedSource),
Modules = _packagingSourceManager.GetModuleList(selectedSource).Where(p => p.SyndicationItem.Categories.All(c => c.Name == "Orchard Module" || c.Name != "Orchard Theme")),
Sources = _packagingSourceManager.GetSources().OrderBy(s => s.FeedTitle),
SelectedSource = selectedSource
});
}
public ActionResult Update() {
public ActionResult Themes(Guid? sourceId) {
var selectedSource = _packagingSourceManager.GetSources().Where(s => s.Id == sourceId).FirstOrDefault();
return View("Themes", new PackagingModulesViewModel {
Modules = _packagingSourceManager.GetModuleList(selectedSource).Where(p => p.SyndicationItem.Categories.Any(c => c.Name == "Orchard Theme")),
Sources = _packagingSourceManager.GetSources().OrderBy(s => s.FeedTitle),
SelectedSource = selectedSource
});
}
public ActionResult Update(string cameFrom) {
_packagingSourceManager.UpdateLists();
_notifier.Information(T("List of available modules and themes is updated."));
return RedirectToAction("Index");
return RedirectToAction(cameFrom == "Themes" ? "ThemesIndex" : "ModulesIndex");
}
public ActionResult Harvest(string extensionName, string feedUrl) {
@@ -147,16 +161,16 @@ namespace Orchard.Packaging.Controllers {
_packageManager.Push(packageData, model.FeedUrl, model.User, model.Password);
_notifier.Information(T("Harvested {0} and published onto {1}", model.ExtensionName, model.FeedUrl));
Update();
Update(null);
return RedirectToAction("Harvest", new { model.ExtensionName, model.FeedUrl });
}
public ActionResult Install(string syndicationId) {
public ActionResult Install(string syndicationId, string cameFrom) {
var packageData = _packageManager.Download(syndicationId);
_packageManager.Install(packageData.PackageStream);
_notifier.Information(T("Installed module"));
return RedirectToAction("Modules");
return RedirectToAction(cameFrom == "Themes" ? "ThemesIndex" : "ModulesIndex");
}
}
}

View File

@@ -121,6 +121,9 @@
<ItemGroup>
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Gallery\Themes.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.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.

View File

@@ -53,7 +53,7 @@ namespace Orchard.Packaging.Services {
}
public IEnumerable<PackagingEntry> GetModuleList(PackagingSource packagingSource = null) {
IEnumerable<PackagingEntry> packageInfos = ( packagingSource == null ? GetSources() : new[] { packagingSource } )
return (packagingSource == null ? GetSources() : new[] {packagingSource})
.SelectMany(
source =>
Bind(ParseFeed(GetModuleListForSource(source)),
@@ -64,11 +64,8 @@ namespace Orchard.Packaging.Services {
Source = source,
SyndicationFeed = feed,
SyndicationItem = item,
PackageStreamUri = item.Links.Single().GetAbsoluteUri().AbsoluteUri,
}))));
return packageInfos.ToArray();
PackageStreamUri = item.Links.Where(l => String.IsNullOrEmpty(l.RelationshipType)).FirstOrDefault().GetAbsoluteUri().AbsoluteUri,
})))).ToArray();
}
private string GetModuleListForSource(PackagingSource source) {

View File

@@ -1,9 +1,9 @@
@model Orchard.Packaging.ViewModels.PackagingModulesViewModel
@{ Style.Require("PackagingAdmin"); }
<h1>@Html.TitleForPage(T("Browse Gallery").ToString())</h1>
<h1>@Html.TitleForPage(T("Browse Gallery - Modules").ToString())</h1>
<div class="manage">@Html.ActionLink(T("Refresh").ToString(), "Update", new object{}, new { @class = "button primaryAction" })</div>
<div class="manage">@Html.ActionLink(T("Refresh").ToString(), "Update", new { cameFrom = "Modules" }, 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>
@@ -27,7 +27,7 @@
</div>
<div class="related">
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"SyndicationId",item.SyndicationItem.Id}})@T(" | ")
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"SyndicationId",item.SyndicationItem.Id},{"cameFrom", "Modules"}})@T(" | ")
<a href="@item.PackageStreamUri">@T("Download")</a>
</div>
@@ -41,4 +41,3 @@
</li>}
</ul>
}

View File

@@ -0,0 +1,49 @@
@model Orchard.Packaging.ViewModels.PackagingModulesViewModel
@{
Style.Require("PackagingAdmin");
Style.Require("ThemesAdmin");
}
<h1>@Html.TitleForPage(T("Browse Gallery - Themes").ToString())</h1>
<div class="manage">@Html.ActionLink(T("Refresh").ToString(), "Update", new { cameFrom = "Themes" }, new { @class = "button primaryAction" })</div>
@using ( Html.BeginFormAntiForgeryPost(Url.Action("Themes", "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="templates">
@foreach (var item in Model.Modules) {
<li>
@{
var author = item.SyndicationItem.Authors.Any() ? String.Join(", ", item.SyndicationItem.Authors.Select(a => a.Name)) : T("Unknown").Text;
var title = item.SyndicationItem.Title == null ? T("(No title)").Text : item.SyndicationItem.Title.Text;
var thumbnail = item.SyndicationItem.Links.Where(l=>l.RelationshipType=="thumbnail").Select(l=>l.Uri.ToString()).FirstOrDefault();
}
<div>
<h3>@title</h3>
@if(!String.IsNullOrEmpty(thumbnail)) {
@Html.Image(thumbnail, Html.Encode(title), null)
}
<br/>
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"SyndicationId",item.SyndicationItem.Id},{"cameFrom", "Themes" }}, new Dictionary<string, object> { { "class", "button" } })
<a class="button" href="@item.PackageStreamUri">@T("Download")</a>
<h5>@T("By") @author</h5>
<p>
@T("Version: {0}", "1.0")<br />
@(item.SyndicationItem.Summary == null ? T("(No description").Text : item.SyndicationItem.Summary.Text)<br />
</p>
</div>
</li>
}
</ul>
}

Some files were not shown because too many files have changed in this diff Show More