添加项目文件。
This commit is contained in:
67
TightWiki/Views/Page/Search.cshtml
Normal file
67
TightWiki/Views/Page/Search.cshtml
Normal file
@@ -0,0 +1,67 @@
|
||||
@using TightWiki.Models
|
||||
@model TightWiki.Models.ViewModels.Page.PageSearchViewModel
|
||||
@{
|
||||
Layout = "/Views/Shared/_Layout.cshtml";
|
||||
var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
|
||||
}
|
||||
|
||||
<h3>
|
||||
Page Search
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
If it's here, you should be able to find it.<br /><br />
|
||||
</p>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
{
|
||||
<div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
|
||||
{
|
||||
<div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
|
||||
}
|
||||
|
||||
@using (Html.BeginForm(null, null, FormMethod.Get, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" }))
|
||||
{
|
||||
<div class="container">
|
||||
<div class="d-flex justify-content-end mb-4">
|
||||
<div class="flex-grow-1 me-2">
|
||||
@Html.TextBoxFor(x => x.SearchString, new { @class = "form-control", style = "width:100%" })
|
||||
</div>
|
||||
<button type="submit" value="Find" class="btn btn-primary">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
|
||||
@foreach (var p in Model.Pages)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@if ((p.Namespace ?? "") != "")
|
||||
{
|
||||
<font class="text-muted">@p.Namespace ::</font>
|
||||
}<a href="@GlobalConfiguration.BasePath/@p.Navigation">@p.Title</a>@(String.IsNullOrEmpty(@p.Description) ? "" : " : ") @p.Description
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
||||
if (Model.Pages.Count == 0)
|
||||
{
|
||||
<div class="d-flex small text-muted mb-0">
|
||||
<strong>
|
||||
Your search criteria resulted in no pages, simplify your search text.
|
||||
</strong>
|
||||
</div>
|
||||
}
|
||||
|
||||
@Html.Raw(TightWiki.Library.PageSelectorGenerator.Generate(Context.Request.QueryString, Model.PaginationPageCount))
|
||||
}
|
||||
|
||||
<script>
|
||||
window.onload = function () {
|
||||
document.getElementById("SearchString").focus();
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user