NewDesign: procedure show add dossier actions

This commit is contained in:
Simon Lehericey 2017-07-11 15:58:31 +02:00 committed by Mathieu Magnin
parent a064ae64a4
commit 0d3c145ef3
12 changed files with 79 additions and 1 deletions

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><g stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M20.54 4.23l-1.391-1.68A1.447 1.447 0 0 0 18 2H6c-.471 0-.88.21-1.16.55L3.46 4.23C3.17 4.57 3 5.02 3 5.5V18c0 1.1.899 2 2 2h14c1.1 0 2-.9 2-2V5.5c0-.48-.17-.93-.46-1.27z"/><path d="M12.088 7.333h3.438c0-2 2.562-2 2.562-2h2l.842-.38a1.933 1.933 0 0 0-.385-.723l-1.39-1.68a1.448 1.448 0 0 0-1.15-.55h-12c-.47 0-.88.21-1.16.55l-1.38 1.68a1.913 1.913 0 0 0-.395.763l.018.34h3s2.562 0 2.562 2h3.438M9 13.868l3 3 3-3M12 16v-5"/></g><path d="M0 0h24v24H0z"/></g></svg>

After

Width:  |  Height:  |  Size: 672 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2z"/><path d="M0 0h24v24H0z"/></g></svg>

After

Width:  |  Height:  |  Size: 337 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="18" viewBox="0 0 22 18"><g fill="none" fill-rule="evenodd"><path stroke="#35D49E" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 3h-8L9 1H3c-1.1 0-1.99.9-1.99 2L1 15c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/><path d="M14 10H6.533M11 7l4 3-4 3" stroke="#35D49E" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/><path d="M-1-3h24v24H-1z"/></g></svg>

After

Width:  |  Height:  |  Size: 456 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z"/><g stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M23 12c0 6.076-4.924 11-11 11-6.074 0-11-4.924-11-11S5.926 1 12 1c6.076 0 11 4.924 11 11zM12 8v10"/><path d="M16 11l-4-4-4 4"/></g></g></svg>

After

Width:  |  Height:  |  Size: 377 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" fill-rule="evenodd"><path stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2 16.112v1.862C2 19.088 2.907 20 4.017 20h16.132c1.11 0 2.018-.912 2.018-2.026V7.85a2.028 2.028 0 0 0-2.018-2.025h-8.066L10.066 3.8h-6.05A2.02 2.02 0 0 0 2.01 5.825L2 8.015M3 12h7.467"/><path stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 9l-4 3 4 3"/><path d="M0 0h24v24H0z"/></g></svg>

After

Width:  |  Height:  |  Size: 536 B

View file

@ -1,4 +1,5 @@
@import "colors";
@import "constants";
.button {
display: inline-block;
@ -44,6 +45,14 @@
&.expand {
width: 100%;
}
i {
width: 18px;
height: 18px;
background-size: 18px 18px;
vertical-align: middle;
margin-right: $default-spacer;
}
}
.link {

View file

@ -0,0 +1,19 @@
i {
display: inline-block;
&.follow {
background-image: image-url("icons/follow-folder.svg");
}
&.unfollow {
background-image: image-url("icons/unfollow-folder.svg");
}
&.archive {
background-image: image-url("icons/archive.svg");
}
&.unarchive {
background-image: image-url("icons/unarchive.svg");
}
}

View file

@ -161,6 +161,11 @@
background-color: $black;
}
}
.button {
width: 180px;
text-align: center;
}
}
h2 {

View file

@ -225,6 +225,14 @@ class Dossier < ActiveRecord::Base
EN_INSTRUCTION.include?(state)
end
def en_construction_ou_instruction?
EN_CONSTRUCTION_OU_INSTRUCTION.include?(state)
end
def termine?
TERMINE.include?(state)
end
def cerfa_available?
procedure.cerfa_flag? && cerfa.size != 0
end

View file

@ -0,0 +1,19 @@
- if dossier.en_construction_ou_instruction?
- if current_gestionnaire.follow?(dossier)
= link_to dossier_unfollow_path(procedure, dossier), method: :patch, class: 'button' do
%i.unfollow>
ne plus suivre
- else
= link_to dossier_follow_path(procedure, dossier), method: :patch, class: 'button' do
%i.follow>
suivre le dossier
- elsif dossier.termine?
- if dossier.archived
= link_to dossier_unarchive_path(procedure, dossier), method: :patch, class: 'button' do
%i.unarchive>
désarchiver le dossier
- else
= link_to dossier_archive_path(procedure, dossier), method: :patch, class: 'button' do
%i.archive>
archiver le dossier

View file

@ -47,6 +47,6 @@
%td.status-col
= link_to(backoffice_dossier_path(dossier), class: 'big-link') do
= render partial: 'status', locals: { dossier: dossier }
%td.follow-col
%td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier }
- else
%h2 Aucun dossier

View file

@ -26,6 +26,19 @@
= link_to ".button.large.primary", "#", class: "button large primary"
%p
= link_to "#", class: "button" do
%i.follow
= "%i.follow"
= link_to "#", class: "button" do
%i.unfollow
= "%i.unfollow"
= link_to "#", class: "button" do
%i.archive
= "%i.archive"
= link_to "#", class: "button" do
%i.unarchive
= "%i.unarchive"
%p
= link_to ".button.primary.expand", "#", class: "button primary expand"