2018-04-11 05:55:27 +01:00
|
|
|
@{
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
// Canary Islands Computer Museum Website
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : Index.cshtml
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Index page (and news)
|
|
|
|
|
//
|
|
|
|
|
// --[ 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"] = "Home Page";
|
|
|
|
|
}
|
2018-04-13 02:42:27 +01:00
|
|
|
@using System.IO
|
2018-08-06 00:26:30 +01:00
|
|
|
@using News = Cicm.Database.Models.News
|
|
|
|
|
@model List<Cicm.Database.Models.News>
|
2018-04-11 05:55:27 +01:00
|
|
|
|
|
|
|
|
<h2>News</h2>
|
|
|
|
|
|
2018-04-13 02:42:27 +01:00
|
|
|
@foreach(News news in Model)
|
|
|
|
|
{
|
|
|
|
|
<table border="0"
|
|
|
|
|
width="100%">
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2">
|
|
|
|
|
<b>@news.Date</b>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2018-08-06 00:26:30 +01:00
|
|
|
News items not yet implemented!
|
|
|
|
|
@* // TODO
|
2018-04-13 02:42:27 +01:00
|
|
|
@if(news.Image != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, news.Image + ".jpg")))
|
|
|
|
|
{
|
|
|
|
|
<td height="128"
|
|
|
|
|
width="128">
|
|
|
|
|
<a asp-action="View"
|
|
|
|
|
asp-controller="@news.TargetView"
|
|
|
|
|
asp-route-id="@news.AffectedId">
|
|
|
|
|
<img height="128"
|
|
|
|
|
width="128"
|
|
|
|
|
src="@(news.Image + ".jpg")">
|
|
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
@news.Text
|
|
|
|
|
</td>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<td colspan="2">
|
|
|
|
|
@news.Text
|
|
|
|
|
</td>
|
|
|
|
|
}
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2">
|
|
|
|
|
<a asp-action="View"
|
|
|
|
|
asp-controller="@news.TargetView"
|
|
|
|
|
asp-route-id="@news.AffectedId">
|
2018-04-14 03:04:52 +01:00
|
|
|
@news.SubText
|
2018-04-13 02:42:27 +01:00
|
|
|
</a>
|
|
|
|
|
</td>
|
2018-08-06 00:26:30 +01:00
|
|
|
*@
|
2018-04-13 02:42:27 +01:00
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<br />
|
|
|
|
|
}
|