<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemplateCatalogList.aspx.cs" Inherits="eDocument.Server.Administrator.eDocumentTemplate.TemplateCatalogList" MasterPageFile="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <style type="text/css">
        .Hide
        {
            display: none;
        }
    </style>
    
    <div class="skjema-admin__page-pre-title">
        Skjema
    </div>
    <h2 class="skjema-admin__page-title skjema-admin__mt-0">
        Kataloger
    </h2>

    <div class="skjema-admin__page__field skjema-admin__mb-40">
        <label class="skjema-admin__page__label">
            Opprett katalog
        </label>

        <div class="d-flex mb-2">
            <asp:TextBox ID="txtTemplateCatalogName" CssClass="skjema-admin__page__text mr-3" runat="server" />
            <asp:Button 
                ID="btnCreateTemplateCatalog"
                CssClass="skjema-admin__button skjema-admin__button--secondary"
                Text="Opprett"
                runat="server" 
                OnClick="btnCreateTemplateCatalog_Click" />
        </div>

        <div class="skjema-admin__page__field-under-text">
            Skriv inn tittel for den nye katalogen
        </div>

        <asp:RequiredFieldValidator
            ID="requiredName"
            ForeColor="Red"
            runat="server" 
            Display="Dynamic"
            ErrorMessage="Navn er obligatorisk" 
            ControlToValidate="txtTemplateCatalogName">
        </asp:RequiredFieldValidator>
    </div>

    <asp:Label runat="server" id="lblMessage" ForeColor="Red"></asp:Label>
    
    <h3 class="skjema-admin__page-title skjema-admin__page-title--small">
        Alle kataloger
    </h3>
    <asp:GridView
        ID="gvTemplateCatalogList"
        runat="server"
        AutoGenerateColumns="False"
        Width="100%"
        Border="0"
        CssClass="skjema-admin__table skjema-admin__table--last-child-w-150 jsTableCheckAll" >
        <HeaderStyle CssClass="skjema-admin__table__header"></HeaderStyle>
        <Columns>
            <asp:BoundField DataField="Id" HeaderText="Katalog-Id" ItemStyle-CssClass="Hide" HeaderStyle-CssClass="Hide"></asp:BoundField>
            <asp:HyperLinkField DataTextField="Name" HeaderText="Tittel" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/eDocumentTemplate/TemplateCatalogEdit.aspx?templateCatalogId={0}" />
            <asp:BoundField DataField="Number" HeaderText="Antall skjema"></asp:BoundField>
        </Columns>
    </asp:GridView>
    
    <%--TODO: legg til hvem som abonnerer på skjemakatalogen --%>
</asp:Content>
