diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..33afe3b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,70 @@ +# Git +.git +.gitignore +.gitattributes + +# IDE +.idea +.vscode +*.swp +*.swo +*~ + +# Environment +.env.local +.env.*.local +stack.env +.env.example + +# Dependencies (will be installed in container) +/vendor/ +/node_modules/ + +# Build artifacts +/var/ +/build/ +/dist/ + +# Cache +/.phpunit.cache/ +/public/bundles/ +/public/assets/ +/assets/vendor/ + +# Tests +/phpunit.xml +/tests/ + +# Uploads (might be managed separately) +/public/uploads/ +/src/uploads/ + +# Config secrets +/config/secrets/prod/prod.decrypt.private.php +secrets/ + +# OS files +.DS_Store +Thumbs.db +*.log + +# Docker files +Dockerfile +docker-compose*.yml +docker-compose*.yaml +.dockerignore + +# CI/CD +.github/ +.gitlab-ci.yml +.travis.yml + +# Documentation +*.md +/document/ + +# Misc +.editorconfig +.codeclimate.yml + + diff --git a/app/assets/styles/maps/index.css b/app/assets/styles/maps/index.css index a4b3cd1..de003dc 100644 --- a/app/assets/styles/maps/index.css +++ b/app/assets/styles/maps/index.css @@ -28,19 +28,38 @@ border-color: var(--border-dark); } +.maps-info { + display: flex; + flex-direction: row; + gap: 0.5rem; + flex: 1; +} + .maps-name { font-weight: 600; font-size: 1rem; color: var(--text-light); margin: 0; transition: color var(--duration-slow) ease; - flex: 1; } [data-theme="dark"] .maps-name { color: var(--text-dark); } +.maps-size { + font-size: 0.85rem; + display: flex; + align-items: end; + justify-content: center; + color: var(--text-light-secondary, #6c757d); + margin: 0; +} + +[data-theme="dark"] .maps-size { + color: var(--text-dark-secondary, #a8adbd); +} + .maps-btn { display: inline-block; padding: 0.6rem 1.2rem; diff --git a/app/src/Controller/MapsController.php b/app/src/Controller/MapsController.php index 08ed03d..63a307c 100644 --- a/app/src/Controller/MapsController.php +++ b/app/src/Controller/MapsController.php @@ -25,9 +25,11 @@ final class MapsController extends AbstractController $scandir = scandir($mapsDir); foreach ($scandir as $file) { if ($file !== '.' && $file !== '..' && is_file($mapsDir . '/' . $file)) { + $filePath = $mapsDir . '/' . $file; $files[] = [ 'filename' => $file, - 'display' => pathinfo($file, PATHINFO_FILENAME) + 'display' => pathinfo($file, PATHINFO_FILENAME), + 'size' => filesize($filePath) ]; } } diff --git a/app/templates/maps/index.html.twig b/app/templates/maps/index.html.twig index 3744b9e..47d1754 100644 --- a/app/templates/maps/index.html.twig +++ b/app/templates/maps/index.html.twig @@ -21,7 +21,17 @@
{% for file in files %}
-

{{ file.display }}

+
+

{{ file.display }}

+

+ {% set sizeInMB = (file.size / 1024 / 1024) %} + {% if sizeInMB >= 950 %} + {{ (file.size / 1024 / 1024 / 1024) | round(2) }} Go + {% else %} + {{ sizeInMB | round(2) }} Mo + {% endif %} +

+
Télécharger