mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
A little more work on the MultiTenancy UI
--HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Environment.Configuration;
|
||||
|
||||
namespace Orchard.MultiTenancy.Extensions {
|
||||
public static class UrlHelperExtensions {
|
||||
public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) {
|
||||
return string.Format(
|
||||
"http://{0}/{1}",
|
||||
!string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost)
|
||||
? tenantShellSettings.RequestUrlHost
|
||||
: urlHelper.RequestContext.HttpContext.Request.Url.Host,
|
||||
tenantShellSettings.RequestUrlPrefix);
|
||||
}
|
||||
}
|
||||
}
|
@@ -63,6 +63,7 @@
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Commands\TenantCommand.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="Extensions\UrlHelperExtensions.cs" />
|
||||
<Compile Include="Services\ITenantService.cs" />
|
||||
<Compile Include="Services\TenantService.cs" />
|
||||
<Compile Include="ViewModels\TenantsAddViewModel.cs" />
|
||||
|
@@ -1,17 +1,35 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<TenantsAddViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.MultiTenancy.ViewModels"%>
|
||||
|
||||
<h1><%=Html.TitleForPage(T("Add a Tenant to your Site").ToString()) %></h1>
|
||||
|
||||
<h1><%=Html.TitleForPage(T("Add New Tenant").ToString()) %></h1>
|
||||
<%using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<%= Html.ValidationSummary() %>
|
||||
<fieldset>
|
||||
<label for="Name"><%=_Encoded("Tenant Name") %></label>
|
||||
<input id="Name" class="textMedium" name="Name" type="text" /><br />
|
||||
<label for="RequestUrlHost"><%=_Encoded("Host") %></label>
|
||||
<input id="RequestUrlHost" class="textMedium" name="RequestUrlHost" type="text" /><br />
|
||||
<div>
|
||||
<label for="Name"><%=_Encoded("Name") %></label>
|
||||
<input id="Name" class="textMedium" name="Name" type="text" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="RequestUrlHost"><%=_Encoded("Host") %></label>
|
||||
<input id="RequestUrlHost" class="textMedium" name="RequestUrlHost" type="text" />
|
||||
<span class="hint"><%=_Encoded("Example: If host is \"orchardproject.net\", the tenant site URL is \"http://orchardproject.net/\"") %></span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><%=_Encoded("Database Setup") %></legend>
|
||||
<div>
|
||||
<input type="radio" name="" value="" />
|
||||
<label for="" class="forcheckbox"><%=_Encoded("Allow the client to set up the database") %></label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" name="" value="" />
|
||||
<label for="" class="forcheckbox"><%=_Encoded("Use built-in data storage") %></label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" name="" value="" />
|
||||
<label for="" class="forcheckbox"><%=_Encoded("Use an existing SQL Server (or SQL Express) database") %></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<input type="submit" class="button primaryAction" value="<%=_Encoded("Save") %>" />
|
||||
</fieldset>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<TenantsIndexViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Environment.Configuration" %>
|
||||
<%@ Import Namespace="Orchard.MultiTenancy.Extensions" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.MultiTenancy.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("List of Site's Tenants").ToString())%></h1>
|
||||
@@ -19,7 +20,7 @@
|
||||
} %></span>
|
||||
<span class="tenantName"><%=Html.Encode(tenant.Name) %></span><%
|
||||
if (!string.IsNullOrEmpty(tenant.RequestUrlHost)) {
|
||||
%><span class="tenantHost"> - <%=Html.Link(tenant.RequestUrlHost, tenant.RequestUrlHost)%></span><%
|
||||
%><span class="tenantHost"> - <%=Html.Link(Url.Tenant(tenant), Url.Tenant(tenant))%></span><%
|
||||
} %>
|
||||
</h3>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user