From d24bdfa22d346ee4ec88eb846a92d9bae7443097 Mon Sep 17 00:00:00 2001 From: Ansley Date: Mon, 28 Oct 2024 17:53:06 +0800 Subject: [PATCH] Practice Leaflet --- composer.json | 1 - composer.lock | 237 +-------------------------- config/packages/catalyst_auth.yaml | 11 +- config/packages/catalyst_menu.yaml | 8 +- config/routes/leaflet.yaml | 4 + src/Controller/LeafletController.php | 27 +++ templates/leaflet/index.html.twig | 89 ++++++++++ 7 files changed, 131 insertions(+), 246 deletions(-) create mode 100644 config/routes/leaflet.yaml create mode 100644 src/Controller/LeafletController.php create mode 100644 templates/leaflet/index.html.twig diff --git a/composer.json b/composer.json index e07bdd8d..8516749e 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,6 @@ "symfony/filesystem": "^4.0", "symfony/flex": "^1.0", "symfony/framework-bundle": "^4.0", - "symfony/mailer": "^4.0", "symfony/maker-bundle": "^1.0", "symfony/monolog-bundle": "^3.7", "symfony/process": "^4.0", diff --git a/composer.lock b/composer.lock index 1f9caf23..5914c598 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3da24a255bf74ac8f6423361afa08210", + "content-hash": "da765755121aaeb5c5a43aa74d7eeb76", "packages": [ { "name": "composer/package-versions-deprecated", @@ -1827,73 +1827,6 @@ }, "time": "2023-07-19T09:04:27+00:00" }, - { - "name": "egulias/email-validator", - "version": "3.2.6", - "source": { - "type": "git", - "url": "https://github.com/egulias/EmailValidator.git", - "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7", - "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^1.2|^2", - "php": ">=7.2", - "symfony/polyfill-intl-idn": "^1.15" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.8|^9.3.3", - "vimeo/psalm": "^4" - }, - "suggest": { - "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Egulias\\EmailValidator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eduardo Gulias Davis" - } - ], - "description": "A library for validating emails against several RFCs", - "homepage": "https://github.com/egulias/EmailValidator", - "keywords": [ - "email", - "emailvalidation", - "emailvalidator", - "validation", - "validator" - ], - "support": { - "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/3.2.6" - }, - "funding": [ - { - "url": "https://github.com/egulias", - "type": "github" - } - ], - "time": "2023-06-01T07:04:22+00:00" - }, { "name": "friendsofphp/proxy-manager-lts", "version": "v1.0.5", @@ -4934,87 +4867,6 @@ ], "time": "2021-11-22T14:10:53+00:00" }, - { - "name": "symfony/mailer", - "version": "v4.4.49", - "source": { - "type": "git", - "url": "https://github.com/symfony/mailer.git", - "reference": "554b8c0dc2db9d74e760fd6b726f527364f03302" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/554b8c0dc2db9d74e760fd6b726f527364f03302", - "reference": "554b8c0dc2db9d74e760fd6b726f527364f03302", - "shasum": "" - }, - "require": { - "egulias/email-validator": "^2.1.10|^3", - "php": ">=7.1.3", - "psr/log": "^1|^2|^3", - "symfony/event-dispatcher": "^4.3", - "symfony/mime": "^4.4.21|^5.2.6", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/http-kernel": "<4.4", - "symfony/sendgrid-mailer": "<4.4" - }, - "require-dev": { - "symfony/amazon-mailer": "^4.4|^5.0", - "symfony/google-mailer": "^4.4|^5.0", - "symfony/http-client-contracts": "^1.1|^2", - "symfony/mailchimp-mailer": "^4.4|^5.0", - "symfony/mailgun-mailer": "^4.4|^5.0", - "symfony/messenger": "^4.4|^5.0", - "symfony/postmark-mailer": "^4.4|^5.0", - "symfony/sendgrid-mailer": "^4.4|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Mailer\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Helps sending emails", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/mailer/tree/v4.4.49" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-04T06:30:35+00:00" - }, { "name": "symfony/maker-bundle", "version": "v1.36.3", @@ -5103,91 +4955,6 @@ ], "time": "2021-11-22T18:44:03+00:00" }, - { - "name": "symfony/mime", - "version": "v5.4.43", - "source": { - "type": "git", - "url": "https://github.com/symfony/mime.git", - "reference": "a02711d6ce461edada8c0f8641aa536709b99b47" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/a02711d6ce461edada8c0f8641aa536709b99b47", - "reference": "a02711d6ce461edada8c0f8641aa536709b99b47", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "egulias/email-validator": "~3.0.0", - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", - "symfony/mailer": "<4.4", - "symfony/serializer": "<5.4.35|>=6,<6.3.12|>=6.4,<6.4.3" - }, - "require-dev": { - "egulias/email-validator": "^2.1.10|^3.1|^4", - "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/process": "^5.4|^6.4", - "symfony/property-access": "^4.4|^5.1|^6.0", - "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/serializer": "^5.4.35|~6.3.12|^6.4.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Mime\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Allows manipulating MIME messages", - "homepage": "https://symfony.com", - "keywords": [ - "mime", - "mime-type" - ], - "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.43" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-08-13T10:38:38+00:00" - }, { "name": "symfony/monolog-bridge", "version": "v5.2.12", @@ -8204,6 +7971,6 @@ "php": "^7.1.3", "ext-iconv": "*" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" } diff --git a/config/packages/catalyst_auth.yaml b/config/packages/catalyst_auth.yaml index b66bbcd9..0356fad9 100644 --- a/config/packages/catalyst_auth.yaml +++ b/config/packages/catalyst_auth.yaml @@ -687,15 +687,14 @@ catalyst_auth: - id: entity.list label: List - - id: send_EDA - label: sendeda + - id: leaflet + label: Leaflet acls: - - id: eda.menu + - id: leaflet.menu label: Menu - - id: eda.update + - id: leaflet.update label: Update - - id: eda.list - label: List + api: diff --git a/config/packages/catalyst_menu.yaml b/config/packages/catalyst_menu.yaml index 100c3b05..ffdcec26 100644 --- a/config/packages/catalyst_menu.yaml +++ b/config/packages/catalyst_menu.yaml @@ -311,7 +311,7 @@ catalyst_menu: acl: entity.menu label: EntityTypes - - id: send_EDA - acl: eda.menu - label: Notifs - parent: entity_list + - id: leaflet + acl: leaflet.menu + label: Leaflet + diff --git a/config/routes/leaflet.yaml b/config/routes/leaflet.yaml new file mode 100644 index 00000000..199af1ba --- /dev/null +++ b/config/routes/leaflet.yaml @@ -0,0 +1,4 @@ +leaflet: + path: /leaflet + controller: App\Controller\LeafletController::index + methods: [GET] \ No newline at end of file diff --git a/src/Controller/LeafletController.php b/src/Controller/LeafletController.php new file mode 100644 index 00000000..8c13b5e5 --- /dev/null +++ b/src/Controller/LeafletController.php @@ -0,0 +1,27 @@ +render('leaflet/index.html.twig', [ + 'message' => 'Hello from LeafletController!', + ]); + } +} diff --git a/templates/leaflet/index.html.twig b/templates/leaflet/index.html.twig new file mode 100644 index 00000000..a6f6fda3 --- /dev/null +++ b/templates/leaflet/index.html.twig @@ -0,0 +1,89 @@ +{% extends 'base.html.twig' %} + +{% block title %}Leaflet Map with Layers{% endblock %} + +{% block stylesheets %} + + +{% endblock %} + +{% block body %} +

Leaflet Map

+ +
+
+ + + +{% endblock %}