--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.Environment.TestDependencies;
using Orchard.Tests.Stubs; using Orchard.Tests.Stubs;
using Orchard.Tests.Utility; using Orchard.Tests.Utility;
using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider;
namespace Orchard.Tests.Environment { namespace Orchard.Tests.Environment {
[TestFixture] [TestFixture]

View File

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

View File

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

View File

@@ -1,3 +1,3 @@
@model Orchard.Core.Common.Fields.TextField @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> <p class="text-field"><span class="name">@Model.Name.CamelFriendly():</span> @Model.Value</p>

View File

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

View File

@@ -1,7 +1,7 @@
@model BodyDisplayViewModel @model BodyDisplayViewModel
@using Orchard.Core.Common.ViewModels @using Orchard.Core.Common.ViewModels;
@/* begin: knowingly broken HTML (hence the ManageWrapperPre and ManageWrapperPost templates) @* begin: knowingly broken HTML (hence the ManageWrapperPre and ManageWrapperPost templates)
we need "wrapper templates" (among other functionality) in the future of UI composition 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> </div>
@/* begin: knowingly broken HTML */ @* begin: knowingly broken HTML *@

View File

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

View File

@@ -1,8 +1,8 @@
@model BodyDisplayViewModel @model BodyDisplayViewModel
@using Orchard.Core.Common.ViewModels @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 @*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, doing this here, inline, until we have a pluggable processing model (both in and out)
//also, ...this is ugly*/ also, ...this is ugly *@
@{ @{
var body = new HtmlString(Html.Excerpt(Model.Html.ToString(), 200).ToString().Replace(Environment.NewLine, "</p>" + Environment.NewLine + "<p>")); 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 @model BodyDisplayViewModel
@using Orchard.Core.Common.ViewModels @using Orchard.Core.Common.ViewModels;
@Model.Html @Model.Html

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,3 +1,3 @@
@model BodyEditorViewModel @model BodyEditorViewModel
@using Orchard.Core.Common.ViewModels @using Orchard.Core.Common.ViewModels;
@Html.TextArea("Text", Model.Text, 25, 80, new { @class = Model.Format }) @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 typeDisplayName = Model.TypeDisplayName;
var pageTitle = T("Manage Content"); var pageTitle = T("Manage Content");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel @model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel
<ul class="pageStatus"> <ul class="pageStatus">
<li>@// Published or not <li>@* Published or not *@
@if (Model.HasPublished) { @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> <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>
<li> <li>
@// Does the page have a draft @* Does the page have a draft *@
@if (Model.HasDraft) { @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> <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> </div>
</fieldset> </fieldset>
<script type="text/javascript"> $(function () { <script type="text/javascript"> $(function () {
@//todo: (heskew) make a plugin @* todo: (heskew) make a plugin *@
$("label.forpicker").each(function () { $("label.forpicker").each(function () {
var $this = $(this); var $this = $(this);
var pickerInput = $("#" + $this.attr("for")); var pickerInput = $("#" + $this.attr("for"));

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
@model Orchard.Core.Settings.ViewModels.SiteSettingsPartViewModel @model Orchard.Core.Settings.ViewModels.SiteSettingsPartViewModel
@using Orchard.Settings @using Orchard.Settings;
@{ @{
var resourceDebugMode = new SelectList(new object[] { var resourceDebugMode = new SelectList(new object[] {
new { Id = (int)ResourceDebugMode.FromAppSetting, Text = "Use web.config setting" }, 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")) .Configure(descriptor => descriptor.Wrappers.Add("Document"))
.OnCreating(creating => creating.Behaviors.Add(new ZoneHoldingBehavior(name => CreateZone(creating, name)))) .OnCreating(creating => creating.Behaviors.Add(new ZoneHoldingBehavior(name => CreateZone(creating, name))))
.OnCreated(created => { .OnCreated(created => {
var page = created.Shape; var layout = created.Shape;
page.Head = created.New.DocumentZone(); layout.Head = created.New.DocumentZone();
page.Body = created.New.DocumentZone(); layout.Body = created.New.DocumentZone();
page.Tail = created.New.DocumentZone(); layout.Tail = created.New.DocumentZone();
page.Content = created.New.Zone(); layout.Content = created.New.Zone();
page.Body.Add(created.New.PlaceChildContent(Source: page)); layout.Body.Add(created.New.PlaceChildContent(Source: layout));
page.Content.Add(created.New.PlaceChildContent(Source: page)); layout.Content.Add(created.New.PlaceChildContent(Source: layout));
}); });
// 'Zone' shapes are built on the Zone base class // 'Zone' shapes are built on the Zone base class
@@ -64,7 +64,6 @@ namespace Orchard.Core.Shapes {
var zone = context.New.Zone(); var zone = context.New.Zone();
zone.Id = "zone-" + name; zone.Id = "zone-" + name;
zone.Classes.Add(zone.Id);
zone.Classes.Add("zone"); zone.Classes.Add("zone");
return zone; return zone;
} }

View File

@@ -1,5 +1,5 @@
@using Orchard.Mvc.Html @using Orchard.Mvc.Html;
@using Orchard.UI.Resources @using Orchard.UI.Resources;
@{ @{
RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content("~/modules/orchard.themes/Content/orchard.ico")}); 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) 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 //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); @* Model.Zones.AddRenderPartial("head:before", "HeadPreload", Model); *@
@//Html.Zone("head", ":metas :styles :scripts"); %> @* Html.Zone("head", ":metas :styles :scripts"); %> *@
@Display(Model.Head) @Display(Model.Head)
<script>(function(d){d.className="dyn"+d.className.substring(6,d.className.length);})(document.documentElement);</script> <script>(function(d){d.className="dyn"+d.className.substring(6,d.className.length);})(document.documentElement);</script>
</head> </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.Header(), "5");
Model.Header.Add(Display.User(), "10"); Model.Header.Add(Display.User(), "10");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
@using Orchard.Blogs.Extensions @using Orchard.Blogs.Extensions;
<h1>@Html.TitleForPage(T("Manage Blogs").ToString())</h1> <h1>@Html.TitleForPage(T("Manage Blogs").ToString())</h1>
@if (Model.ContentItems.Items.Count > 0) { @if (Model.ContentItems.Items.Count > 0) {
<div class="actions"><a class="add button primaryAction" href="@Url.BlogCreate()">@T("New Blog")</a></div> <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.Extensions;
@using Orchard.Blogs.ViewModels @using Orchard.Blogs.ViewModels;
@{ @{
BlogPostArchiveViewModel model = Model.Archives; BlogPostArchiveViewModel model = Model.Archives;
Style.Require("BlogsArchives"); 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> <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"> <div class="archive-trail">
@T("Archives") / @T("Archives") /

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
@using Orchard.Blogs.Extensions @using Orchard.Blogs.Extensions;
@using Orchard.Blogs.Models @using Orchard.Blogs.Models;
<h1><a href="@Url.BlogForAdmin((string)Model.Slug)">@Html.TitleForPage((string)Model.Title)</a></h1> <h1><a href="@Url.BlogForAdmin((string)Model.Slug)">@Html.TitleForPage((string)Model.Title)</a></h1>
@Display(Model.manage) @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> <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.Blogs.Extensions;
@using Orchard.UI.Resources @using Orchard.UI.Resources;
@{ @{
RegisterLink(new LinkEntry { Rel = "wlwmanifest", Type = "application/wlwmanifest+xml", Href = Url.BlogLiveWriterManifest((string)Model.Slug) }); 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) }); 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); Html.AddTitleParts((string)Model.Title);
BlogPostPart blogPost = Model.ContentItem.Get(typeof(BlogPostPart)); BlogPostPart blogPost = Model.ContentItem.Get(typeof(BlogPostPart));
@@ -11,7 +11,7 @@
@Display(Model.secondary) @Display(Model.secondary)
<fieldset> <fieldset>
<input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/> <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) { @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"}) @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.Extensions;
@using Orchard.Blogs.Models @using Orchard.Blogs.Models;
<h2>@Html.Link((string)Model.Title, Url.Blog((string)Model.Slug))</h2> <h2>@Html.Link((string)Model.Title, Url.Blog((string)Model.Slug))</h2>
@if (!string.IsNullOrEmpty((string)Model.Description)) { @if (!string.IsNullOrEmpty((string)Model.Description)) {
<p>@Model.Description</p> <p>@Model.Description</p>

View File

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

View File

@@ -1,12 +1,12 @@
@using Orchard.Blogs.Extensions @using Orchard.Blogs.Extensions;
@using Orchard.Blogs.Models @using Orchard.Blogs.Models;
<div class="summary"> <div class="summary">
<div class="related"> <div class="related">
<a href="@Url.Blog((string)Model.Slug)" title="@T("View")">@T("View")</a>@T(" | ") <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.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.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(" | ") <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" })) { @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> <button type="submit" class="linkButton" title="@T("Remove")">@T("Remove")</button>
} }
@@ -14,7 +14,7 @@
<div class="properties"> <div class="properties">
<h3>@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))</h3> <h3>@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))</h3>
<p>@Display(Model.meta)</p> <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> <p>@Model.Description</p>
</div> </div>
<div style="clear:both;"></div> <div style="clear:both;"></div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,9 +9,9 @@
<fieldset> <fieldset>
<label for="DisplayName">@T("Display Name")</label> <label for="DisplayName">@T("Display Name")</label>
@Html.TextBoxFor(m => m.DisplayName, new { @class = "textMedium" }) @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" /> <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" /> <meta itemprop="Name" content="@Model.Name" />
@Html.HiddenFor(m => m.Name) @Html.HiddenFor(m => m.Name)
</fieldset> </fieldset>

View File

@@ -6,7 +6,7 @@
@Html.ValidationSummary() @Html.ValidationSummary()
<fieldset> <fieldset>
<label for="Name">@T("Name")</label> <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.TextBoxFor(m => m.Name, new {@class = "textMedium", disabled = "disabled"})
@Html.HiddenFor(m => m.Name) @Html.HiddenFor(m => m.Name)
</fieldset> </fieldset>

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
<fieldset class="manage-field"> <fieldset class="manage-field">
<h3>@Model.Name <span>(@Model.FieldDefinition.Name)</span></h3> <h3>@Model.Name <span>(@Model.FieldDefinition.Name)</span></h3>
<div class="manage"> <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>
<div class="details"> <div class="details">
@{Html.RenderTemplates(Model.Templates);} @{Html.RenderTemplates(Model.Templates);}

View File

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

View File

@@ -2,7 +2,7 @@
<fieldset class="manage-part" itemscope="itemscope" itemid="@Model.PartDefinition.Name" itemtype="http://orchardproject.net/data/ContentTypePart"> <fieldset class="manage-part" itemscope="itemscope" itemid="@Model.PartDefinition.Name" itemtype="http://orchardproject.net/data/ContentTypePart">
<h3 itemprop="Name">@Model.PartDefinition.DisplayName</h3> <h3 itemprop="Name">@Model.PartDefinition.DisplayName</h3>
<div class="manage"> <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>
<div class="details">@Html.EditorFor(m => m.PartDefinition.Fields, "TypePartFields", "PartDefinition") <div class="details">@Html.EditorFor(m => m.PartDefinition.Fields, "TypePartFields", "PartDefinition")
@if (Model.Templates.Any()) { @if (Model.Templates.Any()) {
@@ -13,7 +13,7 @@
} }
</div> </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.PartDefinition.Name)
@Html.HiddenFor(m => m.Index) @Html.HiddenFor(m => m.Index)
</div> </div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
@model Orchard.Environment.Configuration.ShellSettings @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"}) @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 @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"})) { @using(Html.BeginFormAntiForgeryPost(Url.Action("disable", new {area = "Orchard.MultiTenancy"}), FormMethod.Post, new {@class = "inline link"})) {
@Html.HiddenFor(ss => ss.Name) @Html.HiddenFor(ss => ss.Name)

View File

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

View File

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

View File

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

View File

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

View File

@@ -63,7 +63,10 @@ namespace Orchard.Packaging.Commands {
Context.Output.WriteLine(T("Success")); Context.Output.WriteLine(T("Success"));
} }
catch (WebException webException) { 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); throw new ApplicationException(text);
} }
} }

View File

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

View File

@@ -121,6 +121,9 @@
<ItemGroup> <ItemGroup>
<Content Include="Web.config" /> <Content Include="Web.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Views\Gallery\Themes.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

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

View File

@@ -1,9 +1,9 @@
@model Orchard.Packaging.ViewModels.PackagingModulesViewModel @model Orchard.Packaging.ViewModels.PackagingModulesViewModel
@{ Style.Require("PackagingAdmin"); } @{ 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")) ) { @using ( Html.BeginFormAntiForgeryPost(Url.Action("Modules", "Gallery")) ) {
<fieldset class="bulk-actions"> <fieldset class="bulk-actions">
<label for="filterResults" class="bulk-filter">@T("Feed:")</label> <label for="filterResults" class="bulk-filter">@T("Feed:")</label>
@@ -27,7 +27,7 @@
</div> </div>
<div class="related"> <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> <a href="@item.PackageStreamUri">@T("Download")</a>
</div> </div>
@@ -41,4 +41,3 @@
</li>} </li>}
</ul> </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