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">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.0.99.1547</Version>
<Version>3.0.99.1551</Version>
<Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product>

View File

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