@@ -1,3 +1,4 @@ | |||
import 'bootstrap'; | |||
import "../js/script"; | |||
import "../js/bulle"; |
@@ -0,0 +1,105 @@ | |||
import * as am4core from "@amcharts/amcharts4/core"; | |||
import * as am4charts from "@amcharts/amcharts4/charts"; | |||
import * as am4plugins_forceDirected from "@amcharts/amcharts4/plugins/forceDirected"; | |||
// Create chart | |||
let chart = am4core.create("carto-bulles", am4plugins_forceDirected.ForceDirectedTree); | |||
// Create series | |||
let series = chart.series.push(new am4plugins_forceDirected.ForceDirectedSeries()) | |||
series.dataSource.url = routes.app_carto_json; | |||
// Set data | |||
// series.data = [{ | |||
// "name": "Nos révoltes", | |||
// "link": ["Nos rêves"], | |||
// "children": [{ | |||
// "name": "A1", "value": 100 | |||
// }, { | |||
// "name": "A2", "value": 60 | |||
// }, { | |||
// "name": "A3", "value": 30 | |||
// }] | |||
// }, { | |||
// "name": "Nos rêves", | |||
// "link": ["Les actions \n inspirantes"], | |||
// "children": [{ | |||
// "name": "B1", "value": 135 | |||
// }, { | |||
// "name": "B2", "value": 98 | |||
// }, { | |||
// "name": "B3", "value": 56 | |||
// }] | |||
// }, { | |||
// "name": "Les actions \n inspirantes", | |||
// "link": ["Les actions \n à booster"], | |||
// "children": [{ | |||
// "name": "C1", "value": 335 | |||
// }, { | |||
// "name": "C2", "value": 148 | |||
// }, { | |||
// "name": "C3", "value": 126 | |||
// }, { | |||
// "name": "C4", "value": 26 | |||
// }] | |||
// }, { | |||
// "name": "Les actions \n à booster", | |||
// "link": ["Nos révoltes"], | |||
// "children": [{ | |||
// "name": "D1", "value": 415 | |||
// }, { | |||
// "name": "D2", "value": 148 | |||
// }, { | |||
// "name": "D3", "value": 89 | |||
// }, { | |||
// "name": "D4", "value": 64 | |||
// }, { | |||
// "name": "D5", "value": 16 | |||
// }] | |||
// }]; | |||
series.nodes.template.events.on("hit", function(event) { | |||
console.log(event.target.dataItem.nb); | |||
}); | |||
series.manyBodyStrength = -25; | |||
series.links.template.strength = 2; | |||
series.centerStrength = 1.2; | |||
//active le zoom | |||
chart.zoomable = true; | |||
//Nombre de level affiché par défaut | |||
series.maxLevels = 1 | |||
//link entre "frere" | |||
// series.dataFields.id = "name"; | |||
// series.dataFields.linkWith = "link"; | |||
//distance entre les bulles | |||
series.links.template.distance = 1.7; | |||
// Set up data fields | |||
series.dataFields.name = "name"; | |||
series.dataFields.children = "children"; | |||
series.dataFields.nb = "nb"; | |||
// Add labels | |||
series.nodes.template.label.text = "{name}"; | |||
series.fontSize = 20; | |||
series.minRadius = 70; | |||
series.maxRadius = 100; | |||
//Couleur des bulles | |||
series.colors.list = [ | |||
am4core.color("#dc5b2f"), | |||
am4core.color("#fce767"), | |||
am4core.color("#97533a"), | |||
am4core.color("#568b6f") | |||
]; | |||
//Apparence des liens entre les bulles | |||
series.links.template.strokeWidth = 5; | |||
series.links.template.strokeOpacity = 1; | |||
//tooltip | |||
series.nodes.template.tooltipText = "{nb}"; |
@@ -9,5 +9,10 @@ | |||
.carto-bulles { | |||
border: 2px solid $green; | |||
min-height: 800px; | |||
tspan { | |||
font-family: dinbold; | |||
} | |||
} | |||
} |
@@ -22,6 +22,10 @@ app_carto_interactive: | |||
path: /cartographie-interactive | |||
controller: App\Controller\Frontend\CartoController::cartoInteractive | |||
app_carto_json: | |||
path: /cartographie-json | |||
controller: App\Controller\Frontend\CartoController::cartoJson | |||
app_carto_liste: | |||
path: /cartographie-list | |||
controller: App\Controller\Frontend\CartoController::cartoListe |
@@ -2,13 +2,15 @@ | |||
"devDependencies": { | |||
"@symfony/stimulus-bridge": "^2.0.0", | |||
"@symfony/webpack-encore": "^1.4.0", | |||
"bootstrap-daterangepicker": "^3.1.0", | |||
"core-js": "^3.0.0", | |||
"regenerator-runtime": "^0.13.2", | |||
"sass": "^1.34.0", | |||
"stimulus": "^2.0.0", | |||
"webpack-notifier": "^1.6.0", | |||
"select2-bootstrap4-theme": "^1.0.0", | |||
"bootstrap-daterangepicker": "^3.1.0" | |||
"stimulus": "^2.0.0", | |||
"ts-loader": "^8.0.1", | |||
"typescript": "^4.4.2", | |||
"webpack-notifier": "^1.6.0" | |||
}, | |||
"license": "UNLICENSED", | |||
"private": true, | |||
@@ -19,6 +21,7 @@ | |||
"build": "encore production --progress" | |||
}, | |||
"dependencies": { | |||
"@amcharts/amcharts4": "^4.10.22", | |||
"admin-lte": "^3.1.0", | |||
"bootstrap-autocomplete": "^2.3.7", | |||
"jquery": "^3.6.0", |
@@ -2,21 +2,22 @@ | |||
"entrypoints": { | |||
"adminlte-plugins": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | |||
"/build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js", | |||
"/build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js", | |||
"/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-5760c2.7a48c88c.js", | |||
"/build/adminlte-plugins.724fdba0.js" | |||
"/build/vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-f22e6e.ed1ad144.js", | |||
"/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-cd1e13.4b3e0d6f.js", | |||
"/build/adminlte-plugins.52943ca2.js" | |||
], | |||
"css": [ | |||
"/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-5760c2.fa890b12.css" | |||
"/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-cd1e13.fa890b12.css" | |||
] | |||
}, | |||
"adminlte-index": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | |||
"/build/vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-2f9703.9d3214e1.js", | |||
@@ -28,7 +29,7 @@ | |||
}, | |||
"adminlte-form": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/vendors-node_modules_core-js_modules_es_array_find_js-_7db01.8e56d6b5.js", | |||
"/build/adminlte-form.52acb20e.js" | |||
@@ -39,7 +40,7 @@ | |||
}, | |||
"adminlte-sort": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | |||
"/build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js", | |||
@@ -52,7 +53,7 @@ | |||
}, | |||
"adminlte-field-filemanager": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/adminlte-field-filemanager.5b4b01b5.js" | |||
], | |||
@@ -62,7 +63,7 @@ | |||
}, | |||
"adminlte-field-collection": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | |||
"/build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js", | |||
@@ -75,7 +76,7 @@ | |||
}, | |||
"adminlte-main": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | |||
"/build/adminlte-main.b8c5ec34.js" | |||
@@ -86,7 +87,7 @@ | |||
}, | |||
"sov-reminder": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/sov-reminder.27580486.js" | |||
], | |||
"css": [ | |||
@@ -95,13 +96,13 @@ | |||
}, | |||
"sov-ticket": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/sov-ticket.df76c7a0.js" | |||
] | |||
}, | |||
"app-backend": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/vendors-node_modules_core-js_modules_es_array_find_js-_7db00.020ca672.js", | |||
"/build/app-backend.e87ef456.js" | |||
@@ -112,16 +113,16 @@ | |||
}, | |||
"app-frontend": { | |||
"js": [ | |||
"/build/runtime.3095b250.js", | |||
"/build/runtime.2742d602.js", | |||
"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | |||
"/build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js", | |||
"/build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js", | |||
"/build/vendors-node_modules_bootstrap_dist_js_bootstrap_js-node_modules_core-js_modules_es_array_for-85fc9f.e742e2fb.js", | |||
"/build/app-frontend.36f3c878.js" | |||
"/build/vendors-node_modules_amcharts_amcharts4_charts_js-node_modules_amcharts_amcharts4_core_js-nod-329af8.85737a1c.js", | |||
"/build/app-frontend.6a1e9044.js" | |||
], | |||
"css": [ | |||
"/build/app-frontend.e9883437.css" | |||
"/build/app-frontend.1fba758f.css" | |||
] | |||
} | |||
} |
@@ -1,5 +1,5 @@ | |||
{ | |||
"build/adminlte-plugins.js": "/build/adminlte-plugins.724fdba0.js", | |||
"build/adminlte-plugins.js": "/build/adminlte-plugins.52943ca2.js", | |||
"build/adminlte-index.css": "/build/adminlte-index.e4548695.css", | |||
"build/adminlte-index.js": "/build/adminlte-index.b12b9c93.js", | |||
"build/adminlte-form.css": "/build/adminlte-form.59862983.css", | |||
@@ -17,20 +17,25 @@ | |||
"build/sov-ticket.js": "/build/sov-ticket.df76c7a0.js", | |||
"build/app-backend.css": "/build/app-backend.3d882954.css", | |||
"build/app-backend.js": "/build/app-backend.e87ef456.js", | |||
"build/app-frontend.css": "/build/app-frontend.e9883437.css", | |||
"build/app-frontend.js": "/build/app-frontend.36f3c878.js", | |||
"build/runtime.js": "/build/runtime.3095b250.js", | |||
"build/app-frontend.css": "/build/app-frontend.1fba758f.css", | |||
"build/app-frontend.js": "/build/app-frontend.6a1e9044.js", | |||
"build/runtime.js": "/build/runtime.2742d602.js", | |||
"build/pdfmake.js": "/build/pdfmake.fbf70324.js", | |||
"build/canvg.js": "/build/canvg.3c523da1.js", | |||
"build/xlsx.js": "/build/xlsx.05855660.js", | |||
"build/vendors-node_modules_core-js_internals_export_js.2e873f33.js": "/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", | |||
"build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js": "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | |||
"build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js": "/build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js", | |||
"build/vendors-node_modules_core-js_modules_es_array_find_js-node_modules_jquery-ui-dist_jquery-ui_js.2e367944.js": "/build/vendors-node_modules_core-js_modules_es_array_find_js-node_modules_jquery-ui-dist_jquery-ui_js.2e367944.js", | |||
"build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js": "/build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js", | |||
"build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-5760c2.fa890b12.css": "/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-5760c2.fa890b12.css", | |||
"build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-5760c2.7a48c88c.js": "/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-5760c2.7a48c88c.js", | |||
"build/vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-f22e6e.ed1ad144.js": "/build/vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-f22e6e.ed1ad144.js", | |||
"build/vendors-node_modules_amcharts_amcharts4_charts_js-node_modules_amcharts_amcharts4_core_js-nod-329af8.85737a1c.js": "/build/vendors-node_modules_amcharts_amcharts4_charts_js-node_modules_amcharts_amcharts4_core_js-nod-329af8.85737a1c.js", | |||
"build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-cd1e13.fa890b12.css": "/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-cd1e13.fa890b12.css", | |||
"build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-cd1e13.4b3e0d6f.js": "/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-cd1e13.4b3e0d6f.js", | |||
"build/vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-2f9703.9d3214e1.js": "/build/vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-2f9703.9d3214e1.js", | |||
"build/vendors-node_modules_core-js_modules_es_array_find_js-_7db00.020ca672.js": "/build/vendors-node_modules_core-js_modules_es_array_find_js-_7db00.020ca672.js", | |||
"build/vendors-node_modules_core-js_modules_es_array_find_js-_7db01.8e56d6b5.js": "/build/vendors-node_modules_core-js_modules_es_array_find_js-_7db01.8e56d6b5.js", | |||
"build/vendors-node_modules_bootstrap_dist_js_bootstrap_js-node_modules_core-js_modules_es_array_for-85fc9f.e742e2fb.js": "/build/vendors-node_modules_bootstrap_dist_js_bootstrap_js-node_modules_core-js_modules_es_array_for-85fc9f.e742e2fb.js", | |||
"build/vendors-node_modules_xlsx_xlsx_js.f1747964.js": "/build/vendors-node_modules_xlsx_xlsx_js.f1747964.js", | |||
"build/images/fa-solid-900.svg": "/build/images/fa-solid-900.13de59f1.svg", | |||
"build/images/fa-brands-400.svg": "/build/images/fa-brands-400.216edb96.svg", | |||
"build/fonts/fa-solid-900.eot": "/build/fonts/fa-solid-900.efbd5d20.eot", |
@@ -0,0 +1,34 @@ | |||
(self["webpackChunk"] = self["webpackChunk"] || []).push([["xlsx"],{ | |||
/***/ "?e708": | |||
/*!************************!*\ | |||
!*** crypto (ignored) ***! | |||
\************************/ | |||
/***/ (() => { | |||
/* (ignored) */ | |||
/***/ }), | |||
/***/ "?58fb": | |||
/*!********************!*\ | |||
!*** fs (ignored) ***! | |||
\********************/ | |||
/***/ (() => { | |||
/* (ignored) */ | |||
/***/ }), | |||
/***/ "?20df": | |||
/*!************************!*\ | |||
!*** stream (ignored) ***! | |||
\************************/ | |||
/***/ (() => { | |||
/* (ignored) */ | |||
/***/ }) | |||
}]); | |||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vaWdub3JlZHwvdmFyL3d3dy9BY3Rlc0NpdG95ZW5zL25vZGVfbW9kdWxlcy94bHN4fGNyeXB0byIsIndlYnBhY2s6Ly8vaWdub3JlZHwvdmFyL3d3dy9BY3Rlc0NpdG95ZW5zL25vZGVfbW9kdWxlcy94bHN4fGZzIiwid2VicGFjazovLy9pZ25vcmVkfC92YXIvd3d3L0FjdGVzQ2l0b3llbnMvbm9kZV9tb2R1bGVzL3hsc3h8c3RyZWFtIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUEsZTs7Ozs7Ozs7OztBQ0FBLGU7Ozs7Ozs7Ozs7QUNBQSxlIiwiZmlsZSI6Inhsc3guMDU4NTU2NjAuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiAoaWdub3JlZCkgKi8iLCIvKiAoaWdub3JlZCkgKi8iLCIvKiAoaWdub3JlZCkgKi8iXSwic291cmNlUm9vdCI6IiJ9 |
@@ -9,6 +9,7 @@ use App\Repository\ProjectBoostStore; | |||
use App\Repository\ProjectInspiringStore; | |||
use App\Repository\RevoltStore; | |||
use App\Repository\TerritoryStore; | |||
use App\Repository\ThematicStore; | |||
use Doctrine\Common\Collections\ArrayCollection; | |||
use Doctrine\ORM\EntityManagerInterface; | |||
use Dompdf\Dompdf; | |||
@@ -16,6 +17,7 @@ use Dompdf\Options; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Generator\CsvGenerator; | |||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | |||
use Symfony\Component\HttpFoundation\JsonResponse; | |||
use Symfony\Component\HttpFoundation\Request; | |||
use Twig\Environment; | |||
use ReflectionClass; | |||
@@ -28,6 +30,7 @@ class CartoController extends DefaultController | |||
protected ProjectBoostStore $projectBoostStore; | |||
protected ProjectInspiringStore $projectInspiringStore; | |||
protected TerritoryStore $territoryStore; | |||
protected ThematicStore $thematicStore; | |||
protected PaginatorInterface $paginator; | |||
protected Environment $templating; | |||
protected ParameterBagInterface $parameterBag; | |||
@@ -39,6 +42,7 @@ class CartoController extends DefaultController | |||
ProjectBoostStore $projectBoostStore, | |||
ProjectInspiringStore $projectInspiringStore, | |||
TerritoryStore $territoryStore, | |||
ThematicStore $thematicStore, | |||
PaginatorInterface $paginator, | |||
Environment $templating, | |||
ParameterBagInterface $parameterBag | |||
@@ -49,6 +53,7 @@ class CartoController extends DefaultController | |||
$this->projectBoostStore = $projectBoostStore; | |||
$this->projectInspiringStore = $projectInspiringStore; | |||
$this->territoryStore = $territoryStore; | |||
$this->thematicStore = $thematicStore; | |||
$this->paginator = $paginator; | |||
$this->templating = $templating; | |||
$this->parameterBag = $parameterBag; | |||
@@ -101,6 +106,57 @@ class CartoController extends DefaultController | |||
); | |||
} | |||
public function cartoJson(Request $request) | |||
{ | |||
$thematicArray = $this->thematicStore->get(); | |||
$data = array(); | |||
$key = 0; | |||
foreach ($thematicArray as $thematic) { | |||
$revoltArray = $this->revoltStore->getByThematic($thematic); | |||
$dreamArray = $this->dreamStore->getByThematic($thematic); | |||
$projectBoostArray = $this->projectBoostStore->getByThematic($thematic); | |||
$projectInspArray = $this->projectInspiringStore->getByThematic($thematic); | |||
$contribArray = array_merge($revoltArray, $dreamArray, $projectBoostArray, $projectInspArray); | |||
foreach ($contribArray as $contrib) { | |||
$keyAlreadyHere = array_search($contrib->__toString(), array_column($data, 'name')); | |||
// si "Nos révoltes" ou "Nos Reves" etc, n'existe pas encore on le créer | |||
if ($keyAlreadyHere === false) { | |||
$data[$key] = [ | |||
'name' => $contrib->__toString(), | |||
'children' => [] | |||
]; | |||
// on insere le premier thème de la contribution | |||
$data[$key]['children'][] = [ | |||
'name' => $contrib->getThematic()->getName(), | |||
'nb' => 1, | |||
]; | |||
$key++; | |||
} else { | |||
$keyTheme = array_search( | |||
$contrib->getThematic()->getName(), | |||
array_column($data[$keyAlreadyHere]['children'], 'name') | |||
); | |||
// si le thème de la contribution n'existe pas encore on le créer | |||
if ($keyTheme === false) { | |||
$data[$keyAlreadyHere]['children'][] = [ | |||
'name' => $contrib->getThematic()->getName(), | |||
'nb' => 1, | |||
]; | |||
} else { | |||
$data[$keyAlreadyHere]['children'][$keyTheme]['nb']++; | |||
} | |||
} | |||
} | |||
} | |||
// dump($data); | |||
// die; | |||
return new JsonResponse($data); | |||
} | |||
private function generateResultArray($data): array | |||
{ | |||
$dreamArray = $revoltArray = $projectBoostArray = $projectInspiringArray = array(); |
@@ -3,6 +3,7 @@ | |||
namespace App\Repository; | |||
use App\Entity\Thematic; | |||
use Doctrine\Common\Collections\ArrayCollection; | |||
use Lc\SovBundle\Repository\AbstractStore; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
@@ -54,4 +55,12 @@ class SearchStore extends AbstractStore implements StoreInterface | |||
return $query->find(); | |||
} | |||
public function getByThematic(Thematic $thematic, $query = null) | |||
{ | |||
$query = $this->createDefaultQuery($query); | |||
$query->filterByThematic(new ArrayCollection([$thematic])); | |||
return $query->find(); | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
<?php | |||
namespace App\Repository; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
class ThematicRepositoryQuery extends AbstractRepositoryQuery implements RepositoryQueryInterface | |||
{ | |||
public function __construct(ThematicRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,34 @@ | |||
<?php | |||
namespace App\Repository; | |||
use Lc\SovBundle\Repository\AbstractStore; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
use Lc\SovBundle\Repository\StoreInterface; | |||
class ThematicStore extends AbstractStore implements StoreInterface | |||
{ | |||
public function __construct(ThematicRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||
{ | |||
$query->orderBy('id'); | |||
return $query; | |||
} | |||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||
{ | |||
return $query; | |||
} | |||
public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | |||
{ | |||
return $query; | |||
} | |||
} |
@@ -5,7 +5,15 @@ | |||
<h1 class="title-interactive">La cartographie interactive Nord Franche-Comté</h1> | |||
<div class="carto-bulles"> | |||
Bubulle! | |||
</div> | |||
</div> | |||
{% endblock %} | |||
{% block javascripts %} | |||
<script> | |||
var routes = { | |||
app_carto_json: '{{ absolute_url(path('app_carto_json')) }}' | |||
}; | |||
</script> | |||
{% endblock %} |
@@ -98,7 +98,7 @@ Encore | |||
//.enableSassLoader() | |||
// uncomment if you use TypeScript | |||
//.enableTypeScriptLoader() | |||
// .enableTypeScriptLoader() | |||
// uncomment if you use React | |||
//.enableReactPreset() |