category.model.html 3.2 KB
Newer Older
nengyuangzhang's avatar
nengyuangzhang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
<div class="inmodal">
    <div class="modal-header">
        <h4 class="modal-title">{{operation | translate}}(ID:{{category.id}})</h4>
    </div>
    <div class="modal-body">
        <form role="form" name="form_category" novalidate class="form-horizontal">
            <div class="form-group"><label class="col-sm-3 control-label">{{'SETTING.NAME' | translate}}</label>

                <div class="col-sm-9"><input ng-model="category.name" type="text" name="categoryname" class="form-control" required="">
                    <div class="m-t-xs" ng-show="form_category.categoryname.$invalid && form_category.categoryname.$dirty">
                        <small class="text-danger" ng-show="form_category.categoryname.$error.required">{{'SETTING.INPUT_NAME' | translate}}</small>
                    </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group"><label class="col-sm-3 control-label">{{'SETTING.UNIT' | translate}}</label>

                <div class="col-sm-9"><input ng-model="category.unit_of_measure" type="text" name="categoryunit" class="form-control" required="">
                <div class="m-t-xs" ng-show="form_category.categoryunit.$invalid && form_category.categoryunit.$dirty">
                        <small class="text-danger" ng-show="form_category.categoryunit.$error.required">{{'SETTING.INPUT_UNIT' | translate}}</small>
                    </div>
                </div>
            </div>
            <div class="form-group"><label class="col-sm-3 control-label">{{'SETTING.KGCE' | translate}}</label>
                <div class="col-sm-9"><input ng-model="category.kgce" type="number" name="categorykgce" class="form-control" required="">
                    <div class="m-t-xs" ng-show="form_category.categorykgce.$invalid && form_category.categorykgce.$dirty">
                        <small class="text-danger" ng-show="form_category.categorykgce.$error.required">{{'SETTING.INPUT_KGCE' | translate}}</small>
                        <small class="text-danger" ng-show="form_category.categorykgce.$error">{{'SETTING.INVALID_FORMAT' | translate}}</small>
                    </div>
                </div>
            </div>
            <div class="form-group"><label class="col-sm-3 control-label">{{'SETTING.KGCO2E' | translate}}</label>
                <div class="col-sm-9"><input ng-model="category.kgco2e" type="number" name="categorykgco2e" class="form-control" required="">
                    <div class="m-t-xs" ng-show="form_category.categorykgco2e.$invalid && form_category.categorykgco2e.$dirty">
                        <small class="text-danger" ng-show="form_category.categorykgco2e.$error.required">{{'SETTING.INPUT_KGCO2E' | translate}}</small>
                        <small class="text-danger" ng-show="form_category.categorykgco2e.$error">{{'SETTING.INVALID_FORMAT' | translate}}</small>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-white" ng-click="cancel()">{{'SETTING.CANCEL' | translate}}</button>
        <button type="button" ng-disabled="form_category.$invalid" class="btn btn-primary" ng-click="ok()">{{'SETTING.SAVE' | translate}}</button>
    </div>
</div>