<ion-view view-title="{{'Name' | translate}}">
    <ion-nav-bar class="bar-stable no-blink">
        <ion-nav-buttons side="left">
            <a class="button icon-left ion-chevron-left button-clear button-dark ng-hide" on-tap="backToEdit(false)" ng-hide="editing" ng-class="{hidden : editing}">{{'GoBack' | translate}}</a>
            <a class="button button-clear button-dark ng-hide" on-tap="backToEdit(false)" ng-show="editing">{{'Abort' | translate}}</a>
        </ion-nav-buttons>
        <ion-nav-buttons side="right">
            <a class="button button-clear button-dark ng-hide" on-tap="backToEdit(true)" ng-show="editing">{{'save_cap' | translate}}</a>
        </ion-nav-buttons>
    </ion-nav-bar>

    <ion-header-bar class="bar-stable" ng-if="modalShown">
        <a class="button icon-left ion-chevron-left button-clear button-dark ng-hide" on-tap="backToEdit(false)" ng-hide="editing" ng-class="{hidden : editing}">{{'GoBack' | translate}}</a>
        <a class="button button-clear button-dark ng-hide" on-tap="backToEdit(false)" ng-show="editing">{{'Abort' | translate}}</a>
        <h2 class="title">{{'AddNewSwitch' | translate}}</h2>
        <a class="button button-clear button-dark ng-hide" on-tap="backToEdit(true)" ng-show="editing">{{'save_cap' | translate}}</a>
    </ion-header-bar>

    <ion-content class="has-header">
        <div class="container-fluid">
            <div class="row-bootstrap">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <label class="item item-input top-margin">
                        <input type="text" ng-model="tile.name" maxlength="50" placeholder="{{oldName || (('EnergySwitch' | translate) + (energyNameCount > 0 ? ' ' + (energyNameCount+1) : ''))}}" ng-focus="setEditing()">
                        <button ng-if="tile.name.length"
                                class="input-button button button-icon ion-close-circled"
                                on-tap="clearName()">
                        </button>
                    </label>
                </div>
            </div>
        </div>
    </ion-content>
</ion-view>