From bf6c0346d8d35a719dd1bff1cb4d573d422f99ff Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 31 May 2017 09:31:18 +0200 Subject: WIP Signed-off-by: Thomas Citharel --- app/AppKernel.php | 3 +- app/DoctrineMigrations/Version20170328185535.php | 99 ++++++++++++++++++++++ .../static/themes/material/css/index.scss | 1 + .../static/themes/material/css/layout.scss | 6 ++ .../static/themes/material/css/profile.scss | 54 ++++++++++++ app/config/config.yml | 3 +- app/config/parameters.yml.dist | 3 + app/config/routing.yml | 5 ++ app/config/security.yml | 1 + 9 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 app/DoctrineMigrations/Version20170328185535.php create mode 100644 app/Resources/static/themes/material/css/profile.scss (limited to 'app') diff --git a/app/AppKernel.php b/app/AppKernel.php index c50783a6..c5109866 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -32,6 +32,7 @@ class AppKernel extends Kernel new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), new FOS\JsRoutingBundle\FOSJsRoutingBundle(), new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(), + new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(), // wallabag bundles new Wallabag\CoreBundle\WallabagCoreBundle(), @@ -39,7 +40,7 @@ class AppKernel extends Kernel new Wallabag\UserBundle\WallabagUserBundle(), new Wallabag\ImportBundle\WallabagImportBundle(), new Wallabag\AnnotationBundle\WallabagAnnotationBundle(), - new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(), + new Wallabag\FederationBundle\WallabagFederationBundle(), ]; if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { diff --git a/app/DoctrineMigrations/Version20170328185535.php b/app/DoctrineMigrations/Version20170328185535.php new file mode 100644 index 00000000..f0afb7b9 --- /dev/null +++ b/app/DoctrineMigrations/Version20170328185535.php @@ -0,0 +1,99 @@ +container = $container; + } + + private function getTable($tableName) + { + return $this->container->getParameter('database_table_prefix').$tableName; + } + + /** + * @param Schema $schema + */ + public function up(Schema $schema) + { + try { + $schema->getTable($this->getTable('change')); + } catch (SchemaException $e) { + // The Change table doesn't exist, we need to create it + if (10 == $e->getCode()) { + if ($this->connection->getDatabasePlatform()->getName() == 'sqlite') { + $this->addSql('CREATE TABLE '.$this->getTable('change').' (id INTEGER NOT NULL, entry_id INTEGER DEFAULT NULL, type INTEGER NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_133B9D0FBA364942 FOREIGN KEY (entry_id) REFERENCES '.$this->getTable('entry').' (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); + + return true; + } + + $changeTable = $schema->createTable($this->getTable('change')); + $changeTable->addColumn( + 'id', + 'integer', + ['autoincrement' => true] + ); + $changeTable->addColumn( + 'type', + 'integer', + ['notnull' => false] + ); + $changeTable->addColumn( + 'created_at', + 'datetime', + ['notnull' => false] + ); + $changeTable->addColumn( + 'entry_id', + 'integer', + ['notnull' => false] + ); + + $changeTable->setPrimaryKey(['id']); + + $changeTable->addForeignKeyConstraint( + $this->getTable('entry'), + ['entry_id'], + ['id'], + ['onDelete' => 'CASCADE'], + 'IDX_change_entry' + ); + + return true; + } + } + + throw new SkipMigrationException('It seems that you already played this migration.'); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema) + { + try { + $changeTable = $schema->getTable($this->getTable('change')); + $schema->dropTable($changeTable->getName()); + } catch (SchemaException $e) { + throw new SkipMigrationException('It seems that you already played this migration.'); + } + } +} diff --git a/app/Resources/static/themes/material/css/index.scss b/app/Resources/static/themes/material/css/index.scss index 8300e430..a360b99b 100644 --- a/app/Resources/static/themes/material/css/index.scss +++ b/app/Resources/static/themes/material/css/index.scss @@ -9,6 +9,7 @@ @import 'nav'; @import 'sidenav'; @import 'notifications'; +@import 'profile'; @import 'various'; /* Tools */ diff --git a/app/Resources/static/themes/material/css/layout.scss b/app/Resources/static/themes/material/css/layout.scss index cfdbf2b3..6fd14335 100755 --- a/app/Resources/static/themes/material/css/layout.scss +++ b/app/Resources/static/themes/material/css/layout.scss @@ -18,6 +18,12 @@ body { border-bottom: 1px solid #ddd; } +nav, +body:not(.reset-left) main, +footer { + padding-left: 240px; +} + main, #content, .valign-wrapper { diff --git a/app/Resources/static/themes/material/css/profile.scss b/app/Resources/static/themes/material/css/profile.scss new file mode 100644 index 00000000..d5b9a5ff --- /dev/null +++ b/app/Resources/static/themes/material/css/profile.scss @@ -0,0 +1,54 @@ +.profile { + .details { + display: flex; + flex-direction: row; + + .bio { + flex: 1; + font-size: 14px; + line-height: 18px; + padding: 5px 10px; + order: 1; + + p { + font-size: 14px; + font-weight: 400; + overflow: hidden; + word-break: normal; + word-wrap: break-word; + } + } + + .details-counters { + order: 0; + display: flex; + flex-direction: row; + } + + .counter { + width: 80px; + color: #9baec8; + padding: 5px 10px 0; + margin-bottom: 10px; + border-right: 1px solid #9baec8; + cursor: default; + position: relative; + + .counter-label { + font-size: 12px; + text-transform: uppercase; + display: block; + margin-bottom: 5px; + } + + .counter-number { + font-weight: 500; + font-size: 18px; + color: #00bcd4; + } + } + } + img.avatar { + width: 10em; + } +} diff --git a/app/config/config.yml b/app/config/config.yml index 2bc5e3b3..4a935dfb 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -6,8 +6,9 @@ imports: parameters: # Allows to use the live reload feature for changes in assets - use_webpack_dev_server: false + use_webpack_dev_server: true craue_config.cache_adapter.class: Craue\ConfigBundle\CacheAdapter\SymfonyCacheComponentAdapter + media_directory: '%kernel.root_dir%/../web/uploads/media' framework: #esi: ~ diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index b3fe11c8..d342c72a 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -25,6 +25,9 @@ parameters: domain_name: https://your-wallabag-url-instance.com + # Instance URL + domain_name: wallabag.tld + mailer_transport: smtp mailer_host: 127.0.0.1 mailer_user: ~ diff --git a/app/config/routing.yml b/app/config/routing.yml index 0bd2d130..f1bbbda9 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -17,6 +17,11 @@ wallabag_api: type: annotation prefix: / +wallabag_federation: + resource: "@WallabagFederationBundle/Controller/" + type: annotation + prefix: / + app: resource: "@WallabagCoreBundle/Controller/" type: annotation diff --git a/app/config/security.yml b/app/config/security.yml index e14a0bd1..a8a0a6ae 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -66,4 +66,5 @@ security: - { path: ^/settings, roles: ROLE_SUPER_ADMIN } - { path: ^/annotations, roles: ROLE_USER } - { path: ^/users, roles: ROLE_SUPER_ADMIN } + - { path: ^/profile, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/, roles: ROLE_USER } -- cgit v1.2.3