2018-04-20 19:21:29 +01:00
|
|
|
@{
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
// Canary Islands Computer Museum Website
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : Index.cshtml
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Lists all companies
|
|
|
|
|
//
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as
|
|
|
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
// Copyright © 2003-2018 Natalia Portillo
|
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
|
|
ViewData["Title"] = "Companies";
|
|
|
|
|
}
|
2018-08-07 21:48:53 +01:00
|
|
|
@using System.IO
|
2019-05-20 01:44:22 +01:00
|
|
|
@model IEnumerable<CompanyViewModel>
|
2018-04-20 19:21:29 +01:00
|
|
|
|
2018-08-06 21:07:23 +01:00
|
|
|
<p align="center">
|
2018-04-20 19:21:29 +01:00
|
|
|
@if(Model.Any())
|
|
|
|
|
{
|
|
|
|
|
<p>
|
|
|
|
|
@Model.Count() companies found in the database.<br />
|
2019-05-20 01:44:22 +01:00
|
|
|
@foreach(CompanyViewModel company in Model)
|
2018-04-20 19:21:29 +01:00
|
|
|
{
|
|
|
|
|
<a asp-controller="Company"
|
|
|
|
|
asp-action="View"
|
|
|
|
|
asp-route-id="@company.Id">
|
2019-05-20 01:44:22 +01:00
|
|
|
@if(company.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", company.LastLogo + ".svg")))
|
2018-04-20 19:21:29 +01:00
|
|
|
{
|
|
|
|
|
<picture>
|
|
|
|
|
<source type="image/svg+xml"
|
2019-05-20 01:44:22 +01:00
|
|
|
srcset="/assets/logos/@(company.LastLogo).svg">
|
2018-04-20 19:21:29 +01:00
|
|
|
<source type="image/webp"
|
2019-05-20 01:44:22 +01:00
|
|
|
srcset="/assets/logos/thumbs/webp/1x/@(company.LastLogo).webp,
|
|
|
|
|
/assets/logos/thumbs/webp/1x/@(company.LastLogo).webp 2x,
|
|
|
|
|
/assets/logos/thumbs/webp/1x/@(company.LastLogo).webp 3x">
|
|
|
|
|
<img srcset="/assets/logos/thumbs/png/1x/@(company.LastLogo).png,
|
|
|
|
|
/assets/logos/thumbs/png/1x/@(company.LastLogo).png 2x,
|
|
|
|
|
/assets/logos/thumbs/png/1x/@(company.LastLogo).webp 3x"
|
|
|
|
|
src="/assets/logos/thumbs/png/1x@(company.LastLogo).png")
|
2018-04-20 19:21:29 +01:00
|
|
|
alt=""
|
2018-08-06 21:07:23 +01:00
|
|
|
height="auto"
|
|
|
|
|
width="auto"
|
|
|
|
|
style="max-height: 32px; max-width: 128px" />
|
2018-04-20 19:21:29 +01:00
|
|
|
</picture>
|
|
|
|
|
}
|
|
|
|
|
@company.Name
|
|
|
|
|
</a>
|
|
|
|
|
<br />
|
|
|
|
|
}
|
|
|
|
|
</p>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<p>There are no companies in the database.</p>
|
|
|
|
|
}
|
|
|
|
|
</p>
|