This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/templates/admin/organisations/list.html.ep

53 lines
1.8 KiB
Text
Raw Normal View History

% 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>
% }
<div class="row mb-3">
<div class="col">
<div class="card">
<h3 class="card-header">
Organisations
<a href="<%= url_for . '/add' %>" class="btn btn-success" style="float: right" target="_blank">Add Organisation</a>
</h3>
<div class="list-group list-group-flush">
% 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" target="_blank">
<div>
%= $org_result->name
</div>
<div>
% if ( $org_result->pending ) {
<span class="badge badge-warning">Unvalidated</span>
% }
% if ( defined $org_result->user ) {
<span class="badge badge-info">User</span>
% }
% 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 {
<span class="badge badge-secondary">Non Local Org</span>
% }
</div>
</a>
% }
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
%= bootstrap_pagination( $c->param('page') || 1, $orgs_rs->pager->last_page, { class => 'justify-content-center' } );
</div>
</div>