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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <h1 class="skjema-admin__page-title">Detaljer for skjema
    </h1>

    <asp:Panel runat="server" ID="pnlDeleted" Visible="False">
        <div style="background-color: red; font-size: medium; height: 20px; vertical-align: auto">
            Dette skjemaet er slettet. 
            <a href="Restore.aspx?eDocumentTemplateID=<%= Request.QueryString["eDocumentTemplateID"] %>&return=Details.aspx?eDocumentTemplateID=<%= Request.QueryString["eDocumentTemplateID"] %>">Trykk her for å gjenopprette.
            </a>
        </div>
    </asp:Panel>

    <h2 class="skjema-admin__section-title">
        Detaljer
    </h2>

    <div class="mb-5">

        <div class="mb-4">
            <asp:Label 
                ID="Label5" 
                CssClass="skjema-admin__page__label"
                runat="server">
                Navn
            </asp:Label>

            <asp:Label ID="lblName" runat="server"></asp:Label>
        </div>

        <div class="mb-4"> 
            <asp:Label 
                ID="Label14"
                CssClass="skjema-admin__page__label"
                runat="server">
                Form ID
            </asp:Label>

            <asp:Label ID="lblFormID" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
             <asp:Label id="Label18" runat="server">Aktiv</asp:Label>
            <asp:CheckBox id="checkActive" runat="server" Enabled="False"></asp:CheckBox>
        </div>

        <div class="mb-4">
            <asp:Label
                CssClass="skjema-admin__page__label"
                ID="Label16" 
                runat="server">
                Instansnavn
            </asp:Label>

            <asp:Label ID="lblInstanceName" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label11" 
                CssClass="skjema-admin__page__label"
                runat="server">
                Kategori
            </asp:Label>

            <asp:Label ID="lblTemplateCategory" runat="server"></asp:Label>
            <asp:HyperLink ID="Hyperlink10" runat="server" Visible="False" Target="_blank">
                Hjelp
            </asp:HyperLink>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label9"
                CssClass="skjema-admin__page__label"
                runat="server">
                Mottak
            </asp:Label>

            <asp:Label ID="lblBox" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label12"
                CssClass="skjema-admin__page__label"
                runat="server">
                Arbeidsflyt
            </asp:Label>

            <asp:Label ID="lblWorkflow" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label10" 
                CssClass="skjema-admin__page__label"
                runat="server">
                XSL
            </asp:Label>
            <asp:Label ID="lblXsl" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <label class="skjema-admin__page__label">
                E-post
            </label>
            <asp:Label ID="lblMail" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <label class="skjema-admin__page__label">
                Sikkerhetsnivå
            </label>
            <asp:Label ID="lblSecurityLevel" runat="server" />
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label1"
                CssClass="skjema-admin__page__label"
                runat="server">
                Opprettet
            </asp:Label>
            <asp:Label ID="lblCreated" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:HyperLink 
                ID="Hyperlink8" 
                runat="server" 
                Visible="False" 
                Target="_blank" 
                NavigateUrl="~/Help/Created.aspx">
                Hjelp
            </asp:HyperLink>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label2" 
                CssClass="skjema-admin__page__label"
                runat="server">
                Kommentar
            </asp:Label>

            <asp:Label ID="lblComment" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label3" 
                CssClass="skjema-admin__page__label"
                runat="server">
                Fra dato
            </asp:Label>

            <asp:Label ID="lblFromDate" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label4" 
                CssClass="skjema-admin__page__label"
                runat="server">
                Til dato
            </asp:Label>

            <asp:Label ID="lblToDate" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <label class="skjema-admin__page__label">
                Synlighet
            </label>
            <asp:Label ID="lblVisibility" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label8" 
                CssClass="skjema-admin__page__label"
                runat="server">
                XFT
            </asp:Label>

            <asp:Label ID="lblDokumentbankenBlankett" runat="server"></asp:Label>
            <asp:HyperLink ID="HyperLink7" runat="server" Target="_blank" Visible="False">Help</asp:HyperLink>
        </div>

        <div class="mb-4">
            <asp:Label ID="Label15" runat="server">
                Autogenerert PDF-respons
            </asp:Label>

            <asp:Label ID="lblFriendlyPDFResponse" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label17" 
                CssClass="skjema-admin__page__label"
                runat="server">
                Autogenerert PDF-utskrift
            </asp:Label>
            <asp:Label ID="lblFriendlyPDFPrint" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label13" 
                CssClass="skjema-admin__page__label"
                runat="server">
                Oppdater lagrede søknader til gjeldende versjon
            </asp:Label>

            <asp:Label ID="lblUpdateSavedToCurrentVersion" runat="server"></asp:Label>
        </div>

        <div class="mb-4">
            <asp:Label 
                ID="Label6" 
                CssClass="skjema-admin__page__label"
                runat="server">
                Gjeldende versjon
            </asp:Label>

            <asp:Label ID="lblCurrentVersion" runat="server"></asp:Label>&nbsp;
            <asp:HyperLink ID="lnkCurrentBinary" runat="server" Target="_blank" NavigateUrl="~/eDocumentTemplateVersion/DownloadEDocumentBinary.aspx?eDocumentTemplateVersionID=">.edoc</asp:HyperLink>|
            <asp:HyperLink ID="lnkCurrentXml" runat="server" Target="_blank" NavigateUrl="~/eDocumentTemplateVersion/DownloadXmlResponseExample.aspx?eDocumentTemplateVersionID=">Xml</asp:HyperLink>|
            <asp:HyperLink ID="lnkCurrentXsd" runat="server" Target="_blank" NavigateUrl="~/eDocumentTemplateVersion/DownloadXsd.aspx?eDocumentTemplateVersionID=">Xsd</asp:HyperLink>
            <asp:HyperLink ID="HyperLink4" runat="server" Visible="False" Target="_blank" NavigateUrl="~/Help/CurrentVersion.aspx">Hjelp</asp:HyperLink>
        </div>

        <div class="mb-4">

            <asp:Label 
                ID="Label7"
                CssClass="skjema-admin__page__label"
                runat="server">
                Nyeste versjon
            </asp:Label>

            <asp:Label ID="lblLatestVersion" runat="server"></asp:Label>&nbsp;<asp:HyperLink
                ID="lnkLatestBinary" runat="server" Target="_blank" NavigateUrl="~/eDocumentTemplateVersion/DownloadEDocumentBinary.aspx?eDocumentTemplateVersionID=">.edoc</asp:HyperLink>|
                    <asp:HyperLink ID="lnkLatestXml" runat="server" Target="_blank" NavigateUrl="~/eDocumentTemplateVersion/DownloadXmlResponseExample.aspx?eDocumentTemplateVersionID=">Xml</asp:HyperLink>|
                    <asp:HyperLink ID="lnkLatestXsd" runat="server" Target="_blank" NavigateUrl="~/eDocumentTemplateVersion/DownloadXsd.aspx?eDocumentTemplateVersionID=">Xsd</asp:HyperLink>

            <asp:HyperLink ID="HyperLink5" runat="server" Visible="False" Target="_blank" NavigateUrl="~/Help/LatestVersion.aspx">Hjelp</asp:HyperLink>
        </div>

        <div class="mb-4">
            <label class="skjema-admin__page__label">
                Retur-URL: Send inn 
            </label>
            <asp:Label ID="lblReturnUrlSubmit" runat="server" Width="500px"></asp:Label>
        </div>

        <div class="mb-4">
            <label class="skjema-admin__page__label">
                Retur-URL: Lagre
            </label>
            <asp:Label ID="lblReturnUrlSave" runat="server" Width="500px"></asp:Label>
        </div>

        <div class="mb-4">
            <label class="skjema-admin__page__label">
                Retur-URL: Avbryt
            </label>
            <asp:Label ID="lblReturnUrlAbort" runat="server" Width="500px"></asp:Label>
        </div>

        <div class="mb-5">
            <asp:Button 
                CssClass="skjema-admin__button skjema-admin__button--primary mr-3"
                runat="server" 
                Text="Slett" 
                ID="btnDelete" 
                OnClick="btnDelete_OnClick">
            </asp:Button>

            <asp:Button 
                CssClass="skjema-admin__button"
                ID="btnEdit" 
                runat="server" 
                Text="Rediger" 
                OnClick="btnEdit_Click">
            </asp:Button>
        </div>
    </div>

    <h2 class="skjema-admin__section-title">Versjoner
    </h2>

    <div class="mb-5">
        <asp:DataGrid
            ID="dgVersions"
            Border="0"
            CssClass="skjema-admin__table"
            runat="server"
            AutoGenerateColumns="False"
            HeaderStyle-CssClass="HeaderStyle"
            ItemStyle-CssClass="ItemStyle"
            AlternatingItemStyle-CssClass="AlternatingItemStyle"
            Width="100%">

            <AlternatingItemStyle CssClass="AlternatingItemStyle"></AlternatingItemStyle>
            <ItemStyle CssClass="ItemStyle"></ItemStyle>
            <HeaderStyle CssClass="HeaderStyle"></HeaderStyle>

            <Columns>
                <asp:BoundColumn Visible="False" DataField="eDocumentTemplateVersionID"></asp:BoundColumn>
                <asp:BoundColumn DataField="Version" SortExpression="Version ASC" HeaderText="Versjon"></asp:BoundColumn>
                <asp:BoundColumn Visible="False" DataField="SignMode"></asp:BoundColumn>
                <asp:BoundColumn Visible="False" DataField="SignObject"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="SignMode" Visible="False"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="SignObject" Visible="False"></asp:BoundColumn>
                <asp:BoundColumn DataField="CreatedOn" SortExpression="CreatedOn ASC" HeaderText="Opprettet"></asp:BoundColumn>
                <asp:BoundColumn DataField="PublishDate" DataFormatString="{0:d}" HeaderText="Publiseringsdato"></asp:BoundColumn>
                <asp:BoundColumn DataField="Comment" HeaderText="Kommentar"></asp:BoundColumn>
                <asp:ButtonColumn Text="Detaljer" CommandName="Details"></asp:ButtonColumn>
                <asp:ButtonColumn Text="Rediger" CommandName="Edit"></asp:ButtonColumn>
                <asp:ButtonColumn Text="Sett som gjeldende" CommandName="SetAsCurrent"></asp:ButtonColumn>
                <asp:ButtonColumn Text="Slett" CommandName="Delete" Visible="false"></asp:ButtonColumn>
            </Columns>

        </asp:DataGrid>
        
        <div class="mb-4">
            <asp:Label ID="lblNoVersionsMessage" runat="server">Ingen versjoner.</asp:Label>
        </div>

        <asp:Button
            ID="btnCreateVersion"
            runat="server"
            Text="Opprett versjon"
            CssClass="skjema-admin__button skjema-admin__button--primary"
            OnClick="btnCreateVersion_Click"></asp:Button>
    </div>


    <h2 class="skjema-admin__section-title">Prosesser
    </h2>

    <div class="mb-5">
        <asp:DataGrid
            ID="dgProcesses"
            runat="server"
            AutoGenerateColumns="False"
            Border="0"
            CssClass="skjema-admin__table"
            Width="100%">
            <AlternatingItemStyle CssClass="AlternatingItemStyle"></AlternatingItemStyle>
            <ItemStyle CssClass="ItemStyle"></ItemStyle>
            <HeaderStyle CssClass="HeaderStyle"></HeaderStyle>

            <Columns>
                <asp:BoundColumn Visible="False" DataField="ProcessOnSubscriptionID"></asp:BoundColumn>
                <asp:BoundColumn Visible="False" DataField="ProcessID"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="Navn" DataField="Name"></asp:BoundColumn>
                <%--<asp:BoundColumn DataField="Sequence" HeaderText="Rekkefølge" Visible="False"></asp:BoundColumn>--%>
                <%--<asp:ButtonColumn Text="Flytt opp" CommandName="MoveUp"></asp:ButtonColumn>--%>
                <%--<asp:ButtonColumn Text="Flytt ned" CommandName="MoveDown"></asp:ButtonColumn>--%>
                <asp:ButtonColumn Text="Fjern" CommandName="Delete"></asp:ButtonColumn>
            </Columns>
        </asp:DataGrid>
        
        <div class="mb-4">
            <asp:Label ID="lblNoProcessesMessage" runat="server">Ingen prosesser.</asp:Label>
        </div>

        <asp:Button
            ID="btnAttachProcess"
            CssClass="skjema-admin__button skjema-admin__button--primary"
            runat="server"
            Text="Legg til prosess"
            OnClick="btnAttachProcess_Click"></asp:Button>
    </div>

    <%--<h2 class="skjema-admin__section-title">XSL
    </h2>--%>

