From 528ebb672a0e90074fa5eb898ef438645304e987 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Mon, 26 May 2025 11:32:53 +0200 Subject: [PATCH] add db and fixtures --- README.md | 20 + composer.json | 7 +- composer.lock | 885 +++++++++++++++++++++++---- config/bundles.php | 1 + config/packages/framework.yaml | 2 + src/Controller/PublicController.php | 23 +- src/DataFixtures/AppFixtures.php | 17 + src/DataFixtures/HistoryFixtures.php | 62 ++ src/Entity/History.php | 71 +++ src/Entity/Place.php | 259 ++++++++ src/Entity/Stats.php | 109 ++++ src/Repository/HistoryRepository.php | 43 ++ src/Repository/PlaceRepository.php | 43 ++ src/Repository/PlacveRepository.php | 43 ++ src/Repository/StatsRepository.php | 43 ++ symfony.lock | 12 + templates/base.html.twig | 24 + templates/public/dashboard.html.twig | 72 +++ templates/public/index.html.twig | 17 +- translations/fr.yaml | 18 + 20 files changed, 1655 insertions(+), 116 deletions(-) create mode 100644 src/DataFixtures/AppFixtures.php create mode 100644 src/DataFixtures/HistoryFixtures.php create mode 100644 src/Entity/History.php create mode 100644 src/Entity/Place.php create mode 100644 src/Entity/Stats.php create mode 100644 src/Repository/HistoryRepository.php create mode 100644 src/Repository/PlaceRepository.php create mode 100644 src/Repository/PlacveRepository.php create mode 100644 src/Repository/StatsRepository.php create mode 100644 templates/public/dashboard.html.twig create mode 100644 translations/fr.yaml diff --git a/README.md b/README.md index 3a2bb3b..a93c14c 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,23 @@ dépot pour faire une démo de "OSM mon commerce", permettant de modifier des co Configurer .env.local pour mettre le token bearer d'un compte dédié installer les dépendances avec composer déployer sur un serveur ayant du php 8 + +# Dépendances + +- PHP 8.1 ou supérieur +- Composer +- PostgreSQL 13 ou supérieur +- Symfony 6.3 +- Extensions PHP requises : + - pdo_pgsql + - xml + - intl + - mbstring + +# base de données + +créer un utilisateur et sa base + +sudo -u postgres psql -c "CREATE USER sf WITH PASSWORD 'jkazhreiidfsDFgfgsgFHGSshdffdshefJYIyl';" +sudo -u postgres psql -c "CREATE DATABASE \"osm-my-commerce\" OWNER sf;" + diff --git a/composer.json b/composer.json index c9eed00..03225ef 100644 --- a/composer.json +++ b/composer.json @@ -9,10 +9,11 @@ "php": ">=8.2", "ext-ctype": "*", "ext-iconv": "*", - "doctrine/dbal": "^3", + "doctrine/dbal": "^4.2", "doctrine/doctrine-bundle": "^2.13", "doctrine/doctrine-migrations-bundle": "^3.4", "doctrine/orm": "^3.1", + "guzzlehttp/guzzle": "^7.9", "phpdocumentor/reflection-docblock": "^5.6", "phpstan/phpdoc-parser": "^2.1", "symfony/asset": "*", @@ -97,11 +98,13 @@ } }, "require-dev": { + "doctrine/doctrine-fixtures-bundle": "^4.1", + "fakerphp/faker": "^1.24", "phpunit/phpunit": "^9.5", "symfony/browser-kit": "*", "symfony/css-selector": "*", "symfony/debug-bundle": "*", - "symfony/maker-bundle": "^1.0", + "symfony/maker-bundle": "^1.63", "symfony/phpunit-bridge": "^7.2", "symfony/stopwatch": "*", "symfony/web-profiler-bundle": "*" diff --git a/composer.lock b/composer.lock index 43f8e81..3a3817c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,101 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0557b215827e19dc2729c50f01189e77", + "content-hash": "f7625b2c7b49fdb113072ea857ae3f03", "packages": [ - { - "name": "doctrine/cache", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", - "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", - "shasum": "" - }, - "require": { - "php": "~7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "cache/integration-tests": "dev-master", - "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "symfony/var-exporter": "^4.4 || ^5.4 || ^6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", - "homepage": "https://www.doctrine-project.org/projects/cache.html", - "keywords": [ - "abstraction", - "apcu", - "cache", - "caching", - "couchdb", - "memcached", - "php", - "redis", - "xcache" - ], - "support": { - "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/2.2.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", - "type": "tidelift" - } - ], - "time": "2022-05-20T20:07:39+00:00" - }, { "name": "doctrine/collections", "version": "2.3.0", @@ -187,45 +94,40 @@ }, { "name": "doctrine/dbal", - "version": "3.9.4", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "ec16c82f20be1a7224e65ac67144a29199f87959" + "reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/ec16c82f20be1a7224e65ac67144a29199f87959", - "reference": "ec16c82f20be1a7224e65ac67144a29199f87959", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/33d2d7fe1269b2301640c44cf2896ea607b30e3e", + "reference": "33d2d7fe1269b2301640c44cf2896ea607b30e3e", "shasum": "" }, "require": { - "composer-runtime-api": "^2", - "doctrine/cache": "^1.11|^2.0", "doctrine/deprecations": "^0.5.3|^1", - "doctrine/event-manager": "^1|^2", - "php": "^7.4 || ^8.0", + "php": "^8.1", "psr/cache": "^1|^2|^3", "psr/log": "^1|^2|^3" }, "require-dev": { "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2023.1", + "jetbrains/phpstorm-stubs": "2023.2", "phpstan/phpstan": "2.1.1", + "phpstan/phpstan-phpunit": "2.0.3", "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "9.6.22", + "phpunit/phpunit": "10.5.39", "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.10.2", - "symfony/cache": "^5.4|^6.0|^7.0", - "symfony/console": "^4.4|^5.4|^6.0|^7.0" + "symfony/cache": "^6.3.8|^7.0", + "symfony/console": "^5.4|^6.3|^7.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." }, - "bin": [ - "bin/doctrine-dbal" - ], "type": "library", "autoload": { "psr-4": { @@ -278,7 +180,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.9.4" + "source": "https://github.com/doctrine/dbal/tree/4.2.3" }, "funding": [ { @@ -294,7 +196,7 @@ "type": "tidelift" } ], - "time": "2025-01-16T08:28:55+00:00" + "time": "2025-03-07T18:29:05+00:00" }, { "name": "doctrine/deprecations", @@ -1290,6 +1192,331 @@ ], "time": "2025-03-06T22:45:56+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "7.9.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.9.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-03-27T13:37:11+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-03-27T13:27:01+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2025-03-27T12:30:47+00:00" + }, { "name": "monolog/monolog", "version": "3.9.0", @@ -1815,6 +2042,166 @@ }, "time": "2019-01-08T18:20:26+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, { "name": "psr/link", "version": "2.0.1", @@ -1921,6 +2308,50 @@ }, "time": "2024-09-11T13:17:53+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "symfony/asset", "version": "v7.2.0", @@ -7314,6 +7745,238 @@ } ], "packages-dev": [ + { + "name": "doctrine/data-fixtures", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/data-fixtures.git", + "reference": "f7f1e12d6bceb58c204b3e77210a103c1c57601e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/f7f1e12d6bceb58c204b3e77210a103c1c57601e", + "reference": "f7f1e12d6bceb58c204b3e77210a103c1c57601e", + "shasum": "" + }, + "require": { + "doctrine/persistence": "^3.1 || ^4.0", + "php": "^8.1", + "psr/log": "^1.1 || ^2 || ^3" + }, + "conflict": { + "doctrine/dbal": "<3.5 || >=5", + "doctrine/orm": "<2.14 || >=4", + "doctrine/phpcr-odm": "<1.3.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "doctrine/dbal": "^3.5 || ^4", + "doctrine/mongodb-odm": "^1.3.0 || ^2.0.0", + "doctrine/orm": "^2.14 || ^3", + "ext-sqlite3": "*", + "fig/log-test": "^1", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5.3", + "symfony/cache": "^6.4 || ^7", + "symfony/var-exporter": "^6.4 || ^7" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)", + "doctrine/mongodb-odm": "For loading MongoDB ODM fixtures", + "doctrine/orm": "For loading ORM fixtures", + "doctrine/phpcr-odm": "For loading PHPCR ODM fixtures" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\DataFixtures\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Data Fixtures for all Doctrine Object Managers", + "homepage": "https://www.doctrine-project.org", + "keywords": [ + "database" + ], + "support": { + "issues": "https://github.com/doctrine/data-fixtures/issues", + "source": "https://github.com/doctrine/data-fixtures/tree/2.0.2" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdata-fixtures", + "type": "tidelift" + } + ], + "time": "2025-01-21T13:21:31+00:00" + }, + { + "name": "doctrine/doctrine-fixtures-bundle", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", + "reference": "a06db6b81ff20a2980bf92063d80c013bb8b4b7c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/a06db6b81ff20a2980bf92063d80c013bb8b4b7c", + "reference": "a06db6b81ff20a2980bf92063d80c013bb8b4b7c", + "shasum": "" + }, + "require": { + "doctrine/data-fixtures": "^2.0", + "doctrine/doctrine-bundle": "^2.2", + "doctrine/orm": "^2.14.0 || ^3.0", + "doctrine/persistence": "^2.4 || ^3.0 || ^4.0", + "php": "^8.1", + "psr/log": "^2 || ^3", + "symfony/config": "^6.4 || ^7.0", + "symfony/console": "^6.4 || ^7.0", + "symfony/dependency-injection": "^6.4 || ^7.0", + "symfony/deprecation-contracts": "^2.1 || ^3", + "symfony/doctrine-bridge": "^6.4.16 || ^7.1.9", + "symfony/http-kernel": "^6.4 || ^7.0" + }, + "conflict": { + "doctrine/dbal": "< 3" + }, + "require-dev": { + "doctrine/coding-standard": "13.0.0", + "phpstan/phpstan": "2.1.11", + "phpunit/phpunit": "^10.5.38 || 11.4.14" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Doctrine\\Bundle\\FixturesBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Doctrine Project", + "homepage": "https://www.doctrine-project.org" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DoctrineFixturesBundle", + "homepage": "https://www.doctrine-project.org", + "keywords": [ + "Fixture", + "persistence" + ], + "support": { + "issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues", + "source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/4.1.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdoctrine-fixtures-bundle", + "type": "tidelift" + } + ], + "time": "2025-03-26T10:56:26+00:00" + }, + { + "name": "fakerphp/faker", + "version": "v1.24.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "doctrine/persistence": "^1.3 || ^2.0", + "ext-intl": "*", + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" + }, + "suggest": { + "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" + }, + "time": "2024-11-21T13:46:39+00:00" + }, { "name": "masterminds/html5", "version": "2.9.0", diff --git a/config/bundles.php b/config/bundles.php index 0457f99..12e7c8a 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -11,4 +11,5 @@ return [ Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], + Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], ]; diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 6d85c29..1d45336 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -5,6 +5,8 @@ framework: http_method_override: false handle_all_throwables: true + default_locale: 'fr' + # 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. session: diff --git a/src/Controller/PublicController.php b/src/Controller/PublicController.php index be63648..8d56cd3 100644 --- a/src/Controller/PublicController.php +++ b/src/Controller/PublicController.php @@ -2,6 +2,9 @@ namespace App\Controller; +use App\Entity\Stats; +use App\Entity\Place; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; @@ -13,6 +16,11 @@ class PublicController extends AbstractController private $mapbox_token = 'BVM2NRJuzQunWvXbTnzg'; private $maptiler_token = 'BVM2NRJuzQunWvXbTnzg'; + public function __construct( + private EntityManagerInterface $entityManager + ) { + } + public function get_osm_object_data($osm_object_id = 12855459190) { @@ -45,7 +53,7 @@ class PublicController extends AbstractController ]; // Récupérer les vraies données OSM - $client = new \GuzzleHttp\Client(); + $client = new Client(); try { $response = $client->get($object_id); $xml = simplexml_load_string($response->getBody()->getContents()); @@ -89,6 +97,19 @@ class PublicController extends AbstractController ]); } + #[Route('/dashboard', name: 'app_public_dashboard')] + public function dashboard(): Response + { + // get stats + $stats = $this->entityManager->getRepository(Stats::class)->findAll(); + $places = $this->entityManager->getRepository(Place::class)->findAll(); + return $this->render('public/dashboard.html.twig', [ + 'controller_name' => 'PublicController', + 'stats' => $stats, + 'places' => $places, + ]); + } + #[Route('/modify/{osm_object_id}/{version}/{changesetID}', name: 'app_public_submit')] public function submit($osm_object_id, $version, $changesetID): Response { diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php new file mode 100644 index 0000000..987f6fe --- /dev/null +++ b/src/DataFixtures/AppFixtures.php @@ -0,0 +1,17 @@ +persist($product); + + $manager->flush(); + } +} diff --git a/src/DataFixtures/HistoryFixtures.php b/src/DataFixtures/HistoryFixtures.php new file mode 100644 index 0000000..db193fe --- /dev/null +++ b/src/DataFixtures/HistoryFixtures.php @@ -0,0 +1,62 @@ +setName($faker->company) + ->setUuidForUrl($faker->uuid) + ->setOsmId((string)$faker->numberBetween(1000000, 9999999)) + ->setOsmKind($faker->randomElement(['node', 'way', 'relation'])) + ->setEmail($faker->email) + ->setOptedOut($faker->boolean) + ->setDead($faker->boolean) + ->setNote($faker->text) + ->setModifiedDate($faker->dateTimeBetween('-1 year', 'now')) + ->setAskedHumainsSupport($faker->boolean) + ->setLastContactAttemptDate($faker->dateTimeBetween('-1 year', 'now')) + ->setZipCode($faker->numberBetween(10000, 99999)); + $manager->persist($place); + $places_list[] = $place; + // Créer plusieurs historiques pour chaque place + for ($j = 0; $j < 3; $j++) { + $history = new History(); + $history->setPlaceId($place); + $history->setCompletionPercent($faker->numberBetween(0, 100)); + $history->setDateTime($faker->dateTimeBetween('-1 year', 'now')); + $manager->persist($history); + } + } + + // Créer des statistiques de test + for ($i = 0; $i < 3; $i++) { + $stat = new Stats(); + $stat->setZone($faker->city) + ->setCompletionPercent($faker->numberBetween(0, 100)) + ->addPlace( $faker->randomElement($places_list)) + ->addPlace( $faker->randomElement($places_list)) + ->addPlace( $faker->randomElement($places_list)) + ->setPlacesCount($faker->numberBetween(100, 1000)); + $manager->persist($stat); + } + + $manager->flush(); + } +} \ No newline at end of file diff --git a/src/Entity/History.php b/src/Entity/History.php new file mode 100644 index 0000000..8bd3970 --- /dev/null +++ b/src/Entity/History.php @@ -0,0 +1,71 @@ +id; + } + + + public function getCompletionPercent(): ?int + { + return $this->completion_percent; + } + + public function setCompletionPercent(?int $completion_percent): static + { + $this->completion_percent = $completion_percent; + + return $this; + } + + public function getDateTime(): ?\DateTime + { + return $this->date_time; + } + + public function setDateTime(\DateTime $date_time): static + { + $this->date_time = $date_time; + + return $this; + } + + public function getPlaceId(): ?Place + { + return $this->place_id; + } + + public function setPlaceId(?Place $place_id): static + { + $this->place_id = $place_id; + + return $this; + } +} diff --git a/src/Entity/Place.php b/src/Entity/Place.php new file mode 100644 index 0000000..5a58570 --- /dev/null +++ b/src/Entity/Place.php @@ -0,0 +1,259 @@ + + */ + #[ORM\OneToMany(targetEntity: History::class, mappedBy: 'place_id', orphanRemoval: true)] + private Collection $histories; + + #[ORM\ManyToOne(inversedBy: 'places')] + private ?Stats $stats = null; + + #[ORM\Column(type: Types::BIGINT)] + private ?string $osmId = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $name = null; + + public function __construct() + { + $this->histories = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getUuidForUrl(): ?string + { + return $this->uuid_for_url; + } + + public function setUuidForUrl(string $uuid_for_url): static + { + $this->uuid_for_url = $uuid_for_url; + + return $this; + } + + public function getOsmKind(): ?string + { + return $this->osm_kind; + } + + public function setOsmKind(string $osm_kind): static + { + $this->osm_kind = $osm_kind; + + return $this; + } + + public function getEmail(): ?string + { + return $this->email; + } + + public function setEmail(string $email): static + { + $this->email = $email; + + return $this; + } + + public function isOptedOut(): ?bool + { + return $this->opted_out; + } + + public function setOptedOut(bool $opted_out): static + { + $this->opted_out = $opted_out; + + return $this; + } + + public function isDead(): ?bool + { + return $this->dead; + } + + public function setDead(bool $dead): static + { + $this->dead = $dead; + + return $this; + } + + public function getNote(): ?string + { + return $this->note; + } + + public function setNote(?string $note): static + { + $this->note = $note; + + return $this; + } + + public function getModifiedDate(): ?\DateTime + { + return $this->modified_date; + } + + public function setModifiedDate(?\DateTime $modified_date): static + { + $this->modified_date = $modified_date; + + return $this; + } + + public function getZipCode(): ?int + { + return $this->zip_code; + } + + public function setZipCode(int $zip_code): static + { + $this->zip_code = $zip_code; + + return $this; + } + + public function isAskedHumainsSupport(): ?bool + { + return $this->asked_humains_support; + } + + public function setAskedHumainsSupport(bool $asked_humains_support): static + { + $this->asked_humains_support = $asked_humains_support; + + return $this; + } + + public function getLastContactAttemptDate(): ?\DateTime + { + return $this->last_contact_attempt_date; + } + + public function setLastContactAttemptDate(?\DateTime $last_contact_attempt_date): static + { + $this->last_contact_attempt_date = $last_contact_attempt_date; + + return $this; + } + + /** + * @return Collection + */ + public function getHistories(): Collection + { + return $this->histories; + } + + public function addHistory(History $history): static + { + if (!$this->histories->contains($history)) { + $this->histories->add($history); + $history->setPlaceId($this); + } + + return $this; + } + + public function removeHistory(History $history): static + { + if ($this->histories->removeElement($history)) { + // set the owning side to null (unless already changed) + if ($history->getPlaceId() === $this) { + $history->setPlaceId(null); + } + } + + return $this; + } + + public function getStats(): ?Stats + { + return $this->stats; + } + + public function setStats(?Stats $stats): static + { + $this->stats = $stats; + + return $this; + } + + public function getOsmId(): ?string + { + return $this->osmId; + } + + public function setOsmId(string $osmId): static + { + $this->osmId = $osmId; + + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(?string $name): static + { + $this->name = $name; + + return $this; + } +} diff --git a/src/Entity/Stats.php b/src/Entity/Stats.php new file mode 100644 index 0000000..c76f3ef --- /dev/null +++ b/src/Entity/Stats.php @@ -0,0 +1,109 @@ + + */ + #[ORM\OneToMany(targetEntity: Place::class, mappedBy: 'stats')] + private Collection $places; + + #[ORM\Column(type: Types::SMALLINT)] + private ?int $places_count = null; + + public function __construct() + { + $this->places = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getZone(): ?string + { + return $this->zone; + } + + public function setZone(string $zone): static + { + $this->zone = $zone; + + return $this; + } + + public function getCompletionPercent(): ?int + { + return $this->completion_percent; + } + + public function setCompletionPercent(int $completion_percent): static + { + $this->completion_percent = $completion_percent; + + return $this; + } + + /** + * @return Collection + */ + public function getPlaces(): Collection + { + return $this->places; + } + + public function addPlace(Place $place): static + { + if (!$this->places->contains($place)) { + $this->places->add($place); + $place->setStats($this); + } + + return $this; + } + + public function removePlace(Place $place): static + { + if ($this->places->removeElement($place)) { + // set the owning side to null (unless already changed) + if ($place->getStats() === $this) { + $place->setStats(null); + } + } + + return $this; + } + + public function getPlacesCount(): ?int + { + return $this->places_count; + } + + public function setPlacesCount(int $places_count): static + { + $this->places_count = $places_count; + + return $this; + } +} diff --git a/src/Repository/HistoryRepository.php b/src/Repository/HistoryRepository.php new file mode 100644 index 0000000..b4b51a7 --- /dev/null +++ b/src/Repository/HistoryRepository.php @@ -0,0 +1,43 @@ + + */ +class HistoryRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, History::class); + } + + // /** + // * @return History[] Returns an array of History objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('h') + // ->andWhere('h.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('h.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?History + // { + // return $this->createQueryBuilder('h') + // ->andWhere('h.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/src/Repository/PlaceRepository.php b/src/Repository/PlaceRepository.php new file mode 100644 index 0000000..8c21f95 --- /dev/null +++ b/src/Repository/PlaceRepository.php @@ -0,0 +1,43 @@ + + */ +class PlaceRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Place::class); + } + + // /** + // * @return Place[] Returns an array of Place objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('p') + // ->andWhere('p.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('p.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?Place + // { + // return $this->createQueryBuilder('p') + // ->andWhere('p.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/src/Repository/PlacveRepository.php b/src/Repository/PlacveRepository.php new file mode 100644 index 0000000..6dfda37 --- /dev/null +++ b/src/Repository/PlacveRepository.php @@ -0,0 +1,43 @@ + + */ +class PlacveRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Placve::class); + } + +// /** +// * @return Placve[] Returns an array of Placve objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('p.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Placve +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/StatsRepository.php b/src/Repository/StatsRepository.php new file mode 100644 index 0000000..a5bd992 --- /dev/null +++ b/src/Repository/StatsRepository.php @@ -0,0 +1,43 @@ + + */ +class StatsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Stats::class); + } + + // /** + // * @return Stats[] Returns an array of Stats objects + // */ + // public function findByExampleField($value): array + // { + // return $this->createQueryBuilder('s') + // ->andWhere('s.exampleField = :val') + // ->setParameter('val', $value) + // ->orderBy('s.id', 'ASC') + // ->setMaxResults(10) + // ->getQuery() + // ->getResult() + // ; + // } + + // public function findOneBySomeField($value): ?Stats + // { + // return $this->createQueryBuilder('s') + // ->andWhere('s.exampleField = :val') + // ->setParameter('val', $value) + // ->getQuery() + // ->getOneOrNullResult() + // ; + // } +} diff --git a/symfony.lock b/symfony.lock index cafc55b..d7a5af9 100644 --- a/symfony.lock +++ b/symfony.lock @@ -13,6 +13,18 @@ "src/Repository/.gitignore" ] }, + "doctrine/doctrine-fixtures-bundle": { + "version": "4.1", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.0", + "ref": "1f5514cfa15b947298df4d771e694e578d4c204d" + }, + "files": [ + "src/DataFixtures/AppFixtures.php" + ] + }, "doctrine/doctrine-migrations-bundle": { "version": "3.4", "recipe": { diff --git a/templates/base.html.twig b/templates/base.html.twig index 6d75878..382891d 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -18,6 +18,30 @@ {% endblock %} +
+ +
+
{% block body %}{% endblock %} +
+
+
+
+
+

