mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
- Editing zoneName passed for display/edit views for the devtools drivers so it's rendered last.
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043232
This commit is contained in:
@@ -4,10 +4,10 @@ using Orchard.Models.ViewModels;
|
||||
namespace Orchard.DevTools.Models {
|
||||
public class DebugLinkProvider : ContentProvider {
|
||||
protected override void GetDisplayViewModel(GetDisplayViewModelContext context) {
|
||||
context.AddDisplay(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "last", Position = "10" });
|
||||
context.AddDisplay(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "recap", Position = "10" });
|
||||
}
|
||||
protected override void GetEditorViewModel(GetEditorViewModelContext context) {
|
||||
context.AddEditor(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "last", Position = "10" });
|
||||
context.AddEditor(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "recap", Position = "10" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -169,6 +169,7 @@ namespace Orchard.Models {
|
||||
|
||||
private static IEnumerable<TemplateViewModel> OrderTemplates(IEnumerable<TemplateViewModel> templates) {
|
||||
var comparer = new PositionComparer();
|
||||
//TODO: rethink this comparison because it adds a requirement on naming zones.
|
||||
return templates.OrderBy(x => (x.ZoneName ?? "*") + "." + (x.Position ?? "5"), comparer);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user