NewDesign: procedure show add dossier status

This commit is contained in:
Simon Lehericey 2017-07-11 15:43:20 +02:00 committed by Mathieu Magnin
parent ad1a11ab52
commit 013f2463d1
5 changed files with 52 additions and 0 deletions

View file

@ -7,3 +7,5 @@ $border-grey: #CCCCCC;
$dark-red: #A94442;
$light-red: #EBCCD1;
$lighter-red: #F2DEDE;
$green: #35D49E;
$orange: #F59415;

View file

@ -133,6 +133,36 @@
width: 200px;
}
.label {
width: 110px;
text-align: center;
&.instruction {
background-color: #FFFFFF;
color: $blue;
border: 1px solid $blue;
}
&.construction {
background-color: #FFFFFF;
color: $black;
border: 1px solid $black;
}
&.closed {
background-color: $green;
}
&.refused {
background-color: $dark-red;
}
&.without-continuation {
background-color: $black;
}
}
}
h2 {
font-size: 20px;
font-weight: bold;

View file

@ -217,6 +217,14 @@ class Dossier < ActiveRecord::Base
BROUILLON.include?(state)
end
def en_construction?
EN_CONSTRUCTION.include?(state)
end
def en_instruction?
EN_INSTRUCTION.include?(state)
end
def cerfa_available?
procedure.cerfa_flag? && cerfa.size != 0
end

View file

@ -0,0 +1,10 @@
- if dossier.en_instruction?
%span.label.instruction en instruction
- elsif dossier.en_construction?
%span.label.construction nouveau
- elsif dossier.closed?
%span.label.closed accepté
- elsif dossier.refused?
%span.label.refused refusé
- elsif dossier.without_continuation?
%span.label.without-continuation sans suite

View file

@ -45,6 +45,8 @@
%td.number-col= link_to(dossier.id, backoffice_dossier_path(dossier), class: 'big-link')
%td= link_to(dossier.user.email, backoffice_dossier_path(dossier), class: 'big-link')
%td.status-col
= link_to(backoffice_dossier_path(dossier), class: 'big-link') do
= render partial: 'status', locals: { dossier: dossier }
%td.follow-col
- else
%h2 Aucun dossier