Files
Orchard/src/Orchard.Web/Core/Contents/ViewModels/PublishContentViewModel.cs
Nathan Heskew 7d6b76d7f5 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
2010-07-16 00:49:24 -07:00

28 lines
991 B
C#

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