<div class="root tags">
  <div class="filtered" ng-if="stateParams.tags">
    <p>Showing only operations with following tag{{getCurrentTags().length === 1 ? '' : 's'}}:</p>
    <span class="tag tag-color-{{tagIndexFor(tag)}}" ng-repeat="tag in getCurrentTags() track by $index">{{tag}}
      <a class="delete-tag" ui-sref="{tags: ''}">×</a>
    </span>
  </div>
  <div class="all-tags" ng-if="!stateParams.tags && getAllTags().length">
    <p>Filter operations by a tag:</p>
    <table ng-if="tagsHaveDescription()">
      <tr ng-repeat="tag in getAllTags() track by $index">
        <td>
          <a class="tag tag-color-{{tagIndexFor(tag.name)}}" ui-sref="{tags: tag.name}">{{tag.name}}</a>
        </td>
        <td>
          <p marked="tag.description"></p>
        </td>
      </tr>
    </table>
    <div ng-if="!tagsHaveDescription()">
      <a
        ng-repeat="tag in getAllTags() track by $index"
        class="tag tag-color-{{tagIndexFor(tag.name)}}"
        ui-sref="{tags: tag.name}">
          {{tag.name}}
      </a>
    </div>
  </div>
</div>
