Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.04 KB | None | 0 0
  1. @using Orchard.Setup.Controllers
  2. @inject Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer T
  3. @model Orchard.Setup.ViewModels.SetupViewModel
  4. @{
  5. var defaultRecipe = Model.Recipes.FirstOrDefault(x => x.Name == Model.RecipeName) ?? Model.Recipes.First();
  6. }
  7.  
  8. <form asp-action="Index">
  9.  
  10. <div class="jumbotron">
  11. <h1>@T["SETUP"]</h1>
  12. <p class="lead">@T["Please answer a few questions to configure your site."]</p>
  13. </div>
  14.  
  15. <div class="row">
  16. <fieldset class="form-group col-md-6" asp-validation-class-for="SiteName">
  17. <div>
  18. <label asp-for="SiteName">@T["What is the name of your site?"]</label>
  19. <span asp-validation-for="SiteName" class="text-danger">@T["This site name is required."]</span>
  20. <input asp-for="SiteName" class="form-control" autofocus />
  21. <span class="text-muted form-text small">@T["This is used as the default title of your pages."]</span>
  22. </div>
  23. </fieldset>
  24. <fieldset class="form-group col-md-6">
  25. <input type="hidden" asp-for="RecipeName" />
  26. <nav>
  27. <div asp-validation-class-for="RecipeName">
  28. <label asp-for="SiteName">@T["Recipe"]</label>
  29. <div id="recipes" class="dropdown">
  30. <button id="recipeButton" title="@defaultRecipe.Description" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  31. @defaultRecipe.DisplayName
  32. </button>
  33. <div class="dropdown-menu">
  34. @foreach (var recipe in Model.Recipes.OrderBy(x => x.Name))
  35. {
  36. <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>
  37. }
  38. </div>
  39. </div>
  40. <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>
  41.  
  42. </div>
  43. </nav>
  44. </fieldset>
  45. </div>
  46. @if (!Model.TablePrefixPreset || !Model.ConnectionStringPreset || !Model.DatabaseProviderPreset)
  47. {
  48. <h6>
  49. @T["Database"]
  50. <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>
  51. </h6>
  52. }
  53. <div class="row">
  54. @if (Model.DatabaseProviderPreset)
  55. {
  56. <input asp-for="DatabaseProvider" type="hidden" />
  57. }
  58. else
  59. {
  60. <div class="form-group col-md-6">
  61. <label asp-for="DatabaseProvider">@T["What type of database to use?"]</label>
  62. <select asp-for="DatabaseProvider" class="form-control">
  63. @foreach (var provider in Model.DatabaseProviders)
  64. {
  65. <option value="@provider.Value" data-provider-name="@provider.Name" <!-- ADD attribute "data-provider-name" --> data-connection-string="@provider.HasConnectionString">@provider.Name</option>
  66. }
  67. </select>
  68. </div>
  69. }
  70. <!-- ADD THIS BOX FIELDSET -->
  71. <fieldset class="row ConnectionMysql">
  72. <div class="form-group col-md-6">
  73. <label asp-for="ConnectionMysql">@T["What connection accessible to use?"]</label>
  74. <select asp-for="ConnectionMysql" class="form-control">
  75. @foreach (var connect in Model.ConnectionsMysql)
  76. {
  77. <option data-connection-name="@connect.Name" >@connect.Name</option>
  78. }
  79. </select>
  80. </div>
  81. </fieldset>
  82.  
  83. @if (Model.TablePrefixPreset)
  84. {
  85. <input asp-for="TablePrefix" type="hidden" />
  86. }
  87. else
  88. {
  89. <div class="form-group col-md-6" asp-validation-class-for="TablePrefix">
  90. <label asp-for="TablePrefix">@T["Table Prefix"]</label>
  91. <span asp-validation-for="TablePrefix" class="text-danger"></span>
  92. <input asp-for="TablePrefix" class="form-control" />
  93. </div>
  94. }
  95. </div>
  96.  
  97. @if (Model.ConnectionStringPreset)
  98. {
  99. <input asp-for="ConnectionString" type="hidden" />
  100. }
  101. else
  102. {
  103. <fieldset class="row connectionString" asp-validation-class-for="ConnectionString">
  104. <div class="form-group col-xs-12">
  105. <label asp-for="ConnectionString">@T["Connection string"]</label>
  106. <span asp-validation-for="ConnectionString" class="text-danger"></span>
  107. <input asp-for="ConnectionString" class="form-control" />
  108. <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>
  109. </div>
  110. </fieldset>
  111. }
  112. <h6>
  113. @T["Super User"]
  114. <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>
  115. </h6>
  116. <div class="row">
  117. <div class="form-group col-md-6" asp-validation-class-for="AdminUserName">
  118. <label asp-for="AdminUserName">@T["User name"]</label>
  119. <span asp-validation-for="AdminUserName" class="text-danger">@T["The user name is required."]</span>
  120. <input asp-for="AdminUserName" class="form-control" />
  121. </div>
  122. <div class="form-group col-md-6" asp-validation-class-for="AdminEmail">
  123. <label for="AdminEmail">@T["Email"]</label>
  124. <span asp-validation-for="AdminEmail" class="text-danger">@T["The email is invalid."]</span>
  125. <input asp-for="AdminEmail" class="form-control" type="email"/>
  126. </div>
  127. </div>
  128.  
  129. <div class="row">
  130. <div class="form-group col-md-6" asp-validation-class-for="Password">
  131. <label asp-for="Password">@T["Password"]</label>
  132. <span asp-validation-for="Password" class="text-danger"></span>
  133. <input asp-for="Password" type="password" class="form-control" />
  134. </div>
  135.  
  136. <div class="form-group col-md-6" asp-validation-class-for="PasswordConfirmation">
  137. <label asp-for="PasswordConfirmation">@T["Password Confirmation"]</label>
  138. <span asp-validation-for="PasswordConfirmation" class="text-danger"></span>
  139. <input asp-for="PasswordConfirmation" type="password" class="form-control" />
  140. </div>
  141. </div>
  142. <fieldset>
  143. <div class="form-group">
  144. <button class="btn btn-primary" type="submit">@T["Finish Setup"]</button>
  145. </div>
  146. </fieldset>
  147. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement