flash fixes on import

This commit is contained in:
Finn 2019-09-11 15:02:08 +01:00
parent c9e272e380
commit f33100ba87
3 changed files with 10 additions and 14 deletions

View file

@ -37,7 +37,9 @@ sub post_suppliers {
my $job_id = $c->minion->enqueue('csv_supplier_import' => [ $filename ]);
$c->flash(success => "CSV import started, see status of minion job at: " . $c->link_to( 'Minion Job', "/admin/minion/jobs?id=$job_id"));
my $job_url = $c->url_for("/admin/minion/jobs?id=$job_id")->to_abs;
$c->flash(success => "CSV import started, see status of minion job at: $job_url");
return $c->redirect_to('/admin/import_from');
}
@ -63,7 +65,9 @@ sub post_postcodes {
my $job_id = $c->minion->enqueue('csv_postcode_import' => [ $filename ]);
$c->flash(success => "CSV import started, see status of minion job at: " . $c->link_to( 'Minion Job', "/admin/minion/jobs?id=$job_id"));
my $job_url = $c->url_for("/admin/minion/jobs?id=$job_id")->to_abs;
$c->flash(success => "CSV import started, see status of minion job at: $job_url");
return $c->redirect_to('/admin/import_from');
}
@ -94,7 +98,9 @@ sub post_transactions {
my $job_id = $c->minion->enqueue('csv_transaction_import' => [ $filename, $c->param('entity_id') ]);
$c->flash(success => "CSV import started, see status of minion job at: " . $c->link_to( 'Minion Job', "/admin/minion/jobs?id=$job_id"));
my $job_url = $c->url_for("/admin/minion/jobs?id=$job_id")->to_abs;
$c->flash(success => "CSV import started, see status of minion job at: $job_url");
return $c->redirect_to('/admin/import_from');
}

View file

@ -16,16 +16,6 @@ $(function() {
})
</script>
% 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 mb-3">
<h3 class="float-left">Import From</h3>