<ul class="attachments">
  <!-- images -->
  <li ng-repeat="link in $ctrl.localLinks |filter:{type:'IMG'} track by $index"
      class="thumbnail-box">

    <img src="{{::link.path}}"
         enlarge-image="link.path">

    <div class="status-line">
      <md-button class="md-icon-button md-raised md-warn trash-button"
                 ng-click="$ctrl.removeLink(link)"
                 aria-label="remove link">
        <ng-md-icon icon="delete_forever"
                    size="22"></ng-md-icon>
      </md-button>

      <a external-link
         class="md-accent"
         href="{{::link.path}}"
         type="{{::link.type}}"
         target="_blank"
         tabindex="1"
         draggable="false"
         aria-label="open global link">
        <div>
          <span ng-bind="link.title"></span>
        </div>
      </a>
    </div>
  </li>

  <!-- non images -->
  <li ng-repeat="link in $ctrl.localLinks |filter:{type:'!IMG'} track by $index"
      class="normal-link">
    <a external-link
       class="md-accent"
       href="{{::link.path}}"
       type="{{::link.type}}"
       target="_blank"
       tabindex="1"
       draggable="false"
       aria-label="open global link">
      <div>
        <ng-md-icon icon="link"
                    ng-if="!link.customIcon && link.type === 'LINK'"
                    aria-label="Open link"></ng-md-icon>
        <ng-md-icon icon="short_text"
                    ng-if="!link.customIcon && link.type === 'TEXT'"
                    aria-label="Open text"></ng-md-icon>
        <ng-md-icon icon="insert_drive_file"
                    ng-if="!link.customIcon && link.type === 'FILE'"
                    aria-label="Open file"></ng-md-icon>
        <ng-md-icon icon="{{::link.customIcon}}"
                    ng-if="link.customIcon"
                    aria-label="Open"></ng-md-icon>

        <span ng-bind="link.title"></span>
      </div>
    </a>

    <md-button class="md-icon-button md-raised md-warn trash-button"
               ng-click="$ctrl.removeLink(link)"
               aria-label="remove link">
      <ng-md-icon icon="delete_forever"
                  size="22"></ng-md-icon>
    </md-button>
  </li>
</ul>