diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 798ae77b4..97678af50 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -41,7 +41,6 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Serializer\SerializerInterface; use Symfony\Contracts\Translation\TranslatorInterface; use function array_key_exists; @@ -213,7 +212,7 @@ final class ActivityController extends AbstractController $form = $this->createForm(ActivityType::class, $entity, [ 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, - 'role' => new Role('CHILL_ACTIVITY_UPDATE'), + 'role' => 'CHILL_ACTIVITY_UPDATE', 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, ]); @@ -442,7 +441,7 @@ final class ActivityController extends AbstractController $form = $this->createForm(ActivityType::class, $entity, [ 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, - 'role' => new Role('CHILL_ACTIVITY_CREATE'), + 'role' => 'CHILL_ACTIVITY_CREATE', 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, ]); diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index be12daca0..042fccc69 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -106,6 +106,9 @@ CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des échanges CHILL_ACTIVITY_DELETE: Supprimer un échange CHILL_ACTIVITY_STATS: Statistique des échanges CHILL_ACTIVITY_LIST: Liste des échanges +CHILL_ACTIVITY_CREATE_PERSON: Créer un échange lié à un usager +CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE: Créer un échange lié à un parcours +CHILL_ACTIVITY_FULL: Voir les détails, créer, supprimer et mettre à jour un échange # admin Activities: Échanges diff --git a/src/Bundle/ChillDocGeneratorBundle/Resources/views/DocGeneratorTemplate/index.html.twig b/src/Bundle/ChillDocGeneratorBundle/Resources/views/DocGeneratorTemplate/index.html.twig index 73527edb3..1adb6872b 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Resources/views/DocGeneratorTemplate/index.html.twig +++ b/src/Bundle/ChillDocGeneratorBundle/Resources/views/DocGeneratorTemplate/index.html.twig @@ -27,9 +27,7 @@ - - {{ 'Edit'|trans }} - + {% endfor %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig index 5731f57f5..ff20257a5 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig @@ -5,14 +5,14 @@ {% block admin_content %}

{{ 'Document category list' | trans }}

