<div class="content-wrapper" ng-if="!myAccess.heroTimeline">
    <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-warning alert-dismissible">
                    <h5><i class="icon fas fa-ban"></i> Warning!</h5>
                    Unauthorised Access.
                </div>
            </div>
        </div>
    </div>
</div>
<div class="content-wrapper modal-demo" ng-if="myAccess.heroTimeline">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-warning">
                        <go-back/>
                        <i class="fas fa-user"></i> Hero Timeline
                    </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/dashboard">Home</a></li>
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/hero/project/timeline/{{gUser.id}}">Hero Timeline</a></li>
                    </ol>
                </div>
            </div>
        </div>
    </section>
    <section class="content">
        <div class="row mb-4">
            <div class="pull-center col-sm-12 col-md-8 col-md-offset-2 d-md-inline-flex">
                <ui-select id="employee" ng-model="param.employeeid" theme="bootstrap" title="Select a Hero" class="col-sm-12 col-md-9 border-left-0">
                    <ui-select-match placeholder="Select or search a Hero in the list...">{{$select.selected.name}}</ui-select-match>
                    <ui-select-choices repeat="e.id as e in employee | filter: $select.search">
                        <span ng-bind-html="e.name | highlight: $select.search"></span>
                    </ui-select-choices>
                </ui-select>
                <a ng-if="param.employeeid" href="/heroes/view/{{param.employeeid}}" target="_blank" class="btn btn-success col-sm-12 col-md-3"><i class="fas fa-external-link-alt"></i> Hero View</a>
            </div>
        </div>
    </section>
    <section class="content" ng-if="projectsearlier.length>0">
        <div class="row ">
            <div class="col-md-11 col-sm-12 pull-center p-0">
                <div class="graph-ui mb-4 bg-white">
                    <div class="graph-ui-caption text-center mb-3"><strong>Project Timeline Graph</strong></div>
                    <div id="projTimelineGraph"></div>
                </div>
            </div>
        </div>
    </section>
    <section class="content" ng-if="projectsearlier.length>0">
        <div class="row">
            <div data-info="My Tags" class="col-md-12">
                <div class="card card-outline card-warning">
                    <div class="card-header border-transparent">
                        <h3 class="card-title"><strong>Hero Timeline</strong></h3>
                        <div class="card-tools">
                            <div class="btn-group">
                                <button type="button" title="Fullscreen Toggle" class="btn btn-dark toggle-fullscreen"><i class="fas fa-expand"></i></button>
                                <button type="button" class="btn btn-dark" data-widget="collapse"><i class="fas fa-minus"></i></button>
                            </div>
                        </div>
                    </div>
                    <div class="card-body p-0">
                        <div class="col-md-12">
                            <ul class="timeline">
                                <li ng-repeat="project in projectsearlier" data-date="{{project.new}}" class="{{project.new ? 'time-label' : ''}}">
                                    <span ng-if="project.new" class="bg-success nowrap" ng-bind="formatDate(project.fromDate) | date:'dd MMM yyyy'"></span>
                                    <i class="fas pf-char bg-green {{project.char}}" data-char-content="{{project.char}}" ng-if="!project.new"></i>
                                    <div class="timeline-item" ng-if="!project.new">
                                        <h3 class="timeline-header no-border">
                                            <a target="_blank" href="{{'accounts/view/'+project.accountid}}">{{project.acc_company_name}}</a> :
                                            <a target="_blank" ng-href="{{'/projects/view/'+project.projectid}}">{{project.proj_name}}</a>|
                                            <a target="_blank" ng-href="{{'/heroes/view/'+project.projmgr.employeeid}}">{{project.projmgr.emp_first_name}}</a>

                                            <span class="btn btn-group pull-right">
                                                <span class="btn badge bg-danger nowrap" ng-bind="project.toDate ? formatDate(project.toDate) : formatDate(project.fromDate) | date:'dd MMM yyyy'" ng-if="!project.isOngoing"></span>
                                                <span class="btn badge bg-success nowrap" ng-bind="'On Going'" ng-if="project.isOngoing"></span>
                                                <span class="btn badge bg-success" title="Billing Hours"><i class="fas fa-clock"></i> {{project.billableHours}} </span>
                                                <span class="btn badge bg-warning" title="Allocation Hours"><i class="fas fa-clock"></i> {{project.partialHours}} </span>
                                            </span>
                                        </h3>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
