@if (Model.Localizations.Count() > 0) {
//todo: need this info in the view model
diff --git a/src/Orchard.Web/Core/Localization/Views/DisplayTemplates/Parts/Localization.ContentTranslations.cshtml b/src/Orchard.Web/Core/Localization/Views/DisplayTemplates/Parts/Localization.ContentTranslations.cshtml
index 0af5af66d..09f237246 100644
--- a/src/Orchard.Web/Core/Localization/Views/DisplayTemplates/Parts/Localization.ContentTranslations.cshtml
+++ b/src/Orchard.Web/Core/Localization/Views/DisplayTemplates/Parts/Localization.ContentTranslations.cshtml
@@ -1,5 +1,5 @@
@model Orchard.Core.Localization.ViewModels.ContentLocalizationsViewModel
-@Html.RegisterStyle("base.css");
+@Style.Require("Localization");
@if (Model.Localizations.Count() > 0) {
diff --git a/src/Orchard.Web/Core/Localization/Views/EditorTemplates/Parts/Localization.Translation.cshtml b/src/Orchard.Web/Core/Localization/Views/EditorTemplates/Parts/Localization.Translation.cshtml
index 08c503751..43511aab0 100644
--- a/src/Orchard.Web/Core/Localization/Views/EditorTemplates/Parts/Localization.Translation.cshtml
+++ b/src/Orchard.Web/Core/Localization/Views/EditorTemplates/Parts/Localization.Translation.cshtml
@@ -1,7 +1,7 @@
@model Orchard.Core.Localization.ViewModels.EditLocalizationViewModel
-@Html.RegisterStyle("admin.css");
+@Style.Require("LocalizationAdmin");
@if (Model.ContentItem.ContentItem.Id > 0 && Model.SelectedCulture != null && Model.ContentLocalizations.Localizations.Count() > 0) {
-Html.RegisterStyle("base.css");
+Style.Require("Localization");
-
\ No newline at end of file
+
diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj
index dd53e1dd6..eeed50db3 100644
--- a/src/Orchard.Web/Core/Orchard.Core.csproj
+++ b/src/Orchard.Web/Core/Orchard.Core.csproj
@@ -74,6 +74,7 @@
+
@@ -94,6 +95,7 @@
+
@@ -102,6 +104,7 @@
+
@@ -109,6 +112,7 @@
+
@@ -203,6 +207,7 @@
+
@@ -267,8 +272,8 @@
-
-
+
+
@@ -301,7 +306,7 @@
-
+
@@ -337,7 +342,8 @@
-
+
+
@@ -407,7 +413,6 @@
-
diff --git a/src/Orchard.Web/Core/PublishLater/Module.txt b/src/Orchard.Web/Core/PublishLater/Module.txt
index 8fda62f2a..99e3d03e4 100644
--- a/src/Orchard.Web/Core/PublishLater/Module.txt
+++ b/src/Orchard.Web/Core/PublishLater/Module.txt
@@ -9,4 +9,4 @@ features:
PublishLater:
Description: Draft creation and scheduled publishing.
Category: Content
- Dependencies: Common, Settings
+ Dependencies: Common, Settings, Scheduling
diff --git a/src/Orchard.Web/Core/PublishLater/PublishLaterResourceManifest.cs b/src/Orchard.Web/Core/PublishLater/PublishLaterResourceManifest.cs
new file mode 100644
index 000000000..6de920ac8
--- /dev/null
+++ b/src/Orchard.Web/Core/PublishLater/PublishLaterResourceManifest.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Orchard.UI.Resources;
+
+namespace Orchard.Core.PublishLater {
+ public class PublishLaterResourceManifest : ResourceManifest {
+ public PublishLaterResourceManifest() {
+ DefineStyle("PublishLater_DatePicker").SetUrl("datetime.css");
+
+ // todo: move into Orchard.jQuery module and also include min versions
+ DefineStyle("jQueryUtils_TimePicker").SetUrl("ui.timepickr.css");
+ DefineStyle("jQueryUI_Orchard").SetUrl("jquery-ui-1.7.2.custom.css").SetVersion("1.7.2");
+ DefineStyle("jQueryUI_DatePicker").SetUrl("ui.datepicker.css").SetDependencies("jQueryUI_Orchard").SetVersion("1.7.2");
+
+ DefineScript("jQueryUtils").SetUrl("jquery.utils.js").SetDependencies("jQuery");
+ DefineScript("jQueryUI_Core").SetUrl("jquery.ui.core.js").SetVersion("1.8b1").SetDependencies("jQuery");
+ DefineScript("jQueryUI_Widget").SetUrl("jquery.ui.widget.js").SetVersion("1.8b1").SetDependencies("jQuery");
+ DefineScript("jQueryUI_DatePicker").SetUrl("jquery.ui.datepicker.js").SetVersion("1.8b1").SetDependencies("jQueryUI_Core", "jQueryUI_Widget");
+ DefineScript("jQueryUtils_TimePicker").SetUrl("ui.timepickr.js").SetVersion("0.7.0a").SetDependencies("jQueryUtils", "jQueryUI_Core");
+ }
+ }
+}
diff --git a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.ascx b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.ascx
deleted file mode 100644
index 785076cc0..000000000
--- a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.ascx
+++ /dev/null
@@ -1,31 +0,0 @@
-<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl
" %>
-
- - <%
- // Published or not
- if (Model.HasPublished) { %>
-
" alt="<%:T("Online") %>" title="<%:T("The page is currently online") %>" /> <%:T("Published") %> | <%
- }
- else { %>
-
" alt="<%:T("Offline") %>" title="<%:T("The page is currently offline") %>" /> <%:T("Not Published") %> | <%
- } %>
-
- - <%
- // Does the page have a draft
- if (Model.HasDraft) { %>
-
" alt="<%:T("Draft") %>" title="<%:T("The page has a draft") %>" /><%:T("Draft") %> | <%
- }
- else { %>
- <%:T("No Draft") %> | <%
- } %>
-
- - <%
- if ((Model.ScheduledPublishUtc.HasValue && Model.ScheduledPublishUtc.Value > DateTime.UtcNow) || (Model.IsPublished && Model.VersionPublishedUtc.HasValue)) {
- if (Model.IsPublished && Model.VersionPublishedUtc.HasValue) { %>
- <%:T("Published: {0}", Html.DateTimeRelative(Model.VersionPublishedUtc.Value, T)) %><%
- }
- else { %>
-
" alt="<%:T("Scheduled") %>" title="<%:T("The page is scheduled for publishing") %>" /><%:T("Scheduled") %>
- <%:Html.DateTime(Model.ScheduledPublishUtc.Value, T("M/d/yyyy h:mm tt")) %><%
- } %> | <%
- } %>
-
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.cshtml b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.cshtml
new file mode 100644
index 000000000..3239d6593
--- /dev/null
+++ b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.SummaryAdmin.cshtml
@@ -0,0 +1,30 @@
+@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel
+
+ - @// Published or not
+ @if (Model.HasPublished) {
+
@T("Published") |
+ }
+ else {
+
@T("Not Published") |
+ }
+
+ -
+ @// Does the page have a draft
+ @if (Model.HasDraft) {
+
@T("Draft") |
+ }
+ else {
+ @T("No Draft") |
+ }
+
+ @if ((Model.ScheduledPublishUtc.HasValue && Model.ScheduledPublishUtc.Value > DateTime.UtcNow) || (Model.IsPublished && Model.VersionPublishedUtc.HasValue)) {
+ -
+ @if (Model.IsPublished && Model.VersionPublishedUtc.HasValue) {
+ @T("Published: {0}", Html.DateTimeRelative(Model.VersionPublishedUtc.Value, T))
+ }
+ else {
+
@T("Scheduled")
+ @Html.DateTime(Model.ScheduledPublishUtc.Value, T("M/d/yyyy h:mm tt"))
+ } |
+ }
+
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.ascx b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.ascx
deleted file mode 100644
index ce4cd4e1a..000000000
--- a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.ascx
+++ /dev/null
@@ -1 +0,0 @@
-<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %>
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.cshtml b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.cshtml
new file mode 100644
index 000000000..8b6405dd7
--- /dev/null
+++ b/src/Orchard.Web/Core/PublishLater/Views/DisplayTemplates/Parts/PublishLater.Metadata.cshtml
@@ -0,0 +1 @@
+@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.ascx b/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.ascx
deleted file mode 100644
index 0f98fc6c8..000000000
--- a/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.ascx
+++ /dev/null
@@ -1,47 +0,0 @@
-<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %>
-<% Html.RegisterStyle("datetime.css"); %>
-<% Html.RegisterStyle("jquery-ui-1.7.2.custom.css"); %>
-<% Html.RegisterStyle("ui.datepicker.css"); %>
-<% Html.RegisterStyle("ui.timepickr.css"); %>
-<% Html.RegisterFootScript("jquery.ui.core.js"); %>
-<% Html.RegisterFootScript("jquery.ui.widget.js"); %>
-<% Html.RegisterFootScript("jquery.ui.datepicker.js"); %>
-<% Html.RegisterFootScript("jquery.utils.js"); %>
-<% Html.RegisterFootScript("ui.timepickr.js"); %>
-
-
-
- <%: Html.RadioButton("Command", "SaveDraft", Model.ContentItem.VersionRecord == null || !Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft") })%>
-
-
-
- <%: Html.RadioButton("Command", "PublishNow", Model.ContentItem.VersionRecord != null && Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow") })%>
-
-
-
- <%: Html.RadioButton("Command", "PublishLater", Model.ScheduledPublishUtc != null, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater") }) %>
-
-
-
-
- <%: Html.EditorFor(m => m.ScheduledPublishUtcDate)%>
-
- <%: Html.EditorFor(m => m.ScheduledPublishUtcTime)%>
-
-
-
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml b/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml
new file mode 100644
index 000000000..3e4e4ed8d
--- /dev/null
+++ b/src/Orchard.Web/Core/PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml
@@ -0,0 +1,45 @@
+@model Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel
+@{
+ Script.RequireFoot("jQueryUtils_TimePicker");
+ Script.RequireFoot("jQueryUI_DatePicker");
+ Style.Require("PublishLater_DatePicker");
+ Style.Require("jQueryUtils_TimePicker");
+ Style.Require("jQueryUI_DatePicker");
+}
+
+
+
+ @Html.RadioButton("Command", "SaveDraft", Model.ContentItem.VersionRecord == null || !Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft") })
+
+
+
+ @Html.RadioButton("Command", "PublishNow", Model.ContentItem.VersionRecord != null && Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow") })
+
+
+
+ @Html.RadioButton("Command", "PublishLater", Model.ScheduledPublishUtc != null, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater") })
+
+
+
+
+ @Html.EditorFor(m => m.ScheduledPublishUtcDate)
+
+ @Html.EditorFor(m => m.ScheduledPublishUtcTime)
+
+
+
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Routable/RoutableResourceManifest.cs b/src/Orchard.Web/Core/Routable/RoutableResourceManifest.cs
new file mode 100644
index 000000000..a098cb595
--- /dev/null
+++ b/src/Orchard.Web/Core/Routable/RoutableResourceManifest.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Orchard.UI.Resources;
+
+namespace Orchard.Core.Routable {
+ public class RoutableResourceManifest : ResourceManifest {
+ public RoutableResourceManifest() {
+ DefineScript("Slugify").SetUrl("jquery.slugify.js").SetDependencies("jQuery");
+ }
+ }
+}
diff --git a/src/Orchard.Web/Core/Settings/SettingsResourceManifest.cs b/src/Orchard.Web/Core/Settings/SettingsResourceManifest.cs
new file mode 100644
index 000000000..2321abcbd
--- /dev/null
+++ b/src/Orchard.Web/Core/Settings/SettingsResourceManifest.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Orchard.UI.Resources;
+
+namespace Orchard.Core.Settings {
+ public class SettingsResourceManifest : ResourceManifest {
+ public SettingsResourceManifest() {
+ DefineStyle("SettingsAdmin").SetUrl("admin.css");
+ }
+ }
+}
diff --git a/src/Orchard.Web/Core/Shapes/CoreShapes.cs b/src/Orchard.Web/Core/Shapes/CoreShapes.cs
index 359a94b96..ea6fd18ac 100644
--- a/src/Orchard.Web/Core/Shapes/CoreShapes.cs
+++ b/src/Orchard.Web/Core/Shapes/CoreShapes.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Globalization;
using System.IO;
using System.Linq;
using System.Web;
@@ -8,7 +9,9 @@ using Orchard.DisplayManagement;
using Orchard.DisplayManagement.Descriptors;
using Orchard.DisplayManagement.Implementation;
using Orchard.Environment.Extensions.Models;
+using Orchard.Mvc.ViewEngines;
using Orchard.UI;
+using Orchard.UI.Resources;
using Orchard.UI.Zones;
// ReSharper disable InconsistentNaming
@@ -66,6 +69,58 @@ namespace Orchard.Core.Shapes {
return tagBuilder;
}
+ //[Shape]
+ //public HtmlString Resource(ResourceRequiredContext Resource, RequireSettings DefaultSettings, string AppPath) {
+ // return new HtmlString(Resource.GetTagBuilder(DefaultSettings, AppPath).ToString());
+ //}
+
+ [Shape]
+ public void HeadScripts(HtmlHelper Html, IResourceManager ResourceManager) {
+ WriteResources(Html, ResourceManager, "script", ResourceLocation.Head, null);
+ }
+
+ [Shape]
+ public void FootScripts(HtmlHelper Html, IResourceManager ResourceManager) {
+ WriteResources(Html, ResourceManager, "script", null, ResourceLocation.Head);
+ TextWriter captured;
+ if (LayoutViewContext.From(Html.ViewContext).Contents.TryGetValue("end-of-page-scripts", out captured)) {
+ Html.ViewContext.Writer.Write(captured);
+ }
+ }
+
+ [Shape]
+ public void Metas(HtmlHelper Html, IResourceManager ResourceManager) {
+ foreach (var meta in ResourceManager.GetRegisteredMetas()) {
+ Html.ViewContext.Writer.WriteLine(meta.GetTag());
+ }
+ }
+
+ [Shape]
+ public void HeadLinks(HtmlHelper Html, IResourceManager ResourceManager) {
+ foreach (var link in ResourceManager.GetRegisteredLinks()) {
+ Html.ViewContext.Writer.WriteLine(link.GetTag());
+ }
+ }
+
+ [Shape]
+ public void StylesheetLinks(HtmlHelper Html, IResourceManager ResourceManager) {
+ WriteResources(Html, ResourceManager, "stylesheet", null, null);
+ }
+
+ private static void WriteResources(HtmlHelper html, IResourceManager rm, string resourceType, ResourceLocation? includeLocation, ResourceLocation? excludeLocation) {
+ var defaultSettings = new RequireSettings {
+ DebugMode = html.ViewContext.HttpContext.IsDebuggingEnabled,
+ Culture = CultureInfo.CurrentUICulture.Name,
+ };
+ var requiredResources = rm.BuildRequiredResources(resourceType);
+ var appPath = html.ViewContext.HttpContext.Request.ApplicationPath;
+ foreach (var context in requiredResources.Where(r =>
+ (includeLocation.HasValue ? r.Settings.Location == includeLocation.Value : true) &&
+ (excludeLocation.HasValue ? r.Settings.Location != excludeLocation.Value : true))) {
+ html.ViewContext.Writer.WriteLine(context.GetTagBuilder(defaultSettings, appPath).ToString());
+ }
+ }
+
[Shape]
public void List(
dynamic Display,
diff --git a/src/Orchard.Web/Core/Shapes/Views/Layout.cshtml b/src/Orchard.Web/Core/Shapes/Views/Layout.cshtml
index 29b96c2a3..c9459aa29 100644
--- a/src/Orchard.Web/Core/Shapes/Views/Layout.cshtml
+++ b/src/Orchard.Web/Core/Shapes/Views/Layout.cshtml
@@ -10,6 +10,9 @@
@Display(Model.Header)
+
+ @Display(Model.Messages)
+
@Display(Model.Content)
diff --git a/src/Orchard.Web/Core/Shapes/Views/Message.cshtml b/src/Orchard.Web/Core/Shapes/Views/Message.cshtml
new file mode 100644
index 000000000..ead9d061a
--- /dev/null
+++ b/src/Orchard.Web/Core/Shapes/Views/Message.cshtml
@@ -0,0 +1 @@
+
@Model.Message
diff --git a/src/Orchard.Web/Core/Shapes/Views/Messages.ascx_ b/src/Orchard.Web/Core/Shapes/Views/Messages.ascx_
deleted file mode 100644
index 8fad33c88..000000000
--- a/src/Orchard.Web/Core/Shapes/Views/Messages.ascx_
+++ /dev/null
@@ -1,10 +0,0 @@
-<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl
>" %>
-<%@ Import Namespace="Orchard.UI.Notify"%>
-<% foreach (var item in Model) {
- var className = item.Type == NotifyType.Error
- ? "critical"
- : item.Type == NotifyType.Warning
- ? "warning"
- : "info"; %>
-<%: item.Message %>
-<% } %>
\ No newline at end of file
diff --git a/src/Orchard.Web/Core/Shapes/Views/NotFound.ascx b/src/Orchard.Web/Core/Shapes/Views/NotFound.ascx
deleted file mode 100644
index 2bd1db51e..000000000
--- a/src/Orchard.Web/Core/Shapes/Views/NotFound.ascx
+++ /dev/null
@@ -1,5 +0,0 @@
-<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl