--HG--
branch : nuget
This commit is contained in:
Louis DeJardin
2010-10-30 22:17:15 -07:00
67 changed files with 600 additions and 154 deletions

View File

@@ -1,3 +1,4 @@
e048b594f33613d53b59a3578d17511dc833ecb5 MIX10
a6b8d094848d4efee67c787e52e5f7d358e3f0c1 0.5
48d6ca62955335ce6a51859d5fab43b3b48d1911 0.8
523f3564d2c053ff068970eab8c64eaf74e3dcec perf baseline

View File

@@ -16,8 +16,8 @@ namespace Orchard.Specs.Bindings {
var webApp = Binding<WebAppHosting>();
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");

View File

@@ -137,6 +137,7 @@
<Compile Include="Values.cs" />
<Compile Include="Users\Controllers\AdminControllerTests.cs" />
<Compile Include="Users\Services\MembershipServiceTests.cs" />
<Compile Include="Widgets\RuleEngine\UrlRuleProviderTest.cs" />
<Compile Include="Widgets\Services\WidgetsServiceTest.cs" />
<Compile Include="Widgets\WidgetsTests.cs" />
<Compile Include="XmlRpc\Controllers\HomeControllerTests.cs" />

View File

@@ -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<UrlRuleProvider>().As<IRuleProvider>();
_stubContextAccessor = new StubHttpContextAccessor();
builder.RegisterInstance(_stubContextAccessor).As<IHttpContextAccessor>();
_container = builder.Build();
_urlRuleProvider = _container.Resolve<IRuleProvider>();
}
[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);
}
}
}

View File

@@ -246,6 +246,7 @@
<Compile Include="Records\BigRecord.cs" />
<Compile Include="Scripting\ScriptingTests.cs" />
<Compile Include="Stubs\InMemoryWebSiteFolder.cs" />
<Compile Include="Stubs\StubHttpContextAccessor.cs" />
<Compile Include="Stubs\StubWorkContextAccessor.cs" />
<Compile Include="Stubs\StubExtensionManager.cs" />
<Compile Include="Stubs\StubReportsCoordinator.cs" />

View File

@@ -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
}
}

View File

@@ -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;
}
}
}

View File

@@ -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" });
//}
}
}

View File

@@ -10,10 +10,10 @@
-->
<!-- edit shapes getting default placements -->
<!-- edit "shape" -->
<Place Parts_Common_Body_Edit="Primary:2"/>
<Place Parts_Common_Owner_Edit="Primary:20"/>
<Place Parts_Common_Container_Edit="Primary:20"/>
<Place Fields_Common_Text_Edit="Primary:2.5"/>
<Place Parts_Common_Body_Edit="Content:2"/>
<Place Parts_Common_Owner_Edit="Content:20"/>
<Place Parts_Common_Container_Edit="Content:20"/>
<Place Fields_Common_Text_Edit="Content:2.5"/>
<!-- default positioning -->
<!-- show summary for all DisplayType by default -->
<Place Parts_Common_Body_Summary="Content:5"/>
@@ -22,7 +22,8 @@
<Match DisplayType="Detail">
<!-- hide summary, show full content, for Detail -->
<Place Parts_Common_Body_Summary="-"
Parts_Common_Body="Content:5" />
Parts_Common_Body="Content:5"
Parts_Common_Metadata="Meta:2"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_Common_Metadata_Summary="Meta:2"/>

View File

@@ -8,6 +8,6 @@
<Place Parts_Contents_Publish="Content:5"/>
</Match>
<Match DisplayType="SummaryAdmin">
<Place Parts_Contents_Publish_SummaryAdmin="Secondary:5"/>
<Place Parts_Contents_Publish_SummaryAdmin="Actions:5"/>
</Match>
</Placement>

View File

@@ -1,9 +1,10 @@
<div class="sections">
<div class="primary">
@Display(Model.Primary)
@Display(Model.Content)
</div>
<div class="secondary">
@Display(Model.Secondary)
@Display(Model.Sidebar)
@* todo: (heskew) remove when the CommonPart is adding the save button *@
<fieldset>
<button class="primaryAction" type="submit" name="submit.Save" value="submit.Save">@T("Save")</button>
</fieldset>

