forked from elefan-grenoble/gestion-compte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Période : améliorer encore l'affichage lorsque cycle_type n'est pas d…
…éfini (elefan-grenoble#961) * Period: hide Semaine title * Allow PeriodPosition weekCycle field to be null * Common template for PeriodPosition edit collapsible
- Loading branch information
1 parent
c07c2dc
commit f78f6c4
Showing
7 changed files
with
153 additions
and
115 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
app/DoctrineMigrations/Version20230823170329_period_position_weekcycle_allow_null.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,35 @@ | ||
<?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 Version20230823170329 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 period_position CHANGE week_cycle week_cycle VARCHAR(1) DEFAULT NULL'); | ||
} | ||
|
||
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 period_position CHANGE week_cycle week_cycle VARCHAR(1) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`'); | ||
} | ||
} |
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
82 changes: 82 additions & 0 deletions
82
app/Resources/views/admin/periodposition/_partial/edit_collapsible.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,82 @@ | ||
|
||
<li id="position{{ position.id }}"> | ||
<div class="collapsible-header"> | ||
<div class="row" style="margin-bottom: 0; width: 100%;"> | ||
<div class="col s12"> | ||
{% if use_fly_and_fixed %} | ||
{% if position.shifter %} | ||
{% if position.formation %}<b data-formation="{{ position.formation.name }}">{% endif %} | ||
{{ position.shifter.displayNameWithMemberNumber }} | ||
{% if position.formation %}</b> ({{ position.formation.name }}){% endif %} | ||
{% if not position.formation and position.shifter.formations | length > 0 %} | ||
<b class="orange-text">({{ position.shifter.formations | join(', ') }})</b> | ||
{% endif %} | ||
{% if position.shifter.isNew %} | ||
<strong class="red-text" title="Nouveau membre">{{ beneficiary_new_icon }}</strong> | ||
{% endif %} | ||
{% else %} | ||
<strong style="font-style:italic">libre</strong> | ||
{% if position.formation %} | ||
({{ position.formation.name }}) | ||
{% else %} | ||
(sans formation particulière) | ||
{% endif %} | ||
{% endif %} | ||
{% else %} | ||
{{ position }} | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
<div class="collapsible-body"> | ||
{% if use_fly_and_fixed %} | ||
{% if position.shifter %} | ||
<p> | ||
Créneau fixe réservé | ||
pour <a href="{{ path("member_show", { 'member_number': position.shifter.membership.memberNumber }) }}" target="_blank">{{ position.shifter }}</a> | ||
le <i>{{ position.bookedTime | date_fr_full_with_time }}</i> | ||
par {% include "admin/member/_partial/member_or_user_link.html.twig" with { user: position.booker, target_blank: true } %}. | ||
</p> | ||
{{ form_start(position_free_form) }} | ||
{{ form_widget(position_free_form) }} | ||
<a href="#" class="btn waves-effect waves-light orange" onclick="var r = confirm('Etes-vous sûr de vouloir libérer ce poste ?!'); if (r == true) {$(this).closest('form').submit();}; event.stopPropagation();" title="Libérer ce poste"> | ||
<i class="material-icons left">lock_open</i>Libérer | ||
</a> | ||
{{ form_end(position_free_form) }} | ||
{% else %} | ||
{{ form_start(position_book_form) }} | ||
<div class="row"> | ||
<div class="col s7 input-field"> | ||
{{ form_label(position_book_form.shifter) }} | ||
{{ form_errors(position_book_form.shifter) }} | ||
{{ form_widget(position_book_form.shifter) }} | ||
</div> | ||
<div class="col s3"> | ||
<button type="submit" class="btn waves-effect waves-light"> | ||
<i class="material-icons left">add</i>Ajouter | ||
</button> | ||
</div> | ||
</div> | ||
{{ form_end(position_book_form) }} | ||
{% endif %} | ||
{% endif %} | ||
{% if not position.shifter %} | ||
{% if is_granted("ROLE_ADMIN") %} | ||
<div class="row"> | ||
{{ form_start(position_delete_form) }} | ||
{{ form_widget(position_delete_form) }} | ||
<a href="#" class="btn waves-effect waves-light red" onclick="var r = confirm('Etes-vous sûr de vouloir supprimer ce poste ?!'); if (r == true) {$(this).closest('form').submit();}; event.stopPropagation();" title="Supprimer ce poste"> | ||
<i class="material-icons left">delete</i>Supprimer | ||
</a> | ||
{{ form_end(position_delete_form) }} | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
{% if position.createdBy %} | ||
<p> | ||
Poste type créé le <i>{{ position.createdAt | date_fr_full_with_time }}</i> | ||
par {% include "admin/member/_partial/member_or_user_link.html.twig" with { user: position.createdBy, target_blank: true } %}. | ||
</p> | ||
{% endif %} | ||
</div> | ||
</li> |
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
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