10 changed files with 74 additions and 15 deletions
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
<?php |
||||
|
||||
declare(strict_types=1); |
||||
|
||||
namespace DoctrineMigrations; |
||||
|
||||
use Doctrine\DBAL\Schema\Schema; |
||||
use Doctrine\Migrations\AbstractMigration; |
||||
|
||||
/** |
||||
* Auto-generated Migration: Please modify to your needs! |
||||
*/ |
||||
final class Version20241210175624 extends AbstractMigration |
||||
{ |
||||
public function getDescription(): string |
||||
{ |
||||
return ''; |
||||
} |
||||
|
||||
public function up(Schema $schema): void |
||||
{ |
||||
// this up() migration is auto-generated, please modify it to your needs |
||||
$this->addSql('CREATE TABLE journal (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, main_categories JSON NOT NULL, lists JSON DEFAULT NULL, editor VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); |
||||
$this->addSql('ALTER TABLE app_user ALTER name DROP NOT NULL'); |
||||
$this->addSql('ALTER TABLE app_user ALTER display_name DROP NOT NULL'); |
||||
} |
||||
|
||||
public function down(Schema $schema): void |
||||
{ |
||||
// this down() migration is auto-generated, please modify it to your needs |
||||
$this->addSql('DROP TABLE journal'); |
||||
$this->addSql('ALTER TABLE app_user ALTER name SET NOT NULL'); |
||||
$this->addSql('ALTER TABLE app_user ALTER display_name SET NOT NULL'); |
||||
} |
||||
} |
||||
@ -1,9 +1,25 @@
@@ -1,9 +1,25 @@
|
||||
<div {{ attributes.defaults(stimulus_controller('login')) }}> |
||||
{% if app.user %} |
||||
<p>Hello, {{ app.user.displayName }}</p> |
||||
|
||||
<twig:Atoms:Button tag="a" href="/logout" data-action="live#$render">Log out</twig:Atoms:Button> |
||||
{% if is_granted('ROLE_ADMIN') %} |
||||
<ul> |
||||
<li> |
||||
<a href="{{ path('admin_roles') }}">{{ 'heading.roles'|trans }}</a> |
||||
</li> |
||||
</ul> |
||||
{% endif %} |
||||
<ul> |
||||
<li> |
||||
<a href="#">Write an article</a> |
||||
</li> |
||||
<li> |
||||
<a href="#">Create a journal</a> |
||||
</li> |
||||
<li> |
||||
<a href="/logout" data-action="live#$render">{{ 'heading.logout'|trans }}</a> |
||||
</li> |
||||
</ul> |
||||
{% else %} |
||||
<twig:Atoms:Button {{ ...stimulus_action('login', 'loginAct') }}>Log in</twig:Atoms:Button> |
||||
<twig:Atoms:Button {{ ...stimulus_action('login', 'loginAct') }}>{{ 'heading.logIn'|trans }}</twig:Atoms:Button> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
Loading…
Reference in new issue