<div id="featureattachement_div">
  <div class="feature-attachment-list">
    <div ng-show="currentPageData.length==0" class="text-center">
      <div class="alert">
        <p>
          <translate>featureattachment.empty</translate>
        </p>
        <p ng-if="!cannotModify">
          <translate>featureattachment.do_browse</translate>
        </p>
      </div>
    </div>
    <table
      ng-show="currentPageData.length>0"
      ng-table="tableParams"
      show-filter="false"
      class="table ng-table-responsive ng-table-attachmnt"
    >
      <tr
        ng-repeat="featureAttachment in currentPageData track by $index"
        ng-class=""
      >
        <td
          width="20"
          style="text-align: left"
          header="'ng-table/headers/checkbox.html'"
        >
          <input
            type="checkbox"
            ng-change="onCheckboxChange(feature.id, featureAttachment, checkboxes.items[featureAttachment])"
            ng-model="checkboxes.items[featureAttachment]"
            ng-disabled="cannotModify"
          />
        </td>
        <td data-title="'featureattachment.name' | translate">
          {{getNameFileWithoutSignetAndExtension(featureAttachment);}}
        </td>
        <td
          ng-show="showExtraInformations == true"
          data-title="'featureattachment.creation_date' | translate"
        >
          {{extraInformations[featureAttachment].creation}}
        </td>
        <td data-title="'featureattachment.actions' | translate">
          <button ng-show = "showPhotoOnly" 
             class="btn btn-default btn-xs"  
             ng-click="editPhotoName(featureAttachment)" 
             title="{{'featureattachment.renameFile' | translate}}">
            <span class="fa fa-edit"></span>
          </button>

          <button ng-show = "showPhotoOnly" 
          class="btn btn-default btn-xs"  
          ng-click="getFeederKey(featureAttachment)" 
          title="Étiquettes">
         <span class="fa fa-eye"></span>
       </button>
          <button
            type="button"
            title="{{'featureattachment.download' | translate}}"
            ng-show="!ancAppAndroid"
            ng-click="downloadAttachment(featureAttachment)"
            class="btn btn-default btn-xs visibleTournee"
            aria-label="Left Align"
            ng-disabled="!feature.id"
          >
            <span class="glyphicon glyphicon-download"></span>
          </button>
          <button
            type="button"
            title="{{'featureattachment.download' | translate}}"
            ng-show="ancAppAndroid"
            ng-click="showAttachment(featureAttachment)"
            class="btn btn-default btn-xs"
            aria-label="Left Align"
            ng-disabled="!feature.id"
          >
            <span class="glyphicon glyphicon-eye-open"></span>
          </button>

          <button
            type="button"
            title="{{'featureattachment.delete' | translate}}"
            ng-click="deleteAttachment(featureAttachment)"
            class="btn btn-default btn-xs"
            aria-label="Left Align"
            ng-disabled="disabledButtonRemoveAttachement()"
          >
            <span class="glyphicon glyphicon-remove"></span>
          </button>
        </td>
      </tr>
    </table>
  </div>
  <div class="row">
    <div class="col-xs-12 text-right">
      <div
        class="btn btn-default"
        ng-if="(isAdmin || isAttachedFileManagerAutorized || hasWriteRightsOnComponent)
         && amountChecked>0 && currentPageData.length>1"
        ng-click="deleteSelectedAttachments()"
        ng-disabled="cannotModify"
      >
        <i class="fa fa-remove">
          <translate>featureattachment.deleteselected</translate>
        </i>
      </div>
    </div>
  </div>
<!--  <div-->
<!--    class="row {{ ancAppAndroid || isMobileBrowser ? 'featureAttachmentButtonsMobile' : 'featureAttachmentButtons' }}"-->
<!--  >-->
  <div class="row">
    <div class="col-xs-12" ng-show="!cannotModify">
      <hr />
      <div class="row fileToLoad" ng-show="lastFile">
        <div
          class="col-xs-7"
          ng-repeat="f in renamedFilesToDisplay track by $index"
        >
          <span> {{f.name}},</span>
          <!--{{ lastFile.name }} -->
        </div>
        <div class="col-xs-5 text-center">
          <div
            class="btn btn-danger btn-xs pull-right"
            title="{{'featureattachment.canceladd' | translate}}"
            ng-disabled="wait"
            ng-click="cancelAttachmentUpload()"
          >
            <i class="fa fa-times"></i>
          </div>
          <div
            class="btn btn-default btn-xs pull-right"
            title="{{'featureattachment.addfta' | translate}}"
            ng-disabled="wait"
            ng-click="uploadAttachements()"
          >
            <i class="fa fa-upload"></i>
            <translate>common.upload</translate>
          </div>
        </div>
      </div>
      <div
        class="row sprow text-{{ ancAppAndroid || isMobileBrowser ? 'right' : 'right' }}"
      >
        <div class="col-xs-12">
          <div
            class="btn btn-default btn-file"
            ng-show="!ancAppAndroid &&
            (isAdmin || isAttachedFileManagerAutorized || hasWriteRightsOnComponent)"
          >
            <span ng-if="isMobileBrowser">
              <i class="fa fa-camera"></i> <i class="fa fa-folder-open-o"></i>
              <translate>common.browseOrTakePicture</translate>
            </span>
            <span ng-if="!isMobileBrowser">
              <i class="fa fa-folder-open-o"></i>
              <translate>common.browse</translate>
            </span>
            <input
              type="file"
              id="file"
              multiple
              name="file"
              onchange="angular.element(this).scope().initFile(this)"
            />
          </div>
          <div
            class="btn btn-default btn-file"
            ng-click="getPicture()"
            ng-show="ancAppAndroid"
          >
            <i class="fa fa-camera"></i>
          </div>
          <div
            class="btn btn-default btn-file"
            ng-click="browseDisk()"
            ng-show="ancAppAndroid"
          >
            <i class="fa fa-folder-open-o"></i>
          </div>
        </div>
      </div>
    </div>
  </div>

  <script type="text/ng-template" id="ng-table/headers/checkbox.html">
    <input ng-show="currentPageData.length>1" type="checkbox" ng-model="checkboxes.checked" id="select_all" name="filter-checkbox" value=""
           ng-change="changeAllCheckboxes(checkboxes.checked)"/>
  </script>
</div>
