mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Getting content publishing/unpublishing hooked up (from the content item list)
- moved publishing control to the Contents module - included some prep for adding bulk actions and filtering to the content item list - publish, unpublish and remove actions need downlevel interstitial pages (functionality only workes w/ JS at the moment) --HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Core.Contents.ViewModels {
|
||||
public class PublishContentViewModel {
|
||||
public PublishContentViewModel(ContentItem contentItem) {
|
||||
ContentItem = contentItem;
|
||||
}
|
||||
|
||||
public ContentItem ContentItem { get; private set; }
|
||||
|
||||
public bool IsPublished {
|
||||
get { return ContentItem.VersionRecord != null && ContentItem.VersionRecord.Published; }
|
||||
}
|
||||
|
||||
public bool HasDraft {
|
||||
get {
|
||||
return (
|
||||
(ContentItem.VersionRecord != null)
|
||||
&& ((ContentItem.VersionRecord.Published == false)
|
||||
|| (ContentItem.VersionRecord.Published && ContentItem.VersionRecord.Latest == false)));
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasPublished {
|
||||
get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; }
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user