Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/refresh v30 #56

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
Expand Down
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Kentico.Xperience.Admin" Version="29.5.3" />
<PackageVersion Include="Kentico.Xperience.Azurestorage" Version="29.5.3" />
<PackageVersion Include="Kentico.Xperience.Cloud" Version="29.5.3" />
<PackageVersion Include="Kentico.Xperience.Imageprocessing" Version="29.5.3" />
<PackageVersion Include="Kentico.Xperience.WebApp" Version="29.5.3" />
<PackageVersion Include="Kentico.Xperience.Core.Tests" Version="29.5.3" />
<PackageVersion Include="Kentico.Xperience.Admin" Version="30.0.0" />
<PackageVersion Include="Kentico.Xperience.Azurestorage" Version="30.0.0" />
<PackageVersion Include="Kentico.Xperience.Cloud" Version="30.0.0" />
<PackageVersion Include="Kentico.Xperience.Imageprocessing" Version="30.0.0" />
<PackageVersion Include="Kentico.Xperience.WebApp" Version="30.0.0" />
<PackageVersion Include="Kentico.Xperience.Core.Tests" Version="30.0.0" />
<PackageVersion Include="Algolia.Search" Version="6.16.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.6.0.74858" />
Expand Down
2 changes: 1 addition & 1 deletion examples/DancingGoat/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"kentico.xperience.dbmanager": {
"version": "29.5.3",
"version": "30.0.0",
"commands": [
"kentico-xperience-dbmanager"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/DancingGoat/DancingGoat.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>DancingGoat</RootNamespace>
<UserSecretsId>79c858af-5444-4954-8d0a-6592a961e82a</UserSecretsId>
<SeparatedAdmin Condition="'$(SeparatedAdmin)' == ''">false</SeparatedAdmin>
Expand Down
Binary file modified examples/DancingGoat/Data/Template.zip
Binary file not shown.
98 changes: 98 additions & 0 deletions examples/DancingGoat/Views/Search/Index.cshtml
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>
98 changes: 98 additions & 0 deletions examples/DancingGoat/Views/Search/Simple.cshtml
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>
Loading
Loading