<ion-view view-title="消费类型设置">
    <ion-nav-buttons side="right">
        <button class="button button-clear" ng-click="ok()">{{ordering ?'完成':'排序'}}</button>
    </ion-nav-buttons>
    <ion-content>
        <ion-refresher ng-if="!ordering" pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
        <div ng-if="loading" class="center init-load action-sheet-backdrop">
            <ion-spinner icon="android"></ion-spinner>
        </div>
        <ion-list ng-if="!loading" show-reorder="ordering" can-swipe="true" class="typelist">
            <ion-item class="item item-icon-left" ng-repeat="type in types" ng-click="toedittype(type)">
                <i class="icon" ng-class="type.icon" style="color:{{type.icon_color}}"></i>
                <h2>{{type.name}}<i class="ion-edit ion-ios-compose-outline positive"></i></h2>
                <ion-reorder-button class="ion-navicon" on-reorder="reorderItem(type, $fromIndex, $toIndex)">
                </ion-reorder-button>
            </ion-item>
        </ion-list>
    </ion-content>
    <div class="calm bar bar-footer footer" ng-click="toaddtype();">
        <div class="title">添加消费类型&nbsp;<i class="ion-plus"></i></div>
    </div>
</ion-view>