2017-04-24 11:49:18 +00:00
|
|
|
% layout 'admin';
|
|
|
|
% title 'Organisations';
|
|
|
|
% content_for javascript => begin
|
|
|
|
% end
|
|
|
|
% if ( my $error = flash 'error' ) {
|
|
|
|
<div class="alert alert-danger" role="alert">
|
|
|
|
<strong>Error!</strong> <%= $error %>
|
|
|
|
</div>
|
|
|
|
% } elsif ( my $success = flash 'success' ) {
|
|
|
|
<div class="alert alert-success" role="alert">
|
|
|
|
<strong>Success!</strong> <%= $success %>
|
|
|
|
</div>
|
|
|
|
% }
|
2017-10-24 12:31:04 +00:00
|
|
|
<div class="row mb-3">
|
2017-04-24 11:49:18 +00:00
|
|
|
<div class="col">
|
|
|
|
<div class="card">
|
|
|
|
<h3 class="card-header">
|
2017-10-23 16:44:38 +00:00
|
|
|
Organisations
|
2017-08-21 14:10:33 +00:00
|
|
|
<a href="<%= url_for . '/add' %>" class="btn btn-success" style="float: right">Add Organisation</a>
|
2017-04-24 11:49:18 +00:00
|
|
|
</h3>
|
|
|
|
<div class="list-group list-group-flush">
|
2017-10-23 16:44:38 +00:00
|
|
|
% for my $org_result ($orgs_rs->all) {
|
|
|
|
<a href="<%= url_for . '/' . $org_result->id %>" class="list-group-item list-group-item-action d-flex justify-content-between">
|
2017-04-24 11:49:18 +00:00
|
|
|
<div>
|
2017-10-23 16:44:38 +00:00
|
|
|
%= $org_result->name
|
2017-04-24 11:49:18 +00:00
|
|
|
</div>
|
|
|
|
<div>
|
2017-10-23 16:44:38 +00:00
|
|
|
% if ( $org_result->pending ) {
|
|
|
|
<span class="badge badge-warning">Unvalidated</span>
|
|
|
|
% }
|
2017-11-20 13:02:07 +00:00
|
|
|
% if ( defined $org_result->user ) {
|
|
|
|
<span class="badge badge-info">User</span>
|
|
|
|
% }
|
2017-10-24 14:23:09 +00:00
|
|
|
% if ( !defined $org_result->is_local ) {
|
|
|
|
<span class="badge badge-danger">Locality Not Set</span>
|
|
|
|
% } elsif ( $org_result->is_local ) {
|
|
|
|
<span class="badge badge-success">Local Org</span>
|
|
|
|
% } else {
|
2017-11-16 15:12:46 +00:00
|
|
|
<span class="badge badge-secondary">Non Local Org</span>
|
2017-10-24 14:23:09 +00:00
|
|
|
% }
|
2017-04-24 11:49:18 +00:00
|
|
|
</div>
|
|
|
|
</a>
|
2017-10-23 16:44:38 +00:00
|
|
|
% }
|
2017-04-24 11:49:18 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-10-24 12:31:04 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
%= bootstrap_pagination( $c->param('page') || 1, $orgs_rs->pager->last_page, { class => 'justify-content-center' } );
|
|
|
|
</div>
|
|
|
|
</div>
|