<aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="/portal" class="brand-link">
        <img src="/images/<%=settings["WebsiteLogo"].Value%>" alt="HRPortal Logo" class="brand-image"
             style="opacity: .8">
        <span class="brand-text font-weight-light">HR Portal</span>
    </a>
    <div class="sidebar">
        <!-- Sidebar user panel (optional) -->
        <div class="user-panel mt-3 pb-3 mb-3 d-flex">
            <div class="image">
                <img src="/profiles/<%= user.Photo %>" class="img-circle elevation-2" style="width: 2.8rem" alt="User Image">
            </div>
            <div class="info">
                <a class="d-block"><%= user.Name %></a>
                <p  style="font-size: 0.8rem; color: #d0d0d0; margin: 0;"><%= user.Position?.Name %></p>
            </div>
        </div>

        <!-- Sidebar Menu -->
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <!-- Add icons to the links using the .nav-icon class
                     with font-awesome or any other icon font library -->
                <% if(user.isAdmin){ %>
                    <li class="nav-item has-treeview">
                        <a href="#" class="nav-link">
                            <i class="nav-icon fas fa-user-shield"></i>
                            <p>
                                Admin
                                <i class="right fas fa-angle-left"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item">
                                <a href="/admin/users" class="nav-link">
                                    <i class="nav-icon fas fa-users-slash" aria-hidden="true"></i>
                                    <p>
                                        Manage Users
                                    </p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="/admin/invites" class="nav-link">
                                    <i class="nav-icon fas fa-user-plus" aria-hidden="true"></i>
                                    <p>
                                        Manage Invites
                                    </p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="/admin/ranks" class="nav-link">
                                    <i class="nav-icon fa fa-star" aria-hidden="true"></i>
                                    <p>
                                        Manage Ranks
                                    </p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="/admin/directorates" class="nav-link">
                                    <i class="nav-icon far fa fa-object-group" aria-hidden="true"></i>
                                    <p>
                                        Manage Directorates
                                    </p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="/admin/teams" class="nav-link">
                                    <i class="nav-icon fas fa-users" aria-hidden="true"></i>
                                    <p>
                                        Manage Teams
                                    </p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="/admin/positions" class="nav-link">
                                    <i class="nav-icon fa fa-briefcase" aria-hidden="true"></i>
                                    <p>
                                        Manage Positions
                                    </p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="/admin/questions" class="nav-link">
                                    <i class="nav-icon fa fa-question-circle" aria-hidden="true"></i>
                                    <p>
                                        Manage Form Questions
                                    </p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a href="/admin/settings" class="nav-link">
                                    <i class="nav-icon fas fa-cogs" aria-hidden="true"></i>
                                    <p>
                                        Settings
                                    </p>
                                </a>
                            </li>
                        </ul>
                    </li>
                <% } %>
                <% if(!user.Position?.Name?.includes("Member") && !user.Position?.Name?.includes("member")){ %>
                <li class="nav-item has-treeview">
                    <a href="#" class="nav-link">
                        <i class="nav-icon fas fa-user-tie"></i>
                        <p>
                            Recruitment
                            <i class="right fas fa-angle-left"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="/portal/applicants/my" class="nav-link">
                                <i class="fas fa-users nav-icon"></i>
                                <p>My Applicants</p>
                            </a>
                        </li>
                        <% if(["Admin", "President", "Marketing VP", "Projects VP", "Financial VP", "Multimedia VP", "HR VP", "TD Team Leader", "OD Team Leader", "L&D Team Leader"].includes(user.Position?.Name) || user.isAdmin){ %>
                        <li class="nav-item">
                            <a href="/portal/applicants/all" class="nav-link">
                                <i class="fas fa-users nav-icon"></i>
                                <p>Applications</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/portal/applicants/bydate/" class="nav-link">
                                <i class="fas fa-user-tie nav-icon"></i>
                                <p>Today's Interviews</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/portal/applicants/filter" class="nav-link">
                                <i class="fas fa-users-slash nav-icon"></i>
                                <p>Unfiltered</p>
                            </a>
                        </li>
                        <% } %>
                    </ul>
                </li>
                <%}%>
                <li class="nav-item has-treeview">
                    <a href="#" class="nav-link">
                        <i class="nav-icon fas fa-user-shield"></i>
                        <p>
                            Members
                            <i class="right fas fa-angle-left"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="/portal/members/kpi" class="nav-link">
                                <i class="nav-icon fas fa-users"></i>
                                <p>
                                    KPI
                                </p>
                            </a>
                        </li>
                    </ul>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="/portal/members/ranking" class="nav-link">
                                <i class="nav-icon fas fa-medal"></i>
                                <p>
                                    Ranking
                                </p>
                            </a>
                        </li>
                    </ul>
                    <% if(["Admin", "President", "HR VP", "TD Team Leader"].includes(user.Position?.Name) || user.isAdmin){ %>
                        <ul class="nav nav-treeview">
                            <li class="nav-item">
                                <a href="/portal/reps" class="nav-link">
                                    <i class="nav-icon fas fa-user-tie"></i>
                                    <p>
                                        Manage Reps
                                    </p>
                                </a>
                            </li>
                        </ul>
                    <% } %>
                </li>
                <% if(!user.Position?.Name.includes("Member") && !user.Position?.Name.includes("member")){ %>
                    <li class="nav-item">
                        <a href="/portal/messages" class="nav-link">
                            <i class="fas fa-envelope nav-icon"></i>
                            <p>Messages</p>
                        </a>
                    </li>
                <% } %>
                <li class="nav-item">
                    <a href="/auth/logout" class="nav-link">
                        <i style="color: #bf0a0a" class="fas fa-user-alt-slash nav-icon"></i>
                        <p>Logout</p>
                    </a>
                </li>

            </ul>
        </nav>
        <!-- /.sidebar-menu -->
    </div>
</aside>