Properly style the button when there is a motivation or attestation

This commit is contained in:
gregoirenovel 2017-11-24 19:26:24 +01:00
parent 5c92989fc8
commit 10f1859a2a
3 changed files with 25 additions and 3 deletions

View file

@ -55,6 +55,28 @@
} }
} }
&.without-continuation {
color: #FFFFFF;
border-color: $black;
background-color: $black;
&:hover {
color: $black;
background-color: #FFFFFF;
}
}
&.refused {
color: #FFFFFF;
border-color: $dark-red;
background-color: $dark-red;
&:hover {
color: $dark-red;
background-color: #FFFFFF;
}
}
&.large { &.large {
font-size: 18px; font-size: 18px;
line-height: 26px; line-height: 26px;

View file

@ -1,5 +1,5 @@
module DossierHelper module DossierHelper
def label_class(dossier) def button_or_label_class(dossier)
if dossier.closed? if dossier.closed?
'accepted' 'accepted'
elsif dossier.without_continuation? elsif dossier.without_continuation?

View file

@ -61,7 +61,7 @@
- else - else
- if dossier.motivation.present? || dossier.attestation.present? - if dossier.motivation.present? || dossier.attestation.present?
%span.button.dropdown{ class: dossier.closed? ? 'accepted' : nil } %span.button.dropdown{ class: button_or_label_class(dossier) }
= dossier.statut = dossier.statut
.dropdown-content.fade-in-down.terminated .dropdown-content.fade-in-down.terminated
- if dossier.motivation.present? - if dossier.motivation.present?
@ -73,5 +73,5 @@
%p.attestation L'acceptation du dossier a envoyé automatiquement une attestation au demandeur %p.attestation L'acceptation du dossier a envoyé automatiquement une attestation au demandeur
= link_to "Voir l'attestation", attestation_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button' = link_to "Voir l'attestation", attestation_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button'
- else - else
%span.label{ class: label_class(dossier) } %span.label{ class: button_or_label_class(dossier) }
= dossier.statut = dossier.statut