<%--    <div class="mb-5">

        <div class="mb-4">
            <asp:DropDownList
                ID="ddlXsl"
                class="skjema-admin__page__text"
                runat="Server" />
        </div>

        <asp:Button
            ID="btnAddXsl"
            CssClass="skjema-admin__button skjema-admin__button--primary mr-2"
            runat="server"
            Text="Legg til"
            OnClick="btnAddXsl_Click" />

        <a class="skjema-admin__button"
            href='../Xsl/Create.aspx?Return=~/eDocumentTemplate/Details.aspx?eDocumentTemplateID=<%= Request.QueryString["eDocumentTemplateID"] %>'>Opprett XSL
        </a>

        <asp:GridView ID="gridXsl" runat="server" AutoGenerateColumns="false" DataKeyNames="XslID"
            OnRowDeleting="gridXsl_RowDeleting">
            <Columns>
                <asp:HyperLinkField DataNavigateUrlFields="XslID" DataNavigateUrlFormatString="../Xsl/Details.aspx?XslID={0}"
                    HeaderText="Navn" DataTextField="Name" />
                <asp:BoundField DataField="Comment" HeaderText="Kommentar" />
                <asp:TemplateField HeaderText="Fjern">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkDelete" CommandArgument='<%# Eval("XslID") %>' CommandName="Delete"
                            runat="server">Fjern</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>--%>

    <p>
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
    </p>
</asp:Content>
