2010-09-16 15:41:25 -07:00
@model Orchard.Themes.ViewModels.ThemesIndexViewModel
2010-09-17 10:19:27 -07:00
@{ Style.Require("ThemesAdmin"); }
2010-09-16 15:41:25 -07:00
<h1>@Html.TitleForPage(T("Manage Themes").ToString())</h1>
@if (Model.CurrentTheme == null) {
2010-11-24 16:10:08 -08:00
<p>
@T("There is no current theme in the application. The built-in theme will be used.")<br />
@Html.ActionLink(T("Install a new Theme").ToString(), "Install")
</p>
2010-09-16 15:41:25 -07:00
} else {
2010-11-24 16:10:08 -08:00
<h3>@T("Current Theme") - @Model.CurrentTheme.Name</h3>
2010-09-16 15:41:25 -07:00
2010-11-24 16:10:08 -08:00
@Html.Image(Href(Html.ThemePath(Model.CurrentTheme, "/Theme.png")), Html.Encode(Model.CurrentTheme.Name), new { @class = "themePreviewImage" })
<h5>@T("By") @Model.CurrentTheme.Author</h5>
2010-09-16 15:41:25 -07:00
2010-11-24 16:10:08 -08:00
<p>
@T("Version:") @Model.CurrentTheme.Version<br />
@Model.CurrentTheme.Description<br />
@Model.CurrentTheme.WebSite
</p>
2010-09-16 15:41:25 -07:00
2010-12-01 16:42:36 -08:00
if (Model.InstallThemes) {
2010-12-06 11:43:00 -08:00
@Html.ActionLink(T("Install a new Theme").ToString(), "AddTheme", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" })
2010-12-01 16:42:36 -08:00
}
2010-09-16 15:41:25 -07:00
}
<h2>@T("Available Themes")</h2>
<ul class="templates">
2010-11-24 16:10:08 -08:00
@foreach (var theme in Model.Themes) {
2010-12-09 12:15:54 -08:00
var tags = theme.Descriptor.Tags;
bool hidden = false;
if (tags != null) {
hidden = tags.Split(',').Any(t => t.Trim().Equals("hidden", StringComparison.OrdinalIgnoreCase));
}
if (!hidden && (Model.CurrentTheme == null || theme.Id != Model.CurrentTheme.Id)) {
2010-11-24 16:10:08 -08:00
<li>
<div>
<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.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.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.Id)
<button type="submit" title="@T("Preview")">@T("Preview")</button>
}
<h5>@T("By") @theme.Descriptor.Author</h5>
<p>
@T("Version:") @theme.Descriptor.Version<br />
@theme.Descriptor.Description<br />
@theme.Descriptor.WebSite
</p>
2010-11-07 14:40:51 -08:00
@if(theme.NeedsUpdate){
2010-11-24 16:10:08 -08:00
using (Html.BeginFormAntiForgeryPost(Url.Action("Update"), FormMethod.Post, new { @class = "inline link" })) {
2010-11-18 15:37:47 -08:00
@Html.Hidden("themeName", theme.Id)
2010-10-12 16:52:36 -07:00
<button type="submit" class="update">@T("Update")</button> <br/>
}
}
2010-12-02 15:27:00 -08:00
@if (Model.InstallThemes) {
2010-12-06 11:43:00 -08:00
using (Html.BeginFormAntiForgeryPost(Url.Action("RemoveTheme", "PackagingServices", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl, retryUrl = HttpContext.Current.Request.RawUrl, themeId = theme.Id }), FormMethod.Post, new { @class = "inline link" })) {
2010-12-02 15:27:00 -08:00
<button type="submit" class="uninstall" title="@T("Uninstall")">@T("Uninstall")</button>
}
2010-11-24 16:10:08 -08:00
}
2010-12-02 15:27:00 -08:00
</div>
2010-11-24 16:10:08 -08:00
</li>
}
}
2010-09-16 15:41:25 -07:00
</ul>