<div class="datatable-controls">
    <h2 class="sr-only" translate>Election Events</h2>
    <div class="datatable-actions">
        <div class="datatable-actions-main">
            <md-button ng-disabled="checkSelected()"
                ng-attr-title="{{getTextIsEESelected()}}"
                class="md-primary md-raised"
                aria-label="{{'Secure' || translate}}"
                id="Secure"
                ng-click="generate()">
                <md-icon md-svg-src="assets/icons/ic_security_24px.svg" aria-label="{{'Secure' | translate}}"></md-icon>
                <span class="hide-xs" translate>Secure</span>
            </md-button>
            <md-button ng-disabled="checkSelectedDownload()"
                ng-if="downloadParticipationEnabled()"
                ng-attr-title="{{getTextIsEESelected()}}"
                class="md-primary md-raised"
                aria-label="{{'Download participation' || translate}}"
                id="download_participation"
                ng-click="downloadParticipationFile()">
                <md-icon md-svg-src="assets/icons/ic_file_download_24px.svg" aria-label="{{'Download participation' | translate}}"></md-icon>
                <span class="hide-xs" translate>Download participation</span>
            </md-button>
            <span ng-if="importExportEnabled()">
                <md-button
                    ng-disabled="checkOneSelected()"
                    class="md-primary md-raised"
                    aria-label="{{'Export' || translate}}"
                    id="export"
                    ov-folder-input="input-folder-export">
                    <md-icon md-svg-src="assets/icons/ic_file_export_24px.svg" aria-label="{{'Export' | translate}}"></md-icon>
                    <span class="hide-xs" translate>Export</span>
                </md-button>
                <input 
                    class="ng-hide"
                    id="input-folder-export"
                    type="file"
                    ov-folder-input-model
                    callback="export(path)"
                    webkitdirectory nwdirectory
                />
            </span>
        </div>
    </div>
</div>

<div class="datatable-data">
    <table class="table">
        <thead>
            <tr>
                <th scope="col" class="table-batchselector"></th>
                <th scope="col" class="grow-2">
                    <span class="no-wrap" title="{{'Title'|translate}}" translate>Title</span>
                </th>
                <th scope="col">
                    <span class="no-wrap" title="{{'Alias'|translate}}" translate>Alias</span>
                </th>
                <th scope="col" class="grow-2">
                    <span class="no-wrap" title="{{'Administration Board'|translate}}" translate>Administration Board</span>
                </th>
                <th scope="col">
                    <span class="no-wrap" title="{{'Status'|translate}}" translate>Status</span>
                </th>
            </tr>
        </thead>
        <tbody>
            <tr data-ng-repeat="electionEvent in electionEvents.result">
                <td class="table-batchselector">
                    <md-checkbox id="check_{{electionEvent.id}}"
                        aria-label="{{'checkbox' | translate}}"
                        ng-model="electionEvent.chosen"
                        ng-change="uniqueChoice(electionEvents.result,electionEvent)"
                        class="md-datatable-theme md-primary">
                    </md-checkbox>
                </td>
                <td class="grow-2">
                    <md-button ng-click="goToElectionEvent(electionEvent)" ng-hide="isNotReadyToNavigate(electionEvent)" class="link">
                        {{electionEvent.defaultTitle}}
                    </md-button>
                    <span ng-show="isNotReadyToNavigate(electionEvent)">
                        {{electionEvent.defaultTitle}}
                    </span>
                </td>
                <td>{{electionEvent.alias}}</td>
                <td class="grow-2">{{getAdminBoardTitle(electionEvent.administrationAuthority.id)}}</td>
                <td>
                    <progress-bar>
                        <span class="no-wrap" title="{{capitalizeFirstLetter(electionEvent.status) | translate}}">{{capitalizeFirstLetter(electionEvent.status) | translate}}</span>
                    </progress-bar>
                </td>
            </tr>
        </tbody>
    </table>
</div>
