Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-group"></i>Clients<b class="caret"></b></a>
<ul class="dropdown-menu" id="swatch-menu">
<li><a href="#/clients">Clients</a></li>
<li><a href="#">Groups</a></li>
<li><a href="#">Centers</a></li>
<li><a href="#/groups">Groups</a></li>
<li><a href="#/centers">Centers</a></li>
</ul>
</li>
<li><a id="swatch-link" href="#"><i class="icon-money"></i>Accounting</a></li>
Expand Down
9 changes: 6 additions & 3 deletions app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives',
$routeProvider.when('/home', {templateUrl: 'partials/home.html', controller: 'HomeCtrl'});
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: 'MyCtrl1'});

$routeProvider.when('/clients', {templateUrl: 'partials/clients.html', controller: 'ClientCtrl'});
$routeProvider.when('/createclient', {templateUrl: 'partials/createClient.html', controller: 'CreateClientCtrl'});
$routeProvider.when('/viewclient/:id', {templateUrl: 'partials/viewClient.html', controller: 'ViewClientCtrl'});
$routeProvider.when('/clients', {templateUrl: 'partials/clients/clients.html', controller: 'ClientCtrl'});
$routeProvider.when('/createclient', {templateUrl: 'partials/clients/createClient.html', controller: 'CreateClientCtrl'});
$routeProvider.when('/viewclient/:id', {templateUrl: 'partials/clients/viewClient.html', controller: 'ViewClientCtrl'});
$routeProvider.when('/loanproducts', {templateUrl: 'partials/products/loanproduct.html', controller: 'LoanProductCtrl'});
$routeProvider.when('/savingproducts', {templateUrl: 'partials/products/savingproduct.html', controller: 'SavingProductCtrl'});
$routeProvider.when('/charges', {templateUrl: 'partials/products/charges.html', controller: 'ChargesCtrl'});
$routeProvider.when('/viewcharge/:id', {templateUrl: 'partials/products/viewcharges.html', controller: 'ViewChargeCtrl'});
$routeProvider.when('/tasks', {templateUrl: 'partials/tasks.html', controller: 'TaskCtrl'});
$routeProvider.when('/groups', {templateUrl: 'partials/clients/groups.html', controller: 'GroupCtrl'});
$routeProvider.when('/viewgroup/:id', {templateUrl: 'partials/clients/viewGroup.html', controller: 'ViewGroupCtrl'});
$routeProvider.when('/centers', {templateUrl: 'partials/clients/centers.html', controller: 'CenterCtrl'});

$routeProvider.when('/search/:query', {templateUrl: 'partials/search/glresults.html', controller: 'SearchCtrl'});
$routeProvider.when('/organization', {templateUrl: 'partials/admin/organization.html', controller: 'OrganizationCtrl'});
Expand Down
33 changes: 31 additions & 2 deletions app/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,34 @@ angular.module('myApp.controllers', []).
Loans.get(function(data){
$scope.loans = data.pageItems;
});
});

})
.controller('GroupCtrl', function($scope , $http , Paginator) {

var fetchFunction = function(offset, limit, callback) {
$http.get('https://demo.openmf.org/mifosng-provider/api/v1/groups',
{params: {offset: offset, limit: limit}})
.success(callback);
};
$scope.searchPaginator = Paginator(fetchFunction, 4);
})
.controller('ViewGroupCtrl', function($scope , $routeParams , Groups , GroupLoans, GroupNotes) {
$scope.group = Groups.get({id: $routeParams.id});

GroupLoans.get({id: $routeParams.id}, function(data) {
$scope.pendingApprovalLoans = data.pendingApprovalLoans;
$scope.openLoans = data.openLoans;
$scope.awaitingDisbursalLoans = data.awaitingDisbursalLoans;
$scope.closedLoans = data.closedLoans;
});

$scope.groupNotes = GroupNotes.search({id: $routeParams.id});
})
.controller('CenterCtrl', function($scope , $http , Paginator) {

var fetchFunction = function(offset, limit, callback) {
$http.get('https://demo.openmf.org/mifosng-provider/api/v1/centers',
{params: {offset: offset, limit: limit}})
.success(callback);
};
$scope.searchPaginator = Paginator(fetchFunction, 4);
});
20 changes: 18 additions & 2 deletions app/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,21 @@ angular.module('myApp.services', [])
.factory('Loans', function($resource)
{
return $resource('https://demo.openmf.org/mifosng-provider/api/v1/loans');
});

})
.factory('Groups', function($resource)
{
return $resource('https://demo.openmf.org/mifosng-provider/api/v1/groups/:id?associations=all',{ id: '@id' });
})
.factory('GroupLoans', function($resource)
{
return $resource('https://demo.openmf.org/mifosng-provider/api/v1/groups/:id/loans',{ id: '@id' });
})
.factory('GroupNotes', function($resource)
{
return $resource('https://demo.openmf.org/mifosng-provider/api/v1/groups/:id/notes',{ id: '@id' }, {
search: {
method: 'GET',
isArray:true
}
});
})
30 changes: 30 additions & 0 deletions app/partials/clients/centers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="row alert-block span" >
<input ng-model="filterText" type="text" class="form-control" placeholder="Filter by name/office">
<div class="span4 pull-right">
<a href="#/createcenters" class="btn btn-primary"><i class="icon-plus icon-white"></i> Create Center</a>
</div>
</div>

