- 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:
suhacan
2009-12-04 22:53:52 +00:00
parent 7210273340
commit d07a59ed51
2 changed files with 3 additions and 2 deletions

View File

@@ -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" });
}
}
}

View File

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