View File

@@ -0,0 +1,20 @@
@using Orchard.Utility.Extensions;
@{
var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify();
}
<article class="content-item @contentTypeClassName">
<header>
@Display(Model.Header)
@if (Model.Meta != null) {
<div class="metadata">
@Display(Model.Meta)
</div>
}
</header>
@Display(Model.Content)
@if(Model.Footer != null) {
<footer>
@Display(Model.Footer)
</footer>
}
</article>

View File

@@ -8,11 +8,19 @@
<div class="properties">
<input type="checkbox" value="@contentItem.Id" name="itemIds"/>
<h3>@Html.ItemEditLink(contentItem)</h3>
@if (Model.Header != null) {
<div class="header">@Display(Model.Header)</div>
}
@if (Model.Meta != null) {
<div class="metadata">@Display(Model.Meta)</div>
}
</div>
<div class="related">@Display(Model.Secondary)
<div class="related">
@Display(Model.Actions)
@Html.ItemEditLink(T("Edit").Text, contentItem) @T(" | ")
@Html.Link(T("Remove").Text, Url.Action("Remove", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl }), new { itemprop = "RemoveUrl UnsafeUrl" })
</div>
<div class="primary">@Display(Model.Primary)</div>
@if (Model.Content != null) {
<div class="primary">@Display(Model.Content)</div>
}
</div>

View File

@@ -6,7 +6,7 @@
Parts_Localization_ContentTranslations_SummaryAdmin
-->
<!-- edit shape just gets default placement -->
<Place Parts_Localization_ContentTranslations_Edit="Primary:before.1"/>
<Place Parts_Localization_ContentTranslations_Edit="Content:before.1"/>
<Match DisplayType="Detail">
<Place Parts_Localization_ContentTranslations="Content:2"/>
</Match>
@@ -14,6 +14,6 @@
<Place Parts_Localization_ContentTranslations_Summary="Content:2"/>
</Match>
<Match DisplayType="SummaryAdmin">
<Place Parts_Localization_ContentTranslations_SummaryAdmin="Primary:5"/>
<Place Parts_Localization_ContentTranslations_SummaryAdmin="Content:5"/>
</Match>
</Placement>

View File

