Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payments Modal Improvements #369

Merged
merged 1 commit into from
May 21, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions app/views/modals/paymentsModal.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-hidden="true">&times;</button>
<h4>Payments &amp; Expenses</h4>
<h4>Payments &amp; Expenses
<small>
<ng-pluralize count="registration.registrants.length" offset=2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice

when="{'0': '',
'1': '{{registration.registrants[0].firstName}} {{registration.registrants[0].lastName}}',
'2': '{{registration.registrants[0].firstName}} {{registration.registrants[0].lastName}} & {{registration.registrants[1].firstName}} {{registration.registrants[1].lastName}}',
'one': '{{registration.registrants[0].firstName}} {{registration.registrants[0].lastName}}, {{registration.registrants[1].firstName}} {{registration.registrants[1].lastName}}, & one other',
'other': '{{registration.registrants[0].firstName}} {{registration.registrants[0].lastName}}, {{registration.registrants[1].firstName}} {{registration.registrants[1].lastName}}, & {} others'}">
</ng-pluralize>
</small>
</h4>
</div>
<div class="modal-body tab-content-spacing-above">
<tabset>
Expand Down Expand Up @@ -129,16 +139,15 @@ <h4>Payments &amp; Expenses</h4>
</td>
</tr>
<tr ng-if="editPayment.id === payment.id" ng-class="{'active': $even}">
<td>{{editPayment.transactionDatetime | date:'MMM d, y h:mm a'}}</td>
<td colspan="4">
<div class="form-horizontal">
<td colspan="5">
<div class="form-horizontal col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">Amount</label>
<div class="col-sm-9">
<div ng-show="editPayment.paymentType !== 'CREDIT_CARD'">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-usd"></i></span>
<input type="number" ng-model="editPayment.amount" class="form-control" step="0.01" min="0">
<input type="number" ng-model="editPayment.amount" class="form-control" step="1" min="0">
</div>
</div>
<div ng-show="editPayment.paymentType === 'CREDIT_CARD'">
Expand Down Expand Up @@ -305,29 +314,23 @@ <h4>Refund Payment</h4>
<tbody ng-repeat="expense in registration.expenses | orderBy:'createdTimestamp'">
<tr>
<td>{{expense.createdTimestamp | date:'MMM d, y h:mm a'}}</td>
<td>{{expense.amount | moneyFormat}}</td>
<td>{{expense.description}}</td>
<td>
<div ng-show="editExpense.id !== expense.id">
<button ng-click="openEditExpenseRow(expense)" title="Edit Expense" class="btn btn-xs"><i class="fa fa-edit"></i></button>
<button ng-click="removeExpense(expense)" title="Delete Expense" class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i></button>
</div>

<button ng-click="openEditExpenseRow(expense)" ng-show="editExpense.id === expense.id" class="btn btn-xs"><i class="fa fa-times"></i> Close</button>
</td>
</tr>
<tr ng-if="editExpense.id === expense.id" ng-class="{'active': $even}">
<td>
{{expense.createdTimestamp | date:'MMM d, y h:mm a'}}
</td>
<td>
<input type="number" ng-model="editExpense.amount" class="form-control" step="0.01" min="0">
<span ng-if="editExpense.id !== expense.id">{{expense.amount | moneyFormat}}</span>
<input ng-if="editExpense.id === expense.id" type="number" ng-model="editExpense.amount" class="form-control" step="1">
</td>
<td>
<input type="text" ng-model="editExpense.description" class="form-control">
<span ng-if="editExpense.id !== expense.id">{{expense.description}}</span>
<input ng-if="editExpense.id === expense.id" type="text" ng-model="editExpense.description" class="form-control">
</td>
<td>
<button class="btn btn-success" ng-click="saveExpenseEdits(editExpense)">Save</button>
<div ng-if="editExpense.id !== expense.id">
<button ng-click="openEditExpenseRow(expense)" title="Edit Expense" class="btn btn-xs"><i class="fa fa-edit"></i></button>
<button ng-click="removeExpense(expense)" title="Delete Expense" class="btn btn-xs btn-danger"><i class="fa fa-trash-o"></i></button>
</div>
<div ng-if="editExpense.id === expense.id">
<button class="btn btn-xs" ng-click="openEditExpenseRow(expense)"><i class="fa fa-times"></i></button>
<button class="btn btn-xs btn-success" ng-click="saveExpenseEdits(editExpense)"><i class="fa fa-check"></i></button>
</div>
</td>
</tr>
</tbody>
Expand Down