<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.NewsControl"
    CodeBehind="News.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="ToolTipLabel" Src="ToolTipLabelControl.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="NumericTextBox" Src="NumericTextBox.ascx" %>
<div class="section-header">
    <div class="title">
        <img src="Common/ico-content.png" alt="News" />
        Manage News
    </div>
    <div class="options">
        <input type="button" onclick="location.href='NewsAdd.aspx'" value="Add new" id="btnAddNew"
            class="adminButtonBlue" title="Add a news entry" />
    </div>
</div>
<p>
</p>
<asp:GridView ID="gvNews" runat="server" AutoGenerateColumns="False" Width="100%"
    OnPageIndexChanging="gvNews_PageIndexChanging" AllowPaging="true" PageSize="15">
    <Columns>
        <asp:BoundField DataField="NewsID" HeaderText="NewsID" Visible="False"></asp:BoundField>
        <asp:TemplateField HeaderText="Name" ItemStyle-Width="30%">
            <ItemTemplate>
                <a href="NewsDetails.aspx?NewsID=<%#Eval("NewsID")%>" title="Edit news item">
                    <%#Server.HtmlEncode(Eval("Title").ToString())%>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Language" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="15%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <a href="LanguageDetails.aspx?NewsID=<%#Eval("LanguageID")%>" title="Manage store languages">
                    <%#((Language)Eval("Language")).Name%></a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <a href="NewsDetails.aspx?NewsID=<%#Eval("NewsID")%>" title="Edit news item">Edit</a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Published" HeaderText="Published" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
        <asp:TemplateField HeaderText="Created on" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("CreatedOn")).ToString()%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="View comments" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <a href="NewsComments.aspx?NewsID=<%#Eval("NewsID")%>" title="View news entry comments">
                    <%#((NewsCommentCollection)Eval("NewsComments")).Count%>
                    comments</a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
