mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 05:23:33 +08:00
Updating the CommonPart to once again make use of the CommonPartVersionRecord
--HG-- branch : dev
This commit is contained in:
@@ -1,13 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Web.Routing;
|
||||||
using Autofac;
|
using Autofac;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Moq;
|
using Moq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Orchard.ContentManagement.Aspects;
|
using Orchard.ContentManagement.Aspects;
|
||||||
|
using Orchard.ContentManagement.Drivers;
|
||||||
|
using Orchard.ContentManagement.Drivers.Coordinators;
|
||||||
using Orchard.ContentManagement.MetaData;
|
using Orchard.ContentManagement.MetaData;
|
||||||
using Orchard.Core.Common;
|
using Orchard.Core.Common;
|
||||||
|
using Orchard.Core.Common.Drivers;
|
||||||
using Orchard.Core.Common.Handlers;
|
using Orchard.Core.Common.Handlers;
|
||||||
using Orchard.Core.Common.Models;
|
using Orchard.Core.Common.Models;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
@@ -27,6 +31,7 @@ using Orchard.Tests.Modules;
|
|||||||
using Orchard.Core.Common.ViewModels;
|
using Orchard.Core.Common.ViewModels;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Orchard.Tests.Stubs;
|
using Orchard.Tests.Stubs;
|
||||||
|
using Orchard.Themes;
|
||||||
|
|
||||||
namespace Orchard.Core.Tests.Common.Providers {
|
namespace Orchard.Core.Tests.Common.Providers {
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
@@ -41,12 +46,19 @@ namespace Orchard.Core.Tests.Common.Providers {
|
|||||||
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
||||||
builder.RegisterType<TestHandler>().As<IContentHandler>();
|
builder.RegisterType<TestHandler>().As<IContentHandler>();
|
||||||
builder.RegisterType<CommonPartHandler>().As<IContentHandler>();
|
builder.RegisterType<CommonPartHandler>().As<IContentHandler>();
|
||||||
|
builder.RegisterType<CommonPartDriver>().As<IContentPartDriver>();
|
||||||
|
builder.RegisterType<ContentPartDriverCoordinator>().As<IContentHandler>();
|
||||||
builder.RegisterType<CommonService>().As<ICommonService>();
|
builder.RegisterType<CommonService>().As<ICommonService>();
|
||||||
builder.RegisterType<ScheduledTaskManager>().As<IScheduledTaskManager>();
|
builder.RegisterType<ScheduledTaskManager>().As<IScheduledTaskManager>();
|
||||||
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
|
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
|
||||||
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
|
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
|
||||||
builder.RegisterType<StubExtensionManager>().As<IExtensionManager>();
|
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>();
|
_authn = new Mock<IAuthenticationService>();
|
||||||
_authz = new Mock<IAuthorizationService>();
|
_authz = new Mock<IAuthorizationService>();
|
||||||
@@ -152,7 +164,7 @@ namespace Orchard.Core.Tests.Common.Providers {
|
|||||||
contentManager.UpdateEditor(item.ContentItem, updater);
|
contentManager.UpdateEditor(item.ContentItem, updater);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test, Ignore("Fix pending")]
|
[Test]
|
||||||
public void PublishingShouldFailIfOwnerIsEmpty()
|
public void PublishingShouldFailIfOwnerIsEmpty()
|
||||||
{
|
{
|
||||||
var contentManager = _container.Resolve<IContentManager>();
|
var contentManager = _container.Resolve<IContentManager>();
|
||||||
@@ -222,9 +234,9 @@ namespace Orchard.Core.Tests.Common.Providers {
|
|||||||
Assert.That(item1.CreatedUtc, Is.EqualTo(createUtc));
|
Assert.That(item1.CreatedUtc, Is.EqualTo(createUtc));
|
||||||
Assert.That(item2.CreatedUtc, Is.EqualTo(createUtc));
|
Assert.That(item2.CreatedUtc, Is.EqualTo(createUtc));
|
||||||
|
|
||||||
// both instances non-versioned dates show the most recent publish
|
// both instances non-versioned dates show the earliest publish date
|
||||||
Assert.That(item1.PublishedUtc, Is.EqualTo(publish2Utc));
|
Assert.That(item1.PublishedUtc, Is.EqualTo(publish1Utc));
|
||||||
Assert.That(item2.PublishedUtc, Is.EqualTo(publish2Utc));
|
Assert.That(item2.PublishedUtc, Is.EqualTo(publish1Utc));
|
||||||
|
|
||||||
// version1 versioned dates show create was upfront and publish was oldest
|
// version1 versioned dates show create was upfront and publish was oldest
|
||||||
Assert.That(item1.VersionCreatedUtc, Is.EqualTo(createUtc));
|
Assert.That(item1.VersionCreatedUtc, Is.EqualTo(createUtc));
|
||||||
|
@@ -51,14 +51,10 @@ namespace Orchard.Core.Common.Drivers {
|
|||||||
ContainerEditor(part, null, shapeHelper));
|
ContainerEditor(part, null, shapeHelper));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(CommonPart instance, IUpdateModel updater, dynamic shapeHelper) {
|
protected override DriverResult Editor(CommonPart part, 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;
|
|
||||||
|
|
||||||
return Combined(
|
return Combined(
|
||||||
OwnerEditor(instance, updater, shapeHelper),
|
OwnerEditor(part, updater, shapeHelper),
|
||||||
ContainerEditor(instance, updater, shapeHelper));
|
ContainerEditor(part, updater, shapeHelper));
|
||||||
}
|
}
|
||||||
|
|
||||||
DriverResult OwnerEditor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) {
|
DriverResult OwnerEditor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
using Orchard.ContentManagement.MetaData;
|
||||||
using Orchard.Core.Common.Models;
|
using Orchard.Core.Common.Models;
|
||||||
using Orchard.Data;
|
using Orchard.Data;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
@@ -13,40 +15,40 @@ namespace Orchard.Core.Common.Handlers {
|
|||||||
private readonly IClock _clock;
|
private readonly IClock _clock;
|
||||||
private readonly IAuthenticationService _authenticationService;
|
private readonly IAuthenticationService _authenticationService;
|
||||||
private readonly IContentManager _contentManager;
|
private readonly IContentManager _contentManager;
|
||||||
|
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||||
|
|
||||||
public CommonPartHandler(
|
public CommonPartHandler(
|
||||||
IRepository<CommonPartRecord> commonRepository,
|
IRepository<CommonPartRecord> commonRepository,
|
||||||
IRepository<CommonPartVersionRecord> commonVersionRepository,
|
IRepository<CommonPartVersionRecord> commonVersionRepository,
|
||||||
IClock clock,
|
IClock clock,
|
||||||
IAuthenticationService authenticationService,
|
IAuthenticationService authenticationService,
|
||||||
IContentManager contentManager) {
|
IContentManager contentManager,
|
||||||
|
IContentDefinitionManager contentDefinitionManager) {
|
||||||
|
|
||||||
_clock = clock;
|
_clock = clock;
|
||||||
_authenticationService = authenticationService;
|
_authenticationService = authenticationService;
|
||||||
_contentManager = contentManager;
|
_contentManager = contentManager;
|
||||||
|
_contentDefinitionManager = contentDefinitionManager;
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
|
|
||||||
Filters.Add(StorageFilter.For(commonRepository));
|
Filters.Add(StorageFilter.For(commonRepository));
|
||||||
Filters.Add(StorageFilter.For(commonVersionRepository));
|
Filters.Add(StorageFilter.For(commonVersionRepository));
|
||||||
|
|
||||||
|
Filters.Add(new ActivatingFilter<ContentPart<CommonPartVersionRecord>>(ContentTypeWithACommonPart));
|
||||||
|
|
||||||
OnInitializing<CommonPart>(PropertySetHandlers);
|
OnInitializing<CommonPart>(PropertySetHandlers);
|
||||||
OnInitializing<CommonPart>(AssignCreatingOwner);
|
OnInitializing<CommonPart>(AssignCreatingOwner);
|
||||||
OnInitializing<ContentPart<CommonPartRecord>>(AssignCreatingDates);
|
OnInitializing<CommonPart>(AssignCreatingDates);
|
||||||
OnInitializing<ContentPart<CommonPartVersionRecord>>(AssignCreatingDates);
|
OnInitializing<ContentPart<CommonPartVersionRecord>>(AssignCreatingDates);
|
||||||
|
|
||||||
OnLoaded<CommonPart>(LazyLoadHandlers);
|
OnLoaded<CommonPart>(LazyLoadHandlers);
|
||||||
|
|
||||||
OnVersioning<CommonPart>(CopyOwnerAndContainer);
|
OnVersioned<CommonPart>(AssignVersioningDates);
|
||||||
|
|
||||||
OnVersioned<ContentPart<CommonPartVersionRecord>>(AssignVersioningDates);
|
OnVersioned<ContentPart<CommonPartVersionRecord>>(AssignVersioningDates);
|
||||||
|
|
||||||
OnPublishing<ContentPart<CommonPartRecord>>(AssignPublishingDates);
|
OnPublishing<CommonPart>(AssignPublishingDates);
|
||||||
OnPublishing<ContentPart<CommonPartVersionRecord>>(AssignPublishingDates);
|
OnPublishing<ContentPart<CommonPartVersionRecord>>(AssignPublishingDates);
|
||||||
|
|
||||||
//OnGetDisplayViewModel<CommonPart>();
|
|
||||||
//OnGetEditorViewModel<CommonPart>(GetEditor);
|
|
||||||
//OnUpdateEditorViewModel<CommonPart>(UpdateEditor);
|
|
||||||
|
|
||||||
OnIndexing<CommonPart>((context, commonPart) => context.DocumentIndex
|
OnIndexing<CommonPart>((context, commonPart) => context.DocumentIndex
|
||||||
.Add("type", commonPart.ContentItem.ContentType).Store()
|
.Add("type", commonPart.ContentItem.ContentType).Store()
|
||||||
.Add("author", commonPart.Owner.UserName).Store()
|
.Add("author", commonPart.Owner.UserName).Store()
|
||||||
@@ -58,6 +60,9 @@ namespace Orchard.Core.Common.Handlers {
|
|||||||
|
|
||||||
public Localizer T { get; set; }
|
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) {
|
void AssignCreatingOwner(InitializingContentContext context, CommonPart part) {
|
||||||
// and use the current user as Owner
|
// 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
|
// assign default create/modified dates
|
||||||
part.Record.CreatedUtc = _clock.UtcNow;
|
part.CreatedUtc = _clock.UtcNow;
|
||||||
part.Record.ModifiedUtc = _clock.UtcNow;
|
part.ModifiedUtc = _clock.UtcNow;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignCreatingDates(InitializingContentContext context, ContentPart<CommonPartVersionRecord> part) {
|
void AssignCreatingDates(InitializingContentContext context, ContentPart<CommonPartVersionRecord> part) {
|
||||||
@@ -78,22 +83,31 @@ namespace Orchard.Core.Common.Handlers {
|
|||||||
part.Record.ModifiedUtc = _clock.UtcNow;
|
part.Record.ModifiedUtc = _clock.UtcNow;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignVersioningDates(VersionContentContext context, ContentPart<CommonPartVersionRecord> existing, ContentPart<CommonPartVersionRecord> building) {
|
void AssignVersioningDates(VersionContentContext context, CommonPart existing, CommonPart building) {
|
||||||
// assign create/modified dates for the new version
|
// assign the created
|
||||||
building.Record.CreatedUtc = _clock.UtcNow;
|
building.CreatedUtc = existing.CreatedUtc ?? _clock.UtcNow;
|
||||||
building.Record.ModifiedUtc = _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
|
// publish date should be null until publish method called
|
||||||
building.Record.PublishedUtc = null;
|
building.Record.PublishedUtc = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignPublishingDates(PublishContentContext context, ContentPart<CommonPartRecord> part) {
|
void AssignPublishingDates(PublishContentContext context, CommonPart part) {
|
||||||
// don't assign dates when unpublishing
|
// don't assign dates when unpublishing
|
||||||
if (context.PublishingItemVersionRecord == null)
|
if (context.PublishingItemVersionRecord == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// assign version-agnostic publish date
|
// set the initial published date
|
||||||
part.Record.PublishedUtc = _clock.UtcNow;
|
part.PublishedUtc = part.PublishedUtc ?? _clock.UtcNow;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignPublishingDates(PublishContentContext context, ContentPart<CommonPartVersionRecord> part) {
|
void AssignPublishingDates(PublishContentContext context, ContentPart<CommonPartVersionRecord> part) {
|
||||||
@@ -101,13 +115,8 @@ namespace Orchard.Core.Common.Handlers {
|
|||||||
if (context.PublishingItemVersionRecord == null)
|
if (context.PublishingItemVersionRecord == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// assign version-specific publish date
|
// assign the version's published date
|
||||||
part.Record.PublishedUtc = _clock.UtcNow;
|
part.Record.PublishedUtc = part.Record.PublishedUtc ?? _clock.UtcNow;
|
||||||
}
|
|
||||||
|
|
||||||
private static void CopyOwnerAndContainer(VersionContentContext c, CommonPart c1, CommonPart c2) {
|
|
||||||
c2.Owner = c1.Owner;
|
|
||||||
c2.Container = c1.Container;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LazyLoadHandlers(LoadContentContext context, CommonPart part) {
|
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
|
// add handlers that will update records when part properties are set
|
||||||
|
|
||||||
part.OwnerField.Setter(user => {
|
part.OwnerField.Setter(user => {
|
||||||
if (user == null) {
|
part.Record.OwnerId = user == null
|
||||||
part.Record.OwnerId = 0;
|
? 0
|
||||||
}
|
: user.ContentItem.Id;
|
||||||
else {
|
return user;
|
||||||
part.Record.OwnerId = user.ContentItem.Id;
|
});
|
||||||
}
|
|
||||||
return user;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Force call to setter if we had already set a value
|
// Force call to setter if we had already set a value
|
||||||
if (part.OwnerField.Value != null)
|
if (part.OwnerField.Value != null)
|
||||||
part.OwnerField.Value = part.OwnerField.Value;
|
part.OwnerField.Value = part.OwnerField.Value;
|
||||||
|
|
||||||
part.ContainerField.Setter(container => {
|
part.ContainerField.Setter(container => {
|
||||||
if (container == null) {
|
part.Record.Container = container == null
|
||||||
part.Record.Container = null;
|
? null
|
||||||
}
|
: container.ContentItem.Record;
|
||||||
else {
|
return container;
|
||||||
part.Record.Container = container.ContentItem.Record;
|
});
|
||||||
}
|
|
||||||
return container;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Force call to setter if we had already set a value
|
// Force call to setter if we had already set a value
|
||||||
if (part.ContainerField.Value != null)
|
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;
|
return PartVersionRecord == null ? CreatedUtc : PartVersionRecord.CreatedUtc;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if (PartVersionRecord != null) {
|
if (PartVersionRecord != null)
|
||||||
PartVersionRecord.CreatedUtc = value;
|
PartVersionRecord.CreatedUtc = value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,9 +60,8 @@ namespace Orchard.Core.Common.Models {
|
|||||||
return PartVersionRecord == null ? PublishedUtc : PartVersionRecord.PublishedUtc;
|
return PartVersionRecord == null ? PublishedUtc : PartVersionRecord.PublishedUtc;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if (PartVersionRecord != null) {
|
if (PartVersionRecord != null)
|
||||||
PartVersionRecord.PublishedUtc = value;
|
PartVersionRecord.PublishedUtc = value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,9 +70,8 @@ namespace Orchard.Core.Common.Models {
|
|||||||
return PartVersionRecord == null ? ModifiedUtc : PartVersionRecord.ModifiedUtc;
|
return PartVersionRecord == null ? ModifiedUtc : PartVersionRecord.ModifiedUtc;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if (PartVersionRecord != null) {
|
if (PartVersionRecord != null)
|
||||||
PartVersionRecord.ModifiedUtc = value;
|
PartVersionRecord.ModifiedUtc = value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -70,6 +70,7 @@
|
|||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Common\Models\CommonPartVersionRecord.cs" />
|
||||||
<Compile Include="Containers\Controllers\ItemController.cs" />
|
<Compile Include="Containers\Controllers\ItemController.cs" />
|
||||||
<Compile Include="Containers\Drivers\ContainablePartDriver.cs" />
|
<Compile Include="Containers\Drivers\ContainablePartDriver.cs" />
|
||||||
<Compile Include="Containers\Drivers\ContainerPartDriver.cs" />
|
<Compile Include="Containers\Drivers\ContainerPartDriver.cs" />
|
||||||
@@ -131,7 +132,6 @@
|
|||||||
<Compile Include="Routable\IRoutablePathConstraint.cs" />
|
<Compile Include="Routable\IRoutablePathConstraint.cs" />
|
||||||
<Compile Include="Routable\Models\RoutePart.cs" />
|
<Compile Include="Routable\Models\RoutePart.cs" />
|
||||||
<Compile Include="Common\Permissions.cs" />
|
<Compile Include="Common\Permissions.cs" />
|
||||||
<Compile Include="Common\Models\CommonPartVersionRecord.cs" />
|
|
||||||
<Compile Include="Common\Utilities\LazyField.cs" />
|
<Compile Include="Common\Utilities\LazyField.cs" />
|
||||||
<Compile Include="Common\Handlers\CommonPartHandler.cs" />
|
<Compile Include="Common\Handlers\CommonPartHandler.cs" />
|
||||||
<Compile Include="Common\Models\CommonPart.cs" />
|
<Compile Include="Common\Models\CommonPart.cs" />
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.Core.Common.Models;
|
|
||||||
using Orchard.PublishLater.Models;
|
using Orchard.PublishLater.Models;
|
||||||
|
|
||||||
namespace Orchard.PublishLater.ViewModels {
|
namespace Orchard.PublishLater.ViewModels {
|
||||||
@@ -30,8 +29,6 @@ namespace Orchard.PublishLater.ViewModels {
|
|||||||
get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; }
|
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 DateTime? ScheduledPublishUtc { get; set; }
|
||||||
|
|
||||||
public string ScheduledPublishDate { get; set; }
|
public string ScheduledPublishDate { get; set; }
|
||||||
|
Reference in New Issue
Block a user