{{!
    Global Authentication Header Partial Template
}}

<div class="global-auth-header">
    <div class="auth-status-container">
        {{#auth_status}}
            {{#user_authorized}}
                <div class="auth-status auth-success">
                    <i class="fa fa-check-circle"></i>
                    <span class="status-text">Authenticated</span>
                    <span class="user-info">{{user_name}}</span>
                    <button class="btn btn-sm btn-outline-secondary btn-logout" onclick="if(typeof GlobalAuth !== 'undefined') GlobalAuth.logout();">
                        <i class="fa fa-sign-out"></i> Logout
                    </button>
                </div>
            {{/user_authorized}}
            {{^user_authorized}}
                <div class="auth-status auth-warning">
                    <i class="fa fa-exclamation-triangle"></i>
                    <span class="status-text">Authentication Required</span>
                    <button class="btn btn-sm btn-primary btn-login" onclick="if(typeof GlobalAuth !== 'undefined') GlobalAuth.showModal();">
                        <i class="fa fa-sign-in"></i> Login
                    </button>
                </div>
            {{/user_authorized}}
        {{/auth_status}}
        {{^auth_status}}
            <div class="auth-status auth-unknown" style="display: none;">
                <i class="fa fa-question-circle"></i>
                <span class="status-text">Checking Authentication...</span>
            </div>
        {{/auth_status}}
    </div>
</div>
