<div class="form-view" ng-controller="FormViewCtrl" ui-tab-gate>
  <div class="navbar record-toolbar" ng-if="::canShowToolbar()">
    <div class="navbar-inner">
      <div class="container" ui-toolbar-adjust>
        <div class="btn-group">
          <button class="btn" ng-click="onNew()" ng-if="canNew()" title="{{ 'New' | t}}">
            <i class="fa fa-plus"></i> <span ng-if="::!tbTitleHide" x-translate>New</span>
          </button>
          <button class="btn" ng-click="onEdit()" ng-if="!isEditable() && canEdit()" title="{{ 'Edit' | t}}">
            <i class="fa fa-pencil"></i> <span ng-if="::!tbTitleHide" x-translate>Edit</span>
          </button>
          <button class="btn" ng-click="onSave()" ng-if="isEditable() && hasButton('save') && (canEdit() || canSave())"  title="{{ 'Save' | t}}">
            <i class="fa fa-floppy-o"></i> <span ng-if="::!tbTitleHide" x-translate>Save</span>
          </button>
          <button class="btn" ng-click="onCancel()" ng-if="hasButton('cancel') && canCancel()" title="{{ 'Cancel' | t}}">
            <i class="fa fa-refresh"></i> <span ng-if="::!tbTitleHide" x-translate>Cancel</span>
          </button>
          <button class="btn" ng-click="onBack()" ng-if="hasButton('back') && !canCancel()" ng-disabled="!canBack()" title="{{ 'Back' | t}}">
            <i class="fa fa-reply"></i> <span ng-if="::!tbTitleHide" x-translate>Back</span>
          </button>
          <button class="btn" ng-disabled="!canShowAttachments()" ng-click="onShowAttachments()" ng-class="{'has-attachments': record.$attachments}">
          	<i class="fa fa-paperclip"></i><sub ng-if="record.$attachments"> {{record.$attachments}}</sub>
          </button>
          <button class="btn" ng-if="hasHelp()" ng-click="onShowHelp()"><i class="fa fa-info-circle"></i></button>
        </div>
        <div ui-menu-bar x-menus="toolmenu" x-handler="this"></div>
        <div class="btn-group view-toolbar" ng-show="toolbar" style="display: none;">
          <button ng-repeat="btn in toolbar | filter:{custom: true}" ui-tool-button></button>
        </div>
        <div class="btn-group" ng-show="toolbar" style="display: none;">
          <button ng-repeat="btn in toolbar | filter:{custom: false}" ui-tool-button></button>
        </div>
        <div ui-menu-bar x-menus="menubar" x-handler="this" class="view-menubar" style="visibility: hidden;"></div>
        <div ui-menu-bar x-menus="toolbarAsMenu" x-handler="this" class="view-toolbar-mobile" style="visibility: hidden;"></div>
        <div ui-menu-bar x-menus="menubarAsMenu" x-handler="this" class="view-menubar-mobile" style="visibility: hidden;"></div>
        <div class="record-toolbar-right">
            <div ui-view-customize class="pull-right"></div>
            <div ui-view-switcher class="pull-right"></div>
            <div ui-record-pager class="pull-right"></div>
        </div>
      </div>
    </div>
  </div>
  <div ui-view-form x-handler="this" ng-class="::{'no-toolbar': !canShowToolbar() }"></div>
</div>
