<ion-view view-title="{{playlist.uri ? 'Edit playlist' : 'Create playlist' | translate}}">
  <ion-nav-bar class="bar-stable">
    <ion-nav-back-button class="button-clear" ng-click="save().then(back)">
      <i class="mopidy-mobile-icon-check"></i> {{'Save' | translate}}
    </ion-nav-back-button>
  </ion-nav-bar>
  <ion-nav-buttons side="secondary">
    <button class="mopidy-mobile-button-icon mopidy-mobile-icon-menu"
            ng-click="popover.show($event)"
            ng-controller="PlaylistEditMenuCtrl"
            >
    </button>
  </ion-nav-buttons>
  <ion-content>
    <form ng-submit="save().then(back)">
      <label class="item item-input">
        <input type="text" placeholder="{{'Name' | translate}}" ng-model="playlist.name">
      </label>
    </form>
    <ion-list show-delete="true" show-reorder="true">
      <ion-item ng-repeat="track in playlist.tracks">
        {{track.name}}
        <ion-delete-button class="ion-minus-circled" ng-click="remove($index)">
        </ion-delete-button>
        <ion-reorder-button class="ion-navicon" on-reorder="move($fromIndex, $toIndex)">
        </ion-reorder-button>
      </ion-item>
    </ion-list>
  </ion-content>
</ion-view>
