Replaced ResetSite checkbox with radio buttons.

This should make things more clear to the user.
This commit is contained in:
Sipke Schoorstra
2015-07-19 23:03:57 +01:00
parent 833d297499
commit ed85e96621
2 changed files with 19 additions and 4 deletions

View File

@@ -3,6 +3,12 @@
@{
Script.Require("ShapesBase");
}
@{
var importOptions = new SelectListItem[] {
new SelectListItem { Text = T("Import").ToString(), Value = "false", Selected = !Model.ResetSite},
new SelectListItem { Text = T("Reset Site and run Setup").ToString(), Value = "true", Selected = Model.ResetSite},
};
}
<p>
@T("Choose a recipe file to import. Please consider {0} or backing up your data first.", @Html.Link(T("exporting").Text, Url.Action("Export", "Admin", new { area = "Orchard.ImportExport" })))
</p>
@@ -12,11 +18,19 @@
</fieldset>
<fieldset>
<legend>
@Html.CheckBoxFor(m => m.ResetSite)
@Html.LabelFor(m => m.ResetSite, T("Reset Site").ToString(), new {@class = "forcheckbox"})
@T("Import Options")
</legend>
@Html.Hint(T("Check this option to reset your site before executing the uploaded recipe."))
<div data-controllerid="@Html.FieldIdFor(m => m.ResetSite)">
<ul>
@foreach (var option in importOptions) {
var importOptionId = String.Format("{0}_{1}", Html.FieldIdFor(m => m.ResetSite), option.Value);
<li>
<input type="radio" id="@importOptionId" name="@Html.FieldNameFor(m => m.ResetSite)" value="@option.Value" @if (option.Selected) { <text> checked="checked" </text> } />
<label for="@importOptionId" class="forradiobutton">@option.Text</label>
</li>
}
</ul>
@Html.Hint(T("Select wether you want to import the selected recipe into the current site or if you want to do a full site reset first."))
<div data-controllerid="@String.Format("{0}_{1}", Html.FieldIdFor(m => m.ResetSite), "true")" style="display: none;">
<div class="message message-Warning">@T("This will delete your database tables. Please consider creating a backup first.")</div>
<div>
@Html.LabelFor(m => m.SuperUserPassword, T("Super User Password"))

View File

@@ -590,6 +590,7 @@ legend { font-size: 1.231em; font-weight: normal; border:none;}
fieldset { padding:6px 0 0; margin:0 0 12px 0; border: 0px solid #dbdbdb; }
label { font-weight:normal; display:block; padding: 0 0 0.3em 0; }
label.forcheckbox { margin:0 0 0 .4em; display:inline; }
label.forradiobutton { margin:0 0 0 .4em; display:inline; }
label.required:after {margin-left: 1ex; content: "*"; color: red; }
legend.required:after {margin-left: 1ex; content: "*"; color: red; }