@@ -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");
}
<h1>@Html.TitleForPage(T("Translate Content").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {

View File

@@ -1,3 +1,3 @@
<Placement>
<Place Parts_MessageSettings_Edit="Primary:10"/>
<Place Parts_MessageSettings_Edit="Content:10"/>
</Placement>

View File

@@ -1,3 +1,3 @@
<Placement>
<Place Parts_Navigation_Menu_Edit="Primary:9"/>
<Place Parts_Navigation_Menu_Edit="Content:9"/>
</Placement>

View File

@@ -369,6 +369,7 @@
<Content Include="Routable\Views\Item\Display.cshtml" />
<Content Include="Routable\Views\Routable.HomePage.cshtml" />
<Content Include="Localization\Views\Parts\Localization.ContentTranslations.SummaryAdmin.cshtml" />
<Content Include="Contents\Views\Items\Content.Summary.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

View File

@@ -1,4 +1,9 @@
<Placement>
<Place Parts_RoutableTitle="Header:5"/>
<Place Parts_Routable_Edit="Primary:before.5"/>
<Place Parts_Routable_Edit="Content:before.5"/>
<Match DisplayType="Detail">
<Place Parts_RoutableTitle="Header:5"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_RoutableTitle="Header:5"/>
</Match>
</Placement>

View File

@@ -1 +1,6 @@
<h1><a href="@Model.Path">@Model.Title</a></h1>
@{
Orchard.ContentManagement.ContentItem contentItem = Model.ContentPart.ContentItem;
string title = Model.Title.ToString();
}
<h1>@Html.ItemDisplayLink(title, contentItem)</h1>

View File

@@ -1,3 +1,3 @@
<Placement>
<Place Parts_Settings_SiteSettingsPart="Primary:1"/>
<Place Parts_Settings_SiteSettingsPart="Content:1"/>
</Placement>

View File

@@ -1,10 +1,9 @@
<h1>@Html.TitleForPage(T("Manage Settings").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
@Display(Model.Primary)
<fieldset>
<input class="button primaryAction" type="submit" value="@T("Save")" />
</fieldset>
@Html.ValidationSummary()
@Display(Model.Content)
<fieldset>
<input class="button primaryAction" type="submit" value="@T("Save")" />
</fieldset>
}

View File

@@ -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<ArchiveLaterPart> {
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);

View File

@@ -1,6 +1,6 @@
<Placement>
<Place Parts_ArchiveLater_Edit="Sidebar:2"/>
<Match DisplayType="SummaryAdmin">
<Place Parts_ArchiveLater_Metadata_SummaryAdmin="Meta:2"/>
</Match>
<Place Parts_ArchiveLater_Edit="Secondary:2"/>
</Placement>

View File

@@ -163,7 +163,6 @@
<Content Include="Views\Items\Content-Blog.DetailAdmin.cshtml" />
<Content Include="Views\Items\Content-Blog.Edit.cshtml" />
<Content Include="Views\Items\Content-BlogPost.Editor.cshtml" />
<Content Include="Views\Items\Content-BlogPost.SummaryAdmin.cshtml" />
<Content Include="Views\Parts\Blogs.BlogPost.List.cshtml" />
<Content Include="Views\Parts\Blogs.Blog.Pager.cshtml" />
<Content Include="Views\Parts\Blogs.RecentBlogPosts.cshtml" />

View File

@@ -10,9 +10,9 @@
-->
<!-- widget and edit shapes just get default placement -->
<!-- edit "shapes" -->
<Place Parts_Blogs_Blog_Fields="Primary:2"/>
<Place Parts_Blogs_BlogArchives_Edit="Primary:5"/>
<Place Parts_Blogs_RecentBlogPosts_Edit="Primary:5"/>
<Place Parts_Blogs_Blog_Fields="Content:2"/>
<Place Parts_Blogs_BlogArchives_Edit="Content:5"/>
<Place Parts_Blogs_RecentBlogPosts_Edit="Content:5"/>
<!-- widgets -->
<Place Parts_Blogs_BlogArchives="Content"/>
<Place Parts_Blogs_RecentBlogPosts="Content"/>
@@ -29,8 +29,8 @@
</Match>
<Match DisplayType="DetailAdmin">
<Place Parts_Blogs_BlogPost_List_Admin="Content:5"
Parts_Blogs_Blog_Manage="Manage"
Parts_Blogs_Blog_Description="Manage:after"/>
Parts_Blogs_Blog_Manage="Actions"
Parts_Blogs_Blog_Description="Actions:after"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_Blogs_Blog_Description="Content:before"

View File

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

View File

@@ -2,6 +2,13 @@
@{
Html.AddTitleParts((string)Model.Title);
}
@Display(Model.Primary)
@Display(Model.Secondary)
<fieldset><button class="primaryAction" type="submit">@T("Save")</button></fieldset>
<div class="sections">
<div class="primary">
@Display(Model.Content)
</div>
<div class="secondary">
@Display(Model.Sidebar)
@* todo: (heskew) remove when the CommonPart is adding the save button *@
<fieldset><button class="primaryAction" type="submit">@T("Save")</button></fieldset>
</div>
</div>

View File

@@ -10,18 +10,20 @@
<div class="properties">
<input type="checkbox" value="@contentItem.Id" name="itemIds"/>
<h3>@Html.Link((string)Model.Title, Url.BlogForAdmin((string)Model.Slug))</h3>
@if (Model.Header != null) {
<div class="header">@Display(Model.Header)</div>
}
@if (Model.Meta != null) {
<div class="metadata">@Display(Model.Meta)</div>
}
@* <p>[list of authors] [modify blog access]</p> *@
</div>
<div class="related">
@Display(Model.Actions)
<a href="@Url.Blog((string)Model.Slug)" title="@T("View")">@T("View")</a>@T(" | ")
<a href="@Url.BlogForAdmin((string)Model.Slug)" title="@T("List Posts")">@T("List Posts")</a>@T(" | ")
<a href="@Url.BlogPostCreate((BlogPart)Model.ContentItem.Get(typeof(BlogPart)))" title="@T("New Post")">@T("New Post")</a>@T(" | ")
<a href="@Url.BlogEdit((string)Model.Slug)" title="@T("Edit")">@T("Edit")</a>@T(" | ")
<a href="Url.BlogRemove((string)Model.Slug)" title="@T("Remove")" itemprop="RemoveUrl UnsafeUrl">@T("Remove")</a>
<br />@Display(Model.Secondary)
<a href="@Url.BlogRemove((string)Model.Slug)" title="@T("Remove")" itemprop="RemoveUrl UnsafeUrl">@T("Remove")</a>
</div>
@if (Model.Content != null) {
<div class="primary">@Display(Model.Content)</div>

View File

@@ -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 @@
}
<div class="sections">
<div class="primary">
@Display(Model.Primary)
@Display(Model.Content)
</div>
<div class="secondary">
@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 *@
<fieldset>
<button class="primaryAction" type="submit" name="submit.Save">@T("Save")</button>
@* 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 @@
}
</fieldset>
</div>
</div>
</div>asdfsdaf

View File

@@ -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();
}
<div class="summary" itemscope="itemscope" itemid="@contentItem.Id" itemtype="http://orchardproject.net/data/ContentItem">
<div class="properties">
<input type="checkbox" value="@contentItem.Id" name="itemIds"/>
<h3>@Html.Link((string)Model.Title, Url.BlogPostEdit((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart))))</h3>
<div class="metadata">@Display(Model.Meta)</div>
</div>
<div class="related">@Display(Model.Related)
@Html.Link(T("Edit").Text, Url.BlogPostEdit((BlogPostPart)Model.ContentItem.Get(typeof(BlogPostPart)))) @T(" | ")
@Html.Link(T("Remove").Text, Url.Action("Remove", "Admin", new { area = "Contents", id = contentItem.Id, returnUrl }), new { itemprop = "RemoveUrl UnsafeUrl" })@T(" | ")
@Display(Model.Secondary)
</div>
<div class="primary">@Display(Model.Content)</div>
</div>