OpenStreetMap Mon Commerce

+

Licence AGPLv3+, fait par CipherBliss, membre de la fédération des professionels d'OpenStreetMap, Sources des données : OpenStreetMap. +
OpenStreetMap France

+
+
+
+
diff --git a/templates/public/dashboard.html.twig b/templates/public/dashboard.html.twig new file mode 100644 index 0000000..bc4723a --- /dev/null +++ b/templates/public/dashboard.html.twig @@ -0,0 +1,72 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello PublicController!{% endblock %} + +{% block stylesheets %} + {{ parent() }} + + +{% endblock %} + +{% block body %} +
+
+
+

Dashboard

+
+
+

Statistiques : {{ stats|length }} commerces

+ + + + + + + + + + + {% for stat in stats %} + + + + + + {% endfor %} + +
ZoneNombre de commercesComplétude %
{{ stat.zone }}{{ stat.placesCount }}{{ stat.completionPercent }}
+ +

Lieux

+ + + + + + + + + + + + + + {% for place in places %} + + + + + + + + + {% endfor %} + +
NomEmailDate de modificationDate de dernier contactDate de dernière modification
{{ place.name }}{{ place.email }}{{ place.modifiedDate | date('Y-m-d H:i:s') }}{{ place.lastContactAttemptDate | date('Y-m-d H:i:s') }}{{ place.modifiedDate | date('Y-m-d H:i:s') }}
+
+
+
+{% endblock %} diff --git a/templates/public/index.html.twig b/templates/public/index.html.twig index 8e5080e..b7155e6 100644 --- a/templates/public/index.html.twig +++ b/templates/public/index.html.twig @@ -5,6 +5,11 @@ {% block stylesheets %} {{ parent() }} + {% endblock %} {% block body %} @@ -57,21 +62,29 @@
- ? Contacter des humains d'OSM France pour m'aider + {{ 'display.contact_humans' | trans}}

Tags

{% for attributes in commerce.tag %} {% for kv in attributes %} + {% if kv.k is 'opening_hours' %} + + {{ 'display.keys.' ~ kv.k |trans}} + + + {% else %}
- + + {{ 'display.keys.' ~ kv.k |trans}}
+ {% endif %} {% endfor %} {% endfor %} diff --git a/translations/fr.yaml b/translations/fr.yaml new file mode 100644 index 0000000..47fd24c --- /dev/null +++ b/translations/fr.yaml @@ -0,0 +1,18 @@ +display: + contact_humans: "Contacter des humains d'OSM France pour m'aider" + modify: "Modifier" + keys: + - "tags" : "étiquettes" + - "name" : "Nom" + - "address" : "Adresse" + - "phone" : "Téléphone" + - "email" : "Email" + - "contact:phone" : "Téléphone du contact" + - "address:housenumber" : "Numéro de rue" + - "address:street" : "Rue" + - "address:city" : "Ville" + - "address:postcode" : "Code postal" + - "website" : "Site web" + - "contact:website" : "Contact du Site web" + - "opening_hours" : "Horaires d'ouverture" + - "shop" : "Type de commerce" \ No newline at end of file