Skip to content

Commit

Permalink
css for search page
Browse files Browse the repository at this point in the history
  • Loading branch information
Lan Nguyen Thuy committed May 2, 2024
1 parent 16b7ea1 commit 1e7c16d
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/TvShows.Web.Tests/TvShows.Web.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Cultiv.Hangfire" Version="3.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Umbraco.Forms.StaticAssets" Version="13.1.2" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/TvShows.Web.UI/TvShows.Web.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<ItemGroup>
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
<PackageReference Include="Umbraco.Forms.StaticAssets" Version="13.1.2" />
<PackageReference Include="Umbraco.Workflow" Version="13.0.6" />
<ProjectReference Include="..\TvShows.Web\TvShows.Web.csproj" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="72.1.0.3" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
Expand Down
7 changes: 4 additions & 3 deletions src/TvShows.Web.UI/Views/SearchPage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
@{
var requestPage = Model.Root().Children().Where(x=>x.ContentType.Alias == Request.ModelTypeAlias).First();
var searchPage = Model.Root().Children().Where(x => x.ContentType.Alias == SearchPage.ModelTypeAlias).First() as SearchPage;
Layout = "_Layout.cshtml";
}
<div class="page-single">
Expand All @@ -29,11 +30,11 @@
}
else
{
<h1 class="small-12 cell" style="color: #f1eaea;">Search</h1>
<h1 class="small-12 cell" style="color: #f1eaea;">@searchPage.ResultTitle</h1>
<div class="callout primary">
<p>
Pardon us, but no shows or people matching your query were found. <br />
You can <a href="@requestPage?.Url()">make a request</a> to add the show you're looking for.
@Html.Raw(searchPage.NoResultNote)
<a href="@requestPage?.Url()">@searchPage.Createbtn</a>
</p>
</div>
}
Expand Down
2 changes: 1 addition & 1 deletion src/TvShows.Web.UI/Views/TvShow.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="row">
<div class="col-md-9 col-sm-12 col-xs-12">
<div class="blog-detail-ct">
<h1>@Model.Name</h1>
<h1>@Model.ShowTitle</h1>
<span class="time">@Model.Premiered</span>
<div>
<img style="width:250px" src="@Model.PreImage?.LocalCrops?.Src" alt="">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,37 @@
"Type": 1,
"Alias": "content",
"PropertyTypes": [
{
"Key": "10d98519-35e3-4f01-94c9-b67217d307d4",
"Alias": "resultTitle",
"DataType": "umb://data-type/0cc0eba1996042c9bf9b60e150b429ae",
"Name": "ResultTitle",
"SortOrder": 3,
"VariesByCulture": true
},
{
"Key": "13c1475b-dfba-4a15-bda3-42170627ae63",
"Alias": "noResultNote",
"DataType": "umb://data-type/0cc0eba1996042c9bf9b60e150b429ae",
"Name": "NoResultNote",
"SortOrder": 4,
"VariesByCulture": true
},
{
"Key": "194d892c-c861-43fd-b931-cee84e071bfc",
"Alias": "searchTitle",
"DataType": "umb://data-type/0cc0eba1996042c9bf9b60e150b429ae",
"Name": "SearchTitle",
"VariesByCulture": true
},
{
"Key": "6ae8d9cb-9566-499a-9e82-51a20133f9f0",
"Alias": "createbtn",
"DataType": "umb://data-type/0cc0eba1996042c9bf9b60e150b429ae",
"Name": "Createbtn",
"SortOrder": 5,
"VariesByCulture": true
},
{
"Key": "c810b76d-1679-43f5-abac-e348c213d3f2",
"Alias": "searchIcon",
Expand Down
24 changes: 24 additions & 0 deletions src/TvShows.Web/PublishedModels/SearchPage.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,30 @@ public SearchPage(IPublishedContent content, IPublishedValueFallback publishedVa

// properties

///<summary>
/// Createbtn
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("createbtn")]
public virtual string Createbtn => this.Value<string>(_publishedValueFallback, "createbtn");

///<summary>
/// NoResultNote
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("noResultNote")]
public virtual string NoResultNote => this.Value<string>(_publishedValueFallback, "noResultNote");

///<summary>
/// ResultTitle
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "13.3.0+a325ba3")]
[global::System.Diagnostics.CodeAnalysis.MaybeNull]
[ImplementPropertyType("resultTitle")]
public virtual string ResultTitle => this.Value<string>(_publishedValueFallback, "resultTitle");

///<summary>
/// SearchIcon
///</summary>
Expand Down
1 change: 1 addition & 0 deletions src/TvShows.Web/TvShows.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<PackageReference Include="Umbraco.Cms" Version="13.3.0" />
<PackageReference Include="Umbraco.Forms" Version="13.1.2" />
<PackageReference Include="Umbraco.Forms.Deploy" Version="13.0.1" />
<PackageReference Include="Umbraco.Forms.StaticAssets" Version="13.1.2" />
<PackageReference Include="Umbraco.UIBuilder" Version="13.1.1" />
<PackageReference Include="Umbraco.UIBuilder.Startup" Version="13.1.1" />
<PackageReference Include="Umbraco.Workflow" Version="13.0.6" />
Expand Down
2 changes: 1 addition & 1 deletion src/TvShows.Web/ViewComponents/TvShowsViewComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public IViewComponentResult Invoke(int pageIndex = 1, int pageSize = 10)
var tvshow = new TvShowsView()
{
Id = child.Id,
Name = child.Name,
Name = child.ShowTitle,
Summary = child.Summary,
Premiered = child.Premiered,
Image = child.PreImage,
Expand Down

0 comments on commit 1e7c16d

Please sign in to comment.