Skip to content

Commit

Permalink
[#95989020] add support for displaying and saving notes
Browse files Browse the repository at this point in the history
  • Loading branch information
drKnoxy committed Jun 2, 2015
1 parent dd86485 commit 34b536d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/scripts/order/controller/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ function ($scope, $routeParams, $location, $q, $orderApiService, $dashboardUtils
// Success
if (response.error === null) {
$scope.message = $dashboardUtilsService.getMessage(null , 'success', 'Order was updated successfully');

// Update the notes list with whatever is on the server.
// we get the whole order back, so we could set the entire thing
$scope.order.note = '';
$scope.order.notes = response.result.notes || [];

for (var field in response.result) {
if (response.result.hasOwnProperty(field) && "updated_at" !== field) {
oldString[field] = response.result[field];
Expand Down
7 changes: 7 additions & 0 deletions app/themes/views/order/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ <h3 class="text-center">
</label>

<div class="clearfix"></div>

<h3>Notes</h3>
<ul ng-if="order.notes">
<li ng-repeat="note in order.notes">{{ note }}</li>
</ul>
<textarea name="newNote" id="newNote" rows="5" class="form-control" ng-model="order.note"></textarea>

<br>
<div class="text-center">
<a class="btn btn-default" href="/orders">Back to orders</a>
Expand Down

0 comments on commit 34b536d

Please sign in to comment.