Defined search settings message when no content is available

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-09-16 13:17:23 -07:00
parent 8aed02cee3
commit 22de315c71

View File

@@ -5,18 +5,21 @@
<legend>@T("Search")</legend> <legend>@T("Search")</legend>
<div> <div>
@{var entryIndex = 0;} @{var entryIndex = 0;}
@if (Model.Entries != null) { @if (Model.Entries != null && Model.Entries.Any()) {
foreach(var modelEntry in Model.Entries) { foreach(var modelEntry in Model.Entries) {
if(Model.Entries[entryIndex].Selected) { 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)"/> <input type="checkbox" value="true" checked="checked" name="@Html.FieldNameFor(m => m.Entries[entryIndex].Selected)" id="@Html.FieldIdFor(m => m.Entries[entryIndex].Selected)"/>
} }
else { 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) @Html.HiddenFor(m => m.Entries[entryIndex].Field)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Entries[entryIndex].Selected)">@Model.Entries[entryIndex].Field</label> <label class="forcheckbox" for="@Html.FieldIdFor(m => m.Entries[entryIndex].Selected)">@Model.Entries[entryIndex].Field</label>
entryIndex = entryIndex + 1; entryIndex = entryIndex + 1;
} }
}
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> </div>
</fieldset> </fieldset>