style(conditionnel): dsfr button styles

This commit is contained in:
Colin Darie 2022-10-12 17:44:24 +02:00
parent 8153f33896
commit e2e9ddd625
6 changed files with 11 additions and 23 deletions

View file

@ -74,13 +74,4 @@ form.form > .conditionnel {
border-color: $dark-red;
}
}
.add-row {
background: none;
border: none;
cursor: pointer;
font-size: 16px;
line-height: 25px;
margin: 0 $default-padding $default-padding;
}
}

View file

@ -184,9 +184,6 @@
}
}
.add-row {
margin-bottom: $default-fields-spacer;
}
input[type=checkbox] {
&.small-margin {

View file

@ -91,10 +91,6 @@
.conditionnel {
color: $white;
.add-row {
background-color: $white;
}
}
}
@ -151,6 +147,7 @@
border-bottom: none;
padding-bottom: 15px;
padding-top: 15px;
z-index: 10; // above DSFR buttons
}
.fill-duration {

View file

@ -21,11 +21,13 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent
end
def logic_conditionnel_button
html_class = 'fr-btn fr-btn--tertiary fr-btn--sm'
if @condition.nil?
submit_tag(
t('.enable_conditionnel'),
formaction: add_row_admin_procedure_condition_path(@procedure_id, @tdc.stable_id),
class: 'button small'
class: html_class
)
else
submit_tag(
@ -33,7 +35,7 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent
formmethod: 'delete',
formnovalidate: true,
data: { confirm: t('.disable_conditionnel_alert') },
class: 'button small'
class: html_class
)
end
end
@ -187,10 +189,10 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent
def add_condition_tag
tag.button(
tag.span('', class: 'icon add') + tag.span(t('.add_condition')),
t('.add_condition'),
formaction: add_row_admin_procedure_condition_path(@procedure_id, @tdc.stable_id),
formnovalidate: true,
class: 'add-row button small'
class: 'fr-btn fr-btn--secondary fr-btn--sm fr-icon-add-circle-line fr-btn--icon-left'
)
end

View file

@ -3,7 +3,7 @@ fr:
display_if: Afficher si
enable_conditionnel: cliquer pour activer
disable_conditionnel: cliquer pour désactiver
disable_conditionnel_alert: "La logique conditionnelle appliquée à ce champ sera désactivé.\nVoulez-vous continuer ?"
disable_conditionnel_alert: "La logique conditionnelle appliquée à ce champ sera désactivée.\nVoulez-vous continuer ?"
select: Sélectionner
add_condition: Ajouter une condition
remove_a_row: Supprimer la ligne

View file

@ -2,8 +2,9 @@
= form_tag admin_procedure_condition_path(@procedure_id, @tdc.stable_id), method: :patch, class: 'form width-100' do
.conditionnel.mt-2.width-100
.flex
%p.mr-2 Logique conditionnelle
= logic_conditionnel_button
%p
Logique conditionnelle
= logic_conditionnel_button
= render TypesDeChampEditor::ConditionsErrorsComponent.new(conditions: condition_per_row, upper_tdcs: @upper_tdcs)