<div class="umb-dialog" style="width: 500px" ng-switch on="model.complete">
    
    <form name="sortForm" ng-submit="performSort()" ng-switch-when="false">
        <div class="umb-dialog-body" auto-scale="90">
            <p class="umb-abstract">Sort children of {{viewModel.name}}</p>

            <table class="table umb-table">
                <thead> 
                    <tr>
                    <td>Name</td>
                    <td>Last Update</td>
                    <td>Index</td>
                </thead>
                <tbody ui-sortable="sortableOptions" ng-model="model.itemsToSort">
                    <tr ng-repeat="item in model.itemsToSort">
                        <td>{{item.column1}}</td>
                        <td>{{item.column2}}</td>
                        <td>{{item.column3}}</td>
                    </tr>
                </tbody>
            </table>

        </div>
        <div class="btn-toolbar umb-btn-toolbar">
            <button type="button" class="btn" ng-click="handleCancel()">Cancel</button>
            <button type="submit" class="btn btn-primary">Sort</button>
        </div>
    </form>
    <div ng-switch-when="true">
        <div class="alert alert-success">
            {{model.successMsg}}
        </div>
        
        <div class="btn-toolbar umb-btn-toolbar">
            <button class="btn" ng-click="handleOk()">{{model.okButton}}</button>
        </div>
    </div>
</div>
