Fix company list not showing properly.

This commit is contained in:
2020-06-01 02:44:34 +01:00
parent 14f8ecaefc
commit dc824dc519
2 changed files with 56 additions and 49 deletions

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.0.99.1547</Version> <Version>3.0.99.1551</Version>
<Company>Canary Islands Computer Museum</Company> <Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright> <Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product> <Product>Canary Islands Computer Museum Website</Product>

View File

@@ -39,60 +39,67 @@
return; return;
} }
<p align="center"> @if (CountryId.HasValue)
@if (CountryId.HasValue) {
{ <p align="center">
<b>@string.Format(L["Companies founded in {0}."], L[_countryName])</b> <b>@string.Format(L["Companies founded in {0}."], L[_countryName])</b>
if (File.Exists(System.IO.Path.Combine(Host.WebRootPath, "assets/flags/countries", CountryId + ".svg"))) if (File.Exists(System.IO.Path.Combine(Host.WebRootPath, "assets/flags/countries", CountryId + ".svg")))
{ {
<picture> <picture>
<source type="image/svg+xml" srcset="/assets/flags/countries/@(CountryId).svg"> <source type="image/svg+xml" srcset="/assets/flags/countries/@(CountryId).svg">
<source type="image/webp" srcset="/assets/flags/countries/webp/1x/@(CountryId).webp, <source type="image/webp" srcset="/assets/flags/countries/webp/1x/@(CountryId).webp,
/assets/flags/countries/webp/1x/@(CountryId).webp 2x, /assets/flags/countries/webp/1x/@(CountryId).webp 2x,
/assets/flags/countries/webp/1x/@(CountryId).webp 3x"> /assets/flags/countries/webp/1x/@(CountryId).webp 3x">
<img srcset="/assets/flags/countries/png/1x/@(CountryId).png, <img srcset="/assets/flags/countries/png/1x/@(CountryId).png,
/assets/flags/countries/png/1x/@(CountryId).png 2x, /assets/flags/countries/png/1x/@(CountryId).png 2x,
/assets/flags/countries/png/1x/@(CountryId).webp 3x" src="/assets/flags/countries/png/1x@(CountryId).png" alt="" height="32" /> /assets/flags/countries/png/1x/@(CountryId).webp 3x" src="/assets/flags/countries/png/1x@(CountryId).png" alt="" height="32" />
</picture> </picture>
} }
<br /> </p>
} }
@if (_character.HasValue) @if (_character.HasValue)
{ {
<p align="center">
<b>@string.Format(L["Companies which name starts with {0}."], _character)</b> <b>@string.Format(L["Companies which name starts with {0}."], _character)</b>
<br /> </p>
} }
@if (_companies.Any()) @if (_companies.Any())
{ {
<p> <div class="container">
@string.Format(L["{0} companies found in the database."], _companies.Count()) <span class="align-content-center">@string.Format(L["{0} companies found in the database."], _companies.Count())</span>
<br /> <hr/>
@foreach (var company in _companies) <table>
{ @foreach (var company in _companies)
<a href="/company/@company.Id"> {
@if (company.LastLogo != null && <tr>
File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", company.LastLogo + ".svg"))) <td class="text-right">
{ <a href="/company/@company.Id">
<picture> @if (company.LastLogo != null &&
<source type="image/svg+xml" srcset="/assets/logos/@(company.LastLogo).svg"> File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", company.LastLogo + ".svg")))
<source type="image/webp" srcset="/assets/logos/thumbs/webp/1x/@(company.LastLogo).webp, {
<picture>
<source type="image/svg+xml" srcset="/assets/logos/@(company.LastLogo).svg">
<source type="image/webp" srcset="/assets/logos/thumbs/webp/1x/@(company.LastLogo).webp,
/assets/logos/thumbs/webp/2x/@(company.LastLogo).webp 2x, /assets/logos/thumbs/webp/2x/@(company.LastLogo).webp 2x,
/assets/logos/thumbs/webp/3x/@(company.LastLogo).webp 3x"> /assets/logos/thumbs/webp/3x/@(company.LastLogo).webp 3x">
<img srcset="/assets/logos/thumbs/png/1x/@(company.LastLogo).png, <img srcset="/assets/logos/thumbs/png/1x/@(company.LastLogo).png,
/assets/logos/thumbs/png/2x/@(company.LastLogo).png 2x, /assets/logos/thumbs/png/2x/@(company.LastLogo).png 2x,
/assets/logos/thumbs/png/3x/@(company.LastLogo).png 3x" src="/assets/logos/thumbs/png/1x@(company.LastLogo).png" alt="" height="auto" width="auto" style="max-height: 32px; max-width: 128px" /> /assets/logos/thumbs/png/3x/@(company.LastLogo).png 3x" src="/assets/logos/thumbs/png/1x@(company.LastLogo).png" alt="" height="auto" width="auto" style="max-height: 32px; max-width: 128px" />
</picture> </picture>
} }
@company.Name </a>
</a> </td>
<br /> <td>
} <a href="/company/@company.Id">@company.Name</a>
</p> </td>
} </tr>
else }
{ </table>
<p>@L["There are no companies in the database."]</p> </div>
} }
</p> else
{
<p align="center">@L["There are no companies in the database."]</p>
}