Some layout changes for search settings.

--HG--
branch : 1.x
This commit is contained in:
jowall
2011-04-01 15:20:51 -07:00
parent 411cab8fbe
commit e255362cb5
4 changed files with 37 additions and 19 deletions

View File

@@ -5,42 +5,46 @@
@using (Html.BeginForm("update", "admin", FormMethod.Post, new {area = "Orchard.Indexing"})) {
<fieldset>
<legend>@T("Search Index Statistics")</legend>
<ol class="decimal">
@if (Model.IndexEntry == null) {
<p>@T("There is currently no search index")</p>
<li>@T("There is currently no search index")</li>
} else if (Model.IndexEntry.LastUpdateUtc == DateTime.MinValue) {
<p>@T("The search index has not been built yet.")</p>
<li>@T("The search index has not been built yet.")</li>
} else {
if (Model.IndexEntry.DocumentCount == 0) {
<p>@T("The search index does not contain any document.")</p>
<li>@T("The search index does not contain any document.")</li>
} else {
<p>@T("The search index contains {0} document(s).", Model.IndexEntry.DocumentCount)</p>
<li>@T("The search index contains {0} document(s).", Model.IndexEntry.DocumentCount)</li>
}
if (!Model.IndexEntry.Fields.Any()) {
<p>@T("The search index does not contain any field.")</p>
<li>@T("The search index does not contain any field.")</li>
} else {
<p>@T("The search index contains the following fields: {0}.", string.Join(T(", ").Text, Model.IndexEntry.Fields))</p>
<li>@T("The search index contains the following fields: {0}.", string.Join(T(", ").Text, Model.IndexEntry.Fields))</li>
}
<p>@T("The search index was last updated {0}.", Display.DateTimeRelative(dateTimeUtc: Model.IndexEntry.LastUpdateUtc))</p>
<li>@T("The search index was last updated {0}.", Display.DateTimeRelative(dateTimeUtc: Model.IndexEntry.LastUpdateUtc))</li>
switch(Model.IndexEntry.IndexingStatus) {
case IndexingStatus.Rebuilding:
@T("The indexing process is currently being rebuilt.");
<li>@T("The indexing process is currently being rebuilt.");</li>
break;
case IndexingStatus.Updating:
@T("The indexing process is currently being updated.");
<li>@T("The indexing process is currently being updated.");</li>
break;
}
}
<p>@T("Update the search index now: ")<button type="submit" title="@T("Update the search index.")" class="primaryAction">@T("Update")</button></p>
</ol>
<label>@T("Update the search index now:")</label><button type="submit" title="@T("Update the search index.")" class="primaryAction">@T("Update")</button>
@Html.AntiForgeryTokenOrchard()
</fieldset>
}
@using (Html.BeginForm("rebuild", "admin", FormMethod.Post, new {area = "Orchard.Search"})) {
<fieldset>
<p>@T("Rebuild the search index for a fresh start.")
<button type="submit" title="@T("Rebuild the search index.")">@T("Rebuild")</button></p>
<label>@T("Rebuild the search index for a fresh start:")</label>
<button type="submit" title="@T("Rebuild the search index.")">@T("Rebuild")</button>
@Html.AntiForgeryTokenOrchard()
</fieldset>
}

View File

@@ -5,21 +5,29 @@
<legend>@T("Enter Settings")</legend>
<div>
@{var entryIndex = 0;}
@if (Model.Entries != null && Model.Entries.Any()) {
foreach(var modelEntry in Model.Entries) {
if(Model.Entries[entryIndex].Selected) {
<input type="checkbox" value="true" checked="checked" name="@Html.FieldNameFor(m => m.Entries[entryIndex].Selected)" id="@Html.FieldIdFor(m => m.Entries[entryIndex].Selected)"/>
<ul>
@foreach(var modelEntry in Model.Entries) {
<li>
@if(Model.Entries[entryIndex].Selected) {
<input type="checkbox" value="true" checked="checked" name="@Html.FieldNameFor(m => m.Entries[entryIndex].Selected)" id="@Html.FieldIdFor(m => m.Entries[entryIndex].Selected)"/>
}
else {
<input type="checkbox" value="true" name="@Html.FieldNameFor(m => m.Entries[entryIndex].Selected)" id="@Html.FieldIdFor(m => m.Entries[entryIndex].Selected)"/>
<input type="checkbox" value="true" name="@Html.FieldNameFor(m => m.Entries[entryIndex].Selected)" id="@Html.FieldIdFor(m => m.Entries[entryIndex].Selected)"/>
}
@Html.HiddenFor(m => m.Entries[entryIndex].Field)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Entries[entryIndex].Selected)">@Model.Entries[entryIndex].Field</label>
</li>
entryIndex = entryIndex + 1;
}
</ul>
}
else {
<span class="hint">@T("There are currently no fields to search from. Please update you index, and check some indexable content exists.")</span>
}
</div>
</fieldset>
</fieldset>

View File

@@ -2,7 +2,7 @@
@using Orchard.Utility.Extensions;
@using Orchard.Warmup.Models;
@{ Layout.Title = T("Warmup Settings").ToString(); }
@{ Layout.Title = T("Settings for Warmup").ToString(); }
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()

View File

@@ -203,6 +203,12 @@ form.link button:hover, button.link:hover {
border-bottom:1px solid #1e5d7d;
}
/* Lists
***************************************************************/
ol.decimal {list-style:decimal inside; margin:12px 0;}
ul.disc {list-style:disc inside; margin:12px 0;}
/* Header - Branding and Login
***************************************************************/
#header {
@@ -826,7 +832,7 @@ button.link {
/* (Items) Tables
----------------------------------------------------------*/
***************************************************************/
table.items {
margin:0 0 1.4em 0;
background:#fff;