From ba63d00f12d4170cdfdc4160bac610ccfaebd742 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 31 Jul 2023 23:38:19 +0200 Subject: [PATCH] style(invite): convert invitation form to dsfr --- app/assets/stylesheets/invites_form.scss | 32 ++---------------------- app/views/invites/_form.html.haml | 30 +++++++++++----------- 2 files changed, 17 insertions(+), 45 deletions(-) diff --git a/app/assets/stylesheets/invites_form.scss b/app/assets/stylesheets/invites_form.scss index cfd4ea2e1..b0fc6c938 100644 --- a/app/assets/stylesheets/invites_form.scss +++ b/app/assets/stylesheets/invites_form.scss @@ -1,34 +1,6 @@ -@import "constants"; #invites-form { - padding: $default-padding; - text-align: left; - - form { - display: flex; - margin-top: $default-padding; - } - - h4 { - font-weight: bold; - margin-bottom: $default-spacer; - } - - p { - margin-bottom: $default-spacer; - } - - ul { - list-style-position: inside; - list-style-type: disc; - margin-bottom: $default-padding; - } - - input[type=email] { - margin-bottom: $default-spacer; - } - - .button { - margin-left: $default-spacer; + @media (min-width: 48em) { + min-width: 400px; } } diff --git a/app/views/invites/_form.html.haml b/app/views/invites/_form.html.haml index 7d0ce75b9..8dded1989 100644 --- a/app/views/invites/_form.html.haml +++ b/app/views/invites/_form.html.haml @@ -1,13 +1,13 @@ -#invites-form +#invites-form.fr-p-2w - if invites.present? #invite-list{ morphing ? { tabindex: "-1" } : {} } - %h4= t('views.invites.form.invite_to_participate') + %h4.fr-h6= t('views.invites.form.invite_to_participate') %ul - invites.each do |invite| %li = invite.email %small{ 'data-turbo': 'true' } - = link_to t('views.invites.form.withdraw_permission'), invite_path(invite), data: { turbo_method: :delete, turbo_confirm: t('views.invites.form.want_to_withdraw_permission') } + = link_to t('views.invites.form.withdraw_permission'), invite_path(invite), data: { turbo_method: :delete, turbo_confirm: t('views.invites.form.want_to_withdraw_permission') }, class: "fr-btn fr-btn--sm fr-btn--tertiary-no-outline" %p= t('views.invites.form.edit_dossier') - if dossier.brouillon? @@ -17,15 +17,15 @@ %p= t('views.invites.form.invite_to_edit_line1') %p= t('views.invites.form.invite_to_edit_line2') - = form_tag dossier_invites_path(dossier), data: { turbo: true, turbo_force: :server }, method: :post, class: 'form' do - .row - .col - %span - = label_tag :invite_email, t('views.invites.form.email') - = email_field_tag :invite_email, '', class: 'small', placeholder: t('views.invites.form.email'), required: true - .col - %span - = label_tag :invite_message, t('views.invites.form.invite_message') - = text_area_tag :invite_message, '', class: 'small', placeholder: t('views.invites.form.invite_message') - .col - = submit_tag t('views.invites.form.send_invitation'), class: 'fr-btn fr-btn--secondary' + = form_tag dossier_invites_path(dossier), data: { turbo: true, turbo_force: :server }, method: :post do + .fr-input-group + = label_tag :invite_email, class: "fr-label" do + = t('views.invites.form.email') + %span.fr-hint-text= t('views.invites.form.email_hint') + = email_field_tag :invite_email, '', required: true, class: "fr-input" + + .fr-input-group + = label_tag :invite_message, t('views.invites.form.invite_message'), class: "fr-label" + = text_area_tag :invite_message, '', class: "fr-input" + + = submit_tag t('views.invites.form.send_invitation'), class: 'fr-btn fr-btn--secondary'