mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Convert Core.Setttings to new shape API.
--HG-- branch : dev
This commit is contained in:
@@ -293,8 +293,11 @@
|
|||||||
<Content Include="Settings\Styles\admin.css" />
|
<Content Include="Settings\Styles\admin.css" />
|
||||||
<Content Include="Settings\Views\Admin\Index.cshtml" />
|
<Content Include="Settings\Views\Admin\Index.cshtml" />
|
||||||
<Content Include="Settings\Views\Admin\Culture.cshtml" />
|
<Content Include="Settings\Views\Admin\Culture.cshtml" />
|
||||||
<Content Include="Settings\Views\DisplayTemplates\CurrentCulture.ascx" />
|
<None Include="Settings\Placement.info">
|
||||||
<Content Include="Settings\Views\DisplayTemplates\RemovableCulture.ascx" />
|
<SubType>Designer</SubType>
|
||||||
|
</None>
|
||||||
|
<None Include="Settings\Views\DisplayTemplates\CurrentCulture.cshtml" />
|
||||||
|
<None Include="Settings\Views\DisplayTemplates\RemovableCulture.cshtml" />
|
||||||
<Content Include="Shapes\Module.txt" />
|
<Content Include="Shapes\Module.txt" />
|
||||||
<Content Include="Shapes\Scripts\base.js" />
|
<Content Include="Shapes\Scripts\base.js" />
|
||||||
<Content Include="Shapes\Scripts\html5.js" />
|
<Content Include="Shapes\Scripts\html5.js" />
|
||||||
|
|||||||
@@ -27,17 +27,18 @@ namespace Orchard.Core.Settings.Drivers {
|
|||||||
SiteCultures = _cultureManager.ListCultures()
|
SiteCultures = _cultureManager.ListCultures()
|
||||||
};
|
};
|
||||||
|
|
||||||
return ContentPartTemplate(model, "Parts/Settings.SiteSettingsPart");
|
return ContentShape("Parts_Settings_SiteSettingsPart",
|
||||||
|
() => shapeHelper.EditorTemplate(TemplateName: "Parts/Settings.SiteSettingsPart", Model: model));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(SiteSettingsPart part, IUpdateModel updater, dynamic shapeHelper) {
|
protected override DriverResult Editor(SiteSettingsPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||||
var site = _siteService.GetSiteSettings().As<SiteSettingsPart>();
|
var site = _siteService.GetSiteSettings().As<SiteSettingsPart>();
|
||||||
var model = new SiteSettingsPartViewModel { Site = site };
|
var model = new SiteSettingsPartViewModel { Site = site };
|
||||||
|
|
||||||
if (updater.TryUpdateModel(model, Prefix, null, null)) {
|
updater.TryUpdateModel(model, Prefix, null, null);
|
||||||
}
|
|
||||||
|
|
||||||
return ContentPartTemplate(model, "Parts/Settings.SiteSettingsPart");
|
return ContentShape("Parts_Settings_SiteSettingsPart",
|
||||||
|
() => shapeHelper.EditorTemplate(TemplateName: "Parts/Settings.SiteSettingsPart", Model: model));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
3
src/Orchard.Web/Core/Settings/Placement.info
Normal file
3
src/Orchard.Web/Core/Settings/Placement.info
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<Placement>
|
||||||
|
<Place Parts_Settings_SiteSettingsPart="Primary:1"/>
|
||||||
|
</Placement>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<string>" %>
|
|
||||||
<strong><%:Model %></strong>
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<strong>@Model</strong>
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<string>" %>
|
|
||||||
<div><%:Model %></div>
|
|
||||||
<% using (Html.BeginFormAntiForgeryPost(Url.Action("DeleteCulture", "Admin", new { area = "Settings" }), FormMethod.Post, new {@class = "inline link"})) { %>
|
|
||||||
<%: Html.Hidden("cultureName", Model, new { id = "" }) %>
|
|
||||||
<button type="submit" class="remove" title="<%:T("Delete") %>">x</button>
|
|
||||||
<% } %>
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<div>
|
||||||
|
@Model
|
||||||
|
@using (Html.BeginFormAntiForgeryPost(Url.Action("DeleteCulture", "Admin", new { area = "Settings" }), FormMethod.Post, new {@class = "inline link"})) {
|
||||||
|
@Html.Hidden("cultureName", (string)Model, new { id = "" })
|
||||||
|
<button type="submit" class="remove" title="@T("Delete")">x</button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
@@ -98,7 +98,9 @@
|
|||||||
<Content Include="Views\Web.config" />
|
<Content Include="Views\Web.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Placement.info" />
|
<None Include="Placement.info">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||||
|
|||||||
Reference in New Issue
Block a user