scottohara/loot

View on GitHub
src/categories/views/delete.html

Summary

Maintainability
Test Coverage
<form role="form" name="categoryForm">
    <div class="modal-header">
        <h4>Delete Category?</h4>
    </div>
    <div class="modal-body">
        <div ng-if="::vm.category.num_children" class="alert alert-danger">
            <strong>Warning!</strong>
            All subcategories will also be deleted
        </div>
        <dl class="dl-horizontal">
            <dt>Name</dt>
            <dd>{{::vm.category.name}}</dd>
            <dt ng-if="::vm.category.parent">Parent</dt>
            <dd ng-if="::vm.category.parent">{{::vm.category.parent.name}}</dd>
            <dt>Type</dt>
            <dd>{{::vm.category.direction == 'inflow' ? 'Income' : 'Expense'}}</dd>
        </dl>
    </div>
    <div class="modal-footer">
        <span ng-if="vm.errorMessage" class="text-danger">{{vm.errorMessage}}</span>
        <button class="btn btn-default" type="button" ng-click="vm.cancel()">
            Cancel
        </button>
        <button
            class="btn btn-danger"
            type="submit"
            ng-click="vm.deleteCategory()"
            autofocus
        >
            <i class="glyphicon glyphicon-remove"></i> Delete
        </button>
    </div>
</form>