mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Some work towards standardizing on (some) template zone names and positions...
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044851
This commit is contained in:
@@ -16,18 +16,18 @@ namespace Orchard.Core.Common.Providers {
|
|||||||
|
|
||||||
OnGetDisplayViewModel<BodyAspect>((context, body) => {
|
OnGetDisplayViewModel<BodyAspect>((context, body) => {
|
||||||
var model = new BodyDisplayViewModel { BodyAspect = body };
|
var model = new BodyDisplayViewModel { BodyAspect = body };
|
||||||
context.AddDisplay(new TemplateViewModel(model, TemplatePrefix) { TemplateName = TemplateName, ZoneName = "body" });
|
context.AddDisplay(new TemplateViewModel(model, TemplatePrefix) { TemplateName = TemplateName, ZoneName = "primary" });
|
||||||
});
|
});
|
||||||
|
|
||||||
OnGetEditorViewModel<BodyAspect>((context, body) => {
|
OnGetEditorViewModel<BodyAspect>((context, body) => {
|
||||||
var model = new BodyEditorViewModel { BodyAspect = body, TextEditorTemplate = DefaultTextEditorTemplate };
|
var model = new BodyEditorViewModel { BodyAspect = body, TextEditorTemplate = DefaultTextEditorTemplate };
|
||||||
context.AddEditor(new TemplateViewModel(model, TemplatePrefix) { TemplateName = TemplateName, ZoneName = "body" });
|
context.AddEditor(new TemplateViewModel(model, TemplatePrefix) { TemplateName = TemplateName, ZoneName = "primary" });
|
||||||
});
|
});
|
||||||
|
|
||||||
OnUpdateEditorViewModel<BodyAspect>((context, body) => {
|
OnUpdateEditorViewModel<BodyAspect>((context, body) => {
|
||||||
var model = new BodyEditorViewModel { BodyAspect = body, TextEditorTemplate = DefaultTextEditorTemplate };
|
var model = new BodyEditorViewModel { BodyAspect = body, TextEditorTemplate = DefaultTextEditorTemplate };
|
||||||
context.Updater.TryUpdateModel(model, TemplatePrefix, null, null);
|
context.Updater.TryUpdateModel(model, TemplatePrefix, null, null);
|
||||||
context.AddEditor(new TemplateViewModel(model, TemplatePrefix) { TemplateName = TemplateName, ZoneName = "body" });
|
context.AddEditor(new TemplateViewModel(model, TemplatePrefix) { TemplateName = TemplateName, ZoneName = "primary" });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace Orchard.Core.Common.Providers {
|
|||||||
if (instance.Owner != null)
|
if (instance.Owner != null)
|
||||||
viewModel.Owner = instance.Owner.UserName;
|
viewModel.Owner = instance.Owner.UserName;
|
||||||
|
|
||||||
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { TemplateName="Parts/Common.Owner", Position = "9" });
|
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { TemplateName = "Parts/Common.Owner", ZoneName = "primary", Position = "999" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ namespace Orchard.Core.Common.Providers {
|
|||||||
instance.Owner = newOwner;
|
instance.Owner = newOwner;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { TemplateName = "Parts/Common.Owner", Position = "9" });
|
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { TemplateName = "Parts/Common.Owner", ZoneName = "primary", Position = "999" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
@@ -10,4 +10,5 @@
|
|||||||
%><div class="posted">Posted by <%=Html.Encode(Model.Item.Creator.UserName)%> <%=Html.PublishedWhen(Model.Item)%></div><%
|
%><div class="posted">Posted by <%=Html.Encode(Model.Item.Creator.UserName)%> <%=Html.PublishedWhen(Model.Item)%></div><%
|
||||||
} %>
|
} %>
|
||||||
</div>
|
</div>
|
||||||
|
<% Html.Zone("primary"); %>
|
||||||
<% Html.ZonesAny(); %>
|
<% Html.ZonesAny(); %>
|
||||||
@@ -9,6 +9,8 @@ namespace Orchard.Comments.Controllers {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo: (heskew) need to be more flexible with displaying parts somehow. e.g. where should the...
|
||||||
|
// comment count go in any given skin or what if the skin builder doesn't want the count
|
||||||
if (displayType.StartsWith("Detail")) {
|
if (displayType.StartsWith("Detail")) {
|
||||||
return Combined(
|
return Combined(
|
||||||
PartTemplate(part, "Parts/Comments.Count").Location("body", "above.5"),
|
PartTemplate(part, "Parts/Comments.Count").Location("body", "above.5"),
|
||||||
@@ -19,12 +21,12 @@ namespace Orchard.Comments.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(HasComments part) {
|
protected override DriverResult Editor(HasComments part) {
|
||||||
return PartTemplate(part, "Parts/Comments.HasComments");
|
return PartTemplate(part, "Parts/Comments.HasComments").Location("primary", "99");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(HasComments part, IUpdateModel updater) {
|
protected override DriverResult Editor(HasComments part, IUpdateModel updater) {
|
||||||
updater.TryUpdateModel(part, Prefix, null, null);
|
updater.TryUpdateModel(part, Prefix, null, null);
|
||||||
return PartTemplate(part, "Parts/Comments.HasComments");
|
return PartTemplate(part, "Parts/Comments.HasComments").Location("primary", "99");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Orchard.Tags.Controllers {
|
|||||||
var model = new EditTagsViewModel {
|
var model = new EditTagsViewModel {
|
||||||
Tags = string.Join(", ", part.CurrentTags.Select((t, i) => t.TagName).ToArray())
|
Tags = string.Join(", ", part.CurrentTags.Select((t, i) => t.TagName).ToArray())
|
||||||
};
|
};
|
||||||
return PartTemplate(model, "Parts/Tags.EditTags");
|
return PartTemplate(model, "Parts/Tags.EditTags").Location("primary", "9");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(HasTags part, IUpdateModel updater) {
|
protected override DriverResult Editor(HasTags part, IUpdateModel updater) {
|
||||||
@@ -36,7 +36,7 @@ namespace Orchard.Tags.Controllers {
|
|||||||
var tagNames = TagHelpers.ParseCommaSeparatedTagNames(model.Tags);
|
var tagNames = TagHelpers.ParseCommaSeparatedTagNames(model.Tags);
|
||||||
_tagService.UpdateTagsForContentItem(part.ContentItem.Id, tagNames);
|
_tagService.UpdateTagsForContentItem(part.ContentItem.Id, tagNames);
|
||||||
|
|
||||||
return PartTemplate(model, "Parts/Tags.EditTags");
|
return PartTemplate(model, "Parts/Tags.EditTags").Location("primary", "9");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user