diff --git a/.hgtags b/.hgtags index 4248c5a5f..e2628fbe5 100644 --- a/.hgtags +++ b/.hgtags @@ -1,3 +1,4 @@ e048b594f33613d53b59a3578d17511dc833ecb5 MIX10 a6b8d094848d4efee67c787e52e5f7d358e3f0c1 0.5 48d6ca62955335ce6a51859d5fab43b3b48d1911 0.8 +523f3564d2c053ff068970eab8c64eaf74e3dcec perf baseline diff --git a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs index a06f713dc..e4e820952 100644 --- a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs +++ b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs @@ -16,8 +16,8 @@ namespace Orchard.Specs.Bindings { var webApp = Binding(); webApp.GivenIHaveACleanSiteWith(TableData( - new { extension = "module", names = "Orchard.Setup, Orchard.Modules, Orchard.Packaging, Orchard.Themes, Orchard.Widgets, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce" }, - new { extension = "core", names = "Common, Dashboard, Feeds, HomePage, Navigation, Contents, Orchard.PublishLater, Routable, Scheduling, Settings, Shapes, XmlRpc" }, + new { extension = "module", names = "Orchard.Setup, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Widgets, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce" }, + new { extension = "core", names = "Common, Dashboard, Feeds, HomePage, Navigation, Contents, Routable, Scheduling, Settings, Shapes, XmlRpc" }, new { extension = "theme", names = "SafeMode, TheAdmin, TheThemeMachine" })); webApp.WhenIGoTo("Setup"); diff --git a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj index c721b10f0..a0b4073ba 100644 --- a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj +++ b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj @@ -137,6 +137,7 @@ + diff --git a/src/Orchard.Tests.Modules/Widgets/RuleEngine/UrlRuleProviderTest.cs b/src/Orchard.Tests.Modules/Widgets/RuleEngine/UrlRuleProviderTest.cs new file mode 100644 index 000000000..a1b3f7719 --- /dev/null +++ b/src/Orchard.Tests.Modules/Widgets/RuleEngine/UrlRuleProviderTest.cs @@ -0,0 +1,65 @@ +using Autofac; +using NUnit.Framework; +using Orchard.Mvc; +using Orchard.Tests.Stubs; +using Orchard.UI.Widgets; +using Orchard.Widgets.RuleEngine; + +namespace Orchard.Tests.Modules.Widgets.RuleEngine { + [TestFixture] + public class UrlRuleProviderTest { + private IContainer _container; + private IRuleProvider _urlRuleProvider; + private StubHttpContextAccessor _stubContextAccessor; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + _stubContextAccessor = new StubHttpContextAccessor(); + builder.RegisterInstance(_stubContextAccessor).As(); + _container = builder.Build(); + _urlRuleProvider = _container.Resolve(); + } + + [Test] + public void UrlForHomePageMatchesHomePagePath() { + _stubContextAccessor.StubContext = new StubHttpContext("~/"); + var context = new RuleContext {FunctionName = "url", Arguments = new[] {"~/"}}; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + + [Test] + public void UrlForAboutPageMatchesAboutPagePath() { + _stubContextAccessor.StubContext = new StubHttpContext("~/about"); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + + [Test] + public void UrlForBlogWithEndingWildcardMatchesBlogPostPageInSaidBlog() { + _stubContextAccessor.StubContext = new StubHttpContext("~/my-blog/my-blog-post"); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/my-blog/*" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + + [Test] + public void UrlForHomePageDoesNotMatchAboutPagePath() { + _stubContextAccessor.StubContext = new StubHttpContext("~/about"); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.False); + } + + [Test] + public void UrlForAboutPageMatchesDifferentCasedAboutPagePath() { + _stubContextAccessor.StubContext = new StubHttpContext("~/About"); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Tests/Orchard.Framework.Tests.csproj b/src/Orchard.Tests/Orchard.Framework.Tests.csproj index 86fae3a54..5f1797686 100644 --- a/src/Orchard.Tests/Orchard.Framework.Tests.csproj +++ b/src/Orchard.Tests/Orchard.Framework.Tests.csproj @@ -246,6 +246,7 @@ + diff --git a/src/Orchard.Tests/Stubs/StubHttpContext.cs b/src/Orchard.Tests/Stubs/StubHttpContext.cs index 0337c90fe..1b9b44668 100644 --- a/src/Orchard.Tests/Stubs/StubHttpContext.cs +++ b/src/Orchard.Tests/Stubs/StubHttpContext.cs @@ -1,4 +1,3 @@ -using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; @@ -28,19 +27,21 @@ namespace Orchard.Tests.Stubs { public override HttpRequestBase Request { get { return new StubHttpRequest(this); } } + public override HttpResponseBase Response { get { return new StubHttpResponse(this); } } - public override IDictionary Items { get { return _items; } } - class StubHttpRequest : HttpRequestBase { + #region Nested type: StubHttpRequest + + private class StubHttpRequest : HttpRequestBase { private readonly StubHttpContext _httpContext; - private NameValueCollection _serverVariables; private NameValueCollection _headers; + private NameValueCollection _serverVariables; public StubHttpRequest(StubHttpContext httpContext) { _httpContext = httpContext; @@ -54,33 +55,45 @@ namespace Orchard.Tests.Stubs { get { return "/"; } } + public override string Path { + get { return _httpContext._appRelativeCurrentExecutionFilePath.TrimStart('~'); } + } + public override string PathInfo { get { return ""; } } + public override NameValueCollection Headers { get { return _headers = _headers - ?? new NameValueCollection { { "Host", _httpContext._hostHeader } }; + ?? new NameValueCollection {{"Host", _httpContext._hostHeader}}; } } + public override NameValueCollection ServerVariables { get { return _serverVariables = _serverVariables - ?? new NameValueCollection { { "HTTP_HOST", _httpContext._hostHeader } }; + ?? new NameValueCollection {{"HTTP_HOST", _httpContext._hostHeader}}; } } } - class StubHttpResponse : HttpResponseBase { + #endregion + + #region Nested type: StubHttpResponse + + private class StubHttpResponse : HttpResponseBase { private readonly StubHttpContext _httpContext; public StubHttpResponse(StubHttpContext httpContext) { _httpContext = httpContext; } + public override string ApplyAppPathModifier(string virtualPath) { return "~/" + virtualPath.TrimStart('/'); } } + #endregion } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubHttpContextAccessor.cs b/src/Orchard.Tests/Stubs/StubHttpContextAccessor.cs new file mode 100644 index 000000000..45a736932 --- /dev/null +++ b/src/Orchard.Tests/Stubs/StubHttpContextAccessor.cs @@ -0,0 +1,16 @@ +using System.Web; +using Orchard.Mvc; + +namespace Orchard.Tests.Stubs { + public class StubHttpContextAccessor : IHttpContextAccessor { + private HttpContextBase _httpContext; + + public HttpContextBase StubContext { + set { _httpContext = value; } + } + + public HttpContextBase Current() { + return _httpContext; + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs b/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs index 8caeca402..9cc8433f4 100644 --- a/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs +++ b/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs @@ -158,7 +158,7 @@ namespace Orchard.Core.Common.Handlers { // if (instance.Owner != null) // viewModel.Owner = instance.Owner.UserName; - // context.AddEditor(new TemplateViewModel(viewModel, "CommonPart") { TemplateName = "Parts/Common.Owner", ZoneName = "primary", Position = "999" }); + // context.AddEditor(new TemplateViewModel(viewModel, "CommonPart") { TemplateName = "Parts/Common.Owner", ZoneName = "Content", Position = "999" }); //} @@ -190,7 +190,7 @@ namespace Orchard.Core.Common.Handlers { // } // } - // context.AddEditor(new TemplateViewModel(viewModel, "CommonPart") { TemplateName = "Parts/Common.Owner", ZoneName = "primary", Position = "999" }); + // context.AddEditor(new TemplateViewModel(viewModel, "CommonPart") { TemplateName = "Parts/Common.Owner", ZoneName = "Content", Position = "999" }); //} } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Placement.info b/src/Orchard.Web/Core/Common/Placement.info index c9796ff46..bffa8434f 100644 --- a/src/Orchard.Web/Core/Common/Placement.info +++ b/src/Orchard.Web/Core/Common/Placement.info @@ -10,10 +10,10 @@ --> - - - - + + + + @@ -22,7 +22,8 @@ + Parts_Common_Body="Content:5" + Parts_Common_Metadata="Meta:2"/> diff --git a/src/Orchard.Web/Core/Contents/Placement.info b/src/Orchard.Web/Core/Contents/Placement.info index 53412fcdb..8cc668cba 100644 --- a/src/Orchard.Web/Core/Contents/Placement.info +++ b/src/Orchard.Web/Core/Contents/Placement.info @@ -8,6 +8,6 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml index 40941f429..e0f0cd87b 100644 --- a/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml @@ -1,9 +1,10 @@ 
- @Display(Model.Primary) + @Display(Model.Content)
- @Display(Model.Secondary) + @Display(Model.Sidebar) + @* todo: (heskew) remove when the CommonPart is adding the save button *@
diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content.Summary.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content.Summary.cshtml new file mode 100644 index 000000000..07e622932 --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content.Summary.cshtml @@ -0,0 +1,20 @@ +@using Orchard.Utility.Extensions; +@{ + var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify(); +} +
+
+ @Display(Model.Header) + @if (Model.Meta != null) { + + } +
+ @Display(Model.Content) + @if(Model.Footer != null) { +
+ @Display(Model.Footer) +
+ } +
\ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml index 82ed945da..ed4c16944 100644 --- a/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content.SummaryAdmin.cshtml @@ -8,11 +8,19 @@

@Html.ItemEditLink(contentItem)

+ @if (Model.Header != null) { +
@Display(Model.Header)
+ } + @if (Model.Meta != null) { + }
- \ No newline at end of file diff --git a/src/Orchard.Web/Core/Localization/Placement.info b/src/Orchard.Web/Core/Localization/Placement.info index 0aa40e044..d06608e6c 100644 --- a/src/Orchard.Web/Core/Localization/Placement.info +++ b/src/Orchard.Web/Core/Localization/Placement.info @@ -6,7 +6,7 @@ Parts_Localization_ContentTranslations_SummaryAdmin --> - + @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Localization/Views/Admin/Translate.cshtml b/src/Orchard.Web/Core/Localization/Views/Admin/Translate.cshtml index 31480af52..dadf0826d 100644 --- a/src/Orchard.Web/Core/Localization/Views/Admin/Translate.cshtml +++ b/src/Orchard.Web/Core/Localization/Views/Admin/Translate.cshtml @@ -2,7 +2,7 @@ @using Orchard.Core.Localization.ViewModels; @{ dynamic content = Model.Content; - content.Zones.Primary.Add(New.Partial(TemplateName: "CultureSelection", Model: Model), "0"); + content.Zones.Content.Add(New.Partial(TemplateName: "CultureSelection", Model: Model), "0"); }

@Html.TitleForPage(T("Translate Content").ToString())

@using (Html.BeginFormAntiForgeryPost()) { diff --git a/src/Orchard.Web/Core/Messaging/Placement.info b/src/Orchard.Web/Core/Messaging/Placement.info index 35c14f610..9bce6bf11 100644 --- a/src/Orchard.Web/Core/Messaging/Placement.info +++ b/src/Orchard.Web/Core/Messaging/Placement.info @@ -1,3 +1,3 @@  - + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Placement.info b/src/Orchard.Web/Core/Navigation/Placement.info index a44150bda..5b48f3af6 100644 --- a/src/Orchard.Web/Core/Navigation/Placement.info +++ b/src/Orchard.Web/Core/Navigation/Placement.info @@ -1,3 +1,3 @@  - + \ 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 811646f4c..5f21661a1 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -369,6 +369,7 @@ + diff --git a/src/Orchard.Web/Core/Routable/Placement.info b/src/Orchard.Web/Core/Routable/Placement.info index 348c88027..6dc1507d4 100644 --- a/src/Orchard.Web/Core/Routable/Placement.info +++ b/src/Orchard.Web/Core/Routable/Placement.info @@ -1,4 +1,9 @@  - - + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Routable/Views/Parts/RoutableTitle.cshtml b/src/Orchard.Web/Core/Routable/Views/Parts/RoutableTitle.cshtml index 925e62123..a1e1e7ed0 100644 --- a/src/Orchard.Web/Core/Routable/Views/Parts/RoutableTitle.cshtml +++ b/src/Orchard.Web/Core/Routable/Views/Parts/RoutableTitle.cshtml @@ -1 +1,6 @@ -

@Model.Title

\ No newline at end of file +@{ + Orchard.ContentManagement.ContentItem contentItem = Model.ContentPart.ContentItem; + string title = Model.Title.ToString(); +} + +

@Html.ItemDisplayLink(title, contentItem)

\ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Placement.info b/src/Orchard.Web/Core/Settings/Placement.info index 729be5f73..4e7d3370c 100644 --- a/src/Orchard.Web/Core/Settings/Placement.info +++ b/src/Orchard.Web/Core/Settings/Placement.info @@ -1,3 +1,3 @@  - + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Views/Admin/Index.cshtml b/src/Orchard.Web/Core/Settings/Views/Admin/Index.cshtml index f40a7ef73..a83d7786c 100644 --- a/src/Orchard.Web/Core/Settings/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Core/Settings/Views/Admin/Index.cshtml @@ -1,10 +1,9 @@ 

@Html.TitleForPage(T("Manage Settings").ToString())

@using (Html.BeginFormAntiForgeryPost()) { -@Html.ValidationSummary() - -@Display(Model.Primary) -
- -
+ @Html.ValidationSummary() + @Display(Model.Content) +
+ +
} diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Drivers/ArchiveLaterPartDriver.cs b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Drivers/ArchiveLaterPartDriver.cs index 53a6da49c..cd5ed2a52 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Drivers/ArchiveLaterPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Drivers/ArchiveLaterPartDriver.cs @@ -5,11 +5,14 @@ using Orchard.ArchiveLater.ViewModels; using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; using Orchard.Localization; +using System.Globalization; namespace Orchard.ArchiveLater.Drivers { public class ArchiveLaterPartDriver : ContentPartDriver { private const string TemplateName = "Parts/ArchiveLater"; private readonly IArchiveLaterService _archiveLaterService; + private const string DatePattern = "M/d/yyyy"; + private const string TimePattern = "h:mm tt"; public ArchiveLaterPartDriver( IOrchardServices services, @@ -38,8 +41,8 @@ namespace Orchard.ArchiveLater.Drivers { model.ScheduledArchiveUtc = part.ScheduledArchiveUtc.Value; model.ArchiveLater = model.ScheduledArchiveUtc.HasValue; - model.ScheduledArchiveDate = model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value.ToLocalTime().ToShortDateString() : String.Empty; - model.ScheduledArchiveTime = model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value.ToLocalTime().ToShortTimeString() : String.Empty; + model.ScheduledArchiveDate = model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value.ToLocalTime().ToString(DatePattern, CultureInfo.InvariantCulture) : String.Empty; + model.ScheduledArchiveTime = model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value.ToLocalTime().ToString(TimePattern, CultureInfo.InvariantCulture) : String.Empty; return ContentShape("Parts_ArchiveLater_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); @@ -51,9 +54,16 @@ namespace Orchard.ArchiveLater.Drivers { if (updater.TryUpdateModel(model, Prefix, null, null) ) { if ( model.ArchiveLater ) { DateTime scheduled; - if ( DateTime.TryParse(string.Format("{0} {1}", model.ScheduledArchiveDate, model.ScheduledArchiveTime), out scheduled) ) + string parseDateTime = String.Concat(model.ScheduledArchiveDate, " ", model.ScheduledArchiveTime); + + // use an english culture as it is the one used by jQuery.datepicker by default + if (DateTime.TryParse(parseDateTime, CultureInfo.GetCultureInfo("en-US"), DateTimeStyles.AssumeLocal, out scheduled)) { model.ScheduledArchiveUtc = scheduled.ToUniversalTime(); - _archiveLaterService.ArchiveLater(model.ContentItem, model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value : DateTime.MaxValue); + _archiveLaterService.ArchiveLater(model.ContentItem, model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value : DateTime.MaxValue); + } + else { + updater.AddModelError(Prefix, T("{0} is an invalid date and time", parseDateTime)); + } } else { _archiveLaterService.RemoveArchiveLaterTasks(model.ContentItem); diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Placement.info b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Placement.info index 7c693ebfe..f9bbb84d6 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Placement.info @@ -1,6 +1,6 @@  + - diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj index 352e3d191..7983253bb 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj @@ -163,7 +163,6 @@ - diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info b/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info index 2c107e4fb..4846f30f5 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Placement.info @@ -10,9 +10,9 @@ --> - - - + + + @@ -29,8 +29,8 @@ + Parts_Blogs_Blog_Manage="Actions" + Parts_Blogs_Blog_Description="Actions:after"/> @Html.TitleForPage((string)Model.Title) -@Display(Model.Manage) +@Display(Model.Header) +@Display(Model.Actions) @Display(Model.Content) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.Edit.cshtml index b18f344b7..92f5bf5b8 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.Edit.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.Edit.cshtml @@ -2,6 +2,13 @@ @{ Html.AddTitleParts((string)Model.Title); } -@Display(Model.Primary) -@Display(Model.Secondary) -
\ No newline at end of file +
+
+ @Display(Model.Content) +
+
+ @Display(Model.Sidebar) + @* todo: (heskew) remove when the CommonPart is adding the save button *@ +
+
+
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.SummaryAdmin.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.SummaryAdmin.cshtml index 25ccabfd3..63bce04f0 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.SummaryAdmin.cshtml @@ -10,18 +10,20 @@

@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))

+ @if (Model.Header != null) { +
@Display(Model.Header)
+ } @if (Model.Meta != null) { } - @*

[list of authors] [modify blog access]

*@
@if (Model.Content != null) {
@Display(Model.Content)
diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-BlogPost.Editor.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-BlogPost.Editor.cshtml index fe43401f1..a73373f4f 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-BlogPost.Editor.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-BlogPost.Editor.cshtml @@ -1,3 +1,5 @@ +@* todo: (heskew) remove - not being used but keeping around for the "remove draft" reminder *@ + @using Orchard.Blogs.Models; @{ Html.AddTitleParts((string)Model.Title); @@ -5,10 +7,11 @@ }
-@Display(Model.Primary) + @Display(Model.Content)
-@Display(Model.Secondary) + @Display(Model.Sidebar) + @* todo: (heskew) remove when the CommonPart is adding the save button - also move the remove draft functionality to the CommonPart at that time *@
@* TODO: (erikpo) In the future, remove the HasPublished check so the user can delete the content item from here if the choose to *@ @@ -17,4 +20,4 @@ }
-
\ No newline at end of file +
asdfsdaf \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-BlogPost.SummaryAdmin.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-BlogPost.SummaryAdmin.cshtml deleted file mode 100644 index a3d32962b..000000000 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-BlogPost.SummaryAdmin.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@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(); -} -
-
- -

@Html.Link((string)Model.Title, Url.BlogPostEdit((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart))))

- -
- -
@Display(Model.Content)
-
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Placement.info b/src/Orchard.Web/Modules/Orchard.Comments/Placement.info index 1aea86c77..e0fc46077 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Comments/Placement.info @@ -7,8 +7,8 @@ --> - - + + @@ -16,6 +16,6 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Drivers/ContentQueryPartDriver.cs b/src/Orchard.Web/Modules/Orchard.ContentQueries/Drivers/ContentQueryPartDriver.cs new file mode 100644 index 000000000..e40dff50d --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Drivers/ContentQueryPartDriver.cs @@ -0,0 +1,30 @@ +using Orchard.ContentManagement.Drivers; +using Orchard.ContentQueries.Models; + +namespace Orchard.ContentQueries.Drivers { + public class ContentQueryPartDriver : ContentPartDriver { + protected override DriverResult Display(ContentQueryPart part, string displayType, dynamic shapeHelper) { + return ContentShape("Parts_QueriedContents", + list => { + var contentItems = shapeHelper.List(); + //contentItems.AddRange(theContentItems); + + list.ContentItems(contentItems); + + if (true) // pager + list.Pager(/* pager configuration */); + + return list; + }); + } + + protected override DriverResult Editor(ContentQueryPart part, dynamic shapeHelper) { + return ContentShape("Parts_ContentQueries_Configuration", + () => shapeHelper.EditorTemplate(TemplateName: "Parts/ContentQueries.Configuration", Model: part, Prefix: Prefix)); + } + + protected override DriverResult Editor(ContentQueryPart part, ContentManagement.IUpdateModel updater, dynamic shapeHelper) { + return Editor(part, shapeHelper); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Migrations.cs b/src/Orchard.Web/Modules/Orchard.ContentQueries/Migrations.cs new file mode 100644 index 000000000..0e6cd9371 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Migrations.cs @@ -0,0 +1,33 @@ +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Contents.Extensions; +using Orchard.Data.Migration; + +namespace Orchard.ContentQueries { + public class Migrations : DataMigrationImpl { + public int Create() { + //SchemaBuilder.CreateTable("ContentQueryPartRecord", + // table => table + // .ContentPartRecord() + // ); + + ContentDefinitionManager.AlterTypeDefinition("ContentQuery", + cfg => cfg + .WithPart("ContentQueryPart") + .WithPart("CommonPart") + .WithPart("RoutePart") + .WithPart("MenuPart") + .Creatable() + ); + + ContentDefinitionManager.AlterTypeDefinition("ContentQueryWidget", + cfg => cfg + .WithPart("ContentQueryPart") + .WithPart("CommonPart") + .WithPart("WidgetPart") + .WithSetting("Stereotype", "Widget") + ); + + return 1; + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Models/ContentQueryPart.cs b/src/Orchard.Web/Modules/Orchard.ContentQueries/Models/ContentQueryPart.cs new file mode 100644 index 000000000..54f14ddc8 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Models/ContentQueryPart.cs @@ -0,0 +1,5 @@ +using Orchard.ContentManagement; + +namespace Orchard.ContentQueries.Models { + public class ContentQueryPart : ContentPart {} +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Models/ContentQueryPartRecord.cs b/src/Orchard.Web/Modules/Orchard.ContentQueries/Models/ContentQueryPartRecord.cs new file mode 100644 index 000000000..375bf61b5 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Models/ContentQueryPartRecord.cs @@ -0,0 +1,5 @@ +using Orchard.ContentManagement.Records; + +namespace Orchard.ContentQueries.Models { + public class ContentQueryPartRecord : ContentPartRecord {} +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Module.txt b/src/Orchard.Web/Modules/Orchard.ContentQueries/Module.txt new file mode 100644 index 000000000..9561a77d0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Module.txt @@ -0,0 +1,12 @@ +Name: Content Queries +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 0.8.0 +OrchardVersion: 0.8.0 +Features: + Orchard.ContentQueries: + Name: Queried Content Lists + Description: Use simple queries to create orderd lists of content items with optional paging support. + Dependencies: Contents + Category: Content diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Orchard.ContentQueries.csproj b/src/Orchard.Web/Modules/Orchard.ContentQueries/Orchard.ContentQueries.csproj new file mode 100644 index 000000000..a0eb16848 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Orchard.ContentQueries.csproj @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + + + 2.0 + {848126A0-9C88-415A-868F-F5F03449D0B6} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Orchard.ContentQueries + Orchard.ContentQueries + v4.0 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + + + + + + + + + + + + + + + + + + + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + Orchard.Core + + + + + + Designer + + + + + + + + + + + False + True + 57372 + / + + + False + True + http://orchard.codeplex.com + False + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Placement.info b/src/Orchard.Web/Modules/Orchard.ContentQueries/Placement.info new file mode 100644 index 000000000..d3b3fb52b --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Placement.info @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Properties/AssemblyInfo.cs b/src/Orchard.Web/Modules/Orchard.ContentQueries/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..471617b95 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.ContentQueries")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0003600f-7634-43b0-9a63-68ee7c247db3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("0.8.0")] +[assembly: AssemblyFileVersion("0.8.0")] diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Views/EditorTemplates/Parts/ContentQueries.Configuration.cshtml b/src/Orchard.Web/Modules/Orchard.ContentQueries/Views/EditorTemplates/Parts/ContentQueries.Configuration.cshtml new file mode 100644 index 000000000..0028f00f6 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Views/EditorTemplates/Parts/ContentQueries.Configuration.cshtml @@ -0,0 +1 @@ +

content query config here -> x

\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Views/Parts/QueriedContents.cshtml b/src/Orchard.Web/Modules/Orchard.ContentQueries/Views/Parts/QueriedContents.cshtml new file mode 100644 index 000000000..ac6ffaa9a --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Views/Parts/QueriedContents.cshtml @@ -0,0 +1,14 @@ +@{ + IEnumerable queriedContents = Model.ContentItems; + Model.ContentItems.Classes.Add("content-items"); + Model.ContentItems.Classes.Add("queried-contents"); +} +@if (queriedContents != null && queriedContents.Count() > 0) { + @Display(Model.ContentItems) + if (Model.Pager != null) { + @Display(Model.Pager) + } +} +else { +

@T("There are no contents.")

+} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentQueries/Web.config b/src/Orchard.Web/Modules/Orchard.ContentQueries/Web.config new file mode 100644 index 000000000..aeb6287ed --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentQueries/Web.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Email/Placement.info b/src/Orchard.Web/Modules/Orchard.Email/Placement.info index 7f3cf4de5..847ddf0b4 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Email/Placement.info @@ -1,3 +1,3 @@  - + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/draft.gif b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/draft.gif new file mode 100644 index 000000000..a572f4589 Binary files /dev/null and b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/draft.gif differ diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/offline.gif b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/offline.gif new file mode 100644 index 000000000..42c8bde22 Binary files /dev/null and b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/offline.gif differ diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/online.gif b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/online.gif new file mode 100644 index 000000000..f55c73a2f Binary files /dev/null and b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/online.gif differ diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/published.gif b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/published.gif new file mode 100644 index 000000000..b24b9c731 Binary files /dev/null and b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/published.gif differ diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/scheduled.gif b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/scheduled.gif new file mode 100644 index 000000000..827afcade Binary files /dev/null and b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Admin/images/scheduled.gif differ diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs b/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs index 5a7503d3f..a8ba7544a 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs @@ -6,12 +6,16 @@ using Orchard.PublishLater.Models; using Orchard.PublishLater.Services; using Orchard.PublishLater.ViewModels; using Orchard.Localization; +using System.Globalization; +using Orchard.Core.Localization.Services; namespace Orchard.PublishLater.Drivers { public class PublishLaterPartDriver : ContentPartDriver { private const string TemplateName = "Parts/PublishLater"; private readonly ICommonService _commonService; private readonly IPublishLaterService _publishLaterService; + private const string DatePattern = "M/d/yyyy"; + private const string TimePattern = "h:mm tt"; public PublishLaterPartDriver( IOrchardServices services, @@ -42,35 +46,43 @@ namespace Orchard.PublishLater.Drivers { } protected override DriverResult Editor(PublishLaterPart part, dynamic shapeHelper) { - var model = BuildEditorViewModel(part); + // date and time are formatted using the same patterns as DateTimePicker is, preventing other cultures issues + var model = new PublishLaterViewModel(part) { + ScheduledPublishUtc = part.ScheduledPublishUtc.Value, + ScheduledPublishDate = part.ScheduledPublishUtc.Value.HasValue ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(DatePattern, CultureInfo.InvariantCulture) : String.Empty, + ScheduledPublishTime = part.ScheduledPublishUtc.Value.HasValue ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(TimePattern, CultureInfo.InvariantCulture) : String.Empty + }; + return ContentShape("Parts_PublishLater_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); } protected override DriverResult Editor(PublishLaterPart part, IUpdateModel updater, dynamic shapeHelper) { var model = new PublishLaterViewModel(part); + updater.TryUpdateModel(model, Prefix, null, null); switch (model.Command) { case "PublishNow": _commonService.Publish(model.ContentItem); - //Services.Notifier.Information(T("{0} has been published!", model.ContentItem.TypeDefinition.DisplayName)); break; case "PublishLater": DateTime scheduled; - if (DateTime.TryParse(string.Format("{0} {1}", model.ScheduledPublishUtcDate, model.ScheduledPublishUtcTime), out scheduled)) - model.ScheduledPublishUtc = scheduled; - _publishLaterService.Publish(model.ContentItem, model.ScheduledPublishUtc.HasValue ? model.ScheduledPublishUtc.Value : DateTime.MaxValue); - //Services.Notifier.Information(T("{0} has been scheduled for publishing!", model.ContentItem.TypeDefinition.DisplayName)); + string parseDateTime = String.Concat(model.ScheduledPublishDate, " ", model.ScheduledPublishTime); + + // use an english culture as it is the one used by jQuery.datepicker by default + if (DateTime.TryParse(parseDateTime, CultureInfo.GetCultureInfo("en-US"), DateTimeStyles.AssumeLocal, out scheduled)) { + model.ScheduledPublishUtc = part.ScheduledPublishUtc.Value = scheduled.ToUniversalTime(); + _publishLaterService.Publish(model.ContentItem, model.ScheduledPublishUtc.Value); + } + else { + updater.AddModelError(Prefix, T("{0} is an invalid date and time", parseDateTime)); + } + break; case "SaveDraft": - //Services.Notifier.Information(T("{0} draft has been saved!", model.ContentItem.TypeDefinition.DisplayName)); break; } return ContentShape("Parts_PublishLater_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); } - - private static PublishLaterViewModel BuildEditorViewModel(PublishLaterPart part) { - return new PublishLaterViewModel(part); - } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Placement.info b/src/Orchard.Web/Modules/Orchard.PublishLater/Placement.info index 98d424a6e..f321cd6a5 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Placement.info @@ -7,7 +7,7 @@ --> - + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css index dc3a06eba..21684b460 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css @@ -6,9 +6,9 @@ html.dyn input.hinted { color:#ccc; font-style:italic; } -input#PublishLater_ScheduledPublishUtcDate { +input#PublishLater_ScheduledPublishDate { width:50%; } -input#PublishLater_ScheduledPublishUtcTime { +input#PublishLater_ScheduledPublishTime { width:36%; } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs b/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs index f8f175253..3961d56c4 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs @@ -6,8 +6,6 @@ using Orchard.PublishLater.Models; namespace Orchard.PublishLater.ViewModels { public class PublishLaterViewModel { private readonly PublishLaterPart _publishLaterPart; - private string _scheduledPublishUtcTime; - private string _scheduledPublishUtcDate; public PublishLaterViewModel(PublishLaterPart publishLaterPart) { _publishLaterPart = publishLaterPart; @@ -37,23 +35,8 @@ namespace Orchard.PublishLater.ViewModels { public DateTime? ScheduledPublishUtc { get; set; } - public string ScheduledPublishUtcDate { - get { - return !HasPublished && !string.IsNullOrEmpty(_scheduledPublishUtcDate) || !ScheduledPublishUtc.HasValue - ? _scheduledPublishUtcDate - : ScheduledPublishUtc.Value.ToShortDateString(); - } - set { _scheduledPublishUtcDate = value; } - } + public string ScheduledPublishDate { get; set; } - - public string ScheduledPublishUtcTime { - get { - return !HasPublished && !string.IsNullOrEmpty(_scheduledPublishUtcTime) || !ScheduledPublishUtc.HasValue - ? _scheduledPublishUtcTime - : ScheduledPublishUtc.Value.ToShortTimeString(); - } - set { _scheduledPublishUtcTime = value; } - } + public string ScheduledPublishTime { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml index 4147741c9..5b7681ce3 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml @@ -21,10 +21,10 @@
- - @Html.EditorFor(m => m.ScheduledPublishUtcDate) - - @Html.EditorFor(m => m.ScheduledPublishUtcTime) + + @Html.EditorFor(m => m.ScheduledPublishDate) + + @Html.EditorFor(m => m.ScheduledPublishTime)
@using(Script.Foot()) { @@ -43,8 +43,9 @@ .blur(function () { var $this = $(this); setTimeout(function () { if (!$this.val()) { $this.addClass("hinted").val($this.data("hint")) } }, 300) }); } }); - $(@(new HtmlString(string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishUtcDate"))))).datepicker({ showAnim: "" }).focus(function () { $(@(new HtmlString(string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater"))))).attr("checked", "checked") }); - $(@(new HtmlString(string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishUtcTime"))))).timepickr().focus(function () { $(@(new HtmlString(string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater"))))).attr("checked", "checked") }); + $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")').datepicker({ showAnim: "" }).focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")').attr("checked", "checked") }); + $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")').timepickr().focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")').attr("checked", "checked") }); + }) //]]> diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Parts/PublishLater.Metadata.SummaryAdmin.cshtml b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Parts/PublishLater.Metadata.SummaryAdmin.cshtml index da9dd5732..b3163f8d1 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Parts/PublishLater.Metadata.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Parts/PublishLater.Metadata.SummaryAdmin.cshtml @@ -30,7 +30,7 @@ } else { @T( @T("Scheduled") - @Html.DateTime(((DateTime?)Model.ScheduledPublishUtc).Value, T("M/d/yyyy h:mm tt")) + @Html.DateTime(((DateTime?)Model.ScheduledPublishUtc).Value.ToLocalTime(), T("M/d/yyyy h:mm tt")) } |  } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Placement.info b/src/Orchard.Web/Modules/Orchard.Roles/Placement.info index bb38e975a..ece7d7ecb 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Roles/Placement.info @@ -1,3 +1,3 @@  - + diff --git a/src/Orchard.Web/Modules/Orchard.Search/Placement.info b/src/Orchard.Web/Modules/Orchard.Search/Placement.info index e0cc312db..c43801cdd 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Search/Placement.info @@ -1,3 +1,3 @@  - + diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs b/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs index 53a0ada60..30f83c52f 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs @@ -94,7 +94,8 @@ namespace Orchard.Setup.Services { "Orchard.Tags", "Orchard.Media", "Orchard.Widgets", - "Orchard.jQuery" + "Orchard.jQuery", + "Orchard.ContentQueries" }; context.EnabledFeatures = hardcoded; diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Placement.info b/src/Orchard.Web/Modules/Orchard.Tags/Placement.info index 8a465c8fa..c528accb2 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Tags/Placement.info @@ -1,4 +1,9 @@  - - + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Items/Content-User.Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Items/Content-User.Edit.cshtml index cda4b0243..af834ed7e 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Items/Content-User.Edit.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Items/Content-User.Edit.cshtml @@ -1,8 +1,8 @@ 
- @Display(Model.Primary) + @Display(Model.Content)
- @Display(Model.Secondary) + @Display(Model.Sidebar)
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Placement.info b/src/Orchard.Web/Modules/Orchard.Widgets/Placement.info index 174ee3b11..9ab08b4dd 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Placement.info @@ -1,5 +1,5 @@  - - - + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/RuleEngine/UrlRuleProvider.cs b/src/Orchard.Web/Modules/Orchard.Widgets/RuleEngine/UrlRuleProvider.cs index 35bd0d296..15c072e43 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/RuleEngine/UrlRuleProvider.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/RuleEngine/UrlRuleProvider.cs @@ -26,7 +26,7 @@ namespace Orchard.Widgets.RuleEngine { if (url != "/" && !url.Contains("?") && url.EndsWith("/")) url = url.TrimEnd('/'); ruleContext.Result = url.EndsWith("*") - ? context.Request.Path.ToUpperInvariant().StartsWith(url.ToUpperInvariant()) + ? context.Request.Path.ToUpperInvariant().StartsWith(url.TrimEnd('*').ToUpperInvariant()) : context.Request.Path.ToUpperInvariant() == url.ToUpperInvariant(); } } diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.Edit.cshtml index 45769c4cf..696503b21 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.Edit.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Items/Widget.Edit.cshtml @@ -1,9 +1,10 @@ 
- @Display(Model.Primary) + @Display(Model.Content)
- @Display(Model.Secondary) + @Display(Model.Sidebar) + @* todo: (heskew) remove when the CommonPart is adding the save button *@
diff --git a/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/addmedia/js/addmedia.js b/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/addmedia/js/addmedia.js index 5916a5291..f9c382f95 100644 --- a/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/addmedia/js/addmedia.js +++ b/src/Orchard.Web/Modules/TinyMce/Scripts/plugins/addmedia/js/addmedia.js @@ -2,14 +2,14 @@ // async media file uploads brought to you with a little insight from reading: http://www.bennadel.com/blog/1244-ColdFusion-jQuery-And-AJAX-File-Upload-Demo.htm var AddMediaDialog = { - init: function() { + init: function () { var form = document.forms[0]; form.action = tinyMCE.activeEditor.getParam('addmedia_action'); form.MediaPath.value = tinyMCE.activeEditor.getParam('addmedia_path'); form.__RequestVerificationToken.value = tinyMCE.activeEditor.getParam('request_verification_token'); }, - addMedia: function(form) { + addMedia: function (form) { var iframeName = "addmedia__" + (new Date()).getTime(); var iframe; @@ -22,12 +22,18 @@ var AddMediaDialog = { iframe.src = "about:blank"; tinymce.DOM.setStyles(iframe, { display: "none" }); - var iframeLoadHandler = tinymce.dom.Event.add(iframe, 'load', function(ev) { + var iframeLoadHandler = tinymce.dom.Event.add(iframe, 'load', function (ev) { try { - var result = window.frames[iframeName].result, close = 0; + var frameWindow = window.frames[iframeName]; + + if (frameWindow.document.URL == "about:blank") { + return true; + } + + var result = frameWindow.result, close = 0; if (result && result.url) { - if (window.parent && window.parent.AddMediaDialog) { + if (window.parent && window.parent.AddMediaDialog) { window.parent.AddMediaDialog.insertMedia(result.url); } else { AddMediaDialog.insertMedia(result.url); @@ -49,7 +55,7 @@ var AddMediaDialog = { } //cleanup - setTimeout(function() { + setTimeout(function () { tinymce.dom.Event.remove(iframe, 'load', iframeLoadHandler); tinymce.DOM.remove(iframe); iframe = null; @@ -72,7 +78,7 @@ var AddMediaDialog = { form.target = iframe.name; }, - insertMedia: function(url) { + insertMedia: function (url) { if (!url) return; var markup = /\.(jpe?g|png|gif)$/i.test(url) diff --git a/src/Orchard.Web/Web.config b/src/Orchard.Web/Web.config index a2592670a..be12b290a 100644 --- a/src/Orchard.Web/Web.config +++ b/src/Orchard.Web/Web.config @@ -112,7 +112,6 @@ -