Merge branch 'dev'

This commit is contained in:
Mathieu Magnin 2017-09-28 16:54:15 +02:00
commit 6f2685f25f
247 changed files with 4756 additions and 753 deletions

10
Gemfile
View file

@ -37,6 +37,7 @@ gem 'bootstrap-sass', '~> 3.3.5'
# Pagination # Pagination
gem 'will_paginate-bootstrap' gem 'will_paginate-bootstrap'
gem 'kaminari'
# Decorators # Decorators
gem 'draper', '~> 3.0.0.pre1' gem 'draper', '~> 3.0.0.pre1'
@ -95,10 +96,11 @@ gem 'newrelic_rpm'
gem 'scenic' gem 'scenic'
# Sidekiq # Cron jobs
gem 'sidekiq' gem 'delayed_job_active_record'
gem 'sidekiq-cron', '~> 0.4.4' gem "daemons"
gem 'sinatra', git: 'https://github.com/sinatra/sinatra.git', require: false gem 'delayed_cron_job'
gem "delayed_job_web"
gem 'select2-rails' gem 'select2-rails'

View file

@ -7,18 +7,6 @@ GIT
open4 (~> 1.3.4) open4 (~> 1.3.4)
rake rake
GIT
remote: https://github.com/sinatra/sinatra.git
revision: d0c4053fd459be9f2c207cfeec5c0606461c014b
specs:
rack-protection (2.0.0.rc1)
rack
sinatra (2.0.0.rc1)
mustermann (= 1.0.0)
rack (~> 2.0)
rack-protection (= 2.0.0.rc1)
tilt (~> 2.0)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@ -121,15 +109,26 @@ GEM
execjs execjs
coffee-script-source (1.12.2) coffee-script-source (1.12.2)
concurrent-ruby (1.0.5) concurrent-ruby (1.0.5)
connection_pool (2.2.1)
copy_carrierwave_file (1.3.0) copy_carrierwave_file (1.3.0)
carrierwave (>= 0.9) carrierwave (>= 0.9)
crack (0.4.3) crack (0.4.3)
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
daemons (1.2.4)
database_cleaner (1.5.3) database_cleaner (1.5.3)
debug_inspector (0.0.2) debug_inspector (0.0.2)
deep_cloneable (2.2.2) deep_cloneable (2.2.2)
activerecord (>= 3.1.0, < 5.2.0) activerecord (>= 3.1.0, < 5.2.0)
delayed_cron_job (0.7.2)
delayed_job (>= 4.1)
delayed_job (4.1.3)
activesupport (>= 3.0, < 5.2)
delayed_job_active_record (4.1.2)
activerecord (>= 3.0, < 5.2)
delayed_job (>= 3.0, < 5)
delayed_job_web (1.4)
activerecord (> 3.0.0)
delayed_job (> 2.0.3)
sinatra (>= 1.4.4)
devise (4.2.0) devise (4.2.0)
bcrypt (~> 3.0) bcrypt (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
@ -396,7 +395,7 @@ GEM
minitest (5.10.1) minitest (5.10.1)
multi_json (1.12.1) multi_json (1.12.1)
multipart-post (2.0.0) multipart-post (2.0.0)
mustermann (1.0.0) mustermann (1.0.1)
nenv (0.3.0) nenv (0.3.0)
netrc (0.11.0) netrc (0.11.0)
newrelic_rpm (3.18.1.330) newrelic_rpm (3.18.1.330)
@ -456,6 +455,8 @@ GEM
httpclient (>= 2.4) httpclient (>= 2.4)
multi_json (>= 1.3.6) multi_json (>= 1.3.6)
rack (>= 1.1) rack (>= 1.1)
rack-protection (2.0.0)
rack
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (5.0.0.1) rails (5.0.0.1)
@ -499,8 +500,6 @@ GEM
trollop (~> 2.1) trollop (~> 2.1)
rdoc (4.3.0) rdoc (4.3.0)
redis (3.3.3) redis (3.3.3)
redis-namespace (1.5.3)
redis (~> 3.0, >= 3.0.4)
ref (2.0.0) ref (2.0.0)
request_store (1.3.1) request_store (1.3.1)
responders (2.3.0) responders (2.3.0)
@ -549,8 +548,6 @@ GEM
ruby_parser (3.8.3) ruby_parser (3.8.3)
sexp_processor (~> 4.1) sexp_processor (~> 4.1)
rubyzip (1.0.0) rubyzip (1.0.0)
rufus-scheduler (3.3.4)
tzinfo
safe_yaml (1.0.4) safe_yaml (1.0.4)
sass (3.4.22) sass (3.4.22)
sass-rails (5.0.6) sass-rails (5.0.6)
@ -577,18 +574,14 @@ GEM
shellany (0.0.1) shellany (0.0.1)
shoulda-matchers (3.1.1) shoulda-matchers (3.1.1)
activesupport (>= 4.0.0) activesupport (>= 4.0.0)
sidekiq (4.2.9)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
rack-protection (>= 1.5.0)
redis (~> 3.2, >= 3.2.1)
sidekiq-cron (0.4.5)
redis-namespace (>= 1.5.2)
rufus-scheduler (>= 2.0.24)
sidekiq (>= 4.2.1)
simple_form (3.4.0) simple_form (3.4.0)
actionpack (> 4, < 5.1) actionpack (> 4, < 5.1)
activemodel (> 4, < 5.1) activemodel (> 4, < 5.1)
sinatra (2.0.0)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.0)
tilt (~> 2.0)
slop (3.6.0) slop (3.6.0)
smart_listing (1.2.0) smart_listing (1.2.0)
coffee-rails coffee-rails
@ -694,8 +687,12 @@ DEPENDENCIES
chunky_png chunky_png
clamav-client clamav-client
copy_carrierwave_file copy_carrierwave_file
daemons
database_cleaner database_cleaner
deep_cloneable (~> 2.2.1) deep_cloneable (~> 2.2.1)
delayed_cron_job
delayed_job_active_record
delayed_job_web
devise devise
dotenv-rails dotenv-rails
draper (~> 3.0.0.pre1) draper (~> 3.0.0.pre1)
@ -710,6 +707,7 @@ DEPENDENCIES
haml-rails haml-rails
hashie hashie
jquery-rails jquery-rails
kaminari
launchy launchy
leaflet-draw-rails leaflet-draw-rails
leaflet-markercluster-rails (~> 0.7.0) leaflet-markercluster-rails (~> 0.7.0)
@ -742,10 +740,7 @@ DEPENDENCIES
select2-rails select2-rails
sentry-raven sentry-raven
shoulda-matchers shoulda-matchers
sidekiq
sidekiq-cron (~> 0.4.4)
simple_form simple_form
sinatra!
smart_listing smart_listing
spreadsheet_architect spreadsheet_architect
spring spring

View file

@ -10,7 +10,6 @@ Téléprocédures Simplifiées, ou TPS pour les intimes, est une plateforme 100
### Tous environnements ### Tous environnements
- postgresql - postgresql
- redis
### Développement ### Développement
@ -61,11 +60,14 @@ Afin de générer la BDD de l'application, il est nécessaire d'éxécuter les c
## Lancement de l'application ## Lancement de l'application
redis-server bin/delayed_job run
sidekiq
mailcatcher -f mailcatcher -f
rails s rails s
## Lancement des workers
Delayed::Job.enqueue(AutoArchiveProcedureWorker.new, cron: "* * * * *")
Delayed::Job.enqueue(WeeklyOverviewWorker.new, cron: "0 8 * * 0")
## Exécution des tests (RSpec) ## Exécution des tests (RSpec)

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"/><path stroke="#35D49E" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 1C5.928 1 1 5.928 1 12s4.928 11 11 11 11-4.928 11-11S18.072 1 12 1z"/><path stroke="#35D49E" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 12.093L10.182 16 18 8"/></g></svg>

After

Width:  |  Height:  |  Size: 434 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"><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 width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><title>Shape</title><path d="M18.34 7.287L7.038 17.73a3.358 3.358 0 0 1-2.292.877c-.867 0-1.68-.312-2.291-.877a2.867 2.867 0 0 1-.948-2.118c0-.801.337-1.554.948-2.119L14.94 1.954c.785-.725 2.159-.724 2.944 0 .812.751.812 1.972 0 2.722L6.675 15.036c-.33.306-.912.307-1.243 0a.779.779 0 0 1-.258-.574c0-.217.092-.422.258-.575l8.08-7.468a.669.669 0 0 0 .221-.492.67.67 0 0 0-.221-.494.816.816 0 0 0-1.065.001l-8.08 7.469c-.451.416-.699.969-.699 1.559s.248 1.143.698 1.56c.9.83 2.473.832 3.375 0L18.95 5.66C19.627 5.035 20 4.202 20 3.315c0-.886-.373-1.72-1.05-2.345A3.718 3.718 0 0 0 16.412 0c-.959 0-1.86.344-2.538.97L1.389 12.51C.493 13.336 0 14.44 0 15.612c0 1.173.493 2.276 1.39 3.103C2.283 19.544 3.475 20 4.745 20s2.463-.456 3.359-1.284l11.3-10.444a.667.667 0 0 0 .222-.492c0-.187-.08-.361-.222-.493a.818.818 0 0 0-1.065 0z" fill-rule="nonzero" fill="#4393F3"/></svg>

After

Width:  |  Height:  |  Size: 952 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"/><path stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8.999A2.989 2.989 0 0 0 14.995 6c0-1.66-1.332-3-2.995-3a2.998 2.998 0 1 0 0 5.999zm0 4c-2.33 0-7 1.17-7 3.5v3.834h14v-3.834c0-2.33-4.67-3.5-7-3.5z"/></g></svg>

After

Width:  |  Height:  |  Size: 396 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" stroke="#CCC" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6.754 19.498l-.007-.006A9 9 0 1 0 11.73 3c-4.97 0-8.999 4.031-8.999 9a8.964 8.964 0 0 0 1.23 4.535S4.1 19.201 2 20.6c0 0 2.309.796 4.754-1.102z"/></svg>

After

Width:  |  Height:  |  Size: 335 B

View file

@ -0,0 +1 @@
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1683 808l-742 741q-19 19-45 19t-45-19L109 808q-19-19-19-45.5t19-45.5l166-165q19-19 45-19t45 19l531 531 531-531q19-19 45-19t45 19l166 165q19 19 19 45.5t-19 45.5z"/></svg>

After

Width:  |  Height:  |  Size: 270 B

View file

@ -0,0 +1 @@
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>ic_close_circle_white</title><defs><path id="a" d="M0 0h992v412H0z"/><filter x="-8.1%" y="-4.6%" width="116.2%" height="110.9%" filterUnits="objectBoundingBox" id="b"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="8" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter><path id="c" d="M0 0h320v479H0z"/></defs><g fill="none" fill-rule="evenodd"><g transform="translate(-557 -325)"><use fill="#FFF" xlink:href="#a"/><path stroke="#CCC" d="M.5.5h991v411H.5z"/></g><g filter="url(#b)" transform="translate(-16 -399)"><use fill="#FFF" xlink:href="#c"/><path stroke="#CCC" d="M.5.5h319v478H.5z"/><g><path d="M16 399h24v24H16z"/><path d="M28 400c-6.072 0-11 4.928-11 11s4.928 11 11 11 11-4.928 11-11-4.928-11-11-11zM31.833 407L24 414.833M31.833 414.833L24 407" stroke="#FF5D60" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

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="M11.999 7.104l-2.2-2.25h-6.6c-1.21 0-2.189 1.014-2.189 2.25l-.011 13.5c0 1.238.99 2.25 2.2 2.25h17.6c1.21 0 2.2-1.012 2.2-2.25V9.355c0-1.237-.99-2.25-2.2-2.25"/><path d="M20.877 6.871l1.829-1.829a.994.994 0 0 0 0-1.41l-2.339-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83-1.069 1.07L4.999 15.25V19h3.75L19.807 7.941l1.07-1.07zm-3.608-3.662l3.396 3.542"/></g><path d="M0 0h24v24H0z"/></g></svg>

After

Width:  |  Height:  |  Size: 595 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 stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.5 21h18M18.878 8.871l1.829-1.829a.994.994 0 0 0 0-1.41l-2.339-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83-1.069 1.07L3 17.25V21h3.75L17.808 9.941l1.07-1.07zm-3.609-3.662l3.396 3.542"/><path d="M0 0h24v24H0z"/></g></svg>

After

Width:  |  Height:  |  Size: 424 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="640.5 640.5 512 512"><path d="M820.864 861.591h151.273v-56.727c0-20.879-7.387-38.705-22.159-53.478-14.773-14.772-32.599-22.159-53.478-22.159s-38.705 7.387-53.477 22.159c-14.773 14.773-22.159 32.599-22.159 53.478v56.727zm245.818 28.364v170.182c0 7.879-2.758 14.575-8.272 20.091-5.516 5.515-12.212 8.272-20.091 8.272H754.682c-7.879 0-14.576-2.758-20.091-8.272-5.515-5.516-8.272-12.212-8.272-20.091V889.955c0-7.879 2.757-14.576 8.272-20.091s12.212-8.273 20.091-8.273h9.455v-56.727c0-36.243 13-67.364 39-93.364s57.121-39 93.364-39c36.242 0 67.363 13 93.363 39s39 57.121 39 93.364v56.727h9.455c7.879 0 14.575 2.758 20.091 8.273 5.514 5.515 8.272 12.212 8.272 20.091z" fill="#999999"/></svg>

