Edit form, pt. 2
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
|
||||
<div class="row form-group">
|
||||
<label for="amountInput">Betrag</label>
|
||||
<input id="amountInput"
|
||||
<input id="amountInput"
|
||||
name="amount"
|
||||
ng-model='transaction.amount'
|
||||
type='text'
|
||||
required
|
||||
@@ -106,22 +107,70 @@
|
||||
|
||||
<!-- Template for UI Bootstrap modal, see https://angular-ui.github.io/bootstrap/#/modal -->
|
||||
<script type="text/ng-template" id="detailsTemplate.html">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">I'm a modal!</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ul>
|
||||
<li ng-repeat="item in items">
|
||||
<a href="#" ng-click="$event.preventDefault(); selected.item = item">{{ item }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
Selected: <b>{{ selected.item }}</b>
|
||||
<pre style="font-size: 75%; color: darkgray;">{{transaction | json}}</pre>
|
||||
<form name="detailsForm" style="padding:2ex;">
|
||||
|
||||
<div class="row form-group">
|
||||
<label for="amountInput">Betrag</label>
|
||||
<input id="amountInput"
|
||||
name="amount"
|
||||
ng-model='transaction.amount'
|
||||
type='text'
|
||||
required
|
||||
autocomplete="off"
|
||||
autofocus="autofocus"
|
||||
ng-pattern="/^[+-]?(?:\d+(?:[\.,]\d{0,2})?|[\.,]\d{1,2})$/"
|
||||
class="form-control" />
|
||||
<span ng-show="detailsForm.amount.$error.pattern"><br/>The value is not valid!</span>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<label for="categorySelect">Kategorie</label>
|
||||
<select
|
||||
id="categorySelect"
|
||||
ng-model='transaction.category'
|
||||
size='1'
|
||||
ng-options="category.name for category in categories track by category._links.self.href"
|
||||
ng-change='checkCategory()'
|
||||
class="form-control"></select>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<label for="dateInput">Datum</label>
|
||||
<input
|
||||
id="dateInput"
|
||||
ng-model='transaction.date'
|
||||
type='date'
|
||||
placeholder="yyyy-MM-dd"
|
||||
required
|
||||
class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<label for="descriptionInput">Notiz</label>
|
||||
<input
|
||||
id="descriptionInput"
|
||||
ng-model="transaction.description"
|
||||
uib-typeahead="address for address in updateSuggestions($viewValue)"
|
||||
typeahead-loading="loadingLocations"
|
||||
class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="row form-group" ng-show="accountUsers.length > 1">
|
||||
<label for="expenseInput">Auslage</label>
|
||||
<div>
|
||||
<label class='userLabel'><input id='noCreditorRadioButton' name='expenseBy' ng-model='transaction.creditor' type='radio' value='' checked='checked' /> Keine </label>
|
||||
<label class='userLabel' ng-repeat="user in accountUsers"><input name='expenseBy' ng-model='$parent.transaction.creditor' type='radio' value="{{user._links.self.href}}" /> {{user.name}} </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" type="button" ng-click="ok()">OK</button>
|
||||
<button class="btn btn-primary" ng-disabled="detailsForm.amount.$error.pattern" type="button" ng-click="ok()">OK</button>
|
||||
<button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button>
|
||||
</div>
|
||||
<pre style="font-size: 75%; color: darkgray;">{{transaction | json}}</pre>
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user