<div class="content-wrapper" ng-if="gUser.emp_first_name === 'Admin'">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6 offset-sm-1 offset-md-2 offset-lg-3 mt-5">
                <div class="alert alert-danger alert-dismissible">
                    <h5><i class="icon fas fa-ban"></i> Alert!</h5>
                    Please login as Hero.
                </div>
            </div>
        </div>
    </div>
</div>
<div class="content-wrapper" ng-if="gUser.emp_first_name !== 'Admin'">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-primary">
                        <go-back/>
                        <i class="fas fa-tachometer-alt"></i> {{page.title}}
                    </h1>
                </div>
                <div class="col-sm-6">
                </div>
            </div>
        </div>
    </section>
    <section class="container-fluid">
        <div class="card card-primary card-outline">
            <div class="card-body p-0">
                <div class="card bg-light" ng-repeat="schedule in assessmentSchedules">
                    <div class="card-header p-0 pointer">
                        <div class="row">
                            <div class="bg-info col p-2 ml-2"> Assessment: <strong> {{schedule.ae_name}} </strong><span title="Project Manager" ng-if="opts.tab!=='mngr'"> </span></div>
                            <div class="bg-info col"><i class="m-2 fas pull-right {{schedule.open ? 'fa-chevron-up':'fa-chevron-down'}}"></i></div>
                        </div>
                    </div>
                    <div class="card-body pt-0 pb-0">
                        <div class="table table-responsive">
                            <table id="assessmentDashboard" class="table table-bordered table-striped table-sm">
                                <thead class="bg-primary">
                                <tr>
                                    <th><i class="fas fa-list-alt"></i> Project</th>
                                    <th><i class="fas fa-user"></i> Hero</th>
                                    <th><i class="fas fa-user"></i> Assessment</th>
                                    <th><i class="fas fa-user-secret"></i> Your Reply</th>
                                    <th><i class="fas fa-cog"></i> Action</th>
                                </tr>
                                </thead>
                                <tbody>
                                    <tr ng-if="schedule.data.length == 0">
                                        <td colspan="8" class="text-center">No data available in table.</td>
                                    </tr>                                    
                                    <tr ng-repeat="d in schedule.data track by $index">
                                        <td>
                                            <!-- {{ d.as_ae_id  + ' ' + schedule.ae_id  + schedule.as_ae_id }} -->
                                            <span class="text-wrap text-blue pointer" ng-click="goToSelf('projectView',{projectid:d.proj_id})">{{d.proj_name}}</span>
                                        </td>
                                        <td class="text-center">
                                            <span class="text-blue pointer" ng-click="goToSelf('heroView',{employeeid:d.emp_id})">{{d.emp_first_name + ' ' + d.emp_last_name}}</span>
                                        </td>
                                        <td class="text-center"><span class="text-wrap badge {{d.as_status ? (d.as_status === 'draft' ? 'badge-warning' : 'badge-success') : 'badge-danger'}}">
                                    {{(d.as_status ? (d.as_status) === 'draft' ? 'Partial Submited' : 'Submited' : 'Not Submitted')}}</span></td>
                                        <td class="text-center"><span class="text-wrap badge {{d.as_manager_status ? (d.as_manager_status === 'draft' ? 'badge-warning' : 'badge-success') : 'badge-danger'}}">
                                    {{(d.as_manager_status ? (d.as_manager_status) === 'draft' ? 'Partial Replied' : 'Replied' : 'Not Replied')}}</span></td>
                                        <td class="text-center">
                                            <a href="/assessment/manager/reply/{{d.proj_id}}/{{d.emp_id}}/{{d.as_ae_id}}" ng-if="d.as_status === 'active' && d.as_manager_status !=='active'" class="btn btn-success btn-xs"><i class="fas fa-reply"></i> Reply</a>
                                            <a href="/assessment/manager/reply/{{d.proj_id}}/{{d.emp_id}}/{{d.as_ae_id}}" ng-if="d.as_status === 'active' && d.as_manager_status =='active'" class="btn btn-success btn-xs"><i class="fas fa-eye"></i> View</a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>