mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
exports: display group as a breadcrumb in template
add a private method in controller which could be moved maybe in ExportManager
This commit is contained in:
parent
d9b668e614
commit
df9a5071c7
@ -86,6 +86,9 @@ class ExportController extends AbstractController
|
|||||||
{
|
{
|
||||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
||||||
$exportManager = $this->exportManager;
|
$exportManager = $this->exportManager;
|
||||||
|
|
||||||
|
$export = $exportManager->getExport($alias);
|
||||||
|
|
||||||
$key = $request->query->get('key', null);
|
$key = $request->query->get('key', null);
|
||||||
|
|
||||||
[$dataCenters, $dataExport, $dataFormatter] = $this->rebuildData($key);
|
[$dataCenters, $dataExport, $dataFormatter] = $this->rebuildData($key);
|
||||||
@ -100,7 +103,8 @@ class ExportController extends AbstractController
|
|||||||
|
|
||||||
$viewVariables = [
|
$viewVariables = [
|
||||||
'alias' => $alias,
|
'alias' => $alias,
|
||||||
'export' => $exportManager->getExport($alias),
|
'export' => $export,
|
||||||
|
'export_group' => $this->getExportGroup($export),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($formater instanceof \Chill\MainBundle\Export\Formatter\CSVListFormatter) {
|
if ($formater instanceof \Chill\MainBundle\Export\Formatter\CSVListFormatter) {
|
||||||
@ -316,6 +320,7 @@ class ExportController extends AbstractController
|
|||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'export_alias' => $alias,
|
'export_alias' => $alias,
|
||||||
'export' => $export,
|
'export' => $export,
|
||||||
|
'export_group' => $this->getExportGroup($export),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,6 +376,7 @@ class ExportController extends AbstractController
|
|||||||
[
|
[
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'export' => $export,
|
'export' => $export,
|
||||||
|
'export_group' => $this->getExportGroup($export),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -514,6 +520,7 @@ class ExportController extends AbstractController
|
|||||||
[
|
[
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'export' => $export,
|
'export' => $export,
|
||||||
|
'export_group' => $this->getExportGroup($export),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -565,4 +572,19 @@ class ExportController extends AbstractController
|
|||||||
throw new LogicException("the step {$step} is not defined.");
|
throw new LogicException("the step {$step} is not defined.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getExportGroup($target): string
|
||||||
|
{
|
||||||
|
$exportManager = $this->exportManager;
|
||||||
|
|
||||||
|
$groups = $exportManager->getExportsGrouped(true);
|
||||||
|
|
||||||
|
foreach ($groups as $group => $array) {
|
||||||
|
foreach ($array as $alias => $export) {
|
||||||
|
if ($export === $target) {
|
||||||
|
return $group;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,11 @@ window.addEventListener("DOMContentLoaded", function(e) {
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
|
||||||
|
<h6>
|
||||||
|
<i class="fa fa-folder-open-o fa-fw"></i>
|
||||||
|
{{ export_group|trans }}
|
||||||
|
</h6>
|
||||||
|
|
||||||
<h1>{{ export.title|trans }}</h1>
|
<h1>{{ export.title|trans }}</h1>
|
||||||
<h2>{{ "Download export"|trans }}</h2>
|
<h2>{{ "Download export"|trans }}</h2>
|
||||||
|
|
||||||
|
@ -27,6 +27,11 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
|
||||||
|
<h6>
|
||||||
|
<i class="fa fa-folder-open-o fa-fw"></i>
|
||||||
|
{{ export_group|trans }}
|
||||||
|
</h6>
|
||||||
|
|
||||||
<h1>{{ export.title|trans }}</h1>
|
<h1>{{ export.title|trans }}</h1>
|
||||||
|
|
||||||
<p>{{ export.description|trans }}</p>
|
<p>{{ export.description|trans }}</p>
|
||||||
|
@ -23,6 +23,11 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
|
||||||
|
<h6>
|
||||||
|
<i class="fa fa-folder-open-o fa-fw"></i>
|
||||||
|
{{ export_group|trans }}
|
||||||
|
</h6>
|
||||||
|
|
||||||
<h1>{{ export.title|trans }}</h1>
|
<h1>{{ export.title|trans }}</h1>
|
||||||
|
|
||||||
<p>{{ export.description|trans }}</p>
|
<p>{{ export.description|trans }}</p>
|
||||||
|
@ -22,6 +22,11 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
|
||||||
|
<h6>
|
||||||
|
<i class="fa fa-folder-open-o fa-fw"></i>
|
||||||
|
{{ export_group|trans }}
|
||||||
|
</h6>
|
||||||
|
|
||||||
<h1>{{ export.title|trans }}</h1>
|
<h1>{{ export.title|trans }}</h1>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user