- +
- + @@ -23,7 +23,7 @@ - +
{{ 'Creator bundle id' | trans }} {{ 'Internal id inside creator bundle' | trans }} {{ 'Document class' | trans }} {{ 'Name' | trans }}{{ 'Actions' | trans }}{{ 'Actions' | trans }}
{{ document_category.documentClass }} {{ document_category.name | localize_translatable_string}} + add('scope', EntityType::class, [ 'class' => Scope::class, + 'placeholder' => 'Choose amongst scopes', 'choice_label' => static function (Scope $scope) use ($translatableStringHelper) { return $translatableStringHelper->localize($scope->getName()); }, diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index 3c9fc8601..2523ee202 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -375,6 +375,12 @@ span.dt { font-weight: bolder; background-color: var(--bs-chill-light-gray); } +/// help text +.help-text { + margin-top: 0.25rem; + font-size: 0.875em; + color: var(--bs-gray); +} /* diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss index b8f60e250..5158a826e 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss @@ -1,3 +1,11 @@ +/// mixin to set sticky area on bottom when scrolling +@mixin sticky-bottom { + position: sticky; + bottom: 0; + margin-top: 4em; + z-index: 1000; +} + ul.record_actions { display: flex; flex-direction: row; @@ -53,16 +61,30 @@ ul.record_actions { } } } + +.sticky-form { + background-color: $white; + padding-top: 1.25em; + margin: -1em; + box-shadow: 0 -20px 20px -20px rgba($chill-gray, .5); + @include sticky-bottom; + + .sticky-form-buttons { + position: initial; + bottom: unset; + margin-top: unset; + z-index: unset; + } +} + .sticky-form-buttons { - margin-top: 4em; - background-color: $beige; - position: sticky; - bottom: 0.3em; - text-align: center; - display: flex; - padding: 0.8em 1.6em; - border-radius: 0; - z-index: 1000; + display: flex; + background-color: $beige; + text-align: center; + padding: 0.8em 1.6em; + border-radius: 0; + @include sticky-bottom; + bottom: 0.3em; } /// EXCEPTIONS diff --git a/src/Bundle/ChillMainBundle/Resources/views/CRUD/_edit_content.html.twig b/src/Bundle/ChillMainBundle/Resources/views/CRUD/_edit_content.html.twig index e23949162..0bfa5d54b 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/CRUD/_edit_content.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/CRUD/_edit_content.html.twig @@ -1,7 +1,7 @@ {% set formId = crudMainFormId|default('crud_main_form') %} {% block crud_content_header %} -

{{ ('crud.'~crud_name~'.title_edit')|trans }}

+

{{ ('crud.'~crud_name~'.title_edit')|trans }}

{% endblock crud_content_header %} {% block crud_content_form %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/CRUD/_index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/CRUD/_index.html.twig index eaacc1f73..81e29a52e 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/CRUD/_index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/CRUD/_index.html.twig @@ -14,7 +14,7 @@ {% endblock %} {% else %} {% block table_entities %} - +
{% block table_entities_thead_tr %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 0f854f7ed..df63cc848 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -3,93 +3,130 @@ {% block title %}{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}{% endblock %} {% block admin_content -%} -

{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}

+
+
-

{{ 'Details'|trans }}

+

{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}

- {{ form_start(edit_form) }} - {{ form_row(edit_form.name) }} - {% if edit_form.flags is defined %} - {{ form_row(edit_form.flags) }} - {% endif %} - {{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-chill-green' } } ) }} - {{ form_end(edit_form) }} +

{{ 'Details'|trans }}

-

{{ 'Grant those permissions'|trans }} :

+ {{ form_start(edit_form) }} + {{ form_row(edit_form.name) }} + {% if edit_form.flags is defined %} + {{ form_row(edit_form.flags) }} + {% endif %} + {{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-save float-end' } } ) }} + {{ form_end(edit_form) }} - {%- if entity.getRoleScopes|length > 0 -%} - {% for title, role_scopes in role_scopes_sorted %} +

{{ 'Grant those permissions'|trans }} :

-

{{ title|default("Unclassified")|trans }}

+ {%- if entity.getRoleScopes|length > 0 -%} + {% for title, role_scopes in role_scopes_sorted %} -
- +

{{ title|default("Unclassified")|trans }}

+ +
+ + + + + + + + + + {% for role_scope in role_scopes %} - - - - - - - - {% for role_scope in role_scopes %} - - + - - - + + + - {% endfor %} - -
{{ 'Circle'|trans }}{{ 'Role'|trans }}{{ 'Actions'|trans }}
{{ 'Role'|trans }}{{ 'Circle'|trans }}{{ 'Actions'|trans }}
- {{ role_scope.role|trans }} - {% if expanded_roles[role_scope.role]|length > 1 %} -
- {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} +
+ {%- if role_scope.scope is not null -%} + + {{ role_scope.scope.name|localize_translatable_string }} + + {%- else -%} + N/A + {%- endif -%} + + {{ role_scope.role|trans }} + {% if expanded_roles[role_scope.role]|length > 1 %} +
+ {{ 'Which implies'|trans }} : + {% for role in expanded_roles[role_scope.role] %} + {% if role != role_scope.role %} + {{ role|trans }} + {% if not loop.last %}, {% endif %} + {% endif %} + {% endfor %} +
{% endif %} -
- {%- if role_scope.scope is not null -%} - - {{ role_scope.scope.name|localize_translatable_string }} - - {%- else -%} - N/A - {%- endif -%} - - {{ form_start(delete_role_scopes_form[role_scope.id]) }} - {{ form_widget(delete_role_scopes_form[role_scope.id].submit, { 'attr': { 'class': 'btn btn-chill-red' } } ) }} - {{ form_end(delete_role_scopes_form[role_scope.id]) }} -
+ {{ form_start(delete_role_scopes_form[role_scope.id]) }} + {{ form_widget(delete_role_scopes_form[role_scope.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} + {{ form_end(delete_role_scopes_form[role_scope.id]) }} +
- {% endfor %} + {% endfor %} +
+ {% endfor %} - {%- else -%} -

{{ 'This group does not provide any permission'|trans }}

- {%- endif -%} + {%- else -%} +

{{ 'This group does not provide any permission'|trans }}

+ {%- endif -%} + + +
-

{{ 'Grant new permissions'|trans }}

{{ form_start(add_role_scopes_form) }} {{ form_errors(add_role_scopes_form) }} - {{ form_row(add_role_scopes_form.composed_role_scope.role) }} - {{ form_row(add_role_scopes_form.composed_role_scope.scope) }} + +
+ {{ form_widget(add_role_scopes_form.composed_role_scope.role, { 'attr': { 'class': 'w-50' }}) }} + {{ form_widget(add_role_scopes_form.composed_role_scope.scope) }} +
+
{{ 'Help to pick role and scope'|trans }}
{{ form_end(add_role_scopes_form) }}
- +
+{% endblock %} + +{% block js %} + {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig index 1b35e9799..6741898e3 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig @@ -5,7 +5,7 @@ {% block admin_content -%}

{{ 'Permissions group list'|trans }}

- +
diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig index 921db8e6d..f8a1f7c31 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig @@ -10,8 +10,6 @@ {% if form.flags is defined %} {{ form_row(form.flags) }} {% endif %} - {{ form_row(form.submit, { 'attr': { 'class': 'btn btn-chill-green' } } ) }} - {{ form_end(form) }} + + {{ form_end(form) }} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig index eb93c4968..b183bc19e 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig @@ -3,44 +3,52 @@ {% block title %}{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}{% endblock %} {% block admin_content -%} -

{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}

+

{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}

-
{{ 'Name'|trans }}
+
- +
{{ 'Name'|trans }}{{ entity.name }}{{ entity.name }}
+ {% if role_scopes_sorted|length > 0 %} -

{{ 'Grant those permissions'|trans }} :

+

{{ 'Grant those permissions'|trans }} :

{% for title, role_scopes in role_scopes_sorted %}

{{ title|default('Unclassified')|trans }}

- +
+ - {% for role_scope in role_scopes %} - - + {% endfor %} @@ -57,17 +65,15 @@ {% endif %} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig index 0ecbdef9f..4ac863ee6 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig @@ -4,10 +4,10 @@ {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% block crud_content_after_form %} {% if access_permissions_group_list %} -

{{ 'Permissions granted'|trans }}

+

{{ 'Permissions granted'|trans }}

{% if entity.groupcenters|length > 0 %} -
{{ 'Circle'|trans }} {{ 'Role'|trans }}{{ 'Circle'|trans }}
- {{ role_scope.role|trans }} - {% if expanded_roles[role_scope.role]|length > 1 %} -
- {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} - {% endif %} -
{%- if role_scope.scope is not null -%} - {{ role_scope.scope.name|localize_translatable_string }} + {%- if role_scope.scope is not null -%} + {{ role_scope.scope.name|localize_translatable_string }} {%- else -%} - N/A - {%- endif -%} + N/A + {%- endif -%} + + {{ role_scope.role|trans }} + {% if expanded_roles[role_scope.role]|length > 1 %} +
+ {{ 'Which implies'|trans }} : + {% for role in expanded_roles[role_scope.role] %} + {% if role != role_scope.role %} + {{ role|trans }} + {% if not loop.last %}, {% endif %} + {% endif %} + {% endfor %} +
+ {% endif %}
+
@@ -19,18 +19,18 @@ {% for groupcenter in entity.groupcenters %} - @@ -47,7 +47,7 @@ {{ form_start(add_groupcenter_form) }} {{ form_row(add_groupcenter_form.composed_groupcenter.center) }} {{ form_row(add_groupcenter_form.composed_groupcenter.permissionsgroup) }} - {{ form_row(add_groupcenter_form.submit, { 'attr' : { 'class': 'btn btn-chill-green' } } ) }} + {{ form_row(add_groupcenter_form.submit, { 'attr' : { 'class': 'btn btn-create' } } ) }} {{ form_end(add_groupcenter_form) }} {% endif %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig index b57e17c06..e4e7d70d8 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig @@ -69,19 +69,20 @@ {% endblock %} - + {% block table_entities_tbody %} {% for entity in entities %} @@ -25,19 +25,19 @@ {% endfor %} {% endblock %} - + {% block actions_before %}
  • {{'Back to the admin'|trans}}
  • {% endblock %} - + {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 369abf628..b8349ce2e 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -167,12 +167,16 @@ Permissionsgroup: Groupe de permissions New permission group: Nouveau groupe de permissions PermissionsGroup "%name%" edit: Modification du groupe de permission '%name%' Role: Rôle -Choose amongst roles: Choisir parmi les rôles +Choose amongst roles: Choisir un rôle +Choose amongst scopes: Choisir un cercle Add permission: Ajouter les permissions This group does not provide any permission: Ce groupe n'attribue aucune permission The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce groupe de permission The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission Unclassified: Non classifié +Help to pick role and scope: Certains rôles ne nécessitent pas de cercle. +The role need scope: Ce rôle nécessite un cercle. +The role does not need scope: Ce rôle ne nécessite pas de cercle ! #admin section for users User configuration: Gestion des utilisateurs @@ -423,6 +427,7 @@ No entities: Aucun élément CHILL_FOO_SEE: Voir un élément CHILL_FOO_EDIT: Modifier un élément +chill_export: Exports (statistiques) #Show templates Date: Date
    {{ 'Permission group'|trans }}
    - - {{ groupcenter.permissionsgroup.name }} - + + {{ groupcenter.permissionsgroup.name }} + - - {{ groupcenter.center.name }} - + + {{ groupcenter.center.name }} + + {{ form_start(delete_groupcenter_form[groupcenter.id]) }} - {{ form_row(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-chill-red' } } ) }} + {{ form_widget(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} {{ form_rest(delete_groupcenter_form[groupcenter.id]) }} {{ form_end(delete_groupcenter_form[groupcenter.id]) }}
      + + {% if is_granted('ROLE_ALLOWED_TO_SWITCH') %} +
    • + +
    • + {% endif %} +
    • {% if allow_change_password is same as(true) %}
    • - -
    • - {% endif %} - - {% if is_granted('ROLE_ALLOWED_TO_SWITCH') %} -
    • - +
    • {% endif %}
    diff --git a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig index e8ea9ec38..3902b33cf 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig @@ -2,14 +2,14 @@ {% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} - + {% block table_entities_thead_tr %}
    id {{ 'Label'|trans }} {{ 'Active'|trans }} {{ 'Actions'|trans }}
    • - +