<h1 translate>Administration - Exporting Loadfile</h1>

<div class="error" ng-if="errMessage" >{{errMessage | translate}}</div>

<div class="loadingIndicator" style="height: 200px; width: 600px;" ng-show="isProcessing" translate>Exporting lists into loadfile ({{currList}} / {{totalLists}})...</div>

<h2 translate>Lists used as Dashboard Endpoints</h2>

<table class="info-table">
    <thead>
    <tr>
        <th width="30px" style="text-align: center;"><input type="checkbox" ng-model="toggleAllValue" ng-change="toggleAll()"></th>
        <th width="100px" style="text-align: left;" translate>Endpoint</th>
        <th width="400px" style="text-align: left;" translate>SharePoint List URL</th>
        <th width="200px" style="text-align: left;" translate>Status</th>
    </tr>
    </thead>

    <tbody>
    <tr ng-repeat="l in dashboardLists">
        <td width="30px" style="text-align: center;"><input type="checkbox" ng-model="l.isSelected"></td>
        <td width="100px" style="text-align: left;">{{l.endpoint}}</td>
        <td width="400px" style="text-align: left;">{{l.listURL}}</td>
        <td width="200px" style="text-align: left;">{{l.status}}</td>
    </tr>
    </tbody>
</table>


<h2 translate>Other SharePoint Lists to be Exported</h2>


<table class="info-table">
    <thead>
    <tr>
        <th width="30px" style="text-align: center;">&nbsp;</th>
        <th width="370px" style="text-align: left;" translate>SharePoint List Title</th>
        <th width="30px" style="text-align: center;">&nbsp;</th>
        <th width="200px" style="text-align: left;" translate>Status</th>
    </tr>
    </thead>

    <tbody>
    <tr ng-repeat="l in otherLists">
        <td width="30px" style="text-align: center;"><input type="checkbox" disabled checked></td>
        <td width="370px" style="text-align: left;">{{l.listTitle}}</td>
        <td width="30px" style="text-align: center;"><i class="fa fa-trash icon-as-button" title="{{ 'Remove list from export selection' | translate }}" ng-click="removeList(l)"></i></td>
        <td width="200px" style="text-align: left;">{{l.status}}</td>
    </tr>

    <tr>
        <td width="30px" style="text-align: center;"><input type="checkbox" disabled></td>
        <td width="600px" colspan="3" style="text-align: left;"><input type="text" ng-model="newlistTitle" size="70"> <button ng-click="addList(newlistTitle)" translate>Add...</button></td>
    </tr>
    </tbody>
</table>



<h2 translate>Export</h2>

<div><button ng-click="createLoadfile()" ng-disabled="isProcessing || !hasAccess" translate>Create Loadfile</button></div>

<ul ng-if="exportLog && exportLog.length > 0">
    <li ng-repeat="log in exportLog" class="loadfile_log_{{log.type}}">{{log.entry}}</li>
</ul>
