mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 20:16:15 +08:00
Implemented tenant reset action.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
@model Orchard.Environment.Configuration.ShellSettings
|
||||
@using Orchard.MultiTenancy.Extensions;
|
||||
|
||||
@using(Html.BeginFormAntiForgeryPost(Url.Action("enable", new {area = "Orchard.MultiTenancy"}), FormMethod.Post, new {@class = "inline link"})) {
|
||||
@using(Html.BeginFormAntiForgeryPost(Url.Action("Enable", new {area = "Orchard.MultiTenancy"}), FormMethod.Post, new {@class = "inline link"})) {
|
||||
@Html.HiddenFor(ss => ss.Name)
|
||||
<button type="submit">@T("Resume")</button>
|
||||
}
|
||||
} @T(" | ")
|
||||
@Html.ActionLink(T("Reset").ToString(), "Reset", new { name = Model.Name, area = "Orchard.MultiTenancy" })
|
||||
@@ -1,7 +1,7 @@
|
||||
@model Orchard.Environment.Configuration.ShellSettings
|
||||
@using Orchard.MultiTenancy.Extensions;
|
||||
|
||||
@using(Html.BeginFormAntiForgeryPost(Url.Action("disable", new {area = "Orchard.MultiTenancy"}), FormMethod.Post, new {@class = "inline link"})) {
|
||||
@using(Html.BeginFormAntiForgeryPost(Url.Action("Disable", new {area = "Orchard.MultiTenancy"}), FormMethod.Post, new {@class = "inline link"})) {
|
||||
@Html.HiddenFor(ss => ss.Name)
|
||||
<button type="submit">@T("Suspend")</button>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,30 +7,31 @@
|
||||
Layout.Title = T("List of Site's Tenants").ToString();
|
||||
}
|
||||
|
||||
<div class="manage">@Html.ActionLink(T("Add a Tenant").ToString(), "Add", new {area = "Orchard.MultiTenancy"}, new { @class = "button primaryAction" })</div>
|
||||
<div class="manage">@Html.ActionLink(T("Add a Tenant").ToString(), "Add", new { area = "Orchard.MultiTenancy" }, new { @class = "button primaryAction" })</div>
|
||||
<ul class="contentItems tenants">
|
||||
@foreach (var tenant in Model.TenantSettings) {
|
||||
<li class="tenant @tenant.State">
|
||||
<div class="summary">
|
||||
<div class="properties">
|
||||
<h3>@tenant.Name @if (!string.IsNullOrEmpty(tenant.RequestUrlHost)) {
|
||||
var tenantClone = new ShellSettings(tenant);
|
||||
foreach (var t in tenant.RequestUrlHost.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) {
|
||||
tenantClone.RequestUrlHost = t;
|
||||
var url = Url.Tenant(tenantClone);
|
||||
<span class="tenantHost"> - @Html.Link(url, url)</span>
|
||||
}
|
||||
}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="related">
|
||||
@if (!string.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
|
||||
@foreach (var tenant in Model.TenantSettings) {
|
||||
<li class="tenant @tenant.State">
|
||||
<div class="summary">
|
||||
<div class="properties">
|
||||
<h3>
|
||||
@tenant.Name @if (!string.IsNullOrEmpty(tenant.RequestUrlHost)) {
|
||||
var tenantClone = new ShellSettings(tenant);
|
||||
foreach (var t in tenant.RequestUrlHost.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) {
|
||||
tenantClone.RequestUrlHost = t;
|
||||
var url = Url.Tenant(tenantClone);
|
||||
<span class="tenantHost"> - @Html.Link(url, url)</span>
|
||||
}
|
||||
}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="related">
|
||||
@if (!String.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
|
||||
var t = tenant;
|
||||
@Html.DisplayFor(m => t, string.Format("ActionsFor{0}", tenant.State.ToString()), "") @T(" | ")
|
||||
}
|
||||
@Html.ActionLink(T("Edit").ToString(), "Edit", new {name = tenant.Name, area = "Orchard.MultiTenancy"})
|
||||
@Html.DisplayFor(m => t, String.Format("ActionsFor{0}", tenant.State.ToString()), "") @T(" | ")
|
||||
}
|
||||
@Html.ActionLink(T("Edit").ToString(), "Edit", new { name = tenant.Name, area = "Orchard.MultiTenancy" })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
@model Orchard.MultiTenancy.ViewModels.TenantResetViewModel
|
||||
|
||||
@{
|
||||
Layout.Title = T("Reset Tenant").ToString();
|
||||
|
||||
Script.Require("jQuery");
|
||||
Script.Include(Url.Content("~/Themes/TheAdmin/Scripts/admin.js")).AtFoot();
|
||||
}
|
||||
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
@Html.ValidationSummary()
|
||||
|
||||
<fieldset>
|
||||
<p>@T("This will reset the tenant <strong>{0}</strong> to its uninitialized state, allowing you to set it up again.", Model.Name)</p>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
@Html.CheckBoxFor(m => Model.DropDatabaseTables)
|
||||
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.DropDatabaseTables)">@("Also delete tenant database tables:")</label>
|
||||
<ul style="margin-left: 4em; margin-top: 1em; -webkit-column-width: 24em; -moz-column-width: 24em; column-width: 24em;">
|
||||
@foreach (var tableName in Model.DatabaseTableNames) {
|
||||
<li><span class="hint">@tableName</span></li>
|
||||
}
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<button class="primaryAction" type="submit">@T("Reset")</button>
|
||||
</fieldset>
|
||||
}
|
||||
Reference in New Issue
Block a user