From 2ae65081df27ed5afa3bb8025e104065afaa4f5c Mon Sep 17 00:00:00 2001 From: Sergio Mendolia Date: Tue, 29 Aug 2023 17:12:53 +0200 Subject: [PATCH] Update composer, autoremove flash on live actions, fix archive check --- assets/controllers/hello_controller.js | 16 -- assets/controllers/inline-edit-controller.js | 29 +++ composer.json | 10 +- composer.lock | 216 ++++++++---------- src/Service/BookManager.php | 15 +- symfony.lock | 4 +- templates/book/_teaser.html.twig | 8 +- .../InlineEditInteraction.html.twig | 75 +++--- 8 files changed, 172 insertions(+), 201 deletions(-) delete mode 100644 assets/controllers/hello_controller.js create mode 100644 assets/controllers/inline-edit-controller.js diff --git a/assets/controllers/hello_controller.js b/assets/controllers/hello_controller.js deleted file mode 100644 index e847027b..00000000 --- a/assets/controllers/hello_controller.js +++ /dev/null @@ -1,16 +0,0 @@ -import { Controller } from '@hotwired/stimulus'; - -/* - * This is an example Stimulus controller! - * - * Any element with a data-controller="hello" attribute will cause - * this controller to be executed. The name "hello" comes from the filename: - * hello_controller.js -> "hello" - * - * Delete this file or adapt it for your use! - */ -export default class extends Controller { - connect() { - this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js'; - } -} diff --git a/assets/controllers/inline-edit-controller.js b/assets/controllers/inline-edit-controller.js new file mode 100644 index 00000000..588537ec --- /dev/null +++ b/assets/controllers/inline-edit-controller.js @@ -0,0 +1,29 @@ +import { Controller } from '@hotwired/stimulus'; +import { getComponent } from '@symfony/ux-live-component'; + +/* + * This is an example Stimulus controller! + * + * Any element with a data-controller="hello" attribute will cause + * this controller to be executed. The name "hello" comes from the filename: + * hello_controller.js -> "hello" + * + * Delete this file or adapt it for your use! + */ + +export default class extends Controller { + async initialize() { + this.component = await getComponent(this.element); + + this.component.on('render:finished', (component) => { + + if(document.querySelector('.alert-remove')) { + setTimeout(function () { + document.querySelector('.alert-remove').remove(); + }, 1000); + } + + }); + } + +} \ No newline at end of file diff --git a/composer.json b/composer.json index ddec6853..4792f57b 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "doctrine/orm": "^2.14", "easycorp/easyadmin-bundle": "^4.7", "gedmo/doctrine-extensions": "^3.11", - "kiwilan/php-ebook": "dev-main", + "kiwilan/php-ebook": "2.0.20", "knplabs/knp-markdown-bundle": "^1.10", "knplabs/knp-menu-bundle": "^3.2", "knplabs/knp-paginator-bundle": "^6.2", @@ -123,11 +123,5 @@ "phpstan/phpstan-strict-rules": "^1.0", "phpstan/phpstan-doctrine": "^1.3", "phpstan/phpstan-symfony": "^1.2" - }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/SergioMendolia/php-ebook" - } - ] + } } diff --git a/composer.lock b/composer.lock index bcb85551..09d9811f 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": "0738ded4089993a404fec20162a060bb", + "content-hash": "44505785422d2bf6f150fce9452d797c", "packages": [ { "name": "behat/transliterator", @@ -1196,16 +1196,16 @@ }, { "name": "doctrine/orm", - "version": "2.16.1", + "version": "2.16.2", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "597a63a86ca8c5f9d1ec2dc74fe3d1269d43434a" + "reference": "17500f56eaa930f5cd14d765bc2cd851c7d37cc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/597a63a86ca8c5f9d1ec2dc74fe3d1269d43434a", - "reference": "597a63a86ca8c5f9d1ec2dc74fe3d1269d43434a", + "url": "https://api.github.com/repos/doctrine/orm/zipball/17500f56eaa930f5cd14d765bc2cd851c7d37cc0", + "reference": "17500f56eaa930f5cd14d765bc2cd851c7d37cc0", "shasum": "" }, "require": { @@ -1291,9 +1291,9 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.16.1" + "source": "https://github.com/doctrine/orm/tree/2.16.2" }, - "time": "2023-08-09T13:05:08+00:00" + "time": "2023-08-27T18:21:56+00:00" }, { "name": "doctrine/persistence", @@ -1864,16 +1864,16 @@ }, { "name": "kiwilan/php-archive", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/kiwilan/php-archive.git", - "reference": "b3540b7acb4b0211259ddc067ded6f59477d0cfb" + "reference": "04b2fba86df1aef38319e7ee04174bd6a6999ed4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kiwilan/php-archive/zipball/b3540b7acb4b0211259ddc067ded6f59477d0cfb", - "reference": "b3540b7acb4b0211259ddc067ded6f59477d0cfb", + "url": "https://api.github.com/repos/kiwilan/php-archive/zipball/04b2fba86df1aef38319e7ee04174bd6a6999ed4", + "reference": "04b2fba86df1aef38319e7ee04174bd6a6999ed4", "shasum": "" }, "require": { @@ -1929,7 +1929,7 @@ ], "support": { "issues": "https://github.com/kiwilan/php-archive/issues", - "source": "https://github.com/kiwilan/php-archive/tree/2.0.0" + "source": "https://github.com/kiwilan/php-archive/tree/v2.1.0" }, "funding": [ { @@ -1937,7 +1937,7 @@ "type": "github" } ], - "time": "2023-08-08T10:16:03+00:00" + "time": "2023-08-28T16:24:51+00:00" }, { "name": "kiwilan/php-audio", @@ -2023,16 +2023,16 @@ }, { "name": "kiwilan/php-ebook", - "version": "dev-main", + "version": "2.0.20", "source": { "type": "git", - "url": "https://github.com/SergioMendolia/php-ebook.git", - "reference": "67220383e1e3edebf2208129a0e6195f4bb6ab88" + "url": "https://github.com/kiwilan/php-ebook.git", + "reference": "cef500241d5113e3b124fd329d44e77a64df53e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SergioMendolia/php-ebook/zipball/67220383e1e3edebf2208129a0e6195f4bb6ab88", - "reference": "67220383e1e3edebf2208129a0e6195f4bb6ab88", + "url": "https://api.github.com/repos/kiwilan/php-ebook/zipball/cef500241d5113e3b124fd329d44e77a64df53e3", + "reference": "cef500241d5113e3b124fd329d44e77a64df53e3", "shasum": "" }, "require": { @@ -2048,41 +2048,13 @@ "phpstan/phpstan": "^1.10", "spatie/ray": "^1.28" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { "Kiwilan\\Ebook\\": "src" } }, - "autoload-dev": { - "psr-4": { - "Kiwilan\\Ebook\\Tests\\": "tests" - } - }, - "scripts": { - "test": [ - "vendor/bin/pest" - ], - "test-filter": [ - "vendor/bin/pest --filter" - ], - "test-parallel": [ - "vendor/bin/pest --parallel" - ], - "test-coverage": [ - "vendor/bin/pest --coverage --min=90" - ], - "test-coverage-parallel": [ - "vendor/bin/pest --parallel --coverage" - ], - "analyse": [ - "vendor/bin/phpstan analyse" - ], - "format": [ - "vendor/bin/pint" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2096,10 +2068,10 @@ "description": "PHP package to read metadata and extract covers from eBooks (.epub, .cbz, .cbr, .cb7, .cbt, .pdf) and audiobooks (.mp3, .m4a, .m4b, .flac, .ogg).", "homepage": "https://github.com/kiwilan/php-ebook", "keywords": [ + "CBA", "book", "calibre", "cb7", - "cba", "cbam", "cbr", "cbt", @@ -2117,15 +2089,16 @@ "php" ], "support": { - "source": "https://github.com/SergioMendolia/php-ebook/tree/main" + "issues": "https://github.com/kiwilan/php-ebook/issues", + "source": "https://github.com/kiwilan/php-ebook/tree/v2.0.20" }, "funding": [ { - "type": "github", - "url": "https://github.com/kiwilan" + "url": "https://github.com/kiwilan", + "type": "github" } ], - "time": "2023-08-26T11:16:19+00:00" + "time": "2023-08-28T08:18:55+00:00" }, { "name": "kiwilan/php-xml-reader", @@ -6226,16 +6199,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -6247,7 +6220,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6287,7 +6260,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -6303,20 +6276,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "a3d9148e2c363588e05abbdd4ee4f971f0a5330c" + "reference": "e46b4da57951a16053cd751f63f4a24292788157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/a3d9148e2c363588e05abbdd4ee4f971f0a5330c", - "reference": "a3d9148e2c363588e05abbdd4ee4f971f0a5330c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/e46b4da57951a16053cd751f63f4a24292788157", + "reference": "e46b4da57951a16053cd751f63f4a24292788157", "shasum": "" }, "require": { @@ -6328,7 +6301,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6374,7 +6347,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.28.0" }, "funding": [ { @@ -6390,20 +6363,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-03-21T17:27:24+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "ecaafce9f77234a6a449d29e49267ba10499116d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/ecaafce9f77234a6a449d29e49267ba10499116d", + "reference": "ecaafce9f77234a6a449d29e49267ba10499116d", "shasum": "" }, "require": { @@ -6417,7 +6390,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6461,7 +6434,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.28.0" }, "funding": [ { @@ -6477,20 +6450,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:30:37+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -6502,7 +6475,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6545,7 +6518,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -6561,20 +6534,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -6589,7 +6562,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6628,7 +6601,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -6644,20 +6617,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "508c652ba3ccf69f8c97f251534f229791b52a57" + "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/508c652ba3ccf69f8c97f251534f229791b52a57", - "reference": "508c652ba3ccf69f8c97f251534f229791b52a57", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", + "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", "shasum": "" }, "require": { @@ -6667,7 +6640,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6680,7 +6653,10 @@ ], "psr-4": { "Symfony\\Polyfill\\Php83\\": "" - } + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6705,7 +6681,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.28.0" }, "funding": [ { @@ -6721,20 +6697,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-08-16T06:22:46+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166" + "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/f3cf1a645c2734236ed1e2e671e273eeb3586166", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9c44518a5aff8da565c8a55dbe85d2769e6f630e", + "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e", "shasum": "" }, "require": { @@ -6749,7 +6725,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6787,7 +6763,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.28.0" }, "funding": [ { @@ -6803,7 +6779,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", @@ -9116,27 +9092,27 @@ }, { "name": "twig/extra-bundle", - "version": "v3.7.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/twigphp/twig-extra-bundle.git", - "reference": "802cc2dd46ec88285d6c7fa85c26ab7f2cd5bc49" + "reference": "f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/802cc2dd46ec88285d6c7fa85c26ab7f2cd5bc49", - "reference": "802cc2dd46ec88285d6c7fa85c26ab7f2cd5bc49", + "url": "https://api.github.com/repos/twigphp/twig-extra-bundle/zipball/f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3", + "reference": "f10baafe6eb0ecd615d52d5cbfb713a39f68e8f3", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/framework-bundle": "^4.4|^5.0|^6.0", - "symfony/twig-bundle": "^4.4|^5.0|^6.0", + "symfony/framework-bundle": "^5.4|^6.0", + "symfony/twig-bundle": "^5.4|^6.0", "twig/twig": "^2.7|^3.0" }, "require-dev": { "league/commonmark": "^1.0|^2.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", + "symfony/phpunit-bridge": "^5.4|^6.3", "twig/cache-extra": "^3.0", "twig/cssinliner-extra": "^2.12|^3.0", "twig/html-extra": "^2.12|^3.0", @@ -9174,7 +9150,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.7.0" + "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.7.1" }, "funding": [ { @@ -9186,20 +9162,20 @@ "type": "tidelift" } ], - "time": "2023-05-06T11:11:46+00:00" + "time": "2023-07-29T15:34:56+00:00" }, { "name": "twig/twig", - "version": "v3.7.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "5cf942bbab3df42afa918caeba947f1b690af64b" + "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/5cf942bbab3df42afa918caeba947f1b690af64b", - "reference": "5cf942bbab3df42afa918caeba947f1b690af64b", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", + "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", "shasum": "" }, "require": { @@ -9209,7 +9185,7 @@ }, "require-dev": { "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + "symfony/phpunit-bridge": "^5.4.9|^6.3" }, "type": "library", "autoload": { @@ -9245,7 +9221,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.7.0" + "source": "https://github.com/twigphp/Twig/tree/v3.7.1" }, "funding": [ { @@ -9257,7 +9233,7 @@ "type": "tidelift" } ], - "time": "2023-07-26T07:16:09+00:00" + "time": "2023-08-28T11:09:02+00:00" }, { "name": "webmozart/assert", @@ -11780,9 +11756,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "kiwilan/php-ebook": 20 - }, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/src/Service/BookManager.php b/src/Service/BookManager.php index e3808d05..20884063 100644 --- a/src/Service/BookManager.php +++ b/src/Service/BookManager.php @@ -116,18 +116,9 @@ public function updateBookLocation(Book $book, SplFileInfo $file):Book public function extractEbookMetadata(SplFileInfo $file):array { try { - if($file->getExtension()==='pdf'){ - throw new \RuntimeException('PDF not supported yet'); - } - $zip = new ZipArchive(); - $res = $zip->open($file->getRealPath(), ZipArchive::CHECKCONS); - if ($res !== TRUE) { - throw match ($res) { - ZipArchive::ER_NOZIP => new RuntimeException('not a zip archive'), - ZipArchive::ER_INCONS => new RuntimeException('consistency check failed'), - ZipArchive::ER_CRC => new RuntimeException('checksum failed'), - default => new RuntimeException('error ' . $res), - }; + + if(!Ebook::isValid($file->getRealPath())){ + throw new RuntimeException('Could not read ebook' . $file->getRealPath()); } $ebook = Ebook::read($file->getRealPath()); diff --git a/symfony.lock b/symfony.lock index 93781216..1f8ccf71 100644 --- a/symfony.lock +++ b/symfony.lock @@ -300,7 +300,7 @@ "files": [ "assets/bootstrap.js", "assets/controllers.json", - "assets/controllers/hello_controller.js" + "assets/controllers/inline-edit-controller.js" ] }, "symfony/translation": { @@ -417,7 +417,7 @@ "assets/app.js", "assets/bootstrap.js", "assets/controllers.json", - "assets/controllers/hello_controller.js", + "assets/controllers/inline-edit-controller.js", "assets/styles/app.css", "config/packages/webpack_encore.yaml", "package.json", diff --git a/templates/book/_teaser.html.twig b/templates/book/_teaser.html.twig index b7e70a9f..ee529954 100644 --- a/templates/book/_teaser.html.twig +++ b/templates/book/_teaser.html.twig @@ -10,16 +10,18 @@
- {{ include('book/_interaction.html.twig') }}
- + {{ book.mainAuthor }} {% if book.serie %}
- + {{ book.serie }} ({{ book.serieIndex }}) {% endif %}
+
+ {{ include('book/_interaction.html.twig') }} +
\ No newline at end of file diff --git a/templates/components/InlineEditInteraction.html.twig b/templates/components/InlineEditInteraction.html.twig index dea8772c..ef1f1698 100644 --- a/templates/components/InlineEditInteraction.html.twig +++ b/templates/components/InlineEditInteraction.html.twig @@ -1,44 +1,41 @@ -
- +
+ {% set finished=false %} + {% if interaction is not null %} + {% if interaction.finished %} + {% set finished=true %} + {% endif %} + {% endif %} + - + {% set favorite = false %} + {% if interaction is not null %} + {% if interaction.favorite %} + {% set favorite = true %} + {% endif %} + {% endif %} +
\ No newline at end of file