Files
Orchard/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Edit.cshtml

118 lines
5.8 KiB
Plaintext
Raw Normal View History

@model Orchard.MultiTenancy.ViewModels.TenantEditViewModel
@using Orchard.Environment.Configuration;
@{
Layout.Title = T("Edit Tenant").ToString();
Script.Require("jQuery").AtFoot();
2015-10-09 10:45:17 +01:00
Script.Require("ShapesBase").AtFoot();
Script.Include(Url.Content("~/Themes/TheAdmin/Scripts/admin.js")).AtFoot();
Script.Include("multi-tenancy.admin.js").AtFoot();
}
2015-10-09 10:45:17 +01:00
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
<fieldset>
<div>
<h2>@Model.Name</h2>
</div>
<div>
<label for="@Html.FieldIdFor(m => m.RequestUrlHost)">@T("URL host")</label>
@Html.TextBoxFor(m => m.RequestUrlHost, new { @class = "text medium" })
<span class="hint">@T("Example: If host is \"orchardproject.net\", the tenant site URL is \"http://orchardproject.net/\". Multiple hosts can be separated by a comma.")</span>
</div>
<div>
<label for="@Html.FieldIdFor(m => m.RequestUrlPrefix)">@T("URL prefix")</label>
@Html.TextBoxFor(m => m.RequestUrlPrefix, new { @class = "text medium" })
<span class="hint">@T("(Optional) Example: If prefix is \"site1\", the tenant URL prefix is \"http://orchardproject.net/site1\"")</span>
2015-10-09 10:45:17 +01:00
</div>
</fieldset>
<fieldset>
<legend>@T("Database Setup")</legend>
2015-10-09 10:45:17 +01:00
@if (Model.State != TenantState.Uninitialized) {
<div class="warning message">@T("Warning: If you don't know what you're doing you *will* (likely) send this tenant into a downward spiral of irrecoverable disrepair. Have a nice day.")</div>
}
2015-10-09 10:45:17 +01:00
else {
<div>
@Html.RadioButtonFor(svm => svm.DataProvider, "", new { id = "tenantDatabaseOption" })
<label for="tenantDatabaseOption" class="forcheckbox">@T("Allow the tenant to set up the database")</label>
</div>
2015-10-09 10:45:17 +01:00
}
<div>
@Html.RadioButtonFor(svm => svm.DataProvider, "SqlCe", new { id = "builtinDatabaseOption" })
<label for="builtinDatabaseOption" class="forcheckbox">@T("Use built-in data storage (SQL Server Compact)")</label>
</div>
<div>
@Html.RadioButtonFor(svm => svm.DataProvider, "SqlServer", new { id = "sqlDatabaseOption" })
<label for="sqlDatabaseOption" class="forcheckbox">@T("Use an existing SQL Server (or SQL Express) database")</label>
2015-10-09 10:45:17 +01:00
<div class="options">
<span data-controllerid="sqlDatabaseOption">
<label for="DatabaseConnectionString">@T("Connection string")</label>
@Html.TextBoxFor(svm => svm.DatabaseConnectionString)
<span class="hint">@T("Example:") @T("Data Source=sqlServerName;Initial Catalog=dbName;Persist Security Info=True;User ID=userName;Password=password")</span>
</span>
<span data-controllerid="sqlDatabaseOption">
<label for="DatabaseTablePrefix">@T("Database table prefix")</label>
@Html.EditorFor(svm => svm.DatabaseTablePrefix)
</span>
</div>
</div>
</fieldset>
2015-10-09 10:45:17 +01:00
<fieldset class="available-extensions">
<label for="@Html.FieldIdFor(m => m.Themes)">@T("Available Themes")</label>
<div>
2014-02-05 12:16:57 -08:00
<span class="hint">@T("Select the Themes which should be available for this tenant. If none is selected, they will all be available.")</span>
2015-10-09 10:45:17 +01:00
2014-02-05 12:16:57 -08:00
<ol>
<li>
<input type="checkbox" class="select-all" id="select-all-themes" />
<label class="forcheckbox" for="select-all-themes">@("Select all")</label>
</li>
2014-02-05 12:16:57 -08:00
@for (var i = 0; i < Model.Themes.Count; i++) {
<li>
@{
var theme = Model.Themes[i];
@Html.CheckBox(Html.FieldNameFor(m => m.Themes[i].Checked), Model.Themes[i].Checked, new { id = Html.FieldIdFor(x => x.Themes[i]) })
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Themes[i])">@Model.Themes[i].ThemeName</label>
@Html.HiddenFor(m => m.Themes[i].ThemeId)
@Html.HiddenFor(m => m.Themes[i].ThemeName)
}
</li>
}
</ol>
2015-10-09 10:45:17 +01:00
</div>
</fieldset>
2015-10-09 10:45:17 +01:00
<fieldset class="available-extensions">
<label for="@Html.FieldIdFor(m => m.Modules)">@T("Available Modules")</label>
<div>
2014-02-05 12:16:57 -08:00
<span class="hint">@T("Select the Modules which should be available for this tenant. If none is selected, they will all be available.")</span>
2014-02-05 12:16:57 -08:00
<ol>
<li>
<input type="checkbox" class="select-all" id="select-all-modules" />
<label class="forcheckbox" for="select-all-modules">@("Select all")</label>
</li>
2014-02-05 12:16:57 -08:00
@for (var i = 0; i < Model.Modules.Count; i++) {
2015-10-09 10:45:17 +01:00
<li>
@{
var theme = Model.Modules[i];
@Html.CheckBox(Html.FieldNameFor(m => m.Modules[i].Checked), Model.Modules[i].Checked, new { id = Html.FieldIdFor(x => x.Modules[i]) })
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Modules[i])">@Model.Modules[i].ModuleName</label>
@Html.HiddenFor(m => m.Modules[i].ModuleId)
@Html.HiddenFor(m => m.Modules[i].ModuleName)
}
</li>
2014-02-05 12:16:57 -08:00
}
</ol>
2015-10-09 10:45:17 +01:00
</div>
</fieldset>
<fieldset>
<button class="primaryAction" type="submit">@T("Save")</button>
</fieldset>
}