<navigation></navigation>

<div class="container">
    <icon></icon>
    <page-header content="vm.pageHeader"></page-header>
    <div class="row">
        <div class="col-xs-12 col-md-7">
            <div class="row">
                <div class="col-xs-12 col-md-7">
                    <div role="alert" ng-show="vm.message" class="alert alert-info">{{ vm.message }}</div>
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h1 align="center" class="panel-title">All sessions <a ng-if="vm.isLoggedIn"href="/myschedule/">| My schedule</a>
                            </h1>
                        </div>
                        <div class="panel-body" ng-repeat="session in vm.data.sessions | orderBy: 'startTime'">
                            <div class="row">
                                <p>
                                    <div class="col-xs-12"><span class="glyphicon glyphicon-calendar"></span>
                                        <a ng-href="/schedule/{{ session._id }}">{{ session.name }}</a>
                                </p>
                                    
                                <div ng-if="vm.isRegularUser" ng-click="vm.addMySession(session._id)" 
                                class="btn btn-success pull-right btn-sm">
                                    <span class="glyphicon glyphicon-plus"></span>
                                </div>

                                <p class="sessionStartTime">{{ session.startTime | date : 'longDate' }}
                                </p>
                                <p class="sessionStartTime">{{ session.startTime | date : 'h:mm a' }} - {{ session.endTime | date : 'h:mm a'
                                    }}
                                </p>
                                <p> <span class="glyphicon glyphicon-map-marker"></span> {{session.location}} </p>
                                 <div  ng-if="vm.isAdmin" ng-click="vm.addSpeakerForm(session._id)" class="btn btn-success btn-sm ">+Speaker</div>
                                <div ng-if="vm.isAdmin" ng-click="vm.delete(session._id)" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12"><a href="/conference/" class="btn btn-warning">Back to Conference</a>
                    <a ng-if="vm.isAdmin" ng-click="vm.addGeneralSessionForm()" class="btn btn-success ">Add Session</a>
                    <a ng-if="vm.isAdmin" class="btn btn-danger">Reset</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <footer-generic></footer-generic>
</div>