After

Width:  |  Height:  |  Size: 760 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"><g stroke="#4393F3" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"/><path d="M2.292 5.033l9.667 6.675 9.666-6.75"/></g><path d="M0 0h24v24H0z"/></g></svg>

After

Width:  |  Height:  |  Size: 383 B

View file

@ -0,0 +1 @@
<svg width="25" height="25" viewBox="0 0 25 25" xmlns="http://www.w3.org/2000/svg"><title>Shape</title><path d="M20.37.5H4.946L.7 6.19l12 18.31 12-18.31L20.37.5zm2.355 5.69l-2.98 4.541c0-.006-.005-.011-.005-.011-.39-.975-.853-2.648-4.215-3.026 0 0-5.351.321-6.377-.563-1.025-.885-2.917-3.132 1.417-4.58 2.635-.885 5.716.377 5.998 3.887h3.488V2.213l2.674 3.977zM8.253 14.49a.148.148 0 0 0-.021.034L5.84 10.877l.005-.01s.912.732 4.232.884c3.32.146 6.25.146 7.158 1.087.912.94-.769 2.704-4.791 2.462-.005 0-2.257-3.606-4.19-.811zM18.311 2.19s.21 1.578-.756 1.972c0 0-.084-.355-1.207-1.972h1.963zm-12.735 0h2.45c-.454.192-3.657 1.989-3.417 6.8v.023L2.759 6.19l2.817-4zm4.073 14.496c.004 0 4.85.715 6.212-.186.059-.04.117-.079.18-.13l-3.299 5.031-3.093-4.715z" fill-rule="nonzero" fill="#4393F3"/></svg>

After

Width:  |  Height:  |  Size: 798 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

@ -0,0 +1 @@
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>sans-suite</title><defs><path id="a" d="M0 0h992v412H0z"/><filter x="-8.1%" y="-4.6%" width="116.2%" height="110.9%" filterUnits="objectBoundingBox" id="b"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="8" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter><path id="c" d="M0 0h320v479H0z"/></defs><g fill="none" fill-rule="evenodd"><g transform="translate(-557 -229)"><use fill="#FFF" xlink:href="#a"/><path stroke="#CCC" d="M.5.5h991v411H.5z"/></g><g filter="url(#b)" transform="translate(-16 -303)"><use fill="#FFF" xlink:href="#c"/><path stroke="#CCC" d="M.5.5h319v478H.5z"/><g><path d="M16 303h24v24H16z"/><path d="M28 304c-6.072 0-11 4.928-11 11s4.928 11 11 11 11-4.928 11-11-4.928-11-11-11z" stroke="#333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><g fill="#333" transform="translate(16 303)"><circle cx="8" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="16" cy="12" r="1"/></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -15,7 +15,7 @@
//= require turbolinks //= require turbolinks
//= require highcharts //= require highcharts
//= require chartkick //= require chartkick
//= require_tree . //= require_tree ./old_design
//= require bootstrap-sprockets //= require bootstrap-sprockets
//= require bootstrap-datepicker/core //= require bootstrap-datepicker/core
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js //= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js

View file

@ -10,9 +10,13 @@
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives. // about supported directives.
// //
//= require ./init
//= require jquery //= require jquery
//= require jquery_ujs //= require jquery_ujs
//= require turbolinks //= require turbolinks
//= require leaflet.1.1.0
//= require highcharts //= require highcharts
//= require chartkick //= require chartkick
//= require select2
//= require typeahead.bundle
//= require_tree . //= require_tree .

View file

@ -0,0 +1,11 @@
$(document).on("click", "body", function () {
$(".button.dropdown").removeClass("open");
});
$(document).on("click", ".button.dropdown", function(event) {
event.stopPropagation();
var $target = $(event.target);
if($target.hasClass("button", "dropdown")){
$target.toggleClass("open");
}
});

View file

@ -0,0 +1,10 @@
function drawCadastre (map) {
drawLayerWithItems(map, dossierCadastres, {
fillColor: '#8A6D3B',
weight: 2,
opacity: 0.7,
color: '#8A6D3B',
dashArray: '3',
fillOpacity: 0.5
});
}

View file

@ -0,0 +1,61 @@
function initCarto() {
if ($("#map").length > 0) {
var position = getPosition() || defaultGestionnairePosition();
var map = L.map('map', {
scrollWheelZoom: false
}).setView([position.lat, position.lon], position.zoom);
L.tileLayer('http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// draw external polygons
drawCadastre(map);
drawQuartiersPrioritaires(map);
// draw user polygon
drawUserSelection(map);
}
}
$(document).on('turbolinks:load', initCarto);
function drawUserSelection(map) {
if (dossierJsonLatLngs.length > 0) {
var polygon = L.polygon(dossierJsonLatLngs, { color: 'red', zIndex: 3 }).addTo(map);
map.fitBounds(polygon.getBounds());
}
}
function defaultGestionnairePosition() {
var LON = '2.428462';
var LAT = '46.538192';
return { lon: LON, lat: LAT, zoom: 5 }
}
function getPosition() {
var position;
$.ajax({
url: getPositionUrl,
dataType: 'json',
async: false
}).done(function (data) {
position = data
});
return position;
}
function drawLayerWithItems(map, items, style) {
if (Array.isArray(items) && items.length > 0) {
var layer = new L.GeoJSON();
items.forEach(function (item) {
layer.addData(item.geometry);
});
layer.setStyle(style).addTo(map);
}
}

View file

@ -0,0 +1,10 @@
function drawQuartiersPrioritaires (map) {
drawLayerWithItems(map, dossierQuartiersPrioritaires, {
fillColor: '#31708F',
weight: 2,
opacity: 0.7,
color: '#31708F',
dashArray: '3',
fillOpacity: 0.5
});
}

View file

@ -0,0 +1,27 @@
(function () {
var display = 'label';
var bloodhound = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(display),
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: '/ban/search?request=%QUERY',
wildcard: '%QUERY'
}
});
bloodhound.initialize();
var bindTypeahead = function() {
$("input[data-address='true']").typeahead({
minLength: 1
}, {
display: display,
source: bloodhound,
limit: 5
});
};
document.addEventListener('turbolinks:load', bindTypeahead);
})();