View File

@@ -7,8 +7,8 @@
-->
<!-- widget and edit shapes just get default placement -->
<!-- edit "shapes" -->
<Place Parts_Comments_Enable="Primary:10"/>
<Place Parts_Comments_SiteSettings="Primary:10"/>
<Place Parts_Comments_Enable="Content:10"/>
<Place Parts_Comments_SiteSettings="Content:10"/>
<Match DisplayType="Detail">
<Place Parts_Comments="Content:10" />
</Match>
@@ -16,6 +16,6 @@
<Place Parts_Comments_Count="Meta:5"/>
</Match>
<Match DisplayType="SummaryAdmin">
<Place Parts_Comments_Count_SummaryAdmin="Secondary"/>
<Place Parts_Comments_Count_SummaryAdmin="Sidebar"/>
</Match>
</Placement>

View File

@@ -0,0 +1,30 @@
using Orchard.ContentManagement.Drivers;
using Orchard.ContentQueries.Models;
namespace Orchard.ContentQueries.Drivers {
public class ContentQueryPartDriver : ContentPartDriver<ContentQueryPart> {
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);
}
}
}

View File

@@ -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;
}
}
}

View File

@@ -0,0 +1,5 @@
using Orchard.ContentManagement;
namespace Orchard.ContentQueries.Models {
public class ContentQueryPart : ContentPart<ContentQueryPartRecord> {}
}

View File

@@ -0,0 +1,5 @@
using Orchard.ContentManagement.Records;
namespace Orchard.ContentQueries.Models {
public class ContentQueryPartRecord : ContentPartRecord {}
}

View File

@@ -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

View File

