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

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

    <div class="skjema-admin__page__field">
        <asp:Label
            CssClass="skjema-admin__page__label"
            ID="Label1" 
            runat="server">
            Navn
        </asp:Label>

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

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Ledetekst
        </label>
        <asp:Label ID="lblCaption" runat="server"></asp:Label>
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Standard saksbehandler
        </label>
        <asp:Label ID="lblDefaultAssignee" runat="server"></asp:Label>
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label3" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Beskrivelse
        </asp:Label>
        <asp:Label ID="lblDescription" runat="server"></asp:Label>
    </div>
    
    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Påloggingstilbydere begrenset til
        </label>
        <asp:CheckBoxList 
            Enabled="false"
            ID="cbIdentityProviders" 
            CssClass="skjema-admin__page__tick"
            runat="server">
            <asp:ListItem Value="IdPorten">ID-porten autentisering</asp:ListItem>
            <asp:ListItem Value="Feide">Feide autentisering</asp:ListItem>
        </asp:CheckBoxList>    
    </div>

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

    <div class="mb-5">
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
    </div>


    <h3 class="skjema-admin__section-title mt-3">
        Brukere
    </h3>

    <p>
        Her angir du hvilke brukere som ligger i rollen.
    </p>

    <div class="skjema-admin__page__field">
        <asp:DropDownList 
            runat="server" 
            CssClass="skjema-admin__page__text mb-4"
            ID="ddlUsers" />

        <div class="mb-2">
            <asp:CheckBox 
                runat="server" 
                CssClass="skjema-admin__page__tick"
                ID="checkR" 
                Checked="True" 
                Text="Se skjema-data (r)" />
        </div>

        <div class="mb-2">
            <asp:CheckBox 
                runat="server" 
                CssClass="skjema-admin__page__tick"
                ID="checkW" 
                Checked="True" 
                Text="Endre skjema-data (w)" />
        </div>

        <div class="mb-4">
            <asp:CheckBox 
                runat="server" 
                CssClass="skjema-admin__page__tick"
                ID="checkX" 
                Checked="True" 
                Text="Kjøre regler (x)" />
        </div>

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

    <asp:GridView 
        runat="server" 
        ID="grid"
        DataKeyNames="Id"
        ItemType="eDocument.Server.Administrator.WorkFlow.UserOnEndpoint"
        AutoGenerateEditButton="False"
        SelectMethod="GetData"
        CssClass="skjema-admin__table"
        Border="0"
        Width="100%"
        AutoGenerateColumns="false">
        <Columns>
            <asp:DynamicField DataField="Id" Visible="False" />
            <asp:DynamicField DataField="Username" />
            <asp:DynamicField DataField="DisplayName" />
            <asp:DynamicField DataField="Email" />
            <asp:DynamicField DataField="Permissions" />
            <asp:TemplateField HeaderText="Fjern bruker">
                <ItemTemplate>
                    <asp:LinkButton runat="server" CommandName="Action" ID="btnRevokeAccess" Text="Fjern tilgang" OnCommand="btnRevokeAccess_OnClick" CommandArgument='<%#Bind("Id") %>'>Fjern tilgang</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

    <asp:Button 
        ID="btnBackToFlowProcess" 
        runat="server" 
        CssClass="skjema-admin__button"
        Text="Tilbake til arbeidsflyt" 
        OnClick="btnBackToFlowProcess_Click">
    </asp:Button>
</asp:Content>
