<ion-view view-title="任务">
  <ion-nav-buttons side="right">
    <button ng-if="data.id != null" class="button button-icon icon ion-minus-round" ng-click="deleteTask()"></button>
  </ion-nav-buttons>
  <ion-content>
    <label class="item item-input">
      <input ng-model="data.title" type="text" placeholder="标题">
    </label>
    <label class="item item-input">
      <textarea ng-model="data.description" rows="6" placeholder="对该任务的描述"></textarea>
    </label>
    <div ng-if="data.is_completed != null" ng-class='{true:"item-balanced",false:"item-energized"}[data.is_completed]' class="item" ng-click="completed()">{{data.is_completed ? '已完成' : '标记为已完成'}}</div>
    <button ng-disabled="(data.title == null || data.title == '') && (data.description == null || data.description == '')" class="button button-block button-positive" ng-click="addTask()">提交</button>
  </ion-content>
</ion-view>
