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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <h1 class="skjema-admin__page-title">Opprett skjema</h1>
    <h3>Trinn 3/6 - integrasjon</h3>
    <br />

    <div runat="server" id="divChooseSystem" visible="True">
        <br />
        <b>Skjema.no støtter import til disse systemene. Er dette et av systemene du ønsker at filene importeres til?</b><br />
        <br />
        <asp:RadioButtonList runat="server" ID="rblKNownSystems" CausesValidation="False" AutoPostBack="True" OnSelectedIndexChanged="rblKNownSystems_OnSelectedIndexChanged">
            <asp:ListItem Value="none">Skjemaet skal ikke integreres</asp:ListItem>
            <asp:ListItem Value="Acos">Acos WebSak</asp:ListItem>
            <asp:ListItem Value="ePhorte">ePhorte</asp:ListItem>
            <asp:ListItem Value="Elements">Elements</asp:ListItem>
            <asp:ListItem Value="p360">Public360 i skyen</asp:ListItem>
            <asp:ListItem Value="other">Et annet system</asp:ListItem>
        </asp:RadioButtonList>

        <div runat="server" id="divRunXsl" visible="False">
            <br />
            <b>Ønsker du at mottaket kjører en XSL transformering før den lagrer filene?</b><br />
            Hvis du ikke kjører noen XSL, vil XML-en få skjema.no's standard XML-format. Du kan lese mer om skjema.no-XML <a href="#" target="_blank">her</a>.<br />
            <br />
            <asp:RadioButtonList runat="server" ID="rblRunXsl" AutoPostBack="True" CausesValidation="False" OnSelectedIndexChanged="rblRunXsl_OnSelectedIndexChanged">
                <asp:ListItem Value="no">Nei, ikke kjør noen XSL</asp:ListItem>
                <asp:ListItem Value="yes">Ja, kjør en XSL</asp:ListItem>
            </asp:RadioButtonList>

            <div id="divXsl" runat="server" visible="False">
                <div id="divChooseXsl" runat="server" visible="False">
                    Du har tidligere lastet opp XSL-filer. Finner du XSL filen du ønsker å bruke i denne listen:
                        
                        <div class="mb-4">
                            <asp:Label ID="Label6" CssClass="skjema-admin__page__label" runat="server">XSL</asp:Label>
                            <asp:DropDownList ID="ddlXsl" DataValueField="Id" DataTextField="Name" CssClass="skjema-admin__page__text" runat="server" CausesValidation="False" AutoPostBack="True" OnSelectedIndexChanged="ddlXsl_OnSelectedIndexChanged" />
                        </div>
                </div>

                <div runat="server" id="divCreateXsl" visible="False">
                    <div class="skjema-admin__page__field">
                        <div id="divUploadXsl" runat="server">
                            <br />
                            1. <b>Velg XSL fil *</b>
                            <input id="flXsl" type="file" runat="server" size="26" /><br />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ForeColor="Red" Display="Dynamic" ErrorMessage="Du må angi XSL filen (.xsl) du ønsker å laste opp." ControlToValidate="flXsl" /><br />
                            <br />
                            2. <b>Klikk her for å laste opp filen.</b>
                            <asp:Button runat="server" ID="btnUploadXsl" Text="Last opp" OnClick="btnUploadXsl_OnClick" />
                            <br />
                            <asp:Label runat="server" ID="lblXslErrorMessage" ForeColor="Red" Text=""></asp:Label>
                        </div>
                        <div id="divRemoveXsl" runat="server" visible="False">
                            <br />
                            1. <b>Velg XSL fil *</b>
                            <asp:Label runat="server" ID="lblXslFilename"></asp:Label><br />
                            <br />
                            2. <b>Hvis du ønsker å laste opp en annen XSL-fil, klikk her for å fjerne filen</b>
                            <asp:Button runat="server" ID="btnRemoveXsl" Text="Fjern XSL-fil" OnClick="btnRemoveXsl_OnClick" />
                        </div>

                        <div runat="server" id="divXslName" visible="False" class="skjema-admin__page__field">
                            <br />
                            3. <b>Gi XSL-en et navn *</b>
                            <asp:TextBox ID="txtXslName" CssClass="skjema-admin__page__text" runat="server" AutoPostBack="True" CausesValidation="False" OnTextChanged="txtXslName_OnTextChanged" /><br />
                            <asp:Label runat="server" ID="lblXslNameErrorMessage" ForeColor="Red"></asp:Label>
                            <asp:RequiredFieldValidator EnableClientScript="False" ID="RequiredFieldValidator1" Display="Dynamic" runat="server" ErrorMessage="Du må angi et navn." ControlToValidate="txtXslName" ForeColor="Red" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <br/>
    <div id="buttons">
        <div class="mb-5">
            <asp:Button 
                ID="btnPrevious" 
                CssClass="skjema-admin__button skjema-admin__button--secondary d-inline-block text-center"
                runat="server" 
                Text="Forrige" 
                OnClick="MovePrevious">
            </asp:Button>
            <asp:Button 
                ID="btnNext" 
                CssClass="skjema-admin__button skjema-admin__button--primary mt-3 mb-5"
                runat="server" 
                Text="Neste" 
                OnClick="MoveNext">
            </asp:Button>
        </div>

        <asp:Label 
            ID="lblMessage" 
            CssClass="skjema-admin__page__label mb-5"  
            runat="server" 
            ForeColor="Red">
        </asp:Label>
    </div>
</asp:Content>
