Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using Orchard.Setup.Controllers
- @inject Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer T
- @model Orchard.Setup.ViewModels.SetupViewModel
- @{
- var defaultRecipe = Model.Recipes.FirstOrDefault(x => x.Name == Model.RecipeName) ?? Model.Recipes.First();
- }
- <form asp-action="Index">
- <div class="jumbotron">
- <h1>@T["SETUP"]</h1>
- <p class="lead">@T["Please answer a few questions to configure your site."]</p>
- </div>
- <div class="row">
- <fieldset class="form-group col-md-6" asp-validation-class-for="SiteName">
- <div>
- <label asp-for="SiteName">@T["What is the name of your site?"]</label>
- <span asp-validation-for="SiteName" class="text-danger">@T["This site name is required."]</span>
- <input asp-for="SiteName" class="form-control" autofocus />
- <span class="text-muted form-text small">@T["This is used as the default title of your pages."]</span>
- </div>
- </fieldset>
- <fieldset class="form-group col-md-6">
- <input type="hidden" asp-for="RecipeName" />
- <nav>
- <div asp-validation-class-for="RecipeName">
- <label asp-for="SiteName">@T["Recipe"]</label>
- <div id="recipes" class="dropdown">
- <button id="recipeButton" title="@defaultRecipe.Description" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- @defaultRecipe.DisplayName
- </button>
- <div class="dropdown-menu">
- @foreach (var recipe in Model.Recipes.OrderBy(x => x.Name))
- {
- <a href="#" data-recipe-name="@recipe.Name" data-recipe-description="@recipe.Description" data-recipe-display-name="@recipe.DisplayName" class="dropdown-item">@recipe.DisplayName <span class="text-muted form-text small">@recipe.Description</span></a>
- }
- </div>
- </div>
- <span class="text-muted form-text small">@T["Recipes allow you to setup your site with additional pre-configured options, features and settings out of the box."]</span>
- </div>
- </nav>
- </fieldset>
- </div>
- @if (!Model.TablePrefixPreset || !Model.ConnectionStringPreset || !Model.DatabaseProviderPreset)
- {
- <h6>
- @T["Database"]
- <span class="text-muted form-text small">@T["The database is used to store the site's configuration and its contents. You can specify a custom table prefix if you intend to reuse the same database for multiple sites."]</span>
- </h6>
- }
- <div class="row">
- @if (Model.DatabaseProviderPreset)
- {
- <input asp-for="DatabaseProvider" type="hidden" />
- }
- else
- {
- <div class="form-group col-md-6">
- <label asp-for="DatabaseProvider">@T["What type of database to use?"]</label>
- <select asp-for="DatabaseProvider" class="form-control">
- @foreach (var provider in Model.DatabaseProviders)
- {
- <option value="@provider.Value" data-provider-name="@provider.Name" <!-- ADD attribute "data-provider-name" --> data-connection-string="@provider.HasConnectionString">@provider.Name</option>
- }
- </select>
- </div>
- }
- <!-- ADD THIS BOX FIELDSET -->
- <fieldset class="row ConnectionMysql">
- <div class="form-group col-md-6">
- <label asp-for="ConnectionMysql">@T["What connection accessible to use?"]</label>
- <select asp-for="ConnectionMysql" class="form-control">
- @foreach (var connect in Model.ConnectionsMysql)
- {
- <option data-connection-name="@connect.Name" >@connect.Name</option>
- }
- </select>
- </div>
- </fieldset>
- @if (Model.TablePrefixPreset)
- {
- <input asp-for="TablePrefix" type="hidden" />
- }
- else
- {
- <div class="form-group col-md-6" asp-validation-class-for="TablePrefix">
- <label asp-for="TablePrefix">@T["Table Prefix"]</label>
- <span asp-validation-for="TablePrefix" class="text-danger"></span>
- <input asp-for="TablePrefix" class="form-control" />
- </div>
- }
- </div>
- @if (Model.ConnectionStringPreset)
- {
- <input asp-for="ConnectionString" type="hidden" />
- }
- else
- {
- <fieldset class="row connectionString" asp-validation-class-for="ConnectionString">
- <div class="form-group col-xs-12">
- <label asp-for="ConnectionString">@T["Connection string"]</label>
- <span asp-validation-for="ConnectionString" class="text-danger"></span>
- <input asp-for="ConnectionString" class="form-control" />
- <span class="text-muted form-text small">@T["The connection string to your database instance. e.g., Data Source=<em>localhost</em>;Initial Catalog=<em>Orchard</em>;User Id=<em>userid</em>;Password=<em>password</em>"]</span>
- </div>
- </fieldset>
- }
- <h6>
- @T["Super User"]
- <span class="text-muted form-text small">@T["The super user has all the rights. It should be used only during Setup and for disaster recovery."]</span>
- </h6>
- <div class="row">
- <div class="form-group col-md-6" asp-validation-class-for="AdminUserName">
- <label asp-for="AdminUserName">@T["User name"]</label>
- <span asp-validation-for="AdminUserName" class="text-danger">@T["The user name is required."]</span>
- <input asp-for="AdminUserName" class="form-control" />
- </div>
- <div class="form-group col-md-6" asp-validation-class-for="AdminEmail">
- <label for="AdminEmail">@T["Email"]</label>
- <span asp-validation-for="AdminEmail" class="text-danger">@T["The email is invalid."]</span>
- <input asp-for="AdminEmail" class="form-control" type="email"/>
- </div>
- </div>
- <div class="row">
- <div class="form-group col-md-6" asp-validation-class-for="Password">
- <label asp-for="Password">@T["Password"]</label>
- <span asp-validation-for="Password" class="text-danger"></span>
- <input asp-for="Password" type="password" class="form-control" />
- </div>
- <div class="form-group col-md-6" asp-validation-class-for="PasswordConfirmation">
- <label asp-for="PasswordConfirmation">@T["Password Confirmation"]</label>
- <span asp-validation-for="PasswordConfirmation" class="text-danger"></span>
- <input asp-for="PasswordConfirmation" type="password" class="form-control" />
- </div>
- </div>
- <fieldset>
- <div class="form-group">
- <button class="btn btn-primary" type="submit">@T["Finish Setup"]</button>
- </div>
- </fieldset>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement