60 lines
2.6 KiB
HTML
60 lines
2.6 KiB
HTML
|
<div class="row">
|
||
|
<div class="span12">
|
||
|
<h1>Transaction</h1>
|
||
|
<form role="form" class="form-horizontal" name="transactionForm">
|
||
|
<fieldset>
|
||
|
<legend>Add transaction</legend>
|
||
|
<div class="form-group"
|
||
|
ng-class="{error: trasactionForm.date.$invalid}">
|
||
|
<label class="col-sm-2 control-label" for="date">Date</label>
|
||
|
<div class="col-sm-10">
|
||
|
<input class="form-control" placeholder="Date"
|
||
|
type="date" name="date" ng-model="transaction.date"
|
||
|
required />
|
||
|
<span ng-show="transactionForm.date.$error.required"
|
||
|
class="help-block">
|
||
|
Required
|
||
|
</span>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="form-group"
|
||
|
ng-class="{error: trasactionForm.payee.$invalid}">
|
||
|
<label class="col-sm-2 control-label" for="payee">Payee</label>
|
||
|
<div class="col-sm-10">
|
||
|
<input class="form-control" placeholder="Payee"
|
||
|
type="text" name="payee" ng-model="transaction.payee" />
|
||
|
</div>
|
||
|
</div>
|
||
|
<h3>Postings</h3>
|
||
|
<div ng-repeat="posting in transaction.postings">
|
||
|
<div class="form-group">
|
||
|
<label class="col-sm-2 control-label" for="account">Account</label>
|
||
|
<div class="col-sm-10">
|
||
|
<input class="form-control" type="text"
|
||
|
placeholder="Account"
|
||
|
name="account" ng-model="posting.account" />
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
|
<label class="col-sm-2 control-label" for="amount">Amount</label>
|
||
|
<div class="col-sm-10">
|
||
|
<input class="form-control" type="text"
|
||
|
placeholder="Amount"
|
||
|
name="amount" ng-model="posting.amount.amount" />
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr />
|
||
|
</div>
|
||
|
<div class="form-group">
|
||
|
<div class="col-sm-offset-2 col-sm-10">
|
||
|
<button class="btn" ng-click="addPosting($event)">
|
||
|
Add posting</button>
|
||
|
<button ng-click="save()" ng-disabled="transactionForm.$invalid"
|
||
|
class="btn btn-primary">Save</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</fieldset>
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|