mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 11:17:28 +08:00
Related to #16712. Rename Feature/ExtensionDescriptor Name -> Id, and DisplayName -> Name.
--HG-- branch : dev
This commit is contained in:
@@ -63,8 +63,8 @@ namespace Orchard.Themes.Controllers {
|
||||
.Where(d => d.ExtensionType == "Theme")
|
||||
.Select(d => new ThemeEntry {
|
||||
Descriptor = d,
|
||||
NeedsUpdate = featuresThatNeedUpdate.Contains(d.Name),
|
||||
Enabled = _shellDescriptor.Features.Any(sf => sf.Name == d.Name)
|
||||
NeedsUpdate = featuresThatNeedUpdate.Contains(d.Id),
|
||||
Enabled = _shellDescriptor.Features.Any(sf => sf.Name == d.Id)
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
|
@@ -38,9 +38,9 @@ namespace Orchard.Themes.Preview {
|
||||
|
||||
var themeListItems = installedThemes
|
||||
.Select(theme => new SelectListItem {
|
||||
Text = theme.DisplayName,
|
||||
Value = theme.Name,
|
||||
Selected = theme.Name == previewThemeName
|
||||
Text = theme.Name,
|
||||
Value = theme.Id,
|
||||
Selected = theme.Id == previewThemeName
|
||||
})
|
||||
.ToList();
|
||||
|
||||
|
@@ -12,10 +12,10 @@ namespace Orchard.Themes.ViewModels {
|
||||
public bool Enabled { get; set; }
|
||||
public bool NeedsUpdate { get; set; }
|
||||
|
||||
public string ThemeName { get { return Descriptor.Name; } }
|
||||
public string DisplayName { get { return Descriptor.DisplayName; } }
|
||||
public string Id { get { return Descriptor.Id; } }
|
||||
public string Name { get { return Descriptor.Name; } }
|
||||
public string ThemePath(string path) {
|
||||
return Descriptor.Location + "/" + Descriptor.Name + path;
|
||||
return Descriptor.Location + "/" + Descriptor.Id + path;
|
||||
}
|
||||
}
|
||||
}
|
@@ -7,9 +7,9 @@
|
||||
@Html.ActionLink(T("Install a new Theme").ToString(), "Install")
|
||||
</p>
|
||||
} else {
|
||||
<h3>@T("Current Theme") - @Model.CurrentTheme.DisplayName</h3>
|
||||
<h3>@T("Current Theme") - @Model.CurrentTheme.Name</h3>
|
||||
|
||||
@Html.Image(Href(Html.ThemePath(Model.CurrentTheme, "/Theme.png")), Html.Encode(Model.CurrentTheme.DisplayName), new { @class = "themePreviewImage" })
|
||||
@Html.Image(Href(Html.ThemePath(Model.CurrentTheme, "/Theme.png")), Html.Encode(Model.CurrentTheme.Name), new { @class = "themePreviewImage" })
|
||||
<h5>@T("By") @Model.CurrentTheme.Author</h5>
|
||||
|
||||
<p>
|
||||
@@ -24,21 +24,21 @@
|
||||
<h2>@T("Available Themes")</h2>
|
||||
<ul class="templates">
|
||||
@foreach (var theme in Model.Themes) {
|
||||
if (Model.CurrentTheme == null || theme.ThemeName != Model.CurrentTheme.Name) {
|
||||
if (Model.CurrentTheme == null || theme.Id != Model.CurrentTheme.Id) {
|
||||
<li>
|
||||
<div>
|
||||
<h3>@theme.DisplayName</h3>
|
||||
@Html.Image(Href(theme.ThemePath("/Theme.png")), Html.Encode(theme.DisplayName), null)
|
||||
<h3>@theme.Name</h3>
|
||||
@Html.Image(Href(theme.ThemePath("/Theme.png")), Html.Encode(theme.Name), null)
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.Action(theme.Enabled ? "Disable" : "Enable"), FormMethod.Post, new { @class = "inline" })) {
|
||||
@Html.Hidden("themeName", theme.ThemeName)
|
||||
@Html.Hidden("themeName", theme.Id)
|
||||
<button type="submit" title="@T(theme.Enabled ? "Disable" : "Enable")">@T(theme.Enabled ? "Disable" : "Enable")</button>
|
||||
}
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.Action("Activate"), FormMethod.Post, new { @class = "inline" })) {
|
||||
@Html.Hidden("themeName", theme.ThemeName)
|
||||
@Html.Hidden("themeName", theme.Id)
|
||||
<button type="submit" title="@T("Activate")">@T("Set Current")</button>
|
||||
}
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.Action("Preview"), FormMethod.Post, new { @class = "inline" })) {
|
||||
@Html.Hidden("themeName", theme.ThemeName)
|
||||
@Html.Hidden("themeName", theme.Id)
|
||||
<button type="submit" title="@T("Preview")">@T("Preview")</button>
|
||||
}
|
||||
<h5>@T("By") @theme.Descriptor.Author</h5>
|
||||
@@ -49,12 +49,12 @@
|
||||
</p>
|
||||
@if(theme.NeedsUpdate){
|
||||
using (Html.BeginFormAntiForgeryPost(Url.Action("Update"), FormMethod.Post, new { @class = "inline link" })) {
|
||||
@Html.Hidden("themeName", theme.ThemeName)
|
||||
@Html.Hidden("themeName", theme.Id)
|
||||
<button type="submit" class="update">@T("Update")</button> <br/>
|
||||
}
|
||||
}
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.Action("Uninstall"), FormMethod.Post, new { @class = "inline link" })) {
|
||||
@Html.Hidden("themeName", theme.ThemeName)
|
||||
@Html.Hidden("themeName", theme.Id)
|
||||
<button type="submit" class="uninstall" title="@T("Uninstall")">@T("Uninstall")</button>
|
||||
}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user