<%@ Page Title="" Language="C#" MasterPageFile="~/PatientAccess/PAAdmin/AdminMainSubNav.Master" AutoEventWireup="true" CodeBehind="SettingEditor.aspx.cs" Inherits="Axium.Web.PAAdmin.v2.Settings.SettingEditor" %>
<%@ MasterType VirtualPath="~/PatientAccess/PAAdmin/AdminMainSubNav.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="AdditionalHeader" runat="server">
    <script type="text/javascript" src="../../Include/simpletreemenu.240530.js"></script>
    <link rel="stylesheet" type="text/css" href="../../Include/simpletree.css" />
    <script type="text/javascript" src="../../Include/v2/SettingEditor.js"></script>
    <link rel="stylesheet" type="text/css" href="../../Include/v2/externalLinks.css" />
</asp:Content>

<asp:Content ID="LeftMenu" ContentPlaceHolderID="SubNavigation" runat="server">
    <adminNav:PagesAndSettings ID="PageNavigationControl" runat="server" />
</asp:Content>

<asp:Content ID="MainSection" ContentPlaceHolderID="MainContent" runat="server">
    <input type='hidden' id='ExternalSiteSortedList' name='ExternalSiteSortedList' runat="server"/>
    <script>
        $(document).ready(function () {
            $('.sortable').sortable({
                stop: function (e, ui) {
                    var listOrder = $(this).sortable('toArray').toString();
                    $("#<%=ExternalSiteSortedList.ClientID %>").val(listOrder);
                }
            });
            $('.sortable').disableSelection();
        });
    </script>

    <div class="MainHeader" style="height: 28px">
        <input id="hdnResetPasswordsBtn" class="hdnResetPasswordsBtn" type="button" value="delete" runat="server"  OnServerClick="ResetAllPasswords_Click" onclick="showSpinner();" style="display: none;"/>
        <input id="hdnResetResetEmailTemplatesToDefaultBtn" class="hdnResetResetEmailTemplatesToDefaultBtn" type="button" value="delete" runat="server" OnServerClick="hdnResetResetEmailTemplatesToDefaultBtn_OnServerClick" onclick="showSpinner();" style="display: none;"/>
    </div>
    <div>
        <h1 runat="server" ID="SettingTitle"></h1>
        <div id="FeatureNotAvailable" runat="server" class="infoBox" visible="false">
            <i class="fas fa-info-circle"></i>
            <asp:Label ID="FeatureNotAvailableLabel" runat="server" Text="Coming soon! This feature is not available yet, but we are working hard to bring it to you soon!"></asp:Label>
        </div>
        <asp:Panel ID="ExternalLinksPanel" Visible="false" runat="server" EnableViewState="true">
            <span class="external-links-panel-description">You can define up to 10 external links to display.  Drag and drop the boxes to reorder the links.</span>
            <ul id="ExternalLinkTable" runat="server" class="sortable" EnableViewState="true">
            </ul>
        </asp:Panel>
        <asp:Panel ID="PageSettingsPanel" Visible="False" CssClass="pageEditorBox" runat="server" EnableViewState="true">
            <h2>Page Settings</h2>
            <div class="field">
                <span class="label">Available in PatientAccess</span>
                <span class="input"><asp:CheckBox ID="AvailableInPatientAccessCheck" runat="server" EnableViewState="true"/></span>
            </div>
            <div class="field">
                <span class="label">Available in FirstAccess</span>
                <span class="input">
                    <asp:CheckBox ID="FirstAccessCheck" runat="server" EnableViewState="true"/>
                    <span id="FirstAccessSpan" runat="server" class="Error"></span>
                </span>
					
            </div>
            <% if (!IsCurrentGroupChangeUsernameAndPassword)  { %>

            <div class="field">
                <span class="label">Hidden from Authorized Representatives</span>
                <span class="input"><asp:CheckBox ID="HiddenAuthRepsCheck" runat="server" EnableViewState="true"/></span>
            </div>

            <% } %>
            <div class="clear"></div>
            
        </asp:Panel>

        <asp:Panel ID="iSettingPanel" runat="server">
            
        </asp:Panel> 

        <asp:Panel ID="SavePanel" CssClass="saveBtnPanel" runat="server">
            <asp:Button ID="SaveSettingBtn" runat="server" Text="Save" CssClass="ButtonGreen" onclick="SaveBtn_Click" OnClientClick="showSpinner();" Visible="false"/>            
        </asp:Panel>
        <span>&nbsp;</span>
    </div>
    
    <div id="resetAllAlert" class="jqmAlert">
        <div class="jqmAlertWindow">
            <div class="jqmAlertTitle">
                <h3 id="ConfirmHeader" runat="server" enableviewstate="false">
                    WARNING
                </h3>
                <a class="logoutX resetCancel" href="#"><em>Cancel</em> </a>
            </div>
            <div class="jqmAlertContent">
                <div id="LogoutExplanation" runat="server" enableviewstate="false">
                    <p>
                        You are about to reset the passwords of all PatientAccess patients. An email will be sent to all PatientAccess patients with a link to change their passwords. <span id="resetExpiry" runat="server">The link will expire in 5 days.</span> This process can take several minutes to complete.<br/><br/> Are you sure you want to continue?
                        <br/>
                        <br/>
                    </p>
                </div>
                <p>
                    <a ID="resetAllYes" ToolTip="Yes" Text="Yes" runat="server"
                        onclick="" href="#" class="resetYes">Yes</a>
                    <asp:HyperLink ID="LogoutCancelLink" ToolTip="No" Text="Cancel"
                        runat="server" EnableViewState="false" NavigateUrl="#" CssClass="resetCancel" />
                </p>
            </div>
        </div>
    </div>
    <div id="resetEmailsTemplatesToDefaultAlert" class="jqmAlert">
        <div class="jqmAlertWindow">
            <div class="jqmAlertTitle">
                <h3>
                    WARNING
                </h3>
                <a class="logoutX resetCancel" href="#"><em>Cancel</em> </a>
            </div>
            <div class="jqmAlertContent">
                <div>
                    <p>
                        You are about to restore email body contents on this page to the default template. This will revert any changes you may have previously applied.
                        <br/><br/> 
                        Are you sure you want to continue?
                        <br/>
                        <br/>
                    </p>
                </div>
                <p>
                    <a href="#" title="Continue" class="resetYes">Continue</a>
                    <a href="#" title="Cancel" class="resetCancel">Cancel</a>
                </p>
            </div>
        </div>
    </div>
</asp:Content>

