mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Clean up the usage of ModelTemplate class a bit
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042780
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Orchard.Comments.Models {
|
||||
if (context.ContentItem.Has<HasComments>() == false) {
|
||||
return;
|
||||
}
|
||||
context.Displays.Add(new ModelTemplate { Model = context.ContentItem.Get<HasComments>(), Prefix = String.Empty });
|
||||
context.Displays.Add(new ModelTemplate(context.ContentItem.Get<HasComments>()));
|
||||
}
|
||||
|
||||
protected override void Loading(LoadContentContext context) {
|
||||
|
@@ -4,10 +4,10 @@ using Orchard.UI.Models;
|
||||
namespace Orchard.DevTools.Models {
|
||||
public class DebugLinkProvider : ContentProvider {
|
||||
protected override void GetDisplays(GetDisplaysContext context) {
|
||||
context.Displays.Add(new ModelTemplate { Model = new ShowDebugLink { ContentItem = context.ContentItem } });
|
||||
context.Displays.Add(new ModelTemplate(new ShowDebugLink { ContentItem = context.ContentItem }));
|
||||
}
|
||||
protected override void GetEditors(GetEditorsContext context) {
|
||||
context.Editors.Add(new ModelTemplate { Model = new ShowDebugLink { ContentItem = context.ContentItem } });
|
||||
context.Editors.Add(new ModelTemplate(new ShowDebugLink { ContentItem = context.ContentItem }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ namespace Orchard.Media.Models {
|
||||
if (model == null)
|
||||
return;
|
||||
|
||||
context.Editors.Add(ModelTemplate.For(model.Record, "MediaSettings"));
|
||||
context.Editors.Add(new ModelTemplate(model.Record, "MediaSettings"));
|
||||
}
|
||||
|
||||
protected override void UpdateEditors(UpdateContentContext context) {
|
||||
@@ -37,7 +37,7 @@ namespace Orchard.Media.Models {
|
||||
return;
|
||||
|
||||
context.Updater.TryUpdateModel(model.Record, "MediaSettings", null, null);
|
||||
context.Editors.Add(ModelTemplate.For(model.Record, "MediaSettings"));
|
||||
context.Editors.Add(new ModelTemplate(model.Record, "MediaSettings"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ namespace Orchard.Roles.Models {
|
||||
Roles = roles.ToList(),
|
||||
};
|
||||
|
||||
context.Editors.Add(ModelTemplate.For(viewModel, "UserRoles"));
|
||||
context.Editors.Add(new ModelTemplate(viewModel, "UserRoles"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Orchard.Roles.Models {
|
||||
}
|
||||
|
||||
}
|
||||
context.Editors.Add(ModelTemplate.For(viewModel, "UserRoles"));
|
||||
context.Editors.Add(new ModelTemplate(viewModel, "UserRoles"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ namespace Orchard.Tags.Models {
|
||||
if (context.ContentItem.Has<HasTags>() == false) {
|
||||
return;
|
||||
}
|
||||
context.Displays.Add(new ModelTemplate { Model = context.ContentItem.Get<HasTags>(), Prefix = String.Empty });
|
||||
context.Displays.Add(new ModelTemplate(context.ContentItem.Get<HasTags>()));
|
||||
}
|
||||
|
||||
protected override void Loading(LoadContentContext context) {
|
||||
|
Reference in New Issue
Block a user