View file

@ -0,0 +1,3 @@
document.addEventListener('turbolinks:load', function() {
$('select.select2').select2();
});

View file

@ -0,0 +1,8 @@
$(document).on('blur keydown', 'input, textarea', function() {
$(this).addClass('touched');
});
$(document).on('click', 'input[type="submit"]:not([formnovalidate])', function() {
var $form = $(this).closest('form');
$('input, textarea', $form).addClass('touched');
});

View file

@ -1,5 +1,3 @@
window.TPS = window.TPS || {};
$(document).on("click", "body", function () { $(document).on("click", "body", function () {
$(".header-menu").removeClass("open fade-in-down"); $(".header-menu").removeClass("open fade-in-down");
}); });

View file

@ -0,0 +1,2 @@
// namespace
window.TPS = window.TPS || {};

View file

@ -0,0 +1,8 @@
TPS.scrollMessagerie = function () {
var $ul = $(".messagerie ul").first();
if($ul.length) {
$ul.scrollTop($ul.prop('scrollHeight'));
}
};
document.addEventListener("turbolinks:load", TPS.scrollMessagerie);

View file

@ -0,0 +1,9 @@
TPS.acceptDossier = function () {
$(".motivation").show();
$(".dropdown-items").hide();
}
TPS.motivationCancel = function () {
$(".motivation").hide();
$(".dropdown-items").show();
}

View file

@ -0,0 +1,36 @@
(function() {
var showNotFound = function() {
$('.dossier-link .text-info').hide();
$('.dossier-link .text-warning').show();
};
var showData = function(data) {
$('.dossier-link .dossier-text-summary').text(data.textSummary);
$('.dossier-link .text-info').show();
$('.dossier-link .text-warning').hide();
};
var hideEverything = function() {
$('.dossier-link .text-info').hide();
$('.dossier-link .text-warning').hide();
};
var fetchProcedureLibelle = function(e) {
var dossierId = $(e.target).val();
if(dossierId) {
$.get('/users/dossiers/' + dossierId + '/text_summary')
.done(showData)
.fail(showNotFound);
} else {
hideEverything();
}
};
var timeOut = null;
var debounceFetchProcedureLibelle = function(e) {
if(timeOut){ clearTimeout(timeOut); }
timeOut = setTimeout(function() { fetchProcedureLibelle(e); }, 300);
};
$(document).on('input', '[data-type=dossier-link]', debounceFetchProcedureLibelle);
})();

View file

@ -7,3 +7,8 @@ $border-grey: #CCCCCC;
$dark-red: #A94442; $dark-red: #A94442;
$light-red: #EBCCD1; $light-red: #EBCCD1;
$lighter-red: #F2DEDE; $lighter-red: #F2DEDE;
$green: #35D49E;
$lighter-green: lighten($green, 30%);
$light-green: lighten($green, 25%);
$dark-green: darken($green, 20%);
$orange: #F59415;

View file

@ -1,3 +1,7 @@
$page-width: 1040px; $page-width: 1040px;
$default-padding: 15px; $default-spacer: 8px;
$default-padding: 2 * $default-spacer;
$footer-height: 267px;
$footer-height-mobile: 531px;

View file

