add title of the export at the download page

This commit is contained in:
Julien Fastré 2019-04-03 15:32:22 +02:00
parent b19e70ccfe
commit 8bfa3c5028
3 changed files with 11 additions and 5 deletions

View File

@ -40,3 +40,7 @@ Version 1.5.6
- fix long url in report download. The exports parameters are now stored in redis.
Branche de développement
========================
- insert the title of the export inside the "download" page ;

View File

@ -483,12 +483,12 @@ class ExportController extends Controller
protected function rebuildData($key)
{
if ($key === NULL) {
throw $this->createHttpNotFoundException("key does not exists");
throw $this->createNotFoundException("key does not exists");
}
if ($this->redis->exists($key) !== 1) {
$this->addFlash('error', $this->translator->trans("This report is not available any more"));
throw $this->createHttpNotFoundException("key does not exists");
throw $this->createNotFoundException("key does not exists");
}
$serialized = $this->redis->get($key);
@ -534,7 +534,8 @@ class ExportController extends Controller
}
$viewVariables = [
'alias' => $alias
'alias' => $alias,
'export' => $exportManager->getExport($alias)
];
if ($formater instanceof \Chill\MainBundle\Export\Formatter\CSVListFormatter) {

View File

@ -18,7 +18,7 @@
{% extends "ChillMainBundle::layoutWithVerticalMenu.html.twig" %}
{% block title "Download export"|trans %}
{% block title "Download export"|trans ~ export.title|trans %}
{% block js %}
<script type="text/javascript">
@ -35,7 +35,8 @@ window.addEventListener("DOMContentLoaded", function(e) {
{% block layout_wvm_content %}
<h1>{{ "Download export"|trans }}</h1>
<h1>{{ export.title|trans }}</h1>
<h2>{{ "Download export"|trans }}</h2>
<div id="download_container" data-alias="{{ alias|escape('html_attr') }}" {% if mime_type is defined %}data-mime-type="{{ mime_type|escape('html_attr') }}"{% endif %} data-download-text="{{ "Download your report"|trans|escape('html_attr') }}"><span id="waiting_text">{{ "Waiting for your report"|trans }}...</span></div>