-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Horaires d'ouverture : pouvoir définir le type d'horaire (#964)
* Create OpeningHourKind entity * AdminOpeningHourKindController list, new, edit & delete * Rename PeriodPosition controller views * New OpeningHour.kind field. Update templates * Update widget generator
- Loading branch information
Showing
38 changed files
with
977 additions
and
184 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
app/DoctrineMigrations/Version20230825104026_opening_hour_kind_entity.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Application\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
final class Version20230825104026 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('CREATE TABLE opening_hour_kind (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, start_date DATE DEFAULT NULL, end_date DATE DEFAULT NULL, enabled TINYINT(1) DEFAULT \'0\' NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_5AEDCF52B03A8386 (created_by_id), INDEX IDX_5AEDCF52896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'); | ||
$this->addSql('ALTER TABLE opening_hour_kind ADD CONSTRAINT FK_5AEDCF52B03A8386 FOREIGN KEY (created_by_id) REFERENCES fos_user (id)'); | ||
$this->addSql('ALTER TABLE opening_hour_kind ADD CONSTRAINT FK_5AEDCF52896DBBDE FOREIGN KEY (updated_by_id) REFERENCES fos_user (id)'); | ||
} | ||
|
||
public function down(Schema $schema) : void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('DROP TABLE opening_hour_kind'); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
app/DoctrineMigrations/Version20230825120912_opening_hour_kind.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Application\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
final class Version20230825120912 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('ALTER TABLE opening_hour ADD opening_hour_kind_id INT DEFAULT NULL'); | ||
$this->addSql('ALTER TABLE opening_hour ADD CONSTRAINT FK_969BD7659BA06AF0 FOREIGN KEY (opening_hour_kind_id) REFERENCES opening_hour_kind (id) ON DELETE SET NULL'); | ||
$this->addSql('CREATE INDEX IDX_969BD7659BA06AF0 ON opening_hour (opening_hour_kind_id)'); | ||
} | ||
|
||
public function down(Schema $schema) : void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('ALTER TABLE opening_hour DROP FOREIGN KEY FK_969BD7659BA06AF0'); | ||
$this->addSql('DROP INDEX IDX_969BD7659BA06AF0 ON opening_hour'); | ||
$this->addSql('ALTER TABLE opening_hour DROP opening_hour_kind_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{% set edit = edit ?? false %} | ||
|
||
<div class="errors"> | ||
{{ form_errors(form) }} | ||
</div> | ||
<div class="row"> | ||
<div class="col m6"> | ||
{{ form_row(form.title) }} | ||
</div> | ||
<div class="col m6"> | ||
{{ form_row(form.kind) }} | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col m6"> | ||
{{ form_row(form.date) }} | ||
</div> | ||
<div class="col m6"> | ||
{{ form_row(form.end) }} | ||
</div> | ||
</div> | ||
<div class="row"> | ||
{{ form_row(form.location) }} | ||
</div> | ||
<div class="row"> | ||
{{ form_row(form.description) }} | ||
</div> | ||
<div class="row"> | ||
{{ form_row(form.imgFile) }} | ||
</div> | ||
|
||
{% if edit %} | ||
<h5>Nécessite un vote ?</h5> | ||
<div class="row"> | ||
<div class="col m6"> | ||
{{ form_errors(form.need_proxy) }} | ||
<label> | ||
{{ form_widget(form.need_proxy) }} | ||
<span>{{ form.need_proxy.vars.label }}</span> | ||
</label> | ||
</div> | ||
<div class="col m6"> | ||
{{ form_errors(form.anonymous_proxy) }} | ||
<label> | ||
{{ form_widget(form.anonymous_proxy) }} | ||
<span>{{ form.anonymous_proxy.vars.label }}</span> | ||
</label> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col m6"> | ||
{{ form_row(form.max_date_of_last_registration) }} | ||
</div> | ||
</div> | ||
{% include "admin/member/_partial/created_updated_card.html.twig" with { item: event } %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="errors"> | ||
{{ form_errors(form) }} | ||
</div> | ||
<div class="row"> | ||
{{ form_row(form.name) }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
{% extends 'layout.html.twig' %} | ||
|
||
{% block title %}Ajouter un événement - {{ site_name }}{% endblock %} | ||
{% block title %}Ajouter un type d'événement - {{ site_name }}{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<a href="{{ path('homepage') }}"><i class="material-icons">home</i></a><i class="material-icons">chevron_right</i> | ||
<a href="{{ path('admin') }}"><i class="material-icons">build</i> Administration</a><i class="material-icons">chevron_right</i> | ||
<a href="{{ path('admin_event_index') }}"><i class="material-icons">list</i> Liste des types d'événements</a><i class="material-icons">chevron_right</i> | ||
<a href="{{ path('admin_event_kind_list') }}"><i class="material-icons">list</i> Liste des types d'événements</a><i class="material-icons">chevron_right</i> | ||
<i class="material-icons">add</i> Ajouter | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<h4>Nouveau type d'événement</h4> | ||
<h4>Nouveau type d'événement</h4> | ||
|
||
{{ form_start(form) }} | ||
{{ form_widget(form) }} | ||
<br /> | ||
<div> | ||
<button type="submit" class="btn waves-effect waves-light">Créer</button> | ||
</div> | ||
{{ form_end(form) }} | ||
{{ form_start(form) }} | ||
{% include "/admin/event/kind/_partial/form.html.twig" with { form: form } %} | ||
<button type="submit" class="btn waves-effect waves-light" title="Créer"> | ||
<i class="material-icons left">save</i>Créer | ||
</button> | ||
{{ form_end(form) }} | ||
|
||
<a href="{{ path('admin_event_kind_list') }}" class="btn waves-effect waves-light red" title="Annuler">Annuler</a> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
app/Resources/views/admin/member/_partial/created_updated_card.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% if item.createdBy or item.updatedBy %} | ||
<div class="card-panel"> | ||
{% if item.createdBy %} | ||
<i>Création le {{ item.createdAt | date_fr_full_with_time }} par {% include "admin/member/_partial/member_or_user_link.html.twig" with { user: item.createdBy, target_blank: true } %}</i> | ||
<br /> | ||
{% endif %} | ||
{% if item.updatedBy %} | ||
<i>Dernière modification le {{ item.updatedAt | date_fr_full_with_time }} par {% include "admin/member/_partial/member_or_user_link.html.twig" with { user: item.updatedBy, target_blank: true } %}</i> | ||
{% endif %} | ||
</div> | ||
{% endif %} |
Oops, something went wrong.