@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{848126A0-9C88-415A-868F-F5F03449D0B6}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.ContentQueries</RootNamespace>
<AssemblyName>Orchard.ContentQueries</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Mvc">
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
<Content Include="Module.txt" />
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Drivers\ContentQueryPartDriver.cs" />
<Compile Include="Migrations.cs" />
<Compile Include="Models\ContentQueryPart.cs" />
<Compile Include="Models\ContentQueryPartRecord.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
<Name>Orchard.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
<Name>Orchard.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="Placement.info">
<SubType>Designer</SubType>
</Content>
<None Include="Views\EditorTemplates\Parts\ContentQueries.Configuration.cshtml" />
<None Include="Views\Parts\QueriedContents.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>57372</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>True</UseCustomServer>
<CustomServerUrl>http://orchard.codeplex.com</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,19 @@
<Placement>
<!-- available display shapes -->
<!--
Parts_QueriedContents
-->
<!-- edit "shape" -->
<Place Parts_ContentQueries_Configuration="Content:2"/>
<!-- default positioning -->
<Match ContentType="ContentQuery">
<Match DisplayType="Detail">
<Place Parts_QueriedContents="Content"/>
</Match>
</Match>
<Match ContentType="ContentQueryWidget">
<Match DisplayType="Detail">
<Place Parts_QueriedContents="Content"/>
</Match>
</Match>
</Placement>

View File

@@ -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")]

View File

@@ -0,0 +1 @@
<p>content query config here -> x</p>

View File

@@ -0,0 +1,14 @@
@{
IEnumerable<object> 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 {
<p>@T("There are no contents.")</p>
}

View File

@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35, processorArchitecture=MSIL"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<namespaces>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<add namespace="System.Linq"/>
<add namespace="System.Collections.Generic"/>
<add namespace="Orchard.Mvc.Html"/>
</namespaces>
</pages>
</system.web>
<system.web.extensions/>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -1,3 +1,3 @@
<Placement>
<Place Parts_SmtpSettings_Edit="Primary:10"/>
<Place Parts_SmtpSettings_Edit="Content:10"/>
</Placement>

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

View File

@@ -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<PublishLaterPart> {
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);
}
}
}

View File

@@ -7,7 +7,7 @@
-->
<!-- edit shape just get default placement -->
<!-- edit "shape" -->
<Place Parts_PublishLater_Edit="Secondary:1"/>
<Place Parts_PublishLater_Edit="Sidebar:1"/>
<!-- default positioning -->
<Match DisplayType="SummaryAdmin">
<Place Parts_PublishLater_Metadata_SummaryAdmin="Meta:1"/>

View File

@@ -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%;
}

View File

@@ -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; }
}
}

View File

@@ -21,10 +21,10 @@
<label class="forcheckbox" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater")">@T("Publish Later")</label>
</div>
<div>
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishUtcDate")">@T("Date")</label>
@Html.EditorFor(m => m.ScheduledPublishUtcDate)
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishUtcTime")">@T("Time")</label>
@Html.EditorFor(m => m.ScheduledPublishUtcTime)
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishDate")">@T("Date")</label>
@Html.EditorFor(m => m.ScheduledPublishDate)
<label class="forpicker" for="@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledPublishTime")">@T("Time")</label>
@Html.EditorFor(m => m.ScheduledPublishTime)
</div>
</fieldset>
@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") });
})
//]]>
</script>

View File

@@ -30,7 +30,7 @@
}
else {
<img class="icon" src="@Href("~/Core/PublishLater/Content/Admin/images/scheduled.gif")" alt="@T("Scheduled")" title="@T("The page is scheduled for publishing")" /><text> @T("Scheduled") </text>
@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"))
}&nbsp;&#124;&nbsp;</li>
}
</ul>

View File

@@ -1,3 +1,3 @@
<Placement>
<Place Parts_Roles_UserRoles_Edit="Primary:10"/>
<Place Parts_Roles_UserRoles_Edit="Content:10"/>
</Placement>

View File

@@ -1,3 +1,3 @@
<Placement>
<Place Parts_Search_SiteSettings="Primary:1"/>
<Place Parts_Search_SiteSettings="Content:1"/>
</Placement>

View File

@@ -94,7 +94,8 @@ namespace Orchard.Setup.Services {
"Orchard.Tags",
"Orchard.Media",
"Orchard.Widgets",
"Orchard.jQuery"
"Orchard.jQuery",
"Orchard.ContentQueries"
};
context.EnabledFeatures = hardcoded;

View File

