diff --git a/Dockerfile b/Dockerfile index 9ed6568..6565dcf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,3 +37,8 @@ RUN composer run-script post-install-cmd \ && chown -R www-data:www-data var EXPOSE 8080 + +COPY docker/entrypoint.sh /usr/local/bin/entrypoint +RUN chmod +x /usr/local/bin/entrypoint + +ENTRYPOINT ["entrypoint"] \ No newline at end of file diff --git a/assets/app.js b/assets/app.js index 5810e88..e957fe6 100644 --- a/assets/app.js +++ b/assets/app.js @@ -5,7 +5,12 @@ window.htmx = htmx; document.addEventListener('click', (event) => { const button = event.target.closest('[data-weather-location]'); - if (!button || !navigator.geolocation) return; + if (!button) return; + const status = document.querySelector('[data-weather-location-status]'); + if (!navigator.geolocation) { + if (status) status.textContent = 'Your browser does not support location services.'; + return; + } navigator.geolocation.getCurrentPosition(async ({coords}) => { const payload = new URLSearchParams({ @@ -18,8 +23,12 @@ document.addEventListener('click', (event) => { headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: payload, }); - if (response.ok) { - window.location.reload(); + if (!response.ok) { + if (status) status.textContent = 'Location could not be saved.'; + return; } + window.location.reload(); + }, () => { + if (status) status.textContent = 'Location permission was not granted.'; }); }); diff --git a/assets/images/TaskNestMascots.png b/assets/images/TaskNestMascots.png new file mode 100644 index 0000000..d25dd35 Binary files /dev/null and b/assets/images/TaskNestMascots.png differ diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 0000000..bb727eb Binary files /dev/null and b/assets/images/logo.png differ diff --git a/assets/styles/app.scss b/assets/styles/app.scss index d5407d1..955b342 100644 --- a/assets/styles/app.scss +++ b/assets/styles/app.scss @@ -15,7 +15,20 @@ body { --container-max: 1280px; --container-gutter: clamp(1rem, 3vw, 2rem); } +header { + display: flex; + align-items: center; +} +.logo { + height: 60px; + width: auto; +} +.mascots { + height: 150px; + width: auto; + margin-left: auto; +} .container { width: min(100% - (2 * var(--container-gutter)), var(--container-max)); margin-inline: auto; @@ -158,12 +171,17 @@ body { flex-direction: column; } } - +.weather-forecast { + font-size: 2em; + margin-bottom: 50px; + color: #fff; +} .task-composer { background-color: #fff; border-radius: 10px; margin-bottom: 50px; flex-direction: column; + form.task-composer__form { width: 100%; max-width: unset; diff --git a/composer.json b/composer.json index 689d85c..142fa33 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,8 @@ "allow-plugins": { "php-http/discovery": true, "symfony/flex": true, - "symfony/runtime": true + "symfony/runtime": true, + "phpdocumentor/shim": true }, "bump-after-update": true, "sort-packages": true @@ -77,6 +78,7 @@ } }, "require-dev": { + "phpdocumentor/shim": "*", "symfony/maker-bundle": "^1.67", "symfony/stopwatch": "8.1.*", "symfony/web-profiler-bundle": "8.1.*" diff --git a/composer.lock b/composer.lock index c977e31..8e21dbf 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": "10ff9f83f3f6050f5acfb976e4ebe9e8", + "content-hash": "2d5ff7449d92b622be5a4168fbc982b1", "packages": [ { "name": "doctrine/collections", @@ -5758,6 +5758,256 @@ }, "time": "2026-07-04T14:30:18+00:00" }, + { + "name": "phar-io/composer-distributor", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/phar-io/composer-distributor.git", + "reference": "dd7d936290b2a42b0c64bfe08090b5c597c280c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/composer-distributor/zipball/dd7d936290b2a42b0c64bfe08090b5c597c280c9", + "reference": "dd7d936290b2a42b0c64bfe08090b5c597c280c9", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0", + "ext-dom": "*", + "ext-libxml": "*", + "phar-io/filesystem": "^2.0", + "phar-io/gnupg": "^1.0", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "phpunit/phpunit": "^9.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "PharIo\\ComposerDistributor\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Heigl", + "email": "andreas@heigl.org", + "role": "Developer" + }, + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Feldmann", + "email": "sf@sebastian-feldmann.info", + "role": "Developer" + } + ], + "description": "Base Code for a composer plugin that installs PHAR-files", + "homepage": "https://phar.io", + "keywords": [ + "bin", + "binary", + "composer", + "distribute", + "phar", + "phive" + ], + "support": { + "issues": "https://github.com/phar-io/composer-distributor/issues", + "source": "https://github.com/phar-io/composer-distributor/tree/1.0.2" + }, + "funding": [ + { + "url": "https://phar.io", + "type": "other" + } + ], + "time": "2023-05-31T17:05:49+00:00" + }, + { + "name": "phar-io/executor", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/executor.git", + "reference": "5bfb7400224a0c1cf83343660af85c7f5a073473" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/executor/zipball/5bfb7400224a0c1cf83343660af85c7f5a073473", + "reference": "5bfb7400224a0c1cf83343660af85c7f5a073473", + "shasum": "" + }, + "require": { + "phar-io/filesystem": "^2.0", + "php": "^7.2||^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + } + ], + "support": { + "issues": "https://github.com/phar-io/executor/issues", + "source": "https://github.com/phar-io/executor/tree/1.0.1" + }, + "time": "2020-11-30T10:53:57+00:00" + }, + { + "name": "phar-io/filesystem", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/filesystem.git", + "reference": "222e3ea432262a05706b7066697c21257664d9d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/filesystem/zipball/222e3ea432262a05706b7066697c21257664d9d1", + "reference": "222e3ea432262a05706b7066697c21257664d9d1", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + } + ], + "support": { + "issues": "https://github.com/phar-io/filesystem/issues", + "source": "https://github.com/phar-io/filesystem/tree/2.0.1" + }, + "time": "2020-11-30T10:16:22+00:00" + }, + { + "name": "phar-io/gnupg", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/gnupg.git", + "reference": "ed8ab1740ac4e9db99500e7252911f2821357093" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/gnupg/zipball/ed8ab1740ac4e9db99500e7252911f2821357093", + "reference": "ed8ab1740ac4e9db99500e7252911f2821357093", + "shasum": "" + }, + "require": { + "phar-io/executor": "^1.0", + "phar-io/filesystem": "^2.0", + "php": "^7.2||^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + } + ], + "description": "Thin GnuPG wrapper class around the gnupg binary, mimicking the pecl/gnupg api", + "support": { + "issues": "https://github.com/phar-io/gnupg/issues", + "source": "https://github.com/phar-io/gnupg/tree/1.0.3" + }, + "time": "2024-08-22T20:45:57+00:00" + }, + { + "name": "phpdocumentor/shim", + "version": "v3.10.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/shim.git", + "reference": "a577ecbee284c51e38a4c41ceeff7fbd665b7689" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/shim/zipball/a577ecbee284c51e38a4c41ceeff7fbd665b7689", + "reference": "a577ecbee284c51e38a4c41ceeff7fbd665b7689", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "phar-io/composer-distributor": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "phpDocumentor\\Plugin" + }, + "autoload": { + "psr-4": { + "phpDocumentor\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "support": { + "source": "https://github.com/phpDocumentor/shim/tree/v3.10.0" + }, + "time": "2026-05-13T19:40:19+00:00" + }, { "name": "symfony/maker-bundle", "version": "v1.67.0", diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..4a1c0e8 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +php bin/console doctrine:migrations:migrate --no-interaction + +exec "$@" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c0d0aea..86bf9f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,6 +6,7 @@ "": { "dependencies": { "@fontsource/noto-sans": "^5.3.0", + "core-js": "^3.50.0", "htmx.org": "^2.0.10", "material-symbols": "^0.45.10" }, @@ -2769,6 +2770,20 @@ "license": "MIT", "peer": true }, + "node_modules/core-js": { + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.50.0.tgz", + "integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==", + "hasInstallScript": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/core-js-compat": { "version": "3.49.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.49.0.tgz", diff --git a/package.json b/package.json index f64a0be..47d94c7 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ }, "dependencies": { "@fontsource/noto-sans": "^5.3.0", + "core-js": "^3.50.0", "htmx.org": "^2.0.10", "material-symbols": "^0.45.10" }, diff --git a/templates/base.html.twig b/templates/base.html.twig index d999bdc..249ec53 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -20,6 +20,7 @@ {% endif %} +
TaskNest Mascots
{% block body %}{% endblock %} diff --git a/templates/task/_task_composer.html.twig b/templates/task/_task_composer.html.twig index fc99b81..3aef60a 100644 --- a/templates/task/_task_composer.html.twig +++ b/templates/task/_task_composer.html.twig @@ -26,8 +26,6 @@
{{ form_row(form.scheduledFor) }}
{{ form_row(form.isOutdoor) }}
{{ form_row(form.weatherProfile) }}
-
{{ form_row(form.isOutdoor) }}
-
{{ form_row(form.weatherProfile) }}
{{ form_widget(form.isRecurring, {attr: {class: 'task-composer__repeat-input'}}) }} {{ form_label(form.isRecurring) }} diff --git a/templates/task/index.html.twig b/templates/task/index.html.twig index 6fd7115..f4aaa13 100644 --- a/templates/task/index.html.twig +++ b/templates/task/index.html.twig @@ -25,10 +25,11 @@ {{ has_saved_location ? 'Update weather location' : 'Use my location for weather' }} +

{% if weather_forecast %} {{ include('task/_weather_forecast.html.twig', {forecast: weather_forecast}) }} - {{ include('task/_task_composer.html.twig', {form: form}) }} {% endif %} + {{ include('task/_task_composer.html.twig', {form: form}) }} {{ include('task/_task_recommendations.html.twig', { tasks: tasks, diff --git a/webpack.config.js b/webpack.config.js index c0555b7..5f26f77 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -21,6 +21,10 @@ Encore * and one CSS file (e.g. app.css) if your JavaScript imports CSS. */ .addEntry('app', './assets/app.js') + .copyFiles({ + from: './assets/images', + to: 'images/[path][name].[ext]', + }) // When enabled, Webpack "splits" your files into smaller pieces for greater optimization. .splitEntryChunks() @@ -53,11 +57,6 @@ Encore // options.minify = MinimizerPlugin.lightningCssMinify; // }) - // configure Babel - .configureBabel((config) => { - config.plugins.push(['polyfill-corejs3', { method: 'usage-global', version: '3.49' }]); - }) - // enables Sass/SCSS support .enableSassLoader()