mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Some clean up on the setup UI around validation.
--HG-- branch : dev
This commit is contained in:
@@ -4,11 +4,11 @@ using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Setup.ViewModels {
|
||||
public class SetupViewModel : BaseViewModel {
|
||||
[Required, StringLength(70)]
|
||||
[Required(ErrorMessage = "Site name is required."), StringLength(70, ErrorMessage = "Site name can be no longer than 70 characters.")]
|
||||
public string SiteName { get; set; }
|
||||
[Required, StringLengthMin(3), StringLength(25)]
|
||||
[Required(ErrorMessage = "User name is required."), StringLengthMin(3, ErrorMessage = "User name must be longer than 3 characters."), StringLength(25, ErrorMessage = "User name can be no longer than 25 characters.")]
|
||||
public string AdminUsername { get; set; }
|
||||
[Required, StringLengthMin(6), StringLength(50)]
|
||||
[Required(ErrorMessage = "Password is required."), StringLengthMin(6, ErrorMessage = "Password must be longer than 6 characters."), StringLength(50, ErrorMessage = "Password can be no longer than 50 characters.")]
|
||||
public string AdminPassword { get; set; }
|
||||
[SqlDatabaseConnectionString]
|
||||
public string DatabaseConnectionString { get; set; }
|
||||
|
||||
@@ -10,28 +10,25 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<div>
|
||||
<label for="SiteName"><%=_Encoded("What is the name of your site?") %></label>
|
||||
<%=Html.EditorFor(svm => svm.SiteName) %>
|
||||
<%=Html.ValidationMessage("SiteName", "*") %>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AdminUsername"><%=_Encoded("Choose a user name:") %></label>
|
||||
<%=Html.EditorFor(svm => svm.AdminUsername)%>
|
||||
<%=Html.ValidationMessage("AdminUsername", "*")%>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AdminPassword"><%=_Encoded("Choose a password:") %></label>
|
||||
<%=Html.PasswordFor(svm => svm.AdminPassword) %>
|
||||
<%=Html.ValidationMessage("AdminPassword", "*") %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="data">
|
||||
<fieldset class="data<%=Model.DatabaseOptions ? " builtin" : " sql" %>">
|
||||
<legend><%=_Encoded("How would you like to store your data?") %></legend>
|
||||
<%=Html.ValidationMessage("DatabaseOptions", "Unable to setup data storage") %>
|
||||
<div>
|
||||
<input type="radio" name="databaseOptions" id="builtin" value="true" checked="checked" />
|
||||
<%=Html.RadioButtonFor(svm => svm.DatabaseOptions, true, new { id = "builtin" })%>
|
||||
<label for="builtin" class="forcheckbox"><%=_Encoded("Use built-in data storage (SQL Lite)") %></label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="radio" name="databaseOptions" id="sql" value="false" />
|
||||
<%=Html.RadioButtonFor(svm => svm.DatabaseOptions, false, new { id = "sql" })%>
|
||||
<label for="sql" class="forcheckbox"><%=_Encoded("Use an existing SQL Server (or SQL Express) database") %></label>
|
||||
<span>
|
||||
<label for="DatabaseConnectionString"><%=_Encoded("Connection string") %></label>
|
||||
|
||||
Reference in New Issue
Block a user