<div class="row alert-block span">
<table class="table" ui:sortable>
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Office</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="centers in searchPaginator.currentPageItems | filter:filterText">
<td><a href="#/viewcenters/{{centers.id}}">{{centers.name}}</a></td>
<td>{{centers.status.value}}</td>
<td>{{centers.officeName}}</td>
</tr>
</tbody>
</table>
<ul class="pager">
<li class="previous"><a ng-click="searchPaginator.previous()" href="" ng-disabled="!searchPaginator.hasPrevious()">&larr; Prev</a></li>
<li class="next" ><a ng-click="searchPaginator.next()" href="" ng-disabled="!searchPaginator.hasNext()">Next &rarr;</a></li>
</ul>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<tr ng-repeat="client in searchPaginator.currentPageItems | filter:filterText">
<td><a href="#/viewclient/{{client.id}}">{{client.displayName}}</a></td>
<td><a href="#/viewclient/{{client.id}}">{{client.accountNo}}</a></td>
<td>{{client.officeName}}</td>
<td>{{client.staffName}}</td>
<td>{{client.officeName}}</td>
</tr>
</tbody>
</table>
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions app/partials/clients/groups.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="row alert-block span" >
<input ng-model="filterText" type="text" class="form-control" placeholder="Filter by name/office">
<div class="span4 pull-right">
<a href="#/creategroup" class="btn btn-primary"><i class="icon-plus icon-white"></i> Create Group</a>
</div>
</div>

<div class="row alert-block span">
<table class="table" ui:sortable>
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th>Office</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="group in searchPaginator.currentPageItems | filter:filterText">
<td><a href="#/viewgroup/{{group.id}}">{{group.name}}</a></td>
<td>{{group.status.value}}</td>
<td>{{group.officeName}}</td>
</tr>
</tbody>
</table>
<ul class="pager">
<li class="previous"><a ng-click="searchPaginator.previous()" href="" ng-disabled="!searchPaginator.hasPrevious()">&larr; Prev</a></li>
<li class="next" ><a ng-click="searchPaginator.next()" href="" ng-disabled="!searchPaginator.hasNext()">Next &rarr;</a></li>
</ul>

</div>
File renamed without changes.
73 changes: 73 additions & 0 deletions app/partials/clients/viewGroup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<div>
<div class="row paddedtop">
<div class="pull-right">
<div class="btn-group">
<a href="#" class="btn btn-primary"><i class="icon-edit icon-white"></i> Edit Group</a>
<a href="#" class="btn btn-primary"><i class="icon-plus icon-white"></i> New Loan</a>
<a href="#" class="btn btn-primary"><i class="icon-edit icon-white"></i> Associate Clients</a>
<a href="#" class="btn btn-primary"><i class="icon-edit icon-white"></i> Attach Meeting</a>
<a href="#" class="btn btn-primary"><i class="icon-list-ul icon-white"></i> Add Note</a>
</div>
</div>
</div>
<div class="row">
<div class="paddedleft"><span class="pull-left"><span class="pull-left badge badge-warning ">{{group.status.value}}</span>&nbsp;<h3>{{group.name}}</h3></span></div>
</div>
<div class="row paddedleft">
<hr/>
<tabset >
<tab heading="Accounts">
<div>
<p>
<b>Loan Accounts Overview</b>
</p>
<table class="table condensed-table">
<thead>
<tr>
<th>Product</th>
<th>Account No</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="grouploanpending in pendingApprovalLoans">
<td>{{grouploanpending.productName}}</td>
<td><a href="#">{{grouploanpending.accountNo}}</a></td>
<td>pending</td>
</tr>
<tr ng-repeat="grouploanawaitingdisbursal in awaitingDisbursalLoans">
<td>{{grouploanawaitingdisbursal.productName}}</td>
<td><a href="#">{{grouploanawaitingdisbursal.accountNo}}</a></td>
<td>awaiting disbural</td>
</tr>
<tr ng-repeat="grouploanopen in openLoans">
<td>{{grouploanopen.productName}}</td>
<td><a href="#">{{grouploanopen.accountNo}}</a></td>
<td>active</td>
</tr>
<tr ng-repeat="closedloan in closedLoans">
<td>{{closedloan.productName}}</td>
<td><a href="#">{{closedloan.accountNo}}</a></td>
<td>closed</td>
</tr>
</tbody>
</table>
</div>
</tab>
<tab heading="Clients">Clients details</tab>
<tab heading="Summary">summary</tab>
<tab heading="Roles">Roles</tab>
<tab heading="Notes">
<div ng-repeat="groupNote in groupNotes">
<div>
<blockquote>
<p>{{groupNote.note}}</p>
<small>Created by :&nbsp;{{groupNote.createdByUsername}}</small>
<small>Created on :&nbsp;{{groupNote.createdOn}}</small>
</blockquote>
</div>
</div>
</tab>
</tabset>
</div>
</div>