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/import/list.html.ep

147 lines
5.2 KiB
Text
Raw Normal View History

2017-11-13 13:30:33 +00:00
% layout 'admin';
% title 'Import';
% 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">
<div class="col-12 col-md-6 mb-3">
<div class="card">
<h3 class="card-header">
User Assignments
</h3>
<div class="card-body">
Unique users in this Import, and their assigned entity
</div>
<div class="list-group list-group-flush">
% for my $user ( $import_users_rs->all ) {
<div class="list-group-item">
<div class="row">
<div class="col-4">
%= $user->user_name
</div>
<div class="col-4">
2017-11-15 18:22:49 +00:00
% if ( defined $import_lookup_rs->{ $user->user_name } ) {
<span class="text-muted"><%= $import_lookup_rs->{ $user->user_name }->{name} %></span>
2017-11-13 19:00:34 +00:00
% } else {
2017-11-13 13:30:33 +00:00
<span class="text-muted font-italic">Unassigned</span>
2017-11-13 19:00:34 +00:00
% }
2017-11-13 13:30:33 +00:00
</div>
<div class="col-4">
2017-11-13 19:00:34 +00:00
<a href="<%= url_for(url_for . '/user')->query([ user => $user->user_name ]) %>" class="btn btn-primary">Select</a>
2017-11-13 13:30:33 +00:00
</div>
</div>
</div>
% }
</div>
</div>
</div>
<div class="col-12 col-md-6 mb-3">
<div class="card">
<h3 class="card-header">
Org Assignments
</h3>
<div class="card-body">
Unique orgs in this Import, and their assigned entity
</div>
<div class="list-group list-group-flush">
% for my $org ( $import_org_rs->all ) {
<div class="list-group-item">
<div class="row">
<div class="col-4">
%= $org->org_name
</div>
<div class="col-4">
2017-11-15 18:22:49 +00:00
% if ( defined $import_lookup_rs->{ $org->org_name } ) {
<span class="text-muted"><%= $import_lookup_rs->{ $org->org_name }->{name} %></span>
% } else {
2017-11-13 13:30:33 +00:00
<span class="text-muted font-italic">Unassigned</span>
% }
2017-11-13 13:30:33 +00:00
</div>
<div class="col-4">
<a href="<%= url_for(url_for . '/org')->query([ org => $org->org_name ]) %>" class="btn btn-primary">Select</a>
2017-11-13 13:30:33 +00:00
</div>
</div>
</div>
% }
</div>
</div>
</div>
2017-11-15 18:22:49 +00:00
<div class="col-12 mb-3">
2017-11-13 13:30:33 +00:00
<div class="card">
<h3 class="card-header">
%= format_human_datetime $import_set->date;
<a href="<%= url_for->query({ignored => $c->param('ignored') ? 0 : 1 }) %>"
class="btn btn-primary float-right">
2017-11-15 18:22:49 +00:00
<%= $c->param('ignored') ? 'Hide' : 'Show' %> Ignored
</a>
<a href="<%= url_for->query({imported => $c->param('imported') ? 0 : 1 }) %>"
class="btn btn-secondary float-right">
<%= $c->param('imported') ? 'Hide' : 'Show' %> Imported
</a>
2017-11-15 18:22:49 +00:00
2017-11-13 13:30:33 +00:00
</h3>
<div class="card-body">
Content listed in original order of import
</div>
<div class="list-group list-group-flush">
% for my $import_value ( $import_value_rs->all ) {
2017-11-15 18:22:49 +00:00
% my $user_lookup = $import_lookup_rs->{ $import_value->user_name };
% my $purchase_lookup = parse_currency $import_value->purchase_value;
% my $org_lookup = $import_lookup_rs->{ $import_value->org_name };
2017-11-13 13:30:33 +00:00
<div class="list-group-item">
<div class="row">
<div class="col-2">
<%= $import_value->user_name %>
2017-11-15 18:22:49 +00:00
% if ( defined $user_lookup ) {
<br>
<span class="text-muted"><%= $user_lookup->{name} %></span>
% }
2017-11-13 13:30:33 +00:00
</div>
<div class="col-3">
<%= format_human_datetime $import_value->purchase_date %>
</div>
<div class="col-2">
<%= $import_value->purchase_value %>
2017-11-15 18:22:49 +00:00
<br>
<span class="text-muted"><%= $purchase_lookup %></span>
2017-11-13 13:30:33 +00:00
</div>
<div class="col-3">
<%= $import_value->org_name %>
2017-11-15 18:22:49 +00:00
% if ( defined $org_lookup ) {
<br>
<span class="text-muted"><%= $org_lookup->{name} %></span>
% }
2017-11-13 13:30:33 +00:00
</div>
<div class="col-2">
2017-11-15 18:22:49 +00:00
% if ( defined $import_value->transaction_id ) {
<button class="btn btn-primary">Imported</button>
% } else {
2017-11-15 18:22:49 +00:00
% if ( defined $user_lookup && defined $org_lookup && $purchase_lookup ) {
<button class="btn btn-success">Ready</button>
% }
% if ( $import_value->ignore_value ) {
<a href="<%= url_for . '/ignore/' . $import_value->id %>" class="btn btn-success">Un Ignore</a>
% } else {
<a href="<%= url_for . '/ignore/' . $import_value->id %>" class="btn btn-danger">Ignore</a>
% }
% }
2017-11-13 13:30:33 +00:00
</div>
</div>
</div>
% }
</div>
</div>
</div>
2017-11-15 18:22:49 +00:00
<div class="col-12">
<a href="<%= url_for . '/import' %>" class="btn btn-info float-right">Import Ready Items</a>
</div>
2017-11-13 13:30:33 +00:00
</div>