aboutsummaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/AppKernel.php2
-rwxr-xr-xapp/DoctrineMigrations/Version20180405182455.php68
-rw-r--r--app/Resources/static/themes/_global/index.js19
-rw-r--r--app/Resources/static/themes/baggy/css/layout.scss11
-rw-r--r--app/Resources/static/themes/material/css/cards.scss11
-rw-r--r--app/config/config.yml16
-rw-r--r--app/config/config_test.yml1
-rw-r--r--app/config/parameters.yml.dist11
-rw-r--r--app/config/security.yml4
-rw-r--r--app/config/services.yml6
-rw-r--r--app/config/services_test.yml38
11 files changed, 171 insertions, 16 deletions
diff --git a/app/AppKernel.php b/app/AppKernel.php
index 40726f05..546794de 100644
--- a/app/AppKernel.php
+++ b/app/AppKernel.php
@@ -32,6 +32,7 @@ class AppKernel extends Kernel
32 new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), 32 new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
33 new FOS\JsRoutingBundle\FOSJsRoutingBundle(), 33 new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
34 new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(), 34 new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(),
35 new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
35 36
36 // wallabag bundles 37 // wallabag bundles
37 new Wallabag\CoreBundle\WallabagCoreBundle(), 38 new Wallabag\CoreBundle\WallabagCoreBundle(),
@@ -39,7 +40,6 @@ class AppKernel extends Kernel
39 new Wallabag\UserBundle\WallabagUserBundle(), 40 new Wallabag\UserBundle\WallabagUserBundle(),
40 new Wallabag\ImportBundle\WallabagImportBundle(), 41 new Wallabag\ImportBundle\WallabagImportBundle(),
41 new Wallabag\AnnotationBundle\WallabagAnnotationBundle(), 42 new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
42 new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
43 ]; 43 ];
44 44
45 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { 45 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
diff --git a/app/DoctrineMigrations/Version20180405182455.php b/app/DoctrineMigrations/Version20180405182455.php
new file mode 100755
index 00000000..71879c0e
--- /dev/null
+++ b/app/DoctrineMigrations/Version20180405182455.php
@@ -0,0 +1,68 @@
1<?php
2
3namespace Application\Migrations;
4
5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema;
7use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8use Symfony\Component\DependencyInjection\ContainerInterface;
9
10/**
11 * Add archived_at column and set its value to updated_at for is_archived entries.
12 */
13class Version20180405182455 extends AbstractMigration implements ContainerAwareInterface
14{
15 /**
16 * @var ContainerInterface
17 */
18 private $container;
19
20 public function setContainer(ContainerInterface $container = null)
21 {
22 $this->container = $container;
23 }
24
25 /**
26 * @param Schema $schema
27 */
28 public function up(Schema $schema)
29 {
30 $entryTable = $schema->getTable($this->getTable('entry'));
31
32 $this->skipIf($entryTable->hasColumn('archived_at'), 'It seems that you already played this migration.');
33
34 $entryTable->addColumn('archived_at', 'datetime', [
35 'notnull' => false,
36 ]);
37 }
38
39 public function postUp(Schema $schema)
40 {
41 $entryTable = $schema->getTable($this->getTable('entry'));
42 $this->skipIf(!$entryTable->hasColumn('archived_at'), 'Unable to add archived_at colum');
43
44 $this->connection->executeQuery(
45 'UPDATE ' . $this->getTable('entry') . ' SET archived_at = updated_at WHERE is_archived = :is_archived',
46 [
47 'is_archived' => true,
48 ]
49 );
50 }
51
52 /**
53 * @param Schema $schema
54 */
55 public function down(Schema $schema)
56 {
57 $entryTable = $schema->getTable($this->getTable('entry'));
58
59 $this->skipIf(!$entryTable->hasColumn('archived_at'), 'It seems that you already played this migration.');
60
61 $entryTable->dropColumn('archived_at');
62 }
63
64 private function getTable($tableName)
65 {
66 return $this->container->getParameter('database_table_prefix') . $tableName;
67 }
68}
diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js
index ae598e56..bb3e95b6 100644
--- a/app/Resources/static/themes/_global/index.js
+++ b/app/Resources/static/themes/_global/index.js
@@ -70,4 +70,23 @@ $(document).ready(() => {
70 retrievePercent(x.entryId, true); 70 retrievePercent(x.entryId, true);
71 }); 71 });
72 } 72 }
73
74 document.querySelectorAll('[data-handler=tag-rename]').forEach((item) => {
75 const current = item;
76 current.wallabag_edit_mode = false;
77 current.onclick = (event) => {
78 const target = event.currentTarget;
79
80 if (target.wallabag_edit_mode === false) {
81 $(target.parentNode.querySelector('[data-handle=tag-link]')).addClass('hidden');
82 $(target.parentNode.querySelector('[data-handle=tag-rename-form]')).removeClass('hidden');
83 target.parentNode.querySelector('[data-handle=tag-rename-form] input').focus();
84 target.querySelector('.material-icons').innerHTML = 'done';
85
86 target.wallabag_edit_mode = true;
87 } else {
88 target.parentNode.querySelector('[data-handle=tag-rename-form]').submit();
89 }
90 };
91 });
73}); 92});
diff --git a/app/Resources/static/themes/baggy/css/layout.scss b/app/Resources/static/themes/baggy/css/layout.scss
index cb14e62d..0293ebe5 100644
--- a/app/Resources/static/themes/baggy/css/layout.scss
+++ b/app/Resources/static/themes/baggy/css/layout.scss
@@ -295,6 +295,15 @@ div.pagination ul {
295 } 295 }
296} 296}
297 297
298.hide { 298.card-tag-form {
299 display: inline-block;
300}
301
302.card-tag-form input[type="text"] {
303 min-width: 20em;
304}
305
306.hide,
307.hidden {
299 display: none; 308 display: none;
300} 309}
diff --git a/app/Resources/static/themes/material/css/cards.scss b/app/Resources/static/themes/material/css/cards.scss
index 6691adc6..52872220 100644
--- a/app/Resources/static/themes/material/css/cards.scss
+++ b/app/Resources/static/themes/material/css/cards.scss
@@ -185,6 +185,17 @@ a.original:not(.waves-effect) {
185 flex-grow: 1; 185 flex-grow: 1;
186} 186}
187 187
188.card-tag-form {
189 display: flex;
190 min-width: 100px;
191 flex-grow: 1;
192}
193
194.card-tag-form input {
195 margin-bottom: 0;
196 height: 2rem;
197}
198
188.card-tag-rss { 199.card-tag-rss {
189 display: flex; 200 display: flex;
190} 201}
diff --git a/app/config/config.yml b/app/config/config.yml
index 0c2b6a1d..092f3ec0 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -79,10 +79,13 @@ doctrine_migrations:
79 79
80# Swiftmailer Configuration 80# Swiftmailer Configuration
81swiftmailer: 81swiftmailer:
82 transport: "%mailer_transport%" 82 transport: "%mailer_transport%"
83 host: "%mailer_host%" 83 username: "%mailer_user%"
84 username: "%mailer_user%" 84 password: "%mailer_password%"
85 password: "%mailer_password%" 85 host: "%mailer_host%"
86 port: "%mailer_port%"
87 encryption: "%mailer_encryption%"
88 auth_mode: "%mailer_auth_mode%"
86 spool: 89 spool:
87 type: memory 90 type: memory
88 91
@@ -357,3 +360,8 @@ jms_serializer:
357 # see: https://github.com/schmittjoh/JMSSerializerBundle/pull/494 360 # see: https://github.com/schmittjoh/JMSSerializerBundle/pull/494
358 datetime: 361 datetime:
359 default_format: "Y-m-d\\TH:i:sO" # ATOM 362 default_format: "Y-m-d\\TH:i:sO" # ATOM
363
364# see https://github.com/symfony/symfony-standard/pull/1133
365sensio_framework_extra:
366 router:
367 annotations: false
diff --git a/app/config/config_test.yml b/app/config/config_test.yml
index fc067ff4..11e0feb7 100644
--- a/app/config/config_test.yml
+++ b/app/config/config_test.yml
@@ -1,6 +1,7 @@
1imports: 1imports:
2 - { resource: config_dev.yml } 2 - { resource: config_dev.yml }
3 - { resource: parameters_test.yml } 3 - { resource: parameters_test.yml }
4 - { resource: services_test.yml }
4 5
5framework: 6framework:
6 test: ~ 7 test: ~
diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist
index 6b0cb8e8..d21f20e0 100644
--- a/app/config/parameters.yml.dist
+++ b/app/config/parameters.yml.dist
@@ -27,10 +27,13 @@ parameters:
27 27
28 domain_name: https://your-wallabag-url-instance.com 28 domain_name: https://your-wallabag-url-instance.com
29 29
30 mailer_transport: smtp 30 mailer_transport: smtp
31 mailer_host: 127.0.0.1 31 mailer_user: ~
32 mailer_user: ~ 32 mailer_password: ~
33 mailer_password: ~ 33 mailer_host: 127.0.0.1
34 mailer_port: false
35 mailer_encryption: ~
36 mailer_auth_mode: ~
34 37
35 locale: en 38 locale: en
36 39
diff --git a/app/config/security.yml b/app/config/security.yml
index 02afc9ea..0318fce1 100644
--- a/app/config/security.yml
+++ b/app/config/security.yml
@@ -31,12 +31,15 @@ security:
31 fos_oauth: true 31 fos_oauth: true
32 stateless: true 32 stateless: true
33 anonymous: true 33 anonymous: true
34 provider: fos_userbundle
34 35
35 login_firewall: 36 login_firewall:
37 logout_on_user_change: true
36 pattern: ^/login$ 38 pattern: ^/login$
37 anonymous: ~ 39 anonymous: ~
38 40
39 secured_area: 41 secured_area:
42 logout_on_user_change: true
40 pattern: ^/ 43 pattern: ^/
41 form_login: 44 form_login:
42 provider: fos_userbundle 45 provider: fos_userbundle
@@ -61,6 +64,7 @@ security:
61 - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } 64 - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
62 - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } 65 - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
63 - { path: /(unread|starred|archive|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } 66 - { path: /(unread|starred|archive|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
67 - { path: ^/locale, role: IS_AUTHENTICATED_ANONYMOUSLY }
64 - { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } 68 - { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
65 - { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY } 69 - { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY }
66 - { path: ^/settings, roles: ROLE_SUPER_ADMIN } 70 - { path: ^/settings, roles: ROLE_SUPER_ADMIN }
diff --git a/app/config/services.yml b/app/config/services.yml
index 7b85d846..25bbe5dc 100644
--- a/app/config/services.yml
+++ b/app/config/services.yml
@@ -2,12 +2,6 @@ parameters:
2 lexik_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber 2 lexik_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber
3 3
4services: 4services:
5 # used for tests
6 filesystem_cache:
7 class: Doctrine\Common\Cache\FilesystemCache
8 arguments:
9 - "%kernel.cache_dir%/doctrine/metadata"
10
11 twig.extension.text: 5 twig.extension.text:
12 class: Twig_Extensions_Extension_Text 6 class: Twig_Extensions_Extension_Text
13 tags: 7 tags:
diff --git a/app/config/services_test.yml b/app/config/services_test.yml
new file mode 100644
index 00000000..a300f75d
--- /dev/null
+++ b/app/config/services_test.yml
@@ -0,0 +1,38 @@
1services:
2 # see https://github.com/symfony/symfony/issues/24543
3 fos_user.user_manager.test:
4 alias: fos_user.user_manager
5 public: true
6
7 fos_user.security.login_manager.test:
8 alias: fos_user.security.login_manager
9 public: true
10
11 wallabag_core.entry_repository.test:
12 alias: wallabag_core.entry_repository
13 public: true
14
15 wallabag_user.user_repository.test:
16 alias: wallabag_user.user_repository
17 public: true
18
19 filesystem_cache:
20 class: Doctrine\Common\Cache\FilesystemCache
21 arguments:
22 - "%kernel.cache_dir%/doctrine/metadata"
23
24 # fixtures
25 Wallabag\AnnotationBundle\DataFixtures\ORM\:
26 resource: '../../src/Wallabag/AnnotationBundle/DataFixtures/ORM/*'
27 tags: ['doctrine.fixture.orm']
28 autowire: true
29
30 Wallabag\CoreBundle\DataFixtures\ORM\:
31 resource: '../../src/Wallabag/CoreBundle/DataFixtures/ORM/*'
32 tags: ['doctrine.fixture.orm']
33 autowire: true
34
35 Wallabag\UserBundle\DataFixtures\ORM\:
36 resource: '../../src/Wallabag/UserBundle/DataFixtures/ORM/*'
37 tags: ['doctrine.fixture.orm']
38 autowire: true