<h1 ng-if="item.id" translate>Edit agenda item</h1>
<h1 ng-if="!item.id" translate>New agenda item</h1>

<div id="submenu">
  <a ui-sref="agenda.item.list" class="btn btn-sm btn-default">
    <i class="fa fa-angle-double-left fa-lg"></i>
    <translate>Back to overview</translate>
  </a>
</div>

<form name="agendaItemForm">
  <div class="form-group">
    <label for="inputNumber" translate>Number</label>
    <input type="text" ng-model="item.item_number" class="form-control" name="inputNumber">
  </div>
  <div class="form-group">
    <label for="inputTitle" translate>Title</label>
    <input type="text" ng-model="item.title" class="form-control" name="inputTitle" required>
  </div>
  <div class="form-group">
    <label for="textareaDesciption" translate>Text</label>
    <textarea ng-model="item.text" class="form-control" name="textareaText" />
  </div>
  <div class="form-group">
    <label for="textareaComment" translate>Comment</label>
    <textarea ng-model="item.comment" class="form-control" name="textareaComment" />
  </div>
  <div class="form-group">
    <label for="inputDuration" translate>Duration</label>
    <input type="text" ng-model="item.duration" class="form-control" name="inputDuration">
  </div>
  <div class="form-group">
    <label for="selectType" translate>Type</label>
    <select ng-options="type.value as type.display_name for type in types"
        ng-model="item.type" class="form-control" name="selectType">
    </select>
  </div>
  <div class="form-group">
    <label for="selectTags" translate>Tags</label>
    <!-- TODO: get types automatically, provide multiple select field -->
    <select ng-options="" ng-model="item.tags" class="form-control" name="selectTags">
    </select>
  </div>

  <button type="submit" ng-click="save(item)" class="btn btn-primary" translate>
    Save
  </button>
  <button ui-sref="agenda.item.list" class="btn btn-default" translate>
    Cancel
  </button>
</form>
