<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<FotbalPortal.Models.Article>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Sportovní portál
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<% foreach (var item in Model) { %>
    <div class="article">
        <div class="image"><img src="<%: Url.Action("ImageResize", new { width = 150, height = 150, filename = item.image } )%>" /></div>
        <div class="title"><a href="<%: Url.Action("Read", new { id=item.id })%>"><%: Html.DisplayFor(modelItem => item.title) %></a></div>
        <% var length = item.text.Length;
           if (length > 200) length = 200; %>
        <div class="text"><%: Html.Raw(item.text.Substring(0,length) + "..." ) %></div>
        <%: Html.DisplayFor(modelItem => item.published) %>
        <%: Html.DisplayFor(modelItem => item.category.name) %>
    </div>
<% } %>


</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ScriptsSection" runat="server">
</asp:Content>
