generated from Kentico/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from Kentico/feat/refresh-v30
Feat/refresh v30
- Loading branch information
Showing
18 changed files
with
4,109 additions
and
3,105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
@using Kentico.Xperience.Algolia.Search | ||
@using Algolia.Search.Models.Search | ||
@using DancingGoat.Search | ||
@using Microsoft.AspNetCore.Mvc.Localization | ||
@using DancingGoat.Search.Models | ||
|
||
@model SearchResponse<DancingGoatSearchResultModel> | ||
@{ | ||
Dictionary<string, string> GetRouteData(int page) => | ||
new Dictionary<string, string>() { { "query", Model.Query }, { "pageSize", Model.ToString() }, { "page", page.ToString() } }; | ||
} | ||
|
||
<h1>Search</h1> | ||
|
||
<style> | ||
.form-field { | ||
margin-bottom: 0.8rem; | ||
} | ||
</style> | ||
|
||
<div class="row" style="padding: 1rem;"> | ||
<div class="col-12"> | ||
<form asp-action="Index" method="get"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="form-field"> | ||
<label class="control-label" asp-for="@Model.Query"></label> | ||
<div class="editing-form-control-nested-control"> | ||
<input class="form-control" asp-for="@Model.Query" name="query"> | ||
<input type="hidden" asp-for="@Model.Page" name="page" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<input type="submit" value="Submit"> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
@if (!Model.Hits.Any()) | ||
{ | ||
if (!String.IsNullOrWhiteSpace(Model.Query)) | ||
{ | ||
@HtmlLocalizer["Sorry, no results match {0}", Model.Query] | ||
} | ||
|
||
return; | ||
} | ||
|
||
@foreach (var item in Model.Hits) | ||
{ | ||
<div class="row search-tile"> | ||
<h3 class="h4 search-tile-title"> | ||
<a href="@item.Url">@item.Title</a> | ||
</h3> | ||
</div> | ||
} | ||
|
||
<div class="pagination-container"> | ||
<ul class="pagination"> | ||
@if (Model.Page > 1) | ||
{ | ||
<li class="PagedList-skipToPrevious"> | ||
<a asp-controller="Search" asp-all-route-data="GetRouteData(Model.Page - 1)"> | ||
@HtmlLocalizer["previous"] | ||
</a> | ||
</li> | ||
} | ||
|
||
@for (int pageNumber = 1; pageNumber <= Model.NbPages; pageNumber++) | ||
{ | ||
if (pageNumber == Model.Page) | ||
{ | ||
<li class="active"> | ||
<span> | ||
@pageNumber | ||
</span> | ||
</li> | ||
} | ||
else | ||
{ | ||
<li> | ||
<a asp-controller="Search" asp-all-route-data="GetRouteData(pageNumber)">@pageNumber</a> | ||
</li> | ||
} | ||
} | ||
|
||
@if (Model.Page < Model.NbPages) | ||
{ | ||
<li class="PagedList-skipToNext"> | ||
<a asp-controller="Search" asp-all-route-data="GetRouteData(Model.Page + 1)"> | ||
@HtmlLocalizer["next"] | ||
</a> | ||
</li> | ||
} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
@using Kentico.Xperience.Algolia.Search | ||
@using Algolia.Search.Models.Search | ||
@using DancingGoat.Search | ||
@using Microsoft.AspNetCore.Mvc.Localization | ||
@using DancingGoat.Search.Models | ||
|
||
@model SearchResponse<DancingGoatSimpleSearchResultModel> | ||
@{ | ||
Dictionary<string, string> GetRouteData(int page) => | ||
new Dictionary<string, string>() { { "query", Model.Query }, { "pageSize", Model.ToString() }, { "page", page.ToString() } }; | ||
} | ||
|
||
<h1>Search</h1> | ||
|
||
<style> | ||
.form-field { | ||
margin-bottom: 0.8rem; | ||
} | ||
</style> | ||
|
||
<div class="row" style="padding: 1rem;"> | ||
<div class="col-12"> | ||
<form asp-action="Index" method="get"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="form-field"> | ||
<label class="control-label" asp-for="@Model.Query"></label> | ||
<div class="editing-form-control-nested-control"> | ||
<input class="form-control" asp-for="@Model.Query" name="query"> | ||
<input type="hidden" asp-for="@Model.Page" name="page" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<input type="submit" value="Submit"> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
@if (!Model.Hits.Any()) | ||
{ | ||
if (!String.IsNullOrWhiteSpace(Model.Query)) | ||
{ | ||
@HtmlLocalizer["Sorry, no results match {0}", Model.Query] | ||
} | ||
|
||
return; | ||
} | ||
|
||
@foreach (var item in Model.Hits) | ||
{ | ||
<div class="row search-tile"> | ||
<h3 class="h4 search-tile-title"> | ||
<a href="@item.Url">@item.Title</a> | ||
</h3> | ||
</div> | ||
} | ||
|
||
<div class="pagination-container"> | ||
<ul class="pagination"> | ||
@if (Model.Page > 1) | ||
{ | ||
<li class="PagedList-skipToPrevious"> | ||
<a asp-controller="Search" asp-all-route-data="GetRouteData(Model.Page - 1)"> | ||
@HtmlLocalizer["previous"] | ||
</a> | ||
</li> | ||
} | ||
|
||
@for (int pageNumber = 1; pageNumber <= Model.NbPages; pageNumber++) | ||
{ | ||
if (pageNumber == Model.Page) | ||
{ | ||
<li class="active"> | ||
<span> | ||
@pageNumber | ||
</span> | ||
</li> | ||
} | ||
else | ||
{ | ||
<li> | ||
<a asp-controller="Search" asp-all-route-data="GetRouteData(pageNumber)">@pageNumber</a> | ||
</li> | ||
} | ||
} | ||
|
||
@if (Model.Page < Model.NbPages) | ||
{ | ||
<li class="PagedList-skipToNext"> | ||
<a asp-controller="Search" asp-all-route-data="GetRouteData(Model.Page + 1)"> | ||
@HtmlLocalizer["next"] | ||
</a> | ||
</li> | ||
} | ||
</ul> | ||
</div> |
Oops, something went wrong.