@ -1,5 +1,4 @@
@import "constants"; @import "constants";
@import "mixins";
%horizontal-list { %horizontal-list {
list-style-type: none; list-style-type: none;
@ -14,12 +13,6 @@
display: inline-block; display: inline-block;
} }
%page-width-container {
@include horizontal-padding($default-padding);
max-width: $page-width + 2 * $default-padding;
margin: 0 auto;
}
%animation { %animation {
animation-fill-mode: forwards; animation-fill-mode: forwards;
animation-duration: 0.3s; animation-duration: 0.3s;

View file

@ -0,0 +1,51 @@
@import "colors";
@import "mixins";
.tabs {
li {
display: inline-block;
line-height: 36px;
position: relative;
text-align: center;
font-size: 14px;
border-radius: 3px 3px 0 0;
border: 1px solid transparent;
a {
display: block;
padding-left: 20px;
padding-right: 20px;
color: $black;
}
&.active {
background-color: #FFFFFF;
border-top: 1px solid $border-grey;
border-left: 1px solid $border-grey;
border-right: 1px solid $border-grey;
a {
color: $blue;
}
.badge {
color: $blue;
}
}
&:hover {
a {
color: $blue;
}
.badge {
color: $blue;
}
}
.notifications {
top: 3px;
right: 3px;
}
}
}

View file

@ -1,4 +1,5 @@
@import "colors"; @import "colors";
@import "constants";
@import "placeholders"; @import "placeholders";
@import "mixins"; @import "mixins";
@ -59,10 +60,13 @@ $auth-breakpoint: 820px;
} }
.auth-form { .auth-form {
font-size: 14px;
.reset-password { .reset-password {
margin-top: 8px; margin-top: - 3 * $default-spacer;
margin-bottom: $default-spacer;
}
.remember-me {
display: inline-block;
} }
.separation { .separation {

View file

@ -0,0 +1,141 @@
@import "colors";
@import "common";
@import "constants";
.give-avis {
h1 {
font-size: 18px;
font-weight: bold;
margin-bottom: $default-padding;
}
.lock {
margin-right: $default-spacer;
}
h2 {
margin-bottom: $default-padding;
.email {
font-weight: bold;
}
}
.introduction {
margin-bottom: $default-padding;
}
.confidentiel {
color: $grey;
font-weight: normal;
margin-bottom: 2 * $default-padding;
}
.date {
font-size: 12px;
color: $grey;
float: right;
}
}
.ask-avis {
h1 {
font-size: 18px;
font-weight: bold;
margin-bottom: $default-padding;
}
.avis-notice {
font-size: 14px;
color: $grey;
margin-bottom: 2 * $default-padding;
}
input[type=email] {
max-width: 500px;
}
form > label {
display: inline-block;
}
.confidentiel {
color: $grey;
font-weight: normal;
margin-bottom: 2 * $default-padding;
}
.confidentiel-wrapper {
label,
select {
display: inline-block;
}
}
}
.list-avis {
.title {
font-size: 18px;
font-weight: bold;
margin-bottom: $default-padding;
.count {
display: inline-block;
width: 20px;
height: 20px;
border-radius: 10px;
border: 1px solid $grey;
text-align: center;
font-size: 12px;
font-weight: normal;
margin-left: 8px;
}
}
.one-avis {
border-top: 1px solid $grey;
padding: $default-padding 0;
.lock {
margin-right: $default-spacer;
}
h2 {
margin-bottom: $default-spacer;
.email {
font-weight: bold;
}
}
.answer {
margin-top: $default-padding;
}
.avis-icon {
margin-right: $default-spacer;
}
.confidentiel {
color: $grey;
font-size: 12px;
.lock {
width: 12px;
height: 12px;
background-size: 12px 12px;
vertical-align: sub;
}
}
}
.date,
.waiting {
font-size: 12px;
color: $grey;
}
.date {
float: right;
}
}

View file

@ -0,0 +1,20 @@
@import "colors";
@import "constants";
.backoffice-title {
font-size: 30px;
font-weight: normal;
margin-top: 3 * $default-spacer;
margin-bottom: 3 * $default-spacer;
}
.backoffice-header {
background-color: $light-grey;
padding-top: $default-padding;
margin-bottom: 2 * $default-spacer;
border-bottom: 1px solid $border-grey;
.container {
margin-bottom: -1px;
}
}

View file

@ -0,0 +1,18 @@
@import "colors";
@import "constants";
.badge {
padding: 0 5px;
font-size: 14px;
font-weight: bold;
text-align: center;
white-space: nowrap;
border-radius: 100px;
background-color: rgba(0, 0, 0, 0.08);
vertical-align: top;
&.warning {
background-color: $orange;
color: #FFFFFF;
}
}

View file

@ -0,0 +1,28 @@
@import "colors";
@import "constants";
.breadcrumbs {
margin: $default-spacer 0 3 * $default-spacer;
li {
display: inline-block;
font-weight: bold;
font-size: 14px;
a {
color: $black;
}
&::after {
content: " > ";
}
&:last-child {
color: $blue;
&::after {
content: none;
}
}
}
}

View file

@ -1,4 +1,5 @@
@import "colors"; @import "colors";
@import "constants";
.button { .button {
display: inline-block; display: inline-block;
@ -6,15 +7,22 @@
border-radius: 30px; border-radius: 30px;
border: 1px solid $border-grey; border: 1px solid $border-grey;
font-size: 14px; font-size: 14px;
line-height: 20px;
background-color: #FFFFFF; background-color: #FFFFFF;
color: $black; color: $black;
cursor: pointer; cursor: pointer;
-webkit-appearance: none;
&:hover { &:hover {
background: $light-grey; background: $light-grey;
text-decoration: none; text-decoration: none;
} }
&:active,
&:focus {
outline: none;
}
&.primary { &.primary {
color: #FFFFFF; color: #FFFFFF;
border-color: $blue; border-color: $blue;
@ -36,14 +44,132 @@
} }
} }
&.success {
color: #FFFFFF;
border-color: $green;
background-color: $green;
&:hover {
color: $green;
background-color: #FFFFFF;
}
}
&.large { &.large {
font-size: 18px; font-size: 18px;
line-height: 26px;
padding: 15px 32px; padding: 15px 32px;
} }
&.expand { &.expand {
width: 100%; width: 100%;
} }
> i {
width: 18px;
height: 18px;
background-size: 18px 18px;
vertical-align: middle;
margin-right: $default-spacer;
}
&.dropdown {
position: relative;
&::after {
content: "";
margin-left: $default-spacer;
font-weight: bold;
}
.dropdown-content {
display: none;
}
&.open {
.dropdown-content {
display: block;
}
}
}
}
.dropdown-content {
border: 1px solid $border-grey;
background: #FFFFFF;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
position: absolute;
right: 0;
top: 5 * $default-spacer;
cursor: default;
z-index: 10;
&.terminated {
width: 600px;
color: $black;
padding: $default-padding;
h4 {
font-size: 24px;
}
.dossier-motivation {
margin-top: 2 * $default-padding;
}
.attestation {
margin: $default-padding 0;
color: $grey;
}
}
}
.dropdown-items {
li {
display: flex;
padding: 2 * $default-spacer;
color: $grey;
border-bottom: 1px solid $border-grey;
font-size: 12px;
min-width: 300px;
cursor: pointer;
&.selected {
cursor: default;
h4 {
color: $blue;
}
}
&.selected,
&:hover {
background: $light-grey;
}
&:last-child {
border-bottom: none;
}
a {
display: flex;
color: $grey;
}
i {
flex-shrink: 0;
}
div {
padding-left: $default-spacer;
}
}
h4 {
font-size: 14px;
color: $black;
margin-bottom: $default-spacer;
}
} }
.link { .link {

View file

@ -0,0 +1,22 @@
@import "colors";
@import "constants";
.card {
padding: ($default-spacer * 3) ($default-spacer * 2);
border: 1px solid $border-grey;
margin-bottom: $default-spacer * 2;
&.featured {
border-top: 8px solid $blue;
.card-title {
color: $blue;
}
}
.card-title {
font-weight: bold;
font-size: 20px;
margin-bottom: $default-spacer * 2;
}
}

View file

@ -1,12 +1,39 @@
@import "colors";
@import "constants";
@import "mixins";
@import "placeholders";
@import "typography"; @import "typography";
body { body,
input,
textarea,
select {
@extend %new-type; @extend %new-type;
font-size: 16px; font-size: 16px;
line-height: 1.42857143; line-height: 1.42857143;
} }
.page-wrapper {
position: relative;
padding-bottom: $footer-height;
min-height: 100%;
@media (max-width: 1000px) {
padding-bottom: $footer-height-mobile;
}
}
h1 { h1 {
font-size: 36px; font-size: 36px;
font-weight: bold; font-weight: bold;
} }
a {
color: $blue;
}
.container {
@include horizontal-padding($default-padding);
max-width: $page-width + 2 * $default-padding;
margin: 0 auto;
}

View file

@ -0,0 +1,17 @@
@import "constants";
@import "colors";
.dossier-link {
.help-block > p {
margin-top: - $default-padding;
margin-bottom: 2 * $default-padding;
}
.text-info {
color: $blue;
}
.text-warning {
color: $dark-red;
}
}

View file

@ -0,0 +1,11 @@
@import "colors";
@import "common";
@import "constants";
#dossier-annotations-privees {
h1 {
font-size: 18px;
font-weight: bold;
margin-bottom: $default-padding;
}
}

View file

@ -0,0 +1,39 @@
@import "colors";
@import "constants";
.table.dossiers-table {
td {
padding: 0;
}
.cell-link {
color: $black;
padding: (3 * $default-spacer) 2px;
display: block;
}
i.folder {
margin-right: $default-spacer;
position: relative;
.notifications {
top: 0px;
right: -10px;
}
}
.number-col,
.status-col {
width: 130px;
}
.status-col span {
width: 110px;
text-align: center;
}
.follow-col {
width: 200px;
text-align: center;
}
}

View file

@ -0,0 +1,19 @@
.flex {
display: flex;
&.align-center {
align-items: center;
}
&.align-start {
align-items: flex-start;
}
&.align-baseline {
align-items: baseline;
}
&.justify-between {
justify-content: space-between;
}
}

View file

@ -1,3 +1,4 @@
@import "constants";
@import "colors"; @import "colors";
.form { .form {
@ -6,32 +7,175 @@
margin-bottom: 20px; margin-bottom: 20px;
} }
label,
input {
font-size: 14px;
}
label,
input[type=submit] {
margin-top: 24px;
}
label { label {
margin-bottom: 8px; margin-bottom: $default-padding;
display: inline-block; display: block;
.mandatory {
color: $dark-red;
} }
input[type=text], .notice {
input[type=email], font-size: 14px;
input[type=password] { display: block;
margin-top: $default-spacer;
color: $grey;
}
}
input[type=text]:not([data-address='true']),
input[type=email],
input[type=password],
input[type=date],
input[type=number],
input[type=tel],
textarea,
select {
display: block; display: block;
width: 100%;
border-radius: 4px; border-radius: 4px;
border: solid 1px $border-grey; border: solid 1px $border-grey;
padding: 16px; margin-bottom: 2 * $default-padding;
padding: $default-padding;
&:disabled { &:disabled {
background-color: $border-grey; background-color: $border-grey;
} }
} }
input[type=text],
input[type=email],
input[type=password],
input[type=date],
input[type=number],
input[type=tel],
textarea {
width: 100%;
}
input[type=email],
input[type=number],
input[type=tel], {
max-width: 500px;
}
input[type=checkbox],
input[type=radio] {
margin-bottom: 2 * $default-padding;
}
input[type=date] {
max-width: 180px;
}
input:invalid,
textarea:invalid {
box-shadow: none;
}
input.touched:invalid,
textarea.touched:invalid {
border-color: $dark-red;
box-shadow: 0px 0px 5px $dark-red;
}
select,
.select2-selection {
// hack found here: https://stackoverflow.com/questions/1895476/how-to-style-a-select-dropdown-with-css-only-without-javascript
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: image-url("icons/chevron-down.svg") no-repeat;
background-size: 14px;
background-position: right 10px center;
padding-right: 3 * $default-spacer;
// CAUTION: IE hackery ahead
&::-ms-expand {
display: none; // remove default arrow in IE 10 and 11 */
}
// target Internet Explorer 9 to undo the custom arrow */
@media screen and (min-width:0\0) {
select {
background: none\9;
}
}
}
.select2 {
min-width: 50%;
}
.select2-container {
display: block;
margin-bottom: 2 * $default-padding;
&.select2-container--focus {
.select2-selection {
border-color: $border-grey;
}
}
// scss-lint:disable SelectorFormat
.select2-selection__rendered {
padding: $default-padding;
}
.select2-selection__choice {
background-color: #FFFFFF;
}
// scss-lint:enable
}
.twitter-typeahead {
margin-bottom: 2 * $default-padding;
}
input.tt-input,
input.tt-hint {
border-radius: 4px;
border: solid 1px $border-grey;
padding: $default-padding;
}
input.tt-hint {
color: $grey;
}
.datetime {
input[type=date] {
display: inline-block;
}
select {
display: inline-block;
}
}
.header-section {
color: #4393F3;
font-weight: bold;
font-size: 20px;
margin-bottom: 2 * $default-padding;
}
.explication-libelle {
font-weight: bold;
font-size: 20px;
margin-bottom: $default-padding;
}
.explication {
background-color: $light-grey;
padding: $default-padding;
margin-bottom: 2 * $default-padding;
}
.send-wrapper {
text-align: right;
.send {
margin-bottom: $default-padding;
}
}
} }

View file

@ -0,0 +1,59 @@
i {
display: inline-block;
width: 24px;
height: 24px;
background-size: 24px 24px;
vertical-align: bottom;
&.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");
}
&.folder {
background-image: image-url("icons/folder.svg");
}
&.accept {
background-image: image-url("icons/accept.svg");
}
&.close {
background-image: image-url("icons/close.svg");
}
&.without-continuation {
background-image: image-url("icons/without-continuation.svg");
}
&.edit {
background-image: image-url("icons/edit-folder-blue.svg");
}
&.in-progress {
background-image: image-url("icons/in-progress-blue.svg");
}
&.bubble {
background-image: image-url("icons/bubble.svg");
}
&.attachment {
background-image: image-url("icons/attachment.svg");
}
&.lock {
background-image: image-url("icons/lock.svg");
}
}

