diff --git a/composer.json b/composer.json index e2aa211..0a532e7 100644 --- a/composer.json +++ b/composer.json @@ -8,10 +8,12 @@ "ext-ctype": "*", "ext-iconv": "*", "sensio/framework-extra-bundle": "^6.2", + "symfony/asset": "5.4.*", "symfony/console": "5.4.*", "symfony/dotenv": "5.4.*", "symfony/flex": "^1.17|^2", "symfony/framework-bundle": "5.4.*", + "symfony/monolog-bundle": "^3.0", "symfony/runtime": "5.4.*", "symfony/twig-bundle": "5.4.*", "symfony/yaml": "5.4.*", @@ -65,5 +67,10 @@ "allow-contrib": false, "require": "5.4.*" } + }, + "require-dev": { + "symfony/debug-bundle": "5.4.*", + "symfony/stopwatch": "5.4.*", + "symfony/web-profiler-bundle": "5.4.*" } } diff --git a/composer.lock b/composer.lock index b7e3af8..51a0f0d 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": "97a6f0cb2e02b9594875c6d2a7187deb", + "content-hash": "31848baa63099948e513e4c28dced967", "packages": [ { "name": "doctrine/annotations", @@ -154,6 +154,105 @@ ], "time": "2022-01-12T08:27:12+00:00" }, + { + "name": "monolog/monolog", + "version": "2.3.5", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9", + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7", + "graylog2/gelf-php": "^1.4.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.3", + "phpspec/prophecy": "^1.6.1", + "phpstan/phpstan": "^0.12.91", + "phpunit/phpunit": "^8.5", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3", + "ruflin/elastica": ">=0.90@dev", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.3.5" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2021-10-01T21:08:31+00:00" + }, { "name": "psr/cache", "version": "1.0.1", @@ -429,6 +528,80 @@ }, "time": "2022-01-02T16:55:10+00:00" }, + { + "name": "symfony/asset", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/asset.git", + "reference": "49e355b57b4b6a5cef1d2dbc4e36cee49369cf7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/asset/zipball/49e355b57b4b6a5cef1d2dbc4e36cee49369cf7d", + "reference": "49e355b57b4b6a5cef1d2dbc4e36cee49369cf7d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/http-foundation": "<5.3" + }, + "require-dev": { + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^5.3|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/http-foundation": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Asset\\": "" + }, + "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": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/asset/tree/v5.4.0" + }, + "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": "2021-11-23T10:19:22+00:00" + }, { "name": "symfony/cache", "version": "v5.4.2", @@ -1775,6 +1948,171 @@ ], "time": "2021-12-29T13:20:26+00:00" }, + { + "name": "symfony/monolog-bridge", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/monolog-bridge.git", + "reference": "6ce6f39536a718ec2ece37eae81c6899030fc571" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/6ce6f39536a718ec2ece37eae81c6899030fc571", + "reference": "6ce6f39536a718ec2ece37eae81c6899030fc571", + "shasum": "" + }, + "require": { + "monolog/monolog": "^1.25.1|^2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/http-kernel": "^5.3|^6.0", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3" + }, + "conflict": { + "symfony/console": "<4.4", + "symfony/http-foundation": "<5.3" + }, + "require-dev": { + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/mailer": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/security-core": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", + "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", + "symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler." + }, + "type": "symfony-bridge", + "autoload": { + "psr-4": { + "Symfony\\Bridge\\Monolog\\": "" + }, + "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": "Provides integration for Monolog with various Symfony components", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/monolog-bridge/tree/v5.4.0" + }, + "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": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/monolog-bundle", + "version": "v3.7.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/monolog-bundle.git", + "reference": "fde12fc628162787a4e53877abadc30047fd868b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/fde12fc628162787a4e53877abadc30047fd868b", + "reference": "fde12fc628162787a4e53877abadc30047fd868b", + "shasum": "" + }, + "require": { + "monolog/monolog": "~1.22 || ~2.0", + "php": ">=7.1.3", + "symfony/config": "~4.4 || ^5.0 || ^6.0", + "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", + "symfony/http-kernel": "~4.4 || ^5.0 || ^6.0", + "symfony/monolog-bridge": "~4.4 || ^5.0 || ^6.0" + }, + "require-dev": { + "symfony/console": "~4.4 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.2 || ^6.0", + "symfony/yaml": "~4.4 || ^5.0 || ^6.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\MonologBundle\\": "" + }, + "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": "Symfony MonologBundle", + "homepage": "https://symfony.com", + "keywords": [ + "log", + "logging" + ], + "support": { + "issues": "https://github.com/symfony/monolog-bundle/issues", + "source": "https://github.com/symfony/monolog-bundle/tree/v3.7.1" + }, + "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": "2021-11-05T10:34:29+00:00" + }, { "name": "symfony/polyfill-intl-grapheme", "version": "v1.24.0", @@ -3281,7 +3619,229 @@ "time": "2022-01-03T21:15:37+00:00" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "symfony/debug-bundle", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug-bundle.git", + "reference": "3f3e9c9f77c9b1813d07181975a8c154fb4eb215" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug-bundle/zipball/3f3e9c9f77c9b1813d07181975a8c154fb4eb215", + "reference": "3f3e9c9f77c9b1813d07181975a8c154fb4eb215", + "shasum": "" + }, + "require": { + "ext-xml": "*", + "php": ">=7.2.5", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/polyfill-php80": "^1.16", + "symfony/twig-bridge": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "conflict": { + "symfony/config": "<4.4", + "symfony/dependency-injection": "<5.2" + }, + "require-dev": { + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/web-profiler-bundle": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/config": "For service container configuration", + "symfony/dependency-injection": "For using as a service from the container" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Symfony\\Bundle\\DebugBundle\\": "" + }, + "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": "Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stack framework", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug-bundle/tree/v5.4.2" + }, + "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": "2021-12-11T13:33:37+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", + "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "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": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v5.4.0" + }, + "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": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/web-profiler-bundle", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/web-profiler-bundle.git", + "reference": "c779222d5a87b7d947e56ac09b02adb34cf8b610" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/c779222d5a87b7d947e56ac09b02adb34cf8b610", + "reference": "c779222d5a87b7d947e56ac09b02adb34cf8b610", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/framework-bundle": "^5.3|^6.0", + "symfony/http-kernel": "^5.3|^6.0", + "symfony/polyfill-php80": "^1.16", + "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/twig-bundle": "^4.4|^5.0|^6.0", + "twig/twig": "^2.13|^3.0.4" + }, + "conflict": { + "symfony/dependency-injection": "<5.2", + "symfony/form": "<4.4", + "symfony/mailer": "<5.4", + "symfony/messenger": "<4.4" + }, + "require-dev": { + "symfony/browser-kit": "^4.4|^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Symfony\\Bundle\\WebProfilerBundle\\": "" + }, + "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": "Provides a development tool that gives detailed information about the execution of any request", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/web-profiler-bundle/tree/v5.4.2" + }, + "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": "2021-12-21T21:22:06+00:00" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], diff --git a/config/bundles.php b/config/bundles.php index a0be87b..dfc5685 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -5,4 +5,7 @@ return [ Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], + Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], + Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true], ]; diff --git a/config/packages/dev/debug.yaml b/config/packages/dev/debug.yaml new file mode 100644 index 0000000..26d4e53 --- /dev/null +++ b/config/packages/dev/debug.yaml @@ -0,0 +1,4 @@ +debug: + # Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser. + # See the "server:dump" command to start a new server. + dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%" diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml new file mode 100644 index 0000000..b1998da --- /dev/null +++ b/config/packages/dev/monolog.yaml @@ -0,0 +1,19 @@ +monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] + # uncomment to get logging in your browser + # you may have to allow bigger header sizes in your Web server configuration + #firephp: + # type: firephp + # level: info + #chromephp: + # type: chromephp + # level: info + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine", "!console"] diff --git a/config/packages/dev/web_profiler.yaml b/config/packages/dev/web_profiler.yaml new file mode 100644 index 0000000..e92166a --- /dev/null +++ b/config/packages/dev/web_profiler.yaml @@ -0,0 +1,6 @@ +web_profiler: + toolbar: true + intercept_redirects: false + +framework: + profiler: { only_exceptions: false } diff --git a/config/packages/prod/deprecations.yaml b/config/packages/prod/deprecations.yaml new file mode 100644 index 0000000..60026a1 --- /dev/null +++ b/config/packages/prod/deprecations.yaml @@ -0,0 +1,8 @@ +# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists +#monolog: +# channels: [deprecation] +# handlers: +# deprecation: +# type: stream +# channels: [deprecation] +# path: php://stderr diff --git a/config/packages/prod/monolog.yaml b/config/packages/prod/monolog.yaml new file mode 100644 index 0000000..2c02ad8 --- /dev/null +++ b/config/packages/prod/monolog.yaml @@ -0,0 +1,17 @@ +monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + buffer_size: 50 # How many messages should be saved? Prevent memory leaks + nested: + type: stream + path: php://stderr + level: debug + formatter: monolog.formatter.json + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine"] diff --git a/config/packages/test/monolog.yaml b/config/packages/test/monolog.yaml new file mode 100644 index 0000000..fc40641 --- /dev/null +++ b/config/packages/test/monolog.yaml @@ -0,0 +1,12 @@ +monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + channels: ["!event"] + nested: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug diff --git a/config/packages/test/web_profiler.yaml b/config/packages/test/web_profiler.yaml new file mode 100644 index 0000000..03752de --- /dev/null +++ b/config/packages/test/web_profiler.yaml @@ -0,0 +1,6 @@ +web_profiler: + toolbar: false + intercept_redirects: false + +framework: + profiler: { collect: false } diff --git a/config/routes/dev/web_profiler.yaml b/config/routes/dev/web_profiler.yaml new file mode 100644 index 0000000..c82beff --- /dev/null +++ b/config/routes/dev/web_profiler.yaml @@ -0,0 +1,7 @@ +web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' + prefix: /_wdt + +web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' + prefix: /_profiler diff --git a/public/css/app.css b/public/css/app.css new file mode 100644 index 0000000..bf400eb --- /dev/null +++ b/public/css/app.css @@ -0,0 +1,127 @@ +body { + font-family: spartan; + color: #444; +} + +.jumbotron-img { + background: rgb(237,116,88); + background: linear-gradient(302deg, rgba(237,116,88,1) 16%, rgba(51,61,81,1) 97%); + color: #fff; +} + +.q-container { + border-top-right-radius: .25rem; + border-top-left-radius: .25rem; + background-color: #efefee; +} + +.q-container-show { + border-top-right-radius: .25rem; + border-top-left-radius: .25rem; + background-color: #ED7458 ; +} + +.q-container img, .q-container-show img { + border: 2px solid #fff; + border-radius: 50%; +} + +.q-display { + background: #fff; + border-radius: .25rem; +} +.q-title-show { + text-transform: uppercase; + font-size: 1.3rem; + color: #fff; +} +.q-title { + text-transform: uppercase; + color: #444; +} + +.q-title:hover { + color: #2B2B2B; +} + +.q-title h2 { + font-size: 1.3rem; +} + +.q-display-response { + background: #333D51; + color: #fff; +} + +.answer-link:hover .magic-wand { + transform: rotate(20deg); +} + +.vote-arrows { + font-size: 1.5rem; +} + +.vote-arrows span { + font-size: 1rem; +} + +.vote-arrows a { + color: #444; +} + +.vote-up:hover { + color: #3D9970; +} +.vote-down:hover { + color: #FF4136; +} + +.btn-question { + color: #FFFFFF; + background-color: #ED7458; + border-color: #D45B3F; +} + +.btn-question:hover, +.btn-question:focus, +.btn-question:active, +.btn-question.active, +.open .dropdown-toggle.btn-question { + color: #FFFFFF; + background-color: #D45B3F; + border-color: #D45B3F; +} + +.btn-question:active, +.btn-question.active, +.open .dropdown-toggle.btn-question { + background-image: none; +} + +.btn-question.disabled, +.btn-question[disabled], +fieldset[disabled] .btn-question, +.btn-question.disabled:hover, +.btn-question[disabled]:hover, +fieldset[disabled] .btn-question:hover, +.btn-question.disabled:focus, +.btn-question[disabled]:focus, +fieldset[disabled] .btn-question:focus, +.btn-question.disabled:active, +.btn-question[disabled]:active, +fieldset[disabled] .btn-question:active, +.btn-question.disabled.active, +.btn-question[disabled].active, +fieldset[disabled] .btn-question.active { + background-color: #ED7458; + border-color: #D45B3F; +} + +.btn-question .badge { + color: #ED7458; + background-color: #FFFFFF; +} + +footer { + background-color: #efefee; +} \ No newline at end of file diff --git a/public/images/magic-photo.png b/public/images/magic-photo.png new file mode 100644 index 0000000..c68de51 Binary files /dev/null and b/public/images/magic-photo.png differ diff --git a/public/images/tisha.png b/public/images/tisha.png new file mode 100644 index 0000000..5a4ecd1 Binary files /dev/null and b/public/images/tisha.png differ diff --git a/public/js/question_show.js b/public/js/question_show.js new file mode 100644 index 0000000..16d818a --- /dev/null +++ b/public/js/question_show.js @@ -0,0 +1,16 @@ +/** + * Simple (ugly) code to handle the comment vote up/down + */ + var $container = $('.js-vote-arrows'); + $container.find('a').on('click', function(e) { + e.preventDefault(); + var $link = $(e.currentTarget); + + $.ajax({ + url: '/comments/10/vote/'+$link.data('direction'), + method: 'POST' + }).then(function(response) { + $container.find('.js-vote-total').text(response.votes); + }); + }); + \ No newline at end of file diff --git a/src/Controller/CommentController.php b/src/Controller/CommentController.php new file mode 100644 index 0000000..f5b293b --- /dev/null +++ b/src/Controller/CommentController.php @@ -0,0 +1,29 @@ +}", methods="POST") + */ + public function commentVote($id, $direction) + { + if ($direction === 'up') { + $logger->info('Voting up!'); + $currentVoteCount = rand(7,100); + } else { + $logger->info('Voting down!'); + $currentVoteCount = rand(0,5); + } + + // return new JsonResponse(['votes'=>$currentVoteCount]); + return $this->json(['votes'=>$currentVoteCount]); + } + +} diff --git a/src/Controller/QuestionController.php b/src/Controller/QuestionController.php index 2fb3e78..e6878c6 100644 --- a/src/Controller/QuestionController.php +++ b/src/Controller/QuestionController.php @@ -11,15 +11,15 @@ use Symfony\Component\Routing\Annotation\Route; class QuestionController extends AbstractController { /** - * @Route("/") + * @Route("/", name="app_homepage") */ public function homepage() { - return new Response('What a bewitching controller we have conjured!'); + return $this->render('question/homepage.html.twig'); } /** - * @Route("/questions/{slug}") + * @Route("/questions/{slug}", name="app_question_show") */ public function show($slug) { @@ -28,6 +28,10 @@ class QuestionController extends AbstractController 'Honestly, I like furry shoes better than MY cat', 'Maybe... try saying the spell backwards?', ]; + +dump($slug,$this); +// dd($slug,$this); + return $this->render('question/show.html.twig', [ 'question'=>ucwords(str_replace('-', ' ', $slug)), 'answers' => $answers, diff --git a/symfony.lock b/symfony.lock index 35abe1a..e052bf0 100644 --- a/symfony.lock +++ b/symfony.lock @@ -14,6 +14,9 @@ "doctrine/lexer": { "version": "1.2.2" }, + "monolog/monolog": { + "version": "2.3.5" + }, "psr/cache": { "version": "1.0.1" }, @@ -38,6 +41,9 @@ "config/packages/sensio_framework_extra.yaml" ] }, + "symfony/asset": { + "version": "v5.4.0" + }, "symfony/cache": { "version": "v5.4.2" }, @@ -59,6 +65,18 @@ "bin/console" ] }, + "symfony/debug-bundle": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "4.1", + "ref": "0ce7a032d344fb7b661cd25d31914cd703ad445b" + }, + "files": [ + "config/packages/dev/debug.yaml" + ] + }, "symfony/dependency-injection": { "version": "v5.4.2" }, @@ -120,6 +138,24 @@ "symfony/http-kernel": { "version": "v5.4.2" }, + "symfony/monolog-bridge": { + "version": "v5.4.0" + }, + "symfony/monolog-bundle": { + "version": "3.7", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.7", + "ref": "a7bace7dbc5a7ed5608dbe2165e0774c87175fe6" + }, + "files": [ + "config/packages/dev/monolog.yaml", + "config/packages/prod/deprecations.yaml", + "config/packages/prod/monolog.yaml", + "config/packages/test/monolog.yaml" + ] + }, "symfony/polyfill-intl-grapheme": { "version": "v1.24.0" }, @@ -157,6 +193,9 @@ "symfony/service-contracts": { "version": "v2.5.0" }, + "symfony/stopwatch": { + "version": "v5.4.0" + }, "symfony/string": { "version": "v5.4.2" }, @@ -185,6 +224,20 @@ "symfony/var-exporter": { "version": "v5.4.2" }, + "symfony/web-profiler-bundle": { + "version": "5.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.3", + "ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6" + }, + "files": [ + "config/packages/dev/web_profiler.yaml", + "config/packages/test/web_profiler.yaml", + "config/routes/dev/web_profiler.yaml" + ] + }, "symfony/yaml": { "version": "v5.4.2" }, diff --git a/templates/base.html.twig b/templates/base.html.twig index d4f83f7..cb783df 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -3,17 +3,31 @@