mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Several refactoring operations
This commit is contained in:
parent
18a7f375f0
commit
f0155c2698
@ -23,13 +23,11 @@ namespace Orchard.Core.Contents.Drivers {
|
|||||||
|
|
||||||
if (part.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable) {
|
if (part.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable) {
|
||||||
results.Add(ContentShape("Content_PublishButton", publishButton => publishButton));
|
results.Add(ContentShape("Content_PublishButton", publishButton => publishButton));
|
||||||
if (part.ContentItem.IsPublished()) {
|
results.Add(ContentShape("Content_UnpublishButton", unpublishButton => unpublishButton));
|
||||||
results.Add(ContentShape("Content_UnpublishButton", unpublishButton => unpublishButton));
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (part.Id > 0) {
|
if (part.Id > 0) {
|
||||||
results.Add(ContentShape("Content_DeleteButton", deleteButton => deleteButton));
|
results.Add(ContentShape("Content_DeleteButton", deleteButton => deleteButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Combined(results.ToArray());
|
return Combined(results.ToArray());
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
Parts_Contents_Publish_SummaryAdmin
|
Parts_Contents_Publish_SummaryAdmin
|
||||||
-->
|
-->
|
||||||
<!-- edit "shape" -->
|
<!-- edit "shape" -->
|
||||||
<Place Content_UnpublishButton="Sidebar:25"/>
|
|
||||||
<Place Content_PublishButton="Sidebar:24"/>
|
|
||||||
<Place Content_SaveButton="Sidebar:23"/>
|
<Place Content_SaveButton="Sidebar:23"/>
|
||||||
<Place Content_DeleteButton="Sidebar:22"/>
|
<Place Content_PublishButton="Sidebar:24"/>
|
||||||
|
<Place Content_UnpublishButton="Sidebar:25"/>
|
||||||
|
<Place Content_DeleteButton="Sidebar:26"/>
|
||||||
<Match DisplayType="Detail">
|
<Match DisplayType="Detail">
|
||||||
<Place Parts_Contents_Publish="Content:5"/>
|
<Place Parts_Contents_Publish="Content:5"/>
|
||||||
</Match>
|
</Match>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@using Orchard.ContentManagement;
|
@using Orchard.ContentManagement;
|
||||||
@using Orchard.Core.Contents;
|
@using Orchard.Core.Contents;
|
||||||
@using Orchard.Utility.Extensions
|
|
||||||
|
|
||||||
@if (Authorizer.Authorize(Permissions.DeleteContent, (IContent)Model.ContentItem)) {
|
@if (Authorizer.Authorize(Permissions.DeleteContent, (IContent)Model.ContentItem)) {
|
||||||
<fieldset class="delete-button">
|
<fieldset class="delete-button">
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
@using Orchard.ContentManagement;
|
@using Orchard.ContentManagement;
|
||||||
@using Orchard.Core.Contents;
|
@using Orchard.Core.Contents;
|
||||||
@using Orchard.Utility.Extensions;
|
|
||||||
@{
|
@{
|
||||||
var contentItem = Model.ContentItem as IContent;
|
var contentItem = Model.ContentItem as IContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (Authorizer.Authorize(Permissions.PublishContent, contentItem) && contentItem.IsPublished()) {
|
@if (Authorizer.Authorize(Permissions.PublishContent, contentItem) && contentItem.IsPublished()) {
|
||||||
<fieldset class="unpublish-button">
|
<fieldset class="unpublish-button">
|
||||||
<button type="submit" name="submit.Unpublish" value="submit.Unpublish">@T("Unpublish")</button>
|
<button type="submit" name="submit.Unpublish" value="submit.Unpublish">@T("Unpublish")</button>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Orchard.Blogs.Extensions;
|
using Orchard.Blogs.Extensions;
|
||||||
using Orchard.Blogs.Models;
|
using Orchard.Blogs.Models;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.ContentManagement.Drivers;
|
using Orchard.ContentManagement.Drivers;
|
||||||
using Orchard.Core.Contents.Settings;
|
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Utility.Extensions;
|
using Orchard.Utility.Extensions;
|
||||||
using Orchard.Widgets.Models;
|
using Orchard.Widgets.Models;
|
||||||
@ -36,11 +35,6 @@ namespace Orchard.Widgets.Drivers {
|
|||||||
() => shapeHelper.EditorTemplate(TemplateName: "Parts.Widgets.WidgetPart", Model: widgetPart, Prefix: Prefix))
|
() => shapeHelper.EditorTemplate(TemplateName: "Parts.Widgets.WidgetPart", Model: widgetPart, Prefix: Prefix))
|
||||||
};
|
};
|
||||||
|
|
||||||
if (widgetPart.Id > 0 && widgetPart.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable) {
|
|
||||||
results.Add(ContentShape("Content_UnpublishButton",
|
|
||||||
unpublishButton => unpublishButton));
|
|
||||||
}
|
|
||||||
|
|
||||||
return Combined(results.ToArray());
|
return Combined(results.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1126,24 +1126,27 @@ html.dyn #submit-pager, html.dyn .apply-bulk-actions-auto { display:none; }
|
|||||||
/* Core Contents and Orchard.PublishLater */
|
/* Core Contents and Orchard.PublishLater */
|
||||||
|
|
||||||
.edit-item-sidebar fieldset {
|
.edit-item-sidebar fieldset {
|
||||||
margin:0;
|
margin: 0;
|
||||||
padding:0;
|
padding: 0;
|
||||||
|
clear: none;
|
||||||
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset.publish-button, fieldset.delete-button, fieldset.save-button, fieldset.unpublish-button {
|
.edit-item-sidebar fieldset:not(:first-child) {
|
||||||
clear:none;
|
margin-left: 12px;
|
||||||
float:left;
|
|
||||||
}
|
}
|
||||||
fieldset.save-button {
|
|
||||||
clear:left;
|
.edit-item-sidebar fieldset:first-child {
|
||||||
|
clear: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset.publish-button, fieldset.unpublish-button {
|
fieldset.publish-button, fieldset.unpublish-button {
|
||||||
margin: 0 12px 0 0;
|
padding-right: 12px;
|
||||||
padding: 0 12px;
|
border-right: 1px solid #ccc;
|
||||||
border-right:1px solid #ccc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset.delete-button {
|
fieldset.delete-button {
|
||||||
margin: 0 0 0 12px;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dashboard */
|
/* Dashboard */
|
||||||
@ -1495,17 +1498,29 @@ html.dir-rtl {
|
|||||||
margin-left:inherit;
|
margin-left:inherit;
|
||||||
margin-right:10px;
|
margin-right:10px;
|
||||||
}
|
}
|
||||||
.dir-rtl fieldset.publish-button, fieldset.delete-button, .dir-rtl fieldset.save-button, .dir-rtl fieldset.unpublish-button {
|
|
||||||
float:right;
|
.dir-rtl .edit-item-sidebar fieldset {
|
||||||
|
float: right;
|
||||||
}
|
}
|
||||||
.dir-rtl fieldset.save-button {
|
|
||||||
clear:right;
|
.dir-rtl .edit-item-sidebar fieldset:first-child {
|
||||||
|
clear: right;
|
||||||
}
|
}
|
||||||
.dir-rtl fieldset.publish-button, .dir-rtl fieldset.unpublish-button {
|
|
||||||
margin: 0 0 0 12px ;
|
.dir-rtl .edit-item-sidebar fieldset:not(:first-child) {
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dir-rtl fieldset.publish-button, fieldset.unpublish-button {
|
||||||
|
padding-right: 0;
|
||||||
|
border-right: none;
|
||||||
|
padding-left: 12px;
|
||||||
|
border-left: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
.dir-rtl fieldset.delete-button {
|
.dir-rtl fieldset.delete-button {
|
||||||
margin: 0 12px 0 0;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-rtl .permalink input.text {
|
.content-rtl .permalink input.text {
|
||||||
|
Loading…
Reference in New Issue
Block a user