View file

@ -0,0 +1,36 @@
@import "colors";
@import "constants";
.label {
display: inline-block;
padding: 4px $default-spacer;
background: $grey;
border: 1px solid transparent;
color: #FFFFFF;
border-radius: 4px;
font-size: 12px;
&.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;
}
}

View file

@ -11,10 +11,6 @@
@include vertical-padding(60px); @include vertical-padding(60px);
} }
.landing-panel-inner-content {
@extend %page-width-container;
}
$landing-breakpoint: 1040px; $landing-breakpoint: 1040px;
.hero-wrapper { .hero-wrapper {

View file

@ -1,6 +1,6 @@
@import "colors"; @import "colors";
@import "common";
@import "constants"; @import "constants";
@import "placeholders";
.two-columns { .two-columns {
$column-padding: 60px; $column-padding: 60px;
@ -9,7 +9,7 @@
background: linear-gradient(to right, #FFFFFF 0%, #FFFFFF 50%, $light-grey 50%, $light-grey 100%); background: linear-gradient(to right, #FFFFFF 0%, #FFFFFF 50%, $light-grey 50%, $light-grey 100%);
.columns-container { .columns-container {
@extend %page-width-container; @extend .container;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;

View file

@ -0,0 +1,4 @@
#map {
height: 400px;
margin-bottom: 16px;
}

View file

@ -0,0 +1,45 @@
@import "colors";
@import "common";
@import "constants";
.messagerie {
ul {
max-height: 350px;
overflow-y: scroll;
border: 1px solid $border-grey;
padding: 2 * $default-spacer;
margin-bottom: $default-spacer;
}
li {
display: flex;
align-items: flex-start;
margin-bottom: 2 * $default-padding;
}
.person-icon {
margin-right: $default-spacer;
}
h2 {
margin-bottom: $default-spacer;
}
.mail {
font-weight: bold;
}
.guest,
.date {
font-size: 12px;
color: $grey;
}
.date {
float: right;
}
.attachment-link {
margin-top: $default-spacer;
}
}

View file

@ -0,0 +1,29 @@
@import "colors";
@import "constants";
.motivation {
display: none;
padding: $default-padding;
color: $black;
width: 450px;
h3 {
font-size: 22px;
margin-bottom: $default-spacer * 2;
i {
vertical-align: sub;
margin-right: $default-spacer;
}
}
textarea {
margin-bottom: $default-spacer;
}
.help {
color: $grey;
font-size: 11px;
margin-bottom: $default-spacer * 2;
}
}

View file

@ -10,3 +10,9 @@
border-color: $light-red; border-color: $light-red;
color: $dark-red; color: $dark-red;
} }
.alert-success {
background-color: $lighter-green;
border-color: $light-green;
color: $dark-green;
}

View file

@ -3,4 +3,7 @@
// = require ./common // = require ./common
// = require ./utils // = require ./utils
// = require ./fonts // = require ./fonts
// = require leaflet.1.1.0
// = require select2
// = require typeahead
// = require_tree . // = require_tree .

View file

@ -3,14 +3,18 @@
@import "mixins"; @import "mixins";
@import "placeholders"; @import "placeholders";
.footer { footer {
@include vertical-padding(72px); @include vertical-padding(72px);
background-color: $light-grey; background-color: $light-grey;
border-top: 1px solid $border-grey; border-top: 1px solid $border-grey;
} position: absolute;
bottom: 0;
width: 100%;
height: $footer-height;
.footer-inner-content { @media (max-width: 1000px) {
@extend %page-width-container; height: $footer-height-mobile;
}
} }
.footer-columns { .footer-columns {

View file

@ -1,7 +1,7 @@
@import "constants";
@import "colors"; @import "colors";
@import "common";
@import "constants";
@import "mixins"; @import "mixins";
@import "placeholders";
// FIXME: Rename when the header is generalized // FIXME: Rename when the header is generalized
.new-header { .new-header {
@ -14,10 +14,37 @@
} }
.header-inner-content { .header-inner-content {
@extend %page-width-container; @extend .container;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding-top: 17px; height: 100%;
}
.header-logo {
display: inline-block;
margin-right: 4 * $default-spacer;
}
.header-tabs {
li {
display: inline-block;
}
a {
display: inline-block;
padding: 23px $default-padding;
font-size: 18px;
color: $black;
&.active {
color: $blue;
border-bottom: 2px solid $blue;
}
&:not(.active):hover {
background-color: $light-grey;
}
}
} }
.header-right-content { .header-right-content {
@ -41,10 +68,11 @@
padding-right: 42px; padding-right: 42px;
float: right; float: right;
width: 300px; width: 300px;
margin: 0;
} }
button { button {
padding: 6px 9px; padding: 9px;
border: none; border: none;
background: none; background: none;
cursor: pointer; cursor: pointer;
@ -80,6 +108,7 @@
border: 1px solid $border-grey; border: 1px solid $border-grey;
min-width: 270px; min-width: 270px;
max-width: 340px; max-width: 340px;
z-index: 20;
&.open { &.open {
display: block; display: block;

View file

@ -0,0 +1,9 @@
@import "colors";
span.notifications {
position: absolute;
width: 8px;
height: 8px;
border-radius: 4px;
background-color: $orange;
}

View file

@ -0,0 +1,10 @@
@import "constants";
.pagination {
text-align: center;
margin-bottom: 3 * $default-spacer;
> span {
margin: 0 $default-spacer;
}
}

View file

@ -1,10 +1,6 @@
@import "placeholders"; @import "placeholders";
.patron { .patron {
.patron-container {
@extend %page-width-container;
}
p { p {
margin-bottom: 20px; margin-bottom: 20px;
} }

View file

@ -0,0 +1,17 @@
@import "colors";
@import "constants";
.procedure-logo {
display: flex;
background: #FFFFFF;
border: 1px solid $border-grey;
height: 84px;
width: 84px;
margin-right: 2 * $default-spacer;
img {
margin: auto;
max-width: 80%;
max-height: 80%;
}
}

View file

@ -0,0 +1,77 @@
@import "colors";
@import "constants";
@import "mixins";
.procedure-list {
.procedure-item {
border-bottom: 1px solid $border-grey;
&:last-child {
border-bottom: none;
}
a {
@include vertical-padding(24px);
color: $black;
width: 100%;
&:hover {
background-color: $light-grey;
.procedure-title {
text-decoration: underline;
}
}
}
}
.procedure-logo {
height: 93px;
width: 93px;
margin-right: 3 * $default-spacer;
flex-shrink: 0;
}
.procedure-title {
min-height: 40px;
font-size: 20px;
margin-bottom: 16px;
}
.procedure-status {
margin-left: auto;
}
.procedure-stats {
li {
min-height: 36px;
border-left: 1px solid $border-grey;
width: 90px;
position: relative;
&:last-child {
border-right: 1px solid $border-grey;
}
.stats-number,
.stats-legend {
text-align: center;
}
.stats-number {
font-size: 14px;
font-weight: bold;
}
.stats-legend {
font-size: 12px;
color: $grey;
}
}
.notifications {
top: 3px;
right: 18px;
}
}
}

View file

@ -0,0 +1,29 @@
@import "colors";
@import "common";
@import "constants";
#procedure-show {
.procedure-logo {
margin-right: $default-padding;
flex-shrink: 0;
}
h1 {
color: $black;
font-size: 22px;
margin-bottom: 2 * $default-padding;
}
.dossiers-table {
margin: (3 * $default-spacer) auto;
}
.procedure-actions {
margin-left: auto;
flex-shrink: 0;
.dropdown-items li {
min-width: 150px;
}
}
}

View file

@ -0,0 +1,52 @@
@import "colors";
@import "constants";
@import "mixins";
.table { // TODO : tester de remplacer par l'élément table uniquement
width: 100%;
tbody tr {
border-top: 1px solid $border-grey;
}
td {
@include vertical-padding($default-spacer);
vertical-align: middle;
}
th {
text-align: left;
font-weight: bold;
padding: (3 * $default-spacer) 2px;
}
&.hoverable {
tbody tr:hover {
background: $light-grey;
}
}
&.vertical {
font-size: 14px;
line-height: 22px;
tr {
border-top: none;
}
th {
@include vertical-padding($default-spacer);
font-weight: normal;
&.header-section {
color: $blue;
font-weight: bold;
font-size: 20px;
}
}
td {
font-weight: bold;
}
}
}

View file

@ -21,3 +21,14 @@
.hidden { .hidden {
display: none; display: none;
} }
.width-100 {
width: 100%;
}
.empty-text {
font-size: 20px;
font-weight: bold;
text-align: center;
margin: 60px 0;
}

View file

@ -1,6 +1,21 @@
.new-design-button {
color: #FFFFFF;
display: block;
font-size: 20px;
margin: 16px 0;
padding: 8px;
text-align: center;
border: 1px solid #FFFFFF;
border-radius: 15px;
&:hover {
background-color: #668ABD;
color: #FFFFFF;
}
}
#search-block { #search-block {
margin: 15px 10px 0 10px; margin: 15px 10px 0 10px;
height: 30px;
} }
#search-button { #search-button {

View file

@ -8,7 +8,7 @@ class ApplicationController < ActionController::Base
before_action :authorize_request_for_profiler before_action :authorize_request_for_profiler
def authorize_request_for_profiler def authorize_request_for_profiler
if Rails.env.production? && administration_signed_in? if administration_signed_in?
Rack::MiniProfiler.authorize_request Rack::MiniProfiler.authorize_request
end end
end end

View file

@ -4,7 +4,7 @@ class Backoffice::AvisController < ApplicationController
before_action :check_avis_exists_and_email_belongs_to_avis, only: [:sign_up, :create_gestionnaire] before_action :check_avis_exists_and_email_belongs_to_avis, only: [:sign_up, :create_gestionnaire]
def create def create
avis = Avis.new(create_params.merge(claimant: current_gestionnaire, dossier: dossier)) avis = Avis.new(create_params.merge(claimant: current_gestionnaire, dossier: dossier, confidentiel: true))
if avis.save if avis.save
flash[:notice] = "Votre demande d'avis a bien été envoyée à #{avis.email_to_display}" flash[:notice] = "Votre demande d'avis a bien été envoyée à #{avis.email_to_display}"

View file

@ -98,9 +98,10 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
dossier = Dossier.find(params[:dossier_id]) dossier = Dossier.find(params[:dossier_id])
dossier.received! dossier.received!
flash.notice = 'Dossier considéré comme reçu.' current_gestionnaire.follow(dossier)
flash.notice = 'Dossier passé en instruction.'
redirect_to backoffice_dossier_path(id: dossier.id) redirect_to_dossier(dossier)
end end
def process_dossier def process_dossier
@ -142,16 +143,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
NotificationMailer.send_notification(dossier, template, attestation_pdf).deliver_now! NotificationMailer.send_notification(dossier, template, attestation_pdf).deliver_now!
redirect_to backoffice_dossier_path(id: dossier.id) redirect_to_dossier(dossier)
end
def follow
follow = current_gestionnaire.toggle_follow_dossier params[:dossier_id]
current_gestionnaire.dossiers.find(params[:dossier_id]).next_step! 'gestionnaire', 'follow'
flash.notice = (follow.class == Follow ? 'Dossier suivi' : 'Dossier relaché')
redirect_to request.referer
end end
def reload_smartlisting def reload_smartlisting
@ -187,14 +179,22 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
def reopen def reopen
create_dossier_facade params[:dossier_id] create_dossier_facade params[:dossier_id]
@facade.dossier.replied! @facade.dossier.initiated!
flash.notice = 'Dossier réouvert.' flash.notice = 'Dossier repassé en construction.'
redirect_to backoffice_dossiers_path redirect_to_dossier(@facade.dossier)
end end
private private
def redirect_to_dossier(dossier)
if params[:new_ui] # TODO delete new_ui when old UI is no longer used
redirect_to dossier_path(dossier.procedure, dossier)
else
redirect_to backoffice_dossier_path(id: dossier.id)
end
end
def check_attestation_emailable(dossier) def check_attestation_emailable(dossier)
if dossier&.attestation&.emailable? == false if dossier&.attestation&.emailable? == false
human_size = number_to_human_size(dossier.attestation.pdf.size) human_size = number_to_human_size(dossier.attestation.pdf.size)

View file

@ -44,9 +44,7 @@ class CommentairesController < ApplicationController
end end
if is_gestionnaire? if is_gestionnaire?
unless current_gestionnaire.follow? @commentaire.dossier current_gestionnaire.follow(@commentaire.dossier)
current_gestionnaire.toggle_follow_dossier @commentaire.dossier
end
redirect_to url_for(controller: 'backoffice/dossiers', action: :show, id: params['dossier_id']) redirect_to url_for(controller: 'backoffice/dossiers', action: :show, id: params['dossier_id'])
else else

View file

@ -0,0 +1,75 @@
module NewGestionnaire
class AvisController < ApplicationController
layout 'new_application'
A_DONNER_STATUS = 'a-donner'
DONNES_STATUS = 'donnes'
def index
gestionnaire_avis = current_gestionnaire.avis.includes(dossier: [:procedure, :user])
@avis_a_donner = gestionnaire_avis.without_answer
@avis_donnes = gestionnaire_avis.with_answer
@statut = params[:statut].present? ? params[:statut] : A_DONNER_STATUS
@avis = case @statut
when A_DONNER_STATUS
@avis_a_donner
when DONNES_STATUS
@avis_donnes
end
@avis = @avis.page([params[:page].to_i, 1].max)
end
def show
@avis = avis
@dossier = avis.dossier
end
def instruction
@avis = avis
@dossier = avis.dossier
end
def update
avis.update_attributes(avis_params)
flash.notice = 'Votre réponse est enregistrée.'
redirect_to instruction_avis_path(avis)
end
def messagerie
@avis = avis
@dossier = avis.dossier
end
def create_commentaire
Commentaire.create(commentaire_params.merge(email: current_gestionnaire.email, dossier: avis.dossier))
redirect_to messagerie_avis_path(avis)
end
def create_avis
confidentiel = avis.confidentiel || params[:avis][:confidentiel]
Avis.create(create_avis_params.merge(claimant: current_gestionnaire, dossier: avis.dossier, confidentiel: confidentiel))
redirect_to instruction_avis_path(avis)
end
private
def avis
current_gestionnaire.avis.includes(dossier: [:avis, :commentaires]).find(params[:id])
end
def avis_params
params.require(:avis).permit(:answer)
end
def commentaire_params
params.require(:commentaire).permit(:body)
end
def create_avis_params
params.require(:avis).permit(:email, :introduction)
end
end
end

Some files were not shown because too many files have changed in this diff Show more