diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 5086845..c03e419 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -5,10 +5,7 @@ framework: http_method_override: false handle_all_throwables: true - default_locale: 'fr' - translator: - default_path: '%kernel.project_dir%/translations' - fallbacks: ['en'] + # Enables session support. Note that the session will ONLY be started if you read or write from it. # Remove or comment this section to explicitly disable session support. diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index b3f8f9c..0af682d 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -1,5 +1,5 @@ framework: - default_locale: en + default_locale: fr translator: default_path: '%kernel.project_dir%/translations' fallbacks: diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 2541cf1..84c8ff6 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -64,6 +64,11 @@ final class AdminController extends AbstractController $this->entityManager->persist($stats); $this->entityManager->flush(); + $stats->computeCompletionPercent(); + $this->entityManager->persist($stats); + $this->entityManager->flush(); + + return $this->render('admin/stats.html.twig', [ 'stats' => $stats, 'zip_code' => $zip_code, diff --git a/src/Controller/PublicController.php b/src/Controller/PublicController.php index 195a735..aa95e2f 100644 --- a/src/Controller/PublicController.php +++ b/src/Controller/PublicController.php @@ -65,6 +65,7 @@ class PublicController extends AbstractController 'commerce_overpass' => $commerce_overpass, 'name' => $name, 'commerce' => $place, + 'excluded_tags_to_render' => $this->motocultrice->excluded_tags_to_render, 'osm_kind' => $place->getOsmKind(), "mapbox_token" => $_ENV['MAPBOX_TOKEN'], "maptiler_token" => $_ENV['MAPTILER_TOKEN'], diff --git a/src/Service/Motocultrice.php b/src/Service/Motocultrice.php index d743ff6..56007fe 100644 --- a/src/Service/Motocultrice.php +++ b/src/Service/Motocultrice.php @@ -10,17 +10,24 @@ class Motocultrice private $overpassApiUrl = 'https://overpass-api.de/api/interpreter'; private $osmApiUrl = 'https://www.openstreetmap.org/api/0.6'; + // ne pas lister les tags qui utilisent des morceaux particuliers de formulaire pour éviter que les gens aient besoin de connaître le tag OSM + public $excluded_tags_to_render = [ + 'name', + 'wheelchair', + 'harassment_prevention', + ]; + // les tags OSM que l'on estime nécessaires pour un commerce public $base_tags = [ 'name', 'opening_hours', 'contact:email', 'contact:phone', - 'wheelchair', 'addr:housenumber', 'addr:street', 'contact:website', 'contact:mastodon', - // 'EEEEEEEEEEEEEEEEEEE' + 'image', + 'note' ]; private $more_tags = ['image', 'ref:FR:SIRET']; public function __construct( diff --git a/templates/base.html.twig b/templates/base.html.twig index f625c57..2039b1b 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -5,6 +5,7 @@
OpenStreetMap Mon Commerce
Licence AGPLv3+, fait par Tykayn de diff --git a/templates/public/dashboard.html.twig b/templates/public/dashboard.html.twig index 1cef998..000ab8f 100644 --- a/templates/public/dashboard.html.twig +++ b/templates/public/dashboard.html.twig @@ -21,7 +21,7 @@
Zone | @@ -41,7 +41,7 @@
---|
Nom | diff --git a/templates/public/edit.html.twig b/templates/public/edit.html.twig index a65817d..397150c 100644 --- a/templates/public/edit.html.twig +++ b/templates/public/edit.html.twig @@ -19,6 +19,10 @@ .is-invalid #validation_messages { color: red; } + img{ + max-width: 100%; + max-height: 400px; + } {% endblock %} @@ -26,11 +30,18 @@
---|