@@ -1,4 +1,9 @@
<Placement>
<Place Parts_Tags_ShowTags="Header:after.7"/>
<Place Parts_Tags_Edit="Primary:7"/>
<Place Parts_Tags_Edit="Content:7"/>
<Match DisplayType="Detail">
<Place Parts_Tags_ShowTags="Header:after.7"/>
</Match>
<Match DisplayType="Summary">
<Place Parts_Tags_ShowTags="Header:after.7"/>
</Match>
</Placement>

View File

@@ -1,8 +1,8 @@
<div class="sections">
<div class="primary">
@Display(Model.Primary)
@Display(Model.Content)
</div>
<div class="secondary">
@Display(Model.Secondary)
@Display(Model.Sidebar)
</div>
</div>

View File

@@ -1,5 +1,5 @@
<Placement>
<Place Parts_Widgets_LayerPart="Primary:1"/>
<Place Parts_Widgets_WidgetPart="Primary:1"/>
<Place Parts_Widgets_WidegetBagPart="Primary:5"/>
<Place Parts_Widgets_LayerPart="Content:1"/>
<Place Parts_Widgets_WidgetPart="Content:1"/>
<Place Parts_Widgets_WidegetBagPart="Content:5"/>
</Placement>

View File

@@ -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();
}
}

View File

@@ -1,9 +1,10 @@
<div class="sections">
<div class="primary">
@Display(Model.Primary)
@Display(Model.Content)
</div>
<div class="secondary">
@Display(Model.Secondary)
@Display(Model.Sidebar)
@* todo: (heskew) remove when the CommonPart is adding the save button *@
<fieldset>
<input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/>
</fieldset>

View File

@@ -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)

View File

@@ -112,7 +112,6 @@
<add verb="*" path="theme.txt" validate="false" type="System.Web.HttpNotFoundHandler" />
</httpHandlers>
</system.web>
<system.web.extensions/>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.

View File

@@ -93,6 +93,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Themes", "Orchard.Web\Theme
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.PublishLater", "Orchard.Web\Modules\Orchard.PublishLater\Orchard.PublishLater.csproj", "{C889167C-E52C-4A65-A419-224B3D1B957D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ContentQueries", "Orchard.Web\Modules\Orchard.ContentQueries\Orchard.ContentQueries.csproj", "{848126A0-9C88-415A-868F-F5F03449D0B6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{104288A3-382E-4032-AF50-FBB5FDAB9EBB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuPack.Core", "..\external\nuget\NuPack.Core\NuPack.Core.csproj", "{F879F274-EFA0-4157-8404-33A19B4E6AEC}"
@@ -496,16 +498,16 @@ Global
{C889167C-E52C-4A65-A419-224B3D1B957D}.FxCop|Any CPU.Build.0 = Release|Any CPU
{C889167C-E52C-4A65-A419-224B3D1B957D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C889167C-E52C-4A65-A419-224B3D1B957D}.Release|Any CPU.Build.0 = Release|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.CodeCoverage|Any CPU.ActiveCfg = Coverage|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.CodeCoverage|Any CPU.Build.0 = Coverage|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.Coverage|Any CPU.ActiveCfg = Coverage|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.Coverage|Any CPU.Build.0 = Coverage|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.FxCop|Any CPU.ActiveCfg = Coverage|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.FxCop|Any CPU.Build.0 = Coverage|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F879F274-EFA0-4157-8404-33A19B4E6AEC}.Release|Any CPU.Build.0 = Release|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.Coverage|Any CPU.Build.0 = Release|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.FxCop|Any CPU.Build.0 = Release|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{848126A0-9C88-415A-868F-F5F03449D0B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -535,6 +537,7 @@ Global
{AB3C207C-0126-4143-8D62-1119DF80D366} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{C889167C-E52C-4A65-A419-224B3D1B957D} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{848126A0-9C88-415A-868F-F5F03449D0B6} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}

View File

@@ -10,7 +10,7 @@ namespace Orchard.ContentManagement.Handlers {
public TemplateFilterForRecord(string prefix, string templateName) {
_prefix = prefix;
_templateName = templateName;
_location = "Primary";
_location = "Content";
_position = "5";
}