mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Yaml.Serialization;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.WindowsAzure;
|
||||
using Microsoft.WindowsAzure.ServiceRuntime;
|
||||
@@ -95,33 +94,60 @@ namespace Orchard.Azure.Environment.Configuration {
|
||||
}
|
||||
|
||||
static ShellSettings ParseSettings(string text) {
|
||||
var ser = new YamlSerializer();
|
||||
var content = ser.Deserialize(text, typeof(Content)).Cast<Content>().Single();
|
||||
return new ShellSettings {
|
||||
Name = content.Name,
|
||||
DataProvider = content.DataProvider,
|
||||
DataConnectionString = content.DataConnectionString,
|
||||
DataTablePrefix = content.DataPrefix,
|
||||
RequestUrlHost = content.RequestUrlHost,
|
||||
RequestUrlPrefix = content.RequestUrlPrefix,
|
||||
State = new TenantState(content.State)
|
||||
};
|
||||
var shellSettings = new ShellSettings();
|
||||
if ( String.IsNullOrEmpty(text) )
|
||||
return shellSettings;
|
||||
|
||||
string[] settings = text.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach ( var setting in settings ) {
|
||||
string[] settingFields = setting.Split(new[] { ":" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
int fieldsLength = settingFields.Length;
|
||||
if ( fieldsLength != 2 )
|
||||
continue;
|
||||
for ( int i = 0; i < fieldsLength; i++ ) {
|
||||
settingFields[i] = settingFields[i].Trim();
|
||||
}
|
||||
if ( settingFields[1] != "null" ) {
|
||||
switch ( settingFields[0] ) {
|
||||
case "Name":
|
||||
shellSettings.Name = settingFields[1];
|
||||
break;
|
||||
case "DataProvider":
|
||||
shellSettings.DataProvider = settingFields[1];
|
||||
break;
|
||||
case "State":
|
||||
shellSettings.State = new TenantState(settingFields[1]);
|
||||
break;
|
||||
case "DataConnectionString":
|
||||
shellSettings.DataConnectionString = settingFields[1];
|
||||
break;
|
||||
case "DataPrefix":
|
||||
shellSettings.DataTablePrefix = settingFields[1];
|
||||
break;
|
||||
case "RequestUrlHost":
|
||||
shellSettings.RequestUrlHost = settingFields[1];
|
||||
break;
|
||||
case "RequestUrlPrefix":
|
||||
shellSettings.RequestUrlPrefix = settingFields[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return shellSettings;
|
||||
}
|
||||
|
||||
static string ComposeSettings(ShellSettings settings) {
|
||||
if ( settings == null )
|
||||
return "";
|
||||
|
||||
var ser = new YamlSerializer();
|
||||
return ser.Serialize(new Content {
|
||||
Name = settings.Name,
|
||||
DataProvider = settings.DataProvider,
|
||||
DataConnectionString = settings.DataConnectionString,
|
||||
DataPrefix = settings.DataTablePrefix,
|
||||
RequestUrlHost = settings.RequestUrlHost,
|
||||
RequestUrlPrefix = settings.RequestUrlPrefix,
|
||||
State = settings.State != null ? settings.State.ToString() : String.Empty
|
||||
});
|
||||
return string.Format("Name: {0}\r\nDataProvider: {1}\r\nDataConnectionString: {2}\r\nDataPrefix: {3}\r\nRequestUrlHost: {4}\r\nRequestUrlPrefix: {5}\r\nState: {6}\r\n",
|
||||
settings.Name,
|
||||
settings.DataProvider,
|
||||
settings.DataConnectionString ?? "null",
|
||||
settings.DataTablePrefix ?? "null",
|
||||
settings.RequestUrlHost ?? "null",
|
||||
settings.RequestUrlPrefix ?? "null",
|
||||
settings.State != null ? settings.State.ToString() : String.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,10 +68,6 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="YamlSerializer, Version=0.9.0.2, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\yaml\YamlSerializer.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CloudBlobContainerExtensions.cs" />
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Routing;
|
||||
using Autofac;
|
||||
using JetBrains.Annotations;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.Drivers.Coordinators;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Core.Common;
|
||||
using Orchard.Core.Common.Drivers;
|
||||
using Orchard.Core.Common.Handlers;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.ContentManagement;
|
||||
@@ -27,6 +31,7 @@ using Orchard.Tests.Modules;
|
||||
using Orchard.Core.Common.ViewModels;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.Themes;
|
||||
|
||||
namespace Orchard.Core.Tests.Common.Providers {
|
||||
[TestFixture]
|
||||
@@ -41,12 +46,19 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
||||
builder.RegisterType<TestHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<CommonPartHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<CommonPartDriver>().As<IContentPartDriver>();
|
||||
builder.RegisterType<ContentPartDriverCoordinator>().As<IContentHandler>();
|
||||
builder.RegisterType<CommonService>().As<ICommonService>();
|
||||
builder.RegisterType<ScheduledTaskManager>().As<IScheduledTaskManager>();
|
||||
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
|
||||
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
|
||||
builder.RegisterType<StubExtensionManager>().As<IExtensionManager>();
|
||||
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
|
||||
builder.RegisterInstance(new Mock<IThemeManager>().Object);
|
||||
builder.RegisterInstance(new Mock<IOrchardServices>().Object);
|
||||
builder.RegisterInstance(new Mock<RequestContext>().Object);
|
||||
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
|
||||
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
|
||||
builder.RegisterType<DefaultContentDisplay>().As<IContentDisplay>();
|
||||
|
||||
_authn = new Mock<IAuthenticationService>();
|
||||
_authz = new Mock<IAuthorizationService>();
|
||||
@@ -152,7 +164,7 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
contentManager.UpdateEditor(item.ContentItem, updater);
|
||||
}
|
||||
|
||||
[Test, Ignore("Fix pending")]
|
||||
[Test]
|
||||
public void PublishingShouldFailIfOwnerIsEmpty()
|
||||
{
|
||||
var contentManager = _container.Resolve<IContentManager>();
|
||||
@@ -222,9 +234,9 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
Assert.That(item1.CreatedUtc, Is.EqualTo(createUtc));
|
||||
Assert.That(item2.CreatedUtc, Is.EqualTo(createUtc));
|
||||
|
||||
// both instances non-versioned dates show the most recent publish
|
||||
Assert.That(item1.PublishedUtc, Is.EqualTo(publish2Utc));
|
||||
Assert.That(item2.PublishedUtc, Is.EqualTo(publish2Utc));
|
||||
// both instances non-versioned dates show the earliest publish date
|
||||
Assert.That(item1.PublishedUtc, Is.EqualTo(publish1Utc));
|
||||
Assert.That(item2.PublishedUtc, Is.EqualTo(publish1Utc));
|
||||
|
||||
// version1 versioned dates show create was upfront and publish was oldest
|
||||
Assert.That(item1.VersionCreatedUtc, Is.EqualTo(createUtc));
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Orchard.Core.Tests.Feeds.Controllers {
|
||||
|
||||
var mockContentManager = new Mock<IContentManager>();
|
||||
mockContentManager.Setup(x => x.GetItemMetadata(It.IsAny<IContent>()))
|
||||
.Returns(new ContentItemMetadata(hello) { DisplayText = "foo" });
|
||||
.Returns(new ContentItemMetadata() { DisplayText = "foo" });
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
//builder.RegisterModule(new ImplicitCollectionSupportModule());
|
||||
|
||||
@@ -61,5 +61,13 @@ namespace Orchard.Tests.Modules.Widgets.RuleEngine {
|
||||
_urlRuleProvider.Process(context);
|
||||
Assert.That(context.Result, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UrlForAboutPageWithEndingSlashMatchesAboutPagePath() {
|
||||
_stubContextAccessor.StubContext = new StubHttpContext("~/About/");
|
||||
var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } };
|
||||
_urlRuleProvider.Process(context);
|
||||
Assert.That(context.Result, Is.True);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,14 +51,10 @@ namespace Orchard.Core.Common.Drivers {
|
||||
ContainerEditor(part, null, shapeHelper));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(CommonPart instance, IUpdateModel updater, dynamic shapeHelper) {
|
||||
// this event is hooked so the modified timestamp is changed when an edit-post occurs.
|
||||
instance.ModifiedUtc = _clock.UtcNow;
|
||||
instance.VersionModifiedUtc = _clock.UtcNow;
|
||||
|
||||
protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
return Combined(
|
||||
OwnerEditor(instance, updater, shapeHelper),
|
||||
ContainerEditor(instance, updater, shapeHelper));
|
||||
OwnerEditor(part, updater, shapeHelper),
|
||||
ContainerEditor(part, updater, shapeHelper));
|
||||
}
|
||||
|
||||
DriverResult OwnerEditor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Data;
|
||||
using Orchard.Localization;
|
||||
@@ -13,40 +15,40 @@ namespace Orchard.Core.Common.Handlers {
|
||||
private readonly IClock _clock;
|
||||
private readonly IAuthenticationService _authenticationService;
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
|
||||
public CommonPartHandler(
|
||||
IRepository<CommonPartRecord> commonRepository,
|
||||
IRepository<CommonPartVersionRecord> commonVersionRepository,
|
||||
IClock clock,
|
||||
IAuthenticationService authenticationService,
|
||||
IContentManager contentManager) {
|
||||
IContentManager contentManager,
|
||||
IContentDefinitionManager contentDefinitionManager) {
|
||||
|
||||
_clock = clock;
|
||||
_authenticationService = authenticationService;
|
||||
_contentManager = contentManager;
|
||||
_contentDefinitionManager = contentDefinitionManager;
|
||||
T = NullLocalizer.Instance;
|
||||
|
||||
Filters.Add(StorageFilter.For(commonRepository));
|
||||
Filters.Add(StorageFilter.For(commonVersionRepository));
|
||||
|
||||
Filters.Add(new ActivatingFilter<ContentPart<CommonPartVersionRecord>>(ContentTypeWithACommonPart));
|
||||
|
||||
OnInitializing<CommonPart>(PropertySetHandlers);
|
||||
OnInitializing<CommonPart>(AssignCreatingOwner);
|
||||
OnInitializing<ContentPart<CommonPartRecord>>(AssignCreatingDates);
|
||||
OnInitializing<CommonPart>(AssignCreatingDates);
|
||||
OnInitializing<ContentPart<CommonPartVersionRecord>>(AssignCreatingDates);
|
||||
|
||||
OnLoaded<CommonPart>(LazyLoadHandlers);
|
||||
|
||||
OnVersioning<CommonPart>(CopyOwnerAndContainer);
|
||||
|
||||
OnVersioned<CommonPart>(AssignVersioningDates);
|
||||
OnVersioned<ContentPart<CommonPartVersionRecord>>(AssignVersioningDates);
|
||||
|
||||
OnPublishing<ContentPart<CommonPartRecord>>(AssignPublishingDates);
|
||||
OnPublishing<CommonPart>(AssignPublishingDates);
|
||||
OnPublishing<ContentPart<CommonPartVersionRecord>>(AssignPublishingDates);
|
||||
|
||||
//OnGetDisplayViewModel<CommonPart>();
|
||||
//OnGetEditorViewModel<CommonPart>(GetEditor);
|
||||
//OnUpdateEditorViewModel<CommonPart>(UpdateEditor);
|
||||
|
||||
OnIndexing<CommonPart>((context, commonPart) => context.DocumentIndex
|
||||
.Add("type", commonPart.ContentItem.ContentType).Store()
|
||||
.Add("author", commonPart.Owner.UserName).Store()
|
||||
@@ -58,6 +60,9 @@ namespace Orchard.Core.Common.Handlers {
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
bool ContentTypeWithACommonPart(string typeName) {
|
||||
return _contentDefinitionManager.GetTypeDefinition(typeName).Parts.Any(part => part.PartDefinition.Name == "CommonPart");
|
||||
}
|
||||
|
||||
void AssignCreatingOwner(InitializingContentContext context, CommonPart part) {
|
||||
// and use the current user as Owner
|
||||
@@ -66,10 +71,10 @@ namespace Orchard.Core.Common.Handlers {
|
||||
}
|
||||
}
|
||||
|
||||
void AssignCreatingDates(InitializingContentContext context, ContentPart<CommonPartRecord> part) {
|
||||
void AssignCreatingDates(InitializingContentContext context, CommonPart part) {
|
||||
// assign default create/modified dates
|
||||
part.Record.CreatedUtc = _clock.UtcNow;
|
||||
part.Record.ModifiedUtc = _clock.UtcNow;
|
||||
part.CreatedUtc = _clock.UtcNow;
|
||||
part.ModifiedUtc = _clock.UtcNow;
|
||||
}
|
||||
|
||||
void AssignCreatingDates(InitializingContentContext context, ContentPart<CommonPartVersionRecord> part) {
|
||||
@@ -78,22 +83,31 @@ namespace Orchard.Core.Common.Handlers {
|
||||
part.Record.ModifiedUtc = _clock.UtcNow;
|
||||
}
|
||||
|
||||
void AssignVersioningDates(VersionContentContext context, ContentPart<CommonPartVersionRecord> existing, ContentPart<CommonPartVersionRecord> building) {
|
||||
// assign create/modified dates for the new version
|
||||
building.Record.CreatedUtc = _clock.UtcNow;
|
||||
building.Record.ModifiedUtc = _clock.UtcNow;
|
||||
void AssignVersioningDates(VersionContentContext context, CommonPart existing, CommonPart building) {
|
||||
// assign the created
|
||||
building.CreatedUtc = existing.CreatedUtc ?? _clock.UtcNow;
|
||||
// persist and published dates
|
||||
building.PublishedUtc = existing.PublishedUtc;
|
||||
// assign modified date for the new version
|
||||
building.ModifiedUtc = _clock.UtcNow;
|
||||
}
|
||||
|
||||
void AssignVersioningDates(VersionContentContext context, ContentPart<CommonPartVersionRecord> existing, ContentPart<CommonPartVersionRecord> building) {
|
||||
// assign the created date
|
||||
building.Record.CreatedUtc = _clock.UtcNow;
|
||||
// assign modified date for the new version
|
||||
building.Record.ModifiedUtc = _clock.UtcNow;
|
||||
// publish date should be null until publish method called
|
||||
building.Record.PublishedUtc = null;
|
||||
}
|
||||
|
||||
void AssignPublishingDates(PublishContentContext context, ContentPart<CommonPartRecord> part) {
|
||||
void AssignPublishingDates(PublishContentContext context, CommonPart part) {
|
||||
// don't assign dates when unpublishing
|
||||
if (context.PublishingItemVersionRecord == null)
|
||||
return;
|
||||
|
||||
// assign version-agnostic publish date
|
||||
part.Record.PublishedUtc = _clock.UtcNow;
|
||||
|
||||
// set the initial published date
|
||||
part.PublishedUtc = part.PublishedUtc ?? _clock.UtcNow;
|
||||
}
|
||||
|
||||
void AssignPublishingDates(PublishContentContext context, ContentPart<CommonPartVersionRecord> part) {
|
||||
@@ -101,13 +115,8 @@ namespace Orchard.Core.Common.Handlers {
|
||||
if (context.PublishingItemVersionRecord == null)
|
||||
return;
|
||||
|
||||
// assign version-specific publish date
|
||||
part.Record.PublishedUtc = _clock.UtcNow;
|
||||
}
|
||||
|
||||
private static void CopyOwnerAndContainer(VersionContentContext c, CommonPart c1, CommonPart c2) {
|
||||
c2.Owner = c1.Owner;
|
||||
c2.Container = c1.Container;
|
||||
// assign the version's published date
|
||||
part.Record.PublishedUtc = part.Record.PublishedUtc ?? _clock.UtcNow;
|
||||
}
|
||||
|
||||
void LazyLoadHandlers(LoadContentContext context, CommonPart part) {
|
||||
@@ -120,28 +129,22 @@ namespace Orchard.Core.Common.Handlers {
|
||||
// add handlers that will update records when part properties are set
|
||||
|
||||
part.OwnerField.Setter(user => {
|
||||
if (user == null) {
|
||||
part.Record.OwnerId = 0;
|
||||
}
|
||||
else {
|
||||
part.Record.OwnerId = user.ContentItem.Id;
|
||||
}
|
||||
return user;
|
||||
});
|
||||
part.Record.OwnerId = user == null
|
||||
? 0
|
||||
: user.ContentItem.Id;
|
||||
return user;
|
||||
});
|
||||
|
||||
// Force call to setter if we had already set a value
|
||||
if (part.OwnerField.Value != null)
|
||||
part.OwnerField.Value = part.OwnerField.Value;
|
||||
|
||||
part.ContainerField.Setter(container => {
|
||||
if (container == null) {
|
||||
part.Record.Container = null;
|
||||
}
|
||||
else {
|
||||
part.Record.Container = container.ContentItem.Record;
|
||||
}
|
||||
return container;
|
||||
});
|
||||
part.Record.Container = container == null
|
||||
? null
|
||||
: container.ContentItem.Record;
|
||||
return container;
|
||||
});
|
||||
|
||||
// Force call to setter if we had already set a value
|
||||
if (part.ContainerField.Value != null)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
|
||||
namespace Orchard.Core.Common.Handlers {
|
||||
public class ItemReferenceContentFieldHandler : ContentFieldHandler {
|
||||
public ItemReferenceContentFieldHandler(IEnumerable<IContentFieldDriver> contentFieldDrivers) : base(contentFieldDrivers) { }
|
||||
}
|
||||
}
|
||||
@@ -50,9 +50,8 @@ namespace Orchard.Core.Common.Models {
|
||||
return PartVersionRecord == null ? CreatedUtc : PartVersionRecord.CreatedUtc;
|
||||
}
|
||||
set {
|
||||
if (PartVersionRecord != null) {
|
||||
if (PartVersionRecord != null)
|
||||
PartVersionRecord.CreatedUtc = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,9 +60,8 @@ namespace Orchard.Core.Common.Models {
|
||||
return PartVersionRecord == null ? PublishedUtc : PartVersionRecord.PublishedUtc;
|
||||
}
|
||||
set {
|
||||
if (PartVersionRecord != null) {
|
||||
if (PartVersionRecord != null)
|
||||
PartVersionRecord.PublishedUtc = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,9 +70,8 @@ namespace Orchard.Core.Common.Models {
|
||||
return PartVersionRecord == null ? ModifiedUtc : PartVersionRecord.ModifiedUtc;
|
||||
}
|
||||
set {
|
||||
if (PartVersionRecord != null) {
|
||||
if (PartVersionRecord != null)
|
||||
PartVersionRecord.ModifiedUtc = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<div class="published">@Display.PublishedState(dateTimeUtc: Model.ContentPart.VersionPublishedUtc)</div>
|
||||
<div class="published">@Display.PublishedState(dateTimeUtc: Model.ContentPart.PublishedUtc)</div>
|
||||
@@ -1 +1 @@
|
||||
<div class="published">@Display.PublishedState(dateTimeUtc: Model.ContentPart.VersionPublishedUtc)</div>
|
||||
<div class="published">@Display.PublishedState(dateTimeUtc: Model.ContentPart.PublishedUtc)</div>
|
||||
@@ -7,8 +7,9 @@ namespace Orchard.Core.Contents.Handlers {
|
||||
if (context.Metadata.CreateRouteValues == null) {
|
||||
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Item"},
|
||||
{"Action", "Create"}
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Create"},
|
||||
{"Id", context.ContentItem.ContentType}
|
||||
};
|
||||
}
|
||||
if (context.Metadata.EditorRouteValues == null) {
|
||||
@@ -30,8 +31,9 @@ namespace Orchard.Core.Contents.Handlers {
|
||||
if (context.Metadata.RemoveRouteValues == null) {
|
||||
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Item"},
|
||||
{"Action", "Remove"}
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Remove"},
|
||||
{"Id", context.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Common\Models\CommonPartVersionRecord.cs" />
|
||||
<Compile Include="Containers\Controllers\ItemController.cs" />
|
||||
<Compile Include="Containers\Drivers\ContainablePartDriver.cs" />
|
||||
<Compile Include="Containers\Drivers\ContainerPartDriver.cs" />
|
||||
@@ -122,7 +123,6 @@
|
||||
<Compile Include="Routable\IRoutablePathConstraint.cs" />
|
||||
<Compile Include="Routable\Models\RoutePart.cs" />
|
||||
<Compile Include="Common\Permissions.cs" />
|
||||
<Compile Include="Common\Models\CommonPartVersionRecord.cs" />
|
||||
<Compile Include="Common\Utilities\LazyField.cs" />
|
||||
<Compile Include="Common\Handlers\CommonPartHandler.cs" />
|
||||
<Compile Include="Common\Models\CommonPart.cs" />
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Orchard.Core.Shapes {
|
||||
var time = _clock.UtcNow - dateTimeUtc;
|
||||
|
||||
if (time.TotalDays > 7)
|
||||
return Html.DateTime(dateTimeUtc, T("'on' MMM d yyyy 'at' h:mm tt"));
|
||||
return Html.DateTime(dateTimeUtc.ToLocalTime(), T("'on' MMM d yyyy 'at' h:mm tt"));
|
||||
if (time.TotalHours > 24)
|
||||
return T.Plural("1 day ago", "{0} days ago", time.Days);
|
||||
if (time.TotalMinutes > 60)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Content\Admin\images\scheduled.gif" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\datetime.css" />
|
||||
<Content Include="Styles\orchard-archivelater-datetime.css" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Web.config" />
|
||||
|
||||
@@ -7,7 +7,7 @@ using Orchard.UI.Resources;
|
||||
namespace Orchard.ArchiveLater {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("ArchiveLater_DatePicker").SetUrl("datetime.css");
|
||||
builder.Add().DefineStyle("ArchiveLater_DatePicker").SetUrl("orchard-archivelater-datetime.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Web.Routing;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Data;
|
||||
|
||||
@@ -14,5 +16,30 @@ namespace Orchard.Blogs.Handlers {
|
||||
context.Shape.PostCount = blog.PostCount;
|
||||
});
|
||||
}
|
||||
|
||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||
var blog = context.ContentItem.As<BlogPart>();
|
||||
|
||||
if (blog == null)
|
||||
return;
|
||||
|
||||
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogAdmin"},
|
||||
{"Action", "Create"}
|
||||
};
|
||||
context.Metadata.EditorRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogAdmin"},
|
||||
{"Action", "Edit"},
|
||||
{"Id", context.ContentItem.Id}
|
||||
};
|
||||
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogAdmin"},
|
||||
{"Action", "Remove"},
|
||||
{"Id", context.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,18 +6,15 @@ using Orchard.Blogs.Models;
|
||||
using Orchard.Blogs.Services;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Core.Routable.Models;
|
||||
|
||||
namespace Orchard.Blogs.Handlers {
|
||||
[UsedImplicitly]
|
||||
public class BlogPostPartHandler : ContentHandler {
|
||||
private readonly IBlogPostService _blogPostService;
|
||||
private readonly IOrchardServices _orchardServices;
|
||||
|
||||
public BlogPostPartHandler(IBlogService blogService, IBlogPostService blogPostService, IOrchardServices orchardServices, RequestContext requestContext) {
|
||||
public BlogPostPartHandler(IBlogService blogService, IBlogPostService blogPostService, RequestContext requestContext) {
|
||||
_blogPostService = blogPostService;
|
||||
_orchardServices = orchardServices;
|
||||
T = NullLocalizer.Instance;
|
||||
|
||||
Action<BlogPart> updateBlogPostCount =
|
||||
(blog => {
|
||||
@@ -65,6 +62,32 @@ namespace Orchard.Blogs.Handlers {
|
||||
context.Shape.Blog = blogPost.BlogPart;
|
||||
}
|
||||
|
||||
Localizer T { get; set; }
|
||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||
var blogPost = context.ContentItem.As<BlogPostPart>();
|
||||
|
||||
if (blogPost == null)
|
||||
return;
|
||||
|
||||
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogPostAdmin"},
|
||||
{"Action", "Create"},
|
||||
{"blogSlug", blogPost.BlogPart.As<RoutePart>().Slug}
|
||||
};
|
||||
context.Metadata.EditorRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogPostAdmin"},
|
||||
{"Action", "Edit"},
|
||||
{"postId", context.ContentItem.Id},
|
||||
{"blogSlug", blogPost.BlogPart.As<RoutePart>().Slug}
|
||||
};
|
||||
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Blogs"},
|
||||
{"Controller", "BlogPostAdmin"},
|
||||
{"Action", "Delete"},
|
||||
{"postId", context.ContentItem.Id},
|
||||
{"blogSlug", blogPost.BlogPart.As<RoutePart>().Slug}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,9 +103,9 @@
|
||||
<Content Include="Content\Admin\images\published.gif" />
|
||||
<Content Include="Content\Admin\images\scheduled.gif" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Scripts\archives.js" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\archives.css" />
|
||||
<Content Include="Scripts\orchard-blogs-archives.js" />
|
||||
<Content Include="Styles\orchard-blogs-admin.css" />
|
||||
<Content Include="Styles\orchard-blogs-archives.css" />
|
||||
<Content Include="Views\BlogAdmin\Create.cshtml" />
|
||||
<Content Include="Views\BlogAdmin\Edit.cshtml" />
|
||||
<Content Include="Views\BlogAdmin\Item.cshtml" />
|
||||
|
||||
@@ -4,10 +4,10 @@ namespace Orchard.Blogs {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
var manifest = builder.Add();
|
||||
manifest.DefineStyle("BlogsAdmin").SetUrl("admin.css");
|
||||
manifest.DefineStyle("BlogsArchives").SetUrl("archives.css");
|
||||
manifest.DefineStyle("BlogsAdmin").SetUrl("orchard-blogs-admin.css");
|
||||
manifest.DefineStyle("BlogsArchives").SetUrl("orchard-blogs-archives.css");
|
||||
|
||||
manifest.DefineScript("BlogsArchives").SetUrl("archives.js").SetDependencies("jQuery");
|
||||
manifest.DefineScript("BlogsArchives").SetUrl("orchard-blogs-archives.js").SetDependencies("jQuery");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
@@ -27,4 +27,12 @@
|
||||
<handlers>
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<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>
|
||||
|
||||
@@ -7,8 +7,6 @@ using Orchard.Comments.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Utility.Extensions;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Orchard.Comments.Controllers {
|
||||
public class CommentController : Controller {
|
||||
@@ -33,16 +31,19 @@ namespace Orchard.Comments.Controllers {
|
||||
: Redirect("~/");
|
||||
|
||||
var viewModel = new CommentsCreateViewModel();
|
||||
|
||||
if (TryUpdateModel(viewModel)) {
|
||||
var context = new CreateCommentContext {
|
||||
Author = viewModel.Name,
|
||||
CommentText = viewModel.CommentText,
|
||||
Email = viewModel.Email,
|
||||
SiteName = viewModel.SiteName,
|
||||
CommentedOn = viewModel.CommentedOn
|
||||
};
|
||||
|
||||
TryUpdateModel(viewModel);
|
||||
|
||||
var context = new CreateCommentContext {
|
||||
Author = viewModel.Name,
|
||||
CommentText = viewModel.CommentText,
|
||||
Email = viewModel.Email,
|
||||
SiteName = viewModel.SiteName,
|
||||
CommentedOn = viewModel.CommentedOn
|
||||
};
|
||||
|
||||
|
||||
if (ModelState.IsValid) {
|
||||
if (!String.IsNullOrEmpty(context.SiteName) && !context.SiteName.StartsWith("http://") && !context.SiteName.StartsWith("https://")) {
|
||||
context.SiteName = "http://" + context.SiteName;
|
||||
}
|
||||
@@ -58,6 +59,13 @@ namespace Orchard.Comments.Controllers {
|
||||
}
|
||||
}
|
||||
|
||||
if(!ModelState.IsValid) {
|
||||
TempData["CreateCommentContext.Name"] = context.Author;
|
||||
TempData["CreateCommentContext.CommentText"] = context.CommentText;
|
||||
TempData["CreateCommentContext.Email"] = context.Email;
|
||||
TempData["CreateCommentContext.SiteName"] = context.SiteName;
|
||||
}
|
||||
|
||||
return !String.IsNullOrEmpty(returnUrl)
|
||||
? Redirect(returnUrl)
|
||||
: Redirect("~/");
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
<Compile Include="Drivers\CommentsContainerPartDriver.cs" />
|
||||
<Compile Include="Drivers\CommentSettingsPartDriver.cs" />
|
||||
<Compile Include="Drivers\CommentsPartDriver.cs" />
|
||||
<Compile Include="ResourceManifest.cs" />
|
||||
<Compile Include="Shapes.cs" />
|
||||
<Compile Include="Models\ClosedCommentsRecord.cs" />
|
||||
<Compile Include="Models\CommentPart.cs" />
|
||||
@@ -97,7 +98,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-comments-admin.css" />
|
||||
<Content Include="Views\Admin\Details.cshtml" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
|
||||
10
src/Orchard.Web/Modules/Orchard.Comments/ResourceManifest.cs
Normal file
10
src/Orchard.Web/Modules/Orchard.Comments/ResourceManifest.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Orchard.UI.Resources;
|
||||
|
||||
namespace Orchard.Comments {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
var manifest = builder.Add();
|
||||
manifest.DefineStyle("Admin").SetUrl("orchard-comments-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<label for="Email">@T("Email")</label>
|
||||
<input id="Email" class="text" name="Email" type="text" value="@Model.Email" />
|
||||
<input id="Email" class="text" name="Email" type="text" value="@Model.Email" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="SiteName">@T("Url")</label>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@using Orchard.Mvc.Html;
|
||||
@using Orchard.Utility.Extensions;
|
||||
@{
|
||||
Style.Include("admin.css");
|
||||
Style.Require("Admin");
|
||||
Script.Require("ShapesBase");
|
||||
}
|
||||
<h1>@Html.TitleForPage(T("Manage Comments").ToString())</h1>
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
@using Orchard.Security;
|
||||
@using Orchard.Utility.Extensions;
|
||||
|
||||
@{
|
||||
var contextExists = TempData["CreateCommentContext.Name"] != null;
|
||||
var name = Convert.ToString(TempData["CreateCommentContext.Name"]);
|
||||
var commentText = Convert.ToString(TempData["CreateCommentContext.CommentText"]);
|
||||
var email = Convert.ToString(TempData["CreateCommentContext.Email"]);
|
||||
var siteName = Convert.ToString(TempData["CreateCommentContext.SiteName"]);
|
||||
}
|
||||
|
||||
@if (Model.ContentPart.Comments.Count > 0) {
|
||||
<div id="comments">
|
||||
<h2 class="comment-count">@T.Plural("1 Comment", "{0} Comments", (int)Model.ContentPart.Comments.Count)</h2>
|
||||
@@ -30,15 +38,15 @@ using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, Fo
|
||||
<ol>
|
||||
<li>
|
||||
<label for="Name">@T("Name")</label>
|
||||
<input id="Name" class="text" name="Name" type="text" />
|
||||
<input id="Name" class="text" name="Name" type="text" value="@(contextExists ? name : String.Empty)" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="Email">@T("Email")</label>
|
||||
<input id="Email" class="text" name="Email" type="text" />
|
||||
<input id="Email" class="text" name="Email" type="text" value="@(contextExists ? email : String.Empty)"/>
|
||||
</li>
|
||||
<li>
|
||||
<label for="SiteName">@T("Url")</label>
|
||||
<input id="SiteName" class="text" name="SiteName" type="text" />
|
||||
<input id="SiteName" class="text" name="SiteName" type="text" value="@(contextExists ? siteName : String.Empty)"/>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
@@ -52,7 +60,7 @@ using (Html.BeginForm("Create", "Comment", new { area = "Orchard.Comments" }, Fo
|
||||
<ol>
|
||||
<li>
|
||||
<label for="comment-text">@T("Comment")</label>
|
||||
<textarea id="comment-text" rows="10" cols="30" name="CommentText"></textarea>
|
||||
<textarea id="comment-text" rows="10" cols="30" name="CommentText">@(contextExists ? commentText : String.Empty)</textarea>
|
||||
</li>
|
||||
<li>
|
||||
<button class="primaryAction" type="submit">@T("Submit Comment")</button>
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-contenttypes-admin.css" />
|
||||
<Content Include="Views\Admin\AddFieldTo.cshtml" />
|
||||
<Content Include="Views\Admin\AddPartsTo.cshtml" />
|
||||
<Content Include="Views\Admin\CreatePart.cshtml" />
|
||||
|
||||
@@ -7,7 +7,7 @@ using Orchard.UI.Resources;
|
||||
namespace Orchard.ContentTypes {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("ContentTypesAdmin").SetUrl("admin.css");
|
||||
builder.Add().DefineStyle("ContentTypesAdmin").SetUrl("orchard-contenttypes-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\base.css" />
|
||||
<Content Include="Styles\orchard-localization-admin.css" />
|
||||
<Content Include="Styles\orchard-localization-base.css" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Styles\Web.config">
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace Orchard.Localization {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
var manifest = builder.Add();
|
||||
manifest.DefineStyle("Localization").SetUrl("base.css");
|
||||
manifest.DefineStyle("LocalizationAdmin").SetUrl("admin.css");
|
||||
manifest.DefineStyle("Localization").SetUrl("orchard-localization-base.css");
|
||||
manifest.DefineStyle("LocalizationAdmin").SetUrl("orchard-localization-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Content\Admin\images\folder.gif" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-media-admin.css" />
|
||||
<Content Include="Content\Site.css" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.UI.Resources;
|
||||
using Orchard.UI.Resources;
|
||||
|
||||
namespace Orchard.Media {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("MediaAdmin").SetUrl("admin.css");
|
||||
builder.Add().DefineStyle("MediaAdmin").SetUrl("orchard-media-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Content\Admin\images\disabled.gif" />
|
||||
<Content Include="Content\Admin\images\enabled.gif" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-modules-admin.css" />
|
||||
<Content Include="Views\Admin\Features.cshtml" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -7,7 +7,7 @@ using Orchard.UI.Resources;
|
||||
namespace Orchard.Modules {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("ModulesAdmin").SetUrl("admin.css");
|
||||
builder.Add().DefineStyle("ModulesAdmin").SetUrl("orchard-modules-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<Content Include="Content\Admin\images\disabled.gif" />
|
||||
<Content Include="Content\Admin\images\enabled.gif" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-multitenancy-admin.css" />
|
||||
<Content Include="Views\Admin\Add.cshtml" />
|
||||
<Content Include="Views\Admin\Edit.cshtml" />
|
||||
<Content Include="Views\Admin\DisplayTemplates\ActionsForUninitialized.cshtml" />
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.UI.Resources;
|
||||
|
||||
namespace Orchard.MultiTenancy {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("MultiTenancyAdmin").SetUrl("admin.css");
|
||||
builder.Add().DefineStyle("MultiTenancyAdmin").SetUrl("orchard-multitenancy-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-packaging-admin.css" />
|
||||
<Content Include="Views\Gallery\AddSource.cshtml" />
|
||||
<Content Include="Views\Gallery\Modules.cshtml" />
|
||||
<Content Include="Views\Gallery\Sources.cshtml" />
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Orchard.Packaging {
|
||||
[OrchardFeature("Gallery")]
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("PackagingAdmin").SetUrl("admin.css");
|
||||
builder.Add().DefineStyle("PackagingAdmin").SetUrl("orchard-packaging-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<Content Include="Content\Admin\images\published.gif" />
|
||||
<Content Include="Content\Admin\images\scheduled.gif" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\datetime.css" />
|
||||
<Content Include="Styles\orchard-publishlater-datetime.css" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\EditorTemplates\Parts\PublishLater.cshtml" />
|
||||
|
||||
@@ -7,7 +7,7 @@ using Orchard.UI.Resources;
|
||||
namespace Orchard.PublishLater {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("PublishLater_DatePicker").SetUrl("datetime.css");
|
||||
builder.Add().DefineStyle("PublishLater_DatePicker").SetUrl("orchard-publishlater-datetime.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.PublishLater.Models;
|
||||
|
||||
namespace Orchard.PublishLater.ViewModels {
|
||||
@@ -30,8 +29,6 @@ namespace Orchard.PublishLater.ViewModels {
|
||||
get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; }
|
||||
}
|
||||
|
||||
public DateTime? VersionPublishedUtc { get { return ContentItem.As<CommonPart>() == null ? null : ContentItem.As<CommonPart>().VersionPublishedUtc; } }
|
||||
|
||||
public DateTime? ScheduledPublishUtc { get; set; }
|
||||
|
||||
public string ScheduledPublishDate { get; set; }
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
@using Orchard.PublishLater.Models;
|
||||
@{
|
||||
PublishLaterPart publishLaterPart = Model.ContentPart;
|
||||
DateTime? versionPublishedUtc = publishLaterPart.As<CommonPart>() == null ? null : publishLaterPart.As<CommonPart>().VersionPublishedUtc;
|
||||
DateTime? publishedUtc = publishLaterPart.As<CommonPart>() == null ? null : publishLaterPart.As<CommonPart>().PublishedUtc;
|
||||
}
|
||||
@if (publishLaterPart.IsPublished() && versionPublishedUtc.HasValue) {
|
||||
@T("Published: {0}", Display.DateTimeRelative(dateTimeUtc: versionPublishedUtc.Value)) @T(" | ")
|
||||
@if (publishLaterPart.IsPublished() && publishedUtc.HasValue) {
|
||||
@T("Published: {0}", Display.DateTimeRelative(dateTimeUtc: publishedUtc.Value)) @T(" | ")
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
@using Orchard.PublishLater.Models;
|
||||
@{
|
||||
PublishLaterPart publishLaterPart = Model.ContentPart;
|
||||
DateTime? versionPublishedUtc = publishLaterPart.As<CommonPart>() == null ? null : publishLaterPart.As<CommonPart>().VersionPublishedUtc;
|
||||
DateTime? publishedUtc = publishLaterPart.As<CommonPart>() == null ? null : publishLaterPart.As<CommonPart>().PublishedUtc;
|
||||
}
|
||||
@if (publishLaterPart.IsPublished() && versionPublishedUtc.HasValue) {
|
||||
@T("Published: {0}", Display.DateTimeRelative(dateTimeUtc: versionPublishedUtc.Value))
|
||||
@if (publishLaterPart.IsPublished() && publishedUtc.HasValue) {
|
||||
@T("Published: {0}", Display.DateTimeRelative(dateTimeUtc: publishedUtc.Value))
|
||||
}
|
||||
@@ -70,8 +70,8 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\search.css" />
|
||||
<Content Include="Styles\orchard-search-admin.css" />
|
||||
<Content Include="Styles\orchard-search-search.css" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -7,8 +7,8 @@ using Orchard.UI.Resources;
|
||||
namespace Orchard.Search {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("SearchAdmin").SetUrl("admin.css"); // todo: this does not appear to be used anywhere
|
||||
builder.Add().DefineStyle("Search").SetUrl("search.css");
|
||||
builder.Add().DefineStyle("SearchAdmin").SetUrl("orchard-search-admin.css"); // todo: this does not appear to be used anywhere
|
||||
builder.Add().DefineStyle("Search").SetUrl("orchard-search-search.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-tags-admin.css" />
|
||||
<Content Include="Views\Web.config" />
|
||||
<Content Include="Views\Admin\Edit.cshtml" />
|
||||
<Content Include="Views\Admin\Index.cshtml" />
|
||||
|
||||
@@ -3,7 +3,7 @@ using Orchard.UI.Resources;
|
||||
namespace Orchard.Tags {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("TagsAdmin").SetUrl("admin.css");
|
||||
builder.Add().DefineStyle("TagsAdmin").SetUrl("orchard-tags-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\orchard.ico" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-themes-admin.css" />
|
||||
<Content Include="Views\Admin\Index.cshtml" />
|
||||
<Content Include="Views\Admin\Install.cshtml" />
|
||||
<Content Include="Views\ThemePreview.cshtml" />
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Orchard.Themes {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
var manifest = builder.Add();
|
||||
manifest.DefineStyle("ThemesAdmin").SetUrl("admin.css");
|
||||
manifest.DefineStyle("ThemesAdmin").SetUrl("orchard-themes-admin.css");
|
||||
|
||||
// todo: include and define the min.js version too
|
||||
// todo: move EasySlider to common location, although it does not appear to be used anywhere right now
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using JetBrains.Annotations;
|
||||
using System.Web.Routing;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Data;
|
||||
using Orchard.Widgets.Models;
|
||||
@@ -9,5 +11,32 @@ namespace Orchard.Widgets.Handlers {
|
||||
public WidgetPartHandler(IRepository<WidgetPartRecord> widgetsRepository) {
|
||||
Filters.Add(StorageFilter.For(widgetsRepository));
|
||||
}
|
||||
|
||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||
var widget = context.ContentItem.As<WidgetPart>();
|
||||
|
||||
if (widget == null)
|
||||
return;
|
||||
|
||||
// create needs to go through the add widget flow (index -> [select layer -> ] add [widget type] to layer)
|
||||
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Widgets"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Index"}
|
||||
};
|
||||
context.Metadata.EditorRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Widgets"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "EditWidget"},
|
||||
{"Id", context.ContentItem.Id}
|
||||
};
|
||||
// remove goes through edit widget...
|
||||
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
|
||||
{"Area", "Orchard.Widgets"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "EditWidget"},
|
||||
{"Id", context.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@
|
||||
<Content Include="Content\Admin\images\moveup.gif" />
|
||||
<Content Include="Content\Admin\images\movedown.gif" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Styles\orchard-widgets-admin.css" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Orchard.Widgets {
|
||||
public class ResourceManifest : IResourceManifestProvider {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
builder.Add().DefineStyle("WidgetsAdmin").SetUrl("admin.css");
|
||||
builder.Add().DefineStyle("WidgetsAdmin").SetUrl("orchard-widgets-admin.css");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,17 @@ namespace Orchard.Widgets.RuleEngine {
|
||||
appPath = "";
|
||||
url = string.Format("{0}/{1}", appPath, url);
|
||||
}
|
||||
if (url != "/" && !url.Contains("?") && url.EndsWith("/"))
|
||||
|
||||
if (!url.Contains("?"))
|
||||
url = url.TrimEnd('/');
|
||||
|
||||
var requestPath = context.Request.Path;
|
||||
if (!requestPath.Contains("?"))
|
||||
requestPath = requestPath.TrimEnd('/');
|
||||
|
||||
ruleContext.Result = url.EndsWith("*")
|
||||
? context.Request.Path.ToUpperInvariant().StartsWith(url.TrimEnd('*').ToUpperInvariant())
|
||||
: context.Request.Path.ToUpperInvariant() == url.ToUpperInvariant();
|
||||
? requestPath.StartsWith(url.TrimEnd('*'), StringComparison.OrdinalIgnoreCase)
|
||||
: string.Equals(requestPath, url, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,15 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Hosting;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Commands {
|
||||
internal class CommandHostEnvironment : IHostEnvironment {
|
||||
internal class CommandHostEnvironment : HostEnvironment {
|
||||
public CommandHostEnvironment() {
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public bool IsFullTrust {
|
||||
get { return AppDomain.CurrentDomain.IsFullyTrusted; }
|
||||
}
|
||||
|
||||
public string MapPath(string virtualPath) {
|
||||
return HostingEnvironment.MapPath(virtualPath);
|
||||
}
|
||||
|
||||
public bool IsAssemblyLoaded(string name) {
|
||||
return AppDomain.CurrentDomain.GetAssemblies().Any(assembly => new AssemblyName(assembly.FullName).Name == name);
|
||||
}
|
||||
|
||||
public void RestartAppDomain() {
|
||||
ResetSiteCompilation();
|
||||
}
|
||||
|
||||
public void ResetSiteCompilation() {
|
||||
public override void ResetSiteCompilation() {
|
||||
throw new OrchardCommandHostRetryException(T("A change of configuration requires the session to be restarted."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Orchard.ContentManagement {
|
||||
public class ContentItemMetadata {
|
||||
public ContentItemMetadata(IContent item) {
|
||||
DisplayRouteValues = GetDisplayRouteValues(item);
|
||||
EditorRouteValues = GetEditorRouteValues(item);
|
||||
CreateRouteValues = GetCreateRouteValues(item);
|
||||
}
|
||||
|
||||
public string DisplayText { get; set; }
|
||||
public RouteValueDictionary DisplayRouteValues { get; set; }
|
||||
public RouteValueDictionary EditorRouteValues { get; set; }
|
||||
public RouteValueDictionary CreateRouteValues { get; set; }
|
||||
public RouteValueDictionary RemoveRouteValues { get; set; }
|
||||
|
||||
public IEnumerable<string> DisplayGroups { get; set; }
|
||||
public IEnumerable<string> EditorGroups { get; set; }
|
||||
|
||||
private static RouteValueDictionary GetDisplayRouteValues(IContent item) {
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Item"},
|
||||
{"Action", "Display"},
|
||||
{"id", item.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
|
||||
private static RouteValueDictionary GetEditorRouteValues(IContent item) {
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Edit"},
|
||||
{"id", item.ContentItem.Id}
|
||||
};
|
||||
}
|
||||
|
||||
private static RouteValueDictionary GetCreateRouteValues(IContent item) {
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Create"},
|
||||
{"id", item.ContentItem.ContentType}
|
||||
};
|
||||
}
|
||||
|
||||
private static RouteValueDictionary GetRemoveRouteValues(IContent item) {
|
||||
return new RouteValueDictionary {
|
||||
{"Area", "Contents"},
|
||||
{"Controller", "Admin"},
|
||||
{"Action", "Remove"}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -350,20 +350,10 @@ namespace Orchard.ContentManagement {
|
||||
public ContentItemMetadata GetItemMetadata(IContent content) {
|
||||
var context = new GetContentItemMetadataContext {
|
||||
ContentItem = content.ContentItem,
|
||||
Metadata = new ContentItemMetadata(content)
|
||||
Metadata = new ContentItemMetadata()
|
||||
};
|
||||
|
||||
Handlers.Invoke(handler => handler.GetContentItemMetadata(context), Logger);
|
||||
//-- was - from ContentItemDriver --
|
||||
//void IContentItemDriver.GetContentItemMetadata(GetContentItemMetadataContext context) {
|
||||
// var item = context.ContentItem.As<TContent>();
|
||||
// if (item != null) {
|
||||
// context.Metadata.DisplayText = GetDisplayText(item) ?? context.Metadata.DisplayText;
|
||||
// context.Metadata.DisplayRouteValues = GetDisplayRouteValues(item) ?? context.Metadata.DisplayRouteValues;
|
||||
// context.Metadata.EditorRouteValues = GetEditorRouteValues(item) ?? context.Metadata.EditorRouteValues;
|
||||
// context.Metadata.CreateRouteValues = GetCreateRouteValues(item) ?? context.Metadata.CreateRouteValues;
|
||||
// }
|
||||
//}
|
||||
|
||||
return context.Metadata;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using NHibernate;
|
||||
using NHibernate.Cfg;
|
||||
using Orchard.Data;
|
||||
using Orchard.Data.Providers;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Environment.ShellBuilders.Models;
|
||||
using Orchard.FileSystems.AppData;
|
||||
@@ -21,6 +22,7 @@ namespace Orchard.Data {
|
||||
public class SessionFactoryHolder : ISessionFactoryHolder {
|
||||
private readonly ShellSettings _shellSettings;
|
||||
private readonly ShellBlueprint _shellBlueprint;
|
||||
private readonly IHostEnvironment _hostEnvironment;
|
||||
private readonly IDataServicesProviderFactory _dataServicesProviderFactory;
|
||||
private readonly IAppDataFolder _appDataFolder;
|
||||
private readonly ISessionConfigurationCache _sessionConfigurationCache;
|
||||
@@ -33,12 +35,14 @@ namespace Orchard.Data {
|
||||
ShellBlueprint shellBlueprint,
|
||||
IDataServicesProviderFactory dataServicesProviderFactory,
|
||||
IAppDataFolder appDataFolder,
|
||||
ISessionConfigurationCache sessionConfigurationCache) {
|
||||
ISessionConfigurationCache sessionConfigurationCache,
|
||||
IHostEnvironment hostEnvironment) {
|
||||
_shellSettings = shellSettings;
|
||||
_shellBlueprint = shellBlueprint;
|
||||
_dataServicesProviderFactory = dataServicesProviderFactory;
|
||||
_appDataFolder = appDataFolder;
|
||||
_sessionConfigurationCache = sessionConfigurationCache;
|
||||
_hostEnvironment = hostEnvironment;
|
||||
|
||||
T = NullLocalizer.Instance;
|
||||
Logger = NullLogger.Instance;
|
||||
@@ -68,7 +72,7 @@ namespace Orchard.Data {
|
||||
private ISessionFactory BuildSessionFactory() {
|
||||
Logger.Debug("Building session factory");
|
||||
|
||||
if (!(AppDomain.CurrentDomain.IsHomogenous && AppDomain.CurrentDomain.IsFullyTrusted))
|
||||
if (!_hostEnvironment.IsFullTrust)
|
||||
NHibernate.Cfg.Environment.UseReflectionOptimizer = false;
|
||||
|
||||
Configuration config = GetConfiguration();
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Web.Hosting;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Services;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Environment
|
||||
{
|
||||
public class DefaultHostEnvironment : IHostEnvironment
|
||||
public class DefaultHostEnvironment : HostEnvironment
|
||||
{
|
||||
private readonly IClock _clock;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
@@ -20,27 +16,7 @@ namespace Orchard.Environment
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
public bool IsFullTrust
|
||||
{
|
||||
get { return AppDomain.CurrentDomain.IsFullyTrusted; }
|
||||
}
|
||||
|
||||
public string MapPath(string virtualPath)
|
||||
{
|
||||
return HostingEnvironment.MapPath(virtualPath);
|
||||
}
|
||||
|
||||
public bool IsAssemblyLoaded(string name)
|
||||
{
|
||||
return AppDomain.CurrentDomain.GetAssemblies().Any(assembly => new AssemblyName(assembly.FullName).Name == name);
|
||||
}
|
||||
|
||||
public void RestartAppDomain()
|
||||
{
|
||||
ResetSiteCompilation();
|
||||
}
|
||||
|
||||
public void ResetSiteCompilation()
|
||||
public override void ResetSiteCompilation()
|
||||
{
|
||||
// Touch web.config
|
||||
File.SetLastWriteTimeUtc(MapPath("~/web.config"), _clock.UtcNow);
|
||||
|
||||
26
src/Orchard/Environment/HostEnvironment.cs
Normal file
26
src/Orchard/Environment/HostEnvironment.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Hosting;
|
||||
|
||||
namespace Orchard.Environment {
|
||||
public abstract class HostEnvironment : IHostEnvironment {
|
||||
public bool IsFullTrust {
|
||||
get { return AppDomain.CurrentDomain.IsHomogenous && AppDomain.CurrentDomain.IsFullyTrusted; }
|
||||
}
|
||||
|
||||
public string MapPath(string virtualPath) {
|
||||
return HostingEnvironment.MapPath(virtualPath);
|
||||
}
|
||||
|
||||
public bool IsAssemblyLoaded(string name) {
|
||||
return AppDomain.CurrentDomain.GetAssemblies().Any(assembly => new AssemblyName(assembly.FullName).Name == name);
|
||||
}
|
||||
|
||||
public void RestartAppDomain() {
|
||||
ResetSiteCompilation();
|
||||
}
|
||||
|
||||
public abstract void ResetSiteCompilation();
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security;
|
||||
using System.Security.Permissions;
|
||||
using Autofac;
|
||||
using Autofac.Core;
|
||||
using Castle.Core.Logging;
|
||||
using Orchard.Environment;
|
||||
using Module = Autofac.Module;
|
||||
|
||||
namespace Orchard.Logging {
|
||||
@@ -16,13 +15,15 @@ namespace Orchard.Logging {
|
||||
// by default, use Orchard's logger that delegates to Castle's logger factory
|
||||
moduleBuilder.RegisterType<CastleLoggerFactory>().As<ILoggerFactory>().InstancePerLifetimeScope();
|
||||
|
||||
// Register logger type
|
||||
if (AppDomain.CurrentDomain.IsHomogenous && AppDomain.CurrentDomain.IsFullyTrusted) {
|
||||
moduleBuilder.RegisterType<TraceLoggerFactory>().As<Castle.Core.Logging.ILoggerFactory>().InstancePerLifetimeScope();
|
||||
} else {
|
||||
// if security model does not allow it, fall back to null logger factory
|
||||
moduleBuilder.RegisterType<NullLogFactory>().As<Castle.Core.Logging.ILoggerFactory>().InstancePerLifetimeScope();
|
||||
}
|
||||
moduleBuilder.Register<Castle.Core.Logging.ILoggerFactory>(componentContext => {
|
||||
IHostEnvironment host = componentContext.Resolve<IHostEnvironment>();
|
||||
if (host.IsFullTrust)
|
||||
return new TraceLoggerFactory();
|
||||
return new NullLogFactory();
|
||||
})
|
||||
.As<Castle.Core.Logging.ILoggerFactory>()
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
|
||||
// call CreateLogger in response to the request for an ILogger implementation
|
||||
moduleBuilder.Register(CreateLogger).As<ILogger>().InstancePerDependency();
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace Orchard.Mvc.Html {
|
||||
|
||||
public static LocalizedString DateTime(this HtmlHelper htmlHelper, DateTime value) {
|
||||
//TODO: (erikpo) This default format should come from a site setting
|
||||
return htmlHelper.DateTime(value, new LocalizedString("MMM d yyyy h:mm tt")); //todo: above comment and get rid of just wrapping this as a localized string
|
||||
return htmlHelper.DateTime(value.ToLocalTime(), new LocalizedString("MMM d yyyy h:mm tt")); //todo: above comment and get rid of just wrapping this as a localized string
|
||||
}
|
||||
|
||||
public static LocalizedString DateTime(this HtmlHelper htmlHelper, DateTime value, LocalizedString customFormat) {
|
||||
|
||||
@@ -153,6 +153,7 @@
|
||||
<Compile Include="DisplayManagement\Implementation\IShapeDisplayEvents.cs" />
|
||||
<Compile Include="DisplayManagement\Implementation\IShapeFactoryEvents.cs" />
|
||||
<Compile Include="DisplayManagement\Shapes\ITagBuilderFactory.cs" />
|
||||
<Compile Include="Environment\HostEnvironment.cs" />
|
||||
<Compile Include="Environment\DefaultHostEnvironment.cs" />
|
||||
<Compile Include="Environment\Extensions\Loaders\RawThemeExtensionLoader.cs" />
|
||||
<Compile Include="Environment\Features\FeatureManager.cs" />
|
||||
|
||||
Reference in New Issue
Block a user