From 3f3a60879e168f4a8040c441e295fa63e024961d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 8 Oct 2016 12:59:17 +0200 Subject: Add entry export in API Export isn't available for json & xml because user can use the default entry endpoint instead. --- app/config/config.yml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index 75d7299c..48f317c7 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -130,6 +130,8 @@ fos_rest: nelmio_api_doc: sandbox: enabled: false + cache: + enabled: true name: wallabag API documentation nelmio_cors: -- cgit v1.2.3 From f1c3f68e909e51f071f3f4b2ef9430163bbfd7a4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 15 Oct 2016 16:46:42 +0200 Subject: ApiDoc & Route annotation were conflicted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generated error was “Unable to guess how to get a Doctrine instance from the request information.”. I haven’t checked deeper in Doctrine (I know it was coming from the DoctrineParamConverter). Anyway, I check for FosRest possiblity to add extra format without allowing them for every route (like it was done in the first place). I finally found a way but it then seems all request goes to the FormatListener of FosRest so I needed to add a custom rules to match all request to be sure we don’t get a 406 error from FosRest. Should be ok now … --- app/config/config.yml | 27 +++++++++++++++++++++++++-- app/config/routing_rest.yml | 5 ++--- 2 files changed, 27 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index 2f102c45..b4760073 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -112,12 +112,26 @@ swiftmailer: fos_rest: param_fetcher_listener: true body_listener: true - format_listener: true view: + mime_types: + csv: + - 'text/csv' + - 'text/plain' + pdf: + - 'application/pdf' + epub: + - 'application/epub+zip' + mobi: + - 'application/x-mobipocket-ebook' view_response_listener: 'force' formats: xml: true - json : true + json: true + txt: true + csv: true + pdf: true + epub: true + mobi: true templating_formats: html: true force_redirects: @@ -126,6 +140,15 @@ fos_rest: default_engine: twig routing_loader: default_format: json + format_listener: + enabled: true + rules: + - { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: false, prefer_extension: false } + - { path: "^/api", priorities: ['json', 'xml'], fallback_format: false, prefer_extension: false } + - { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: false, prefer_extension: false } + # for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener + # so we need to add custom rule for custom api export but also for all other routes of the application... + - { path: '^/', priorities: ['text/html', '*/*'], fallback_format: html, prefer_extension: false } nelmio_api_doc: sandbox: diff --git a/app/config/routing_rest.yml b/app/config/routing_rest.yml index 52d395dd..29f4ab14 100644 --- a/app/config/routing_rest.yml +++ b/app/config/routing_rest.yml @@ -1,4 +1,3 @@ Rest_Wallabag: - type : rest - resource: "@WallabagApiBundle/Resources/config/routing_rest.yml" - + type : rest + resource: "@WallabagApiBundle/Resources/config/routing_rest.yml" -- cgit v1.2.3 From 206bade58a279d7f2e34c2dbada10366b90d2d6b Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 1 Oct 2016 09:26:32 +0200 Subject: Add ability to reset some datas - annotations - tags - entries --- app/DoctrineMigrations/Version20161001072726.php | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161001072726.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php new file mode 100644 index 00000000..2e112949 --- /dev/null +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -0,0 +1,54 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY FK_F035C9E5BA364942'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY FK_F035C9E5BAD26311'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_F035C9E5BA364942 FOREIGN KEY (entry_id) REFERENCES `entry` (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_F035C9E5BAD26311 FOREIGN KEY (tag_id) REFERENCES `tag` (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP FOREIGN KEY FK_2E443EF2BA364942'); + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' ADD CONSTRAINT FK_2E443EF2BA364942 FOREIGN KEY (entry_id) REFERENCES `entry` (id) ON DELETE CASCADE'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP FOREIGN KEY FK_2E443EF2BA364942'); + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' ADD CONSTRAINT FK_2E443EF2BA364942 FOREIGN KEY (entry_id) REFERENCES entry (id)'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY FK_F035C9E5BA364942'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY FK_F035C9E5BAD26311'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_F035C9E5BA364942 FOREIGN KEY (entry_id) REFERENCES entry (id)'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_F035C9E5BAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id)'); + } +} -- cgit v1.2.3 From 98efffc2a62820bad347a0f93840c48fa57f8cc3 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 1 Oct 2016 10:52:13 +0200 Subject: Fix emoji insertion in MySQL Switch to utf8mb4 instead of utf8 because f*** MySQL See https://github.com/doctrine/dbal/pull/851 --- app/config/config.yml | 2 +- app/config/config_test.yml | 2 +- app/config/parameters.yml.dist | 14 ++++++++------ app/config/parameters_test.yml | 1 + app/config/tests/parameters_test.mysql.yml | 1 + app/config/tests/parameters_test.pgsql.yml | 1 + app/config/tests/parameters_test.sqlite.yml | 1 + 7 files changed, 14 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index b4760073..9dbc9d7c 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -75,7 +75,7 @@ doctrine: dbname: "%database_name%" user: "%database_user%" password: "%database_password%" - charset: UTF8 + charset: "%database_charset%" path: "%database_path%" unix_socket: "%database_socket%" server_version: 5.6 diff --git a/app/config/config_test.yml b/app/config/config_test.yml index 3eab6fb2..f5e2c25e 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml @@ -28,7 +28,7 @@ doctrine: dbname: "%test_database_name%" user: "%test_database_user%" password: "%test_database_password%" - charset: UTF8 + charset: "%test_database_charset%" path: "%test_database_path%" orm: metadata_cache_driver: diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index ece4903a..a33ea37b 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -19,16 +19,18 @@ parameters: database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite" database_table_prefix: wallabag_ database_socket: null + # with MySQL, use "utf8mb4" if got problem with content with emojis + database_charset: utf8 - mailer_transport: smtp - mailer_host: 127.0.0.1 - mailer_user: ~ - mailer_password: ~ + mailer_transport: smtp + mailer_host: 127.0.0.1 + mailer_user: ~ + mailer_password: ~ - locale: en + locale: en # A secret key that's used to generate certain security-related tokens - secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv + secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv # two factor stuff twofactor_auth: true diff --git a/app/config/parameters_test.yml b/app/config/parameters_test.yml index 2943b27a..5f2e25bb 100644 --- a/app/config/parameters_test.yml +++ b/app/config/parameters_test.yml @@ -6,3 +6,4 @@ parameters: test_database_user: null test_database_password: null test_database_path: '%kernel.root_dir%/../data/db/wallabag_test.sqlite' + test_database_charset: utf8 diff --git a/app/config/tests/parameters_test.mysql.yml b/app/config/tests/parameters_test.mysql.yml index d8512845..bca2d466 100644 --- a/app/config/tests/parameters_test.mysql.yml +++ b/app/config/tests/parameters_test.mysql.yml @@ -6,3 +6,4 @@ parameters: test_database_user: root test_database_password: ~ test_database_path: ~ + test_database_charset: utf8mb4 diff --git a/app/config/tests/parameters_test.pgsql.yml b/app/config/tests/parameters_test.pgsql.yml index 41383868..3e18d4a0 100644 --- a/app/config/tests/parameters_test.pgsql.yml +++ b/app/config/tests/parameters_test.pgsql.yml @@ -6,3 +6,4 @@ parameters: test_database_user: travis test_database_password: ~ test_database_path: ~ + test_database_charset: utf8 diff --git a/app/config/tests/parameters_test.sqlite.yml b/app/config/tests/parameters_test.sqlite.yml index 1952e3a6..0efbe786 100644 --- a/app/config/tests/parameters_test.sqlite.yml +++ b/app/config/tests/parameters_test.sqlite.yml @@ -6,3 +6,4 @@ parameters: test_database_user: ~ test_database_password: ~ test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite" + test_database_charset: utf8mb4 -- cgit v1.2.3 From 2f82e7f8e1827423e2dbe4a91089c66d3afff367 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 8 Oct 2016 10:57:57 +0200 Subject: Cleanup subscriber / listener definition --- app/config/parameters_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/config/parameters_test.yml b/app/config/parameters_test.yml index 5f2e25bb..3111da47 100644 --- a/app/config/parameters_test.yml +++ b/app/config/parameters_test.yml @@ -6,4 +6,4 @@ parameters: test_database_user: null test_database_password: null test_database_path: '%kernel.root_dir%/../data/db/wallabag_test.sqlite' - test_database_charset: utf8 + test_database_charset: utf8mb4 -- cgit v1.2.3 From b0de88f75dead50385e80e3897dc3913a971b91e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 11 Oct 2016 21:45:43 +0200 Subject: Use statements & update translation --- app/config/parameters.yml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index a33ea37b..436eeeda 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -20,7 +20,7 @@ parameters: database_table_prefix: wallabag_ database_socket: null # with MySQL, use "utf8mb4" if got problem with content with emojis - database_charset: utf8 + database_charset: utf8mb4 mailer_transport: smtp mailer_host: 127.0.0.1 -- cgit v1.2.3 From fc79f1ffa82529e5340d115b2f438ac5952e9cb0 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 22 Oct 2016 13:41:03 +0200 Subject: Add verification check for MySQL version Must now be >= 5.5.4 --- app/config/parameters.yml.dist | 4 ++-- app/config/tests/parameters_test.sqlite.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 436eeeda..7a22cb98 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -19,8 +19,8 @@ parameters: database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite" database_table_prefix: wallabag_ database_socket: null - # with MySQL, use "utf8mb4" if got problem with content with emojis - database_charset: utf8mb4 + # with MySQL, use "utf8mb4" if you got problem with content with emojis + database_charset: utf8 mailer_transport: smtp mailer_host: 127.0.0.1 diff --git a/app/config/tests/parameters_test.sqlite.yml b/app/config/tests/parameters_test.sqlite.yml index 0efbe786..b8a5f41a 100644 --- a/app/config/tests/parameters_test.sqlite.yml +++ b/app/config/tests/parameters_test.sqlite.yml @@ -6,4 +6,4 @@ parameters: test_database_user: ~ test_database_password: ~ test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite" - test_database_charset: utf8mb4 + test_database_charset: utf8 -- cgit v1.2.3 From 5751b41491b9fd69c5b553c95e70a90fbf975aeb Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 22 Oct 2016 14:01:58 +0200 Subject: Add migration for MySQL utf8mb4 --- app/DoctrineMigrations/Version20161022134138.php | 77 ++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161022134138.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php new file mode 100644 index 00000000..5cce55a5 --- /dev/null +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -0,0 +1,77 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + + $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('tag').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CHANGE `text` `text` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CHANGE `quote` `quote` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE `title` `title` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE `content` `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('tag').' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE `name` `name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + + $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('tag').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CHANGE `text` `text` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CHANGE `quote` `quote` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE `title` `title` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE `content` `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('tag').' CHANGE `label` `label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); + + } +} -- cgit v1.2.3 From 5ce1528953998ee2957cd548ee123870b82f4079 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 23 Oct 2016 12:35:57 +0200 Subject: Fix migrations --- app/DoctrineMigrations/Version20160410190541.php | 12 +++++--- app/DoctrineMigrations/Version20160812120952.php | 15 +++++++--- app/DoctrineMigrations/Version20160911214952.php | 4 +-- app/DoctrineMigrations/Version20160916201049.php | 6 ++-- app/DoctrineMigrations/Version20161001072726.php | 37 +++++++++++++++--------- 5 files changed, 47 insertions(+), 27 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 4014857b..c41b0465 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -29,8 +29,12 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE `'.$this->getTable('entry').'` ADD `uuid` LONGTEXT DEFAULT NULL'); - $this->addSql("INSERT INTO `".$this->getTable('craue_config_setting')."` (`name`, `value`, `section`) VALUES ('share_public', '1', 'entry')"); + if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') { + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD uuid UUID DEFAULT NULL'); + } else { + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD uuid LONGTEXT DEFAULT NULL'); + } + $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_public', '1', 'entry')"); } /** @@ -40,7 +44,7 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); - $this->addSql('ALTER TABLE `'.$this->getTable('entry').'` DROP `uuid`'); - $this->addSql("DELETE FROM `".$this->getTable('craue_config_setting')."` WHERE `name` = 'share_public'"); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' DROP uuid'); + $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'share_public'"); } } diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index a8d3bcf2..39423e2f 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -29,10 +29,17 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - if ($this->connection->getDatabasePlatform()->getName() == 'sqlite') { - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); - } else { - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); + break; + + case 'mysql': + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); + break; + + case 'postgresql': + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name text DEFAULT NULL'); } } diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index 35809cec..3f988ccf 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -29,8 +29,8 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('INSERT INTO `'.$this->getTable('craue_config_setting').'` (`name`, `value`, `section`) VALUES (\'import_with_redis\', \'0\', \'import\')'); - $this->addSql('INSERT INTO `'.$this->getTable('craue_config_setting').'` (`name`, `value`, `section`) VALUES (\'import_with_rabbitmq\', \'0\', \'import\')'); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting').' (name, value, section) VALUES (\'import_with_redis\', \'0\', \'import\')'); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting').' (name, value, section) VALUES (\'import_with_rabbitmq\', \'0\', \'import\')'); } /** diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 202901e6..fc4e700a 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -30,7 +30,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI public function up(Schema $schema) { $this->addSql('ALTER TABLE '.$this->getTable('config').' ADD pocket_consumer_key VARCHAR(255) DEFAULT NULL'); - $this->addSql("DELETE FROM `".$this->getTable('craue_config_setting')."` WHERE `name` = 'pocket_consumer_key';"); + $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'pocket_consumer_key';"); } /** @@ -40,7 +40,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI { $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - $this->addSql('ALTER TABLE `'.$this->getTable('config').'` DROP pocket_consumer_key'); - $this->addSql("INSERT INTO `".$this->getTable('craue_config_setting')."` (`name`, `value`, `section`) VALUES ('pocket_consumer_key', NULL, 'import')"); + $this->addSql('ALTER TABLE '.$this->getTable('config').' DROP pocket_consumer_key'); + $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); } } diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index 2e112949..237db932 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -29,12 +29,28 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY FK_F035C9E5BA364942'); - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY FK_F035C9E5BAD26311'); - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_F035C9E5BA364942 FOREIGN KEY (entry_id) REFERENCES `entry` (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_F035C9E5BAD26311 FOREIGN KEY (tag_id) REFERENCES `tag` (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP FOREIGN KEY FK_2E443EF2BA364942'); - $this->addSql('ALTER TABLE '.$this->getTable('annotation').' ADD CONSTRAINT FK_2E443EF2BA364942 FOREIGN KEY (entry_id) REFERENCES `entry` (id) ON DELETE CASCADE'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + + // remove all FK from entry_tag + $query = $this->connection->query("SELECT CONSTRAINT_NAME FROM information_schema.key_column_usage WHERE TABLE_NAME = '".$this->getTable('entry_tag')."' AND CONSTRAINT_NAME LIKE 'FK_%' AND TABLE_SCHEMA = '".$this->connection->getDatabase()."'"); + $query->execute(); + + foreach ($query->fetchAll() as $fk) { + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY '.$fk['CONSTRAINT_NAME']); + } + + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES '.$this->getTable('entry').' (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES '.$this->getTable('tag').' (id) ON DELETE CASCADE'); + + // remove entry FK from annotation + $query = $this->connection->query("SELECT CONSTRAINT_NAME FROM information_schema.key_column_usage WHERE TABLE_NAME = '".$this->getTable('annotation')."' AND CONSTRAINT_NAME LIKE 'FK_%' and COLUMN_NAME = 'entry_id' AND TABLE_SCHEMA = '".$this->connection->getDatabase()."'"); + $query->execute(); + + foreach ($query->fetchAll() as $fk) { + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP FOREIGN KEY '.$fk['CONSTRAINT_NAME']); + } + + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES '.$this->getTable('entry').' (id) ON DELETE CASCADE'); } /** @@ -42,13 +58,6 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - - $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP FOREIGN KEY FK_2E443EF2BA364942'); - $this->addSql('ALTER TABLE '.$this->getTable('annotation').' ADD CONSTRAINT FK_2E443EF2BA364942 FOREIGN KEY (entry_id) REFERENCES entry (id)'); - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY FK_F035C9E5BA364942'); - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY FK_F035C9E5BAD26311'); - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_F035C9E5BA364942 FOREIGN KEY (entry_id) REFERENCES entry (id)'); - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_F035C9E5BAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id)'); + throw new SkipMigrationException('Too complex ...'); } } -- cgit v1.2.3 From f623516e107c8146f87d815f033cecb5d812466a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 24 Oct 2016 10:10:38 +0200 Subject: SQLite should use utf8, not utf8mb4 --- app/config/parameters_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/config/parameters_test.yml b/app/config/parameters_test.yml index 3111da47..5f2e25bb 100644 --- a/app/config/parameters_test.yml +++ b/app/config/parameters_test.yml @@ -6,4 +6,4 @@ parameters: test_database_user: null test_database_password: null test_database_path: '%kernel.root_dir%/../data/db/wallabag_test.sqlite' - test_database_charset: utf8mb4 + test_database_charset: utf8 -- cgit v1.2.3 From 23406ca3f12303759ecb46974d6bcb22fb0e037b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 24 Oct 2016 21:56:28 +0200 Subject: Added relation between API Client and User Fix #2062 --- app/DoctrineMigrations/Version20161024212538.php | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161024212538.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php new file mode 100644 index 00000000..75973b33 --- /dev/null +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -0,0 +1,47 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD CONSTRAINT FK_clients_user_clients FOREIGN KEY (user_id) REFERENCES '.$this->getTable('user').' (id) ON DELETE CASCADE'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + + } +} -- cgit v1.2.3 From f24ea59ea4e854d8a699f51a7347af9d4a222de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 28 Oct 2016 10:55:39 +0200 Subject: Fixed migration and added tests --- app/DoctrineMigrations/Version20161024212538.php | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index 75973b33..b9dc500c 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -34,6 +34,7 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI { $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD `user_id` INT(11) DEFAULT NULL'); $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD CONSTRAINT FK_clients_user_clients FOREIGN KEY (user_id) REFERENCES '.$this->getTable('user').' (id) ON DELETE CASCADE'); } -- cgit v1.2.3 From f08ec5f88a78bfe2edf2c2148094f3f099e8389c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 28 Oct 2016 11:11:32 +0200 Subject: Remove backquote in query --- app/DoctrineMigrations/Version20161024212538.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index b9dc500c..f8e927e4 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -7,9 +7,6 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -/** - * Auto-generated Migration: Please modify to your needs! - */ class Version20161024212538 extends AbstractMigration implements ContainerAwareInterface { /** @@ -34,7 +31,7 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI { $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD `user_id` INT(11) DEFAULT NULL'); + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD user_id INT(11) DEFAULT NULL'); $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD CONSTRAINT FK_clients_user_clients FOREIGN KEY (user_id) REFERENCES '.$this->getTable('user').' (id) ON DELETE CASCADE'); } -- cgit v1.2.3 From 535bfcbe80de5d697b768c3a657214fdeff0eac3 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 30 Oct 2016 09:58:39 +0100 Subject: Move related event things in Event folder --- app/config/services.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/config/services.yml b/app/config/services.yml index a57ef0f3..9a1ce80b 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -32,13 +32,13 @@ services: - { name: twig.extension } wallabag.locale_listener: - class: Wallabag\CoreBundle\EventListener\LocaleListener + class: Wallabag\CoreBundle\Event\Listener\LocaleListener arguments: ["%kernel.default_locale%"] tags: - { name: kernel.event_subscriber } wallabag.user_locale_listener: - class: Wallabag\CoreBundle\EventListener\UserLocaleListener + class: Wallabag\CoreBundle\Event\Listener\UserLocaleListener arguments: ["@session"] tags: - { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin } -- cgit v1.2.3 From aedd6ca0fd212abd07ec59c5fd58ea2ca99198c5 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 31 Oct 2016 13:29:33 +0100 Subject: Add translations & migration --- app/DoctrineMigrations/Version20161031132655.php | 44 ++++++++++++++++++++++ .../translations/CraueConfigBundle.da.yml | 1 + .../translations/CraueConfigBundle.de.yml | 1 + .../translations/CraueConfigBundle.en.yml | 1 + .../translations/CraueConfigBundle.es.yml | 1 + .../translations/CraueConfigBundle.fa.yml | 1 + .../translations/CraueConfigBundle.fr.yml | 1 + .../translations/CraueConfigBundle.it.yml | 1 + .../translations/CraueConfigBundle.oc.yml | 1 + .../translations/CraueConfigBundle.pl.yml | 1 + .../translations/CraueConfigBundle.ro.yml | 1 + .../translations/CraueConfigBundle.tr.yml | 1 + 12 files changed, 55 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161031132655.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php new file mode 100644 index 00000000..c7364428 --- /dev/null +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -0,0 +1,44 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + + $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); + } +} diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index 3e11d675..7c323783 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -29,3 +29,4 @@ piwik_enabled: Aktiver Piwik demo_mode_enabled: "Aktiver demo-indstilling? (anvendes kun til wallabags offentlige demo)" demo_mode_username: "Demobruger" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index c74b5c1f..438eb74a 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -29,3 +29,4 @@ piwik_enabled: Piwik aktivieren demo_mode_enabled: "Test-Modus aktivieren? (nur für die öffentliche wallabag-Demo genutzt)" demo_mode_username: "Test-Benutzer" share_public: Erlaube eine öffentliche URL für Einträge +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 77c09db4..c2f2b3fb 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -29,3 +29,4 @@ piwik_enabled: Enable Piwik demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" demo_mode_username: "Demo user" share_public: Allow public url for entries +download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index baa83849..76feea50 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -29,3 +29,4 @@ piwik_enabled: Activar Piwik demo_mode_enabled: "Activar modo demo (sólo usado para la demo de wallabag)" demo_mode_username: "Nombre de usuario demo" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index b394977e..30df0086 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -29,3 +29,4 @@ modify_settings: "اعمال" # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" # demo_mode_username: "Demo user" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index 31a80880..a60341b3 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -29,3 +29,4 @@ piwik_enabled: Activer Piwik demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo publique de wallabag)" demo_mode_username: "Utilisateur de la démo" share_public: Autoriser une URL publique pour les articles +download_images_enabled: Télécharger les images en local diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index ba038556..3ad5f7d0 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -29,3 +29,4 @@ piwik_enabled: Abilita Piwik demo_mode_enabled: "Abilita modalità demo ? (usato solo per la demo pubblica di wallabag)" demo_mode_username: "Utente Demo" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index 55249e33..fd83b437 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -29,3 +29,4 @@ piwik_enabled: Activar Piwik demo_mode_enabled: "Activar lo mode demostracion ? (utilizar solament per la demostracion publica de wallabag)" demo_mode_username: "Utilizaire de la demostracion" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 42cc5b52..3a63eebb 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -29,3 +29,4 @@ piwik_enabled: Włacz Piwik demo_mode_enabled: "Włacz tryb demo? (używany wyłącznie dla publicznej demonstracji Wallabag)" demo_mode_username: "Użytkownik Demonstracyjny" share_public: Zezwalaj na publiczny adres url dla wpisow +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 8e72b955..4fb42e98 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -29,3 +29,4 @@ modify_settings: "aplică" # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" # demo_mode_username: "Demo user" # share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index 55f70843..ebfadf29 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -29,3 +29,4 @@ # demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" # demo_mode_username: "Demo user" # share_public: Allow public url for entries +# download_images_enabled: Download images locally -- cgit v1.2.3 From e61ee56031aa0788f9a40ec245d3c391d219d6c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 31 Oct 2016 16:16:41 +0100 Subject: Added QRCode and link to configure android application --- app/Resources/static/themes/_global/js/tools.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index ab30deb1..00f5d501 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,5 +1,7 @@ const $ = require('jquery'); +var jrQrcode = require('jr-qrcode'); + function supportsLocalStorage() { try { return 'localStorage' in window && window.localStorage !== null; -- cgit v1.2.3 From 3b81212674bb4b2cf51ce51637e0093c952cefde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 31 Oct 2016 16:48:34 +0100 Subject: Added translations and baggy part --- app/Resources/static/themes/_global/js/tools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 00f5d501..9b23e4b5 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,6 +1,6 @@ const $ = require('jquery'); -var jrQrcode = require('jr-qrcode'); +import jrQrcode from 'jr-qrcode'; function supportsLocalStorage() { try { -- cgit v1.2.3 From 32508ef07aeb43966694ae360eeaeff8325e2a4d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 3 Nov 2016 14:23:09 +0100 Subject: avoid eslint warning by disabling line Signed-off-by: Thomas Citharel --- app/Resources/static/themes/_global/js/tools.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 9b23e4b5..55de090c 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,6 +1,7 @@ const $ = require('jquery'); -import jrQrcode from 'jr-qrcode'; +/* Allows inline call qr-code call */ +import jrQrcode from 'jr-qrcode'; // eslint-disable-line function supportsLocalStorage() { try { -- cgit v1.2.3 From 1e7b04d4eada9b1a9064cbd8c9bf2de63ae63e76 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 4 Nov 2016 07:56:04 +0100 Subject: Use created_at as default sort With index (following https://github.com/wallabag/wallabag/pull/2534) --- app/DoctrineMigrations/Version20161104073720.php | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161104073720.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php new file mode 100644 index 00000000..16503b4b --- /dev/null +++ b/app/DoctrineMigrations/Version20161104073720.php @@ -0,0 +1,53 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + $this->addSql('CREATE INDEX `created_at` ON `'.$this->getTable('entry').'` (`created_at` DESC)'); + break; + + case 'mysql': + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD INDEX created_at (created_at);'); + break; + + case 'postgresql': + $this->addSql('CREATE INDEX created_at ON '.$this->getTable('entry').' (created_at DESC)'); + } + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + + } +} -- cgit v1.2.3 From 9ab024b4f5388e2a41c50a8a2b79e4033788782a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 4 Nov 2016 22:44:31 +0100 Subject: Add Pinboard import --- app/config/config.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index 7f24244d..ff0f5a0b 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -266,6 +266,11 @@ old_sound_rabbit_mq: exchange_options: name: 'wallabag.import.readability' type: topic + import_pinboard: + connection: default + exchange_options: + name: 'wallabag.import.pinboard' + type: topic import_instapaper: connection: default exchange_options: @@ -316,6 +321,14 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.instapaper' callback: wallabag_import.consumer.amqp.instapaper + import_pinboard: + connection: default + exchange_options: + name: 'wallabag.import.pinboard' + type: topic + queue_options: + name: 'wallabag.import.pinboard' + callback: wallabag_import.consumer.amqp.pinboard import_wallabag_v1: connection: default exchange_options: -- cgit v1.2.3 From db3838545cef117e05c63afc1e7ebfdf8c8d3a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 6 Nov 2016 15:34:08 +0100 Subject: Removed Maintenance bundle --- app/AppKernel.php | 1 - app/config/config.yml | 10 ---------- 2 files changed, 11 deletions(-) (limited to 'app') diff --git a/app/AppKernel.php b/app/AppKernel.php index 52f85558..342bd139 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -29,7 +29,6 @@ class AppKernel extends Kernel new KPhoen\RulerZBundle\KPhoenRulerZBundle(), new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Craue\ConfigBundle\CraueConfigBundle(), - new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(), new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), // wallabag bundles diff --git a/app/config/config.yml b/app/config/config.yml index 7f24244d..0dc5809a 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -236,16 +236,6 @@ kphoen_rulerz: executors: doctrine: true -lexik_maintenance: - authorized: - ips: ['127.0.0.1'] - driver: - ttl: 3600 - class: 'Lexik\Bundle\MaintenanceBundle\Drivers\DatabaseDriver' - response: - code: 503 - status: "wallabag Service Temporarily Unavailable" - old_sound_rabbit_mq: connections: default: -- cgit v1.2.3 From 8a9604aafe8b8c6ddde4e1be78189af5238588fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 9 Nov 2016 15:44:28 +0100 Subject: Added unmark.it sharing Fix #668 --- app/DoctrineMigrations/Version20161109150755.php | 40 +++++++++++++++++++++ .../translations/CraueConfigBundle.da.yml | 1 + .../translations/CraueConfigBundle.de.yml | 1 + .../translations/CraueConfigBundle.en.yml | 1 + .../translations/CraueConfigBundle.es.yml | 1 + .../translations/CraueConfigBundle.fa.yml | 1 + .../translations/CraueConfigBundle.fr.yml | 1 + .../translations/CraueConfigBundle.it.yml | 1 + .../translations/CraueConfigBundle.oc.yml | 1 + .../translations/CraueConfigBundle.pl.yml | 1 + .../translations/CraueConfigBundle.pt.yml | 1 + .../translations/CraueConfigBundle.ro.yml | 1 + .../translations/CraueConfigBundle.tr.yml | 1 + .../_global/img/icons/unmark-icon--black.png | Bin 0 -> 926 bytes app/Resources/static/themes/baggy/css/main.css | 5 +++ app/Resources/static/themes/material/css/main.css | 5 +++ 16 files changed, 62 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161109150755.php create mode 100644 app/Resources/static/themes/_global/img/icons/unmark-icon--black.png (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161109150755.php b/app/DoctrineMigrations/Version20161109150755.php new file mode 100644 index 00000000..e4d269c4 --- /dev/null +++ b/app/DoctrineMigrations/Version20161109150755.php @@ -0,0 +1,40 @@ +container = $container; + } + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('share_unmark', 0, 'entry')"); + $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); + } + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'share_unmark';"); + $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'unmark_url';"); + } +} diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index 7c323783..8ee0a303 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -15,6 +15,7 @@ share_diaspora: Aktiver deling til Diaspora share_mail: Aktiver deling med email share_shaarli: Aktiver deling gennem Shaarli share_twitter: Aktiver deling gennem Twitter +share_unmark: Aktiver deling gennem Unmark.it show_printlink: Vis et link til print-indhold wallabag_support_url: Support-URL for wallabag wallabag_url: URL for *sin* wallabag-installation diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index 438eb74a..73a9d640 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -15,6 +15,7 @@ share_diaspora: Teilen zu Diaspora aktiveren share_mail: Teilen via E-Mail aktiveren share_shaarli: Teilen zu Shaarli aktiveren share_twitter: Teilen zu Twitter aktiveren +share_unmark: Teilen zu Unmark.it aktiveren show_printlink: Link anzeigen, um den Inhalt auszudrucken wallabag_support_url: Support-URL für wallabag wallabag_url: URL von *deiner* wallabag-Instanz diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index c2f2b3fb..c8c13805 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -15,6 +15,7 @@ share_diaspora: Enable share to Diaspora share_mail: Enable share by email share_shaarli: Enable share to Shaarli share_twitter: Enable share to Twitter +share_unmark: Enable share to Unmark.it show_printlink: Display a link to print content wallabag_support_url: Support URL for wallabag wallabag_url: URL of *your* wallabag instance diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index 76feea50..0ea98d8f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -15,6 +15,7 @@ share_diaspora: Activar compartir con Diaspora share_mail: Activar compartir con email share_shaarli: Activar compartir con Shaarli share_twitter: Activar compartir con Twitter +share_unmark: Activar compartir con Unmark.it show_printlink: Mostrar un enlace para imprimir contenido wallabag_support_url: URL de soporte de wallabag wallabag_url: URL de *tu* instancia de wallabag diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index 30df0086..c527b971 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -15,6 +15,7 @@ share_diaspora: فعال‌سازی هم‌رسانی به Diaspora share_mail: فعال‌سازی هم‌رسانی با ایمیل share_shaarli: فعال‌سازی هم‌رسانی به Shaarli share_twitter: فعال‌سازی هم‌رسانی به Twitter +share_unmark: فعال‌سازی هم‌رسانی به Unmark.it show_printlink: نمایش پیوندی برای چاپ مطلب wallabag_support_url: نشانی صفحهٔ پشتیبانی wallabag wallabag_url: نشانی صفحهٔ wallabag *شما* diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index a60341b3..176e7c86 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -15,6 +15,7 @@ share_diaspora: Activer le partage vers Diaspora share_mail: Activer le partage par email share_shaarli: Activer le partage vers Shaarli share_twitter: Activer le partage vers Twitter +share_unmark: Activer le partage vers Unmark.it show_printlink: Afficher un lien pour imprimer wallabag_support_url: URL de support de wallabag wallabag_url: URL de *votre* instance de wallabag diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index 3ad5f7d0..621d4dcd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -15,6 +15,7 @@ share_diaspora: Abilita la condivisione con Diaspora share_mail: Abilita la condivisione per email share_shaarli: Abilita la condivisione con Shaarli share_twitter: Abilita la condivisione con Twitter +share_unmark: Abilita la condivisione con Unmark.it show_printlink: Mostra un collegamento per stampare il contenuto wallabag_support_url: URL di supporto per wallabag wallabag_url: URL della *tua* installazione di wallabag diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index fd83b437..04accd45 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -15,6 +15,7 @@ share_diaspora: Activar lo partatge cap a Diaspora share_mail: Activar lo partatge per corrièl share_shaarli: Activar lo partatge cap a Shaarli share_twitter: Activar lo partatge cap a Twitter +share_unmark: Activar lo partatge cap a Unmark.it show_printlink: Afichar un ligam per imprimir wallabag_support_url: URL d'assisténcia de wallabag wallabag_url: URL de *vòstra* instància de wallabag diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 3a63eebb..2f4f3154 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -15,6 +15,7 @@ share_diaspora: Włącz udostępnianie dla Diaspora share_mail: Włącz udostępnianie przez email share_shaarli: Włącz udostępnianie dla Shaarli share_twitter: Włącz udostępnianie dla Twitter +share_unmark: Włącz udostępnianie dla Unmark.it show_printlink: Pokaż link do wydrukowania zawartości wallabag_support_url: Adres URL wsparcia dla wallabag wallabag_url: Adres *twojej* instacji wallabag diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index e8260422..5da940e9 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml @@ -14,6 +14,7 @@ share_diaspora: Habilitar compartilhamento para o Diaspora share_mail: Habilitar compartilhamento por e-mail share_shaarli: Habilitar compartilhamento para o Shaarli share_twitter: Habilitar compartilhamento para o Twitter +share_unmark: Habilitar compartilhamento para o Unmark.it show_printlink: Mostrar um link para imprimir o conteúdo wallabag_support_url: URL de Suporte do wallabag wallabag_url: URL de *sua* instância do wallabag diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 4fb42e98..6d2eaffd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -15,6 +15,7 @@ share_diaspora: Permite share către Diaspora share_mail: Permite share prin email share_shaarli: Permite share către Shaarli share_twitter: Permite share către Twitter +share_unmark: Permite share către Unmark.it show_printlink: Afișează un link pentru a printa content-ul wallabag_support_url: URL-ul de suport pentru wallabag wallabag_url: URL-ul instanței tale wallabag diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index ebfadf29..9146bfb6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -15,6 +15,7 @@ # share_mail: Enable share by email # share_shaarli: Enable share to Shaarli # share_twitter: Enable share to Twitter +# share_unmark: Enable share to Unmark.it # show_printlink: Display a link to print content # wallabag_support_url: Support URL for wallabag # wallabag_url: URL of *your* wallabag instance diff --git a/app/Resources/static/themes/_global/img/icons/unmark-icon--black.png b/app/Resources/static/themes/_global/img/icons/unmark-icon--black.png new file mode 100644 index 00000000..45f679ee Binary files /dev/null and b/app/Resources/static/themes/_global/img/icons/unmark-icon--black.png differ diff --git a/app/Resources/static/themes/baggy/css/main.css b/app/Resources/static/themes/baggy/css/main.css index 44db2070..6cf49de1 100755 --- a/app/Resources/static/themes/baggy/css/main.css +++ b/app/Resources/static/themes/baggy/css/main.css @@ -936,6 +936,11 @@ a.add-to-wallabag-link-after::after { background-image: url("../../_global/img/icons/diaspora-icon--black.png"); } +/* Unmark.it */ +.icon-image--unmark { + background-image: url("../../_global/img/icons/unmark-icon--black.png"); +} + /* shaarli */ .icon-image--shaarli { background-image: url("../../_global/img/icons/shaarli.png"); diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 2cc2e8a0..b165d45e 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -124,6 +124,11 @@ background-image: url("../../_global/img/icons/diaspora-icon--black.png"); } +/* Unmark.it */ +.icon-image--unmark { + background-image: url("../../_global/img/icons/unmark-icon--black.png"); +} + /* Shaarli */ .icon-image--shaarli { background-image: url("../../_global/img/icons/shaarli.png"); -- cgit v1.2.3 From 3cc78f06799b0c91957767e8d9255e67b30edd96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 24 Oct 2016 11:20:11 +0200 Subject: Added shortcuts --- app/AppKernel.php | 1 + app/Resources/static/themes/_global/js/tools.js | 12 ++++++++++++ app/config/config.yml | 3 +++ app/config/routing.yml | 3 +++ 4 files changed, 19 insertions(+) (limited to 'app') diff --git a/app/AppKernel.php b/app/AppKernel.php index 342bd139..81b83ef9 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -30,6 +30,7 @@ class AppKernel extends Kernel new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Craue\ConfigBundle\CraueConfigBundle(), new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), + new FOS\JsRoutingBundle\FOSJsRoutingBundle(), // wallabag bundles new Wallabag\CoreBundle\WallabagCoreBundle(), diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 55de090c..9a98f0a6 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,4 +1,5 @@ const $ = require('jquery'); +require('mousetrap'); /* Allows inline call qr-code call */ import jrQrcode from 'jr-qrcode'; // eslint-disable-line @@ -51,3 +52,14 @@ function initExport() { } export { savePercent, retrievePercent, initFilters, initExport }; + +/** Shortcuts **/ + +/* Go to */ +Mousetrap.bind('g u', function() { window.location.href = Routing.generate('homepage') }); +Mousetrap.bind('g s', function() { window.location.href = Routing.generate('starred') }); + +/* Actions */ +Mousetrap.bind('g a', function() { + $("#nav-btn-add").trigger("click"); +}); diff --git a/app/config/config.yml b/app/config/config.yml index 168634cf..494a67a9 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -351,3 +351,6 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.chrome' callback: wallabag_import.consumer.amqp.chrome + +fos_js_routing: + routes_to_expose: [ homepage, starred, archive, all, tag, config, import, developer, howto, about, logout ] diff --git a/app/config/routing.yml b/app/config/routing.yml index 750ed435..eedf51d5 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -52,3 +52,6 @@ craue_config_settings_modify: path: /settings defaults: _controller: CraueConfigBundle:Settings:modify + +fos_js_routing: + resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml" -- cgit v1.2.3 From 49c5d0ad6ef5ceafdc0bec4533afcd27a01bd75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 24 Oct 2016 12:58:19 +0200 Subject: Changed FOSJSRouting format in config --- app/config/config.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index 494a67a9..3cde2377 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -353,4 +353,15 @@ old_sound_rabbit_mq: callback: wallabag_import.consumer.amqp.chrome fos_js_routing: - routes_to_expose: [ homepage, starred, archive, all, tag, config, import, developer, howto, about, logout ] + routes_to_expose: + - homepage + - starred + - archive + - all + - tag + - config + - import + - developer + - howto + - about + - logout -- cgit v1.2.3 From f9cded7dd2acab3af8ff8481941e0c199daf8270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 24 Oct 2016 20:37:49 +0200 Subject: Added new shortcuts --- app/Resources/static/themes/_global/js/tools.js | 37 ++++++++++++++++++++++++- app/config/config.yml | 1 - 2 files changed, 36 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 9a98f0a6..d6a2d803 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -58,8 +58,43 @@ export { savePercent, retrievePercent, initFilters, initExport }; /* Go to */ Mousetrap.bind('g u', function() { window.location.href = Routing.generate('homepage') }); Mousetrap.bind('g s', function() { window.location.href = Routing.generate('starred') }); +Mousetrap.bind('g r', function() { window.location.href = Routing.generate('archive') }); +Mousetrap.bind('g a', function() { window.location.href = Routing.generate('all') }); +Mousetrap.bind('g t', function() { window.location.href = Routing.generate('tag') }); +Mousetrap.bind('g c', function() { window.location.href = Routing.generate('config') }); +Mousetrap.bind('g i', function() { window.location.href = Routing.generate('import') }); +Mousetrap.bind('g d', function() { window.location.href = Routing.generate('developer') }); +Mousetrap.bind('g h', function() { window.location.href = Routing.generate('howto') }); +Mousetrap.bind('g l', function() { window.location.href = Routing.generate('logout') }); + /* Actions */ -Mousetrap.bind('g a', function() { +Mousetrap.bind('g n', function() { $("#nav-btn-add").trigger("click"); }); + +Mousetrap.bind('esc', function() { + $(".close").trigger("click"); +}); + +// Display the first element of the current view +Mousetrap.bind('right', function() { + $("ul.data li:first-child span.dot-ellipsis a")[0].click(); +}); + +/* Article view */ +Mousetrap.bind('o', function() { + $("ul.side-nav li:nth-child(2) a i")[0].click(); +}); + +Mousetrap.bind('s', function() { + $("ul.side-nav li:nth-child(5) a i")[0].click(); +}); + +Mousetrap.bind('a', function() { + $("ul.side-nav li:nth-child(4) a i")[0].click(); +}); + +Mousetrap.bind('del', function() { + $("ul.side-nav li:nth-child(6) a i")[0].click(); +}); diff --git a/app/config/config.yml b/app/config/config.yml index 3cde2377..e0e1ad97 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -363,5 +363,4 @@ fos_js_routing: - import - developer - howto - - about - logout -- cgit v1.2.3 From af61cb80eb600618df95a01a15a08e87fc878c2a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 27 Oct 2016 01:57:27 +0200 Subject: es6 imports Signed-off-by: Thomas Citharel --- .../static/themes/_global/js/bookmarklet.js | 1 - app/Resources/static/themes/_global/js/tools.js | 52 +++++++++++----------- .../static/themes/baggy/js/autoCompleteTags.js | 2 +- app/Resources/static/themes/baggy/js/init.js | 18 +++++--- app/Resources/static/themes/baggy/js/uiTools.js | 4 +- app/Resources/static/themes/material/js/init.js | 6 +-- 6 files changed, 44 insertions(+), 39 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/bookmarklet.js b/app/Resources/static/themes/_global/js/bookmarklet.js index 5174ff47..a497628b 100644 --- a/app/Resources/static/themes/_global/js/bookmarklet.js +++ b/app/Resources/static/themes/_global/js/bookmarklet.js @@ -1,4 +1,3 @@ - top['bookmarklet-url@wallabag.org'] = 'bag it!' + '' + diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index d6a2d803..96d9fcf6 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,5 +1,5 @@ -const $ = require('jquery'); -require('mousetrap'); +import $ from 'jquery'; +import Mousetrap from 'mousetrap'; /* Allows inline call qr-code call */ import jrQrcode from 'jr-qrcode'; // eslint-disable-line @@ -56,45 +56,45 @@ export { savePercent, retrievePercent, initFilters, initExport }; /** Shortcuts **/ /* Go to */ -Mousetrap.bind('g u', function() { window.location.href = Routing.generate('homepage') }); -Mousetrap.bind('g s', function() { window.location.href = Routing.generate('starred') }); -Mousetrap.bind('g r', function() { window.location.href = Routing.generate('archive') }); -Mousetrap.bind('g a', function() { window.location.href = Routing.generate('all') }); -Mousetrap.bind('g t', function() { window.location.href = Routing.generate('tag') }); -Mousetrap.bind('g c', function() { window.location.href = Routing.generate('config') }); -Mousetrap.bind('g i', function() { window.location.href = Routing.generate('import') }); -Mousetrap.bind('g d', function() { window.location.href = Routing.generate('developer') }); -Mousetrap.bind('g h', function() { window.location.href = Routing.generate('howto') }); -Mousetrap.bind('g l', function() { window.location.href = Routing.generate('logout') }); +Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); }); +Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); }); +Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); }); +Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); }); +Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); }); +Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); }); +Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); }); +Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); }); +Mousetrap.bind('g h', () => { window.location.href = Routing.generate('howto'); }); +Mousetrap.bind('g l', () => { window.location.href = Routing.generate('logout'); }); /* Actions */ -Mousetrap.bind('g n', function() { - $("#nav-btn-add").trigger("click"); +Mousetrap.bind('g n', () => { + $('#nav-btn-add').trigger('click'); }); -Mousetrap.bind('esc', function() { - $(".close").trigger("click"); +Mousetrap.bind('esc', () => { + $('.close').trigger('click'); }); // Display the first element of the current view -Mousetrap.bind('right', function() { - $("ul.data li:first-child span.dot-ellipsis a")[0].click(); +Mousetrap.bind('right', () => { + $('ul.data li:first-child span.dot-ellipsis a')[0].click(); }); /* Article view */ -Mousetrap.bind('o', function() { - $("ul.side-nav li:nth-child(2) a i")[0].click(); +Mousetrap.bind('o', () => { + $('ul.side-nav li:nth-child(2) a i')[0].click(); }); -Mousetrap.bind('s', function() { - $("ul.side-nav li:nth-child(5) a i")[0].click(); +Mousetrap.bind('s', () => { + $('ul.side-nav li:nth-child(5) a i')[0].click(); }); -Mousetrap.bind('a', function() { - $("ul.side-nav li:nth-child(4) a i")[0].click(); +Mousetrap.bind('a', () => { + $('ul.side-nav li:nth-child(4) a i')[0].click(); }); -Mousetrap.bind('del', function() { - $("ul.side-nav li:nth-child(6) a i")[0].click(); +Mousetrap.bind('del', () => { + $('ul.side-nav li:nth-child(6) a i')[0].click(); }); diff --git a/app/Resources/static/themes/baggy/js/autoCompleteTags.js b/app/Resources/static/themes/baggy/js/autoCompleteTags.js index f287ebfa..64fdaa92 100755 --- a/app/Resources/static/themes/baggy/js/autoCompleteTags.js +++ b/app/Resources/static/themes/baggy/js/autoCompleteTags.js @@ -5,4 +5,4 @@ function extractLast(term) { return split(term).pop(); } -export { split, extractLast }; +export default { split, extractLast }; diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js index dc11043a..b7347f7c 100755 --- a/app/Resources/static/themes/baggy/js/init.js +++ b/app/Resources/static/themes/baggy/js/init.js @@ -1,11 +1,17 @@ -import { savePercent, retrievePercent } from '../../_global/js/tools'; -import { toggleSaveLinkForm } from './uiTools'; +import $ from 'jquery'; + +/* eslint-disable no-unused-vars */ +/* jquery has default scope */ +import cookie from 'jquery.cookie'; +import ui from 'jquery-ui-browserify'; +/* eslint-enable no-unused-vars */ -const $ = global.jquery = require('jquery'); -require('jquery.cookie'); -require('jquery-ui-browserify'); -const annotator = require('annotator'); +import annotator from 'annotator'; + +import { savePercent, retrievePercent } from '../../_global/js/tools'; +import toggleSaveLinkForm from './uiTools'; +global.jquery = $; $.fn.ready(() => { const $listmode = $('#listmode'); diff --git a/app/Resources/static/themes/baggy/js/uiTools.js b/app/Resources/static/themes/baggy/js/uiTools.js index 900b2707..713c53f7 100644 --- a/app/Resources/static/themes/baggy/js/uiTools.js +++ b/app/Resources/static/themes/baggy/js/uiTools.js @@ -1,4 +1,4 @@ -const $ = require('jquery'); +import $ from 'jquery'; function toggleSaveLinkForm(url, event) { $('#add-link-result').empty(); @@ -32,4 +32,4 @@ function toggleSaveLinkForm(url, event) { plainUrl.focus(); } -export { toggleSaveLinkForm }; +export default toggleSaveLinkForm; diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index a68269e0..d8edeed1 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js @@ -1,10 +1,10 @@ +import $ from 'jquery'; +import annotator from 'annotator'; import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; -const $ = require('jquery'); +require('materialize'); // eslint-disable-line global.jQuery = $; -require('materialize'); // eslint-disable-line -const annotator = require('annotator'); $(document).ready(() => { // sideNav -- cgit v1.2.3 From 16ef7607f43ebc3e0134360b7657af191e14fe12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 2 Nov 2016 16:44:20 +0100 Subject: Reorganized JS folders for shortcuts --- .../static/themes/_global/js/shortcuts/entry.js | 0 .../static/themes/_global/js/shortcuts/main.js | 13 ++++++ app/Resources/static/themes/_global/js/tools.js | 48 +--------------------- app/Resources/static/themes/baggy/js/init.js | 3 ++ .../static/themes/baggy/js/shortcuts/entry.js | 19 +++++++++ .../static/themes/baggy/js/shortcuts/main.js | 0 app/Resources/static/themes/material/js/init.js | 2 + .../static/themes/material/js/shortcuts/entry.js | 19 +++++++++ .../static/themes/material/js/shortcuts/main.js | 13 ++++++ 9 files changed, 71 insertions(+), 46 deletions(-) create mode 100644 app/Resources/static/themes/_global/js/shortcuts/entry.js create mode 100644 app/Resources/static/themes/_global/js/shortcuts/main.js create mode 100644 app/Resources/static/themes/baggy/js/shortcuts/entry.js create mode 100644 app/Resources/static/themes/baggy/js/shortcuts/main.js create mode 100644 app/Resources/static/themes/material/js/shortcuts/entry.js create mode 100644 app/Resources/static/themes/material/js/shortcuts/main.js (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/shortcuts/entry.js b/app/Resources/static/themes/_global/js/shortcuts/entry.js new file mode 100644 index 00000000..e69de29b diff --git a/app/Resources/static/themes/_global/js/shortcuts/main.js b/app/Resources/static/themes/_global/js/shortcuts/main.js new file mode 100644 index 00000000..0bb962d0 --- /dev/null +++ b/app/Resources/static/themes/_global/js/shortcuts/main.js @@ -0,0 +1,13 @@ +/** Shortcuts **/ + +/* Go to */ +Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); }); +Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); }); +Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); }); +Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); }); +Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); }); +Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); }); +Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); }); +Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); }); +Mousetrap.bind('?', () => { window.location.href = Routing.generate('howto'); }); +Mousetrap.bind('g l', () => { window.location.href = Routing.generate('logout'); }); diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 96d9fcf6..77879dcd 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,5 +1,7 @@ import $ from 'jquery'; import Mousetrap from 'mousetrap'; +import './shortcuts/main.js'; +import './shortcuts/entry.js'; /* Allows inline call qr-code call */ import jrQrcode from 'jr-qrcode'; // eslint-disable-line @@ -52,49 +54,3 @@ function initExport() { } export { savePercent, retrievePercent, initFilters, initExport }; - -/** Shortcuts **/ - -/* Go to */ -Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); }); -Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); }); -Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); }); -Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); }); -Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); }); -Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); }); -Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); }); -Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); }); -Mousetrap.bind('g h', () => { window.location.href = Routing.generate('howto'); }); -Mousetrap.bind('g l', () => { window.location.href = Routing.generate('logout'); }); - - -/* Actions */ -Mousetrap.bind('g n', () => { - $('#nav-btn-add').trigger('click'); -}); - -Mousetrap.bind('esc', () => { - $('.close').trigger('click'); -}); - -// Display the first element of the current view -Mousetrap.bind('right', () => { - $('ul.data li:first-child span.dot-ellipsis a')[0].click(); -}); - -/* Article view */ -Mousetrap.bind('o', () => { - $('ul.side-nav li:nth-child(2) a i')[0].click(); -}); - -Mousetrap.bind('s', () => { - $('ul.side-nav li:nth-child(5) a i')[0].click(); -}); - -Mousetrap.bind('a', () => { - $('ul.side-nav li:nth-child(4) a i')[0].click(); -}); - -Mousetrap.bind('del', () => { - $('ul.side-nav li:nth-child(6) a i')[0].click(); -}); diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js index b7347f7c..5a8911ad 100755 --- a/app/Resources/static/themes/baggy/js/init.js +++ b/app/Resources/static/themes/baggy/js/init.js @@ -1,4 +1,7 @@ import $ from 'jquery'; +import { initFilters, initExport } from '../../_global/js/tools'; +import './shortcuts/main.js'; +import './shortcuts/entry.js'; /* eslint-disable no-unused-vars */ /* jquery has default scope */ diff --git a/app/Resources/static/themes/baggy/js/shortcuts/entry.js b/app/Resources/static/themes/baggy/js/shortcuts/entry.js new file mode 100644 index 00000000..d618f28e --- /dev/null +++ b/app/Resources/static/themes/baggy/js/shortcuts/entry.js @@ -0,0 +1,19 @@ +/* Article view */ +Mousetrap.bind('o', () => { + $('div#article_toolbar ul.links li:nth-child(2) a')[0].click(); +}); + +/* mark as favorite */ +Mousetrap.bind('s', () => { + $('div#article_toolbar ul.links li:nth-child(5) a')[0].click(); +}); + +/* mark as read */ +Mousetrap.bind('a', () => { + $('div#article_toolbar ul.links li:nth-child(4) a')[0].click(); +}); + +/* delete */ +Mousetrap.bind('del', () => { + $('div#article_toolbar ul.links li:nth-child(7) a')[0].click(); +}); diff --git a/app/Resources/static/themes/baggy/js/shortcuts/main.js b/app/Resources/static/themes/baggy/js/shortcuts/main.js new file mode 100644 index 00000000..e69de29b diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index d8edeed1..3ff8de0a 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js @@ -1,6 +1,8 @@ import $ from 'jquery'; import annotator from 'annotator'; import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; +import './shortcuts/main.js'; +import './shortcuts/entry.js'; require('materialize'); // eslint-disable-line diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js new file mode 100644 index 00000000..900a8214 --- /dev/null +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js @@ -0,0 +1,19 @@ +/* open original article */ +Mousetrap.bind('o', () => { + $('ul.side-nav li:nth-child(2) a i')[0].click(); +}); + +/* mark as favorite */ +Mousetrap.bind('s', () => { + $('ul.side-nav li:nth-child(5) a i')[0].click(); +}); + +/* mark as read */ +Mousetrap.bind('a', () => { + $('ul.side-nav li:nth-child(4) a i')[0].click(); +}); + +/* delete */ +Mousetrap.bind('del', () => { + $('ul.side-nav li:nth-child(6) a i')[0].click(); +}); diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js new file mode 100644 index 00000000..ccd3c92d --- /dev/null +++ b/app/Resources/static/themes/material/js/shortcuts/main.js @@ -0,0 +1,13 @@ +/* Actions */ +Mousetrap.bind('g n', () => { + $('#nav-btn-add').trigger('click'); +}); + +Mousetrap.bind('esc', () => { + $('.close').trigger('click'); +}); + +// Display the first element of the current view +Mousetrap.bind('right', () => { + $('ul.data li:first-child span.dot-ellipsis a')[0].click(); +}); -- cgit v1.2.3 From 5637a26e9af98a05c76823c85611315cd1a986e0 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 3 Nov 2016 10:02:16 +0100 Subject: Bring navigation (with right, left and enter) on material entries page. Supports going to next and previous page ! Also better indentation for js files (changed editorconfig for them). Signed-off-by: Thomas Citharel --- .../static/themes/_global/js/shortcuts/main.js | 3 + app/Resources/static/themes/_global/js/tools.js | 5 +- app/Resources/static/themes/baggy/js/init.js | 12 +++- .../static/themes/baggy/js/shortcuts/entry.js | 11 ++-- app/Resources/static/themes/material/js/init.js | 13 +++- .../static/themes/material/js/shortcuts/entry.js | 11 ++-- .../static/themes/material/js/shortcuts/main.js | 74 +++++++++++++++++++--- 7 files changed, 105 insertions(+), 24 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/shortcuts/main.js b/app/Resources/static/themes/_global/js/shortcuts/main.js index 0bb962d0..1f2c1c52 100644 --- a/app/Resources/static/themes/_global/js/shortcuts/main.js +++ b/app/Resources/static/themes/_global/js/shortcuts/main.js @@ -1,3 +1,6 @@ +import Mousetrap from 'mousetrap'; + + /** Shortcuts **/ /* Go to */ diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 77879dcd..568b2dce 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,7 +1,6 @@ import $ from 'jquery'; -import Mousetrap from 'mousetrap'; -import './shortcuts/main.js'; -import './shortcuts/entry.js'; +import './shortcuts/main'; +import './shortcuts/entry'; /* Allows inline call qr-code call */ import jrQrcode from 'jr-qrcode'; // eslint-disable-line diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js index 5a8911ad..05360a28 100755 --- a/app/Resources/static/themes/baggy/js/init.js +++ b/app/Resources/static/themes/baggy/js/init.js @@ -1,7 +1,5 @@ +/* jQuery */ import $ from 'jquery'; -import { initFilters, initExport } from '../../_global/js/tools'; -import './shortcuts/main.js'; -import './shortcuts/entry.js'; /* eslint-disable no-unused-vars */ /* jquery has default scope */ @@ -9,8 +7,16 @@ import cookie from 'jquery.cookie'; import ui from 'jquery-ui-browserify'; /* eslint-enable no-unused-vars */ +/* Annotations */ import annotator from 'annotator'; +/* Shortcuts */ +import './shortcuts/main'; +import './shortcuts/entry'; +import '../../_global/js/shortcuts/main'; +import '../../_global/js/shortcuts/entry'; + +/* Tools */ import { savePercent, retrievePercent } from '../../_global/js/tools'; import toggleSaveLinkForm from './uiTools'; diff --git a/app/Resources/static/themes/baggy/js/shortcuts/entry.js b/app/Resources/static/themes/baggy/js/shortcuts/entry.js index d618f28e..77d267a3 100644 --- a/app/Resources/static/themes/baggy/js/shortcuts/entry.js +++ b/app/Resources/static/themes/baggy/js/shortcuts/entry.js @@ -1,19 +1,22 @@ +import Mousetrap from 'mousetrap'; +import $ from 'jquery'; + /* Article view */ Mousetrap.bind('o', () => { - $('div#article_toolbar ul.links li:nth-child(2) a')[0].click(); + $('div#article_toolbar ul.links li:nth-child(2) a')[0].click(); }); /* mark as favorite */ Mousetrap.bind('s', () => { - $('div#article_toolbar ul.links li:nth-child(5) a')[0].click(); + $('div#article_toolbar ul.links li:nth-child(5) a')[0].click(); }); /* mark as read */ Mousetrap.bind('a', () => { - $('div#article_toolbar ul.links li:nth-child(4) a')[0].click(); + $('div#article_toolbar ul.links li:nth-child(4) a')[0].click(); }); /* delete */ Mousetrap.bind('del', () => { - $('div#article_toolbar ul.links li:nth-child(7) a')[0].click(); + $('div#article_toolbar ul.links li:nth-child(7) a')[0].click(); }); diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index 3ff8de0a..9746224b 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js @@ -1,8 +1,17 @@ +/* jQuery */ import $ from 'jquery'; + +/* Annotations */ import annotator from 'annotator'; + +/* Tools */ import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; -import './shortcuts/main.js'; -import './shortcuts/entry.js'; + +/* Import shortcuts */ +import './shortcuts/main'; +import './shortcuts/entry'; +import '../../_global/js/shortcuts/main'; +import '../../_global/js/shortcuts/entry'; require('materialize'); // eslint-disable-line diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js index 900a8214..674253b5 100644 --- a/app/Resources/static/themes/material/js/shortcuts/entry.js +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js @@ -1,19 +1,22 @@ +import Mousetrap from 'mousetrap'; +import $ from 'jquery'; + /* open original article */ Mousetrap.bind('o', () => { - $('ul.side-nav li:nth-child(2) a i')[0].click(); + $('ul.side-nav li:nth-child(2) a i')[0].click(); }); /* mark as favorite */ Mousetrap.bind('s', () => { - $('ul.side-nav li:nth-child(5) a i')[0].click(); + $('ul.side-nav li:nth-child(5) a i')[0].click(); }); /* mark as read */ Mousetrap.bind('a', () => { - $('ul.side-nav li:nth-child(4) a i')[0].click(); + $('ul.side-nav li:nth-child(4) a i')[0].click(); }); /* delete */ Mousetrap.bind('del', () => { - $('ul.side-nav li:nth-child(6) a i')[0].click(); + $('ul.side-nav li:nth-child(6) a i')[0].click(); }); diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js index ccd3c92d..62b7ec64 100644 --- a/app/Resources/static/themes/material/js/shortcuts/main.js +++ b/app/Resources/static/themes/material/js/shortcuts/main.js @@ -1,13 +1,71 @@ -/* Actions */ -Mousetrap.bind('g n', () => { +import Mousetrap from 'mousetrap'; +import $ from 'jquery'; + +function toggleFocus(cardToToogleFocus) { + if (cardToToogleFocus) { + $(cardToToogleFocus).toggleClass('z-depth-4'); + } +} +let card; +let cardIndex; +let cardNumber; +let pagination; + +$(document).ready(() => { + cardIndex = 0; + cardNumber = $('#content ul.data > li').length; + card = $('#content ul.data > li')[cardIndex]; + pagination = $('.pagination'); + + /* If we come from next page */ + if (window.location.hash === '#prev') { + cardIndex = cardNumber - 1; + card = $('ul.data > li')[cardIndex]; + } + + /* Focus current card */ + toggleFocus(card); + + /* Actions */ + Mousetrap.bind('g n', () => { $('#nav-btn-add').trigger('click'); -}); + }); -Mousetrap.bind('esc', () => { + Mousetrap.bind('esc', () => { $('.close').trigger('click'); -}); + }); + + /* Select right card. If there's a next page, go to next page */ + Mousetrap.bind('right', () => { + if (cardIndex >= 0 && cardIndex < cardNumber - 1) { + toggleFocus(card); + cardIndex += 1; + card = $('ul.data > li')[cardIndex]; + toggleFocus(card); + return; + } + if (pagination != null && pagination.find('li.next') && cardIndex === cardNumber - 1) { + window.location.href = window.location.origin + $(pagination).find('li.next a').attr('href'); + return; + } + }); + + /* Select previous card. If there's a previous page, go to next page */ + Mousetrap.bind('left', () => { + if (cardIndex > 0 && cardIndex < cardNumber) { + toggleFocus(card); + cardIndex -= 1; + card = $('ul.data > li')[cardIndex]; + toggleFocus(card); + return; + } + if (pagination !== null && $(pagination).find('li.prev') && cardIndex === 0) { + window.location.href = `${window.location.origin + $(pagination).find('li.prev a').attr('href')}#prev`; + return; + } + }); -// Display the first element of the current view -Mousetrap.bind('right', () => { - $('ul.data li:first-child span.dot-ellipsis a')[0].click(); + Mousetrap.bind('enter', () => { + window.location.href = window.location.origin + $(card).find('span.card-title a').attr('href'); + }); }); -- cgit v1.2.3 From c930992348d81c70884791ee3edbec4a3cc1d128 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sat, 5 Nov 2016 16:06:13 +0100 Subject: fix next/prev page --- .../static/themes/_global/js/shortcuts/main.js | 1 - .../static/themes/material/js/shortcuts/main.js | 18 ++++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/shortcuts/main.js b/app/Resources/static/themes/_global/js/shortcuts/main.js index 1f2c1c52..ef6a1b84 100644 --- a/app/Resources/static/themes/_global/js/shortcuts/main.js +++ b/app/Resources/static/themes/_global/js/shortcuts/main.js @@ -1,6 +1,5 @@ import Mousetrap from 'mousetrap'; - /** Shortcuts **/ /* Go to */ diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js index 62b7ec64..ba396841 100644 --- a/app/Resources/static/themes/material/js/shortcuts/main.js +++ b/app/Resources/static/themes/material/js/shortcuts/main.js @@ -6,16 +6,12 @@ function toggleFocus(cardToToogleFocus) { $(cardToToogleFocus).toggleClass('z-depth-4'); } } -let card; -let cardIndex; -let cardNumber; -let pagination; $(document).ready(() => { - cardIndex = 0; - cardNumber = $('#content ul.data > li').length; - card = $('#content ul.data > li')[cardIndex]; - pagination = $('.pagination'); + let cardIndex = 0; + const cardNumber = $('#content ul.data > li').length; + let card = $('#content ul.data > li')[cardIndex]; + const pagination = $('.pagination'); /* If we come from next page */ if (window.location.hash === '#prev') { @@ -44,9 +40,8 @@ $(document).ready(() => { toggleFocus(card); return; } - if (pagination != null && pagination.find('li.next') && cardIndex === cardNumber - 1) { + if (pagination.length > 0 && pagination.find('li.next:not(.disabled)').length > 0 && cardIndex === cardNumber - 1) { window.location.href = window.location.origin + $(pagination).find('li.next a').attr('href'); - return; } }); @@ -59,9 +54,8 @@ $(document).ready(() => { toggleFocus(card); return; } - if (pagination !== null && $(pagination).find('li.prev') && cardIndex === 0) { + if (pagination.length > 0 && $(pagination).find('li.prev:not(.disabled)').length > 0 && cardIndex === 0) { window.location.href = `${window.location.origin + $(pagination).find('li.prev a').attr('href')}#prev`; - return; } }); -- cgit v1.2.3 From 10a1ffae5313b0f77287b92aca93bb0066d3b1e3 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 15 Nov 2016 22:23:50 +0100 Subject: Fix keyboard navigation on quickstart view Signed-off-by: Thomas Citharel --- app/Resources/static/themes/material/js/shortcuts/main.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js index ba396841..8514f71e 100644 --- a/app/Resources/static/themes/material/js/shortcuts/main.js +++ b/app/Resources/static/themes/material/js/shortcuts/main.js @@ -13,6 +13,11 @@ $(document).ready(() => { let card = $('#content ul.data > li')[cardIndex]; const pagination = $('.pagination'); + /* Show nothing on quickstart */ + if ($('#content > div.quickstart').length > 0) { + return; + } + /* If we come from next page */ if (window.location.hash === '#prev') { cardIndex = cardNumber - 1; -- cgit v1.2.3 From 94f2057ffefdb164ae388a6971b4ed052082a434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 16 Nov 2016 09:17:12 +0100 Subject: Added CSS class on links --- app/Resources/static/themes/baggy/js/shortcuts/entry.js | 8 ++++---- app/Resources/static/themes/material/js/shortcuts/entry.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/baggy/js/shortcuts/entry.js b/app/Resources/static/themes/baggy/js/shortcuts/entry.js index 77d267a3..728df8bd 100644 --- a/app/Resources/static/themes/baggy/js/shortcuts/entry.js +++ b/app/Resources/static/themes/baggy/js/shortcuts/entry.js @@ -3,20 +3,20 @@ import $ from 'jquery'; /* Article view */ Mousetrap.bind('o', () => { - $('div#article_toolbar ul.links li:nth-child(2) a')[0].click(); + $('div#article_toolbar ul.links a.original')[0].click(); }); /* mark as favorite */ Mousetrap.bind('s', () => { - $('div#article_toolbar ul.links li:nth-child(5) a')[0].click(); + $('div#article_toolbar ul.links a.favorite')[0].click(); }); /* mark as read */ Mousetrap.bind('a', () => { - $('div#article_toolbar ul.links li:nth-child(4) a')[0].click(); + $('div#article_toolbar ul.links a.markasread')[0].click(); }); /* delete */ Mousetrap.bind('del', () => { - $('div#article_toolbar ul.links li:nth-child(7) a')[0].click(); + $('div#article_toolbar ul.links a.delete')[0].click(); }); diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js index 674253b5..357c22fe 100644 --- a/app/Resources/static/themes/material/js/shortcuts/entry.js +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js @@ -3,20 +3,20 @@ import $ from 'jquery'; /* open original article */ Mousetrap.bind('o', () => { - $('ul.side-nav li:nth-child(2) a i')[0].click(); + $('ul.side-nav a.original i')[0].click(); }); /* mark as favorite */ Mousetrap.bind('s', () => { - $('ul.side-nav li:nth-child(5) a i')[0].click(); + $('ul.side-nav a.favorite i')[0].click(); }); /* mark as read */ Mousetrap.bind('a', () => { - $('ul.side-nav li:nth-child(4) a i')[0].click(); + $('ul.side-nav a.markasread i')[0].click(); }); /* delete */ Mousetrap.bind('del', () => { - $('ul.side-nav li:nth-child(6) a i')[0].click(); + $('ul.side-nav a.delete i')[0].click(); }); -- cgit v1.2.3 From a42f38d9fb7906b785285fab2a09f8c2b9efe996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 6 Nov 2016 12:02:39 +0100 Subject: Added a configuration to define the redirection after archiving an entry Fix #496 --- app/DoctrineMigrations/Version20161106113822.php | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161106113822.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php new file mode 100644 index 00000000..41e64a4a --- /dev/null +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -0,0 +1,42 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql('ALTER TABLE "'.$this->getTable('config').'" ADD action_mark_as_read INT DEFAULT 0'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + + $this->addSql('ALTER TABLE "'.$this->getTable('config').'" DROP action_mark_as_read'); + } +} -- cgit v1.2.3 From 9e2440fe15633532c2bf62feac1535a85d6eb840 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 17 Nov 2016 08:05:15 +0100 Subject: Fix migration --- app/DoctrineMigrations/Version20161106113822.php | 8 +++-- app/DoctrineMigrations/Version20161109150755.php | 40 --------------------- app/DoctrineMigrations/Version20161117071626.php | 44 ++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 43 deletions(-) delete mode 100644 app/DoctrineMigrations/Version20161109150755.php create mode 100644 app/DoctrineMigrations/Version20161117071626.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index 41e64a4a..edca54f5 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -4,8 +4,10 @@ namespace Application\Migrations; use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; -class Version20161106113822 extends AbstractMigration +class Version20161106113822 extends AbstractMigration implements ContainerAwareInterface { /** * @var ContainerInterface @@ -27,7 +29,7 @@ class Version20161106113822 extends AbstractMigration */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE "'.$this->getTable('config').'" ADD action_mark_as_read INT DEFAULT 0'); + $this->addSql('ALTER TABLE '.$this->getTable('config').' ADD action_mark_as_read INT DEFAULT 0'); } /** @@ -37,6 +39,6 @@ class Version20161106113822 extends AbstractMigration { $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); - $this->addSql('ALTER TABLE "'.$this->getTable('config').'" DROP action_mark_as_read'); + $this->addSql('ALTER TABLE '.$this->getTable('config').' DROP action_mark_as_read'); } } diff --git a/app/DoctrineMigrations/Version20161109150755.php b/app/DoctrineMigrations/Version20161109150755.php deleted file mode 100644 index e4d269c4..00000000 --- a/app/DoctrineMigrations/Version20161109150755.php +++ /dev/null @@ -1,40 +0,0 @@ -container = $container; - } - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } - /** - * @param Schema $schema - */ - public function up(Schema $schema) - { - $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('share_unmark', 0, 'entry')"); - $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); - } - /** - * @param Schema $schema - */ - public function down(Schema $schema) - { - $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'share_unmark';"); - $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'unmark_url';"); - } -} diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php new file mode 100644 index 00000000..9ae55b5f --- /dev/null +++ b/app/DoctrineMigrations/Version20161117071626.php @@ -0,0 +1,44 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); + $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'share_unmark';"); + $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'unmark_url';"); + } +} -- cgit v1.2.3 From 10b3509757c704943aa9cdd69c1d02bedfa937a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 18 Nov 2016 15:09:21 +0100 Subject: Added http_status in Entry entity --- app/DoctrineMigrations/Version20161118134328.php | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161118134328.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php new file mode 100644 index 00000000..b5413ddc --- /dev/null +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -0,0 +1,47 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status INT DEFAULT 0'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + + $this->addSql('ALTER TABLE '.$this->getTable('entry').' DROP http_status'); + } +} -- cgit v1.2.3 From e10e6ab34e62129d57fc69d7b9b69b08c20e6f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 18 Nov 2016 15:55:16 +0100 Subject: Replace http status with a string I don't want to have 0 if we don't fetch status code, I think it's better to have an empty string, mainly for filters --- app/DoctrineMigrations/Version20161118134328.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index b5413ddc..390e89ce 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -32,7 +32,7 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status INT DEFAULT 0'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status VARCHAR(3) DEFAULT NULL'); } /** -- cgit v1.2.3 From ee122a7528f55dfb5f02e351c509d00b756fedaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 4 Nov 2016 23:24:43 +0100 Subject: Added a simple search engine Fix #18 --- app/Resources/static/themes/material/css/main.css | 10 +++++++--- app/Resources/static/themes/material/js/init.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index df126fb4..21f948b1 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -322,11 +322,13 @@ nav input { color: #444; } -.input-field.nav-panel-add label { +.input-field.nav-panel-add label, +.input-field.nav-panel-search label { left: 1rem; } -.input-field.nav-panel-add .close { +.input-field.nav-panel-add .close, +.input-field.nav-panel-search .close { position: absolute; top: 0; right: 1rem; @@ -345,7 +347,9 @@ nav input { } .input-field.nav-panel-add, -.input-field.nav-panel-add form { +.input-field.nav-panel-add form, +.input-field.nav-panel-search, +.input-field.nav-panel-search form{ height: 100%; } diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index 9746224b..0b2832c0 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js @@ -55,7 +55,7 @@ $(document).ready(() => { $('.nav-panels .action').hide(100); $('.nav-panel-menu').addClass('hidden'); $('.nav-panels').css('background', 'white'); - $('#searchfield').focus(); + $('#search_entry_term').focus(); return false; }); $('.close').on('click', () => { -- cgit v1.2.3 From 32f455c1317bf536aea63147d2c5074ae7425d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 18 Nov 2016 17:36:19 +0100 Subject: Added tests --- app/Resources/static/themes/material/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 21f948b1..8e33cfbc 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -349,7 +349,7 @@ nav input { .input-field.nav-panel-add, .input-field.nav-panel-add form, .input-field.nav-panel-search, -.input-field.nav-panel-search form{ +.input-field.nav-panel-search form { height: 100%; } -- cgit v1.2.3 From 995c204428dd6be04d2bff1d5e17f3e95268f44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 18 Nov 2016 19:21:31 +0100 Subject: Added shortcut --- app/Resources/static/themes/baggy/js/shortcuts/main.js | 7 +++++++ app/Resources/static/themes/material/js/shortcuts/main.js | 6 ++++++ app/config/config.yml | 1 + 3 files changed, 14 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/baggy/js/shortcuts/main.js b/app/Resources/static/themes/baggy/js/shortcuts/main.js index e69de29b..aed09aee 100644 --- a/app/Resources/static/themes/baggy/js/shortcuts/main.js +++ b/app/Resources/static/themes/baggy/js/shortcuts/main.js @@ -0,0 +1,7 @@ +$(document).ready(() => { + Mousetrap.bind('s', () => { + $('#search').trigger('click'); + $('#search_entry_term').focus(); + return false; + }); +}); diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js index 8514f71e..ad4ca80a 100644 --- a/app/Resources/static/themes/material/js/shortcuts/main.js +++ b/app/Resources/static/themes/material/js/shortcuts/main.js @@ -30,6 +30,12 @@ $(document).ready(() => { /* Actions */ Mousetrap.bind('g n', () => { $('#nav-btn-add').trigger('click'); + return false; + }); + + Mousetrap.bind('s', () => { + $('#nav-btn-search').trigger('click'); + return false; }); Mousetrap.bind('esc', () => { diff --git a/app/config/config.yml b/app/config/config.yml index 48496bc2..53c26beb 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -364,3 +364,4 @@ fos_js_routing: - developer - howto - logout + - new -- cgit v1.2.3 From 3c969d39906dbfb9711caee9f115a1d06d06ad36 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 19 Nov 2016 14:28:19 +0100 Subject: Add missing translations --- .../CraueConfigBundle/translations/CraueConfigBundle.da.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.de.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.en.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.es.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.fa.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.fr.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.it.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.oc.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.pl.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.pt.yml | 6 +++++- .../CraueConfigBundle/translations/CraueConfigBundle.ro.yml | 1 + .../CraueConfigBundle/translations/CraueConfigBundle.tr.yml | 1 + 12 files changed, 16 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index 8ee0a303..fac3b4f8 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Download billeder på din server carrot: Aktiver deling til Carrot diaspora_url: Diaspora URL, hvis tjenesten er aktiv diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index 73a9d640..d382733c 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Bilder auf den Server herunterladen carrot: Teilen zu Carrot aktivieren diaspora_url: Diaspora-URL, sofern der Service aktiviert ist diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index c8c13805..23de7a43 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -1,3 +1,4 @@ +settings_changed: Configuration updated download_pictures: Download pictures on your server carrot: Enable share to Carrot diaspora_url: Diaspora URL, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index 0ea98d8f..ff1dd04f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Descargar imágenes carrot: Activar compartir con Carrot diaspora_url: Diaspora URL, si el servicio está activado diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index c527b971..4e712fdd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: تصاویر را در کارگزار خودتان باربگیرید carrot: فعال‌سازی هم‌رسانی به Carrot diaspora_url: نشانی Diaspora، اگر فعال بود diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index 176e7c86..cae4c662 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -1,3 +1,4 @@ +settings_changed: Configuration mise à jour download_pictures: Télécharger les images sur le serveur carrot: Activer le partage vers Carrot diaspora_url: URL de Diaspora, si le service Diaspora est activé diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index 621d4dcd..f94f834f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Scarica le immagini sul tuo server carrot: Abilita la condivisione con Carrot diaspora_url: Diaspora URL, se il servizio è abilitato diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index 04accd45..de60a194 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Telecargar los imatges sul servidor carrot: Activar lo partatge cap a Carrot diaspora_url: URL de Diaspora, se lo servici Diaspora es activat diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 2f4f3154..11579745 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Pobierz obrazy na swój serwer carrot: Włącz udostępnianie dla Carrot diaspora_url: Adres URL Diaspora, jeżeli usługa jest włączona diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index 5da940e9..74ae5a44 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Download imagens no seu servidor carrot: Habilitar compartilhamento para o Carrot diaspora_url: URL Diaspora, se o serviço está habilitado @@ -8,7 +9,8 @@ export_csv: Habilita exportação para CSV export_json: Habilita exportação para JSON export_txt: Habilita exportação para TXT export_xml: Habilita exportação para XML -pocket_consumer_key: Chave de consumidor do Pocket para importar conteúdo (https://getpocket.com/developer/docs/authentication) +# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously +# import_with_redis: Enable Redis to import data asynchronously shaarli_url: URL Shaarli, se o serviço está habilitado share_diaspora: Habilitar compartilhamento para o Diaspora share_mail: Habilitar compartilhamento por e-mail @@ -28,3 +30,5 @@ piwik_site_id: ID de seu website Piwik piwik_enabled: Habilitar Piwik demo_mode_enabled: "Habilitar modo demo? (somente usado para o demo público do wallabag)" demo_mode_username: "Usuário demo" +# share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 6d2eaffd..5095dfa0 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Descarcă poze pe server carrot: Permite share către Carrot diaspora_url: Diaspora URL, dacă serviciul este permis diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index 9146bfb6..cd42e595 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated # download_pictures: Download pictures on your server # carrot: Enable share to Carrot # diaspora_url: Diaspora URL, if the service is enabled -- cgit v1.2.3 From 77e2898ad406c5aa7672dcaead6b5090cd203d47 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 20 Nov 2016 10:14:19 +0100 Subject: Fix card action overlap On smaller resolution --- app/Resources/static/themes/material/css/main.css | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 8e33cfbc..1af30777 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -544,6 +544,10 @@ a.original { line-height: 24px; } +.card .card-action ul.tools li a.tool { + margin-right: 5px !important; +} + .card .card-action a { color: #fff; margin: 0; -- cgit v1.2.3 From c1683778abb662ee4fcca2fca204bb00c92b8f13 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 20 Nov 2016 20:23:30 +0100 Subject: Add ability to use Redis with password --- app/config/parameters.yml.dist | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 7a22cb98..f821f2a8 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -55,3 +55,4 @@ parameters: redis_host: localhost redis_port: 6379 redis_path: null + redis_password: null -- cgit v1.2.3 From c526f9e4744ac03aa7ab4ff507d5466eee371b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 20 Nov 2016 10:11:57 +0100 Subject: Added help about shortcuts --- app/Resources/static/themes/baggy/js/shortcuts/entry.js | 2 +- app/Resources/static/themes/material/js/shortcuts/entry.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/baggy/js/shortcuts/entry.js b/app/Resources/static/themes/baggy/js/shortcuts/entry.js index 728df8bd..22aa0caf 100644 --- a/app/Resources/static/themes/baggy/js/shortcuts/entry.js +++ b/app/Resources/static/themes/baggy/js/shortcuts/entry.js @@ -7,7 +7,7 @@ Mousetrap.bind('o', () => { }); /* mark as favorite */ -Mousetrap.bind('s', () => { +Mousetrap.bind('f', () => { $('div#article_toolbar ul.links a.favorite')[0].click(); }); diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js index 357c22fe..2dcc93d7 100644 --- a/app/Resources/static/themes/material/js/shortcuts/entry.js +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js @@ -7,7 +7,7 @@ Mousetrap.bind('o', () => { }); /* mark as favorite */ -Mousetrap.bind('s', () => { +Mousetrap.bind('f', () => { $('ul.side-nav a.favorite i')[0].click(); }); -- cgit v1.2.3 From 7aab0ecf2f78ce58f28b53c1fa19bfd824cc3cd7 Mon Sep 17 00:00:00 2001 From: Bertrand Dunogier Date: Thu, 29 Sep 2016 10:14:43 +0200 Subject: Added authentication for restricted access articles Fix #438. Thank you so much @bdunogier --- app/AppKernel.php | 1 + app/config/parameters.yml.dist | 3 +++ 2 files changed, 4 insertions(+) (limited to 'app') diff --git a/app/AppKernel.php b/app/AppKernel.php index 81b83ef9..c8382d5f 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -31,6 +31,7 @@ class AppKernel extends Kernel new Craue\ConfigBundle\CraueConfigBundle(), new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), new FOS\JsRoutingBundle\FOSJsRoutingBundle(), + new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(), // wallabag bundles new Wallabag\CoreBundle\WallabagCoreBundle(), diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index f821f2a8..a4dc0bde 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -56,3 +56,6 @@ parameters: redis_port: 6379 redis_path: null redis_password: null + + # sites credentials + sites_credentials: {} -- cgit v1.2.3 From d64bf7953b0e4e793d7f75ec50bf6e42652560b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 22 Nov 2016 14:56:53 +0100 Subject: Added internal setting to enable/disable articles with paywall --- app/DoctrineMigrations/Version20161122144743.php | 45 ++++++++++++++++++++++ .../translations/CraueConfigBundle.en.yml | 1 + 2 files changed, 46 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161122144743.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161122144743.php b/app/DoctrineMigrations/Version20161122144743.php new file mode 100644 index 00000000..ec80c48e --- /dev/null +++ b/app/DoctrineMigrations/Version20161122144743.php @@ -0,0 +1,45 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'restricted_access';"); + } +} diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index 23de7a43..52cb8e20 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Enable demo mode ? (only used for the wallabag public demo)" demo_mode_username: "Demo user" share_public: Allow public url for entries download_images_enabled: Download images locally +restricted_access: Enable authentication for websites with paywall -- cgit v1.2.3 From d51093a7d964ca720793d0cfcf4af601f2de448a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 22 Nov 2016 15:58:00 +0100 Subject: Added documentation and missing translations --- app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml | 1 + app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml | 1 + 11 files changed, 11 insertions(+) (limited to 'app') diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index fac3b4f8..c65463db 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Aktiver demo-indstilling? (anvendes kun til wallabags offent demo_mode_username: "Demobruger" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index d382733c..bc378147 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Test-Modus aktivieren? (nur für die öffentliche wallabag-D demo_mode_username: "Test-Benutzer" share_public: Erlaube eine öffentliche URL für Einträge # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index ff1dd04f..dbec0e81 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Activar modo demo (sólo usado para la demo de wallabag)" demo_mode_username: "Nombre de usuario demo" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index 4e712fdd..7a341e0b 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -32,3 +32,4 @@ modify_settings: "اعمال" # demo_mode_username: "Demo user" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index cae4c662..f5c886d6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Activer le mode démo ? (utiliser uniquement pour la démo p demo_mode_username: "Utilisateur de la démo" share_public: Autoriser une URL publique pour les articles download_images_enabled: Télécharger les images en local +restricted_access: Activer l'authentification pour les articles derrière un paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index f94f834f..88a1b4f6 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Abilita modalità demo ? (usato solo per la demo pubblica di demo_mode_username: "Utente Demo" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index de60a194..00deeade 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Activar lo mode demostracion ? (utilizar solament per la dem demo_mode_username: "Utilizaire de la demostracion" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 11579745..744031e8 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Włacz tryb demo? (używany wyłącznie dla publicznej demon demo_mode_username: "Użytkownik Demonstracyjny" share_public: Zezwalaj na publiczny adres url dla wpisow # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index 74ae5a44..1edde87a 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml @@ -32,3 +32,4 @@ demo_mode_enabled: "Habilitar modo demo? (somente usado para o demo público do demo_mode_username: "Usuário demo" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 5095dfa0..f0c935d3 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -32,3 +32,4 @@ modify_settings: "aplică" # demo_mode_username: "Demo user" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index cd42e595..eb40fc5e 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -32,3 +32,4 @@ # demo_mode_username: "Demo user" # share_public: Allow public url for entries # download_images_enabled: Download images locally +# restricted_access: Enable authentication for websites with paywall -- cgit v1.2.3 From 9624b3adfaa51ff1a911b63996a5336358dd1a62 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 20 Nov 2016 20:06:26 +0100 Subject: =?UTF-8?q?These=20files=20aren=E2=80=99t=20used=20anymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Translation were moved to the global one --- app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml | 2 -- app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml | 2 -- 7 files changed, 14 deletions(-) delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml delete mode 100644 app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml (limited to 'app') diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml deleted file mode 100644 index 015989ef..00000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.da.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Log ind" -Enter your email address below and we'll send you password reset instructions.: "Indtast din emailadresse nedenfor, så sender vi dig instrukser til at nulstille din adgangskode." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml deleted file mode 100644 index 944a0d41..00000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.de.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Anmelden" -Enter your email address below and we'll send you password reset instructions.: "Tippe deine E-Mail-Adresse unten ein und wir senden dir die Anweisungen, wie du dein Kennwort zurücksetzen kannst." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml deleted file mode 100644 index 968eb241..00000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.es.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Logearse" -Enter your email address below and we'll send you password reset instructions.: "Introduzca su dirección de email y le enviaremos las instrucciones para resetear su contraseña." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml deleted file mode 100644 index 1c5ea640..00000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.fr.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Se connecter" -Enter your email address below and we'll send you password reset instructions.: "Renseignez votre adresse courriel, nous vous enverrons les instructions pour réinitialiser votre mot de passe." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml deleted file mode 100644 index b8a75172..00000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.oc.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Se connectar" -Enter your email address below and we'll send you password reset instructions.: "Picatz vòstra adreça de corrièl çai-jos, vos mandarem las instruccions per reïnicializar vòstre senhal." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml deleted file mode 100644 index 7e0a2490..00000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.pl.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Logowanie" -Enter your email address below and we'll send you password reset instructions.: "Wpisz poniżej swój adres email, abyśmy mogli wysłać ci instrukcję resetowania hasła." diff --git a/app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml b/app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml deleted file mode 100644 index 85eadfd8..00000000 --- a/app/Resources/FOSUserBundle/translations/FOSUserBundle.pt.yml +++ /dev/null @@ -1,2 +0,0 @@ -Login: "Login" -Enter your email address below and we'll send you password reset instructions.: "Digite seu endereço de e-mail para enviarmos as instruções de recupeção de sua senha." -- cgit v1.2.3 From 5066c3e066ad67788bdf6edac9e80cab614a2d4d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 21 Nov 2016 15:12:11 +0100 Subject: Re-use FOSUser master branch --- app/config/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index 487e934b..5f939ab5 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -210,6 +210,7 @@ fos_user: from_email: address: "%from_email%" sender_name: wallabag + fos_oauth_server: db_driver: orm client_class: Wallabag\ApiBundle\Entity\Client @@ -217,10 +218,10 @@ fos_oauth_server: refresh_token_class: Wallabag\ApiBundle\Entity\RefreshToken auth_code_class: Wallabag\ApiBundle\Entity\AuthCode service: - user_provider: fos_user.user_manager + user_provider: fos_user.user_provider.username_email options: refresh_token_lifetime: 1209600 - + scheb_two_factor: trusted_computer: enabled: true -- cgit v1.2.3 From be2725db406310ca3e025f1d0d79f768804245a2 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 22 Nov 2016 20:54:00 +0100 Subject: Add migration for new FOSUser version --- app/DoctrineMigrations/Version20161122203647.php | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161122203647.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php new file mode 100644 index 00000000..ea2703b6 --- /dev/null +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -0,0 +1,57 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix') . $tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + + $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD expired tinyint(1) NULL DEFAULT 0'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD credentials_expired tinyint(1) NULL DEFAULT 0'); + } +} -- cgit v1.2.3 From 0df2a4b021e581c7661968a23e5c8dd5de5273c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 22 Nov 2016 21:31:21 +0100 Subject: Fixed entry shortcuts available in list view --- .../static/themes/baggy/js/shortcuts/entry.js | 34 ++++++++++++---------- .../static/themes/material/js/shortcuts/entry.js | 34 ++++++++++++---------- 2 files changed, 38 insertions(+), 30 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/baggy/js/shortcuts/entry.js b/app/Resources/static/themes/baggy/js/shortcuts/entry.js index 22aa0caf..c87408b9 100644 --- a/app/Resources/static/themes/baggy/js/shortcuts/entry.js +++ b/app/Resources/static/themes/baggy/js/shortcuts/entry.js @@ -1,22 +1,26 @@ import Mousetrap from 'mousetrap'; import $ from 'jquery'; -/* Article view */ -Mousetrap.bind('o', () => { - $('div#article_toolbar ul.links a.original')[0].click(); -}); +$(document).ready(() => { + if ($('#article').length > 0) { + /* Article view */ + Mousetrap.bind('o', () => { + $('div#article_toolbar ul.links a.original')[0].click(); + }); -/* mark as favorite */ -Mousetrap.bind('f', () => { - $('div#article_toolbar ul.links a.favorite')[0].click(); -}); + /* mark as favorite */ + Mousetrap.bind('f', () => { + $('div#article_toolbar ul.links a.favorite')[0].click(); + }); -/* mark as read */ -Mousetrap.bind('a', () => { - $('div#article_toolbar ul.links a.markasread')[0].click(); -}); + /* mark as read */ + Mousetrap.bind('a', () => { + $('div#article_toolbar ul.links a.markasread')[0].click(); + }); -/* delete */ -Mousetrap.bind('del', () => { - $('div#article_toolbar ul.links a.delete')[0].click(); + /* delete */ + Mousetrap.bind('del', () => { + $('div#article_toolbar ul.links a.delete')[0].click(); + }); + } }); diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js index 2dcc93d7..e19800bd 100644 --- a/app/Resources/static/themes/material/js/shortcuts/entry.js +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js @@ -1,22 +1,26 @@ import Mousetrap from 'mousetrap'; import $ from 'jquery'; -/* open original article */ -Mousetrap.bind('o', () => { - $('ul.side-nav a.original i')[0].click(); -}); +$(document).ready(() => { + if ($('#article').length > 0) { + /* open original article */ + Mousetrap.bind('o', () => { + $('ul.side-nav a.original i')[0].click(); + }); -/* mark as favorite */ -Mousetrap.bind('f', () => { - $('ul.side-nav a.favorite i')[0].click(); -}); + /* mark as favorite */ + Mousetrap.bind('f', () => { + $('ul.side-nav a.favorite i')[0].click(); + }); -/* mark as read */ -Mousetrap.bind('a', () => { - $('ul.side-nav a.markasread i')[0].click(); -}); + /* mark as read */ + Mousetrap.bind('a', () => { + $('ul.side-nav a.markasread i')[0].click(); + }); -/* delete */ -Mousetrap.bind('del', () => { - $('ul.side-nav a.delete i')[0].click(); + /* delete */ + Mousetrap.bind('del', () => { + $('ul.side-nav a.delete i')[0].click(); + }); + } }); -- cgit v1.2.3 From 66e9dde0dc0ba5f554231a7a968ef5b530a0563f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 23 Nov 2016 14:40:00 +0100 Subject: Fixed logout shortcut --- app/Resources/static/themes/_global/js/shortcuts/main.js | 2 +- app/config/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/shortcuts/main.js b/app/Resources/static/themes/_global/js/shortcuts/main.js index ef6a1b84..c81bf869 100644 --- a/app/Resources/static/themes/_global/js/shortcuts/main.js +++ b/app/Resources/static/themes/_global/js/shortcuts/main.js @@ -12,4 +12,4 @@ Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); }); Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); }); Mousetrap.bind('?', () => { window.location.href = Routing.generate('howto'); }); -Mousetrap.bind('g l', () => { window.location.href = Routing.generate('logout'); }); +Mousetrap.bind('g l', () => { window.location.href = Routing.generate('fos_user_security_logout'); }); diff --git a/app/config/config.yml b/app/config/config.yml index 5f939ab5..6b1ed056 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -366,5 +366,5 @@ fos_js_routing: - import - developer - howto - - logout + - fos_user_security_logout - new -- cgit v1.2.3 From 5b69e03eb43faf3a0f9bbf5ded12447e33510472 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 20 Nov 2016 20:18:30 +0100 Subject: Material: change color of background, article content and titles Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/main.css | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 1af30777..2fcf11bd 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -164,7 +164,7 @@ body { display: flex; min-height: 100vh; flex-direction: column; - background: #f0f0f0; + background: #fafafa; } body.login main { @@ -603,6 +603,19 @@ a.original { max-width: 40em; } +#article article { + color: #424242; +} + +#article article h1, +#article article h2, +#article article h3, +#article article h4, +#article article h5, +#article article h6 { + color: #212121; +} + #article img, #article figure { max-width: 100%; -- cgit v1.2.3 From 7470a2f36ab9c66176855affa9788e2dca8978e2 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 20 Nov 2016 20:27:10 +0100 Subject: Material: prevent bold in title, update title font size Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/main.css | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 2fcf11bd..ffccb498 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -616,6 +616,39 @@ a.original { color: #212121; } +#article article h1 strong, +#article article h2 strong, +#article article h3 strong, +#article article h4 strong, +#article article h5 strong, +#article article h6 strong { + font-weight: 500; +} + +#article article h6 { + font-size: 1.2rem; +} + +#article article h5 { + font-size: 1.6rem; +} + +#article article h4 { + font-size: 1.9rem; +} + +#article article h3 { + font-size: 2.2rem; +} + +#article article h2 { + font-size: 2.5rem; +} + +#article article h1 { + font-size: 2.7rem; +} + #article img, #article figure { max-width: 100%; -- cgit v1.2.3 From 5ea90fa8b994dcc20738576261702183c0175907 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 20 Nov 2016 20:27:45 +0100 Subject: Material: increase max width of article on large screens Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index ffccb498..86dab6bf 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -600,7 +600,7 @@ a.original { #article { font-size: 20px; margin: 0 auto; - max-width: 40em; + max-width: 45em; } #article article { -- cgit v1.2.3 From 858430c0d02b94fe84daf6f0a14bdbbb1b75a969 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 20 Nov 2016 20:36:02 +0100 Subject: Material: update style of article links Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/main.css | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 86dab6bf..3a15a789 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -655,6 +655,15 @@ a.original { height: auto; } +#article article a { + border-bottom: 1px dotted #03a9f4; + text-decoration: none; +} + +#article article a:hover { + border-bottom-style: solid; +} + #article > header > h1 { font-size: 2em; margin: 2.1rem 0 0.68rem; -- cgit v1.2.3 From 59cfd63c235404b05712c9005b37d3814a655633 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 20 Nov 2016 20:36:31 +0100 Subject: Material: update style of ul in article Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/main.css | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 3a15a789..b4d2765c 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -664,6 +664,15 @@ a.original { border-bottom-style: solid; } +#article article ul { + padding-left: 30px; +} + +#article article ul, +#article article ul li { + list-style-type: disc; +} + #article > header > h1 { font-size: 2em; margin: 2.1rem 0 0.68rem; -- cgit v1.2.3 From fdaa044314d6bd05ac3ff3a6cdad88c852702b2e Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 20 Nov 2016 20:40:35 +0100 Subject: Material: update style of pre in article Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/main.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index b4d2765c..ff3a9891 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -673,6 +673,20 @@ a.original { list-style-type: disc; } +#article article pre { + box-sizing: border-box; + margin: 0 0 1.75em; + border: #e3f2fd 1px solid; + width: 100%; + padding: 10px; + font-family: monospace; + font-size: 0.8em; + white-space: pre; + overflow: auto; + background: #f5f5f5; + border-radius: 3px; +} + #article > header > h1 { font-size: 2em; margin: 2.1rem 0 0.68rem; -- cgit v1.2.3 From 819c8f5bd42e2b69228d8adc9303970cae768167 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 20 Nov 2016 20:45:05 +0100 Subject: Material: render blockquote in italic and strong in bold in article Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/main.css | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index ff3a9891..a8172b7e 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -673,6 +673,14 @@ a.original { list-style-type: disc; } +#article article blockquote { + font-style: italic; +} + +#article article strong { + font-weight: bold; +} + #article article pre { box-sizing: border-box; margin: 0 0 1.75em; -- cgit v1.2.3 From 56026217c55ee254cce5875ea56072d3a5c49274 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Fri, 25 Nov 2016 13:49:45 +0100 Subject: Material: update size of text in article Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/main.css | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index a8172b7e..82a74c23 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -605,6 +605,8 @@ a.original { #article article { color: #424242; + font-size: 18px; + line-height: 1.7em; } #article article h1, -- cgit v1.2.3 From 07326af5e25f52f54f725898d9fb2f82af60e224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 28 Nov 2016 13:25:18 +0100 Subject: Added migration to remove useless fields --- app/DoctrineMigrations/Version20161128131503.php | 61 ++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161128131503.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161128131503.php b/app/DoctrineMigrations/Version20161128131503.php new file mode 100644 index 00000000..f0e016c8 --- /dev/null +++ b/app/DoctrineMigrations/Version20161128131503.php @@ -0,0 +1,61 @@ + 'smallint', + 'credentials_expire_at' => 'datetime', + 'expires_at' => 'datetime', + ]; + + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $userTable = $schema->getTable($this->getTable('user')); + + foreach ($this->fields as $field => $type) { + $this->skipIf(!$userTable->hasColumn($field), 'It seems that you already played this migration.'); + $userTable->dropColumn($field); + } + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $userTable = $schema->getTable($this->getTable('user')); + + foreach ($this->fields as $field => $type) { + $this->skipIf($userTable->hasColumn($field), 'It seems that you already played this migration.'); + $userTable->addColumn($field, $type); + } + } +} -- cgit v1.2.3 From 9f01d0fde09fa055a7db9f26e77c5e6b3d6c2224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 28 Nov 2016 11:02:10 +0100 Subject: Added list view --- app/DoctrineMigrations/Version20161128084725.php | 49 ++++++++++++++++++++++ app/Resources/static/themes/_global/img/list.png | Bin 0 -> 201 bytes app/Resources/static/themes/_global/img/table.png | Bin 0 -> 229 bytes app/Resources/static/themes/baggy/css/main.css | 15 +++---- app/Resources/static/themes/material/css/main.css | 10 ++++- 5 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 app/DoctrineMigrations/Version20161128084725.php create mode 100755 app/Resources/static/themes/_global/img/list.png create mode 100755 app/Resources/static/themes/_global/img/table.png (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161128084725.php b/app/DoctrineMigrations/Version20161128084725.php new file mode 100644 index 00000000..347a4256 --- /dev/null +++ b/app/DoctrineMigrations/Version20161128084725.php @@ -0,0 +1,49 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $configTable = $schema->getTable($this->getTable('config')); + $this->skipIf($configTable->hasColumn('view_mode'), 'It seems that you already played this migration.'); + + $configTable->addColumn('view_mode', 'integer'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $configTable = $schema->getTable($this->getTable('config')); + $configTable->dropColumn('view_mode'); + } +} diff --git a/app/Resources/static/themes/_global/img/list.png b/app/Resources/static/themes/_global/img/list.png new file mode 100755 index 00000000..bd5aff5a Binary files /dev/null and b/app/Resources/static/themes/_global/img/list.png differ diff --git a/app/Resources/static/themes/_global/img/table.png b/app/Resources/static/themes/_global/img/table.png new file mode 100755 index 00000000..859c4cd8 Binary files /dev/null and b/app/Resources/static/themes/_global/img/table.png differ diff --git a/app/Resources/static/themes/baggy/css/main.css b/app/Resources/static/themes/baggy/css/main.css index 4f48f8ca..126c451b 100755 --- a/app/Resources/static/themes/baggy/css/main.css +++ b/app/Resources/static/themes/baggy/css/main.css @@ -297,18 +297,14 @@ h2::after { text-decoration: none; } -#listmode a:hover { - opacity: 1; -} - #listmode.tablemode { - background-image: url("../img/baggy/table.png"); + background-image: url("../../_global/img/table.png"); background-repeat: no-repeat; background-position: bottom; } #listmode.listmode { - background-image: url("../img/baggy/list.png"); + background-image: url("../../_global/img/list.png"); background-repeat: no-repeat; background-position: bottom; } @@ -352,9 +348,9 @@ footer a { letter-spacing: -5px; } -.listmode .entry { - width: 100% !important; - margin-left: 0 !important; +.listmode.entry { + width: 100%; + height: inherit; } .card-entry-labels { @@ -588,6 +584,7 @@ div.pagination ul { text-align: left; font-style: italic; color: #999; + display: inline-flex; } div.pagination ul > * { diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 82a74c23..76423409 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -194,7 +194,6 @@ main, .results { height: 1em; - line-height: 30px; } .results .nb-results, @@ -203,6 +202,14 @@ main, margin-bottom: 0; } +.results .nb-results { + display: inline-flex; +} + +.results a { + color: #444; +} + .pagination { float: right; } @@ -593,6 +600,7 @@ a.original { background-position: 50%; } + /* ========================================================================== 5 = Article ========================================================================== */ -- cgit v1.2.3 From 56a7ce17f3a9a22e0bfc8651cb690a14447e0afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 28 Nov 2016 11:26:08 +0100 Subject: Hide article text on mobile with list mode --- app/Resources/static/themes/baggy/css/main.css | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/Resources/static/themes/baggy/css/main.css b/app/Resources/static/themes/baggy/css/main.css index 126c451b..6d656c21 100755 --- a/app/Resources/static/themes/baggy/css/main.css +++ b/app/Resources/static/themes/baggy/css/main.css @@ -1203,6 +1203,10 @@ pre code { } @media screen and (max-width: 500px) { + .hide { + display: none; + } + .entry { width: 100%; margin-left: 0; -- cgit v1.2.3 From 73f7eabb6e10cff09a79105b6525e3c269e3cf08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 25 Nov 2016 13:47:09 +0100 Subject: Added hasColumn() in migration to check column existence --- app/DoctrineMigrations/Version20160410190541.php | 44 +++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index f034b0e4..5de53d4b 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -21,7 +21,41 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; + } + + private function hasColumn($tableName, $columnName) + { + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + $rows = $this->connection->executeQuery('pragma table_info('.$tableName.')')->fetchAll(); + foreach ($rows as $column) { + if (strcasecmp($column['name'], $columnName) === 0) { + return true; + } + } + + return false; + case 'mysql': + $rows = $this->connection->executeQuery('SHOW COLUMNS FROM '.$tableName)->fetchAll(); + foreach ($rows as $column) { + if (strcasecmp($column['Field'], $columnName) === 0) { + return true; + } + } + + return false; + case 'postgresql': + $sql = sprintf("SELECT count(*) + FROM information_schema.columns + WHERE table_schema = 'public' AND table_name = '%s' AND column_name = '%s'", + $tableName, + $columnName + ); + $result = $this->connection->executeQuery($sql)->fetch(); + + return $result['count'] > 0; + } } /** @@ -29,13 +63,15 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { + $this->skipIf($this->hasColumn($this->getTable('entry'), 'uuid'), 'It seems that you already played this migration.'); + if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') { $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid UUID DEFAULT NULL'); } else { $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid LONGTEXT DEFAULT NULL'); } - $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('share_public', '1', 'entry')"); + $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('share_public', '1', 'entry')"); } /** @@ -43,9 +79,9 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" DROP uuid'); - $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'share_public'"); + $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'share_public'"); } } -- cgit v1.2.3 From 986cb536457e921dacf7ab5c7bc16ad4b2108781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 25 Nov 2016 17:36:15 +0100 Subject: Removed my hasColumn and used the existing one in Doctrine --- app/DoctrineMigrations/Version20160410190541.php | 36 +----------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 5de53d4b..c2360937 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -24,46 +24,12 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI return $this->container->getParameter('database_table_prefix').$tableName; } - private function hasColumn($tableName, $columnName) - { - switch ($this->connection->getDatabasePlatform()->getName()) { - case 'sqlite': - $rows = $this->connection->executeQuery('pragma table_info('.$tableName.')')->fetchAll(); - foreach ($rows as $column) { - if (strcasecmp($column['name'], $columnName) === 0) { - return true; - } - } - - return false; - case 'mysql': - $rows = $this->connection->executeQuery('SHOW COLUMNS FROM '.$tableName)->fetchAll(); - foreach ($rows as $column) { - if (strcasecmp($column['Field'], $columnName) === 0) { - return true; - } - } - - return false; - case 'postgresql': - $sql = sprintf("SELECT count(*) - FROM information_schema.columns - WHERE table_schema = 'public' AND table_name = '%s' AND column_name = '%s'", - $tableName, - $columnName - ); - $result = $this->connection->executeQuery($sql)->fetch(); - - return $result['count'] > 0; - } - } - /** * @param Schema $schema */ public function up(Schema $schema) { - $this->skipIf($this->hasColumn($this->getTable('entry'), 'uuid'), 'It seems that you already played this migration.'); + $this->skipIf($schema->getTable($this->getTable('entry'))->hasColumn('uuid'), 'It seems that you already played this migration.'); if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') { $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid UUID DEFAULT NULL'); -- cgit v1.2.3 From 18d7bc3a353d8737c64a0f9e1c9fdcb7a756c3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 25 Nov 2016 17:43:28 +0100 Subject: Added checks on migrations --- app/DoctrineMigrations/Version20160812120952.php | 4 +++- app/DoctrineMigrations/Version20160916201049.php | 8 +++++--- app/DoctrineMigrations/Version20161024212538.php | 5 +++-- app/DoctrineMigrations/Version20161106113822.php | 4 +++- app/DoctrineMigrations/Version20161118134328.php | 6 ++++-- app/DoctrineMigrations/Version20161122203647.php | 9 +++++++-- 6 files changed, 25 insertions(+), 11 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 39423e2f..3ed1b798 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -21,7 +21,7 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -29,6 +29,8 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { + $this->skipIf($schema->getTable($this->getTable('oauth2_clients'))->hasColumn('name'), 'It seems that you already played this migration.'); + switch ($this->connection->getDatabasePlatform()->getName()) { case 'sqlite': $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 0d2edf9e..5db00108 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -21,7 +21,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -29,8 +29,10 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { + $this->skipIf($schema->getTable($this->getTable('config'))->hasColumn('pocket_consumer_key'), 'It seems that you already played this migration.'); + $this->addSql('ALTER TABLE "'.$this->getTable('config').'" ADD pocket_consumer_key VARCHAR(255) DEFAULT NULL'); - $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'pocket_consumer_key';"); + $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'pocket_consumer_key';"); } /** @@ -41,6 +43,6 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); $this->addSql('ALTER TABLE "'.$this->getTable('config').'" DROP pocket_consumer_key'); - $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); + $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); } } diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index f8e927e4..ced3a802 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -21,7 +21,7 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -31,6 +31,8 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI { $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf($schema->getTable($this->getTable('oauth2_clients'))->hasColumn('user_id'), 'It seems that you already played this migration.'); + $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD user_id INT(11) DEFAULT NULL'); $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD CONSTRAINT FK_clients_user_clients FOREIGN KEY (user_id) REFERENCES '.$this->getTable('user').' (id) ON DELETE CASCADE'); } @@ -40,6 +42,5 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - } } diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index edca54f5..a5401b2c 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -21,7 +21,7 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -29,6 +29,8 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { + $this->skipIf($schema->getTable($this->getTable('config'))->hasColumn('action_mark_as_read'), 'It seems that you already played this migration.'); + $this->addSql('ALTER TABLE '.$this->getTable('config').' ADD action_mark_as_read INT DEFAULT 0'); } diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index 390e89ce..76dd9074 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Add http_status in `entry_table` + * Add http_status in `entry_table`. */ class Version20161118134328 extends AbstractMigration implements ContainerAwareInterface { @@ -24,7 +24,7 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -32,6 +32,8 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { + $this->skipIf($schema->getTable($this->getTable('entry'))->hasColumn('http_status'), 'It seems that you already played this migration.'); + $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status VARCHAR(3) DEFAULT NULL'); } diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index ea2703b6..2cb990e1 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Methods and properties removed from `FOS\UserBundle\Model\User` + * Methods and properties removed from `FOS\UserBundle\Model\User`. * * - `$expired` * - `$credentialsExpired` @@ -32,7 +32,7 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -42,7 +42,12 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI { $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('expired'), 'It seems that you already played this migration.'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired'); + + $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired'); } -- cgit v1.2.3 From a4d55a9161144f7e0daafff8da13dabc9e090ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 26 Nov 2016 13:34:36 +0100 Subject: Replaced abortIf with skipIf --- app/DoctrineMigrations/Version20160812120952.php | 2 +- app/DoctrineMigrations/Version20160911214952.php | 2 +- app/DoctrineMigrations/Version20160916201049.php | 2 +- app/DoctrineMigrations/Version20161001072726.php | 2 +- app/DoctrineMigrations/Version20161022134138.php | 3 +-- app/DoctrineMigrations/Version20161031132655.php | 8 ++++---- app/DoctrineMigrations/Version20161104073720.php | 3 +-- app/DoctrineMigrations/Version20161106113822.php | 2 +- app/DoctrineMigrations/Version20161117071626.php | 10 +++++----- app/DoctrineMigrations/Version20161118134328.php | 2 +- app/DoctrineMigrations/Version20161122144743.php | 8 ++++---- app/DoctrineMigrations/Version20161122203647.php | 2 +- 12 files changed, 22 insertions(+), 24 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 3ed1b798..a5d11e3f 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -50,7 +50,7 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' DROP COLUMN name'); } diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index f14f7bc6..53e5cf85 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -21,7 +21,7 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 5db00108..83ed6b61 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -40,7 +40,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); $this->addSql('ALTER TABLE "'.$this->getTable('config').'" DROP pocket_consumer_key'); $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index 237db932..5ab88555 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -21,7 +21,7 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index 5cce55a5..b3d02b40 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -21,7 +21,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -72,6 +72,5 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE '.$this->getTable('tag').' CHANGE `label` `label` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE `name` `name` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); - } } diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index c7364428..80163c0b 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -21,7 +21,7 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -29,7 +29,7 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql("INSERT INTO \"".$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); + $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); } /** @@ -37,8 +37,8 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - $this->addSql("DELETE FROM \"".$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); + $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); } } diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php index 16503b4b..7a0361f8 100644 --- a/app/DoctrineMigrations/Version20161104073720.php +++ b/app/DoctrineMigrations/Version20161104073720.php @@ -21,7 +21,7 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -48,6 +48,5 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - } } diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index a5401b2c..5e3fd562 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -39,7 +39,7 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); $this->addSql('ALTER TABLE '.$this->getTable('config').' DROP action_mark_as_read'); } diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php index 9ae55b5f..33f5707e 100644 --- a/app/DoctrineMigrations/Version20161117071626.php +++ b/app/DoctrineMigrations/Version20161117071626.php @@ -21,7 +21,7 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -29,8 +29,8 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); - $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); } /** @@ -38,7 +38,7 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'share_unmark';"); - $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'unmark_url';"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_unmark';"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'unmark_url';"); } } diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index 76dd9074..69eae5a5 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -42,7 +42,7 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); $this->addSql('ALTER TABLE '.$this->getTable('entry').' DROP http_status'); } diff --git a/app/DoctrineMigrations/Version20161122144743.php b/app/DoctrineMigrations/Version20161122144743.php index ec80c48e..536b8339 100644 --- a/app/DoctrineMigrations/Version20161122144743.php +++ b/app/DoctrineMigrations/Version20161122144743.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Add the restricted_access internal setting for articles with paywall + * Add the restricted_access internal setting for articles with paywall. */ class Version20161122144743 extends AbstractMigration implements ContainerAwareInterface { @@ -24,7 +24,7 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI private function getTable($tableName) { - return $this->container->getParameter('database_table_prefix') . $tableName; + return $this->container->getParameter('database_table_prefix').$tableName; } /** @@ -32,7 +32,7 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql("INSERT INTO ".$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); } /** @@ -40,6 +40,6 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->addSql("DELETE FROM ".$this->getTable('craue_config_setting')." WHERE name = 'restricted_access';"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'restricted_access';"); } } diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index 2cb990e1..354a10e8 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -40,7 +40,7 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->abortIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + $this->skipIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('expired'), 'It seems that you already played this migration.'); -- cgit v1.2.3 From 84c6a48df412af7a15a63de5484c4bbcf27de33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 26 Nov 2016 15:40:42 +0100 Subject: Added dropColumn for SQLite and some enhancements --- app/DoctrineMigrations/Version20161024212538.php | 14 ++++++++++---- app/DoctrineMigrations/Version20161031132655.php | 2 -- app/DoctrineMigrations/Version20161104073720.php | 14 ++------------ app/DoctrineMigrations/Version20161106113822.php | 13 ++++++++----- app/DoctrineMigrations/Version20161118134328.php | 14 +++++++++----- app/DoctrineMigrations/Version20161122203647.php | 15 ++++++++------- 6 files changed, 37 insertions(+), 35 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index ced3a802..7e79cbde 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -29,12 +29,18 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); - $this->skipIf($schema->getTable($this->getTable('oauth2_clients'))->hasColumn('user_id'), 'It seems that you already played this migration.'); + $this->skipIf($clientsTable->hasColumn('user_id'), 'It seems that you already played this migration.'); - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD user_id INT(11) DEFAULT NULL'); - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD CONSTRAINT FK_clients_user_clients FOREIGN KEY (user_id) REFERENCES '.$this->getTable('user').' (id) ON DELETE CASCADE'); + $clientsTable->addColumn('user_id', 'integer'); + + $clientsTable->addForeignKeyConstraint( + $this->getTable('user'), + array('user_id'), + array('id'), + array('onDelete' => 'CASCADE') + ); } /** diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index 80163c0b..39b85ea9 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -37,8 +37,6 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); } } diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php index 7a0361f8..cd2029cb 100644 --- a/app/DoctrineMigrations/Version20161104073720.php +++ b/app/DoctrineMigrations/Version20161104073720.php @@ -29,18 +29,8 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - switch ($this->connection->getDatabasePlatform()->getName()) { - case 'sqlite': - $this->addSql('CREATE INDEX `created_at` ON `'.$this->getTable('entry').'` (`created_at` DESC)'); - break; - - case 'mysql': - $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD INDEX created_at (created_at);'); - break; - - case 'postgresql': - $this->addSql('CREATE INDEX created_at ON '.$this->getTable('entry').' (created_at DESC)'); - } + $entryTable = $schema->getTable($this->getTable('entry')); + $entryTable->addIndex(['created_at']); } /** diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index 5e3fd562..5032a8f0 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -29,9 +29,13 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->skipIf($schema->getTable($this->getTable('config'))->hasColumn('action_mark_as_read'), 'It seems that you already played this migration.'); + $configTable = $schema->getTable($this->getTable('config')); - $this->addSql('ALTER TABLE '.$this->getTable('config').' ADD action_mark_as_read INT DEFAULT 0'); + $this->skipIf($configTable->hasColumn('action_mark_as_read'), 'It seems that you already played this migration.'); + + $configTable->addColumn('action_mark_as_read', 'integer', [ + 'default' => 0, + ]); } /** @@ -39,8 +43,7 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); - - $this->addSql('ALTER TABLE '.$this->getTable('config').' DROP action_mark_as_read'); + $configTable = $schema->getTable($this->getTable('config')); + $userTable->dropColumn('action_mark_as_read'); } } diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index 69eae5a5..f168cb53 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -32,9 +32,14 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->skipIf($schema->getTable($this->getTable('entry'))->hasColumn('http_status'), 'It seems that you already played this migration.'); + $entryTable = $schema->getTable($this->getTable('entry')); - $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD http_status VARCHAR(3) DEFAULT NULL'); + $this->skipIf($entryTable->hasColumn('http_status'), 'It seems that you already played this migration.'); + + $entryTable->addColumn('http_status', 'string', [ + 'length' => 3, + 'notnull' => false, + ]); } /** @@ -42,8 +47,7 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); - - $this->addSql('ALTER TABLE '.$this->getTable('entry').' DROP http_status'); + $userTable = $schema->getTable($this->getTable('entry')); + $userTable->dropColumn('http_status'); } } diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index 354a10e8..9c1557eb 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -40,15 +40,15 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'This up migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + $userTable = $schema->getTable($this->getTable('user')); - $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('expired'), 'It seems that you already played this migration.'); + $this->skipIf(false === $userTable->hasColumn('expired'), 'It seems that you already played this migration.'); - $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP expired'); + $userTable->dropColumn('expired'); - $this->skipIf(false === $schema->getTable($this->getTable('user'))->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); + $this->skipIf(false === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); - $this->addSql('ALTER TABLE '.$this->getTable('user').' DROP credentials_expired'); + $userTable->dropColumn('credentials_expired'); } /** @@ -56,7 +56,8 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD expired tinyint(1) NULL DEFAULT 0'); - $this->addSql('ALTER TABLE '.$this->getTable('user').' ADD credentials_expired tinyint(1) NULL DEFAULT 0'); + $userTable = $schema->getTable($this->getTable('user')); + $userTable->addColumn('expired', 'smallint'); + $userTable->addColumn('credentials_expired', 'smallint'); } } -- cgit v1.2.3 From 597755b8c7f45310df072d2185fc7bd406f9a39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 26 Nov 2016 16:06:14 +0100 Subject: Cleaned old migrations --- app/DoctrineMigrations/Version20160410190541.php | 19 +++++++++---------- app/DoctrineMigrations/Version20160812120952.php | 21 +++++---------------- app/DoctrineMigrations/Version20160911214952.php | 6 ++++-- app/DoctrineMigrations/Version20160916201049.php | 15 ++++++++------- 4 files changed, 26 insertions(+), 35 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index c2360937..0cdec008 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -29,15 +29,14 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->skipIf($schema->getTable($this->getTable('entry'))->hasColumn('uuid'), 'It seems that you already played this migration.'); + $entryTable = $schema->getTable($this->getTable('entry')); - if ($this->connection->getDatabasePlatform()->getName() == 'postgresql') { - $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid UUID DEFAULT NULL'); - } else { - $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" ADD uuid LONGTEXT DEFAULT NULL'); - } + $this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.'); - $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('share_public', '1', 'entry')"); + $entryTable->addColumn('uuid', 'guid', [ + 'notnull' => false, + ]); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_public', '1', 'entry')"); } /** @@ -45,9 +44,9 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.'); + $entryTable = $schema->getTable($this->getTable('entry')); + $entryTable->dropColumn('uuid'); - $this->addSql('ALTER TABLE "'.$this->getTable('entry').'" DROP uuid'); - $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'share_public'"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_public'"); } } diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index a5d11e3f..053b8d88 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -29,20 +29,10 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->skipIf($schema->getTable($this->getTable('oauth2_clients'))->hasColumn('name'), 'It seems that you already played this migration.'); + $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); + $this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.'); - switch ($this->connection->getDatabasePlatform()->getName()) { - case 'sqlite': - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext DEFAULT NULL'); - break; - - case 'mysql': - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name longtext COLLATE \'utf8_unicode_ci\' DEFAULT NULL'); - break; - - case 'postgresql': - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' ADD name text DEFAULT NULL'); - } + $clientsTable->addColumn('name', 'blob'); } /** @@ -50,8 +40,7 @@ class Version20160812120952 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - - $this->addSql('ALTER TABLE '.$this->getTable('oauth2_clients').' DROP COLUMN name'); + $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); + $clientsTable->dropColumn('name'); } } diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index 53e5cf85..963821ae 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -29,8 +29,8 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting').'" (name, value, section) VALUES (\'import_with_redis\', \'0\', \'import\')'); - $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting').'" (name, value, section) VALUES (\'import_with_rabbitmq\', \'0\', \'import\')'); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_redis', 0, 'import')"); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')"); } /** @@ -38,5 +38,7 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'import_with_redis';"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'import_with_rabbitmq';"); } } diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 83ed6b61..09c05f4b 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -29,10 +29,12 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->skipIf($schema->getTable($this->getTable('config'))->hasColumn('pocket_consumer_key'), 'It seems that you already played this migration.'); + $configTable = $schema->getTable($this->getTable('config')); - $this->addSql('ALTER TABLE "'.$this->getTable('config').'" ADD pocket_consumer_key VARCHAR(255) DEFAULT NULL'); - $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'pocket_consumer_key';"); + $this->skipIf($configTable->hasColumn('pocket_consumer_key'), 'It seems that you already played this migration.'); + + $userTable->addColumn('pocket_consumer_key', 'string'); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'pocket_consumer_key';"); } /** @@ -40,9 +42,8 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); - - $this->addSql('ALTER TABLE "'.$this->getTable('config').'" DROP pocket_consumer_key'); - $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); + $configTable = $schema->getTable($this->getTable('config')); + $clientsTable->dropColumn('pocket_consumer_key'); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); } } -- cgit v1.2.3 From d79b3adbed4c2c1fd8d35e9475af734d443b564a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 28 Nov 2016 08:55:03 +0100 Subject: Fixed typo --- app/DoctrineMigrations/Version20160916201049.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 09c05f4b..9390755e 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -33,7 +33,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI $this->skipIf($configTable->hasColumn('pocket_consumer_key'), 'It seems that you already played this migration.'); - $userTable->addColumn('pocket_consumer_key', 'string'); + $configTable->addColumn('pocket_consumer_key', 'string'); $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'pocket_consumer_key';"); } @@ -43,7 +43,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI public function down(Schema $schema) { $configTable = $schema->getTable($this->getTable('config')); - $clientsTable->dropColumn('pocket_consumer_key'); + $configTable->dropColumn('pocket_consumer_key'); $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('pocket_consumer_key', NULL, 'import')"); } } -- cgit v1.2.3 From 9aa991281ddd315f607cabcfc3b917401d3d2104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 28 Nov 2016 12:08:51 +0100 Subject: Renamed view_mode by list_mode and hide excerpt --- app/DoctrineMigrations/Version20161128084725.php | 8 ++++---- app/Resources/static/themes/baggy/css/main.css | 8 ++++---- app/Resources/static/themes/material/css/main.css | 9 ++++++++- 3 files changed, 16 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161128084725.php b/app/DoctrineMigrations/Version20161128084725.php index 347a4256..242d5900 100644 --- a/app/DoctrineMigrations/Version20161128084725.php +++ b/app/DoctrineMigrations/Version20161128084725.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Added view_mode in user config. + * Added list_mode in user config. */ class Version20161128084725 extends AbstractMigration implements ContainerAwareInterface { @@ -33,9 +33,9 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI public function up(Schema $schema) { $configTable = $schema->getTable($this->getTable('config')); - $this->skipIf($configTable->hasColumn('view_mode'), 'It seems that you already played this migration.'); + $this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.'); - $configTable->addColumn('view_mode', 'integer'); + $configTable->addColumn('list_mode', 'integer'); } /** @@ -44,6 +44,6 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI public function down(Schema $schema) { $configTable = $schema->getTable($this->getTable('config')); - $configTable->dropColumn('view_mode'); + $configTable->dropColumn('list_mode'); } } diff --git a/app/Resources/static/themes/baggy/css/main.css b/app/Resources/static/themes/baggy/css/main.css index 6d656c21..e16846ea 100755 --- a/app/Resources/static/themes/baggy/css/main.css +++ b/app/Resources/static/themes/baggy/css/main.css @@ -617,6 +617,10 @@ div.pagination ul .current { background-color: #ccc; } +.hide { + display: none; +} + /* ========================================================================== 2.1 = "save a link" related styles ========================================================================== */ @@ -1203,10 +1207,6 @@ pre code { } @media screen and (max-width: 500px) { - .hide { - display: none; - } - .entry { width: 100%; margin-left: 0; diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 76423409..8f7b7a3d 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -555,6 +555,14 @@ a.original { margin-right: 5px !important; } +.card-stacked:hover ul.tools-list { + display: block; +} + +.card-stacked ul.tools-list { + display: none; +} + .card .card-action a { color: #fff; margin: 0; @@ -600,7 +608,6 @@ a.original { background-position: 50%; } - /* ========================================================================== 5 = Article ========================================================================== */ -- cgit v1.2.3 From 65a8c6e135e75bbcb37c286ce26b686f5af409c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 30 Nov 2016 11:27:07 +0100 Subject: Code review --- app/DoctrineMigrations/Version20161024212538.php | 6 +++--- app/DoctrineMigrations/Version20161122203647.php | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index 7e79cbde..75ff86f1 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -37,9 +37,9 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI $clientsTable->addForeignKeyConstraint( $this->getTable('user'), - array('user_id'), - array('id'), - array('onDelete' => 'CASCADE') + ['user_id'], + ['id'], + ['onDelete' => 'CASCADE'] ); } diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index 9c1557eb..94197193 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -42,12 +42,9 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI { $userTable = $schema->getTable($this->getTable('user')); - $this->skipIf(false === $userTable->hasColumn('expired'), 'It seems that you already played this migration.'); + $this->skipIf(false === $userTable->hasColumn('expired') || false === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); $userTable->dropColumn('expired'); - - $this->skipIf(false === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); - $userTable->dropColumn('credentials_expired'); } -- cgit v1.2.3 From 067ae472cc50a6047d6197f1a042ce239153407d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 30 Nov 2016 12:29:55 +0100 Subject: Named index --- app/DoctrineMigrations/Version20161104073720.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php index cd2029cb..4721426a 100644 --- a/app/DoctrineMigrations/Version20161104073720.php +++ b/app/DoctrineMigrations/Version20161104073720.php @@ -14,6 +14,8 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI */ private $container; + private $indexName = 'IDX_entry_created_at'; + public function setContainer(ContainerInterface $container = null) { $this->container = $container; @@ -30,7 +32,9 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI public function up(Schema $schema) { $entryTable = $schema->getTable($this->getTable('entry')); - $entryTable->addIndex(['created_at']); + $this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); + + $entryTable->addIndex(['created_at'], $this->indexName); } /** @@ -38,5 +42,9 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { + $entryTable = $schema->getTable($this->getTable('entry')); + $this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); + + $entryTable->dropIndex($this->indexName); } } -- cgit v1.2.3 From 24879db1f73c85b121702ba8c6ea36bae285c7c3 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 12 Dec 2016 17:41:03 +0100 Subject: Add default value for list_mode --- app/DoctrineMigrations/Version20161128084725.php | 2 +- app/config/config.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161128084725.php b/app/DoctrineMigrations/Version20161128084725.php index 242d5900..ea370076 100644 --- a/app/DoctrineMigrations/Version20161128084725.php +++ b/app/DoctrineMigrations/Version20161128084725.php @@ -35,7 +35,7 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI $configTable = $schema->getTable($this->getTable('config')); $this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.'); - $configTable->addColumn('list_mode', 'integer'); + $configTable->addColumn('list_mode', 'integer', ['notnull' => false]); } /** diff --git a/app/config/config.yml b/app/config/config.yml index 6b1ed056..d52f37c8 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -51,6 +51,8 @@ wallabag_core: rss_limit: 50 reading_speed: 1 cache_lifetime: 10 + action_mark_as_read: 1 + list_mode: 1 fetching_error_message: | wallabag can't retrieve contents for this article. Please troubleshoot this issue. -- cgit v1.2.3 From 21e7ccef3d960f4747d58fc0c9e081618e9451eb Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 14 Dec 2016 11:54:30 +0100 Subject: Fix tests & deprecation notice --- app/config/routing.yml | 4 ---- 1 file changed, 4 deletions(-) (limited to 'app') diff --git a/app/config/routing.yml b/app/config/routing.yml index eedf51d5..0bd2d130 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -17,10 +17,6 @@ wallabag_api: type: annotation prefix: / -wallabag_api: - resource: "@WallabagApiBundle/Resources/config/routing.yml" - prefix: / - app: resource: "@WallabagCoreBundle/Controller/" type: annotation -- cgit v1.2.3 From 99712e5d8509e624b2c81dfd10226babad446a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 8 Dec 2016 13:58:04 +0100 Subject: Added QoS for RabbitMQ --- app/config/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index d52f37c8..2dd5c1de 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -300,6 +300,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.pocket' callback: wallabag_import.consumer.amqp.pocket + qos_options: {prefetch_count: 10} import_readability: connection: default exchange_options: @@ -308,6 +309,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.readability' callback: wallabag_import.consumer.amqp.readability + qos_options: {prefetch_count: 10} import_instapaper: connection: default exchange_options: @@ -316,6 +318,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.instapaper' callback: wallabag_import.consumer.amqp.instapaper + qos_options: {prefetch_count: 10} import_pinboard: connection: default exchange_options: @@ -324,6 +327,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.pinboard' callback: wallabag_import.consumer.amqp.pinboard + qos_options: {prefetch_count: 10} import_wallabag_v1: connection: default exchange_options: @@ -332,6 +336,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.wallabag_v1' callback: wallabag_import.consumer.amqp.wallabag_v1 + qos_options: {prefetch_count: 10} import_wallabag_v2: connection: default exchange_options: @@ -340,6 +345,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.wallabag_v2' callback: wallabag_import.consumer.amqp.wallabag_v2 + qos_options: {prefetch_count: 10} import_firefox: connection: default exchange_options: @@ -348,6 +354,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.firefox' callback: wallabag_import.consumer.amqp.firefox + qos_options: {prefetch_count: 10} import_chrome: connection: default exchange_options: @@ -356,6 +363,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.chrome' callback: wallabag_import.consumer.amqp.chrome + qos_options: {prefetch_count: 10} fos_js_routing: routes_to_expose: -- cgit v1.2.3 From 881b0578e782e947706124a4e1d625a3dd3ddc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 15 Dec 2016 21:58:20 +0100 Subject: Moved RabbitMQ QoS to parameters --- app/config/config.yml | 16 ++++++++-------- app/config/parameters.yml.dist | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index 2dd5c1de..591b5294 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -300,7 +300,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.pocket' callback: wallabag_import.consumer.amqp.pocket - qos_options: {prefetch_count: 10} + qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_readability: connection: default exchange_options: @@ -309,7 +309,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.readability' callback: wallabag_import.consumer.amqp.readability - qos_options: {prefetch_count: 10} + qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_instapaper: connection: default exchange_options: @@ -318,7 +318,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.instapaper' callback: wallabag_import.consumer.amqp.instapaper - qos_options: {prefetch_count: 10} + qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_pinboard: connection: default exchange_options: @@ -327,7 +327,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.pinboard' callback: wallabag_import.consumer.amqp.pinboard - qos_options: {prefetch_count: 10} + qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_wallabag_v1: connection: default exchange_options: @@ -336,7 +336,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.wallabag_v1' callback: wallabag_import.consumer.amqp.wallabag_v1 - qos_options: {prefetch_count: 10} + qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_wallabag_v2: connection: default exchange_options: @@ -345,7 +345,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.wallabag_v2' callback: wallabag_import.consumer.amqp.wallabag_v2 - qos_options: {prefetch_count: 10} + qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_firefox: connection: default exchange_options: @@ -354,7 +354,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.firefox' callback: wallabag_import.consumer.amqp.firefox - qos_options: {prefetch_count: 10} + qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} import_chrome: connection: default exchange_options: @@ -363,7 +363,7 @@ old_sound_rabbit_mq: queue_options: name: 'wallabag.import.chrome' callback: wallabag_import.consumer.amqp.chrome - qos_options: {prefetch_count: 10} + qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"} fos_js_routing: routes_to_expose: diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index a4dc0bde..97f51ed1 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -49,6 +49,7 @@ parameters: rabbitmq_port: 5672 rabbitmq_user: guest rabbitmq_password: guest + rabbitmq_prefetch_count: 10 # Redis processing redis_scheme: tcp -- cgit v1.2.3 From 31fec5f363b915fb694d9a6e925d02da1e83b508 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 4 Dec 2016 12:56:20 +0100 Subject: Ensure craue_config_setting migration are ok We now can run the migration every time, new line from `craue_config_setting` are properly checked. --- app/DoctrineMigrations/Version20160911214952.php | 21 +++++++++++++++++++-- app/DoctrineMigrations/Version20161031132655.php | 7 +++++++ app/DoctrineMigrations/Version20161117071626.php | 21 +++++++++++++++++++-- app/DoctrineMigrations/Version20161122144743.php | 7 +++++++ 4 files changed, 52 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index 963821ae..7b85dc5e 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -29,8 +29,25 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_redis', 0, 'import')"); - $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')"); + $redis = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "import_with_redis"'); + + if (false === $redis) { + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_redis', 0, 'import')"); + } + + $rabbitmq = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "import_with_rabbitmq"'); + + if (false === $rabbitmq) { + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')"); + } + + $this->skipIf(false !== $rabbitmq && false !== $redis, 'It seems that you already played this migration.'); } /** diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index 39b85ea9..89b66018 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -29,6 +29,13 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { + $images = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "download_images_enabled"'); + + $this->skipIf(false !== $images, 'It seems that you already played this migration.'); + $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); } diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php index 33f5707e..e65598a9 100644 --- a/app/DoctrineMigrations/Version20161117071626.php +++ b/app/DoctrineMigrations/Version20161117071626.php @@ -29,8 +29,25 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { - $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); - $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); + $share = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "share_unmark"'); + + if (false === $share) { + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); + } + + $unmark = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "unmark_url"'); + + if (false === $unmark) { + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); + } + + $this->skipIf(false !== $share && false !== $unmark, 'It seems that you already played this migration.'); } /** diff --git a/app/DoctrineMigrations/Version20161122144743.php b/app/DoctrineMigrations/Version20161122144743.php index 536b8339..02113031 100644 --- a/app/DoctrineMigrations/Version20161122144743.php +++ b/app/DoctrineMigrations/Version20161122144743.php @@ -32,6 +32,13 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { + $access = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "restricted_access"'); + + $this->skipIf(false !== $access, 'It seems that you already played this migration.'); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); } -- cgit v1.2.3 From bea8d754171321fa6960ae8916da2a37667e7705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 18 Dec 2016 13:47:25 +0100 Subject: Replaced quotes for Postgres --- app/DoctrineMigrations/Version20160911214952.php | 4 ++-- app/DoctrineMigrations/Version20161031132655.php | 2 +- app/DoctrineMigrations/Version20161117071626.php | 4 ++-- app/DoctrineMigrations/Version20161122144743.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index 7b85dc5e..6ddeb767 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -32,7 +32,7 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI $redis = $this->container ->get('doctrine.orm.default_entity_manager') ->getConnection() - ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "import_with_redis"'); + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'import_with_redis'"); if (false === $redis) { $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_redis', 0, 'import')"); @@ -41,7 +41,7 @@ class Version20160911214952 extends AbstractMigration implements ContainerAwareI $rabbitmq = $this->container ->get('doctrine.orm.default_entity_manager') ->getConnection() - ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "import_with_rabbitmq"'); + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'import_with_rabbitmq'"); if (false === $rabbitmq) { $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')"); diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index 89b66018..770ad2d8 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -32,7 +32,7 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI $images = $this->container ->get('doctrine.orm.default_entity_manager') ->getConnection() - ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "download_images_enabled"'); + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'download_images_enabled'"); $this->skipIf(false !== $images, 'It seems that you already played this migration.'); diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php index e65598a9..d864888f 100644 --- a/app/DoctrineMigrations/Version20161117071626.php +++ b/app/DoctrineMigrations/Version20161117071626.php @@ -32,7 +32,7 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI $share = $this->container ->get('doctrine.orm.default_entity_manager') ->getConnection() - ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "share_unmark"'); + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_unmark'"); if (false === $share) { $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_unmark', 0, 'entry')"); @@ -41,7 +41,7 @@ class Version20161117071626 extends AbstractMigration implements ContainerAwareI $unmark = $this->container ->get('doctrine.orm.default_entity_manager') ->getConnection() - ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "unmark_url"'); + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'unmark_url'"); if (false === $unmark) { $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')"); diff --git a/app/DoctrineMigrations/Version20161122144743.php b/app/DoctrineMigrations/Version20161122144743.php index 02113031..388a0e4b 100644 --- a/app/DoctrineMigrations/Version20161122144743.php +++ b/app/DoctrineMigrations/Version20161122144743.php @@ -35,7 +35,7 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI $access = $this->container ->get('doctrine.orm.default_entity_manager') ->getConnection() - ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "restricted_access"'); + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'restricted_access'"); $this->skipIf(false !== $access, 'It seems that you already played this migration.'); -- cgit v1.2.3 From a48b5d5a5aa437cff0474321962c12b0e045dbf8 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 12 Dec 2016 11:01:54 +0100 Subject: Run migration in test, ready for MySQL --- app/DoctrineMigrations/Version20161022134138.php | 6 ++++++ app/DoctrineMigrations/Version20161031132655.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index b3d02b40..3ac8cc5b 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -33,6 +33,12 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); + // convert field length for utf8mb4 + // http://stackoverflow.com/a/31474509/569101 + $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE confirmation_token confirmation_token VARCHAR(180) NOT NULL;'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE salt salt VARCHAR(180) NOT NULL;'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE password password VARCHAR(180) NOT NULL;'); + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); $this->addSql('ALTER TABLE '.$this->getTable('tag').' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index 770ad2d8..f81898ff 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -36,7 +36,7 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI $this->skipIf(false !== $images, 'It seems that you already played this migration.'); - $this->addSql('INSERT INTO "'.$this->getTable('craue_config_setting')."\" (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('download_images_enabled', 0, 'misc')"); } /** @@ -44,6 +44,6 @@ class Version20161031132655 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->addSql('DELETE FROM "'.$this->getTable('craue_config_setting')."\" WHERE name = 'download_images_enabled';"); + $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'download_images_enabled';"); } } -- cgit v1.2.3 From 3ad4061dbab52a17cc961bef15abad181e352448 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 13 Dec 2016 09:35:54 +0100 Subject: pocket_consumer_key can be null --- app/DoctrineMigrations/Version20160916201049.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 9390755e..8b42bb87 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -33,7 +33,7 @@ class Version20160916201049 extends AbstractMigration implements ContainerAwareI $this->skipIf($configTable->hasColumn('pocket_consumer_key'), 'It seems that you already played this migration.'); - $configTable->addColumn('pocket_consumer_key', 'string'); + $configTable->addColumn('pocket_consumer_key', 'string', ['notnull' => false]); $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'pocket_consumer_key';"); } -- cgit v1.2.3 From d44016b072ebe146f3f875f6bf3e9268b367867e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 13 Dec 2016 10:31:53 +0100 Subject: Use actual database name We can't retrieve the environment within the migration. And when we ran migration on Travis, database name isn't `database_name` but `test_database_name`. Retrieve the database name from the connection is more accurate --- app/DoctrineMigrations/Version20161022134138.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index 3ac8cc5b..22469f63 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -31,7 +31,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI { $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); - $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); + $this->addSql('ALTER DATABASE '.$this->connection->getParams()['dbname'].' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); // convert field length for utf8mb4 // http://stackoverflow.com/a/31474509/569101 @@ -62,7 +62,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI { $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); - $this->addSql('ALTER DATABASE '.$this->container->getParameter('database_name').' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); + $this->addSql('ALTER DATABASE '.$this->connection->getParams()['dbname'].' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); $this->addSql('ALTER TABLE '.$this->getTable('annotation').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); $this->addSql('ALTER TABLE '.$this->getTable('entry').' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); -- cgit v1.2.3 From 6514f0ed37da14346338b11ee055c1d49813df49 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 13 Dec 2016 10:41:47 +0100 Subject: fixup! Run migration in test, ready for MySQL --- app/DoctrineMigrations/Version20161022134138.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index 22469f63..d0e5cb3f 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -35,7 +35,7 @@ class Version20161022134138 extends AbstractMigration implements ContainerAwareI // convert field length for utf8mb4 // http://stackoverflow.com/a/31474509/569101 - $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE confirmation_token confirmation_token VARCHAR(180) NOT NULL;'); + $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL;'); $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE salt salt VARCHAR(180) NOT NULL;'); $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE password password VARCHAR(180) NOT NULL;'); -- cgit v1.2.3 From 3ef75cc4e327146513ff077d69de65c8f93b775c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 19 Dec 2016 14:24:19 +0100 Subject: Be consistent between migration & schema definition --- app/DoctrineMigrations/Version20161106113822.php | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index 5032a8f0..55bd87a2 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -35,6 +35,7 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI $configTable->addColumn('action_mark_as_read', 'integer', [ 'default' => 0, + 'notnull' => false, ]); } -- cgit v1.2.3 From 78d6c3090a03b25ad349f7de679fb18303ce0a9d Mon Sep 17 00:00:00 2001 From: Simounet Date: Tue, 20 Dec 2016 13:04:51 +0100 Subject: Fix the box shadow on the card entry --- .../static/themes/material/js/shortcuts/main.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js index ad4ca80a..0a2d2a69 100644 --- a/app/Resources/static/themes/material/js/shortcuts/main.js +++ b/app/Resources/static/themes/material/js/shortcuts/main.js @@ -8,9 +8,14 @@ function toggleFocus(cardToToogleFocus) { } $(document).ready(() => { + const cards = $('#content').find('.card'); + const cardNumber = cards.length; let cardIndex = 0; - const cardNumber = $('#content ul.data > li').length; - let card = $('#content ul.data > li')[cardIndex]; + /* If we come from next page */ + if (window.location.hash === '#prev') { + cardIndex = cardNumber - 1; + } + let card = cards[cardIndex]; const pagination = $('.pagination'); /* Show nothing on quickstart */ @@ -18,12 +23,6 @@ $(document).ready(() => { return; } - /* If we come from next page */ - if (window.location.hash === '#prev') { - cardIndex = cardNumber - 1; - card = $('ul.data > li')[cardIndex]; - } - /* Focus current card */ toggleFocus(card); @@ -47,7 +46,7 @@ $(document).ready(() => { if (cardIndex >= 0 && cardIndex < cardNumber - 1) { toggleFocus(card); cardIndex += 1; - card = $('ul.data > li')[cardIndex]; + card = cards[cardIndex]; toggleFocus(card); return; } @@ -61,7 +60,7 @@ $(document).ready(() => { if (cardIndex > 0 && cardIndex < cardNumber) { toggleFocus(card); cardIndex -= 1; - card = $('ul.data > li')[cardIndex]; + card = cards[cardIndex]; toggleFocus(card); return; } -- cgit v1.2.3 From a72f3dc308f2e4386f73e88af41db919ba0acaf3 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 23 Dec 2016 09:00:13 +0100 Subject: Fix bad migration for PostreSQL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Queries weren’t executed for PostgreSQL, bad syntax. --- app/DoctrineMigrations/Version20161001072726.php | 76 +++++++++++++++++++++--- 1 file changed, 68 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index 5ab88555..f6930778 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -32,22 +32,82 @@ class Version20161001072726 extends AbstractMigration implements ContainerAwareI $this->skipIf($this->connection->getDatabasePlatform()->getName() == 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); // remove all FK from entry_tag - $query = $this->connection->query("SELECT CONSTRAINT_NAME FROM information_schema.key_column_usage WHERE TABLE_NAME = '".$this->getTable('entry_tag')."' AND CONSTRAINT_NAME LIKE 'FK_%' AND TABLE_SCHEMA = '".$this->connection->getDatabase()."'"); - $query->execute(); + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'mysql': + $query = $this->connection->query(" + SELECT CONSTRAINT_NAME + FROM information_schema.key_column_usage + WHERE TABLE_NAME = '".$this->getTable('entry_tag')."' AND CONSTRAINT_NAME LIKE 'FK_%' + AND TABLE_SCHEMA = '".$this->connection->getDatabase()."'" + ); + $query->execute(); - foreach ($query->fetchAll() as $fk) { - $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY '.$fk['CONSTRAINT_NAME']); + foreach ($query->fetchAll() as $fk) { + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP FOREIGN KEY '.$fk['CONSTRAINT_NAME']); + } + break; + + case 'postgresql': + // http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk + $query = $this->connection->query(" + SELECT conrelid::regclass AS table_from + ,conname + ,pg_get_constraintdef(c.oid) + FROM pg_constraint c + JOIN pg_namespace n ON n.oid = c.connamespace + WHERE contype = 'f' + AND conrelid::regclass::text = '".$this->getTable('entry_tag')."' + AND n.nspname = 'public';" + ); + $query->execute(); + + foreach ($query->fetchAll() as $fk) { + $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' DROP CONSTRAINT '.$fk['conname']); + } + break; } $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_entry_tag_entry FOREIGN KEY (entry_id) REFERENCES '.$this->getTable('entry').' (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE '.$this->getTable('entry_tag').' ADD CONSTRAINT FK_entry_tag_tag FOREIGN KEY (tag_id) REFERENCES '.$this->getTable('tag').' (id) ON DELETE CASCADE'); // remove entry FK from annotation - $query = $this->connection->query("SELECT CONSTRAINT_NAME FROM information_schema.key_column_usage WHERE TABLE_NAME = '".$this->getTable('annotation')."' AND CONSTRAINT_NAME LIKE 'FK_%' and COLUMN_NAME = 'entry_id' AND TABLE_SCHEMA = '".$this->connection->getDatabase()."'"); - $query->execute(); - foreach ($query->fetchAll() as $fk) { - $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP FOREIGN KEY '.$fk['CONSTRAINT_NAME']); + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'mysql': + $query = $this->connection->query(" + SELECT CONSTRAINT_NAME + FROM information_schema.key_column_usage + WHERE TABLE_NAME = '".$this->getTable('annotation')."' + AND CONSTRAINT_NAME LIKE 'FK_%' + AND COLUMN_NAME = 'entry_id' + AND TABLE_SCHEMA = '".$this->connection->getDatabase()."'" + ); + $query->execute(); + + foreach ($query->fetchAll() as $fk) { + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP FOREIGN KEY '.$fk['CONSTRAINT_NAME']); + } + break; + + case 'postgresql': + // http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk + $query = $this->connection->query(" + SELECT conrelid::regclass AS table_from + ,conname + ,pg_get_constraintdef(c.oid) + FROM pg_constraint c + JOIN pg_namespace n ON n.oid = c.connamespace + WHERE contype = 'f' + AND conrelid::regclass::text = '".$this->getTable('annotation')."' + AND n.nspname = 'public' + AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';" + ); + $query->execute(); + + foreach ($query->fetchAll() as $fk) { + $this->addSql('ALTER TABLE '.$this->getTable('annotation').' DROP CONSTRAINT '.$fk['conname']); + } + break; } $this->addSql('ALTER TABLE '.$this->getTable('annotation').' ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES '.$this->getTable('entry').' (id) ON DELETE CASCADE'); -- cgit v1.2.3 From 74b7c0985d3ff2b2011d0809c9b71e505e9aa947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 14 Dec 2016 09:47:07 +0100 Subject: Added index on entry.uuid Useful for entry sharing --- app/DoctrineMigrations/Version20161214094403.php | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161214094403.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161214094403.php b/app/DoctrineMigrations/Version20161214094403.php new file mode 100644 index 00000000..fc9acb5a --- /dev/null +++ b/app/DoctrineMigrations/Version20161214094403.php @@ -0,0 +1,53 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + $this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); + + $entryTable->addIndex(['uuid'], $this->indexName); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + $this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); + + $entryTable->dropIndex($this->indexName); + } +} -- cgit v1.2.3 From 89cd670abfc77ca268a538c9323a4026fec06fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 23 Dec 2016 09:49:22 +0100 Subject: Changed uuid type in database --- app/DoctrineMigrations/Version20160410190541.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 0cdec008..8761a9bb 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -33,8 +33,9 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI $this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.'); - $entryTable->addColumn('uuid', 'guid', [ + $entryTable->addColumn('uuid', 'string', [ 'notnull' => false, + 'length' => 23, ]); $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_public', '1', 'entry')"); } -- cgit v1.2.3 From 7239082a5e290dada1d393f7a25acebb09ace2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 29 Dec 2016 10:09:44 +0100 Subject: Renamed uuid to uid --- app/DoctrineMigrations/Version20160410190541.php | 6 +++--- app/DoctrineMigrations/Version20161214094403.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index 8761a9bb..f166a325 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -31,9 +31,9 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI { $entryTable = $schema->getTable($this->getTable('entry')); - $this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.'); + $this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.'); - $entryTable->addColumn('uuid', 'string', [ + $entryTable->addColumn('uid', 'string', [ 'notnull' => false, 'length' => 23, ]); @@ -46,7 +46,7 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI public function down(Schema $schema) { $entryTable = $schema->getTable($this->getTable('entry')); - $entryTable->dropColumn('uuid'); + $entryTable->dropColumn('uid'); $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_public'"); } diff --git a/app/DoctrineMigrations/Version20161214094403.php b/app/DoctrineMigrations/Version20161214094403.php index fc9acb5a..5948b5fa 100644 --- a/app/DoctrineMigrations/Version20161214094403.php +++ b/app/DoctrineMigrations/Version20161214094403.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Added index on wallabag_entry.uuid + * Added index on wallabag_entry.uid */ class Version20161214094403 extends AbstractMigration implements ContainerAwareInterface { @@ -17,7 +17,7 @@ class Version20161214094403 extends AbstractMigration implements ContainerAwareI */ private $container; - private $indexName = 'IDX_entry_uiid'; + private $indexName = 'IDX_entry_uid'; public function setContainer(ContainerInterface $container = null) { @@ -37,7 +37,7 @@ class Version20161214094403 extends AbstractMigration implements ContainerAwareI $entryTable = $schema->getTable($this->getTable('entry')); $this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.'); - $entryTable->addIndex(['uuid'], $this->indexName); + $entryTable->addIndex(['uid'], $this->indexName); } /** -- cgit v1.2.3 From 22d0c929e33e8902db92c18b6fa288b773f46e36 Mon Sep 17 00:00:00 2001 From: Simounet Date: Thu, 29 Dec 2016 19:19:51 +0100 Subject: Access to search, filters, export on mobile --- app/Resources/static/themes/material/css/main.css | 36 ++++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 8f7b7a3d..c6b7326d 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -283,6 +283,16 @@ nav input { color: #aaa; } +nav { + height: auto; +} + +.nav-wrapper { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} + .nav-wrapper .button-collapse { padding: 0 15px; } @@ -291,8 +301,10 @@ nav input { display: none; } -.nav-panels { - overflow: hidden; +.nav-panel-buttom { + display: flex; + flex-grow: 1; + justify-content: right; } .nav-panel-buttom li { @@ -357,7 +369,7 @@ nav input { .input-field.nav-panel-add form, .input-field.nav-panel-search, .input-field.nav-panel-search form { - height: 100%; + flex-grow: 1; } /* ========================================================================== @@ -807,6 +819,14 @@ article aside .tools li { width: auto; } + .nav-panels .action { + padding-right: 0.75rem; + } + + .nav-panel-buttom { + justify-content: space-around; + } + #article { max-width: 35em; margin-left: auto; @@ -843,11 +863,13 @@ article aside .tools li { .pagination li.next { width: auto; } -} -@media only screen and (min-width: 400px) { - .nav-panel-buttom { - float: right; + .drag-target + .drag-target { + height: 50%; + } + + .drag-target + .drag-target + .drag-target { + top: 50%; } } -- cgit v1.2.3 From 0bacc9e175d57676bf23348cf039cb3f214dfb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 30 Dec 2016 13:23:02 +0100 Subject: Fixed API error 'No matching accepted Response format could be determined' --- app/config/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/config/config.yml b/app/config/config.yml index 591b5294..05c82e43 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -148,9 +148,9 @@ fos_rest: format_listener: enabled: true rules: - - { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: false, prefer_extension: false } - - { path: "^/api", priorities: ['json', 'xml'], fallback_format: false, prefer_extension: false } - - { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: false, prefer_extension: false } + - { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: json, prefer_extension: false } + - { path: "^/api", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false } + - { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false } # for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener # so we need to add custom rule for custom api export but also for all other routes of the application... - { path: '^/', priorities: ['text/html', '*/*'], fallback_format: html, prefer_extension: false } -- cgit v1.2.3 From 8e2419a5cf8b28281eef9b567e0e24b190cbe9dd Mon Sep 17 00:00:00 2001 From: Simounet Date: Thu, 29 Dec 2016 19:17:36 +0100 Subject: Fix right side-nav scrolling on low height window --- app/Resources/static/themes/material/css/main.css | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index c6b7326d..50aa690c 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -439,7 +439,6 @@ nav ul a:hover { .side-nav.fixed.right-aligned { right: -250px; left: auto !important; - overflow-y: visible; } #filters div.with-checkbox { -- cgit v1.2.3 From bb2934d47638c913579b18d66b72687bc508fdfa Mon Sep 17 00:00:00 2001 From: Simounet Date: Fri, 30 Dec 2016 13:54:13 +0100 Subject: Fix action's icons position --- app/Resources/static/themes/material/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 50aa690c..f43e6042 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css @@ -304,7 +304,7 @@ nav { .nav-panel-buttom { display: flex; flex-grow: 1; - justify-content: right; + justify-content: flex-end; } .nav-panel-buttom li { -- cgit v1.2.3 From ccb9e79a35cdac9f93de90f577f8ec63fdcc6081 Mon Sep 17 00:00:00 2001 From: Simounet Date: Thu, 29 Dec 2016 19:17:36 +0100 Subject: Fix double overlay on expanded right sidenav --- app/Resources/static/themes/_global/js/tools.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 568b2dce..cee84fa8 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -35,7 +35,7 @@ function initFilters() { // no display if filters not available if ($('div').is('#filters')) { $('#button_filters').show(); - $('.button-collapse-right').sideNav({ edge: 'right' }); + $('.js-filters-action').sideNav({ edge: 'right' }); $('#clear_form_filters').on('click', () => { $('#filters input').val(''); $('#filters :checked').removeAttr('checked'); @@ -48,7 +48,7 @@ function initExport() { // no display if export not available if ($('div').is('#export')) { $('#button_export').show(); - $('.button-collapse-right').sideNav({ edge: 'right' }); + $('.js-export-action').sideNav({ edge: 'right' }); } } -- cgit v1.2.3 From 5ed503ab28b912bb0427dbe68c02dd831b397001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 14 Jan 2017 13:46:20 +0100 Subject: Added migration to rename uuid to uid --- app/DoctrineMigrations/Version20161214094402.php | 71 ++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 app/DoctrineMigrations/Version20161214094402.php (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161214094402.php b/app/DoctrineMigrations/Version20161214094402.php new file mode 100644 index 00000000..3a09c29e --- /dev/null +++ b/app/DoctrineMigrations/Version20161214094402.php @@ -0,0 +1,71 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + + $this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.'); + + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + // + break; + case 'mysql': + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE uuid uid VARCHAR(23)'); + break; + case 'postgresql': + $this->addSql('ALTER TABLE '.$this->getTable('entry').' RENAME uuid TO uid'); + } + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + $entryTable = $schema->getTable($this->getTable('entry')); + + $this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.'); + + switch ($this->connection->getDatabasePlatform()->getName()) { + case 'sqlite': + // + break; + case 'mysql': + $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE uid uuid VARCHAR(23)'); + break; + case 'postgresql': + $this->addSql('ALTER TABLE '.$this->getTable('entry').' RENAME uid TO uuid'); + } + } +} -- cgit v1.2.3 From b87f1712336564ec14e37487f512568bc4d986f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 13 Jan 2017 14:51:37 +0100 Subject: Added information about latest migrations --- app/DoctrineMigrations/Version20160410190541.php | 3 +++ app/DoctrineMigrations/Version20160812120952.php | 3 +++ app/DoctrineMigrations/Version20160911214952.php | 3 +++ app/DoctrineMigrations/Version20160916201049.php | 3 +++ app/DoctrineMigrations/Version20161001072726.php | 3 +++ app/DoctrineMigrations/Version20161022134138.php | 3 +++ app/DoctrineMigrations/Version20161024212538.php | 3 +++ app/DoctrineMigrations/Version20161031132655.php | 3 +++ app/DoctrineMigrations/Version20161104073720.php | 3 +++ app/DoctrineMigrations/Version20161106113822.php | 3 +++ app/DoctrineMigrations/Version20161117071626.php | 3 +++ 11 files changed, 33 insertions(+) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index f166a325..ebf4135f 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added foreign keys for account resetting + */ class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20160812120952.php b/app/DoctrineMigrations/Version20160812120952.php index 053b8d88..bd6e8d63 100644 --- a/app/DoctrineMigrations/Version20160812120952.php +++ b/app/DoctrineMigrations/Version20160812120952.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added name field on wallabag_oauth2_clients + */ class Version20160812120952 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20160911214952.php b/app/DoctrineMigrations/Version20160911214952.php index 6ddeb767..edef81ed 100644 --- a/app/DoctrineMigrations/Version20160911214952.php +++ b/app/DoctrineMigrations/Version20160911214952.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added settings for RabbitMQ and Redis imports + */ class Version20160911214952 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20160916201049.php b/app/DoctrineMigrations/Version20160916201049.php index 8b42bb87..9f8e77e7 100644 --- a/app/DoctrineMigrations/Version20160916201049.php +++ b/app/DoctrineMigrations/Version20160916201049.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added pocket_consumer_key field on wallabag_config + */ class Version20160916201049 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index f6930778..b5d104cd 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added pocket_consumer_key field on wallabag_config + */ class Version20161001072726 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index d0e5cb3f..c71166a0 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Converted database to utf8mb4 encoding (for MySQL only) + */ class Version20161022134138 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index 75ff86f1..0c5a53da 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added user_id column on oauth2_clients to prevent users to delete API clients from other users + */ class Version20161024212538 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20161031132655.php b/app/DoctrineMigrations/Version20161031132655.php index f81898ff..83b97ca9 100644 --- a/app/DoctrineMigrations/Version20161031132655.php +++ b/app/DoctrineMigrations/Version20161031132655.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added the internal setting to enable/disable downloading pictures + */ class Version20161031132655 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20161104073720.php b/app/DoctrineMigrations/Version20161104073720.php index 4721426a..fb8f5fa1 100644 --- a/app/DoctrineMigrations/Version20161104073720.php +++ b/app/DoctrineMigrations/Version20161104073720.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added created_at index on entry table + */ class Version20161104073720 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index 55bd87a2..faa2d9fd 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added action_mark_as_read field on config table + */ class Version20161106113822 extends AbstractMigration implements ContainerAwareInterface { /** diff --git a/app/DoctrineMigrations/Version20161117071626.php b/app/DoctrineMigrations/Version20161117071626.php index d864888f..8daa2142 100644 --- a/app/DoctrineMigrations/Version20161117071626.php +++ b/app/DoctrineMigrations/Version20161117071626.php @@ -7,6 +7,9 @@ use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +/** + * Added the internal setting to share articles to unmark.it + */ class Version20161117071626 extends AbstractMigration implements ContainerAwareInterface { /** -- cgit v1.2.3 From 4acbeb93717612f361627f7d4b946fcb4477823c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 23 Jan 2017 14:16:00 +0100 Subject: Added hardcoded SQL for migration to 2.2 --- app/DoctrineMigrations/Version20161001072726.php | 1 + app/DoctrineMigrations/Version20161024212538.php | 16 ++++++++++++++-- app/DoctrineMigrations/Version20161106113822.php | 5 ++++- app/DoctrineMigrations/Version20161118134328.php | 7 +++++-- app/DoctrineMigrations/Version20161122203647.php | 7 +++++-- app/DoctrineMigrations/Version20161128131503.php | 2 +- 6 files changed, 30 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index b5d104cd..f247c236 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; +use Doctrine\DBAL\Migrations\SkipMigrationException; /** * Added pocket_consumer_key field on wallabag_config diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index 0c5a53da..ecb872d1 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -17,6 +17,8 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI */ private $container; + private $constraintName = 'IDX_user_oauth_client'; + public function setContainer(ContainerInterface $container = null) { $this->container = $container; @@ -36,13 +38,14 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI $this->skipIf($clientsTable->hasColumn('user_id'), 'It seems that you already played this migration.'); - $clientsTable->addColumn('user_id', 'integer'); + $clientsTable->addColumn('user_id', 'integer', ['notnull' => false]); $clientsTable->addForeignKeyConstraint( $this->getTable('user'), ['user_id'], ['id'], - ['onDelete' => 'CASCADE'] + ['onDelete' => 'CASCADE'], + $this->constraintName ); } @@ -51,5 +54,14 @@ class Version20161024212538 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { + $clientsTable = $schema->getTable($this->getTable('oauth2_clients')); + + $this->skipIf(!$clientsTable->hasColumn('user_id'), 'It seems that you already played this migration.'); + + $clientsTable->dropColumn('user_id', 'integer'); + + if ($this->connection->getDatabasePlatform()->getName() != 'sqlite') { + $clientsTable->removeForeignKey($this->constraintName); + } } } diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php index faa2d9fd..de3702a4 100644 --- a/app/DoctrineMigrations/Version20161106113822.php +++ b/app/DoctrineMigrations/Version20161106113822.php @@ -48,6 +48,9 @@ class Version20161106113822 extends AbstractMigration implements ContainerAwareI public function down(Schema $schema) { $configTable = $schema->getTable($this->getTable('config')); - $userTable->dropColumn('action_mark_as_read'); + + $this->skipIf(!$configTable->hasColumn('action_mark_as_read'), 'It seems that you already played this migration.'); + + $configTable->dropColumn('action_mark_as_read'); } } diff --git a/app/DoctrineMigrations/Version20161118134328.php b/app/DoctrineMigrations/Version20161118134328.php index f168cb53..7b2eeb7b 100644 --- a/app/DoctrineMigrations/Version20161118134328.php +++ b/app/DoctrineMigrations/Version20161118134328.php @@ -47,7 +47,10 @@ class Version20161118134328 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $userTable = $schema->getTable($this->getTable('entry')); - $userTable->dropColumn('http_status'); + $entryTable = $schema->getTable($this->getTable('entry')); + + $this->skipIf(!$entryTable->hasColumn('http_status'), 'It seems that you already played this migration.'); + + $entryTable->dropColumn('http_status'); } } diff --git a/app/DoctrineMigrations/Version20161122203647.php b/app/DoctrineMigrations/Version20161122203647.php index 94197193..9b17d6ef 100644 --- a/app/DoctrineMigrations/Version20161122203647.php +++ b/app/DoctrineMigrations/Version20161122203647.php @@ -54,7 +54,10 @@ class Version20161122203647 extends AbstractMigration implements ContainerAwareI public function down(Schema $schema) { $userTable = $schema->getTable($this->getTable('user')); - $userTable->addColumn('expired', 'smallint'); - $userTable->addColumn('credentials_expired', 'smallint'); + + $this->skipIf(true === $userTable->hasColumn('expired') || true === $userTable->hasColumn('credentials_expired'), 'It seems that you already played this migration.'); + + $userTable->addColumn('expired', 'smallint', ['notnull' => false]); + $userTable->addColumn('credentials_expired', 'smallint', ['notnull' => false]); } } diff --git a/app/DoctrineMigrations/Version20161128131503.php b/app/DoctrineMigrations/Version20161128131503.php index f0e016c8..b71aa38b 100644 --- a/app/DoctrineMigrations/Version20161128131503.php +++ b/app/DoctrineMigrations/Version20161128131503.php @@ -55,7 +55,7 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI foreach ($this->fields as $field => $type) { $this->skipIf($userTable->hasColumn($field), 'It seems that you already played this migration.'); - $userTable->addColumn($field, $type); + $userTable->addColumn($field, $type, ['notnull' => false]); } } } -- cgit v1.2.3 From 6dfd1a6c78a851cb044a7a7d3d7a3328bacec13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 25 Jan 2017 12:59:04 +0100 Subject: Added migration for SQLite --- app/DoctrineMigrations/Version20161214094402.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/DoctrineMigrations/Version20161214094402.php b/app/DoctrineMigrations/Version20161214094402.php index 3a09c29e..db125f76 100644 --- a/app/DoctrineMigrations/Version20161214094402.php +++ b/app/DoctrineMigrations/Version20161214094402.php @@ -38,7 +38,11 @@ class Version20161214094402 extends AbstractMigration implements ContainerAwareI switch ($this->connection->getDatabasePlatform()->getName()) { case 'sqlite': - // + $this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM '.$this->getTable('entry')); + $this->addSql('DROP TABLE '.$this->getTable('entry')); + $this->addSql('CREATE TABLE '.$this->getTable('entry').' (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT "0", PRIMARY KEY(id));'); + $this->addSql('INSERT INTO '.$this->getTable('entry').' (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public) SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM __temp__wallabag_entry;'); + $this->addSql('DROP TABLE __temp__wallabag_entry'); break; case 'mysql': $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE uuid uid VARCHAR(23)'); @@ -59,7 +63,7 @@ class Version20161214094402 extends AbstractMigration implements ContainerAwareI switch ($this->connection->getDatabasePlatform()->getName()) { case 'sqlite': - // + throw new SkipMigrationException('Too complex ...'); break; case 'mysql': $this->addSql('ALTER TABLE '.$this->getTable('entry').' CHANGE uid uuid VARCHAR(23)'); -- cgit v1.2.3