diff --git a/.gitignore b/.gitignore
index dc45b1263..47c6145fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ public/uploads
public/downloads
bin/*
config/initializers/token.rb
+config/initializers/super_admin.rb
doc/*.svg
rubocop.html
config/france_connect.yml
diff --git a/Gemfile b/Gemfile
index 98ccff836..6484c2565 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,22 +1,23 @@
source 'https://rubygems.org'
-
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
-gem 'rails', '4.2.7.1'
+gem 'rails', '5.0.0.1'
+
+gem 'actioncable', '5.0.0.1'
+gem 'redis'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
-# Use CoffeeScript for .coffee assets and views
-gem 'coffee-rails', '~> 4.1.0'
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
-gem 'turbolinks'
+gem 'turbolinks', '~> 2.5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
@@ -47,10 +48,11 @@ gem 'bootstrap-sass', '~> 3.3.5'
gem 'will_paginate-bootstrap'
# Decorators
-gem 'draper'
+gem 'draper', '~> 3.0.0.pre1'
+gem 'unicode_utils'
#Gestion des comptes utilisateurs
-gem 'devise', '~> 3.0'
+gem 'devise'
gem 'openid_connect'
gem 'rest-client'
@@ -83,13 +85,12 @@ gem 'mailjet'
gem "smart_listing"
-# gem 'css_splitter'
gem 'bootstrap-wysihtml5-rails', '~> 0.3.3.8'
gem 'as_csv'
gem 'spreadsheet_architect'
-gem 'apipie-rails', '=0.3.1'
+gem 'apipie-rails'
gem "maruku" # for Markdown support in apipie
gem 'openstack'
@@ -98,6 +99,7 @@ gem 'browser'
group :test do
gem 'capybara'
+ gem 'launchy'
gem 'factory_girl'
gem 'database_cleaner'
gem 'selenium-webdriver'
@@ -106,14 +108,19 @@ group :test do
gem 'simplecov', require: false
gem 'poltergeist'
gem 'timecop'
- # gem 'guard'
+ gem 'guard'
# gem 'guard-rspec', require: false
- # gem 'guard-livereload', '~> 2.4', require: false
+ gem 'guard-livereload', '~> 2.4', require: false
gem 'vcr'
+ gem 'rails-controller-testing'
end
group :development do
- gem 'web-console', '~> 2.0'
+ # Access an IRB console on exception pages or by using <%= console %> in views
+
+ gem 'web-console'
+
+ gem 'rack-handlers'
end
group :development, :test do
@@ -124,11 +131,9 @@ group :development, :test do
gem 'byebug'
gem 'pry-byebug'
- # Access an IRB console on exception pages or by using <%= console %> in views
-
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
- gem 'spring'
- gem 'spring-commands-rspec'
+ # gem 'spring'
+ # gem 'spring-commands-rspec'
gem 'rspec-rails', '~> 3.0'
gem 'railroady'
@@ -137,13 +142,12 @@ group :development, :test do
gem 'rubocop-checkstyle_formatter', require: false
gem 'rubocop-rspec', require: false
- gem "nyan-cat-formatter"
-
- gem 'parallel_tests', '~> 1.9.0'
+ gem 'parallel_tests', '~> 2.10'
gem 'brakeman', require: false
+
# Deploy
- gem 'mina', git: 'https://github.com/mina-deploy/mina.git'
+ gem 'mina', ref: '343a7', git: 'https://github.com/mina-deploy/mina.git'
end
group :production, :staging do
diff --git a/Gemfile.lock b/Gemfile.lock
index 319e88f59..ebf23e02c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,154 +1,153 @@
GIT
remote: https://github.com/mina-deploy/mina.git
- revision: a66b55a72833b19ac0ffb240afb37c86c0227582
+ revision: 343a7ab672d8b4f0ddb84ec240cde7d94b46397a
+ ref: 343a7
specs:
- mina (0.3.7)
+ mina (0.3.8)
open4 (~> 1.3.4)
rake
GEM
remote: https://rubygems.org/
specs:
- CFPropertyList (2.3.2)
- actionmailer (4.2.7.1)
- actionpack (= 4.2.7.1)
- actionview (= 4.2.7.1)
- activejob (= 4.2.7.1)
+ CFPropertyList (2.3.4)
+ actioncable (5.0.0.1)
+ actionpack (= 5.0.0.1)
+ nio4r (~> 1.2)
+ websocket-driver (~> 0.6.1)
+ actionmailer (5.0.0.1)
+ actionpack (= 5.0.0.1)
+ actionview (= 5.0.0.1)
+ activejob (= 5.0.0.1)
mail (~> 2.5, >= 2.5.4)
- rails-dom-testing (~> 1.0, >= 1.0.5)
- actionpack (4.2.7.1)
- actionview (= 4.2.7.1)
- activesupport (= 4.2.7.1)
- rack (~> 1.6)
- rack-test (~> 0.6.2)
- rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-dom-testing (~> 2.0)
+ actionpack (5.0.0.1)
+ actionview (= 5.0.0.1)
+ activesupport (= 5.0.0.1)
+ rack (~> 2.0)
+ rack-test (~> 0.6.3)
+ rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (4.2.7.1)
- activesupport (= 4.2.7.1)
+ actionview (5.0.0.1)
+ activesupport (= 5.0.0.1)
builder (~> 3.1)
erubis (~> 2.7.0)
- rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- active_model_serializers (0.8.3)
- activemodel (>= 3.0)
- activejob (4.2.7.1)
- activesupport (= 4.2.7.1)
- globalid (>= 0.3.0)
- activemodel (4.2.7.1)
- activesupport (= 4.2.7.1)
+ active_model_serializers (0.10.3)
+ actionpack (>= 4.1, < 6)
+ activemodel (>= 4.1, < 6)
+ jsonapi (= 0.1.1.beta2)
+ activejob (5.0.0.1)
+ activesupport (= 5.0.0.1)
+ globalid (>= 0.3.6)
+ activemodel (5.0.0.1)
+ activesupport (= 5.0.0.1)
+ activemodel-serializers-xml (1.0.1)
+ activemodel (> 5.x)
+ activerecord (> 5.x)
+ activesupport (> 5.x)
builder (~> 3.1)
- activerecord (4.2.7.1)
- activemodel (= 4.2.7.1)
- activesupport (= 4.2.7.1)
- arel (~> 6.0)
- activesupport (4.2.7.1)
+ activerecord (5.0.0.1)
+ activemodel (= 5.0.0.1)
+ activesupport (= 5.0.0.1)
+ arel (~> 7.0)
+ activesupport (5.0.0.1)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
- json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
- thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
- addressable (2.3.8)
- apipie-rails (0.3.1)
+ addressable (2.5.0)
+ public_suffix (~> 2.0, >= 2.0.2)
+ apipie-rails (0.3.7)
json
- arel (6.0.3)
+ arel (7.1.4)
as_csv (2.0.2)
actionpack (>= 3.0)
activemodel (>= 3.0)
responders
- ast (2.0.0)
- astrolabe (1.3.0)
- parser (>= 2.2.0.pre.3, < 3.0)
- attr_required (1.0.0)
- autoprefixer-rails (5.2.1)
+ ast (2.3.0)
+ attr_required (1.0.1)
+ autoprefixer-rails (6.5.4)
execjs
- json
axlsx (2.0.1)
htmlentities (~> 4.3.1)
nokogiri (>= 1.4.1)
rubyzip (~> 1.0.0)
bcrypt (3.1.11)
- bindata (2.1.0)
- binding_of_caller (0.7.2)
- debug_inspector (>= 0.0.1)
- bootstrap-datepicker-rails (1.4.0)
+ bindata (2.3.4)
+ bootstrap-datepicker-rails (1.6.4.1)
railties (>= 3.0)
- bootstrap-sass (3.3.5)
- autoprefixer-rails (>= 5.0.0.1)
- sass (>= 3.2.19)
+ bootstrap-sass (3.3.7)
+ autoprefixer-rails (>= 5.2.1)
+ sass (>= 3.3.4)
bootstrap-wysihtml5-rails (0.3.3.8)
railties (>= 3.0)
- brakeman (3.1.1)
- erubis (~> 2.6)
- fastercsv (~> 1.5)
- haml (>= 3.0, < 5.0)
- highline (~> 1.6)
- multi_json (~> 1.2)
- ruby2ruby (>= 2.1.1, < 2.3.0)
- ruby_parser (~> 3.7.0)
- sass (~> 3.0)
- slim (>= 1.3.6, < 4.0)
- terminal-table (~> 1.4)
- browser (2.2.0)
+ brakeman (3.4.1)
+ browser (2.3.0)
builder (3.2.2)
- byebug (5.0.0)
- columnize (= 0.9.0)
- capybara (2.4.4)
+ byebug (9.0.6)
+ capybara (2.11.0)
+ addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
- carrierwave (0.10.0)
+ carrierwave (0.11.2)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
json (>= 1.7)
mime-types (>= 1.16)
- chartkick (1.3.2)
- childprocess (0.5.5)
+ mimemagic (>= 0.3.0)
+ chartkick (2.2.1)
+ childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
- clamav-client (3.0.0)
+ clamav-client (3.1.0)
cliver (0.3.2)
- coderay (1.1.0)
- coffee-rails (4.1.0)
+ coderay (1.1.1)
+ coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
- railties (>= 4.0.0, < 5.0)
+ railties (>= 4.0.0, < 5.2.x)
coffee-script (2.4.1)
coffee-script-source
execjs
- coffee-script-source (1.9.1.1)
- columnize (0.9.0)
+ coffee-script-source (1.11.1)
concurrent-ruby (1.0.2)
- crack (0.4.2)
+ crack (0.4.3)
safe_yaml (~> 1.0.0)
- database_cleaner (1.4.1)
+ database_cleaner (1.5.3)
debug_inspector (0.0.2)
- deep_cloneable (2.2.1)
+ deep_cloneable (2.2.2)
activerecord (>= 3.1.0, < 5.2.0)
- devise (3.5.10)
+ devise (4.2.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
- railties (>= 3.2.6, < 5)
+ railties (>= 4.1.0, < 5.1)
responders
- thread_safe (~> 0.1)
warden (~> 1.2.3)
diff-lcs (1.2.5)
docile (1.1.5)
- domain_name (0.5.24)
+ domain_name (0.5.20161129)
unf (>= 0.0.5, < 1.0.0)
- draper (2.1.0)
- actionpack (>= 3.0)
- activemodel (>= 3.0)
- activesupport (>= 3.0)
+ draper (3.0.0.pre1)
+ actionpack (~> 5.0)
+ activemodel (~> 5.0)
+ activemodel-serializers-xml (~> 1.0)
+ activesupport (~> 5.0)
request_store (~> 1.0)
+ em-websocket (0.5.1)
+ eventmachine (>= 0.12.9)
+ http_parser.rb (~> 0.6.0)
erubis (2.7.0)
- excon (0.49.0)
+ eventmachine (1.2.1)
+ excon (0.54.0)
execjs (2.7.0)
- factory_girl (4.5.0)
+ factory_girl (4.7.0)
activesupport (>= 3.0.0)
- faraday (0.9.1)
+ faraday (0.10.0)
multipart-post (>= 1.2, < 3)
- fastercsv (1.5.5)
- ffi (1.9.6)
+ ffi (1.9.14)
fission (0.5.0)
CFPropertyList (~> 2.2)
fog (1.38.0)
@@ -188,12 +187,12 @@ GEM
fog-atmos (0.1.0)
fog-core
fog-xml
- fog-aws (0.9.2)
- fog-core (~> 1.27)
+ fog-aws (1.0.0)
+ fog-core (~> 1.38)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
- fog-brightbox (0.10.1)
+ fog-brightbox (0.11.0)
fog-core (~> 1.22)
fog-json
inflecto (~> 0.0.2)
@@ -202,7 +201,7 @@ GEM
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
- fog-core (1.38.0)
+ fog-core (1.43.0)
builder
excon (~> 0.49)
formatador (~> 0.2)
@@ -220,22 +219,20 @@ GEM
fog-json (1.0.2)
fog-core (~> 1.0)
multi_json (~> 1.10)
- fog-local (0.3.0)
+ fog-local (0.3.1)
fog-core (~> 1.27)
- fog-openstack (0.1.5)
- fog-core (>= 1.38)
+ fog-openstack (0.1.18)
+ fog-core (>= 1.40)
fog-json (>= 1.0)
- fog-xml (>= 0.1)
ipaddress (>= 0.8)
fog-powerdns (0.1.1)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
- fog-profitbricks (0.0.5)
- fog-core
- fog-xml
- nokogiri
- fog-rackspace (0.1.1)
+ fog-profitbricks (3.0.0)
+ fog-core (~> 1.42)
+ fog-json (~> 1.0)
+ fog-rackspace (0.1.2)
fog-core (>= 1.35)
fog-json (>= 1.0)
fog-xml (>= 0.1)
@@ -254,7 +251,7 @@ GEM
fog-serverlove (0.1.2)
fog-core
fog-json
- fog-softlayer (1.1.1)
+ fog-softlayer (1.1.4)
fog-core
fog-json
fog-storm_on_demand (0.1.1)
@@ -269,21 +266,36 @@ GEM
fog-voxel (0.1.0)
fog-core
fog-xml
- fog-vsphere (0.6.4)
+ fog-vsphere (1.5.2)
fog-core
- rbvmomi (~> 1.8)
+ rbvmomi (~> 1.9)
fog-xenserver (0.2.3)
fog-core
fog-xml
fog-xml (0.1.2)
fog-core
nokogiri (~> 1.5, >= 1.5.11)
- font-awesome-rails (4.4.0.0)
- railties (>= 3.2, < 5.0)
+ font-awesome-rails (4.7.0.1)
+ railties (>= 3.2, < 5.1)
formatador (0.2.5)
globalid (0.3.7)
activesupport (>= 4.1.0)
- haml (4.0.6)
+ guard (2.14.0)
+ formatador (>= 0.2.4)
+ listen (>= 2.7, < 4.0)
+ lumberjack (~> 1.0)
+ nenv (~> 0.1)
+ notiffany (~> 0.0)
+ pry (>= 0.9.12)
+ shellany (~> 0.0)
+ thor (>= 0.18.1)
+ guard-compat (1.2.1)
+ guard-livereload (2.5.2)
+ em-websocket (~> 0.5)
+ guard (~> 2.8)
+ guard-compat (~> 1.0)
+ multi_json (~> 1.8)
+ haml (4.0.7)
tilt
haml-rails (0.9.0)
actionpack (>= 4.0.1)
@@ -291,105 +303,123 @@ GEM
haml (>= 4.0.6, < 5.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
- hashie (3.4.1)
- highline (1.7.8)
+ hashdiff (0.3.1)
+ hashie (3.4.6)
html2haml (2.0.0)
erubis (~> 2.7.0)
haml (~> 4.0.0)
nokogiri (~> 1.6.0)
ruby_parser (~> 3.5)
htmlentities (4.3.4)
- http-cookie (1.0.2)
+ http-cookie (1.0.3)
domain_name (~> 0.5)
- httpclient (2.6.0.1)
+ http_parser.rb (0.6.0)
+ httpclient (2.8.3)
i18n (0.7.0)
inflecto (0.0.2)
ipaddress (0.8.3)
- jbuilder (2.3.1)
- activesupport (>= 3.0.0, < 5)
+ jbuilder (2.6.1)
+ activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
- jquery-rails (4.0.4)
- rails-dom-testing (~> 1.0)
+ jquery-rails (4.2.1)
+ rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
- json-jwt (1.5.1)
+ json-jwt (1.7.0)
activesupport
bindata
multi_json (>= 1.3)
securecompare
url_safe_base64
- kaminari (0.16.3)
+ jsonapi (0.1.1.beta2)
+ json (~> 1.8)
+ kaminari (0.17.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
- kgio (2.9.3)
+ kgio (2.10.0)
+ launchy (2.4.3)
+ addressable (~> 2.3)
leaflet-draw-rails (0.1.0)
leaflet-markercluster-rails (0.7.0)
railties (>= 3.1)
- leaflet-rails (0.7.4)
- libv8 (3.16.14.7)
+ leaflet-rails (0.7.7)
+ libv8 (3.16.14.17)
+ listen (3.1.5)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+ ruby_dep (~> 1.2)
logstash-event (1.2.02)
- logstasher (0.6.5)
+ logstasher (1.1.0)
+ activerecord (>= 4.0)
+ activesupport (>= 4.0)
logstash-event (~> 1.2.0)
request_store
loofah (2.0.3)
nokogiri (>= 1.5.9)
+ lumberjack (1.0.10)
mail (2.6.4)
mime-types (>= 1.16, < 4)
- mailjet (1.1.0)
+ mailjet (1.4.10)
activesupport (>= 3.1.0)
rack (>= 1.4.0)
rest-client
maruku (0.7.2)
method_source (0.8.2)
- mime-types (2.99.2)
+ mime-types (3.1)
+ mime-types-data (~> 3.2015)
+ mime-types-data (3.2016.0521)
+ mimemagic (0.3.2)
mini_portile2 (2.1.0)
- minitest (5.9.0)
- multi_json (1.11.2)
+ minitest (5.10.1)
+ multi_json (1.12.1)
multipart-post (2.0.0)
- netrc (0.10.3)
- nokogiri (1.6.8)
+ nenv (0.3.0)
+ netrc (0.11.0)
+ nio4r (1.2.1)
+ nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
- pkg-config (~> 1.1.7)
- nyan-cat-formatter (0.11)
- rspec (>= 2.99, >= 2.14.2, < 4)
+ notiffany (0.1.1)
+ nenv (~> 0.1)
+ shellany (~> 0.0)
open4 (1.3.4)
- openid_connect (0.9.2)
+ openid_connect (0.12.0)
activemodel
attr_required (>= 1.0.0)
json (>= 1.4.3)
json-jwt (>= 1.5.0)
- rack-oauth2 (>= 1.2.1)
+ rack-oauth2 (>= 1.3.1)
swd (>= 1.0.0)
tzinfo
validate_email
validate_url
webfinger (>= 1.0.1)
- openstack (2.0.2)
+ openstack (3.3.7)
json
orm_adapter (0.5.0)
- parallel (1.9.0)
- parallel_tests (1.9.0)
+ parallel (1.10.0)
+ parallel_tests (2.10.0)
parallel
- parser (2.2.2.2)
- ast (>= 1.1, < 3.0)
- pg (0.18.2)
- pkg-config (1.1.7)
- poltergeist (1.6.0)
+ parser (2.3.3.1)
+ ast (~> 2.2)
+ pg (0.19.0)
+ poltergeist (1.12.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
- multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
- powerpack (0.1.0)
- pry (0.10.1)
+ powerpack (0.1.1)
+ pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
- pry-byebug (3.2.0)
- byebug (~> 5.0)
+ pry-byebug (3.4.2)
+ byebug (~> 9.0)
pry (~> 0.10)
- rack (1.6.4)
- rack-oauth2 (1.2.1)
+ public_suffix (2.0.4)
+ rack (2.0.1)
+ rack-handlers (0.7.3)
+ rack
+ rack-oauth2 (1.4.0)
activesupport (>= 2.3)
attr_required (>= 0.0.5)
httpclient (>= 2.4)
@@ -397,90 +427,92 @@ GEM
rack (>= 1.1)
rack-test (0.6.3)
rack (>= 1.0)
- railroady (1.3.0)
- rails (4.2.7.1)
- actionmailer (= 4.2.7.1)
- actionpack (= 4.2.7.1)
- actionview (= 4.2.7.1)
- activejob (= 4.2.7.1)
- activemodel (= 4.2.7.1)
- activerecord (= 4.2.7.1)
- activesupport (= 4.2.7.1)
+ railroady (1.5.2)
+ rails (5.0.0.1)
+ actioncable (= 5.0.0.1)
+ actionmailer (= 5.0.0.1)
+ actionpack (= 5.0.0.1)
+ actionview (= 5.0.0.1)
+ activejob (= 5.0.0.1)
+ activemodel (= 5.0.0.1)
+ activerecord (= 5.0.0.1)
+ activesupport (= 5.0.0.1)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.2.7.1)
- sprockets-rails
- rails-deprecated_sanitizer (1.0.3)
- activesupport (>= 4.2.0.alpha)
- rails-dom-testing (1.0.7)
- activesupport (>= 4.2.0.beta, < 5.0)
+ railties (= 5.0.0.1)
+ sprockets-rails (>= 2.0.0)
+ rails-controller-testing (1.0.1)
+ actionpack (~> 5.x)
+ actionview (~> 5.x)
+ activesupport (~> 5.x)
+ rails-dom-testing (2.0.1)
+ activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
- rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
- railties (4.2.7.1)
- actionpack (= 4.2.7.1)
- activesupport (= 4.2.7.1)
+ railties (5.0.0.1)
+ actionpack (= 5.0.0.1)
+ activesupport (= 5.0.0.1)
+ method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rainbow (2.0.0)
- raindrops (0.13.0)
- rake (11.2.2)
- rbvmomi (1.8.2)
- builder
- nokogiri (>= 1.4.1)
- trollop
- rdoc (4.2.0)
- json (~> 1.4)
+ rainbow (2.1.0)
+ raindrops (0.17.0)
+ rake (12.0.0)
+ rb-fsevent (0.9.8)
+ rb-inotify (0.9.7)
+ ffi (>= 0.5.0)
+ rbvmomi (1.9.4)
+ builder (~> 3.2)
+ json (>= 1.8)
+ nokogiri (~> 1.5)
+ trollop (~> 2.1)
+ rdoc (4.3.0)
+ redis (3.3.0)
ref (2.0.0)
- request_store (1.1.0)
+ request_store (1.3.1)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
- rest-client (1.8.0)
+ rest-client (2.0.0)
http-cookie (>= 1.0.2, < 2.0)
- mime-types (>= 1.16, < 3.0)
- netrc (~> 0.7)
- rgeo (0.3.20)
- rgeo-geojson (0.3.1)
- rgeo (~> 0.3)
+ mime-types (>= 1.16, < 4.0)
+ netrc (~> 0.8)
+ rgeo (0.5.3)
+ rgeo-geojson (0.4.3)
+ rgeo (~> 0.5)
rodf (0.3.7)
activesupport (>= 3.0, < 6.0)
builder (~> 3.0)
rubyzip (~> 1.0)
- rspec (3.2.0)
- rspec-core (~> 3.2.0)
- rspec-expectations (~> 3.2.0)
- rspec-mocks (~> 3.2.0)
- rspec-core (3.2.3)
- rspec-support (~> 3.2.0)
- rspec-expectations (3.2.1)
+ rspec-core (3.5.4)
+ rspec-support (~> 3.5.0)
+ rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.2.0)
- rspec-mocks (3.2.1)
+ rspec-support (~> 3.5.0)
+ rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.2.0)
- rspec-rails (3.2.1)
- actionpack (>= 3.0, < 4.3)
- activesupport (>= 3.0, < 4.3)
- railties (>= 3.0, < 4.3)
- rspec-core (~> 3.2.0)
- rspec-expectations (~> 3.2.0)
- rspec-mocks (~> 3.2.0)
- rspec-support (~> 3.2.0)
- rspec-support (3.2.2)
- rubocop (0.30.1)
- astrolabe (~> 1.3)
- parser (>= 2.2.2.1, < 3.0)
+ rspec-support (~> 3.5.0)
+ rspec-rails (3.5.2)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec-core (~> 3.5.0)
+ rspec-expectations (~> 3.5.0)
+ rspec-mocks (~> 3.5.0)
+ rspec-support (~> 3.5.0)
+ rspec-support (3.5.0)
+ rubocop (0.46.0)
+ parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
- ruby-progressbar (~> 1.4)
- rubocop-checkstyle_formatter (0.2.0)
- rubocop (>= 0.20.1)
- rubocop-rspec (1.3.0)
- ruby-progressbar (1.7.5)
- ruby2ruby (2.1.4)
- ruby_parser (~> 3.1)
- sexp_processor (~> 4.0)
- ruby_parser (3.7.0)
+ ruby-progressbar (~> 1.7)
+ unicode-display_width (~> 1.0, >= 1.0.1)
+ rubocop-checkstyle_formatter (0.3.0)
+ rubocop (>= 0.30.1)
+ rubocop-rspec (1.8.0)
+ rubocop (>= 0.42.0)
+ ruby-progressbar (1.8.1)
+ ruby_dep (1.5.0)
+ ruby_parser (3.8.3)
sexp_processor (~> 4.1)
rubyzip (1.0.0)
safe_yaml (1.0.4)
@@ -494,75 +526,68 @@ GEM
scenic (1.3.0)
activerecord (>= 4.0.0)
railties (>= 4.0.0)
- sdoc (0.4.1)
+ sdoc (0.4.2)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
securecompare (1.0.0)
- selenium-webdriver (2.44.0)
+ selenium-webdriver (3.0.3)
childprocess (~> 0.5)
- multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0)
- sentry-raven (0.13.1)
- faraday (>= 0.7.6)
- sexp_processor (4.6.0)
- shoulda-matchers (2.8.0)
- activesupport (>= 3.0.0)
- simplecov (0.9.1)
+ sentry-raven (2.2.0)
+ faraday (>= 0.7.6, < 1.0)
+ sexp_processor (4.7.0)
+ shellany (0.0.1)
+ shoulda-matchers (3.1.1)
+ activesupport (>= 4.0.0)
+ simplecov (0.12.0)
docile (~> 1.1.0)
- multi_json (~> 1.0)
- simplecov-html (~> 0.8.0)
- simplecov-html (0.8.0)
- slim (3.0.6)
- temple (~> 0.7.3)
- tilt (>= 1.3.3, < 2.1)
+ json (>= 1.8, < 3)
+ simplecov-html (~> 0.10.0)
+ simplecov-html (0.10.0)
slop (3.6.0)
- smart_listing (1.1.2)
+ smart_listing (1.2.0)
coffee-rails
jquery-rails
- kaminari (~> 0.16.1)
+ kaminari (~> 0.17)
rails (>= 3.2)
- spreadsheet_architect (1.4.7)
+ spreadsheet_architect (1.4.8)
axlsx (>= 2.0)
- rodf (>= 0.3.6)
- spring (1.3.6)
- spring-commands-rspec (1.0.4)
- spring (>= 0.9.1)
+ rodf (= 0.3.7)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
- sprockets-rails (3.1.1)
+ sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
- swd (1.0.0)
+ swd (1.0.1)
activesupport (>= 3)
attr_required (>= 0.0.5)
httpclient (>= 2.4)
i18n
json (>= 1.4.3)
- temple (0.7.6)
- terminal-table (1.5.2)
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
- thor (0.19.1)
+ thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.5)
- timecop (0.7.3)
+ timecop (0.8.1)
trollop (2.1.2)
turbolinks (2.5.3)
coffee-rails
tzinfo (1.2.2)
thread_safe (~> 0.1)
- uglifier (3.0.2)
+ uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
- unf_ext (0.0.7.1)
- unicorn (4.9.0)
+ unf_ext (0.0.7.2)
+ unicode-display_width (1.1.2)
+ unicode_utils (1.4.0)
+ unicorn (5.2.0)
kgio (~> 2.6)
- rack
raindrops (~> 0.7)
url_safe_base64 (0.2.2)
validate_email (0.1.6)
@@ -571,26 +596,27 @@ GEM
validate_url (1.0.2)
activemodel (>= 3.0.0)
addressable
- vcr (3.0.1)
+ vcr (3.0.3)
warden (1.2.6)
rack (>= 1.0)
- web-console (2.2.1)
- activemodel (>= 4.0)
- binding_of_caller (>= 0.7.2)
- railties (>= 4.0)
- sprockets-rails (>= 2.0, < 4.0)
- webfinger (1.0.1)
+ web-console (3.4.0)
+ actionview (>= 5.0)
+ activemodel (>= 5.0)
+ debug_inspector
+ railties (>= 5.0)
+ webfinger (1.0.2)
activesupport
httpclient (>= 2.4)
multi_json
- webmock (1.21.0)
+ webmock (2.3.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
- websocket (1.2.1)
- websocket-driver (0.5.3)
+ hashdiff
+ websocket (1.2.3)
+ websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
- will_paginate (3.0.7)
+ will_paginate (3.1.5)
will_paginate-bootstrap (1.0.1)
will_paginate (>= 3.0.3)
xml-simple (1.1.5)
@@ -601,8 +627,9 @@ PLATFORMS
ruby
DEPENDENCIES
+ actioncable (= 5.0.0.1)
active_model_serializers
- apipie-rails (= 0.3.1)
+ apipie-rails
as_csv
bootstrap-datepicker-rails
bootstrap-sass (~> 3.3.5)
@@ -614,19 +641,21 @@ DEPENDENCIES
carrierwave
chartkick
clamav-client
- coffee-rails (~> 4.1.0)
database_cleaner
deep_cloneable (~> 2.2.1)
- devise (~> 3.0)
- draper
+ devise
+ draper (~> 3.0.0.pre1)
factory_girl
fog
fog-openstack
font-awesome-rails
+ guard
+ guard-livereload (~> 2.4)
haml-rails
hashie
jbuilder (~> 2.0)
jquery-rails
+ launchy
leaflet-draw-rails
leaflet-markercluster-rails (~> 0.7.0)
leaflet-rails
@@ -634,15 +663,17 @@ DEPENDENCIES
mailjet
maruku
mina!
- nyan-cat-formatter
openid_connect
openstack
- parallel_tests (~> 1.9.0)
+ parallel_tests (~> 2.10)
pg
poltergeist
pry-byebug
+ rack-handlers
railroady
- rails (= 4.2.7.1)
+ rails (= 5.0.0.1)
+ rails-controller-testing
+ redis
rest-client
rgeo-geojson
rspec-rails (~> 3.0)
@@ -658,15 +689,14 @@ DEPENDENCIES
simplecov
smart_listing
spreadsheet_architect
- spring
- spring-commands-rspec
therubyracer
timecop
- turbolinks
+ turbolinks (~> 2.5)
uglifier (>= 1.3.0)
+ unicode_utils
unicorn
vcr
- web-console (~> 2.0)
+ web-console
webmock
will_paginate-bootstrap
diff --git a/Guardfile b/Guardfile
index 2c60c7b22..a937e06b8 100644
--- a/Guardfile
+++ b/Guardfile
@@ -43,7 +43,7 @@ guard 'livereload' do
rails_view_exts = %w(erb haml slim)
# file types LiveReload may optimize refresh for
- compiled_exts = extensions.values.uniq
+ compiled_exts = extensions.values
watch(%r{public/.+\.(#{compiled_exts * '|'})})
extensions.each do |ext, type|
@@ -64,24 +64,24 @@ guard 'livereload' do
watch(%r{config/locales/.+\.yml})
end
-guard :rspec, cmd: 'bin/rspec' do
- watch(%r{^spec/.+_spec\.rb$})
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
- watch('spec/spec_helper.rb') { "spec" }
-
- # Rails example
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
- watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
- watch('config/routes.rb') { "spec/routing" }
- watch('app/controllers/application_controller.rb') { "spec/controllers" }
- watch('spec/rails_helper.rb') { "spec" }
-
- # Capybara features specs
- watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
-
- # Turnip features and steps
- watch(%r{^spec/acceptance/(.+)\.feature$})
- watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
-end
+# guard :rspec, cmd: 'bin/rspec' do
+# watch(%r{^spec/.+_spec\.rb$})
+# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+# watch('spec/spec_helper.rb') { "spec" }
+#
+# # Rails example
+# watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+# watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+# watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+# watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+# watch('config/routes.rb') { "spec/routing" }
+# watch('app/controllers/application_controller.rb') { "spec/controllers" }
+# watch('spec/rails_helper.rb') { "spec" }
+#
+# # Capybara features specs
+# watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
+#
+# # Turnip features and steps
+# watch(%r{^spec/acceptance/(.+)\.feature$})
+# watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
+# end
diff --git a/README.md b/README.md
index a695d90ed..02886312a 100644
--- a/README.md
+++ b/README.md
@@ -7,8 +7,8 @@ TéléProcédure Simplifiée, ou TPS pour les intimes, est une plateforme 100% w
## Technologies utilisées
-Ruby : 2.1.5
-Rails : 4.2.0
+Ruby : 2.3.1
+Rails : 5.0.0.1
## Initialisation de l'environnement de développement
diff --git a/app/assets/images/etapes/complet_2.png b/app/assets/images/etapes/complet_2.png
new file mode 100644
index 000000000..90c8241f4
Binary files /dev/null and b/app/assets/images/etapes/complet_2.png differ
diff --git a/app/assets/images/etapes/create_1.png b/app/assets/images/etapes/create_1.png
new file mode 100644
index 000000000..1a37f8c11
Binary files /dev/null and b/app/assets/images/etapes/create_1.png differ
diff --git a/app/assets/images/etapes/message_3.png b/app/assets/images/etapes/message_3.png
new file mode 100644
index 000000000..facf08a69
Binary files /dev/null and b/app/assets/images/etapes/message_3.png differ
diff --git a/app/assets/images/etapes/shared_4.png b/app/assets/images/etapes/shared_4.png
new file mode 100644
index 000000000..90ce51dd3
Binary files /dev/null and b/app/assets/images/etapes/shared_4.png differ
diff --git a/app/assets/images/keywords/documentation.png b/app/assets/images/keywords/documentation.png
deleted file mode 100644
index cfebd1a93..000000000
Binary files a/app/assets/images/keywords/documentation.png and /dev/null differ
diff --git a/app/assets/images/keywords/echanger.png b/app/assets/images/keywords/echanger.png
deleted file mode 100644
index cf517db40..000000000
Binary files a/app/assets/images/keywords/echanger.png and /dev/null differ
diff --git a/app/assets/images/keywords/faciliter.png b/app/assets/images/keywords/faciliter.png
deleted file mode 100644
index 020ba4339..000000000
Binary files a/app/assets/images/keywords/faciliter.png and /dev/null differ
diff --git a/app/assets/images/keywords/profiter.png b/app/assets/images/keywords/profiter.png
deleted file mode 100644
index 0e1f016ba..000000000
Binary files a/app/assets/images/keywords/profiter.png and /dev/null differ
diff --git a/app/assets/images/keywords/securiser.png b/app/assets/images/keywords/securiser.png
deleted file mode 100644
index d49f08029..000000000
Binary files a/app/assets/images/keywords/securiser.png and /dev/null differ
diff --git a/app/assets/images/keywords/simplifier.png b/app/assets/images/keywords/simplifier.png
deleted file mode 100644
index 29ada7ff2..000000000
Binary files a/app/assets/images/keywords/simplifier.png and /dev/null differ
diff --git a/app/assets/images/landing_background.png b/app/assets/images/landing_background.png
index 1d67e71a1..a043859f7 100644
Binary files a/app/assets/images/landing_background.png and b/app/assets/images/landing_background.png differ
diff --git a/app/assets/images/landing_background_old.png b/app/assets/images/landing_background_old.png
new file mode 100644
index 000000000..1d67e71a1
Binary files /dev/null and b/app/assets/images/landing_background_old.png differ
diff --git a/app/assets/images/logos/logo-tps.png b/app/assets/images/logos/logo-tps.png
index af81e35a9..b667980eb 100644
Binary files a/app/assets/images/logos/logo-tps.png and b/app/assets/images/logos/logo-tps.png differ
diff --git a/app/assets/images/logos/logo-tps_old.png b/app/assets/images/logos/logo-tps_old.png
new file mode 100644
index 000000000..af81e35a9
Binary files /dev/null and b/app/assets/images/logos/logo-tps_old.png differ
diff --git a/app/assets/images/marianne_small.png b/app/assets/images/marianne_small.png
index 6ef0b3b39..886b05bf7 100644
Binary files a/app/assets/images/marianne_small.png and b/app/assets/images/marianne_small.png differ
diff --git a/app/assets/javascripts/action_btn_rules.js b/app/assets/javascripts/action_btn_rules.js
new file mode 100644
index 000000000..7202d53b6
--- /dev/null
+++ b/app/assets/javascripts/action_btn_rules.js
@@ -0,0 +1,13 @@
+$(document).on('page:load', init_action_btn_rules);
+$(document).ready(init_action_btn_rules);
+
+function init_action_btn_rules() {
+ $('.btn-send').click(function () {
+ $(this).addClass("disabled");
+ this.addEventListener("click", lock_btn);
+ });
+
+ function lock_btn(event) {
+ event.preventDefault();
+ }
+}
diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js
index 571e93b65..6c2e63536 100644
--- a/app/assets/javascripts/admin.js
+++ b/app/assets/javascripts/admin.js
@@ -41,4 +41,4 @@ function on_change_type_de_champ_select (){
}
})
-}
\ No newline at end of file
+}
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index e9049908b..567658f93 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -50,7 +50,7 @@ function scroll_to() {
$('.js-scrollTo').on('click', function () { // Au clic sur un élément
var page = $(this).attr('cible'); // Page cible
var speed = 600; // Durée de l'animation (en ms)
- $('html, body').animate({scrollTop: $(page).offset().top - 100}, speed); // Go
+ $('html, body').animate({scrollTop: $(page).offset().top - 200}, speed); // Go
return false;
});
}
diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js
new file mode 100644
index 000000000..daa54bbb2
--- /dev/null
+++ b/app/assets/javascripts/cable.js
@@ -0,0 +1,13 @@
+// Action Cable provides the framework to deal with WebSockets in Rails.
+// You can generate new channels where WebSocket features live using the rails generate channel command.
+//
+//= require action_cable
+//= require_self
+//= require_tree ./channels
+
+//(function() {
+// this.App || (this.App = {});
+//
+// App.cable = ActionCable.createConsumer();
+//
+//}).call(this);
diff --git a/app/assets/javascripts/cgu.js b/app/assets/javascripts/cgu.js
new file mode 100644
index 000000000..b0008d676
--- /dev/null
+++ b/app/assets/javascripts/cgu.js
@@ -0,0 +1,9 @@
+$(document).on('page:load', buttons_anchor);
+$(document).ready(buttons_anchor);
+
+function buttons_anchor(){
+ $("#cgu_menu_block").on('click', 'a', function(){
+ event.preventDefault();
+ $('html,body').animate({scrollTop:$(this.hash).offset().top-80}, 500);
+ });
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/channels/notifications.js b/app/assets/javascripts/channels/notifications.js
new file mode 100644
index 000000000..4445c9110
--- /dev/null
+++ b/app/assets/javascripts/channels/notifications.js
@@ -0,0 +1,23 @@
+//App.messages = App.cable.subscriptions.create('NotificationsChannel', {
+// received: function (data) {
+// if (window.location.href.indexOf('backoffice') !== -1) {
+// $("#notification_alert").html(data['message']);
+//
+// slideIn_notification_alert();
+// }
+// }
+//});
+
+function slideIn_notification_alert (){
+ $("#notification_alert").animate({
+ right: '20px'
+ }, 250);
+
+ setTimeout(slideOut_notification_alert, 3500);
+}
+
+function slideOut_notification_alert (){
+ $("#notification_alert").animate({
+ right: '-250px'
+ }, 200);
+}
\ No newline at end of file
diff --git a/app/assets/javascripts/default_data_block.js b/app/assets/javascripts/default_data_block.js
new file mode 100644
index 000000000..1ff875ddf
--- /dev/null
+++ b/app/assets/javascripts/default_data_block.js
@@ -0,0 +1,34 @@
+$(document).on('page:load', init_default_data_block);
+$(document).ready(init_default_data_block);
+
+function init_default_data_block() {
+ $('.default_data_block #dossier .body').toggle();
+ $('.default_data_block #dossier .carret-right').toggle();
+ $('.default_data_block #dossier .carret-down').toggle();
+
+ $('.default_data_block .title').click(function () {
+ toggle_default_data_bloc(this, 400);
+ });
+
+ $('.new-action').click(function () {
+ var messages_block = $(this).parents().closest('.default_data_block').find('.title')
+ toggle_default_data_bloc(messages_block, 400);
+ });
+
+ $('.default_data_block.default_visible').each(function() {
+ toggle_default_data_bloc($(this).find('.title'), 0);
+ });
+
+ function toggle_default_data_bloc(element, duration) {
+ var block = $(element).parents('.show-block');
+ if (block.attr('id') == 'messages') {
+ block.children('.last-commentaire').toggle();
+ $(".commentaires").animate({ scrollTop: $(this).height() }, "slow");
+ }
+
+ block.children('.body').slideToggle(duration);
+
+ block.find('.carret-right').toggle();
+ block.find('.carret-down').toggle();
+ }
+}
diff --git a/app/assets/javascripts/description.js b/app/assets/javascripts/description.js
index cb66f0adf..24a9e7e56 100644
--- a/app/assets/javascripts/description.js
+++ b/app/assets/javascripts/description.js
@@ -27,7 +27,6 @@ function action_type_de_champs() {
});
address_type_init();
- toggle_header_section_composents();
}
function toggleErrorClass(node, boolean) {
@@ -55,21 +54,3 @@ function validateNumber(number) {
function validateInput(input, regex) {
return regex.test(input);
}
-
-function toggle_header_section_composents() {
- $("a.mask_section_button").on('click', function (e) {
- target = e.currentTarget;
-
- header_section_id = target.id.split('mask_button_')[1];
- header_section_composents = $(".header_section_" + header_section_id);
-
- header_section_composents.slideToggle(200, function () {
- if (header_section_composents.css('display') == 'none') {
- $(target).html('Afficher la section ')
- }
- else {
- $(target).html('Masquer la section ')
- }
- });
- });
-}
diff --git a/app/assets/javascripts/dossier_commentaires_modal.js b/app/assets/javascripts/dossier_commentaires_modal.js
index 1b697bd4e..ee6610c89 100644
--- a/app/assets/javascripts/dossier_commentaires_modal.js
+++ b/app/assets/javascripts/dossier_commentaires_modal.js
@@ -13,4 +13,4 @@ function init_modal_commentaire() {
$("#modalCommentairesDossierParChamp").on("hidden.bs.modal", function (e) {
body.html(originalBody);
});
-}
\ No newline at end of file
+}
diff --git a/app/assets/javascripts/dossiers.js b/app/assets/javascripts/dossiers.js
index e65a0da9e..c294b6c16 100644
--- a/app/assets/javascripts/dossiers.js
+++ b/app/assets/javascripts/dossiers.js
@@ -1,19 +1,36 @@
$(document).on('page:load', the_terms);
$(document).ready(the_terms);
+$(document).on('page:load', pannel_switch);
+$(document).ready(pannel_switch);
+
+function pannel_switch() {
+ $('#switch-notifications').click(function () {
+ $('#procedure_list').addClass('hidden');
+ $('#notifications_list').removeClass('hidden');
+ $(this).addClass('active');
+ $('#switch-procedures').removeClass('active');
+ })
+ $('#switch-procedures').click(function () {
+ $('#notifications_list').addClass('hidden');
+ $('#procedure_list').removeClass('hidden');
+ $(this).addClass('active');
+ $('#switch-notifications').removeClass('active');
+ })
+}
function the_terms() {
var the_terms = $("#dossier_autorisation_donnees");
- if(the_terms.size() == 0)
+ if (the_terms.size() == 0)
return;
- check_value (the_terms);
+ check_value(the_terms);
the_terms.click(function () {
- check_value (the_terms);
+ check_value(the_terms);
});
- function check_value (the_terms){
+ function check_value(the_terms) {
if (the_terms.is(":checked")) {
$("#etape_suivante").removeAttr("disabled");
} else {
@@ -22,8 +39,8 @@ function the_terms() {
}
}
-function error_form_siret(invalid_siret){
- setTimeout(function(){
+function error_form_siret(invalid_siret) {
+ setTimeout(function () {
$("input[type='submit']").val('Erreur SIRET');
}, 10);
@@ -33,12 +50,12 @@ function error_form_siret(invalid_siret){
}
-function reset_form_siret(){
+function reset_form_siret() {
$("input[type='submit']").removeClass('btn-danger').addClass('btn-success').val('Valider');
$("#dossier_siret").removeClass('input-error');
}
-function toggle_etape_1(){
+function toggle_etape_1() {
$('.row.etape.etape_1 .etapes_menu #logos').toggle(100);
$('.row.etape.etape_1 .etapes_informations #description_procedure').toggle(100);
-}
\ No newline at end of file
+}
diff --git a/app/assets/javascripts/dossiers_list_filter.js b/app/assets/javascripts/dossiers_list_filter.js
index 3a50fc6a5..389eb6199 100644
--- a/app/assets/javascripts/dossiers_list_filter.js
+++ b/app/assets/javascripts/dossiers_list_filter.js
@@ -1,7 +1,6 @@
$(document).on('page:load', filters_init);
$(document).ready(filters_init);
-
function filters_init() {
$('html').click(function(event) {
var visible_filter = $('.filter_framed:visible')
@@ -11,11 +10,13 @@ function filters_init() {
}
}
});
+
$(".filter").on('click', function (event) {
filter_framed_show(event);
filter_framed_close_all_excepted(framed_id(event));
event.stopPropagation();
});
+
$(".erase-filter").on('click', function (event) {
$(this).parent().find(".filter_input").val("");
});
@@ -34,6 +35,11 @@ function framed_id(event) {
function filter_framed_show(event) {
dom_object = $(framed_id(event));
- dom_object.css('top', (event.pageY + 7) + 'px');
- dom_object.css('left', (event.pageX + 7) + 'px');
+ var offset = $('#main-container').offset();
+
+ var y = event.pageY - offset.top;
+ var x = event.pageX - offset.left;
+
+ dom_object.css('top', (y + 7) + 'px');
+ dom_object.css('left', (x + 7) + 'px');
}
diff --git a/app/assets/javascripts/dossiers_list_link.js b/app/assets/javascripts/dossiers_list_link.js
index 1764dd571..09fb31542 100644
--- a/app/assets/javascripts/dossiers_list_link.js
+++ b/app/assets/javascripts/dossiers_list_link.js
@@ -1,9 +1,8 @@
$(document).on('page:load', link_init);
$(document).ready(link_init);
-
function link_init() {
- $('#dossiers_list tr').on('click', function () {
- $(location).attr('href', $(this).data('dossier_url'))
- });
-}
\ No newline at end of file
+ $('#dossiers_list tr').on('click', function () {
+ $(location).attr('href', $(this).data('dossier_url'))
+ });
+}
diff --git a/app/assets/javascripts/gestionnaire_dossier_modal.js b/app/assets/javascripts/gestionnaire_dossier_modal.js
index 4727189a6..2632ab407 100644
--- a/app/assets/javascripts/gestionnaire_dossier_modal.js
+++ b/app/assets/javascripts/gestionnaire_dossier_modal.js
@@ -13,4 +13,4 @@ function modal_action() {
modal.find('#PJmodal_title').html(modal_title);
$("#PJmodal .modal-body .table #"+modal_index).show();
})
-}
\ No newline at end of file
+}
diff --git a/app/assets/javascripts/landing.js b/app/assets/javascripts/landing.js
deleted file mode 100644
index 7c519c0f0..000000000
--- a/app/assets/javascripts/landing.js
+++ /dev/null
@@ -1,17 +0,0 @@
-$(document).on('page:load', all_video);
-$(document).ready(all_video);
-
-function all_video() {
- $(".all_video").on('click', function(event){
- $("#all_video").slideToggle(200);
-
- if (event.stopPropagation) {
- event.stopPropagation();
- }
- event.cancelBubble = true;
-
- return false;
- });
-}
-
-
diff --git a/app/assets/javascripts/search.js b/app/assets/javascripts/search.js
new file mode 100644
index 000000000..689f65f37
--- /dev/null
+++ b/app/assets/javascripts/search.js
@@ -0,0 +1,60 @@
+$(document).on('page:load', init_search_anim);
+$(document).ready(init_search_anim);
+
+function init_search_anim(){
+ $("#search_area").on('click', search_fadeIn);
+}
+
+function search_fadeIn(){
+ var search_area = $("#search_area");
+ var body_dom = $('body');
+ var positions = search_area.position();
+ var width = search_area.width();
+
+ search_area.css('position', 'fixed');
+ search_area.css('top', positions.top + $('.navbar').height());
+ search_area.css('left', positions.left);
+ search_area.css('z-index', 300);
+ search_area.css('width', width);
+ search_area.find('#q').animate({ height: '50px' });
+ search_area.find('#search_button').animate({ height: '50px' });
+
+ body_dom.append(search_area);
+ $('#mask_search').fadeIn(200);
+
+ var body_width = body_dom.width();
+
+ var search_area_width = body_width/2.5;
+
+ search_area.animate({
+ width: search_area_width,
+ left: (body_width/2 - search_area_width/2 + 40)
+ }, 400, function() {
+ search_area.off();
+ $("#search_area input").focus();
+
+ $('#mask_search').on('click', search_fadeOut)
+ });
+}
+
+function search_fadeOut(){
+ var search_area = $("#search_area");
+
+ $('#mask_search').fadeOut(200);
+
+ search_area.fadeOut(200, function(){
+ search_area.css('position', 'static');
+ search_area.css('top', '');
+ search_area.css('left', '');
+ search_area.css('z-index', '');
+ search_area.css('width', 'auto');
+ search_area.find('#q').css('height', 34);
+ search_area.find('#search_button').css('height', 34);
+
+ $('#search-block').append(search_area);
+ search_area.fadeIn(200);
+
+ init_search_anim();
+ });
+
+}
diff --git a/app/assets/stylesheets/admin_index.scss b/app/assets/stylesheets/admin_index.scss
index c3590cc4d..3c8e9eb11 100644
--- a/app/assets/stylesheets/admin_index.scss
+++ b/app/assets/stylesheets/admin_index.scss
@@ -1,17 +1,23 @@
-.table {
- #id {
- width: 5%;
- }
+#admin_index{
+ margin-left: 2em;
+ margin-right: 2em;
- #libelle {
- width: 40%;
- }
+ .table {
+ #id {
+ width: 5%;
+ }
- #organisation {
- width: 28%;
- }
+ #libelle {
+ width: 40%;
+ }
- #direction {
- width: 22%;
+ #organisation {
+ width: 28%;
+ }
+
+ #direction {
+ width: 22%;
+ }
}
-}
\ No newline at end of file
+}
+
diff --git a/app/assets/stylesheets/admin_type_de_champ.scss b/app/assets/stylesheets/admin_type_de_champ.scss
index 71747f829..e4a9b92e9 100644
--- a/app/assets/stylesheets/admin_type_de_champ.scss
+++ b/app/assets/stylesheets/admin_type_de_champ.scss
@@ -1,5 +1,5 @@
.header_section{
- background-color: rgb(245,245,245);
+ background-color: rgb(0, 49, 137);
margin-top: 20px;
margin-bottom: 10px;
margin-left: 0;
@@ -7,6 +7,12 @@
text-align:center;
padding-bottom: 8px;
+ color: white;
+
+ .form-control.libelle {
+ font-weight: bold;
+ }
+
.form-group.description {
display: none;
}
diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss
index 1e7eba0fc..58f55fa66 100644
--- a/app/assets/stylesheets/application.scss
+++ b/app/assets/stylesheets/application.scss
@@ -24,7 +24,7 @@
@import "bootstrap";
body {
- background-color: rgb(255, 255, 255);
+ background-color: #F2F6FA;
}
html, body {
@@ -32,16 +32,22 @@ html, body {
}
body {
- padding-top: 50px;
+ padding-top: 60px;
+}
+
+form {
+ margin-bottom: 0.3em;
}
.wysihtml5-sandbox {
resize: vertical;
+ width: 100% !important;
}
#wrap {
min-height: 100%;
margin-bottom: -50px;
+ overflow: hidden;
}
#wrap:after {
@@ -50,47 +56,23 @@ body {
}
#footer, #wrap:after {
- height: 40px;
+ height: 50px;
}
#footer {
- background-color: rgb(240, 240, 240)
-}
-
-.main_div {
- margin-left: 10rem;
- margin-right: 10rem;
-}
-
-.logo {
- margin-left: 10px;
- padding-top: 5px;
- padding-bottom: 5px;
- max-height: 100%;
-}
-
-.logo_navbar {
- margin-left: 10px;
- padding-top: 5px;
- padding-bottom: 5px;
- max-height: 100%;
-}
-
-#beta {
+ background-color: #F2F6FA;
text-align: center;
- text-transform: uppercase;
- position: absolute;
- top: 26px;
- right: -35px;
- -webkit-transform: rotate(45deg);
- transform: rotate(45deg);
- width: 150px;
- background-color: #008cba;
- color: #fff;
- padding: 5px;
- font-size: 15px;
- font-weight: 700;
- z-index: 10;
+ padding: 0;
+ a, p {
+ color: #000000;
+ }
+ a:hover {
+ color: #000000;
+ }
+ p {
+ line-height: 40px;
+ padding: 0;
+ }
}
.beta_staging {
@@ -104,34 +86,6 @@ body {
transform: translate(-50%, -50%);
}
-#sign_out {
- decorate: none;
- box-shadow: none;
- float: right;
- margin-top: 8px;
- margin-right: 105px;
-}
-
-#header {
- top: 0;
- left: -3px;
- position: fixed;
- width: 100%;
- z-index: 10;
-
-}
-
-.navbar {
- height: 35px;
- background-color: rgba(235, 235, 235, 0.95);
-
- .sign_in_FC {
- margin-top: -18px;
- height: 70px;
- }
-
-}
-
.text-purple {
color: #8B008B
}
@@ -224,31 +178,6 @@ div.pagination {
}
}
-.btn-nav {
- background-color: transparent;
- margin-top: 6px;
- height: 36px;
-}
-
-.btn-nav:hover {
- background-color: #eeeeee;
- border-color: #eeeeee #eeeeee #ddd;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-.btn-nav.text-info:hover {
- color: #23527c;
-}
-
-.btn-nav.text-success:hover {
- color: #3c763d;
-}
-
-.btn-nav.text-danger:hover {
- color: #a94442;
-}
-
#confirm {
display: none;
}
@@ -291,3 +220,11 @@ div.pagination {
}
}
+
+.no-padding {
+ padding: 0;
+}
+
+.no-margin {
+ margin: 0;
+}
diff --git a/app/assets/stylesheets/application_split2.css b/app/assets/stylesheets/application_split2.css
deleted file mode 100644
index 07566dff4..000000000
--- a/app/assets/stylesheets/application_split2.css
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- *= require 'application'
-*/
\ No newline at end of file
diff --git a/app/assets/stylesheets/backoffice.scss b/app/assets/stylesheets/backoffice.scss
index b447e2a5e..4956cfeb4 100644
--- a/app/assets/stylesheets/backoffice.scss
+++ b/app/assets/stylesheets/backoffice.scss
@@ -1,17 +1,24 @@
-#backoffice_search {
- .table {
- tr th {
- border-top: none
+#backoffice_index, #backoffice_search {
+ margin-left: 2rem;
+ margin-right: 2rem;
+
+ .default_data_block {
+ background-color: #FFFFFF;
+ margin-top: 20px;
+ .show-block {
+ width: 100%;
}
+ .body {
+ height: auto;
+ }
+ }
+ .fixed-right {
+ position: fixed;
+ right: 20px;
}
}
-#backoffice_index, #backoffice_search {
- margin-left: -7rem;
- margin-right: -7rem;
-}
-
-#pref_list{
+#pref_list {
.dropdown-menu {
padding: 10px;
width: 500px;
@@ -46,4 +53,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/app/assets/stylesheets/cgu.scss b/app/assets/stylesheets/cgu.scss
new file mode 100644
index 000000000..5053eaa4b
--- /dev/null
+++ b/app/assets/stylesheets/cgu.scss
@@ -0,0 +1,4 @@
+#cgu {
+ margin-left: 2em;
+ margin-right: 2em;
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/default_data_block.scss b/app/assets/stylesheets/default_data_block.scss
new file mode 100644
index 000000000..adc1ad053
--- /dev/null
+++ b/app/assets/stylesheets/default_data_block.scss
@@ -0,0 +1,69 @@
+.default_data_block {
+ font-family: Arial;
+
+ .show-block {
+ width: 840px;
+ min-width: 840px;
+ margin-left: auto;
+ margin-right: auto;
+ box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5);
+ margin-bottom: 40px;
+ }
+ .carret-right {
+ float: left;
+ width: 0;
+ height: 0;
+ border-top: 7px solid transparent;
+ border-bottom: 7px solid transparent;
+ border-left: 14px solid #FFFFFF;
+ margin: 12px 12px 0 15px;
+ }
+ .carret-down {
+ float: left;
+ width: 0;
+ height: 0;
+ display: none;
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ border-top: 14px solid #FFFFFF;
+ margin: 12px 12px 0 15px;
+ }
+ .header {
+ background-color: #003C92;
+ height: 40px;
+ color: #FFFFFF;
+ font-size: 18px;
+ font-weight: bold;
+ .title, .title-no-expanse, .action, .count {
+ height: 100%;
+ line-height: 40px;
+ padding: 0px;
+ text-transform: uppercase;
+ }
+ .title-no-expanse {
+ cursor: not-allowed;
+ }
+ .title, .action, .count {
+ cursor: pointer;
+ }
+ .action {
+ background-color: #E45B51;
+ text-align: center;
+ line-height: 40px;
+ font-size: 15px;
+ text-decoration: none;
+ color: #FFFFFF;
+ }
+ .action:hover {
+ color: #F2F6FA;
+ }
+ .count {
+ font-size: 16px;
+ text-align: center;
+ }
+ }
+ .body {
+ background-color: #FFFFFF;
+ display: none;
+ }
+}
diff --git a/app/assets/stylesheets/description.scss b/app/assets/stylesheets/description.scss
index 54ea06cfa..dc24f6646 100644
--- a/app/assets/stylesheets/description.scss
+++ b/app/assets/stylesheets/description.scss
@@ -2,8 +2,21 @@
@import "bootstrap-datepicker3";
#description_page #liste_champs {
+
+ .default_data_block {
+ .show-block {
+ width: 90%;
+ .body{
+ padding-left: 35px;
+ padding-right: 35px;
+ padding-bottom: 35px;
+ }
+ }
+ }
+
h4 {
- margin-top: 35px;
+ padding-top: 35px;
+ margin: 0;
}
}
@@ -28,8 +41,6 @@
.type_champ-header_section {
@extend .col-md-12;
@extend .col-lg-12;
-
- margin-bottom: -25px;
}
.type_champ-address {
diff --git a/app/assets/stylesheets/dossier_show.scss b/app/assets/stylesheets/dossier_show.scss
new file mode 100644
index 000000000..3d9c6ba98
--- /dev/null
+++ b/app/assets/stylesheets/dossier_show.scss
@@ -0,0 +1,196 @@
+#backoffice_dossier_show, #users_recapitulatif_dossier_show {
+
+ #messages {
+ .last-commentaire {
+ display: block;
+ background-color: #FFFFFF;
+ .content, .new-action {
+ margin-bottom: 20px;
+ }
+ }
+ .body {
+ .commentaires {
+ max-height: 350px;
+ overflow-y: scroll;
+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.075) 0%, rgba(219, 219, 219, 0) 50%, rgba(250, 251, 253, 0.18) 51%, #ffffff 100%);
+ }
+ .no-commentaires {
+ text-align: center;
+ font-size: 18px;
+ padding-top: 20px;
+ }
+ }
+ .last-commentaire, .commentaire {
+ padding: 20px 0 0 20px;
+ .comment-header {
+ font-family: Arial;
+ font-size: 14px;
+ font-weight: bold;
+ line-height: 16px;
+ color: #000000;
+ margin-bottom: 10px;
+ }
+ .new-action {
+ background-color: #E45B51;
+ text-align: center;
+ cursor: pointer;
+ color: #FFFFFF;
+ width: 253px;
+ height: 40px;
+ line-height: 40px;
+ font-family: Arial;
+ font-size: 16px;
+ font-weight: bold;
+ }
+ .file {
+ padding-right: 70px;
+ text-align: center;
+ margin-bottom: 20px;
+ .link {
+ span {
+ width: 100%;
+ font-size: 40px;
+ }
+ }
+ }
+ }
+ .split-hr {
+ margin: 20px 20px 0 20px;
+ border-bottom: 1px solid #979797;
+ }
+ #new-commentaire {
+ padding: 35px;
+ .btn-send {
+ background-color: #E45B51;
+ text-align: center;
+ color: #FFFFFF;
+ width: 150px;
+ height: 40px;
+ line-height: 28px;
+ font-family: Arial;
+ font-size: 16px;
+ font-weight: bold;
+ float: right;
+ border-radius: 0;
+ }
+ }
+ }
+ .infos {
+ .split-row {
+ margin: 0 0 20px 0;
+ }
+ .entreprise-info {
+ font-size: 14px;
+ }
+ .entreprise-label {
+ font-weight: bold;
+ text-align: end;
+ }
+ }
+ #carto {
+ }
+ #private-fields {
+ .text-primary {
+ color: #337ab7;
+ }
+ }
+ #pieces-jointes {
+ .piece-row {
+ margin: 20px;
+ .piece-label {
+ text-align: right;
+ font-weight: bold;
+ }
+ }
+ .modal-title {
+ color: #000000;
+ }
+ }
+
+ #carto {
+ #map {
+ margin-bottom: 20px;
+ height: 350px;
+ }
+ }
+
+ #dossier, #pieces-jointes, .infos, #carto, #private-fields {
+ .body {
+ padding: 20px 20px 0 20px;
+ color: #000000;
+ .libelle-procedure {
+ font-style: italic;
+ padding: 10px;
+ }
+ .depositaire-label {
+ font-weight: bold;
+ text-align: end;
+ }
+ .depositaire-info {
+ }
+ .btn-action{
+ border: none;
+ margin: 20px 0 40px 0;
+ }
+ .btn-action:hover {
+ color: #EEEEEE;
+ }
+ .action {
+ margin: 50px 0 0 15px;
+ }
+ .action, .btn-action {
+ background-color: #E45B51;
+ text-align: center;
+ cursor: pointer;
+ color: #FFFFFF;
+ width: 253px;
+ height: 40px;
+ line-height: 40px;
+ font-family: Arial;
+ font-size: 16px;
+ font-weight: bold;
+ text-decoration: none;
+ a:hover {
+ color: #EEEEEE;
+ }
+ }
+ .historique {
+ color: #000000;
+ margin-left: 20px;
+ }
+ .comments {
+ margin-right: -10px;
+ }
+ .comments-off {
+ margin-right: -35px;
+ }
+ .dossier-title {
+ font-size: 16px;
+ min-height: 40px;
+ text-align: center;
+ }
+ .split-hr {
+ border-bottom: 1px solid #979797;
+ height: 12px;
+ min-height: 10px;
+ }
+ .title-row {
+ margin: 20px 10px 10px 10px;
+ }
+ .margin-top-40 {
+ margin-top: 40px;
+ }
+ .margin-top-20 {
+ margin-top: 20px;
+ }
+ .margin-bot-40 {
+ margin-bottom: 40px;
+ }
+ }
+ #pieces_justificatives {
+ .piece-row {
+ margin: 0 0 0 0;
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/dossiers.scss b/app/assets/stylesheets/dossiers.scss
index 76ce739db..c6a493da8 100644
--- a/app/assets/stylesheets/dossiers.scss
+++ b/app/assets/stylesheets/dossiers.scss
@@ -29,7 +29,44 @@ h5 span {
}
}
+#dossiers_list {
+ .filter {
+ cursor: pointer;
+ font-size: 1.1em;
+ display: inline;
+ }
+}
+
#dossiers_list tr:hover{
background-color: #eeeeee;
cursor: pointer;
-}
\ No newline at end of file
+}
+
+#procedure_list, #notifications_list {
+ margin-left: -10px;
+ margin-top: 20px;
+ a, a:hover {
+ color: #FFFFFF;
+ text-decoration: none;
+ }
+ .procedure_list_element.active, .notification.active {
+ background-color: #668ABD;
+ }
+ .procedure_list_element, .notification {
+ padding: 15px 40px 15px 20px;
+ cursor: pointer;
+ line-height: 1.8em;
+ .progress-bar-warning {
+ background-color: #E4594F;
+ }
+ }
+ .procedure_list_element:hover, .notification:hover {
+ background-color: #668ABD;
+ cursor: pointer;
+ }
+}
+
+.split-hr-left {
+ border-bottom: 1px solid #FFFFFF;
+ margin: 20px 10px 0px 10px;
+}
diff --git a/app/assets/stylesheets/etapes.scss b/app/assets/stylesheets/etapes.scss
index b9f307024..4bef8c51a 100644
--- a/app/assets/stylesheets/etapes.scss
+++ b/app/assets/stylesheets/etapes.scss
@@ -1,18 +1,3 @@
-.etapes_menu{
- h3 {
- margin-left: 3%;
- }
- padding-right: 0 !important;
-}
-
-.etapes_informations {
- padding-left: 0 !important;
-}
-
-.etape{
- margin-bottom: 0px;
-}
-
.etape_2{
.etapes_menu{
#dossier_siret{
@@ -26,4 +11,4 @@
.etapes_informations{
padding-top: 15px;
}
-}
\ No newline at end of file
+}
diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss
index 7c22bc774..e241fe95d 100644
--- a/app/assets/stylesheets/landing.scss
+++ b/app/assets/stylesheets/landing.scss
@@ -1,21 +1,26 @@
-.max-size {
- margin-left: -10rem;
- margin-right: -10rem;
-}
-
#landing {
-
background-image: image-url('landing_background.png');
background-attachment: fixed;
+ background-size: 130% auto;
background-position: top center;
background-repeat: no-repeat;
- background-color: rgba(11,107,168,0.2);
+ h5{
+ color: grey;
+ }
+
+ .logos {
+ width: 150px;
+ }
+
+ #logo-tps {
+ width: 200px;
+ }
#title {
- h1 {
- font-size: 65px;
- }
+ padding-bottom: 2%;
+ padding-top: 1%;
+
h2 {
font-size: 35px;
}
@@ -23,104 +28,35 @@
.btn {
text-shadow: none;
}
- color: white;
- padding-top: 3%;
- padding-bottom: 4%;
- text-shadow: 0px 0px 10px rgb(0, 0, 0);
- }
- .logo img {
- width: 70px;
+ color: white;
+ text-shadow: 0px 0px 10px rgb(0, 0, 0);
}
}
-#suite {
- .row{
- width: 100%;
- margin-left: 0;
- margin-right: 0;
- }
- .word {
- border-bottom: solid darkgrey 1px;
+.background-tps{
+ background-color: #668AEA;
+ color: white;
+}
- img {
- padding-top: 50px;
- padding-bottom: 50px;
- width: 200px;
- margin-left: 25%;
- }
+.latest_release{
+ margin-left: 1%
+}
+
+#landing_body{
+ .split-hr-left {
+ margin-left: auto;
+ margin-right: auto;
+
+ margin-top: 40px;
+ margin-bottom: 20px;
+
+ border-color: grey;
+ width: 40%;
}
- .simplifier {
- ul {
- margin-top: 13%;
- }
+ #etapes, #request_access{
+ margin-top: 20px;
+ margin-bottom: 20px;
}
-
- .securiser {
- img {
- width: 300px;
- }
-
- ul {
- margin-top: 11%;
- }
- }
-
- .echanger {
- ul {
- margin-top: 4%;
- }
- }
- .profiter {
- //border-bottom: none;
-
- ul {
- margin-top: 10%;
- }
- }
- .news {
- padding-top: 25px;
- padding-bottom: 25px;
-
- .latest_release {
- .body {
- margin-left: 3%;
- }
- }
- }
-
- .demo_account {
- img {
- margin-left: 0;
- padding-top: 10px;
- padding-bottom: 0;
- }
- padding-top: 25px;
- padding-bottom: 25px;
-
- .btn {
- margin-top: 10%;
- }
- }
-
- .documentation {
- border-bottom: none;
-
- padding-top: 15px;
- padding-bottom: 15px;
-
- a {
- margin-top: 16%;
- }
-
- ul{
- margin-top: 14%;
- }
-
- img {
- margin-left: 0;
- width: 22%;
- }
- }
-}
\ No newline at end of file
+}
diff --git a/app/assets/stylesheets/left_pannel.scss b/app/assets/stylesheets/left_pannel.scss
new file mode 100644
index 000000000..7c8925c3f
--- /dev/null
+++ b/app/assets/stylesheets/left_pannel.scss
@@ -0,0 +1,226 @@
+#left-pannel {
+ margin-top: 60px;
+ padding: 0;
+ background-color: #003189;
+ height: calc(100% - 60px);
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ color: white;
+ overflow-y: scroll;
+
+ #first-block {
+ font-family: Arial;
+ font-size: 16px;
+ line-height: 18px;
+ margin-top: 20px;
+ .infos {
+ font-size: 25px;
+ text-align: center;
+ margin: 10px 10px 30px 0;
+ .projet-name {
+ font-size: 25px;
+ line-height: normal;
+ padding: 5px;
+ }
+ }
+ .count {
+ display: inline-block;
+ padding: 3px;
+ border-radius: 25px;
+ min-width: 40px;
+ text-align: center;
+ line-height: 23px;
+ }
+ .text {
+ display: inline-block;
+ width: 30px;
+ margin: 0 0 0 8px;
+ }
+ .dossiers-en-cours, .en-cours {
+ margin-top: 20px;
+ }
+ .dossiers-en-cours {
+ .count {
+ border: 1px solid #FFFFFF;
+ }
+ }
+ .nouveaux-dossiers {
+ .count {
+ background-color: #5CB85C;
+ }
+ }
+ .nouvelles-notifications {
+ .count {
+ background-color: #E4594F;
+ }
+ }
+ .dossiers-en-cours, .nouveaux-dossiers, .nouvelles-notifications, .en-cours {
+ margin: 5px auto 0 20px;
+ width: 150px;
+ }
+ }
+ #action-block {
+ text-align: center;
+ margin: 10px;
+ .action {
+ background-color: #E45B51;
+ text-align: center;
+ cursor: pointer;
+ color: #FFFFFF;
+ margin: 0 10px 0 0;
+ min-height: 40px;
+ padding: 5px;
+ font-family: Arial;
+ font-size: 16px;
+ font-weight: bold;
+ border: none;
+ width: 100%;
+ }
+ .close-dossier, .refuse-dossier, .forget-dossier {
+ border: 1px solid #FFFFFF;
+ border-radius: 25px;
+ margin: 5px;
+ margin-left: auto;
+ margin-right: auto;
+ width: 60px;
+ }
+ .close-dossier:hover, .refuse-dossier:hover, .forget-dossier:hover {
+ color: #000000;
+ border-color: #000000;
+ }
+ .close-dossier {
+ background-color: #2A9E2A;
+ }
+ .refuse-dossier {
+ background-color: #E4594F;
+ }
+ .forget-dossier {
+ background-color: #FF8300;
+ }
+ }
+ #menu-block {
+ #switch-buttons {
+ height: 30px;
+ line-height: 30px;
+ font-size: 16px;
+ margin-top: 20px;
+ margin-left: auto;
+ margin-right: auto;
+ width: 205px;
+ border: 1px solid;
+ padding: 0 0 0 10px;
+ border-radius: 25px;
+ cursor: pointer;
+ .active {
+ background-color: #668ABD !important;
+ cursor: default;
+ }
+ .separator {
+ height: 26px;
+ width: 1px;
+ display: inline-block;
+ background-color: #FFFFFF;
+ }
+ #switch-procedures:hover, #switch-notifications:hover {
+ background-color: #668AEA;
+ }
+ #switch-procedures {
+ height: 28px;
+ margin: 0 0 0 -10px;
+ padding-left: 10px;
+ width: 100px;
+ display: inline-block;
+ border-radius: 25px 0 0 25px;
+ }
+ #switch-notifications {
+ width: 103px;
+ display: inline-block;
+ border-radius: 0 25px 25px 0;
+ height: 28px;
+ margin: 0 0 0 -5px;
+ padding: 0 0 0 5px;
+ }
+ }
+ .split-hr {
+ border-bottom: 1px solid #FFFFFF;
+ width: 200px;
+ margin: 20px 0 20px 0;
+ }
+ }
+ #infos-block {
+ .split-hr {
+ border-bottom: 1px solid #FFFFFF;
+ width: 200px;
+ margin: 20px 0 20px 0;
+ }
+ .dossier-state {
+ text-align: center;
+ font-size: 25px;
+ width: 200px;
+ margin-top: 20px;
+ width: 200px;
+ margin-left: auto;
+ margin-right: auto;
+ }
+ #notifications_list {
+ .no-notification {
+ margin: 0 30px 0 30px;
+ }
+ .notification {
+ padding: 10px 2px 10px 15px;
+ .dossier, .updated-at {
+ display: inline-block;
+ color: #CCCCCC;
+ font-size: 12px;
+ text-align: left;
+ }
+ .dossier-index, .updated-at-index, .count {
+ display: inline-block;
+ color: #FFFFFF;
+ font-size: 14px;
+ text-align: left;
+ }
+ .count {
+ background-color: #F0AD4E;
+ border-radius: 25px;
+ padding: 0 5px 0 5px;
+ width: 25px;
+ text-align: center;
+ }
+ .type-notif {
+ font-size: 16px;
+ }
+ }
+ }
+ .notifications {
+ margin: 20px 10px 0 5px;
+ .fa {
+ font-size: 25px;
+ width: 100%;
+ margin: 0 0 15px 0;
+ }
+ .type-notif {
+ font-size: 16px;
+ float: right;
+ width: 30px;
+ }
+ .notification {
+ margin: 10px 0 10px 10px;
+ .type {
+ margin-bottom: 20px;
+ }
+ .updated-at {
+ color: #CCCCCC;
+ font-size: 12px;
+ text-align: left;
+ }
+ .split-hr {
+ width: 40px;
+ margin: auto;
+ }
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/main_container.scss b/app/assets/stylesheets/main_container.scss
new file mode 100644
index 000000000..fda591698
--- /dev/null
+++ b/app/assets/stylesheets/main_container.scss
@@ -0,0 +1,3 @@
+#main-container {
+ float: right;
+}
diff --git a/app/assets/stylesheets/navbar.scss b/app/assets/stylesheets/navbar.scss
new file mode 100644
index 000000000..3d8fd8ea5
--- /dev/null
+++ b/app/assets/stylesheets/navbar.scss
@@ -0,0 +1,210 @@
+#header {
+ top: 0;
+ left: 0;
+ position: fixed;
+ width: 100%;
+ z-index: 10;
+ border-radius: 0;
+ height: 60px;
+ #title_navbar{
+ color: white;
+ font-weight: bold;
+ font-size: 1.8em;
+ z-index: 10;
+ overflow: hidden;
+ }
+ #title_navbar:hover{
+ text-decoration: none;
+ }
+ #home {
+ text-align: center;
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,0.5);
+ background-color: #003189;
+ height: 60px;
+ .logo {
+ margin-top: 10px;
+ height: 40px;
+ }
+ #tps-title {
+ font-family: Arial;
+ font-size: 24px;
+ font-weight: bold;
+ line-height: 28px;
+ margin-top: 17px;
+ }
+ }
+ #navbar-body {
+ height: 60px;
+ background-color: #FFFFFF;
+ box-shadow: 0 1px 2px 0 rgba(50,50,50,0.5);
+ padding-left: 50px;
+ .main-info {
+ font-family: Arial;
+ font-size: 18px;
+ font-weight: bold;
+ line-height: 58px;
+ height: 58px;
+ color: #000000;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ .options {
+ font-family: Arial;
+ font-size: 14px;
+ text-align: right;
+ line-height: 22px;
+ color: #666666;
+ padding: 8px;
+ border-right: 1px solid #C8C6C8;
+ height: 60px;
+ .dropdown-toggle {
+ cursor: pointer;
+ }
+ .dropdown-pannel {
+ min-height: 100px;
+ width: 400px;
+ padding-left: 10px;
+ }
+ .centered-option {
+ line-height: 40px;
+ height: 40px;
+ }
+ .caret-right {
+ border-bottom: 4px solid transparent;
+ border-top: 4px solid transparent;
+ border-left: 4px solid;
+ display: inline-block;
+ height: 0;
+ margin: 8px 2px 0 5px;
+ vertical-align: top;
+ width: 0;
+ }
+ }
+
+ #sign_in{
+ margin-top: 7px;
+ .btn {
+ color: #003C92;
+ float: right;
+ margin-right: 1.3em;
+ }
+ .btn:hover {
+ color: #668ABD;
+ }
+ }
+
+ #sign_out{
+ height: 60px;
+
+ .fa {
+ color: #003C92;
+ float: right;
+ width: 70px;
+ margin-top: 2%;
+ margin-right: 0.5em;
+ font-size: 40px;
+ }
+ .fa:hover {
+ color: #668ABD;
+ }
+ }
+ }
+}
+
+#download-menu {
+ .btn-sm {
+ color: #000000;
+ font-size: 14px;
+ }
+}
+
+.btn-nav {
+ color: white;
+ background-color: transparent;
+ margin-top: 6px;
+ height: 36px;
+}
+
+.btn-nav:hover {
+ background-color: #eeeeee;
+ border-color: #eeeeee #eeeeee #ddd;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+}
+
+.btn-nav.text-info:hover {
+ color: #23527c;
+}
+
+.btn-nav.text-success:hover {
+ color: #3c763d;
+}
+
+.btn-nav.text-danger:hover {
+ color: #a94442;
+}
+
+.navbar {
+ border: 0 !important;
+ .sign_in_FC {
+ margin-top: -18px;
+ height: 70px;
+ }
+}
+
+#beta {
+ text-align: center;
+ text-transform: uppercase;
+ position: fixed;
+ bottom: 26px;
+ right: -35px;
+ -webkit-transform: rotate(-45deg);
+ transform: rotate(-45deg);
+ width: 150px;
+ background-color: #008cba;
+ color: #fff;
+ padding: 5px;
+ font-size: 15px;
+ font-weight: 700;
+ z-index: 10;
+}
+
+.button_navbar {
+ color: #666666;
+ cursor: pointer;
+}
+
+.button-navbar-action {
+ background-color: #E4594F;
+ color: #FFFFFF;
+ cursor: pointer;
+ display: block;
+ width: 150px;
+ text-align: center;
+ padding: 2px;
+ float: right;
+ .fa {
+ font-size: 20px;
+ margin-right: 10px;
+ }
+}
+.button-navbar-action:hover {
+ color: #F2F6FA;
+}
+
+.button_navbar:hover, .button-navbar-action:hover {
+ text-decoration: none;
+}
+
+#credentials {
+ display: none;
+ width: initial;
+ padding: 10px;
+ left: -130px;
+ text-align: center;
+ .description {
+ font-weight: bold;
+ font-size: 20px;
+ }
+}
+
diff --git a/app/assets/stylesheets/notification_alert.scss b/app/assets/stylesheets/notification_alert.scss
new file mode 100644
index 000000000..caf95bdf9
--- /dev/null
+++ b/app/assets/stylesheets/notification_alert.scss
@@ -0,0 +1,12 @@
+#notification_alert {
+ position: fixed;
+ top: 20px;
+ right: -250px;
+
+ z-index: 1000;
+
+ width: 250px;
+ height: 80px;
+
+ border: solid black 1px;
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/pref_list_menu.scss b/app/assets/stylesheets/pref_list_menu.scss
index 0ab24a30d..3251d69fb 100644
--- a/app/assets/stylesheets/pref_list_menu.scss
+++ b/app/assets/stylesheets/pref_list_menu.scss
@@ -11,7 +11,7 @@
width: 470px;
height: calc(100% - 25px);
padding: 15px;
- overflow: scroll;
+ overflow-y: scroll;
}
.open_pref_list {
diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss
index c16833811..9b9dc1fec 100644
--- a/app/assets/stylesheets/print.scss
+++ b/app/assets/stylesheets/print.scss
@@ -28,4 +28,4 @@
#backoffice_dossier_show .nav-tabs {
display: none;
}
-}
\ No newline at end of file
+}
diff --git a/app/assets/stylesheets/recapitulatif.scss b/app/assets/stylesheets/recapitulatif.scss
index 39699dc8f..7d81a7c46 100644
--- a/app/assets/stylesheets/recapitulatif.scss
+++ b/app/assets/stylesheets/recapitulatif.scss
@@ -1,13 +1,3 @@
-#infos_dossier{
- background-color:rgba(248,248,255,0.8);
- padding-left:13%;
- padding-right:13%;
- padding-bottom:20px;
- padding-top:15px;
- margin-left:-10rem;
- margin-right:-10rem;
-}
-
#UploadPJmodal {
text-align: left;
@@ -16,4 +6,4 @@
margin-left: 0 !important;
margin-bottom: 0;
}
-}
\ No newline at end of file
+}
diff --git a/app/assets/stylesheets/search.scss b/app/assets/stylesheets/search.scss
new file mode 100644
index 000000000..ce3219ac5
--- /dev/null
+++ b/app/assets/stylesheets/search.scss
@@ -0,0 +1,19 @@
+#search-block{
+ margin: 15px 10px 0 10px;
+ height: 30px;
+}
+
+#search_button {
+ height: 34px;
+}
+
+#mask_search{
+ display: none;
+ position: fixed;
+ background-color: rgba(0, 0, 0, 0.4);
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 200;
+}
diff --git a/app/assets/stylesheets/support_navigator_banner.scss b/app/assets/stylesheets/support_navigator_banner.scss
new file mode 100644
index 000000000..d786918f5
--- /dev/null
+++ b/app/assets/stylesheets/support_navigator_banner.scss
@@ -0,0 +1,15 @@
+#support_navigator_banner{
+ position: fixed;
+ text-align:center;
+ line-height: 2em;
+ color: white;
+ background-color: #990000;
+ width: 100%;
+ margin: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1000;
+ a{
+ color: #c3d9ff;
+ }
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/switch_menu.scss b/app/assets/stylesheets/switch_menu.scss
new file mode 100644
index 000000000..95d6b0b30
--- /dev/null
+++ b/app/assets/stylesheets/switch_menu.scss
@@ -0,0 +1,6 @@
+#switch_menu{
+ position: fixed;
+ left: 10px;
+ bottom: 10px;
+ z-index: 300;
+}
\ No newline at end of file
diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss
new file mode 100644
index 000000000..8b734bee7
--- /dev/null
+++ b/app/assets/stylesheets/users.scss
@@ -0,0 +1,59 @@
+#users_index, #admins_index{
+ margin-left: 2rem;
+ margin-right: 2rem;
+
+ .default_data_block {
+ margin-top: 20px;
+ background-color: #FFFFFF;
+ .show-block {
+ width: 100%;
+ }
+ .body {
+ height: auto;
+ }
+ }
+}
+
+#users_siret_index {
+ margin: 20px;
+}
+
+#description_page {
+}
+
+#carto_page {
+ margin: 20px;
+}
+
+.white-back {
+ margin: 20px !important;
+ #previsualisation {
+ margin-top: 30px;
+ }
+}
+
+.white-back, #users_siret_index, #description_page, #carto_page {
+ background-color: #FFFFFF;
+ box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5);
+ padding: 20px;
+ .action {
+ background-color: #E45B51;
+ text-align: center;
+ line-height: 40px;
+ font-size: 15px;
+ text-decoration: none;
+ color: #FFFFFF;
+ text-transform: uppercase;
+ border: none;
+ padding: 10px;
+ }
+ .action:hover {
+ color: #F2F6FA;
+ }
+ .padding-left-30 {
+ padding-left: 30px;
+ }
+ h3 {
+ margin-bottom: 20px;
+ }
+}
diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb
new file mode 100644
index 000000000..d56fa30f4
--- /dev/null
+++ b/app/channels/application_cable/channel.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
+module ApplicationCable
+ class Channel < ActionCable::Channel::Base
+ end
+end
diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb
new file mode 100644
index 000000000..b4f41389a
--- /dev/null
+++ b/app/channels/application_cable/connection.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
+module ApplicationCable
+ class Connection < ActionCable::Connection::Base
+ end
+end
diff --git a/app/channels/notifications_channel.rb b/app/channels/notifications_channel.rb
new file mode 100644
index 000000000..a57c0f242
--- /dev/null
+++ b/app/channels/notifications_channel.rb
@@ -0,0 +1,5 @@
+class NotificationsChannel < ApplicationCable::Channel
+ def subscribed
+ stream_from 'notifications'
+ end
+end
\ No newline at end of file
diff --git a/app/controllers/admin/gestionnaires_controller.rb b/app/controllers/admin/gestionnaires_controller.rb
index 421eaa240..da082c5f3 100644
--- a/app/controllers/admin/gestionnaires_controller.rb
+++ b/app/controllers/admin/gestionnaires_controller.rb
@@ -21,7 +21,7 @@ class Admin::GestionnairesController < AdminController
assign_gestionnaire!
end
- if procedure_id
+ if procedure_id.present?
redirect_to admin_procedure_accompagnateurs_path(procedure_id: procedure_id)
else
redirect_to admin_gestionnaires_path
@@ -44,7 +44,7 @@ class Admin::GestionnairesController < AdminController
))
if @gestionnaire.errors.messages.empty?
- User.create(attributes) if Features.unified_login
+ User.create(attributes)
flash.notice = 'Accompagnateur ajouté'
GestionnaireMailer.new_gestionnaire(@gestionnaire.email, @gestionnaire.password).deliver_now!
GestionnaireMailer.new_assignement(@gestionnaire.email, current_administrateur.email).deliver_now!
diff --git a/app/controllers/admin/previsualisations_controller.rb b/app/controllers/admin/previsualisations_controller.rb
index a5c873e7f..257de657b 100644
--- a/app/controllers/admin/previsualisations_controller.rb
+++ b/app/controllers/admin/previsualisations_controller.rb
@@ -9,5 +9,10 @@ class Admin::PrevisualisationsController < AdminController
@dossier.build_default_champs
@champs = @dossier.ordered_champs
+
+ @headers = @champs.inject([]) do |acc, champ|
+ acc.push(champ) if champ.type_champ == 'header_section'
+ acc
+ end
end
end
\ No newline at end of file
diff --git a/app/controllers/admin/procedures_controller.rb b/app/controllers/admin/procedures_controller.rb
index 4d8e44af3..2f7f11d1b 100644
--- a/app/controllers/admin/procedures_controller.rb
+++ b/app/controllers/admin/procedures_controller.rb
@@ -105,6 +105,7 @@ class Admin::ProceduresController < AdminController
if procedure_path
if procedure_path.administrateur_id == current_administrateur.id
procedure_path.procedure.archive
+ procedure_path.delete
else
@mine = false
return render '/admin/procedures/publish', formats: 'js'
diff --git a/app/controllers/admin/types_de_champ_controller.rb b/app/controllers/admin/types_de_champ_controller.rb
index ee3205901..912008ddb 100644
--- a/app/controllers/admin/types_de_champ_controller.rb
+++ b/app/controllers/admin/types_de_champ_controller.rb
@@ -45,4 +45,4 @@ class Admin::TypesDeChampController < AdminController
def create_facade
@types_de_champ_facade = AdminTypesDeChampFacades.new false, @procedure
end
-end
\ No newline at end of file
+end
diff --git a/app/controllers/administrateurs/sessions_controller.rb b/app/controllers/administrateurs/sessions_controller.rb
index f7f676790..be676864f 100644
--- a/app/controllers/administrateurs/sessions_controller.rb
+++ b/app/controllers/administrateurs/sessions_controller.rb
@@ -2,12 +2,12 @@ class Administrateurs::SessionsController < Sessions::SessionsController
def demo
return redirect_to root_path if Rails.env.production?
- @administrateur = Administrateur.new(email: 'admin@tps.fr', password: 'password')
- render 'new'
+ @user = User.new(email: DemoEmails[:admin], password: 'password')
+ render 'users/sessions/new'
end
def new
- @administrateur = Administrateur.new
+ redirect_to new_user_session_path
end
def create
diff --git a/app/controllers/administrations_controller.rb b/app/controllers/administrations_controller.rb
index a2c628dee..e610ffcf5 100644
--- a/app/controllers/administrations_controller.rb
+++ b/app/controllers/administrations_controller.rb
@@ -15,10 +15,6 @@ class AdministrationsController < ApplicationController
end
- def show
- @admin = Administrateur.find(params[:id])
- end
-
def create
admin = Administrateur.new create_administrateur_params
diff --git a/app/controllers/api/v1/dossiers_controller.rb b/app/controllers/api/v1/dossiers_controller.rb
index a26726df2..2849fd8c1 100644
--- a/app/controllers/api/v1/dossiers_controller.rb
+++ b/app/controllers/api/v1/dossiers_controller.rb
@@ -16,7 +16,8 @@ class API::V1::DossiersController < APIController
def index
procedure = current_administrateur.procedures.find(params[:procedure_id])
dossiers = procedure.dossiers.where.not(state: :draft).paginate(page: params[:page])
- render json: dossiers, each_serializer: DossiersSerializer, meta: pagination(dossiers), meta_key: 'pagination', status: 200
+
+ render json: {dossiers: dossiers.map{|dossier| DossiersSerializer.new(dossier)}, pagination: pagination(dossiers)}, status: 200
rescue ActiveRecord::RecordNotFound => e
render json: {}, status: 404
end
@@ -39,9 +40,10 @@ class API::V1::DossiersController < APIController
def show
procedure = current_administrateur.procedures.find(params[:procedure_id])
dossier = procedure.dossiers.find(params[:id])
+
respond_to do |format|
- format.json { render json: dossier, status: 200 }
- format.csv { render csv: dossier, status: 200 }
+ format.json { render json: {dossier: DossierSerializer.new(dossier).as_json}, status: 200 }
+ format.csv { render csv: dossier.as_csv, status: 200 }
end
rescue ActiveRecord::RecordNotFound => e
render json: {}, status: 404
diff --git a/app/controllers/api/v1/procedures_controller.rb b/app/controllers/api/v1/procedures_controller.rb
index 5a76daa30..bc712abb0 100644
--- a/app/controllers/api/v1/procedures_controller.rb
+++ b/app/controllers/api/v1/procedures_controller.rb
@@ -14,9 +14,9 @@ class API::V1::ProceduresController < APIController
}
def show
- @procedure = current_administrateur.procedures.find(params[:id]).decorate
+ procedure = current_administrateur.procedures.find(params[:id]).decorate
- render json: @procedure
+ render json: {procedure: ProcedureSerializer.new(procedure).as_json}
rescue ActiveRecord::RecordNotFound => e
Rails.logger.error(e.message)
render json: {}, status: 404
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index 410f1c103..8c636918d 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -1,6 +1,6 @@
class APIController < ApplicationController
before_action :authenticate_user
- before_filter :default_format_json
+ before_action :default_format_json
def authenticate_user
render json: {}, status: 401 unless valid_token?
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 103ca5526..83ab972b9 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,14 +2,24 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
- before_filter :check_browser
+ before_action :check_browser
+ before_action :load_navbar_left_pannel_partial_url
def default_url_options
- return { protocol: 'https' } if Rails.env.staging? || Rails.env.production?
+ return {protocol: 'https'} if Rails.env.staging? || Rails.env.production?
{}
end
def check_browser
- BROWSER.value = Browser.new(request.user_agent)
+ BROWSER.value = BrowserService.get_browser(request)
+ end
+
+ def load_navbar_left_pannel_partial_url
+ controller = request.controller_class
+ method = params[:action]
+ service = RenderPartialService.new(controller, method)
+ @navbar_url = service.navbar
+ @left_pannel_url = service.left_panel
+ @facade_data_view = nil
end
end
diff --git a/app/controllers/backoffice/dossiers/procedure_controller.rb b/app/controllers/backoffice/dossiers/procedure_controller.rb
index 74b092f43..76b96bf66 100644
--- a/app/controllers/backoffice/dossiers/procedure_controller.rb
+++ b/app/controllers/backoffice/dossiers/procedure_controller.rb
@@ -7,14 +7,14 @@ class Backoffice::Dossiers::ProcedureController < Backoffice::DossiersListContro
render 'backoffice/dossiers/index'
rescue ActiveRecord::RecordNotFound
- flash[:alert] = "Cette procédure n'existe pas ou vous n'y avez pas accès."
+ flash.alert = "Cette procédure n'existe pas ou vous n'y avez pas accès."
redirect_to backoffice_dossiers_path
end
def filter
super
- redirect_to backoffice_dossiers_procedure_path(id: params[:id], liste: param_liste)
+ redirect_to backoffice_dossiers_procedure_path(id: params[:id])
end
private
diff --git a/app/controllers/backoffice/dossiers_controller.rb b/app/controllers/backoffice/dossiers_controller.rb
index 85c5a7b82..73fd4ec13 100644
--- a/app/controllers/backoffice/dossiers_controller.rb
+++ b/app/controllers/backoffice/dossiers_controller.rb
@@ -2,14 +2,34 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
respond_to :html, :xlsx, :ods, :csv
def index
- super
+ procedure = current_gestionnaire.procedure_filter
- dossiers_list_facade.service.filter_procedure_reset!
+ if procedure.nil?
+ procedure_list = dossiers_list_facade.gestionnaire_procedures_name_and_id_list
+ if procedure_list.count == 0
+ flash.alert = "Vous n'avez aucune procédure d'affectée."
+ return redirect_to root_path
+ end
+
+ procedure = procedure_list.first[:id]
+ end
+
+ redirect_to backoffice_dossiers_procedure_path(id: procedure)
end
def show
create_dossier_facade params[:id]
- @champs = @facade.champs_private unless @facade.nil?
+
+ unless @facade.nil?
+ @champs_private = @facade.champs_private
+
+ @headers_private = @champs_private.inject([]) do |acc, champ|
+ acc.push(champ) if champ.type_champ == 'header_section'
+ acc
+ end
+ end
+
+ Notification.where(dossier_id: params[:id].to_i).update_all already_read: true
end
def filter
@@ -26,8 +46,8 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
dossiers = dossiers_list_facade(param_liste).dossiers_to_display
respond_to do |format|
format.xlsx { render xlsx: dossiers }
- format.ods { render ods: dossiers }
- format.csv { render csv: dossiers }
+ format.ods { render ods: dossiers }
+ format.csv { render csv: dossiers }
end
end
end
@@ -36,20 +56,30 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
@search_terms = params[:q]
# exact id match?
- @dossier = Dossier.where(id: @search_terms)
+ @dossiers = Dossier.where(id: @search_terms.to_i) if @search_terms.to_i < 2147483647
+ @dossiers = Dossier.none if @dossiers.nil?
# full text search
- unless @dossier.any?
- @dossier ||= Search.new(
- gestionnaire: current_gestionnaire,
- query: @search_terms,
- page: params[:page]
+ unless @dossiers.any?
+ @dossiers = Search.new(
+ gestionnaire: current_gestionnaire,
+ query: @search_terms,
+ page: params[:page]
).results
end
- smartlisting_dossier @dossier, 'search'
+ smart_listing_create :search,
+ @dossiers,
+ partial: "backoffice/dossiers/list",
+ array: true,
+ default_sort: dossiers_list_facade.service.default_sort
+
rescue RuntimeError
- smartlisting_dossier [], 'search'
+ smart_listing_create :search,
+ [],
+ partial: "backoffice/dossiers/list",
+ array: true,
+ default_sort: dossiers_list_facade.service.default_sort
end
def valid
@@ -60,7 +90,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
NotificationMailer.dossier_validated(@facade.dossier).deliver_now!
- render 'show'
+ redirect_to backoffice_dossier_path(id: @facade.dossier.id)
end
def receive
@@ -71,7 +101,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
NotificationMailer.dossier_received(@facade.dossier).deliver_now!
- render 'show'
+ redirect_to backoffice_dossier_path(id: @facade.dossier.id)
end
def refuse
@@ -82,7 +112,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
NotificationMailer.dossier_refused(@facade.dossier).deliver_now!
- render 'show'
+ redirect_to backoffice_dossier_path(id: @facade.dossier.id)
end
def without_continuation
@@ -93,7 +123,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
NotificationMailer.dossier_without_continuation(@facade.dossier).deliver_now!
- render 'show'
+ redirect_to backoffice_dossier_path(id: @facade.dossier.id)
end
def close
@@ -104,7 +134,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
NotificationMailer.dossier_closed(@facade.dossier).deliver_now!
- render 'show'
+ redirect_to backoffice_dossier_path(id: @facade.dossier.id)
end
def follow
@@ -123,7 +153,6 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
@liste = cookies[:liste] || 'a_traiter'
end
- dossiers_list_facade @liste
smartlisting_dossier
render 'backoffice/dossiers/index', formats: :js
diff --git a/app/controllers/backoffice/dossiers_list_controller.rb b/app/controllers/backoffice/dossiers_list_controller.rb
index 9a98d7e45..ad38d17e5 100644
--- a/app/controllers/backoffice/dossiers_list_controller.rb
+++ b/app/controllers/backoffice/dossiers_list_controller.rb
@@ -9,7 +9,6 @@ class Backoffice::DossiersListController < ApplicationController
unless DossiersListGestionnaireService.dossiers_liste_libelle.include?(param_liste)
cookies[:liste] = 'a_traiter'
- return redirect_to backoffice_dossiers_path
end
dossiers_list_facade param_liste
@@ -25,22 +24,37 @@ class Backoffice::DossiersListController < ApplicationController
end
def dossiers_list_facade liste='a_traiter'
- @dossiers_list_facade ||= DossiersListFacades.new current_gestionnaire, liste, retrieve_procedure
+ @facade_data_view ||= DossiersListFacades.new current_gestionnaire, liste, retrieve_procedure
end
def smartlisting_dossier dossiers_list=nil, liste='a_traiter'
dossiers_list_facade liste
- dossiers_list = dossiers_list_facade.dossiers_to_display if dossiers_list.nil?
+
+ new_dossiers_list = dossiers_list_facade.service.nouveaux
+ follow_dossiers_list = dossiers_list_facade.service.suivi
+ all_state_dossiers_list = dossiers_list_facade.service.all_state
if param_page.nil?
params[:dossiers_smart_listing] = {page: dossiers_list_facade.service.default_page}
end
- @dossiers = smart_listing_create :dossiers,
- dossiers_list,
- partial: "backoffice/dossiers/list",
- array: true,
- default_sort: dossiers_list_facade.service.default_sort
+ smart_listing_create :new_dossiers,
+ new_dossiers_list,
+ partial: "backoffice/dossiers/list",
+ array: true,
+ default_sort: dossiers_list_facade.service.default_sort
+
+ smart_listing_create :follow_dossiers,
+ follow_dossiers_list,
+ partial: "backoffice/dossiers/list",
+ array: true,
+ default_sort: dossiers_list_facade.service.default_sort
+
+ smart_listing_create :all_state_dossiers,
+ all_state_dossiers_list,
+ partial: "backoffice/dossiers/list",
+ array: true,
+ default_sort: dossiers_list_facade.service.default_sort
end
private
diff --git a/app/controllers/backoffice/preference_list_dossier_controller.rb b/app/controllers/backoffice/preference_list_dossier_controller.rb
index 645ddc049..39ddba55d 100644
--- a/app/controllers/backoffice/preference_list_dossier_controller.rb
+++ b/app/controllers/backoffice/preference_list_dossier_controller.rb
@@ -1,4 +1,4 @@
-class Backoffice::PreferenceListDossierController < ApplicationController
+class Backoffice::PreferenceListDossierController < Backoffice::DossiersListController
include SmartListing::Helper::ControllerExtensions
helper SmartListing::Helper
@@ -22,7 +22,7 @@ class Backoffice::PreferenceListDossierController < ApplicationController
end
def reload_pref_list
- @dossiers_list_facade = DossiersListFacades.new current_gestionnaire, '', retrieve_procedure
+ dossiers_list_facade
render partial: 'backoffice/dossiers/pref_list', id: params_procedure_id
end
diff --git a/app/controllers/commentaires_controller.rb b/app/controllers/commentaires_controller.rb
index 8a1ce41c8..cdf3cb747 100644
--- a/app/controllers/commentaires_controller.rb
+++ b/app/controllers/commentaires_controller.rb
@@ -1,9 +1,9 @@
class CommentairesController < ApplicationController
def index
@facade = DossierFacades.new(
- params[:dossier_id],
- (current_gestionnaire || current_user).email,
- params[:champs_id]
+ params[:dossier_id],
+ (current_gestionnaire || current_user).email,
+ params[:champs_id]
)
render layout: false
rescue ActiveRecord::RecordNotFound
@@ -36,7 +36,11 @@ class CommentairesController < ApplicationController
@commentaire.body = params['texte_commentaire']
saved = false
- saved = @commentaire.save unless flash.alert
+ unless @commentaire.body.blank? && @commentaire.piece_justificative.nil?
+ saved = @commentaire.save unless flash.alert
+ else
+ flash.alert = "Veuillez rédiger un message ou ajouter une pièce jointe."
+ end
if is_gestionnaire?
unless current_gestionnaire.follow? @commentaire.dossier
@@ -44,12 +48,15 @@ class CommentairesController < ApplicationController
end
NotificationMailer.new_answer(@commentaire.dossier).deliver_now! if saved
+
redirect_to url_for(controller: 'backoffice/dossiers', action: :show, id: params['dossier_id'])
- elsif current_user.email != @commentaire.dossier.user.email
- invite = Invite.where(dossier: @commentaire.dossier, user: current_user).first
- redirect_to url_for(controller: 'users/dossiers/invites', action: :show, id: invite.id)
else
- redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: params['dossier_id'])
+ if current_user.email != @commentaire.dossier.user.email
+ invite = Invite.where(dossier: @commentaire.dossier, user: current_user).first
+ redirect_to url_for(controller: 'users/dossiers/invites', action: :show, id: invite.id)
+ else
+ redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: params['dossier_id'])
+ end
end
end
diff --git a/app/controllers/france_connect/particulier_controller.rb b/app/controllers/france_connect/particulier_controller.rb
index 16e103693..a62393990 100644
--- a/app/controllers/france_connect/particulier_controller.rb
+++ b/app/controllers/france_connect/particulier_controller.rb
@@ -83,7 +83,8 @@ class FranceConnect::ParticulierController < ApplicationController
unless user.valid?
flash.alert = 'Email non valide'
- return redirect_to france_connect_particulier_new_path fci_id: params[:fci_id], salt: params[:salt], user: params[:user]
+
+ return redirect_to france_connect_particulier_new_path fci_id: params[:fci_id], salt: params[:salt], user: {email_france_connect: params[:user]['email_france_connect']}
end
user.save
diff --git a/app/controllers/gestionnaires/passwords_controller.rb b/app/controllers/gestionnaires/passwords_controller.rb
index 39e2d72ee..87373d162 100644
--- a/app/controllers/gestionnaires/passwords_controller.rb
+++ b/app/controllers/gestionnaires/passwords_controller.rb
@@ -1,5 +1,6 @@
class Gestionnaires::PasswordsController < Devise::PasswordsController
after_action :try_to_authenticate_user, only: %i(update)
+ after_action :try_to_authenticate_administrateur, only: %i(update)
# GET /resource/password/new
# def new
@@ -38,4 +39,11 @@ class Gestionnaires::PasswordsController < Devise::PasswordsController
sign_in user if user
end
end
+
+ def try_to_authenticate_administrateur
+ if gestionnaire_signed_in?
+ administrateur = Administrateur.find_by(email: current_gestionnaire.email)
+ sign_in administrateur if administrateur
+ end
+ end
end
diff --git a/app/controllers/gestionnaires/sessions_controller.rb b/app/controllers/gestionnaires/sessions_controller.rb
index 36121470a..c0f7d7b9b 100644
--- a/app/controllers/gestionnaires/sessions_controller.rb
+++ b/app/controllers/gestionnaires/sessions_controller.rb
@@ -2,12 +2,12 @@ class Gestionnaires::SessionsController < Sessions::SessionsController
def demo
return redirect_to root_path if Rails.env.production?
- @gestionnaire = Gestionnaire.new(email: 'gestionnaire@apientreprise.fr', password: 'password')
- render 'new'
+ @user = User.new(email: DemoEmails[:gestionnaire], password: 'password')
+ render 'users/sessions/new'
end
def new
- @gestionnaire = Gestionnaire.new
+ redirect_to new_user_session_path
end
def create
diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb
index f92a913d7..0878b7b94 100644
--- a/app/controllers/root_controller.rb
+++ b/app/controllers/root_controller.rb
@@ -1,22 +1,37 @@
class RootController < ApplicationController
def index
+ route = Rails.application.routes.recognize_path(request.referrer)
- if user_signed_in?
- redirect_to users_dossiers_path
+ if user_signed_in? && !route[:controller].match('users').nil?
+ return redirect_to users_dossiers_path
+
+ elsif administrateur_signed_in? && !route[:controller].match('admin').nil?
+ return redirect_to admin_procedures_path
elsif gestionnaire_signed_in?
- redirect_to backoffice_dossiers_path
+ procedure_id = current_gestionnaire.procedure_filter
+ if procedure_id.nil?
+ procedure_list = current_gestionnaire.procedures
+
+ if procedure_list.count > 0
+ return redirect_to backoffice_dossiers_procedure_path(id: procedure_list.first.id)
+ else
+ flash.alert = "Vous n'avez aucune procédure d'affectée"
+ end
+ else
+ return redirect_to backoffice_dossiers_procedure_path(id: procedure_id)
+ end
+
+ elsif user_signed_in?
+ return redirect_to users_dossiers_path
elsif administrateur_signed_in?
- redirect_to admin_procedures_path
+ return redirect_to admin_procedures_path
elsif administration_signed_in?
- redirect_to administrations_path
-
- else
- # @latest_release = Github::Releases.latest
- @latest_release = nil
- render 'landing'
+ return redirect_to administrations_path
end
+
+ render 'landing'
end
-end
\ No newline at end of file
+end
diff --git a/app/controllers/users/carte_controller.rb b/app/controllers/users/carte_controller.rb
index 0bf52f02e..0b8a328e9 100644
--- a/app/controllers/users/carte_controller.rb
+++ b/app/controllers/users/carte_controller.rb
@@ -32,7 +32,8 @@ class Users::CarteController < UsersController
end
def get_position
- point = Carto::Geocodeur.convert_adresse_to_point(current_user_dossier.etablissement.geo_adresse)
+ etablissement = current_user_dossier.etablissement
+ point = Carto::Geocodeur.convert_adresse_to_point(etablissement.geo_adresse) unless etablissement.nil?
lon = '2.428462'
lat = '46.538192'
diff --git a/app/controllers/users/confirmations_controller.rb b/app/controllers/users/confirmations_controller.rb
deleted file mode 100644
index 1126e23aa..000000000
--- a/app/controllers/users/confirmations_controller.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-class Users::ConfirmationsController < Devise::ConfirmationsController
- # GET /resource/confirmation/new
- # def new
- # super
- # end
-
- # POST /resource/confirmation
- # def create
- # super
- # end
-
- # GET /resource/confirmation?confirmation_token=abcdef
- # def show
- # super
- # end
-
- # protected
-
- # The path used after resending confirmation instructions.
- # def after_resending_confirmation_instructions_path_for(resource_name)
- # super(resource_name)
- # end
-
- # The path used after confirmation.
- # def after_confirmation_path_for(resource_name, resource)
- # super(resource_name, resource)
- # end
-end
diff --git a/app/controllers/users/description_controller.rb b/app/controllers/users/description_controller.rb
index b74671a45..215973c72 100644
--- a/app/controllers/users/description_controller.rb
+++ b/app/controllers/users/description_controller.rb
@@ -12,16 +12,21 @@ class Users::DescriptionController < UsersController
@procedure = @dossier.procedure
@champs = @dossier.ordered_champs
+ @headers = @champs.inject([]) do |acc, champ|
+ acc.push(champ) if champ.type_champ == 'header_section'
+ acc
+ end
+
rescue ActiveRecord::RecordNotFound
flash.alert = t('errors.messages.dossier_not_found')
redirect_to url_for(root_path)
end
- def error
- show
- flash.now.alert = 'Un ou plusieurs attributs obligatoires sont manquants ou incorrects.'
- render 'show'
- end
+ # def error
+ # show
+ # flash.now.alert = 'Un ou plusieurs attributs obligatoires sont manquants ou incorrects.'
+ # render 'show'
+ # end
def create
@dossier = current_user_dossier
@@ -34,16 +39,16 @@ class Users::DescriptionController < UsersController
unless @dossier.update_attributes(create_params)
@dossier = @dossier.decorate
- flash.now.alert = @dossier.errors.full_messages.join('
').html_safe
- return render 'show'
+ flash.alert = @dossier.errors.full_messages.join('
').html_safe
+ return redirect_to users_dossier_description_path(dossier_id: @dossier.id)
end
unless params[:champs].nil?
champs_service_errors = ChampsService.save_formulaire @dossier.champs, params, mandatory
unless champs_service_errors.empty?
- flash.now.alert = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'
' }).html_safe
- return render 'show'
+ flash.alert = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'
' }).html_safe
+ return redirect_to users_dossier_description_path(dossier_id: @dossier.id)
end
end
@@ -51,15 +56,15 @@ class Users::DescriptionController < UsersController
unless params[:cerfa_pdf].nil?
cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user)
unless cerfa.save
- flash.now.alert = cerfa.errors.full_messages.join('
').html_safe
- return render 'show'
+ flash.alert = cerfa.errors.full_messages.join('
').html_safe
+ return redirect_to users_dossier_description_path(dossier_id: @dossier.id)
end
end
end
unless (errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).empty?
flash.alert = errors_upload.html_safe
- return render 'show'
+ return redirect_to users_dossier_description_path(dossier_id: @dossier.id)
end
diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb
index f5ef2472f..3468bad5f 100644
--- a/app/controllers/users/dossiers_controller.rb
+++ b/app/controllers/users/dossiers_controller.rb
@@ -27,7 +27,7 @@ class Users::DossiersController < UsersController
def commencer
unless params[:procedure_path].nil?
- procedure = ProcedurePath.where(path: params[:procedure_path]).first!.procedure
+ procedure = ProcedurePath.where(path: params[:procedure_path]).last.procedure
end
if procedure.archived?
@@ -115,12 +115,12 @@ class Users::DossiersController < UsersController
@facade = facade params[:dossier][:id]
if checked_autorisation_donnees?
- begin
- @facade.dossier.update_attributes!(update_params)
- rescue
- flash.now.alert = @facade.dossier.errors.full_messages.join('
').html_safe
- return render 'show'
+ unless Dossier.find(@facade.dossier.id).update_attributes update_params
+ flash.alert = @facade.dossier.errors.full_messages.join('
').html_safe
+
+ return redirect_to users_dossier_path(id: @facade.dossier.id)
end
+
if @facade.dossier.procedure.module_api_carto.use_api_carto
redirect_to url_for(controller: :carte, action: :show, dossier_id: @facade.dossier.id)
else
diff --git a/app/controllers/users/passwords_controller.rb b/app/controllers/users/passwords_controller.rb
index c85d0cb70..0c199841d 100644
--- a/app/controllers/users/passwords_controller.rb
+++ b/app/controllers/users/passwords_controller.rb
@@ -1,5 +1,6 @@
class Users::PasswordsController < Devise::PasswordsController
after_action :try_to_authenticate_gestionnaire, only: %i(update)
+ after_action :try_to_authenticate_administrateur, only: %i(update)
# GET /resource/password/new
# def new
@@ -38,4 +39,11 @@ class Users::PasswordsController < Devise::PasswordsController
sign_in gestionnaire if gestionnaire
end
end
+
+ def try_to_authenticate_administrateur
+ if user_signed_in?
+ administrateur = Administrateur.find_by(email: current_user.email)
+ sign_in administrateur if administrateur
+ end
+ end
end
diff --git a/app/controllers/users/recapitulatif_controller.rb b/app/controllers/users/recapitulatif_controller.rb
index 8be4629a2..4a63ed4c9 100644
--- a/app/controllers/users/recapitulatif_controller.rb
+++ b/app/controllers/users/recapitulatif_controller.rb
@@ -14,7 +14,7 @@ class Users::RecapitulatifController < UsersController
@facade.dossier.next_step! 'user', 'initiate'
flash.notice = 'Dossier soumis avec succès.'
- render 'show'
+ redirect_to users_dossier_recapitulatif_path
end
def submit
@@ -23,12 +23,12 @@ class Users::RecapitulatifController < UsersController
@facade.dossier.submit!
flash.notice = 'Dossier déposé avec succès.'
- render 'show'
+ redirect_to users_dossier_recapitulatif_path
end
def self.route_authorization
{
- states: [:initiated, :replied, :updated, :validated, :received, :submitted, :without_continuation, :closed]
+ states: [:initiated, :replied, :updated, :validated, :received, :submitted, :without_continuation, :closed, :refused]
}
end
diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb
index 857d04111..18054d6a9 100644
--- a/app/controllers/users/registrations_controller.rb
+++ b/app/controllers/users/registrations_controller.rb
@@ -1,6 +1,6 @@
class Users::RegistrationsController < Devise::RegistrationsController
-# before_filter :configure_sign_up_params, only: [:create]
-# before_filter :configure_account_update_params, only: [:update]
+# before_action :configure_sign_up_params, only: [:create]
+# before_action :configure_account_update_params, only: [:update]
def after_sign_up_path_for(resource_or_scope)
WelcomeMailer.welcome_email(resource_or_scope).deliver_now!
@@ -69,6 +69,6 @@ class Users::RegistrationsController < Devise::RegistrationsController
def check_invite! user
Invite.where(email: user.email)
- .each { |invite| invite.update_attribute(:user, user) }
+ .each { |invite| invite.update user: user }
end
end
diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb
index a582ade20..33e91c7a9 100644
--- a/app/controllers/users/sessions_controller.rb
+++ b/app/controllers/users/sessions_controller.rb
@@ -1,11 +1,10 @@
class Users::SessionsController < Sessions::SessionsController
-# before_filter :configure_sign_in_params, only: [:create]
+# before_action :configure_sign_in_params, only: [:create]
def demo
return redirect_to root_path if Rails.env.production?
- @user = User.new(email: 'demo@tps.fr', password: 'password')
-
+ @user = User.new(email: DemoEmails[:user], password: 'password')
render 'new'
end
@@ -23,7 +22,8 @@ class Users::SessionsController < Sessions::SessionsController
#POST /resource/sign_in
def create
try_to_authenticate(User)
- try_to_authenticate(Gestionnaire) if Features.unified_login
+ try_to_authenticate(Gestionnaire)
+ try_to_authenticate(Administrateur)
if user_signed_in?
current_user.update_attributes(loged_in_with_france_connect: '')
@@ -33,7 +33,10 @@ class Users::SessionsController < Sessions::SessionsController
redirect_to after_sign_in_path_for(:user)
elsif gestionnaire_signed_in?
redirect_to backoffice_path
+ elsif administrateur_signed_in?
+ redirect_to admin_path
else
+ flash.alert = 'Mauvais couple login / mot de passe'
new
render :new, status: 401
end
@@ -41,9 +44,8 @@ class Users::SessionsController < Sessions::SessionsController
# DELETE /resource/sign_out
def destroy
- if gestionnaire_signed_in?
- sign_out :gestionnaire
- end
+ sign_out :gestionnaire if gestionnaire_signed_in?
+ sign_out :administrateur if administrateur_signed_in?
if user_signed_in?
connected_with_france_connect = current_user.loged_in_with_france_connect
diff --git a/app/controllers/users/unlocks_controller.rb b/app/controllers/users/unlocks_controller.rb
deleted file mode 100644
index 8b9ef8612..000000000
--- a/app/controllers/users/unlocks_controller.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-class Users::UnlocksController < Devise::UnlocksController
- # GET /resource/unlock/new
- # def new
- # super
- # end
-
- # POST /resource/unlock
- # def create
- # super
- # end
-
- # GET /resource/unlock?unlock_token=abcdef
- # def show
- # super
- # end
-
- # protected
-
- # The path used after sending unlock password instructions
- # def after_sending_unlock_instructions_path_for(resource)
- # super(resource)
- # end
-
- # The path used after unlocking the resource
- # def after_unlock_path_for(resource)
- # super(resource)
- # end
-end
diff --git a/app/decorators/champ_decorator.rb b/app/decorators/champ_decorator.rb
index b6613426b..6713e5049 100644
--- a/app/decorators/champ_decorator.rb
+++ b/app/decorators/champ_decorator.rb
@@ -1,4 +1,5 @@
class ChampDecorator < Draper::Decorator
+ delegate_all
def value
if type_champ == 'checkbox'
@@ -6,8 +7,4 @@ class ChampDecorator < Draper::Decorator
end
object.value
end
-
- def type_champ
- object.type_de_champ.type_champ
- end
end
\ No newline at end of file
diff --git a/app/decorators/commentaire_decorator.rb b/app/decorators/commentaire_decorator.rb
index 06b752c3b..43958f05c 100644
--- a/app/decorators/commentaire_decorator.rb
+++ b/app/decorators/commentaire_decorator.rb
@@ -3,7 +3,5 @@ class CommentaireDecorator < Draper::Decorator
def created_at_fr
created_at.localtime.strftime('%d/%m/%Y - %H:%M')
- rescue
- 'dd/mm/YYYY - HH:MM'
end
end
diff --git a/app/decorators/dossier_decorator.rb b/app/decorators/dossier_decorator.rb
index 109b95bf7..8bf76769b 100644
--- a/app/decorators/dossier_decorator.rb
+++ b/app/decorators/dossier_decorator.rb
@@ -2,12 +2,6 @@ class DossierDecorator < Draper::Decorator
delegate :current_page, :per_page, :offset, :total_entries, :total_pages
delegate_all
- def display_date
- date_previsionnelle.localtime.strftime('%d/%m/%Y')
- rescue
- 'dd/mm/YYYY'
- end
-
def first_creation
created_at.localtime.strftime('%d/%m/%Y %H:%M')
end
@@ -20,16 +14,6 @@ class DossierDecorator < Draper::Decorator
DossierDecorator.case_state_fr state
end
- def class_qp_active
- 'qp' if procedure.module_api_carto.quartiers_prioritaires
- end
-
- def state_color_class
- return 'text-danger' if waiting_for_gestionnaire?
- return 'text-info' if waiting_for_user?
- return 'text-success' if termine?
- end
-
def self.case_state_fr state=self.state
h.t("activerecord.attributes.dossier.state.#{state}")
end
diff --git a/app/decorators/dossiers_decorator.rb b/app/decorators/dossiers_decorator.rb
index 77c064fee..0960972b1 100644
--- a/app/decorators/dossiers_decorator.rb
+++ b/app/decorators/dossiers_decorator.rb
@@ -1,15 +1,4 @@
class DossiersDecorator < Draper::CollectionDecorator
delegate :current_page, :per_page, :offset, :total_entries, :total_pages
-
- def active_class_a_traiter page
- 'active' if page == 'a_traiter'
- end
-
- def active_class_en_attente page
- 'active' if page == 'en_attente'
- end
-
- def active_class_termine page
- 'active' if page == 'termine'
- end
+
end
diff --git a/app/decorators/notification_decorator.rb b/app/decorators/notification_decorator.rb
new file mode 100644
index 000000000..0763f1dc2
--- /dev/null
+++ b/app/decorators/notification_decorator.rb
@@ -0,0 +1,8 @@
+class NotificationDecorator < Draper::Decorator
+ delegate_all
+
+ def index_display
+ ['champs', 'piece_justificative'].include?(type_notif) ? type = liste.join(" ") : type = liste.last
+ { dossier: "Dossier n°#{dossier.id}", date: created_at.strftime('%d/%m %H:%M'), type: type }
+ end
+end
diff --git a/app/facades/dossier_facades.rb b/app/facades/dossier_facades.rb
index 0616bce68..6893f4bcb 100644
--- a/app/facades/dossier_facades.rb
+++ b/app/facades/dossier_facades.rb
@@ -3,7 +3,6 @@ class DossierFacades
#TODO rechercher en fonction de la personne/email
def initialize(dossier_id, email, champ_id = nil)
@dossier = Dossier.where(archived: false).find(dossier_id)
- @email = email
@champ_id = champ_id
end
@@ -11,6 +10,10 @@ class DossierFacades
@dossier.decorate
end
+ def last_notifications
+ @dossier.notifications.order("updated_at DESC").limit(5)
+ end
+
def champs
@dossier.ordered_champs
end
@@ -27,6 +30,10 @@ class DossierFacades
@dossier.ordered_pieces_justificatives
end
+ def types_de_pieces_justificatives
+ @dossier.types_de_piece_justificative.order('order_place ASC')
+ end
+
def champ_id
@champ_id
end
@@ -35,10 +42,6 @@ class DossierFacades
@dossier.ordered_commentaires.where(champ_id: @champ_id).decorate
end
- def commentaire_email
- @email
- end
-
def procedure
@dossier.procedure
end
diff --git a/app/facades/dossiers_list_facades.rb b/app/facades/dossiers_list_facades.rb
index 4f96caa4d..6f0cf3bde 100644
--- a/app/facades/dossiers_list_facades.rb
+++ b/app/facades/dossiers_list_facades.rb
@@ -1,6 +1,8 @@
class DossiersListFacades
include Rails.application.routes.url_helpers
+ attr_accessor :procedure, :current_devise_profil, :liste
+
def initialize current_devise_profil, liste, procedure = nil
@current_devise_profil = current_devise_profil
@liste = liste
@@ -16,12 +18,28 @@ class DossiersListFacades
end
end
- def liste
- @liste
+ def total_dossier
+ current_devise_profil.dossiers.where(archived: false).count
+ end
+
+ def total_new_dossier
+ current_devise_profil.dossiers.where(state: :initiated, archived: false).count
+ end
+
+ def new_dossier_number procedure_id
+ current_devise_profil.dossiers.where(state: :initiated, archived: false, procedure_id: procedure_id).count
end
def gestionnaire_procedures_name_and_id_list
- @current_devise_profil.procedures.order('libelle ASC').inject([]) { |acc, procedure| acc.push({id: procedure.id, libelle: procedure.libelle}) }
+ @current_devise_profil.procedures.order('libelle ASC').inject([]) { |acc, procedure| acc.push({id: procedure.id, libelle: procedure.libelle, unread_notifications: @current_devise_profil.dossier_with_notification_for(procedure)}) }
+ end
+
+ def unread_notifications
+ current_devise_profil.notifications
+ end
+
+ def dossiers_with_unread_notifications
+ (unread_notifications.inject([]) { |acc, notif| acc.push(notif.dossier) }).uniq
end
def procedure_id
@@ -42,34 +60,18 @@ class DossiersListFacades
preference_list_dossiers_filter.where(table: :champs).where.not(filter: '').size == 0
end
+ def all_state_class
+ (@liste == 'all_state' ? 'active' : '')
+ end
+
def brouillon_class
(@liste == 'brouillon' ? 'active' : '')
end
- def nouveaux_class
- (@liste == 'nouveaux' ? 'active' : '')
- end
-
- def a_traiter_class
- (@liste == 'a_traiter' ? 'active' : '')
- end
-
def en_construction_class
(@liste == 'a_traiter' ? 'active' : '')
end
- def fige_class
- (@liste == 'fige' ? 'active' : '')
- end
-
- def en_attente_class
- (@liste == 'en_attente' ? 'active' : '')
- end
-
- def deposes_class
- (@liste == 'deposes' ? 'active' : '')
- end
-
def valides_class
(@liste == 'valides' ? 'active' : '')
end
@@ -78,24 +80,16 @@ class DossiersListFacades
(@liste == 'en_instruction' ? 'active' : '')
end
- def a_instruire_class
- (@liste == 'a_instruire' ? 'active' : '')
- end
-
def termine_class
(@liste == 'termine' ? 'active' : '')
end
- def suivi_class
- (@liste == 'suivi' ? 'active' : '')
- end
-
def invite_class
(@liste == 'invite' ? 'active' : '')
end
- def search_class
- (@liste == 'search' ? 'active' : '')
+ def all_state_total
+ service.all_state.count
end
def brouillon_total
@@ -106,38 +100,18 @@ class DossiersListFacades
service.nouveaux.count
end
- def a_traiter_total
- service.ouvert.count
- end
-
def en_construction_total
service.en_construction.count
end
- def fige_total
- service.fige.count
- end
-
- def en_attente_total
- service.waiting_for_user.count
- end
-
def valides_total
service.valides.count
end
- def deposes_total
- service.deposes.count
- end
-
def en_instruction_total
service.en_instruction.count
end
- def a_instruire_total
- service.a_instruire.count
- end
-
def termine_total
service.termine.count
end
@@ -150,42 +124,6 @@ class DossiersListFacades
service.invite.count
end
- def brouillon_url
- base_url 'brouillon'
- end
-
- def nouveaux_url
- base_url 'nouveaux'
- end
-
- def a_traiter_url
- base_url 'a_traiter'
- end
-
- def en_construction_url
- base_url 'a_traiter'
- end
-
- def fige_url
- base_url 'fige'
- end
-
- def en_attente_url
- base_url 'en_attente'
- end
-
- def deposes_url
- base_url 'deposes'
- end
-
- def a_instruire_url
- base_url 'a_instruire'
- end
-
- def termine_url
- base_url 'termine'
- end
-
def filter_url
@procedure.nil? ? backoffice_dossiers_filter_path(liste: liste) : backoffice_dossiers_procedure_filter_path(id: @procedure.id, liste: liste)
end
@@ -204,4 +142,4 @@ class DossiersListFacades
@procedure.nil? ? backoffice_dossiers_path(liste: liste) : backoffice_dossiers_procedure_path(id: @procedure.id, liste: liste)
end
-end
\ No newline at end of file
+end
diff --git a/app/facades/invite_dossier_facades.rb b/app/facades/invite_dossier_facades.rb
index 824d93ce3..cda91257e 100644
--- a/app/facades/invite_dossier_facades.rb
+++ b/app/facades/invite_dossier_facades.rb
@@ -2,8 +2,6 @@ class InviteDossierFacades < DossierFacades
#TODO rechercher en fonction de la personne/email
def initialize dossier_id, email
- @dossier = (Invite.where(email: email).find(dossier_id)).dossier
- @email = email
+ @dossier = Invite.where(email: email, dossier_id: dossier_id).first!.dossier
end
-
end
\ No newline at end of file
diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb
new file mode 100644
index 000000000..a009ace51
--- /dev/null
+++ b/app/jobs/application_job.rb
@@ -0,0 +1,2 @@
+class ApplicationJob < ActiveJob::Base
+end
diff --git a/lib/carto/bano/address_retriever.rb b/app/lib/carto/bano/address_retriever.rb
similarity index 100%
rename from lib/carto/bano/address_retriever.rb
rename to app/lib/carto/bano/address_retriever.rb
diff --git a/lib/carto/bano/driver.rb b/app/lib/carto/bano/driver.rb
similarity index 100%
rename from lib/carto/bano/driver.rb
rename to app/lib/carto/bano/driver.rb
diff --git a/lib/carto/bano/point_retriever.rb b/app/lib/carto/bano/point_retriever.rb
similarity index 100%
rename from lib/carto/bano/point_retriever.rb
rename to app/lib/carto/bano/point_retriever.rb
diff --git a/lib/carto/geo_api/driver.rb b/app/lib/carto/geo_api/driver.rb
similarity index 90%
rename from lib/carto/geo_api/driver.rb
rename to app/lib/carto/geo_api/driver.rb
index d4cc8866f..01825be40 100644
--- a/lib/carto/geo_api/driver.rb
+++ b/app/lib/carto/geo_api/driver.rb
@@ -11,7 +11,15 @@ module Carto
end
def self.pays
- File.open('lib/carto/geo_api/pays.json').read
+ File.open('app/lib/carto/geo_api/pays.json').read
+ end
+
+ def self.departements_url
+ 'https://geo.api.gouv.fr/departements'
+ end
+
+ def self.regions_url
+ 'https://geo.api.gouv.fr/regions'
end
private
@@ -22,13 +30,6 @@ module Carto
nil
end
- def self.departements_url
- 'https://geo.api.gouv.fr/departements'
- end
-
- def self.regions_url
- 'https://geo.api.gouv.fr/regions'
- end
end
end
end
diff --git a/lib/carto/geo_api/pays.json b/app/lib/carto/geo_api/pays.json
similarity index 100%
rename from lib/carto/geo_api/pays.json
rename to app/lib/carto/geo_api/pays.json
diff --git a/lib/carto/geocodeur.rb b/app/lib/carto/geocodeur.rb
similarity index 100%
rename from lib/carto/geocodeur.rb
rename to app/lib/carto/geocodeur.rb
diff --git a/lib/carto/sgmap/api.rb b/app/lib/carto/sgmap/api.rb
similarity index 88%
rename from lib/carto/sgmap/api.rb
rename to app/lib/carto/sgmap/api.rb
index 39cef144d..db29d7d0b 100644
--- a/lib/carto/sgmap/api.rb
+++ b/app/lib/carto/sgmap/api.rb
@@ -21,6 +21,9 @@ class CARTO::SGMAP::API
url,
verify_ssl: verify_ssl_mode,
).post params[:geojson], content_type: 'application/json'
+
+ rescue RestClient::InternalServerError
+ raise RestClient::ResourceNotFound
end
def self.base_url
diff --git a/lib/carto/sgmap/cadastre/adapter.rb b/app/lib/carto/sgmap/cadastre/adapter.rb
similarity index 100%
rename from lib/carto/sgmap/cadastre/adapter.rb
rename to app/lib/carto/sgmap/cadastre/adapter.rb
diff --git a/lib/carto/sgmap/quartiers_prioritaires/adapter.rb b/app/lib/carto/sgmap/quartiers_prioritaires/adapter.rb
similarity index 100%
rename from lib/carto/sgmap/quartiers_prioritaires/adapter.rb
rename to app/lib/carto/sgmap/quartiers_prioritaires/adapter.rb
diff --git a/lib/file_size_validator.rb b/app/lib/file_size_validator.rb
similarity index 100%
rename from lib/file_size_validator.rb
rename to app/lib/file_size_validator.rb
diff --git a/lib/siade/api.rb b/app/lib/siade/api.rb
similarity index 100%
rename from lib/siade/api.rb
rename to app/lib/siade/api.rb
diff --git a/lib/siade/entreprise_adapter.rb b/app/lib/siade/entreprise_adapter.rb
similarity index 100%
rename from lib/siade/entreprise_adapter.rb
rename to app/lib/siade/entreprise_adapter.rb
diff --git a/lib/siade/etablissement_adapter.rb b/app/lib/siade/etablissement_adapter.rb
similarity index 100%
rename from lib/siade/etablissement_adapter.rb
rename to app/lib/siade/etablissement_adapter.rb
diff --git a/lib/siade/exercices_adapter.rb b/app/lib/siade/exercices_adapter.rb
similarity index 100%
rename from lib/siade/exercices_adapter.rb
rename to app/lib/siade/exercices_adapter.rb
diff --git a/lib/siade/rna_adapter.rb b/app/lib/siade/rna_adapter.rb
similarity index 100%
rename from lib/siade/rna_adapter.rb
rename to app/lib/siade/rna_adapter.rb
diff --git a/lib/tasks/.keep b/app/lib/tasks/.keep
similarity index 100%
rename from lib/tasks/.keep
rename to app/lib/tasks/.keep
diff --git a/lib/tasks/cloud_storage.rake b/app/lib/tasks/cloud_storage.rake
similarity index 100%
rename from lib/tasks/cloud_storage.rake
rename to app/lib/tasks/cloud_storage.rake
diff --git a/lib/tasks/dev.rake b/app/lib/tasks/dev.rake
similarity index 100%
rename from lib/tasks/dev.rake
rename to app/lib/tasks/dev.rake
diff --git a/lib/tasks/opensimplif_import.rake b/app/lib/tasks/opensimplif_import.rake
similarity index 100%
rename from lib/tasks/opensimplif_import.rake
rename to app/lib/tasks/opensimplif_import.rake
diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb
index 5f4303042..f42be257c 100644
--- a/app/mailers/notification_mailer.rb
+++ b/app/mailers/notification_mailer.rb
@@ -1,6 +1,6 @@
class NotificationMailer < ApplicationMailer
def new_answer dossier
- send_mail dossier, "Nouveau commentaire pour votre dossier TPS N°#{dossier.id}"
+ send_mail dossier, "Nouveau message pour votre dossier TPS N°#{dossier.id}"
end
def dossier_received dossier
diff --git a/app/models/administrateur.rb b/app/models/administrateur.rb
index 5cb4723bf..b2882fb62 100644
--- a/app/models/administrateur.rb
+++ b/app/models/administrateur.rb
@@ -6,6 +6,7 @@ class Administrateur < ActiveRecord::Base
has_many :procedures
before_save :ensure_api_token
+ after_update :sync_credentials
def ensure_api_token
if api_token.nil?
@@ -25,4 +26,11 @@ class Administrateur < ActiveRecord::Base
break token unless Administrateur.find_by(api_token: token)
end
end
+
+ def sync_credentials
+ if email_changed? || encrypted_password_changed?
+ return SyncCredentialsService.new(Administrateur, email_was, email, encrypted_password).change_credentials!
+ end
+ true
+ end
end
diff --git a/app/models/application_record.rb b/app/models/application_record.rb
new file mode 100644
index 000000000..10a4cba84
--- /dev/null
+++ b/app/models/application_record.rb
@@ -0,0 +1,3 @@
+class ApplicationRecord < ActiveRecord::Base
+ self.abstract_class = true
+end
diff --git a/app/models/cerfa.rb b/app/models/cerfa.rb
index 0022ad244..6d6d0c702 100644
--- a/app/models/cerfa.rb
+++ b/app/models/cerfa.rb
@@ -5,6 +5,8 @@ class Cerfa < ActiveRecord::Base
mount_uploader :content, CerfaUploader
validates :content, :file_size => {:maximum => 20.megabytes}
+ after_save :internal_notification, if: Proc.new { !dossier.nil? }
+
def empty?
content.blank?
end
@@ -18,4 +20,12 @@ class Cerfa < ActiveRecord::Base
end
end
end
+
+ private
+
+ def internal_notification
+ unless dossier.state == 'draft'
+ NotificationService.new('cerfa', self.dossier.id).notify
+ end
+ end
end
\ No newline at end of file
diff --git a/app/models/champ.rb b/app/models/champ.rb
index f6ba23268..e4a6e820e 100644
--- a/app/models/champ.rb
+++ b/app/models/champ.rb
@@ -5,6 +5,8 @@ class Champ < ActiveRecord::Base
delegate :libelle, :type_champ, :order_place, :mandatory, :description, :drop_down_list, to: :type_de_champ
+ after_save :internal_notification, if: Proc.new { !dossier.nil? }
+
def mandatory?
mandatory
end
@@ -36,14 +38,22 @@ class Champ < ActiveRecord::Base
end
def self.regions
- JSON.parse(Carto::GeoAPI::Driver.regions).sort_by{|e| e['nom']}.inject([]){|acc, liste| acc.push(liste['nom']) }
+ JSON.parse(Carto::GeoAPI::Driver.regions).sort_by { |e| e['nom'] }.inject([]) { |acc, liste| acc.push(liste['nom']) }
end
def self.departements
- JSON.parse(Carto::GeoAPI::Driver.departements).inject([]){|acc, liste| acc.push(liste['code'] + ' - ' + liste['nom']) }.push('99 - Étranger')
+ JSON.parse(Carto::GeoAPI::Driver.departements).inject([]) { |acc, liste| acc.push(liste['code'] + ' - ' + liste['nom']) }.push('99 - Étranger')
end
def self.pays
- JSON.parse(Carto::GeoAPI::Driver.pays).inject([]){|acc, liste| acc.push(liste['nom']) }
+ JSON.parse(Carto::GeoAPI::Driver.pays).inject([]) { |acc, liste| acc.push(liste['nom']) }
+ end
+
+ private
+
+ def internal_notification
+ unless dossier.state == 'draft'
+ NotificationService.new('champs', self.dossier.id, self.libelle).notify
+ end
end
end
diff --git a/app/models/commentaire.rb b/app/models/commentaire.rb
index e59138ccb..09c147dd4 100644
--- a/app/models/commentaire.rb
+++ b/app/models/commentaire.rb
@@ -3,4 +3,18 @@ class Commentaire < ActiveRecord::Base
belongs_to :champ
belongs_to :piece_justificative
+
+ after_save :internal_notification
+
+ def header
+ "#{email}, " + created_at.localtime.strftime('%d %b %Y %H:%M')
+ end
+
+ private
+
+ def internal_notification
+ if email == dossier.user.email || dossier.invites_user.pluck(:email).to_a.include?(email)
+ NotificationService.new('commentaire', self.dossier.id).notify
+ end
+ end
end
diff --git a/app/models/dossier.rb b/app/models/dossier.rb
index 8bd92395a..e3f719e38 100644
--- a/app/models/dossier.rb
+++ b/app/models/dossier.rb
@@ -27,6 +27,7 @@ class Dossier < ActiveRecord::Base
has_many :invites, dependent: :destroy
has_many :invites_user, class_name: 'InviteUser', dependent: :destroy
has_many :follows
+ has_many :notifications, dependent: :destroy
belongs_to :procedure
belongs_to :user
@@ -41,6 +42,7 @@ class Dossier < ActiveRecord::Base
after_save :build_default_champs, if: Proc.new { procedure_id_changed? }
after_save :build_default_individual, if: Proc.new { procedure.for_individual? }
+ after_save :internal_notification
validates :user, presence: true
@@ -55,7 +57,15 @@ class Dossier < ActiveRecord::Base
EN_INSTRUCTION = %w(submitted received)
A_INSTRUIRE = %w(received)
TERMINE = %w(closed refused without_continuation)
- ALL_STATE = %w(draft initiated updated replied validated submitted received closed refused without_continuation)
+ ALL_STATE = %w(initiated updated replied validated submitted received closed refused without_continuation)
+
+ def unreaded_notifications
+ @unreaded_notif ||= notifications.where(already_read: false)
+ end
+
+ def first_unread_notification
+ unreaded_notifications.order("created_at ASC").first
+ end
def retrieve_last_piece_justificative_by_type(type)
pieces_justificatives.where(type_de_piece_justificative_id: type).last
@@ -76,7 +86,9 @@ class Dossier < ActiveRecord::Base
end
def build_default_individual
- Individual.new(dossier_id: id).save(validate: false)
+ if Individual.where(dossier_id: self.id).count == 0
+ Individual.create(dossier: self)
+ end
end
def ordered_champs
@@ -95,14 +107,6 @@ class Dossier < ActiveRecord::Base
commentaires.order(created_at: :desc)
end
- def sous_domaine
- if Rails.env.production?
- 'tps'
- else
- 'tps-dev'
- end
- end
-
def next_step! role, action
unless %w(initiate follow update comment valid submit receive refuse without_continuation close).include?(action)
fail 'action is not valid'
@@ -172,58 +176,10 @@ class Dossier < ActiveRecord::Base
state
end
- def all_state?
- ALL_STATE.include?(state)
- end
-
def brouillon?
BROUILLON.include?(state)
end
- def nouveaux?
- NOUVEAUX.include?(state)
- end
-
- def waiting_for_gestionnaire?
- WAITING_FOR_GESTIONNAIRE.include?(state)
- end
-
- def waiting_for_user?
- WAITING_FOR_USER.include?(state)
- end
-
- def en_construction?
- EN_CONSTRUCTION.include?(state)
- end
-
- def ouvert?
- OUVERT.include?(state)
- end
-
- def deposes?
- DEPOSES.include?(state)
- end
-
- def valides?
- VALIDES.include?(state)
- end
-
- def fige?
- VALIDES.include?(state)
- end
-
- def a_instruire?
- A_INSTRUIRE.include?(state)
- end
-
- def en_instruction?
- EN_INSTRUCTION.include?(state)
- end
-
- def termine?
- TERMINE.include?(state)
- end
-
def self.all_state order = 'ASC'
where(state: ALL_STATE, archived: false).order("updated_at #{order}")
end
@@ -362,10 +318,6 @@ class Dossier < ActiveRecord::Base
follows.size
end
- def total_commentaire
- self.commentaires.size
- end
-
def submit!
self.deposit_datetime= DateTime.now
@@ -385,11 +337,11 @@ class Dossier < ActiveRecord::Base
(invites_user.pluck :email).include? email
end
- def self.word_is_an_integer word
- return 0 if Float(word) > 2147483647
+ private
- Float(word)
- rescue ArgumentError
- 0
+ def internal_notification
+ if state_changed? && state == 'submitted'
+ NotificationService.new('submitted', self.id).notify
+ end
end
end
diff --git a/app/models/gestionnaire.rb b/app/models/gestionnaire.rb
index 70c4d7ba7..c944d93a6 100644
--- a/app/models/gestionnaire.rb
+++ b/app/models/gestionnaire.rb
@@ -8,16 +8,16 @@ class Gestionnaire < ActiveRecord::Base
has_many :assign_to, dependent: :destroy
has_many :procedures, through: :assign_to
- has_many :dossiers, through: :procedures
+ has_many :dossiers, -> { where.not(state: :draft) }, through: :procedures
has_many :follows
has_many :preference_list_dossiers
after_create :build_default_preferences_list_dossier
after_create :build_default_preferences_smart_listing_page
- after_update :sync_credentials, if: -> { Features.unified_login }
+ after_update :sync_credentials
def dossiers_follow
- dossiers.joins(:follows).where("follows.gestionnaire_id = #{id}")
+ @dossiers_follow ||= dossiers.joins(:follows).where("follows.gestionnaire_id = #{id}")
end
def toggle_follow_dossier dossier_id
@@ -63,6 +63,34 @@ class Gestionnaire < ActiveRecord::Base
PreferenceSmartListingPage.create(page: 1, procedure: nil, gestionnaire: self, liste: 'a_traiter')
end
+ def notifications
+ Notification.where(already_read: false, dossier_id: follows.pluck(:dossier_id) ).order("updated_at DESC")
+ end
+
+ def notifications_for procedure
+ procedure_ids = dossiers_follow.pluck(:procedure_id)
+
+ if procedure_ids.include?(procedure.id)
+ return dossiers_follow.where(procedure_id: procedure.id)
+ .inject(0) do |acc, dossier|
+ acc += dossier.notifications.where(already_read: false).count
+ end
+ end
+ 0
+ end
+
+ def dossier_with_notification_for procedure
+ procedure_ids = dossiers_follow.pluck(:procedure_id)
+
+ if procedure_ids.include?(procedure.id)
+ return dossiers_follow.where(procedure_id: procedure.id)
+ .inject(0) do |acc, dossier|
+ acc += ((dossier.notifications.where(already_read: false).count) > 0 ? 1 : 0)
+ end
+ end
+ 0
+ end
+
private
def valid_couple_table_attr? table, column
@@ -88,12 +116,7 @@ class Gestionnaire < ActiveRecord::Base
def sync_credentials
if email_changed? || encrypted_password_changed?
- user = User.find_by(email: email_was)
- if user
- return user.update_columns(
- email: email,
- encrypted_password: encrypted_password)
- end
+ return SyncCredentialsService.new(Gestionnaire, email_was, email, encrypted_password).change_credentials!
end
true
end
diff --git a/app/models/individual.rb b/app/models/individual.rb
index 324438c48..59d3ffc48 100644
--- a/app/models/individual.rb
+++ b/app/models/individual.rb
@@ -2,8 +2,4 @@ class Individual < ActiveRecord::Base
belongs_to :dossier
validates_uniqueness_of :dossier_id
-
- validates :nom, presence: true, allow_nil: false, allow_blank: false
- validates :prenom, presence: true, allow_nil: false, allow_blank: false
- validates :birthdate, presence: true, allow_nil: false, allow_blank: false
end
diff --git a/app/models/notification.rb b/app/models/notification.rb
new file mode 100644
index 000000000..4ff810f37
--- /dev/null
+++ b/app/models/notification.rb
@@ -0,0 +1,19 @@
+class Notification < ActiveRecord::Base
+ belongs_to :dossier
+
+ # after_save :broadcast_notification
+
+ enum type_notif: {
+ commentaire: 'commentaire',
+ cerfa: 'cerfa',
+ piece_justificative: 'piece_justificative',
+ champs: 'champs',
+ submitted: 'submitted'
+ }
+
+ # def broadcast_notification
+ # ActionCable.server.broadcast 'notifications',
+ # message: "Dossier n°#{self.dossier.id} : #{self.liste.last}",
+ # dossier: {id: self.dossier.id}
+ # end
+end
diff --git a/app/models/piece_justificative.rb b/app/models/piece_justificative.rb
index e1a0df9c8..0c2056b6a 100644
--- a/app/models/piece_justificative.rb
+++ b/app/models/piece_justificative.rb
@@ -13,6 +13,8 @@ class PieceJustificative < ActiveRecord::Base
validates :content, :file_size => {:maximum => 20.megabytes}
validates :content, presence: true, allow_blank: false, allow_nil: false
+ after_save :internal_notification, if: Proc.new { !dossier.nil? }
+
def empty?
content.blank?
end
@@ -43,4 +45,12 @@ class PieceJustificative < ActiveRecord::Base
image/jpeg
"
end
+
+ private
+
+ def internal_notification
+ unless self.type_de_piece_justificative.nil? && dossier.state == 'draft'
+ NotificationService.new('piece_justificative', self.dossier.id, self.libelle).notify
+ end
+ end
end
diff --git a/app/models/preference_list_dossier.rb b/app/models/preference_list_dossier.rb
index 0fa14f24e..b7880d5c1 100644
--- a/app/models/preference_list_dossier.rb
+++ b/app/models/preference_list_dossier.rb
@@ -96,22 +96,26 @@ class PreferenceListDossier < ActiveRecord::Base
def self.columns_champs_procedure procedure_id
table = 'champs'
- Procedure.find(procedure_id).types_de_champ.inject({}) do |acc, type_de_champ|
- acc = acc.merge({
- "type_de_champ_#{type_de_champ.id}" => create_column(type_de_champ.libelle, table, type_de_champ.id, 'value', 2)
- }) if type_de_champ.field_for_list?
- acc
+ if procedure = Procedure.find_by(id: procedure_id)
+ procedure.types_de_champ.inject({}) do |acc, type_de_champ|
+ acc = acc.merge({
+ "type_de_champ_#{type_de_champ.id}" => create_column(type_de_champ.libelle, table, type_de_champ.id, 'value', 2)
+ }) if type_de_champ.field_for_list?
+ acc
+ end
end
end
def self.columns_champs_private_procedure procedure_id
table = 'champs_private'
- Procedure.find(procedure_id).types_de_champ_private.inject({}) do |acc, type_de_champ|
- acc = acc.merge({
- "type_de_champ_private_#{type_de_champ.id}" => create_column(type_de_champ.libelle, table, type_de_champ.id, 'value', 2)
- }) if type_de_champ.field_for_list?
- acc
+ if procedure = Procedure.find_by(id: procedure_id)
+ procedure.types_de_champ_private.inject({}) do |acc, type_de_champ|
+ acc = acc.merge({
+ "type_de_champ_private_#{type_de_champ.id}" => create_column(type_de_champ.libelle, table, type_de_champ.id, 'value', 2)
+ }) if type_de_champ.field_for_list?
+ acc
+ end
end
end
@@ -126,4 +130,4 @@ class PreferenceListDossier < ActiveRecord::Base
filter: nil
}
end
-end
\ No newline at end of file
+end
diff --git a/app/models/user.rb b/app/models/user.rb
index 23794964c..34d245e48 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -15,7 +15,7 @@ class User < ActiveRecord::Base
delegate :given_name, :family_name, :email_france_connect, :gender, :birthdate, :birthplace, :france_connect_particulier_id, to: :france_connect_information
accepts_nested_attributes_for :france_connect_information
- after_update :sync_credentials, if: -> { Features.unified_login }
+ after_update :sync_credentials
def self.find_for_france_connect email, siret
user = User.find_by_email(email)
@@ -39,12 +39,7 @@ class User < ActiveRecord::Base
def sync_credentials
if email_changed? || encrypted_password_changed?
- gestionnaire = Gestionnaire.find_by(email: email_was)
- if gestionnaire
- return gestionnaire.update_columns(
- email: email,
- encrypted_password: encrypted_password)
- end
+ return SyncCredentialsService.new(User, email_was, email, encrypted_password).change_credentials!
end
true
end
diff --git a/app/serializers/cerfa_serializer.rb b/app/serializers/cerfa_serializer.rb
index 2fbfa1be9..5580dca10 100644
--- a/app/serializers/cerfa_serializer.rb
+++ b/app/serializers/cerfa_serializer.rb
@@ -1,7 +1,6 @@
class CerfaSerializer < ActiveModel::Serializer
-
attributes :created_at,
- :content_url => :url
+ :content_url
has_one :user
end
\ No newline at end of file
diff --git a/app/serializers/piece_justificative_serializer.rb b/app/serializers/piece_justificative_serializer.rb
index c4a3cbba0..9f999bfe1 100644
--- a/app/serializers/piece_justificative_serializer.rb
+++ b/app/serializers/piece_justificative_serializer.rb
@@ -1,7 +1,7 @@
class PieceJustificativeSerializer < ActiveModel::Serializer
attributes :created_at,
:type_de_piece_justificative_id,
- :content_url => :url
+ :content_url
has_one :user
end
\ No newline at end of file
diff --git a/app/serializers/type_de_champ_serializer.rb b/app/serializers/type_de_champ_serializer.rb
index bbe2cb7dc..32f10627c 100644
--- a/app/serializers/type_de_champ_serializer.rb
+++ b/app/serializers/type_de_champ_serializer.rb
@@ -1,7 +1,7 @@
class TypeDeChampSerializer < ActiveModel::Serializer
attributes :id,
:libelle,
- {:type_champ => :type},
+ :type_champ,
:order_place,
:description
end
\ No newline at end of file
diff --git a/app/services/accompagnateur_service.rb b/app/services/accompagnateur_service.rb
index 2babc2e93..df4e56825 100644
--- a/app/services/accompagnateur_service.rb
+++ b/app/services/accompagnateur_service.rb
@@ -12,7 +12,7 @@ class AccompagnateurService
if @to == ASSIGN
AssignTo.create(gestionnaire: @accompagnateur, procedure: @procedure)
elsif @to == NOT_ASSIGN
- AssignTo.delete_all(gestionnaire: @accompagnateur, procedure: @procedure)
+ AssignTo.where(gestionnaire: @accompagnateur, procedure: @procedure).delete_all
end
end
diff --git a/app/services/browser_service.rb b/app/services/browser_service.rb
new file mode 100644
index 000000000..09f0837a4
--- /dev/null
+++ b/app/services/browser_service.rb
@@ -0,0 +1,19 @@
+class BrowserService
+
+ def self.get_browser request
+ BROWSER.value = Browser.new(request.user_agent)
+ end
+
+ def self.recommended_browser?
+ browser = BROWSER.value
+
+ return false if browser.chrome? && browser.version.to_i < 40
+ return false if browser.ie?(["<10"])
+ return false if browser.firefox? && browser.version.to_i < 45
+ return false if browser.opera? && browser.version.to_i < 19
+ return false if browser.safari? && browser.version.to_i < 8
+
+ true
+ end
+
+end
\ No newline at end of file
diff --git a/app/services/champs_service.rb b/app/services/champs_service.rb
index faf25cf7c..04fdf9602 100644
--- a/app/services/champs_service.rb
+++ b/app/services/champs_service.rb
@@ -19,9 +19,9 @@ class ChampsService
end
end
- champ.save
+ champ.save if champ.changed?
end
errors
end
-end
\ No newline at end of file
+end
diff --git a/app/services/dossiers_list_gestionnaire_service.rb b/app/services/dossiers_list_gestionnaire_service.rb
index cfd6bf63e..85d0b32e5 100644
--- a/app/services/dossiers_list_gestionnaire_service.rb
+++ b/app/services/dossiers_list_gestionnaire_service.rb
@@ -7,6 +7,7 @@ class DossiersListGestionnaireService
def dossiers_to_display
{'nouveaux' => nouveaux,
+ 'suivi' => suivi,
'a_traiter' => ouvert,
'fige' => fige,
'deposes' => deposes,
@@ -16,13 +17,17 @@ class DossiersListGestionnaireService
end
def self.dossiers_liste_libelle
- ['nouveaux', 'a_traiter', 'fige' ,'deposes', 'a_instruire', 'termine', 'all_state']
+ ['nouveaux', 'suivi', 'a_traiter', 'fige', 'deposes', 'a_instruire', 'termine', 'all_state']
end
def all_state
@all_state ||= filter_dossiers.all_state
end
+ def suivi
+ @suivi ||= @current_devise_profil.dossiers_follow.merge(all_state)
+ end
+
def nouveaux
@nouveaux ||= filter_dossiers.nouveaux
end
@@ -49,7 +54,7 @@ class DossiersListGestionnaireService
def filter_dossiers
@filter_dossiers ||= @procedure.nil? ? @current_devise_profil.dossiers.joins(joins_filter).where(where_filter) : @procedure.dossiers.joins(joins_filter).where(where_filter)
- @filter_dossiers.uniq
+ @filter_dossiers.distinct
end
def filter_procedure_reset!
@@ -84,20 +89,22 @@ class DossiersListGestionnaireService
def change_page! new_page
pref = current_preference_smart_listing_page
- unless pref.liste == @liste && pref.procedure == @procedure
- pref.liste = @liste
- pref.procedure = @procedure
+ if pref
+ unless pref.liste == @liste && pref.procedure == @procedure
+ pref.liste = @liste
+ pref.procedure = @procedure
- if new_page.nil?
- pref.page = 1
+ if new_page.nil?
+ pref.page = 1
+ pref.save
+ end
+ end
+
+ unless new_page.nil?
+ pref.page = new_page
pref.save
end
end
-
- unless new_page.nil?
- pref.page = new_page
- pref.save
- end
end
def change_sort! new_sort
@@ -183,4 +190,5 @@ class DossiersListGestionnaireService
def current_preference_smart_listing_page
@current_devise_profil.preference_smart_listing_page
end
+
end
diff --git a/app/services/france_connect_service.rb b/app/services/france_connect_service.rb
index 0e8b398eb..883169e70 100644
--- a/app/services/france_connect_service.rb
+++ b/app/services/france_connect_service.rb
@@ -1,12 +1,4 @@
class FranceConnectService
- def self.retrieve_user_informations_entreprise code
- client = FranceConnectEntrepriseClient.new code: code
-
- access_token = client.access_token!(client_auth_method: :secret)
- user_info = access_token.userinfo!
- Hashie::Mash.new user_info.raw_attributes
- end
-
def self.retrieve_user_informations_particulier code
client = FranceConnectParticulierClient.new code: code
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
new file mode 100644
index 000000000..01bfe97e3
--- /dev/null
+++ b/app/services/notification_service.rb
@@ -0,0 +1,42 @@
+class NotificationService
+
+ def initialize type_notif, dossier_id, attribut_change=''
+ @type_notif = type_notif
+ @dossier_id = dossier_id
+
+ notification.liste.push text_for_notif attribut_change
+ notification.liste = notification.liste.uniq
+
+ self
+ end
+
+ def notify
+ notification.save
+ end
+
+ def notification
+ @notification ||=
+ begin
+ Notification.find_by! dossier_id: @dossier_id, already_read: false, type_notif: @type_notif
+ rescue ActiveRecord::RecordNotFound
+ Notification.new dossier_id: @dossier_id, type_notif: @type_notif, liste: []
+ end
+ end
+
+ def text_for_notif attribut=''
+ case @type_notif
+ when 'commentaire'
+ "#{notification.liste.size + 1} nouveau(x) commentaire(s) déposé(s)."
+ when 'cerfa'
+ "Un nouveau formulaire a été déposé."
+ when 'piece_justificative'
+ attribut
+ when 'champs'
+ attribut
+ when 'submitted'
+ "Le dossier n°#{@dossier_id} a été déposé."
+ else
+ 'Notification par défaut'
+ end
+ end
+end
diff --git a/app/services/render_partial_service.rb b/app/services/render_partial_service.rb
new file mode 100644
index 000000000..efb5ed2ab
--- /dev/null
+++ b/app/services/render_partial_service.rb
@@ -0,0 +1,37 @@
+class RenderPartialService
+
+ attr_accessor :controller, :method
+
+ def initialize controller, method
+ @controller = controller
+ @method = method
+ end
+
+ def navbar
+ retrieve_navbar
+ end
+
+ def left_panel
+ retrieve_left_panel
+ end
+
+ def self.left_panel_exist? left_panel_url
+ file = left_panel_url.split('/').last
+
+ File.exist?(Rails.root.join('app','views', 'layouts', 'left_panels', '_'+file+'.html.haml'))
+ end
+
+ private
+
+ def retrieve_navbar
+ 'layouts/navbars/navbar_' + retrieve_name
+ end
+
+ def retrieve_left_panel
+ 'layouts/left_panels/left_panel_' + retrieve_name
+ end
+
+ def retrieve_name
+ controller.to_s.parameterize.underscore + '_' + method.to_s
+ end
+end
diff --git a/app/services/switch_devise_profile_service.rb b/app/services/switch_devise_profile_service.rb
new file mode 100644
index 000000000..64e0ed29b
--- /dev/null
+++ b/app/services/switch_devise_profile_service.rb
@@ -0,0 +1,25 @@
+class SwitchDeviseProfileService
+ def initialize warden
+ @warden = warden
+ end
+
+ def multiple_devise_profile_connect?
+ user_signed_in? && gestionnaire_signed_in? ||
+ gestionnaire_signed_in? && administrateur_signed_in? ||
+ user_signed_in? && administrateur_signed_in?
+ end
+
+ private
+
+ def user_signed_in?
+ !@warden.authenticate(:scope => :user).nil?
+ end
+
+ def gestionnaire_signed_in?
+ !@warden.authenticate(:scope => :gestionnaire).nil?
+ end
+
+ def administrateur_signed_in?
+ !@warden.authenticate(:scope => :administrateur).nil?
+ end
+end
\ No newline at end of file
diff --git a/app/services/sync_credentials_service.rb b/app/services/sync_credentials_service.rb
new file mode 100644
index 000000000..491ec1d55
--- /dev/null
+++ b/app/services/sync_credentials_service.rb
@@ -0,0 +1,38 @@
+class SyncCredentialsService
+
+ def initialize klass, email_was, email, encrypted_password
+ @klass = klass
+ @email_was = email_was
+ @email = email
+ @encrypted_password = encrypted_password
+ end
+
+ def change_credentials!
+ unless @klass == User
+ user = User.find_by(email: @email_was)
+ if user
+ return user.update_columns(
+ email: @email,
+ encrypted_password: @encrypted_password)
+ end
+ end
+
+ unless @klass == Gestionnaire
+ gestionnaire = Gestionnaire.find_by(email: @email_was)
+ if gestionnaire
+ return gestionnaire.update_columns(
+ email: @email,
+ encrypted_password: @encrypted_password)
+ end
+ end
+
+ unless @klass == Administrateur
+ administrateur = Administrateur.find_by(email: @email_was)
+ if administrateur
+ return administrateur.update_columns(
+ email: @email,
+ encrypted_password: @encrypted_password)
+ end
+ end
+ end
+end
diff --git a/app/services/types_de_champ_service.rb b/app/services/types_de_champ_service.rb
index 8a6c7a066..b8397d3a4 100644
--- a/app/services/types_de_champ_service.rb
+++ b/app/services/types_de_champ_service.rb
@@ -7,9 +7,10 @@ class TypesDeChampService
.permit("#{attributes}" => [:libelle, :description, :order_place, :type_champ, :id, :mandatory, :type,
drop_down_list_attributes: [:value, :id]])
- parameters[attributes].each do |param|
- if param.second[:libelle].empty?
- parameters[attributes].delete(param.first.to_s)
+
+ parameters[attributes].each do |param_first, param_second|
+ if param_second[:libelle].empty?
+ parameters[attributes].delete(param_first.to_s)
end
end
diff --git a/app/views/admin/accompagnateurs/_list_assign.html.haml b/app/views/admin/accompagnateurs/_list_assign.html.haml
index e83b58d21..3dac05419 100644
--- a/app/views/admin/accompagnateurs/_list_assign.html.haml
+++ b/app/views/admin/accompagnateurs/_list_assign.html.haml
@@ -8,7 +8,7 @@
- @accompagnateurs_assign.each do |accompagnateur|
%tr
- %td.col-md-1.col-lg-1.center
+ %td.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center
%a.btn.btn-primary{href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: AccompagnateurService::NOT_ASSIGN)}", 'data-method' => 'put'}
.fa.fa-arrow-left
%td{style:'padding-top: 11px; font-size:15px; text-align:right'}= accompagnateur.email
diff --git a/app/views/admin/accompagnateurs/_list_not_assign.html.haml b/app/views/admin/accompagnateurs/_list_not_assign.html.haml
index 8d036f9ae..e5b206f97 100644
--- a/app/views/admin/accompagnateurs/_list_not_assign.html.haml
+++ b/app/views/admin/accompagnateurs/_list_not_assign.html.haml
@@ -3,7 +3,7 @@
= text_field_tag :filter, '', class: "search form-control",
placeholder: "Recherche...", autocomplete: :off
%button.btn.btn-primary{type: :submit}
- %span.glyphicon.glyphicon-search
+ %span.fa.fa-search
- unless smart_listing.empty?
@@ -14,9 +14,9 @@
- @accompagnateurs_not_assign.each do |accompagnateur|
%tr
- %td.col-md-11.col-lg-11{style:'padding-top: 11px; font-size:15px'}= accompagnateur.email
+ %td.col-md-11.col-sm-11.col-xs-11.col-lg-11{style:'padding-top: 11px; font-size:15px'}= accompagnateur.email
%td.center
- %a.btn.btn-success{href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: AccompagnateurService::ASSIGN)}", 'data-method' => 'put'}
+ %a.btn.btn-success.gestionnaire-affectation{href: "#{admin_procedure_accompagnateurs_path(procedure_id: @procedure.id, accompagnateur_id: accompagnateur.id, to: AccompagnateurService::ASSIGN)}", 'data-method' => 'put'}
.fa.fa-arrow-right
diff --git a/app/views/admin/accompagnateurs/show.html.haml b/app/views/admin/accompagnateurs/show.html.haml
index e12a5e379..114f3729f 100644
--- a/app/views/admin/accompagnateurs/show.html.haml
+++ b/app/views/admin/accompagnateurs/show.html.haml
@@ -1,28 +1,23 @@
-=render partial: 'admin/procedures/head', locals: {active: 'Accompagnateurs'}
-
-#accompagnateur_form
- .row
- .col-md-6.col-lg-6
- %h3.text-info Disponibles
- = smart_listing_render :accompagnateurs_not_assign
-
- %br
- %h3
- =t('dynamics.admin.procedure.onglet_accompagnateurs.add.title')
- #procedure_new.section.section-label
- = form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f|
- .row
- .col-md-5.col-lg-5
- = hidden_field_tag :procedure_id, params[:procedure_id]
- =render partial: 'admin/gestionnaires/informations', locals: {f: f}
- .col-md-2.col-lg-2
- %br
- %br
- =f.submit 'Valider', class: 'btn btn-info', style: 'float:left'
-
- .col-md-6.col-lg-6
- %h3.text-success Affectés
-
- = smart_listing_render :accompagnateurs_assign
-
+.row.white-back
+ #accompagnateur_form
+ .row
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
+ %h3.text-info Disponibles
+ = smart_listing_render :accompagnateurs_not_assign
+ %br
+ %h3
+ = t('dynamics.admin.procedure.onglet_accompagnateurs.add.title')
+ #procedure_new.section.section-label
+ = form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f|
+ .row
+ .col-md-5.col-sm-5.col-xs-5.col-lg-5
+ = hidden_field_tag :procedure_id, params[:procedure_id]
+ =render partial: 'admin/gestionnaires/informations', locals: {f: f}
+ .col-md-2.col-sm-2.col-xs-2.col-lg-2
+ %br
+ %br
+ = f.submit 'Valider', class: 'btn btn-info', style: 'float:left', id: 'add-gestionnaire-email'
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
+ %h3.text-success Affectés
+ = smart_listing_render :accompagnateurs_assign
diff --git a/app/views/admin/gestionnaires/_informations.html.haml b/app/views/admin/gestionnaires/_informations.html.haml
index 6ee5146e4..b7c9a268c 100644
--- a/app/views/admin/gestionnaires/_informations.html.haml
+++ b/app/views/admin/gestionnaires/_informations.html.haml
@@ -1,5 +1,5 @@
-{email: 'Email*'}.each do |key, value|
- .form-group{class: ('has-error' if @gestionnaire.errors.messages[key])}
+ .form-group
%h4
- =value
- =f.text_field key, class: 'form-control', placeholder: value
+ = value
+ = f.text_field key, class: 'form-control', placeholder: value
diff --git a/app/views/admin/gestionnaires/_list.html.haml b/app/views/admin/gestionnaires/_list.html.haml
index caceecc00..48cdd8f68 100644
--- a/app/views/admin/gestionnaires/_list.html.haml
+++ b/app/views/admin/gestionnaires/_list.html.haml
@@ -8,11 +8,11 @@
%tr
%td{style:'padding-top: 11px; font-size:15px'}= gestionnaire.email
%td{ style: 'text-align:right' }
- .delete.btn.btn-sm.glyphicon.glyphicon-remove
+ .delete.btn.btn-sm.fa.fa-trash
.confirm
=link_to 'Valider', admin_gestionnaire_path(id: gestionnaire.id), {method: :delete, class: 'btn btn-sm btn-success'}
- .cancel.btn.btn-sm.btn-danger.glyphicon.glyphicon-minus{style: 'top: 0'}
+ .cancel.btn.btn-sm.btn-danger.fa.fa-minus{style: 'top: 0'}
= smart_listing.paginate
= smart_listing.pagination_per_page_links
diff --git a/app/views/admin/gestionnaires/index.html.haml b/app/views/admin/gestionnaires/index.html.haml
index 78803f487..23860546f 100644
--- a/app/views/admin/gestionnaires/index.html.haml
+++ b/app/views/admin/gestionnaires/index.html.haml
@@ -2,18 +2,18 @@
%br
.row
- .col-md-4.col-lg-4
+ .col-md-4.col-sm-4.col-xs-4.col-lg-4
= smart_listing_render :gestionnaires
- .col-md-1.col-lg-1
+ .col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1
- .col-md-6.col-lg-6
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
%h3 Ajouter un accompagnateur
#procedure_new.section.section-label
= form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f|
.row
- .col-md-5.col-lg-5
- =render partial: 'informations', locals: {f: f}
- .col-md-2.col-lg-2
+ .col-md-5.col-sm-5.col-xs-5.col-lg-5
+ = render partial: 'informations', locals: {f: f}
+ .col-md-2.col-sm-2.col-xs-2.col-lg-2
%br
%br
- =f.submit 'Valider', class: 'btn btn-info', style: 'float:left'
+ = f.submit 'Valider', class: 'btn btn-info', style: 'float:left'
diff --git a/app/views/admin/mails/index.html.haml b/app/views/admin/mails/index.html.haml
index a910f76fe..14c6db2eb 100644
--- a/app/views/admin/mails/index.html.haml
+++ b/app/views/admin/mails/index.html.haml
@@ -1,29 +1,28 @@
-=render partial: 'admin/procedures/head', locals: {active: 'E-mails'}
+.row.white-back
+ %h3
+ E-mail d'accusé de réception
-%h3
- E-mail d'accusé de réception
-
-- unless @procedure.mail_received.blank?
- = form_for @procedure.mail_received, url: {controller: 'admin/mails', action: 'update', id: @procedure.mail_received.id} do |f|
- =f.text_field :object, {class:'form-control', style:'width: 40%'}
- %br
- =f.text_area :body, {class: 'form-control wysihtml5'}
- %br
- =f.submit 'Mettre à jour', {class:'btn btn-success', style:'float: right'}
+ - unless @procedure.mail_received.blank?
+ = form_for @procedure.mail_received, url: {controller: 'admin/mails', action: 'update', id: @procedure.mail_received.id} do |f|
+ =f.text_field :object, {class:'form-control', style:'width: 40%'}
+ %br
+ =f.text_area :body, {class: 'form-control wysihtml5'}
+ %br
+ =f.submit 'Mettre à jour', {class:'btn btn-success', style:'float: right'}
-%table.table{style:'width: 50%'}
- %tr
- %th
- Balise
- %th
- Description
- - MailTemplate.tags.each do |balise|
+ %table.table{style:'width: 50%'}
%tr
- %td.center
- %b.text-success
- \--
- = balise.first
- \--
- %td
- =balise.second[:description]
+ %th
+ Balise
+ %th
+ Description
+ - MailTemplate.tags.each do |balise|
+ %tr
+ %td.center
+ %b.text-success
+ \--
+ = balise.first
+ \--
+ %td
+ =balise.second[:description]
diff --git a/app/views/admin/pieces_justificatives/_fields.html.haml b/app/views/admin/pieces_justificatives/_fields.html.haml
index aaa552edd..f44cf396a 100644
--- a/app/views/admin/pieces_justificatives/_fields.html.haml
+++ b/app/views/admin/pieces_justificatives/_fields.html.haml
@@ -20,7 +20,7 @@
.form-group
%br
- if ff.object.id.nil?
- = f.submit('Ajouter la pièce', class: 'btn btn-success')
+ = f.submit('Ajouter la pièce', class: 'btn btn-success', id: 'add_piece_justificative')
- else
= link_to("", admin_procedure_piece_justificative_path(@procedure, ff.object.id), method: :delete, remote: true, id: "delete_type_de_piece_justificative_#{ff.object.id}", class: %w(form-control btn btn-danger fa fa-trash-o) )
diff --git a/app/views/admin/pieces_justificatives/show.html.haml b/app/views/admin/pieces_justificatives/show.html.haml
index 5ca55f972..3b381440a 100644
--- a/app/views/admin/pieces_justificatives/show.html.haml
+++ b/app/views/admin/pieces_justificatives/show.html.haml
@@ -1,4 +1,3 @@
-=render partial: 'admin/procedures/head', locals: {active: 'Pieces'}
-
-#piece_justificative_form
- = render 'form'
\ No newline at end of file
+.row.white-back
+ #piece_justificative_form
+ = render 'form'
diff --git a/app/views/admin/previsualisations/show.html.haml b/app/views/admin/previsualisations/show.html.haml
index 01c815d6b..bda53fd41 100644
--- a/app/views/admin/previsualisations/show.html.haml
+++ b/app/views/admin/previsualisations/show.html.haml
@@ -1,4 +1,3 @@
-=render partial: 'admin/procedures/head', locals: {active: 'Prévisualisation'}
-
-#previsualisation
- =render 'users/description/show'
\ No newline at end of file
+.row.white-back
+ #previsualisation
+ = render 'users/description/show'
diff --git a/app/views/admin/procedures/_head.html.haml b/app/views/admin/procedures/_head.html.haml
deleted file mode 100644
index f3ca2c1b7..000000000
--- a/app/views/admin/procedures/_head.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-%h2.text-info
- -unless @procedure.logo.blank?
- = image_tag @procedure.decorate.logo_img, style: 'width: 30px'
- =@procedure.libelle
-%br
-
-%ul.nav.nav-tabs
- = render partial: 'admin/procedures/navbar', locals: {active: active}
\ No newline at end of file
diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml
index d22e32166..bf5776e99 100644
--- a/app/views/admin/procedures/_informations.html.haml
+++ b/app/views/admin/procedures/_informations.html.haml
@@ -2,17 +2,17 @@
%br
-{libelle: 'Libellé*', description: 'Description*', organisation: 'Organisation', direction: 'Direction', lien_site_web: 'Lien site internet', lien_notice: 'Lien notice'}.each do |key, value|
- .form-group{class: ('has-error' if @procedure.errors.messages[key])}
+ .form-group
%h4
- =value
+ = value
- if key == :description
= f.text_area key, rows: '6', placeholder: 'Description du projet', class: 'form-control wysihtml5'
- else
- =f.text_field key, class: 'form-control', placeholder: value
+ = f.text_field key, class: 'form-control', placeholder: value
.row
- .col-md-6.col-lg-6
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
%h4 Logo de la procédure
- unless @procedure.logo.blank?
= image_tag @procedure.decorate.logo_img, {style: 'height: 40px; display: inline; margin-right: 6px', id: 'preview_procedure_logo'}
@@ -21,7 +21,7 @@
%div{style:'margin-top:5px'}
%i
Fichier accepté : JPG / JPEG / PNG
- .col-md-6.col-lg-6
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
%h4 Drapeau européen
%label
=f.check_box :euro_flag
@@ -30,7 +30,7 @@
%br
.row
- .col-md-6.col-lg-6
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
%h4 Cartographie
= f.fields_for :module_api_carto, @procedure.module_api_carto do |ff|
@@ -48,7 +48,7 @@
= ff.check_box :cadastre
Cadastre
- .col-md-6.col-lg-6
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
%h4 Formulaire / CERFA
%label
=f.check_box :cerfa_flag
@@ -58,7 +58,7 @@
%br
.row
- .col-md-6.col-lg-6
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
%h4 Particuliers
%div
%label
diff --git a/app/views/admin/procedures/_list.html.haml b/app/views/admin/procedures/_list.html.haml
index 459585388..e1ae6bfb4 100644
--- a/app/views/admin/procedures/_list.html.haml
+++ b/app/views/admin/procedures/_list.html.haml
@@ -1,5 +1,5 @@
- unless smart_listing.empty?
- %table.table
+ %table.table#dossiers_list
%thead
%th#ID= smart_listing.sortable 'ID', 'id'
%th#libelle= smart_listing.sortable 'Libellé', 'libelle'
@@ -10,21 +10,23 @@
- @procedures.each do |procedure|
- procedure = procedure.decorate
- %tr
+ %tr{id: "tr_dossier_#{procedure.id}", 'data-dossier_url' => admin_procedure_path(id: procedure.id)}
%td= procedure.id
- %td.col-md-6.col-lg-6
- = link_to(procedure.libelle, "/admin/procedures/#{procedure.id}")
+ %td.col-md-6.col-sm-6.col-xs-6.col-lg-6
+ = procedure.libelle
- if @active_class
- %td= link_to procedure.lien, procedure.lien
+ %td= link_to procedure.lien, procedure.lien, class: 'procedure-lien', 'data-method' => :get
%td
= procedure.created_at_fr
%td
- = link_to('Cloner', admin_procedure_clone_path(procedure.id), 'data-method' => :put, class: 'btn-sm btn-primary')
+ = link_to('Cloner', admin_procedure_clone_path(procedure.id), 'data-method' => :put, class: 'btn-sm btn-primary clone-btn')
- unless procedure.published? || procedure.archived?
= link_to('X', url_for(controller: 'admin/procedures', action: :destroy, id: procedure.id), 'data-method' => :delete, class: 'btn-sm btn-danger')
= smart_listing.paginate
= smart_listing.pagination_per_page_links
+ %br
+
- else
%h4.center
diff --git a/app/views/admin/procedures/_navbar.html.haml b/app/views/admin/procedures/_navbar.html.haml
deleted file mode 100644
index b9a736f4f..000000000
--- a/app/views/admin/procedures/_navbar.html.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-%li{ class: ('active' if active == 'Informations') }
- = link_to('Informations', admin_procedure_path(@procedure))
-
-%li{ class: ('active' if active == 'Accompagnateurs') }
- = link_to(t('dynamics.admin.procedure.onglets.accompagnateurs'), admin_procedure_accompagnateurs_path(@procedure))
-
-%li{ class: ('disabled' if @procedure.locked?) || ('active' if active == 'Description') }
- = link_to_unless(@procedure.locked?, 'Description', edit_admin_procedure_path(@procedure)) do
- = link_to('Description', '#')
-
-%li{ class: ('disabled' if @procedure.locked?) || ('active' if active == 'Champs') }
- = link_to_unless(@procedure.locked?, 'Champs', admin_procedure_types_de_champ_path(@procedure)) do
- = link_to('Champs', '#')
-
-%li{ class: ('disabled' if @procedure.locked?) || ('active' if active == 'Pieces') }
- = link_to_unless(@procedure.locked?, 'Pièces justificatives', admin_procedure_pieces_justificatives_path(@procedure)) do
- = link_to('Pièces justificatives', '#')
-
-%li{ class: ('disabled' if @procedure.locked?) || ('active' if active == 'Champs privés') }
- = link_to_unless(@procedure.locked?, 'Champs privés', admin_procedure_types_de_champ_private_path(@procedure)) do
- = link_to('Champs privés', '#')
-
-%li{ class: ('active' if active == 'E-mails') }
- = link_to('E-mails', admin_procedure_mails_path(@procedure))
-
-%li{ class: ('active' if active == 'Prévisualisation'), style: 'float:right' }
- = link_to('Prévisualisation', admin_procedure_previsualisation_path(@procedure), {style: 'font-style: italic;'})
\ No newline at end of file
diff --git a/app/views/admin/procedures/edit.html.haml b/app/views/admin/procedures/edit.html.haml
index afbfaf50f..c1a2c7dbe 100644
--- a/app/views/admin/procedures/edit.html.haml
+++ b/app/views/admin/procedures/edit.html.haml
@@ -1,8 +1,7 @@
-= render partial: 'head', locals: {active: 'Description'}
-
-#procedure_new.section.section-label
- = form_for @procedure, url: url_for({controller: 'admin/procedures', action: :update, id: @procedure.id}), multipart: true do |f|
- = render partial: 'informations', locals: {f: f}
- = f.submit 'Editer', class: 'btn btn-success', style: 'float:right'
-%br
-%br
+.row.white-back
+ #procedure_new.section.section-label
+ = form_for @procedure, url: url_for({controller: 'admin/procedures', action: :update, id: @procedure.id}), multipart: true do |f|
+ = render partial: 'informations', locals: {f: f}
+ = f.submit 'Editer', class: 'btn btn-success', style: 'float:right'
+ %br
+ %br
diff --git a/app/views/admin/procedures/index.html.haml b/app/views/admin/procedures/index.html.haml
index 825ad5f5e..8ebb524ef 100644
--- a/app/views/admin/procedures/index.html.haml
+++ b/app/views/admin/procedures/index.html.haml
@@ -1,8 +1,14 @@
-= link_to(t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure'), "/admin/procedures/new", class: 'btn btn-success', style: 'float:right; margin-top:2%;')
-%h1
- =t('dynamics.admin.dossiers.tableau_de_bord.title')
-%br
+#admins_index
+ .default_data_block.default_visible
+ %div.row.show-block#new_dossiers
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ Procédures
+ %a{href:'/admin/procedures/new'}
+ %div#new-procedure.col-lg-2.col-md-2.col-sm-2.col-xs-2.action
+ Nouvelle
-= render partial: 'onglets'
-
-= smart_listing_render :procedures
+ %div.body
+ = smart_listing_render :procedures
diff --git a/app/views/admin/procedures/new.html.haml b/app/views/admin/procedures/new.html.haml
index 391adde06..b6c555d99 100644
--- a/app/views/admin/procedures/new.html.haml
+++ b/app/views/admin/procedures/new.html.haml
@@ -1,10 +1,8 @@
-%h2
- =t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure')
+.row.white-back
+ %h2
+ =t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure')
-#procedure_new.section.section-label
- = form_for @procedure, url: {controller: 'admin/procedures', action: :create}, multipart: true do |f|
- =render partial: 'informations', locals: {f: f}
- =f.submit 'Valider', class: 'btn btn-info', style: 'float:right'
- %br
- %br
- %br
\ No newline at end of file
+ #procedure_new.section.section-label
+ = form_for @procedure, url: {controller: 'admin/procedures', action: :create}, multipart: true do |f|
+ = render partial: 'informations', locals: {f: f}
+ = f.submit 'Valider', class: 'btn btn-info', id: 'save-procedure', style: 'float:right'
diff --git a/app/views/admin/procedures/show.html.haml b/app/views/admin/procedures/show.html.haml
index b250fbda5..26e940142 100644
--- a/app/views/admin/procedures/show.html.haml
+++ b/app/views/admin/procedures/show.html.haml
@@ -1,126 +1,134 @@
-#procedure_show
- =render partial: 'head', locals: {active: 'Informations'}
-
- -unless @facade.procedure.published?
- - if @facade.procedure.gestionnaires.size == 0
- %a.action_button.btn.btn-success{style:'float: right; margin-top: 10px', disabled: 'disabled', 'data-toggle' => :tooltip, title: 'Vous ne pouvez pas publier une procédure sans qu\'aucun accompagnateur ne soit affecté à celle-ci.'}
- %i.fa.fa-eraser
- Publier
- -else
- %a#publish.btn.btn-success{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px'}
- %i.fa.fa-eraser
- Publier
-
- =render partial: '/admin/procedures/modal_publish'
-
- %a#transfer.btn.btn-small.btn-default{"data-target" => "#transferModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px; margin-right: 10px'}
- %i.fa.fa-exchange
- Transférer
-
- =render partial: '/admin/procedures/modal_transfer'
-
- -if @facade.procedure.archived?
- %a#reenable.btn.btn-small.btn-default.text-info{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px'}
- %i.fa.fa-eraser
- Réactiver
-
- =render partial: '/admin/procedures/modal_publish'
-
- -elsif @facade.procedure.published?
- = form_tag admin_procedure_archive_path(procedure_id: @facade.procedure.id, archive: !@facade.procedure.archived?), method: :put, style:'float: right; margin-top: 10px' do
- %button#archive.btn.btn-small.btn-default.text-info{type: :button}
- %i.fa.fa-eraser
- = 'Archiver'
- #confirm
- %button#valid.btn.btn-small.btn-success{type: :submit}
- %i.fa.fa-check
- Valider
- %button#cancel.btn.btn-small.btn-danger{type: :button}
- %i.fa.fa-remove
- Annuler
-
- - if @facade.procedure.locked?
- #procedure_locked.center
- %h5
- .label.label-info La procédure ne peut plus être modifiée car elle a été publiée
-
- %div
- %h3 Lien procédure
- %div{style:'margin-left:3%'}
- -if @facade.procedure.archived?
- %b
- Cette procédure a été archivée et n'est plus accessible par le public.
- -elsif @facade.procedure.published?
- = @facade.procedure.lien
- -else
- %b
- Cette procédure n'a pas encore été publiée et n'est donc pas accessible par le public.
-
- %br
- %h3 Détails
-
- .row{style:'margin-right:3%; margin-left:3%;'}
- .description.col-md-4.col-lg-4
- %h4.text-info
- = @facade.procedure.libelle
-
- = h @facade.procedure.description.html_safe
- .champs.col-md-4.col-lg-4
- %h4.text-info
- Champs
- .badge.progress-bar-info
- = @facade.procedure.types_de_champ.size
- - @facade.procedure.types_de_champ.each do |champ|
- = champ.libelle
- %br
-
- .pieces_justificatives.col-md-4.col-lg-4
- %h4.text-info
- Pièces justificatives
- .badge.progress-bar-info
- = @facade.procedure.types_de_piece_justificative.size
- - @facade.procedure.types_de_piece_justificative.each do |piece_justificative|
- = piece_justificative.libelle
- %br
- %br
- %h3
- =t('dynamics.admin.procedure.stats.title')
-
- .row
- .col-md-6.col-lg-6{style:'margin-left:3%'}
- %h4 Total
- %div
- = @facade.dossiers_total
-
- %h4.text-danger Attente Accompagnateur
- %div
- = @facade.dossiers_waiting_gestionnaire_total
-
- %h4.text-info Attente Utilisateur
- %div
- = @facade.dossiers_waiting_user_total
-
- %h4.text-success Terminé
- %div
- = @facade.dossiers_termine_total
-
- %h4 Archivé
-
- - unless @facade.dossiers_archived_total == 0
- %ul
- - @facade.dossiers_archived_by_state_total.each do |dossier|
- %li
- = dossier.display_state
- \:
- = dossier.total
+.row.white-back
+ #procedure_show
+ -unless @facade.procedure.published?
+ - if @facade.procedure.gestionnaires.size == 0
+ %a.action_button.btn.btn-success{style:'float: right; margin-top: 10px', disabled: 'disabled', 'data-toggle' => :tooltip, title: 'Vous ne pouvez pas publier une procédure sans qu\'aucun accompagnateur ne soit affecté à celle-ci.', id: 'publish-procedure'}
+ %i.fa.fa-eraser
+ Publier
- else
- %p
- 0
+ %a.btn.btn-success{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px', id: 'publish-procedure'}
+ %i.fa.fa-eraser
+ Publier
- .col-md-5.col-lg-5
- %h4 Non archivés
- = javascript_include_tag "https://code.highcharts.com/highcharts.js", "chartkick"
- - if @facade.dossiers_for_pie_highchart.blank?
- Aucune statistique pour le moment
- -else
- =pie_chart @facade.dossiers_for_pie_highchart
\ No newline at end of file
+ =render partial: '/admin/procedures/modal_publish'
+
+ %a#transfer.btn.btn-small.btn-default{"data-target" => "#transferModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px; margin-right: 10px'}
+ %i.fa.fa-exchange
+ Transférer
+
+ =render partial: '/admin/procedures/modal_transfer'
+
+ - if @facade.procedure.archived?
+ %a#reenable.btn.btn-small.btn-default.text-info{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px'}
+ %i.fa.fa-eraser
+ Réactiver
+
+ = render partial: '/admin/procedures/modal_publish'
+
+ - elsif @facade.procedure.published?
+ = form_tag admin_procedure_archive_path(procedure_id: @facade.procedure.id, archive: !@facade.procedure.archived?), method: :put, style:'float: right; margin-top: 10px' do
+ %button#archive.btn.btn-small.btn-default.text-info{type: :button}
+ %i.fa.fa-eraser
+ = 'Archiver'
+ #confirm
+ %button#valid.btn.btn-small.btn-success{type: :submit}
+ %i.fa.fa-check
+ Valider
+ %button#cancel.btn.btn-small.btn-danger{type: :button}
+ %i.fa.fa-remove
+ Annuler
+
+ - if @facade.procedure.locked?
+ #procedure_locked.center
+ %h5
+ .label.label-info La procédure ne peut plus être modifiée car elle a été publiée
+
+ %div
+ %h3 Lien procédure
+ %div{style:'margin-left:3%'}
+ - if @facade.procedure.archived?
+ %b
+ Cette procédure a été archivée et n'est plus accessible par le public.
+ - elsif @facade.procedure.published?
+ = @facade.procedure.lien
+ - else
+ %b
+ Cette procédure n'a pas encore été publiée et n'est donc pas accessible par le public.
+
+ %br
+ %h3 Détails
+
+ .row{style:'margin-right:3%; margin-left:3%;'}
+ .description.col-md-3.col-sm-3.col-xs-3.col-lg-3
+ %h4.text-info
+ = @facade.procedure.libelle
+
+ = h @facade.procedure.description.html_safe
+ .champs.col-md-3.col-sm-3.col-xs-3.col-lg-3
+ %h4.text-info
+ Champs
+ .badge.progress-bar-info
+ = @facade.procedure.types_de_champ.size
+ - @facade.procedure.types_de_champ.order(:order_place).each do |champ|
+ = champ.libelle
+ %br
+
+ .champs_private.col-md-3.col-sm-3.col-xs-3.col-lg-3
+ %h4.text-info
+ Champs privés
+ .badge.progress-bar-info
+ = @facade.procedure.types_de_champ_private.size
+ - @facade.procedure.types_de_champ_private.order(:order_place).each do |champ|
+ = champ.libelle
+ %br
+
+ .pieces_justificatives.col-md-3.col-sm-3.col-xs-3.col-lg-3
+ %h4.text-info
+ Pièces justificatives
+ .badge.progress-bar-info
+ = @facade.procedure.types_de_piece_justificative.size
+ - @facade.procedure.types_de_piece_justificative.each do |piece_justificative|
+ = piece_justificative.libelle
+ %br
+ %br
+ %h3
+ =t('dynamics.admin.procedure.stats.title')
+
+ .row
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6{style:'margin-left:3%'}
+ %h4 Total
+ %div
+ = @facade.dossiers_total
+
+ %h4.text-danger Attente Accompagnateur
+ %div
+ = @facade.dossiers_waiting_gestionnaire_total
+
+ %h4.text-info Attente Utilisateur
+ %div
+ = @facade.dossiers_waiting_user_total
+
+ %h4.text-success Terminé
+ %div
+ = @facade.dossiers_termine_total
+
+ %h4 Archivé
+
+ - unless @facade.dossiers_archived_total == 0
+ %ul
+ - @facade.dossiers_archived_by_state_total.each do |dossier|
+ %li
+ = dossier.display_state
+ \:
+ = dossier.total
+ - else
+ %p
+ 0
+
+ .col-md-5.col-sm-5.col-xs-5.col-lg-5
+ %h4 Non archivés
+ = javascript_include_tag "https://code.highcharts.com/highcharts.js", "chartkick"
+ - if @facade.dossiers_for_pie_highchart.blank?
+ Aucune statistique pour le moment
+ - else
+ =pie_chart @facade.dossiers_for_pie_highchart
diff --git a/app/views/admin/types_de_champ/show.html.haml b/app/views/admin/types_de_champ/show.html.haml
index bed676c74..1ec8b0871 100644
--- a/app/views/admin/types_de_champ/show.html.haml
+++ b/app/views/admin/types_de_champ/show.html.haml
@@ -1,4 +1,3 @@
-=render partial: 'admin/procedures/head', locals: {active: @types_de_champ_facade.active}
-
-#liste_champ
- = render partial: 'admin/types_de_champ/form'
\ No newline at end of file
+.row.white-back
+ #liste_champ
+ = render partial: 'admin/types_de_champ/form'
diff --git a/app/views/administrateurs/_login_banner.html.haml b/app/views/administrateurs/_login_banner.html.haml
index 90353b334..5bd922746 100644
--- a/app/views/administrateurs/_login_banner.html.haml
+++ b/app/views/administrateurs/_login_banner.html.haml
@@ -1,27 +1 @@
-%div{ style: "decorate:none; display: flex;box-shadow:none; float:right; display: flex" }
- %div{ style: "vertical-align: middle; margin-right: 10px; margin-top: auto; margin-bottom: auto;" }
- = current_administrateur.email
- .dropdown#admin_menu
- %button.btn.btn-default.dropdown-toggle#dropdownMenuAdmin{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false}
- %i.fa.fa-cog
- %span.caret
- %ul.dropdown-menu.dropdown-menu-right
- %li
- = link_to(admin_procedures_path, id: :menu_item_procedure) do
- %i.fa.fa-list{ style: "background-size: 10px;"}
-
- =t('dynamics.admin.menu.procedures')
- %li
- = link_to(admin_gestionnaires_path) do
- %i.fa.fa-user
-
- =t('dynamics.admin.menu.accompagnateurs')
- %li.divider{ role: :separator}
- %li
- = link_to(admin_profile_path, id: :profile) do
- %i.fa.fa-user
- Profile
- %li
- = link_to('/administrateurs/sign_out',id: :admin_sign_out, method: :delete) do
- %i.fa.fa-power-off
- Se déconnecter
+= link_to "", "/administrateurs/sign_out", method: :delete, class: "btn btn-md fa fa-sign-out"
diff --git a/app/views/administrateurs/sessions/new.html.haml b/app/views/administrateurs/sessions/new.html.haml
index 2c2185b9b..4dda316e2 100644
--- a/app/views/administrateurs/sessions/new.html.haml
+++ b/app/views/administrateurs/sessions/new.html.haml
@@ -13,14 +13,14 @@
= f.label :email
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-user
+ %span.fa.fa-user
= f.email_field :email, class: 'form-control'
%br
%h4
= f.label 'Mot de passe'
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-asterisk
+ %span.fa.fa-asterisk
= f.password_field :password, class: 'form-control', value: @administrateur.password
%br
%br
diff --git a/app/views/administrations/_list.html.haml b/app/views/administrations/_list.html.haml
index 6a20b807e..c31059e24 100644
--- a/app/views/administrations/_list.html.haml
+++ b/app/views/administrations/_list.html.haml
@@ -1,10 +1,10 @@
- unless smart_listing.empty?
%table.table
%thead
- %th.col-md-4.col-lg-4= smart_listing.sortable 'Email', :email
- %th.col-md-4.col-lg-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at
- %th.col-md-2.col-lg-2 Procédure active
- %th.col-md-2.col-lg-2 Dossier en cours
+ %th.col-md-4.col-sm-4.col-xs-4.col-lg-4= smart_listing.sortable 'Email', :email
+ %th.col-md-4.col-sm-4.col-xs-4.col-lg-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at
+ %th.col-md-2.col-sm-2.col-xs-2.col-lg-2 Procédure active
+ %th.col-md-2.col-sm-2.col-xs-2.col-lg-2 Dossier en cours
- @admins.each do |admin|
%tr
diff --git a/app/views/backoffice/commentaires/_commentaire.html.haml b/app/views/backoffice/commentaires/_commentaire.html.haml
new file mode 100644
index 000000000..c6eb31717
--- /dev/null
+++ b/app/views/backoffice/commentaires/_commentaire.html.haml
@@ -0,0 +1,14 @@
+%div.commentaire
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.comment-header
+ = commentaire.header
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.content
+ = commentaire.body.html_safe
+ - if file = commentaire.piece_justificative
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.file
+ = link_to file.content_url, class: 'link', target: '_blank' do
+ %span.fa.fa-file
+ %div
+ = file.original_filename
diff --git a/app/views/backoffice/dossiers/_filter_framed.html.haml b/app/views/backoffice/dossiers/_filter_framed.html.haml
index 35c60c7f8..5e8337870 100644
--- a/app/views/backoffice/dossiers/_filter_framed.html.haml
+++ b/app/views/backoffice/dossiers/_filter_framed.html.haml
@@ -2,7 +2,7 @@
.panel-heading
= preference.libelle
- =form_tag @dossiers_list_facade.filter_url, {class: 'panel-body form-inline', method: :post} do
+ =form_tag @facade_data_view.filter_url, {class: 'panel-body form-inline', method: :post} do
%input.form-control.filter_input{name: "filter_input[#{preference.table_attr}]", style:'width: 69%', value: "#{preference.filter}"}
%button.btn.btn-sm.btn-success
%i.fa.fa-check
diff --git a/app/views/backoffice/dossiers/_follow_action.html.haml b/app/views/backoffice/dossiers/_follow_action.html.haml
deleted file mode 100644
index c695c9942..000000000
--- a/app/views/backoffice/dossiers/_follow_action.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- if current_gestionnaire.follow?(@facade.dossier.id)
- = link_to('Se désabonner'.html_safe, backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-danger', id: "suivre_dossier_#{@facade.dossier.id}")
--else
- = link_to("S'abonner", backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'btn btn-md btn-primary', id: "suivre_dossier_#{@facade.dossier.id}")
diff --git a/app/views/backoffice/dossiers/_followers.html.haml b/app/views/backoffice/dossiers/_followers.html.haml
index be87860b8..4578680fd 100644
--- a/app/views/backoffice/dossiers/_followers.html.haml
+++ b/app/views/backoffice/dossiers/_followers.html.haml
@@ -3,7 +3,7 @@
%br
.row
- .col-md-4.col-lg-4
+ .col-md-4.col-sm-4.col-xs-4.col-lg-4
- if @facade.followers.size > 0
%ul
- @facade.followers.each do |follower|
diff --git a/app/views/backoffice/dossiers/_list.html.haml b/app/views/backoffice/dossiers/_list.html.haml
index 7b2f7dbd5..41674a174 100644
--- a/app/views/backoffice/dossiers/_list.html.haml
+++ b/app/views/backoffice/dossiers/_list.html.haml
@@ -1,22 +1,34 @@
%table#dossiers_list.table
%thead
- - @dossiers_list_facade.preference_list_dossiers_filter.each do |preference|
+ - if smart_listing.name.to_s == 'follow_dossiers'
+ %th
+ %i.fa.fa-bell
+ - @facade_data_view.preference_list_dossiers_filter.each do |preference|
%th{class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}"}
- if preference.table.to_s.include? 'champs'
= preference.libelle
-else
= smart_listing.sortable preference.libelle, preference.table_attr
- - if @dossiers_list_facade.active_filter? preference
- %i.filter.fa.fa-filter{style: "cursor: pointer; margin-left:3px; font-size: 1.1em; color:#{(preference.filter.blank? ? 'grey' : 'orange')}", id: "filter_"+preference.table_attr.sub('.', '_')}
- = render partial: 'backoffice/dossiers/filter_framed', locals:{preference: preference, filter_framed_id: "framed_filter_"+preference.table_attr.sub('.', '_')}
+ - if @facade_data_view.active_filter? preference
+ %i.filter.fa.fa-filter{style: "color:#{(preference.filter.blank? ? 'grey' : 'orange')}", id: "filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}"}
+ = render partial: 'backoffice/dossiers/filter_framed', locals:{preference: preference, filter_framed_id: "framed_filter_#{smart_listing.name.to_s}_#{preference.table_attr.sub('.', '_')}"}
- %th.col-md-1.col-lg-1.center Actions
- %th.col-md-1.col-lg-1.center Abonnés
+ %th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center Actions
+ %th.col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1.center Abonnés
- unless smart_listing.empty?
- - @dossiers.each do |dossier|
- %tr{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => backoffice_dossier_url(id: dossier.id)}
- - @dossiers_list_facade.preference_list_dossiers_filter.each_with_index do |preference, index|
+ - smart_listing.collection.each do |dossier|
+ %tr.dossier-row{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => backoffice_dossier_url(id: dossier.id)}
+ - if smart_listing.name.to_s == 'follow_dossiers'
+ %td.center
+ - total_notif = dossier.notifications.where(already_read: false).count
+ - if total_notif == 0
+ .badge.progress-bar-default
+ = total_notif
+ - else
+ .badge.progress-bar-warning
+ = total_notif
+ - @facade_data_view.preference_list_dossiers_filter.each_with_index do |preference, index|
%td
- if preference.table.nil? || preference.table.empty?
- value = dossier.decorate.public_send(preference.attr_decorate)
@@ -41,7 +53,10 @@
= dossier.total_follow
= smart_listing.paginate
-= smart_listing.pagination_per_page_links
+- if smart_listing.name.to_s == 'follow_dossiers'
+ = smart_listing.pagination_per_page_links
+ %br
+
- if smart_listing.empty?
%h4.center
diff --git a/app/views/backoffice/dossiers/_onglets.html.haml b/app/views/backoffice/dossiers/_onglets.html.haml
deleted file mode 100644
index b35281247..000000000
--- a/app/views/backoffice/dossiers/_onglets.html.haml
+++ /dev/null
@@ -1,71 +0,0 @@
-#filter_by_procedure{style:'margin-left: 2%'}
- %b.text-info
- = t('dynamics.backoffice.filter_procedure.title')
- %select{onchange: 'location = this.value', style:'margin-top: 10px; margin-bottom: 10px', id: 'filter_by_procedure_select'}
- %option{value: backoffice_dossiers_path}
- = t('dynamics.backoffice.filter_procedure.first')
- - @dossiers_list_facade.gestionnaire_procedures_name_and_id_list.each do |procedure|
- %option{value: backoffice_dossiers_procedure_path(procedure[:id]), ('selected' if procedure[:id] == params[:id].to_i) => '' }
- = truncate(procedure[:libelle], {length: 50})
-
-#onglets
- %ul.nav.nav-tabs
- -unless Features.opensimplif
- %li{ class: (@dossiers_list_facade.nouveaux_class)}
- %a{:href => "#{url_for @dossiers_list_facade.nouveaux_url}", 'data-toggle' => :tooltip, title: 'Les nouveaux dossiers non ouverts.'}
- %h5.text-info
- = "Nouveaux "
- .badge.progress-bar-info
- =@dossiers_list_facade.nouveaux_total
-
- %li{ class: (@dossiers_list_facade.a_traiter_class) }
- %a{:href => "#{url_for @dossiers_list_facade.a_traiter_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ne sont pas encore déclarés complets.'}
- %h5.text-danger
- ="Ouverts"
- .badge.progress-bar-danger
- =@dossiers_list_facade.a_traiter_total
-
- %li{ class: (@dossiers_list_facade.fige_class) }
- %a{:href => "#{url_for @dossiers_list_facade.fige_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui sont déclarés complets et donc figés.'}
- %h5.text-default
- ="Figés"
- .badge.progress-bar-default
- =@dossiers_list_facade.fige_total
-
- %li{ class: (@dossiers_list_facade.deposes_class) }
- %a{:href => "#{url_for @dossiers_list_facade.deposes_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ont été validés et déposés par les usager qui attendent une réponse de bonne réception avant examen.'}
- %h5.text-purple
- ="À réceptionner"
- .badge.progress-bar-purple
- =@dossiers_list_facade.deposes_total
-
- %li{ class: (@dossiers_list_facade.a_instruire_class) }
- %a{:href => "#{url_for @dossiers_list_facade.a_instruire_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ont été notifiés comme bien réceptionnés et qui attendent un verdict final.'}
- %h5.text-warning
- = "À instruire"
- .badge.progress-bar-warning
- =@dossiers_list_facade.a_instruire_total
-
- %li{ class: (@dossiers_list_facade.termine_class) }
- %a{:href => "#{url_for @dossiers_list_facade.termine_url}",'data-toggle' => :tooltip, title: 'Tous les dossiers qui ont été traité avec un statut "Validé", "Refusé" ou "Sans suite "'}
- %h5.text-success
- = "Terminé"
- .badge.progress-bar-success
- =@dossiers_list_facade.termine_total
-
- %ul.nav.nav-tabs.navbar-right{style:'border-bottom: none;'}
- %li#search{ class: (@dossiers_list_facade.search_class) }
- %a
- = form_tag(backoffice_dossiers_search_url, method: :get) do
- .input-group{style:'width: 300px'}
- = text_field_tag('q', "#{@search_terms unless @search_terms.nil? }", id: 'q', placeholder: t('dynamics.backoffice.research.placeholder'), class:'form-control')
- %span.input-group-btn
- %button.btn.btn-default{ id:'search_button' }
- %i.fa.fa-search
-
- - if @dossiers_search.nil?
- %li#pref_list
- %a.btn#pref_list_dossier_open_action{href: '#'}
- %i.fa.fa-columns
-
-%br
diff --git a/app/views/backoffice/dossiers/_pref_list.html.haml b/app/views/backoffice/dossiers/_pref_list.html.haml
index 310852807..4815ca782 100644
--- a/app/views/backoffice/dossiers/_pref_list.html.haml
+++ b/app/views/backoffice/dossiers/_pref_list.html.haml
@@ -1,4 +1,4 @@
-%button#pref_list_dossier_close_action.btn.btn-danger.btn-xs{style:'float:right'}
+%button#pref_list_dossier_close_action.btn.btn-danger.btn-xs.fixed-right
%i.fa.fa-close
%h3
=t('dynamics.backoffice.pref_list.title')
@@ -10,7 +10,7 @@
Actuelles
%ul
- - @dossiers_list_facade.preference_list_dossiers_filter.each_with_index do |preference, index|
+ - @facade_data_view.preference_list_dossiers_filter.each_with_index do |preference, index|
%li
= form_tag backoffice_preference_list_dossier_delete_path, method: :delete, remote: true do
= hidden_field_tag :pref_id, preference.id
@@ -23,24 +23,25 @@
Disponibles
%table
- - PreferenceListDossier.available_columns_for(@dossiers_list_facade.procedure_id).each_with_index do |tables, index|
+ - PreferenceListDossier.available_columns_for(@facade_data_view.procedure_id).each_with_index do |tables, index|
- if index%2 == 0 || tables.first.to_s.include?('champs')
%tr
- %td.col-sm-5.col-md-5.col-lg-5{style: 'vertical-align: top', colspan: (tables.first == :champs ? 2 : 1)}
+ %td.col-sm-5.col-md-5.col-sm-5.col-xs-5.col-lg-5{style: 'vertical-align: top', colspan: (tables.first == :champs ? 2 : 1)}
%h5= tables.first.to_s.gsub('_', ' ').capitalize
%ul
- - tables.second.each do |columns|
- %li
- = form_tag backoffice_preference_list_dossier_add_path, method: :post, remote: true do
- = hidden_field_tag :libelle, columns.second[:libelle]
- = hidden_field_tag :table, columns.second[:table]
- = hidden_field_tag :attr, columns.second[:attr]
- = hidden_field_tag :attr_decorate, columns.second[:attr_decorate]
- = hidden_field_tag :bootstrap_lg, columns.second[:bootstrap_lg]
- = hidden_field_tag :procedure_id, @dossiers_list_facade.procedure_id
+ - if tables.second
+ - tables.second.each do |columns|
+ %li
+ = form_tag backoffice_preference_list_dossier_add_path, method: :post, remote: true do
+ = hidden_field_tag :libelle, columns.second[:libelle]
+ = hidden_field_tag :table, columns.second[:table]
+ = hidden_field_tag :attr, columns.second[:attr]
+ = hidden_field_tag :attr_decorate, columns.second[:attr_decorate]
+ = hidden_field_tag :bootstrap_lg, columns.second[:bootstrap_lg]
+ = hidden_field_tag :procedure_id, @facade_data_view.procedure_id
- = columns.second[:libelle]
- %button.btn.btn-default.btn-xs{type: :submit, id: "add_pref_list_#{columns.second[:table]}_#{columns.second[:attr]}"}
- %i.fa.fa-plus
+ = columns.second[:libelle]
+ %button.btn.btn-default.btn-xs{type: :submit, id: "add_pref_list_#{columns.second[:table]}_#{columns.second[:attr]}"}
+ %i.fa.fa-plus
diff --git a/app/views/backoffice/dossiers/_state_description.html.haml b/app/views/backoffice/dossiers/_state_description.html.haml
index b3d1946d1..280074d9d 100644
--- a/app/views/backoffice/dossiers/_state_description.html.haml
+++ b/app/views/backoffice/dossiers/_state_description.html.haml
@@ -2,9 +2,9 @@
.panel.panel-info
.panel-body.center
.row
- .col-md-1.col-lg-1
+ .col-md-1.col-lg-1.col-sm-1.col-xs-1.col-sm-1.col-xs-1
.fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'}
- .col-md-11.col-lg-11
+ .col-md-11.col-sm-11.col-xs-11.col-lg-11
-if dossiers_list_facade.liste == 'nouveaux'
Tous les dossiers présents dans cette liste sont ceux qui
%b
diff --git a/app/views/backoffice/dossiers/index.html.haml b/app/views/backoffice/dossiers/index.html.haml
index 9b239a510..adaeeed1e 100644
--- a/app/views/backoffice/dossiers/index.html.haml
+++ b/app/views/backoffice/dossiers/index.html.haml
@@ -2,35 +2,41 @@
#pref_list_menu
= render partial: 'backoffice/dossiers/pref_list'
- %h1
- =t('dynamics.backoffice.title')
+ .default_data_block
+ %div.row.show-block#new_dossiers
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ Nouveaux dossiers
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
+ =@facade_data_view.nouveaux_total
+ dossiers
+ %div.body
+ = smart_listing_render :new_dossiers
- %div.dropdown.pull-right#download_menu
- - if @dossiers_list_facade.dossiers_to_display.count > 400
- %button.btn.btn-error.dropdown-toggle#dropdownDownloadMenu{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false, class: 'disabled'}
- %span{'data-toggle' => :tooltip, "data-placement" => :left, title: 'Pour réduire le nombre de dossiers et ne pas dépasser la limite autorisée de 400, merci de bien vouloir appliquer des filtres.'}
- = t('dynamics.backoffice.limit_excess_download_all_dossiers')
- - else
- %button.btn.btn-success.dropdown-toggle#dropdownDownloadMenu{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
- %i.fa.fa-download
- = t('dynamics.backoffice.download_all_dossiers')
- %span.caret
- %ul.dropdown-menu.dropdown-menu-right
- %li
- = link_to backoffice_download_dossiers_tps_path(format: :csv, procedure_id: params[:id]), { class: 'btn btn-sm' } do
- = t('dynamics.backoffice.format_csv')
- %li
- = link_to backoffice_download_dossiers_tps_path(format: :xlsx, procedure_id: params[:id]), { class: 'btn btn-sm' } do
- = t('dynamics.backoffice.format_xlsx')
- %li
- = link_to backoffice_download_dossiers_tps_path(format: :ods, procedure_id: params[:id]), { class: 'btn btn-sm' } do
- = t('dynamics.backoffice.format_ods')
+ .default_data_block.default_visible
+ %div.row.show-block#follow_dossiers
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ Dossiers suivis
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
+ =@facade_data_view.suivi_total
+ dossiers
+ %div.body
+ = smart_listing_render :follow_dossiers
- = render partial: 'backoffice/dossiers/onglets'
-
- = smart_listing_render :dossiers
-
- %br
- %br
- - unless Features.opensimplif
- = render partial: 'backoffice/dossiers/state_description', locals: {dossiers_list_facade: @dossiers_list_facade}
+ .default_data_block
+ %div.row.show-block#all_dossiers
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ Tous les dossiers
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
+ =@facade_data_view.all_state_total
+ dossiers
+ %div.body
+ = smart_listing_render :all_state_dossiers
diff --git a/app/views/backoffice/dossiers/index.js.erb b/app/views/backoffice/dossiers/index.js.erb
index 876f677fd..14108f49a 100644
--- a/app/views/backoffice/dossiers/index.js.erb
+++ b/app/views/backoffice/dossiers/index.js.erb
@@ -1,4 +1,6 @@
-<%= smart_listing_update :dossiers %>
+<%= smart_listing_update :new_dossiers, {force: true} %>
+<%= smart_listing_update :follow_dossiers, {force: true} %>
+<%= smart_listing_update :all_state_dossiers, {force: true} %>
filters_init();
link_init();
\ No newline at end of file
diff --git a/app/views/backoffice/dossiers/search.html.haml b/app/views/backoffice/dossiers/search.html.haml
index a7e9fac0b..1f6383b21 100644
--- a/app/views/backoffice/dossiers/search.html.haml
+++ b/app/views/backoffice/dossiers/search.html.haml
@@ -1,4 +1,17 @@
#backoffice_search
- = render partial: 'onglets'
+ #pref_list_menu
+ = render partial: 'backoffice/dossiers/pref_list'
+
+ .default_data_block.default_visible
+ %div.row.show-block#new_dossiers
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ Résultat de la recherche
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
+ =@dossiers.count
+ dossiers
+ %div.body
+ = smart_listing_render :search
- = smart_listing_render :dossiers
\ No newline at end of file
diff --git a/app/views/backoffice/dossiers/search.js.erb b/app/views/backoffice/dossiers/search.js.erb
index 0f7d43419..2f95cb389 100644
--- a/app/views/backoffice/dossiers/search.js.erb
+++ b/app/views/backoffice/dossiers/search.js.erb
@@ -1,3 +1,3 @@
-<%= smart_listing_update :dossiers %>
+<%= smart_listing_update :search %>
filters_init();
\ No newline at end of file
diff --git a/app/views/backoffice/dossiers/show.html.haml b/app/views/backoffice/dossiers/show.html.haml
index 223c49508..1e8fd6961 100644
--- a/app/views/backoffice/dossiers/show.html.haml
+++ b/app/views/backoffice/dossiers/show.html.haml
@@ -1,18 +1,2 @@
-#backoffice_dossier_show
- %h1#dossier_id.text-info{ :style => 'text-align:right'}
- = t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s
-
- %div{:style => 'text-align:right'}
- %h3{:class => 'text-success'}
- = @facade.dossier.display_state
-
- = render partial: 'follow_action'
- - unless @facade.entreprise.nil?
- = render partial: '/dossiers/infos_entreprise'
-
- = render partial: '/dossiers/infos_dossier'
- %br
-
- %div
- = render partial: 'dossiers/tab_objects_dossier'
- %br
\ No newline at end of file
+%div.col-lg-12.col-md-12.col-sm-12.col-xs-12#backoffice_dossier_show
+ = render partial: "dossiers/dossier_show"
diff --git a/app/views/cgu/index.html.haml b/app/views/cgu/index.html.haml
index 0983ef0d5..37b16adb6 100644
--- a/app/views/cgu/index.html.haml
+++ b/app/views/cgu/index.html.haml
@@ -1,167 +1,174 @@
-%h2
- Condition d’utilisation du service « TPS » pour téléprocédure simplifiée
-%br
-%h3
- Editeur
-%p Ce service est proposé par le Secrétariat général pour la modernisation de l’action publique, un service interministériel du Premier Ministre, mis à disposition du ministère de la Réforme de l’Etat, de la Décentralisation et de la Fonction publique.
-%p Il est opéré par la Direction interministérielle du numérique et du système d'information et de communication de l'Etat (DINSIC).
-%p
-%p
- %strong Secrétariat Général pour la Modernisation de l’Action publique
- %br/
- 64-70 allée de Bercy
- %br/
- 75572 Paris Cedex 12
-%p
- %strong Directeur de la publication
-%p Laure de LA BRETECHE
-%p
- %strong Responsable éditorial
-%p Henri VERDIER
-%p
- %strong Responsable éditorial délégué
-%p Philippe VRIGNAUD
-%br
-%h3
- Ingénierie et hébergement informatique
-%p L'ingénierie du site est assurée par :
-%p
- %strong OVH
- %br/
- SAS au capital de 10 000 000 €
- %br/
- RCS Roubaix – Tourcoing 424 761 419 00045
- %br/
- Code APE 6202A
- %br/
- N° TVA : FR 22 424 761 419
- %br/
- Siège social : 2 rue Kellermann - 59100 Roubaix - France.
-%br
-%h3
- Object du site internet
- %a{:href => "https://tps.apientreprise.fr/"}
- %strong tps.apientreprise.fr
-%p
- Le site internet tps.apientreprise.fr a pour objet de faciliter la création de démarches administratives en ligne par les acteurs publics, et l’examen par plusieurs services des demandes formulées par les usagers auprès d’un ou organismes publics.
-%br
-%h3
- Acteurs de
- %a{:href => "https://tps.apientreprise.fr/"}
- TPS
-%p Les acteurs de TPS sont les suivants :
-%ul
- %li Le SGMAP qui héberge le service TPS, le maintien en condition opérationnelle et gère les droits d’accès
- %li L’administrateur au sein d’une administration donnée qui crée la démarche en ligne
- %li Le ou les accompagnateurs au sein d’une administration donnée, qui reçoivent les démarches des usagers, les accompagnent le cas échéant dans le bouclage de leurs dossier, instruisent la demande et décident des suites à donner aux demandes
- %li Les Usagers qui formulent les demandes en ligne via le formulaire qui leur est mis à disposition
-%br
-%h3
- Déclaration CNIL
-%p Le SGMAP a procédé à la déclaration CNIL de TPS. Celle-ci porte le numéro "1986658 v 0" à la date du 30 août 2016. Néanmoins les administrations devront procéder à une déclaration complémentaire auprès de la CNIL si les données du formulaire qu’elles ont produit comportent des données de la nature suivante :
-%ul
- %li N° de sécurité sociale,
- %li Infractions, condamnations, mesures de sécurité,
- %li
- %a{:href => "https://www.declaration.cnil.fr/declarations/declaration/donneesSensibles_DN.display.action"} Opinions philosophiques, politiques, religieuses, syndicales, vie sexuelle, données de santé, origine raciale.
-%br
-%h3
- Données collectées et responsabilité des organismes publics à l’initiative de démarches en ligne avec TPS.
-%p Les données collectées par le service sont définis par les services publics utilisateurs du service qui arrêtent, sous leur responsabilité, la liste des informations qui seront demandées à l’usager.
-%p Les organismes publics s’engagent à créer des démarches pour collecter les informations strictement nécessaires à l’examen des demandes formulées auprès des acteurs publics, dans le cadre juridique prévu par chacune des démarches.
-%p Ces données sont collectées et traitées par les seuls services concernés par l’examen des demandes, et précisées dans la notice d’utilisation de chaque démarche publiée par l’organisme public.
+#cgu
+ %h2
+ Condition d’utilisation du service « TPS » pour téléprocédure simplifiée
+ %br
+ %h3#editeur
+ Editeur
+ %p Ce service est proposé par le Secrétariat général pour la modernisation de l’action publique, un service interministériel du Premier Ministre, mis à disposition du ministère de la Réforme de l’Etat, de la Décentralisation et de la Fonction publique.
+ %p Il est opéré par la Direction interministérielle du numérique et du système d'information et de communication de l'Etat (DINSIC).
+ %p
+ %p
+ %strong Secrétariat Général pour la Modernisation de l’Action publique
+ %br/
+ 64-70 allée de Bercy
+ %br/
+ 75572 Paris Cedex 12
+ %p
+ %strong Directeur de la publication
+ %p Laure de LA BRETECHE
+ %p
+ %strong Responsable éditorial
+ %p Henri VERDIER
+ %p
+ %strong Responsable éditorial délégué
+ %p Philippe VRIGNAUD
+ %br
+ %h3#ingenieurie_hebergement
+ Ingénierie et hébergement informatique
+ %p L'ingénierie du site est assurée par :
+ %p
+ %strong OVH
+ %br/
+ SAS au capital de 10 000 000 €
+ %br/
+ RCS Roubaix – Tourcoing 424 761 419 00045
+ %br/
+ Code APE 6202A
+ %br/
+ N° TVA : FR 22 424 761 419
+ %br/
+ Siège social : 2 rue Kellermann - 59100 Roubaix - France.
+ %br
+ %h3#object_website
+ Object du site internet
+ %a{:href => "https://tps.apientreprise.fr/"}
+ %strong tps.apientreprise.fr
+ %p
+ Le site internet tps.apientreprise.fr a pour objet de faciliter la création de démarches administratives en ligne par les acteurs publics, et l’examen par plusieurs services des demandes formulées par les usagers auprès d’un ou organismes publics.
+ %br
+ %h3#acteurs
+ Acteurs de
+ %a{:href => "https://tps.apientreprise.fr/"}
+ TPS
+ %p Les acteurs de TPS sont les suivants :
+ %ul
+ %li Le SGMAP qui héberge le service TPS, le maintien en condition opérationnelle et gère les droits d’accès
+ %li L’administrateur au sein d’une administration donnée qui crée la démarche en ligne
+ %li Le ou les accompagnateurs au sein d’une administration donnée, qui reçoivent les démarches des usagers, les accompagnent le cas échéant dans le bouclage de leurs dossier, instruisent la demande et décident des suites à donner aux demandes
+ %li Les Usagers qui formulent les demandes en ligne via le formulaire qui leur est mis à disposition
+ %br
+ %h3#CNIL
+ Déclaration CNIL
+ %p Le SGMAP a procédé à la déclaration CNIL de TPS. Celle-ci porte le numéro "1986658 v 0" à la date du 30 août 2016. Néanmoins les administrations devront procéder à une déclaration complémentaire auprès de la CNIL si les données du formulaire qu’elles ont produit comportent des données de la nature suivante :
+ %ul
+ %li N° de sécurité sociale,
+ %li Infractions, condamnations, mesures de sécurité,
+ %li
+ %a{:href => "https://www.declaration.cnil.fr/declarations/declaration/donneesSensibles_DN.display.action"} Opinions philosophiques, politiques, religieuses, syndicales, vie sexuelle, données de santé, origine raciale.
+ %br
+ %h3#data_collects
+ Données collectées et responsabilité des organismes publics à l’initiative de démarches en ligne avec TPS.
+ %p Les données collectées par le service sont définis par les services publics utilisateurs du service qui arrêtent, sous leur responsabilité, la liste des informations qui seront demandées à l’usager.
+ %p Les organismes publics s’engagent à créer des démarches pour collecter les informations strictement nécessaires à l’examen des demandes formulées auprès des acteurs publics, dans le cadre juridique prévu par chacune des démarches.
+ %p Ces données sont collectées et traitées par les seuls services concernés par l’examen des demandes, et précisées dans la notice d’utilisation de chaque démarche publiée par l’organisme public.
-%br
-%h3 Traitement des données à caractère personnel
-%h4 Données personnelles :
-%p
- En application de la loi n°78-17 Informatique et Libertés du 6 janvier 1978, vous disposez d'un droit d'accès, de rectification, de modification et de suppression concernant les données qui vous concernent. Vous pouvez exercer ce droit à travers la rubrique
- %a{:href => "http://www.faire-simple.gouv.fr/contact"} Contact
-%h4 Données de connexion :
-%p Conformément à la loi n°2004-575 du 21 juin 2004 pour la confiance dans l’économie numérique, certaines données de connexion sont conservées par le service aux fins de protection contre les intrusions et de poursuites judiciaires le cas échéant. Ces données sont conservées pendant un an.
+ %br
+ %h3#individual_data
+ Traitement des données à caractère personnel
+ %h4 Données personnelles :
+ %p
+ En application de la loi n°78-17 Informatique et Libertés du 6 janvier 1978, vous disposez d'un droit d'accès, de rectification, de modification et de suppression concernant les données qui vous concernent. Vous pouvez exercer ce droit à travers la rubrique
+ %a{:href => "http://www.faire-simple.gouv.fr/contact"} Contact
+ %h4 Données de connexion :
+ %p Conformément à la loi n°2004-575 du 21 juin 2004 pour la confiance dans l’économie numérique, certaines données de connexion sont conservées par le service aux fins de protection contre les intrusions et de poursuites judiciaires le cas échéant. Ces données sont conservées pendant un an.
-%br
-%h3 Règles relatives aux informations sur les entreprises mises à disposition par les partenaires publics du SGMAP.
-%p Le service « TPS », opéré par le SGMAP propose l’affichage aux internautes d’informations issues de deux bases de données distinctes gérées par quatre organismes qui sont :
-%br
-%h4 L’INSEE :
-%p
- %strong Insee (Institut national de la statistique et des études économiques)
- %br/
- 18, boulevard Adolphe Pinard
- %br/
- 75675 Paris cedex 14
- %br/
- Tél. : 01 41 17 50 50
-%p
- %a{:href => "http://www.insee.fr/fr/bases-de-donnees/default.asp?page=sirene.htm"} Informations de la base SIRENE
- %br/
- %a{:href => "http://www.sirene.fr/sirene/public/static/mentions-legales"} Condition légales d’utilisation de service SIRENE
-%br
-%h4 INFOGREFFE :
-%p
- %strong INFOGREFFE
- %br/
- Immeuble Le Parisien
- %br/
- 5-7, avenue de Paris
- %br/
- 94300 VINCENNES
-%p
- Les informations transmises aux autorités publiques en charges de l’examen de dossiers de candidature sont définis par le service en ligne suivant proposé aux internautes :
- %a{:href => "https://www.infogreffe.fr/societes/documents-officiels/demande-kbis.html"} https://www.infogreffe.fr/societes/documents-officiels/demande-kbis.html
-%p
- %a{:href => "https://www.infogreffe.fr/societes/cgu-cgv.html"} Conditions générales d’utilisation des données d’infogreffe
+ %br
+ %h3#entreprise_information
+ Règles relatives aux informations sur les entreprises mises à disposition par les partenaires publics du SGMAP.
+ %p Le service « TPS », opéré par le SGMAP propose l’affichage aux internautes d’informations issues de deux bases de données distinctes gérées par quatre organismes qui sont :
+ %br
+ %h4 L’INSEE :
+ %p
+ %strong Insee (Institut national de la statistique et des études économiques)
+ %br/
+ 18, boulevard Adolphe Pinard
+ %br/
+ 75675 Paris cedex 14
+ %br/
+ Tél. : 01 41 17 50 50
+ %p
+ %a{:href => "http://www.insee.fr/fr/bases-de-donnees/default.asp?page=sirene.htm"} Informations de la base SIRENE
+ %br/
+ %a{:href => "http://www.sirene.fr/sirene/public/static/mentions-legales"} Condition légales d’utilisation de service SIRENE
+ %br
+ %h4 INFOGREFFE :
+ %p
+ %strong INFOGREFFE
+ %br/
+ Immeuble Le Parisien
+ %br/
+ 5-7, avenue de Paris
+ %br/
+ 94300 VINCENNES
+ %p
+ Les informations transmises aux autorités publiques en charges de l’examen de dossiers de candidature sont définis par le service en ligne suivant proposé aux internautes :
+ %a{:href => "https://www.infogreffe.fr/societes/documents-officiels/demande-kbis.html"} https://www.infogreffe.fr/societes/documents-officiels/demande-kbis.html
+ %p
+ %a{:href => "https://www.infogreffe.fr/societes/cgu-cgv.html"} Conditions générales d’utilisation des données d’infogreffe
-%br
-%h4 TPS fait appel à d’autres services opérés par le SGMAP afin de faciliter les démarches administratives :
-%br
-%p
- %strong> France CONNECT
- \ : informations complémentaires :
- %a{:href => "https://franceconnect.gouv.fr/"} https://franceconnect.gouv.fr/
-%p
- %strong La base d’adresse nationale :
- %a{:href => "https://adresse.data.gouv.fr/"} https://adresse.data.gouv.fr/
-%p
- %strong TPS est un service de l’Etat Plateforme :
+ %br
+ %h4 TPS fait appel à d’autres services opérés par le SGMAP afin de faciliter les démarches administratives :
+ %br
+ %p
+ %strong> France CONNECT
+ \ : informations complémentaires :
+ %a{:href => "https://franceconnect.gouv.fr/"} https://franceconnect.gouv.fr/
+ %p
+ %strong La base d’adresse nationale :
+ %a{:href => "https://adresse.data.gouv.fr/"} https://adresse.data.gouv.fr/
+ %p
+ %strong TPS est un service de l’Etat Plateforme :
- %a{:href => "http://etatplateforme.modernisation.gouv.fr/"} http://etatplateforme.modernisation.gouv.fr/
-%p
- %strong Il met en œuvre les principes définis par le programme « Dites-le nous une fois »
-%p
- %a{:href => "http://www.modernisation.gouv.fr/les-services-publics-se-simplifient-et-innovent/par-des-simplifications-pour-les-entreprises/dites-le-nous-une-fois-un-programme-pour-simplifier-la-vie-des-entreprises"} http://www.modernisation.gouv.fr/les-services-publics-se-simplifient-et-innovent/par-des-simplifications-pour-les-entreprises/dites-le-nous-une-fois-un-programme-pour-simplifier-la-vie-des-entreprises
-%br
-%h3 Droit de reproduction :
-%p Toute copie de pages du site doit avoir obtenu l’autorisation du directeur de la publication.
-%p La création de liens avec le site « tps.apientreprise.fr » est libre.
-%p Le SGMAP se réserve le droit de demander la suppression d’un lien qu’elle estime non conforme à l’objet du service « tps.apientreprise.fr » aux missions du SGMAP, ou plus généralement aux principes véhiculés par l’Administration.
-%p L’autorisation de création de liens est valable pour tout support, à l’exception de ceux diffusant des informations à caractère raciste, pornographique, xénophobe ou pouvant porter atteinte à la sensibilité du plus grand nombre.
-%p
- La rubrique
- %a{:href => "http://www.faire-simple.gouv.fr/contact"} Contactez-nous
- est à votre disposition pour nous faire part de vos remarques et suggestions.
-%br
-%h3 Propriété intellectuelle, droits d’auteur et copyright
-%p Ce service relève de la législation française et internationale sur le droit d'auteur et la propriété intellectuelle. Tous les droits de reproduction sont réservés, y compris pour les documents téléchargeables et les représentations iconographiques et photographiques.
-%p La reproduction de tout ou partie de ce site sur un support électronique quel qu'il soit est formellement interdite sauf autorisation expresse du Directeur de la publication (voir ci-après : Reproduction des contenus).
-%p Les marques citées sur ce site sont protégées par les organismes qui en sont propriétaires.
+ %a{:href => "http://etatplateforme.modernisation.gouv.fr/"} http://etatplateforme.modernisation.gouv.fr/
+ %p
+ %strong Il met en œuvre les principes définis par le programme « Dites-le nous une fois »
+ %p
+ %a{:href => "http://www.modernisation.gouv.fr/les-services-publics-se-simplifient-et-innovent/par-des-simplifications-pour-les-entreprises/dites-le-nous-une-fois-un-programme-pour-simplifier-la-vie-des-entreprises"} http://www.modernisation.gouv.fr/les-services-publics-se-simplifient-et-innovent/par-des-simplifications-pour-les-entreprises/dites-le-nous-une-fois-un-programme-pour-simplifier-la-vie-des-entreprises
+ %br
+ %h3#reproduction
+ Droit de reproduction :
+ %p Toute copie de pages du site doit avoir obtenu l’autorisation du directeur de la publication.
+ %p La création de liens avec le site « tps.apientreprise.fr » est libre.
+ %p Le SGMAP se réserve le droit de demander la suppression d’un lien qu’elle estime non conforme à l’objet du service « tps.apientreprise.fr » aux missions du SGMAP, ou plus généralement aux principes véhiculés par l’Administration.
+ %p L’autorisation de création de liens est valable pour tout support, à l’exception de ceux diffusant des informations à caractère raciste, pornographique, xénophobe ou pouvant porter atteinte à la sensibilité du plus grand nombre.
+ %p
+ La rubrique
+ %a{:href => "http://www.faire-simple.gouv.fr/contact"} Contactez-nous
+ est à votre disposition pour nous faire part de vos remarques et suggestions.
+ %br
+ %h3#propriete_intellectuelle
+ Propriété intellectuelle, droits d’auteur et copyright
+ %p Ce service relève de la législation française et internationale sur le droit d'auteur et la propriété intellectuelle. Tous les droits de reproduction sont réservés, y compris pour les documents téléchargeables et les représentations iconographiques et photographiques.
+ %p La reproduction de tout ou partie de ce site sur un support électronique quel qu'il soit est formellement interdite sauf autorisation expresse du Directeur de la publication (voir ci-après : Reproduction des contenus).
+ %p Les marques citées sur ce site sont protégées par les organismes qui en sont propriétaires.
-%br
-%h3 Logiciels nécessaires à la consultation
-%p Ce service est optimisé pour un affichage en 1024*768. Il est prévu pour :
-%ul
- %li les versions 10 ou supérieures d'Internet Explorer (sur windows 7 ou plus)
- %li toutes versions de Microsoft Edge
- %li les versions 19 ou supérieures d’Opera
- %li les versions 8 ou supérieures de Safari
- %li les versions 45.3.0 ou 48 ou supérieures de Firefox
- %li les versions 40 ou supérieures de Chrome
-%p
- La liste des versions compatibles a volontairement été réduite afin de garantir une meilleure sécurité sur nos services. Par ailleurs, le service TPS peut fonctionner sur des versions antérieures à celles évoquées ci-dessus mais sans garantie par le SGMAP.
-%p Certains navigateurs peuvent bloquer par défaut l'ouverture de fenêtres sur ce site. Afin de vous permettre d'afficher certaines pages, vous devez autoriser l'ouverture des fenêtres lorsque le navigateur vous le propose en cliquant sur le bandeau d'avertissement alors affiché en haut de la page. En cas d'absence de message d'avertissement de la part de votre navigateur, vous devez configurer celui-ci afin qu'il autorise l'ouverture des fenêtres pour le site "tps.apientreprise.fr".
-%br
-%h3 Conception & Réalisation
-%p SGMAP
-%p
-%p
\ No newline at end of file
+ %br
+ %h3#navigateurs
+ Logiciels nécessaires à la consultation
+ %p Ce service est optimisé pour un affichage en 1024*768. Il est prévu pour :
+ %ul
+ %li les versions 10 ou supérieures d'Internet Explorer (sur windows 7 ou plus)
+ %li toutes versions de Microsoft Edge
+ %li les versions 19 ou supérieures d’Opera
+ %li les versions 8 ou supérieures de Safari
+ %li les versions 45.3.0 ou 48 ou supérieures de Firefox
+ %li les versions 40 ou supérieures de Chrome
+ %p
+ La liste des versions compatibles a volontairement été réduite afin de garantir une meilleure sécurité sur nos services. Par ailleurs, le service TPS peut fonctionner sur des versions antérieures à celles évoquées ci-dessus mais sans garantie par le SGMAP.
+ %p Certains navigateurs peuvent bloquer par défaut l'ouverture de fenêtres sur ce site. Afin de vous permettre d'afficher certaines pages, vous devez autoriser l'ouverture des fenêtres lorsque le navigateur vous le propose en cliquant sur le bandeau d'avertissement alors affiché en haut de la page. En cas d'absence de message d'avertissement de la part de votre navigateur, vous devez configurer celui-ci afin qu'il autorise l'ouverture des fenêtres pour le site "tps.apientreprise.fr".
+ %br
+ %h3#conception
+ Conception & Réalisation
+ %p SGMAP
+ %p
+ %p
\ No newline at end of file
diff --git a/app/views/demo/_list.html.haml b/app/views/demo/_list.html.haml
index 9f6257376..852751809 100644
--- a/app/views/demo/_list.html.haml
+++ b/app/views/demo/_list.html.haml
@@ -14,11 +14,11 @@
%tr
%td
= procedure.id
- %td.col-md-4.col-lg-4
+ %td.col-md-4.col-sm-4.col-xs-4.col-lg-4
= link_to procedure.libelle, procedure.lien
%td
= procedure.description
- %td.col-md-3.col-lg-3
+ %td.col-md-3.col-sm-3.col-xs-3.col-lg-3
= procedure.organisation
= smart_listing.paginate
diff --git a/app/views/dossiers/_commentaires_files.html.haml b/app/views/dossiers/_commentaires_files.html.haml
index 53a22cc06..ab6d55a1f 100644
--- a/app/views/dossiers/_commentaires_files.html.haml
+++ b/app/views/dossiers/_commentaires_files.html.haml
@@ -4,11 +4,11 @@
- if @facade.commentaires_files.size > 0
%table.table
%thead
- %th.col-md-3
+ %th.col-md-3.col-sm-3.col-xs-3
Email
- %th.col-md-2
+ %th.col-md-2.col-sm-2.col-xs-2
Date
- %th.col-md-6
+ %th.col-md-6.col-sm-6.col-xs-6
Fichier
diff --git a/app/views/dossiers/_dossier_show.html.haml b/app/views/dossiers/_dossier_show.html.haml
new file mode 100644
index 000000000..3c1da4f2f
--- /dev/null
+++ b/app/views/dossiers/_dossier_show.html.haml
@@ -0,0 +1,121 @@
+.default_data_block{style:'margin-top: 40px'}
+ .row.show-block#messages
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ .carret-right
+ .carret-down
+ MESSAGERIE avec votre
+ - if user_signed_in?
+ Administration
+ - elsif gestionnaire_signed_in?
+ Usager
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
+ - message_count = @facade.commentaires.count
+ = (message_count == 1) ? "1 message" : "#{message_count} messages"
+ %div.body
+ - unless @facade.commentaires.empty?
+ %div.commentaires
+ - @facade.commentaires.object.sort.each do |commentaire|
+ = render partial: commentaire
+ .row
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12
+ %div.split-hr
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12#new-commentaire
+ = form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: @facade.dossier.id, champ_id: @facade.champ_id }), class: 'form-inline', method: 'POST', multipart: true) do
+ %textarea.form-control{id: 'texte_commentaire', class: 'wysihtml5', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', placeholder:"Commentaire"}
+ %h4.text-primary{style: 'margin-top: 0px'} Ajouter un fichier
+ = file_field_tag "piece_justificative[content]", accept: PieceJustificative.accept_format, style: 'float: left; margin-left: 20px'
+ %input#save-message.form-control.btn.btn-send{ type: 'submit', value: 'ENVOYER' }
+ - if last_comment = @facade.commentaires.first
+ %div.last-commentaire
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.comment-header
+ = "DERNIER MESSAGE (#{last_comment.header})"
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.content
+ = last_comment.body.html_safe
+ - if file = last_comment.piece_justificative
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.file
+ = link_to file.content_url, class: 'link', target: '_blank' do
+ %span.fa.fa-file
+ %div
+ = file.original_filename
+ .row
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12
+ %div#open-message.new-action
+ ENVOYER UN MESSAGE
+ - else
+ .last-commentaire
+ .row
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12
+ %div#open-message.new-action
+ ENVOYER UN MESSAGE
+
+- if @facade.procedure.individual_with_siret
+ .default_data_block
+ %div.row.show-block.infos
+ %div.header
+ %div.col-lg-8.col-md-8.col-sm-8.col-xs-8.title-no-expanse
+ %div.carret-right
+ INFORMATIONS ENTREPRISE / ASSOCIATION
+ - if !@current_gestionnaire && ["draft", "updated", "replied", "initiated"].include?(@facade.dossier.state)
+ %a#add_siret.action{href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id)}
+ %div.col-lg-4.col-md-4.col-sm-4.col-xs-4.action
+ = "Renseigner un SIRET"
+
+- unless @facade.entreprise.nil?
+ .default_data_block
+ %div.row.show-block.infos#infos_entreprise
+ %div.header
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.title
+ %div.carret-right
+ %div.carret-down
+ INFORMATIONS ENTREPRISE / ASSOCIATION
+ %div.body
+ = render partial: '/dossiers/infos_entreprise'
+
+.default_data_block.default_visible
+ %div.row.show-block.infos#infos_dossier
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ CONSTRUCTION DU DOSSIER
+ = render partial: '/dossiers/edit_dossier'
+ %div.body
+ = render partial: '/dossiers/infos_dossier'
+
+- if @facade.dossier.procedure.module_api_carto.use_api_carto
+ .default_data_block.default_visible
+ %div.row.show-block#carto
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ CARTOGRAPHIE
+ = render partial: '/dossiers/edit_carto'
+ %div.body
+ %input{id: 'json_latlngs', type: 'hidden', value: "#{@facade.dossier.json_latlngs}", name: 'json_latlngs'}
+ %input{id: 'quartier_prioritaires', type: 'hidden', value: "#{@facade.dossier.quartier_prioritaires.to_json}"}
+ %input{id: 'cadastres', type: 'hidden', value: "#{@facade.dossier.cadastres.to_json}"}
+
+ = render partial: '/users/carte/map', locals: {dossier: @facade.dossier}
+ = render partial: 'users/carte/init_carto', locals: {dossier: @facade.dossier}
+
+
+- if @current_gestionnaire && gestionnaire_signed_in? && @champs_private.count > 0
+ .default_data_block.default_visible
+ %div.row.show-block#private-fields
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ = "formulaire privé".upcase
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
+ - private_fields_count = @champs_private.count
+ = (private_fields_count == 1) ? "1 champ" : "#{private_fields_count} champs"
+ %div.body
+ = render partial: '/dossiers/infos_private_fields'
+
diff --git a/app/views/dossiers/_download_dossiers.html.haml b/app/views/dossiers/_download_dossiers.html.haml
new file mode 100644
index 000000000..cfd478d8c
--- /dev/null
+++ b/app/views/dossiers/_download_dossiers.html.haml
@@ -0,0 +1,20 @@
+%div.dropdown.pull-right#download-menu
+ - if @facade_data_view.dossiers_to_display.count > 400
+ %button.btn.btn-error.dropdown-toggle#dropdownDownloadMenu{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false, class: 'disabled'}
+ %span{'data-toggle' => :tooltip, "data-placement" => :left, title: 'Pour réduire le nombre de dossiers et ne pas dépasser la limite autorisée de 400, merci de bien vouloir appliquer des filtres.'}
+ = t('dynamics.backoffice.limit_excess_download_all_dossiers')
+ - else
+ %a.dropdown-toggle#dropdownDownloadMenu.button_navbar{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
+ %i.fa.fa-download
+ = t('dynamics.backoffice.download_all_dossiers')
+ %span.caret
+ %ul.dropdown-menu.dropdown-menu-right
+ %li
+ = link_to backoffice_download_dossiers_tps_path(format: :csv, procedure_id: params[:id]), { class: 'btn btn-sm export-link' } do
+ = t('dynamics.backoffice.format_csv')
+ %li
+ = link_to backoffice_download_dossiers_tps_path(format: :xlsx, procedure_id: params[:id]), { class: 'btn btn-sm export-link' } do
+ = t('dynamics.backoffice.format_xlsx')
+ %li
+ = link_to backoffice_download_dossiers_tps_path(format: :ods, procedure_id: params[:id]), { class: 'btn btn-sm export-link' } do
+ = t('dynamics.backoffice.format_ods')
diff --git a/app/views/dossiers/_edit_carto.html.haml b/app/views/dossiers/_edit_carto.html.haml
new file mode 100644
index 000000000..08380a1a6
--- /dev/null
+++ b/app/views/dossiers/_edit_carto.html.haml
@@ -0,0 +1,5 @@
+- unless @facade.dossier.read_only?
+ - if user_signed_in? && (@facade.dossier.owner?(current_user.email) || @facade.dossier.invite_by_user?(current_user.email))
+ %a#maj_carte.action{href: "/users/dossiers/#{@facade.dossier.id}/carte"}
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.action
+ = 'éditer'.upcase
diff --git a/app/views/dossiers/_edit_dossier.html.haml b/app/views/dossiers/_edit_dossier.html.haml
new file mode 100644
index 000000000..5f07d7ccc
--- /dev/null
+++ b/app/views/dossiers/_edit_dossier.html.haml
@@ -0,0 +1,5 @@
+- unless @facade.dossier.read_only?
+ - if user_signed_in? && (@facade.dossier.owner?(current_user.email) || @facade.dossier.invite_by_user?(current_user.email))
+ %a#maj_infos.action{href: "/users/dossiers/#{@facade.dossier.id}/description"}
+ %div#edit-dossier.col-lg-2.col-md-2.col-sm-2.col-xs-2.action
+ = "éditer".upcase
diff --git a/app/views/dossiers/_edit_pieces_jointes.html.haml b/app/views/dossiers/_edit_pieces_jointes.html.haml
new file mode 100644
index 000000000..c65d90d10
--- /dev/null
+++ b/app/views/dossiers/_edit_pieces_jointes.html.haml
@@ -0,0 +1,11 @@
+- unless @facade.dossier.read_only?
+ - if user_signed_in? && (@facade.dossier.owner?(current_user.email) || @facade.dossier.invite_by_user?(current_user.email))
+ - if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.size > 0
+ %div.col-lg-4.col-md-4.col-sm-4.col-xs-4.action
+ %a#maj_pj.action{"data-target" => "#UploadPJmodal",
+ "data-toggle" => "modal",
+ :type => "button",
+ style: 'margin-bottom: 15px; margin-top: -30px'}
+ Modifier les documents
+ %br
+ = render partial: 'users/recapitulatif/modal_upload_pj'
diff --git a/app/views/dossiers/_infos_carto.html.haml b/app/views/dossiers/_infos_carto.html.haml
new file mode 100644
index 000000000..1c706b2f5
--- /dev/null
+++ b/app/views/dossiers/_infos_carto.html.haml
@@ -0,0 +1,11 @@
+.row
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12
+ #map.mini{class: @facade.dossier.procedure.module_api_carto.classes}
+
+ %input{id: 'json_latlngs', type:'hidden', value: "#{@facade.dossier.json_latlngs}"}
+ %input{id: 'quartier_prioritaires', type:'hidden', value: "#{@facade.dossier.quartier_prioritaires.to_json}"}
+ %input{id: 'cadastres', type:'hidden', value: "#{@facade.dossier.cadastres.to_json}"}
+
+ %script{type: 'text/javascript'}
+ = "var dossier_id =#{@facade.dossier.id}"
+ initCarto();
diff --git a/app/views/dossiers/_infos_dossier.html.haml b/app/views/dossiers/_infos_dossier.html.haml
index 547b082c1..bade9cde2 100644
--- a/app/views/dossiers/_infos_dossier.html.haml
+++ b/app/views/dossiers/_infos_dossier.html.haml
@@ -1,124 +1,159 @@
-#infos_dossier
- %div.row
- .col-lg-6.col-md-6
- %h3
- = @facade.dossier.procedure.libelle
+%div.row
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12
+ - if @facade.procedure.for_individual?
+ .row.title-row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.split-hr
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.dossier-title= t('utils.depositaire').upcase
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.split-hr
+ .row
+ %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Civilité
+ %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-"
+ %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.gender
+ .row
+ %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Nom
+ %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-"
+ %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.nom
+ .row
+ %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Prénom
+ %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-"
+ %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.despositaire-info= @facade.individual.prenom
+ - unless Features.opensimplif
+ .row
+ %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label Date de naissance
+ %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-"
+ %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info= @facade.individual.birthdate
+ .row.margin-top-20
- - if @facade.procedure.for_individual?
+ - unless @facade.champs.nil?
+ - @facade.champs.each do |champ|
+ - if champ.type_champ == 'header_section'
+ .row.title-row.margin-top-40
+ %div.col-md-3.col-sm-3.col-xs-3.col-lg-3.split-hr
+ %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.dossier-title= champ.libelle.upcase
+ %div.col-md-3.col-sm-3.col-xs-3.col-lg-3.split-hr
+ - else
+ .row
+ %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label= champ.libelle
+ - if Features.opensimplif
+ %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments
+ - if gestionnaire_signed_in?
+ = link_to "", "data-href" => backoffice_dossier_commentaires_path(@facade.dossier, champs_id: champ.id), "data-toggle" => "modal", "data-target" => "#modalCommentairesDossierParChamp" do
+ %i.fa.fa-comment-o
+ - else
+ = link_to "", "data-href" => users_dossier_commentaires_path(@facade.dossier, champs_id: champ.id), "data-toggle" => "modal", "data-target" => "#modalCommentairesDossierParChamp" do
+ %i.fa.fa-commenting-o
+ - else
+ %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off
+ = "-"
+ %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.depositaire-info{ id: "champ-#{champ.id}-value" }
+ - unless champ.decorate.value.blank?
+ = champ.decorate.value.html_safe
+
+ - if @facade.dossier.mandataire_social && gestionnaire_signed_in?
+ .mandataire_social.text-success.center
%br
- .individual.text-info
- %h4
- =t('dynamics.dossiers.depositaite')
+ ="Il est probable que le soumissionnaire du dossier soit un des mandataire social de l'entreprise ("
+ %b
+ ="#{@facade.dossier.user.given_name} #{@facade.dossier.user.family_name}"
+ =")"
+%div.row
+ - if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.count > 0
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12
+ .row.title-row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.split-hr
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.dossier-title= t('utils.pieces').upcase
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.split-hr
- %table.table{style:'width: 60%'}
- %tr
- %th.col-md-3.col-lg-3
- Civilité
- %td.col-md-5.col-lg-5
- = @facade.individual.gender
- %tr
- %th.col-md-3.col-lg-3
- Nom
- %td.col-md-5.col-lg-5
- = @facade.individual.nom
- %tr
- %th.col-md-3.col-lg-3
- Prénom
- %td.col-md-5.col-lg-5
- = @facade.individual.prenom
- - unless Features.opensimplif
- %tr
- %th.col-md-3.col-lg-3
- Date de naissance
- %td.col-md-5.col-lg-5
- = @facade.individual.birthdate
-
- - if @facade.dossier.mandataire_social && gestionnaire_signed_in?
- .mandataire_social.text-success.center
- %br
- ="Il est probable que le soumissionnaire du dossier soit un des mandataire social de l'entreprise ("
- %b
- ="#{@facade.dossier.user.given_name} #{@facade.dossier.user.family_name}"
- =")"
-
- - if @facade.dossier.procedure.module_api_carto.use_api_carto
- .col-lg-6.col-md-6
-
- #map.mini{class: @facade.dossier.procedure.module_api_carto.classes}
-
- %input{id: 'json_latlngs', type:'hidden', value: "#{@facade.dossier.json_latlngs}"}
- %input{id: 'quartier_prioritaires', type:'hidden', value: "#{@facade.dossier.quartier_prioritaires.to_json}"}
- %input{id: 'cadastres', type:'hidden', value: "#{@facade.dossier.cadastres.to_json}"}
-
- %script{type: 'text/javascript'}
- = "var dossier_id =#{@facade.dossier.id}"
- initCarto();
-
- %br
- -unless @facade.champs.nil?
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12#pieces_justificatives.margin-bot-40
.row
- .col-lg-6.col-md-6
- %table.table#liste_champs
- -@facade.champs.each do |champ|
- %tr
- %th{ style: 'width:25%' }
- =champ.libelle
- -if gestionnaire_signed_in?
- =link_to "COM", "", "data-href" => backoffice_dossier_commentaires_path(@facade.dossier, champs_id: champ.id),
- "data-toggle" => "modal", "data-target" => "#modalCommentairesDossierParChamp"
- -else
- =link_to "COM", "", "data-href" => users_dossier_commentaires_path(@facade.dossier, champs_id: champ.id),
- "data-toggle" => "modal", "data-target" => "#modalCommentairesDossierParChamp"
- %td
- -unless champ.decorate.value.blank?
- =champ.decorate.value.html_safe
- .col-lg-6.col-md-6
- =render partial: '/dossiers/pieces_justificatives'
- %br
+ - if @facade.procedure.cerfa_flag?
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12#piece_justificative_0
+ .row.piece-row
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label= 'Formulaire'
+ .col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-"
+ .col-md-5.col-sm-5.col-xs-5.col-lg-5.despositaire-info
+ - if @facade.dossier.cerfa_available?
+ %a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter
+ %span{style:'margin-left:12px'}
+ \-
+ = link_to "", class: "historique", "data-toggle" => "modal", "data-target" => "#PJmodal", :type => "button", "data-modal_title" => 'formulaires', "data-modal_index" => 'cerfa' do
+ %span.fa.fa-clock-o
+ - else
+ = 'Pièce non fournie'
+ .row
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12
+ - @facade.types_de_pieces_justificatives.each do |type_de_piece_justificative|
+ .row.piece-row
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" }
+ .row
+ %div.col-md-6.col-sm-6.col-xs-6.col-lg-6.depositaire-label= type_de_piece_justificative.libelle
+ %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-"
+ %div.col-md-5.col-sm-5.col-xs-5.col-lg-5.despositaire-info
+ - if type_de_piece_justificative.api_entreprise
+ %span.text-success Nous l'avons récupéré pour vous.
+ - elsif !(@pj = @facade.dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)).nil?
+ %a{ href: "#{@pj.content_url}", target: '_blank' } Consulter
+ %span{style:'margin-left:12px'}
+ \-
+ - if @facade.dossier.pieces_justificatives.where(type_de_piece_justificative_id: type_de_piece_justificative.id).count > 1
+ = link_to "", class: "historique", "data-toggle" => "modal", "data-target" => "#PJmodal", :type => "button", "data-modal_title" => 'formulaires', "data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}" do
+ %span.fa.fa-clock-o
+ - else
+ = 'Pièce non fournie'
- .row{style: 'text-align:right'}
- unless @facade.dossier.read_only?
- if user_signed_in? && (@facade.dossier.owner?(current_user.email) || @facade.dossier.invite_by_user?(current_user.email))
- if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.size > 0
- %a#maj_pj.btn.btn-success{"data-target" => "#UploadPJmodal",
- "data-toggle" => "modal",
- :type => "button",
- style: 'margin-bottom: 15px; margin-top: -30px'}
- Modifier les documents
- %br
- = render partial: 'users/recapitulatif/modal_upload_pj'
+ .row
+ .col-lg-4.col-md-4.col-sm-4.col-xs-4
+ %a#maj_pj.action{"data-target" => "#UploadPJmodal", "data-toggle" => "modal", :type => "button"}
+ .col-lg-4.col-md-4.col-sm-4.col-xs-4.action
+ Modifier les documents
+ %br
+ = render partial: 'users/recapitulatif/modal_upload_pj'
+ .col-lg-4.col-md-4.col-sm-4.col-xs-4
-
- -if @facade.procedure.individual_with_siret
- %a#add_siret.btn.btn-success{href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id)}
- = "Renseigner un SIRET"
- -if @facade.dossier.procedure.module_api_carto.use_api_carto
- %a#maj_carte.btn.btn-primary{href: "/users/dossiers/#{@facade.dossier.id}/carte"}
- = 'Modifier la carte'
- %a#maj_infos.btn.btn-info{href: "/users/dossiers/#{@facade.dossier.id}/description"}
- = 'Modifier le dossier'
-
- -if gestionnaire_signed_in?
- -if !@facade.dossier.read_only?
- = form_tag(url_for({controller: 'backoffice/dossiers', action: :valid, dossier_id: @facade.dossier.id}), class: 'form-inline', method: 'POST') do
- %button.action_button.btn.btn-success{'data-toggle' => :tooltip, title: 'En cliquant ici, vous figez le dossier et autorisez le dépôt du dossier pour instruction.'}
- = 'Déclarer complet'
-
- -elsif @facade.dossier.submitted?
- = form_tag(url_for({controller: 'backoffice/dossiers', action: :receive, dossier_id: @facade.dossier.id}), class: 'form-inline', method: 'POST') do
- %button.action_button.btn.btn-success
- = 'Accuser réception'
-
- -elsif @facade.dossier.received?
- = form_tag(url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Accepter') do
- %button.action_button.btn.btn-success
- %i.fa.fa-check
- = form_tag(url_for({controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Refuser') do
- %button.action_button.btn.btn-danger
- %i.fa.fa-times
- = form_tag(url_for({controller: 'backoffice/dossiers', action: :without_continuation, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Classer sans suite') do
- %button.action_button.btn.btn-warning
- %i.fa.fa-circle-o
+ - if gestionnaire_signed_in?
+ #PJmodal.modal.fade{"aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
+ .modal-dialog.modal-lg{:role => "document"}
+ .modal-content
+ .modal-header
+ %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
+ %span{"aria-hidden" => "true"} ×
+ %h4#myModalLabel.modal-title
+ Historique des
+ %span#PJmodal_title
+ .modal-body
+ %table.table
+ %thead
+ %th
+ Utilisateur
+ %th
+ Date d'envoi
+ %th
+ Lien
+ %thead.tr_content#cerfa
+ -if @facade.procedure.cerfa_flag?
+ - if @facade.dossier.cerfa_available?
+ - @facade.cerfas_ordered.each do |cerfa|
+ %tr
+ %td.col-md-6.col-sm-6.col-xs-6.col-lg-4
+ = cerfa.user.email
+ %td.col-md-6.col-sm-6.col-xs-6.col-lg-4
+ = cerfa.created_at
+ %td.col-md-6.col-sm-6.col-xs-6.col-lg-4
+ =link_to 'Récupérer', cerfa.content_url, {target: :blank}
+ - @facade.dossier.types_de_piece_justificative.each do |type_de_piece_justificative|
+ %tbody.tr_content{id: "type_de_pj_#{type_de_piece_justificative.id}"}
+ - @facade.dossier.retrieve_all_piece_justificative_by_type(type_de_piece_justificative.id).each do |piece_justificative|
+ %tr
+ %td.col-md-6.col-sm-6.col-xs-6.col-lg-4
+ = piece_justificative.user.email
+ %td.col-md-6.col-sm-6.col-xs-6.col-lg-4
+ = piece_justificative.created_at
+ %td.col-md-6.col-sm-6.col-xs-6.col-lg-4
+ =link_to 'Récupérer', piece_justificative.content_url, {target: :blank}
+ .modal-footer
#modalCommentairesDossierParChamp.modal.fade{"tabindex" => -1, "role" => "dialog"}
.modal-dialog{"role" => "document"}
diff --git a/app/views/dossiers/_infos_entreprise.html.haml b/app/views/dossiers/_infos_entreprise.html.haml
index 0ca65401b..81f670643 100644
--- a/app/views/dossiers/_infos_entreprise.html.haml
+++ b/app/views/dossiers/_infos_entreprise.html.haml
@@ -1,59 +1,60 @@
-.col-md-12.col-xs-12
+.col-md-12.col-sm-12.col-xs-12.col-xs-12
%h4
= @facade.entreprise.raison_sociale_or_name
+ .row.split-row
+ %div.col-md-12.col-sm-12.col-xs-12.col-lg-12.split-hr
+%div.row
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12
-.row#infos_entreprise
- .col-lg-6.col-md-6.col-xs-12.col-sm-12
- %dl.dl-horizontal
- %dt Siret :
- %dd.text-success= @facade.etablissement.siret
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Siret :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.etablissement.siret
+ - if @facade.etablissement.siret != @facade.entreprise.siret_siege_social
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label SIRET siège social :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.siret_siege_social
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Forme juridique :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.forme_juridique
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Libellé naf :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.etablissement.libelle_naf
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Code naf :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.etablissement.naf
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Date de création :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= Time.at(@facade.entreprise.date_creation).strftime "%d-%m-%Y"
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Effectif organisation :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.effectif
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Code effectif :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.code_effectif_entreprise
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Numéro TVA intracommunautaire :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.numero_tva_intracommunautaire
- - if @facade.etablissement.siret != @facade.entreprise.siret_siege_social
- %dt SIRET siège social :
- %dd= @facade.entreprise.siret_siege_social
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Adresse :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info
+ - @facade.etablissement.adresse.split("\n").each do |line|
+ = line
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Capital social :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info= @facade.entreprise.pretty_capital_social
- %dt Forme juridique :
- %dd= @facade.entreprise.forme_juridique
-
- %dt Libellé naf :
- %dd= @facade.etablissement.libelle_naf
-
- %dt Code naf :
- %dd= @facade.etablissement.naf
-
- %dt Date de création :
- %dd= Time.at(@facade.entreprise.date_creation).strftime "%d-%m-%Y"
-
- %dt Effectif organisation :
- %dd= @facade.entreprise.effectif
-
- %dt Code effectif :
- %dd= @facade.entreprise.code_effectif_entreprise
-
- %dt Numéro TVA intracommunautaire :
- %dd= @facade.entreprise.numero_tva_intracommunautaire
-
-
- .col-lg-6.col-md-6.col-xs-12.col-sm-12
- %dl.dl-horizontal
- %dt Adresse :
- %dd
- %address
- - @facade.etablissement.adresse.split("\n").each do |line|
- = line
- %br
-
- %dt Capital social :
- %dd= @facade.entreprise.pretty_capital_social
-
- %dt Exercices :
- %dd
- %address
- - @facade.etablissement.exercices.each_with_index do |exercice, index|
- %strong
- = "#{exercice.dateFinExercice.year} : "
+ .row
+ %div.col-md-4.col-sm-4.col-xs-4.col-lg-4.entreprise-label Exercices :
+ %div.col-md-8.col-sm-8.col-xs-8.col-lg-8.entreprise-info
+ - @facade.etablissement.exercices.each_with_index do |exercice, index|
+ %strong
+ = "#{exercice.dateFinExercice.year} : "
= number_to_currency(exercice.ca)
- %br
+ %br
+ .row.split-row
+ %div.col-md-12.col-sm-12.col-xs-12.col-lg-12.split-hr
- unless @facade.entreprise.rna_information.nil?
- = render partial: '/dossiers/infos_rna'
\ No newline at end of file
+ = render partial: '/dossiers/infos_rna'
+
diff --git a/app/views/dossiers/_infos_pieces_jointes.html.haml b/app/views/dossiers/_infos_pieces_jointes.html.haml
new file mode 100644
index 000000000..3d562b8a9
--- /dev/null
+++ b/app/views/dossiers/_infos_pieces_jointes.html.haml
@@ -0,0 +1,49 @@
+#pieces_justificatives
+ .row
+ - if @facade.procedure.cerfa_flag?
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12#piece_justificative_0
+ .row.piece-row
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6.piece-label= 'Formulaire'
+ .col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off= "-"
+ .col-md-5.col-sm-5.col-xs-5.col-lg-5
+ - if @facade.dossier.cerfa_available?
+ %a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter
+ %span{style:'margin-left:12px'}
+ \-
+ %a.btn.fa.fa-timer{style:'color: black; padding-top: 0',
+ "data-target" => "#PJmodal",
+ "data-toggle" => "modal",
+ :type => "button",
+ "data-modal_title" => 'formulaires',
+ "data-modal_index" => 'cerfa'}
+ - else
+ = 'Pièce non fournie'
+
+ .row
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12
+ - @facade.dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative|
+ .row.piece-row
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" }
+ .row
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6= type_de_piece_justificative.libelle
+ .col-md-6.col-sm-6.col-xs-6.col-lg-6
+ - if type_de_piece_justificative.api_entreprise
+ %span.text-success Nous l'avons récupéré pour vous.
+ - elsif !(@pj = @facade.dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)).nil?
+ -#- if user_signed_in?
+ -# = 'Pièce fournie'
+ -#- elsif gestionnaire_signed_in?
+ %a{ href: "#{@pj.content_url}", target: '_blank' } Consulter
+ %span{style:'margin-left:12px'}
+ \-
+ %a.btn.fa.fa-timer{style:'color: black; padding-top: 0',
+ "data-target" => "#PJmodal",
+ "data-toggle" => "modal",
+ :type => "button",
+ "data-modal_title" => type_de_piece_justificative.libelle,
+ "data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}"}
+ - else
+ = 'Pièce non fournie'
+
+ -#- if gestionnaire_signed_in?
+ = render partial: '/dossiers/modal_historique'
diff --git a/app/views/dossiers/_infos_private_fields.html.haml b/app/views/dossiers/_infos_private_fields.html.haml
new file mode 100644
index 000000000..b6aac7f24
--- /dev/null
+++ b/app/views/dossiers/_infos_private_fields.html.haml
@@ -0,0 +1,6 @@
+.row{style: 'margin-top: -20px'}
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12
+ = form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do
+ = render partial: '/users/description/champs', locals:{private: true}
+ .row.center
+ = submit_tag :Enregistrer, {class: 'btn-action'}
diff --git a/app/views/dossiers/_infos_rna.html.haml b/app/views/dossiers/_infos_rna.html.haml
index f8f0adb5e..3a582bac7 100644
--- a/app/views/dossiers/_infos_rna.html.haml
+++ b/app/views/dossiers/_infos_rna.html.haml
@@ -1,5 +1,5 @@
.row#infos_rna
- .col-lg-6.col-md-6
+ .col-lg-6.col-md-6.col-sm-6.col-xs-6
%dl.dl-horizontal
%dt Association ID :
%dd.text-success= @facade.entreprise.rna_information.association_id
@@ -10,7 +10,7 @@
%dt Objet :
%dd= @facade.entreprise.rna_information.objet
- .col-lg-6.col-md-6
+ .col-lg-6.col-md-6.col-sm-6.col-xs-6
%dl.dl-horizontal
%dt Date création :
%dd= @facade.entreprise.rna_information.date_creation
diff --git a/app/views/dossiers/_invites.html.haml b/app/views/dossiers/_invites.html.haml
index d2fa82d4e..72307147e 100644
--- a/app/views/dossiers/_invites.html.haml
+++ b/app/views/dossiers/_invites.html.haml
@@ -2,7 +2,7 @@
%br
.row
- .col-md-4.col-lg-4
+ .col-md-4.col-sm-4.col-xs-4.col-lg-4
- if @facade.invites.size > 0
%ul
- @facade.invites.each do |invite|
@@ -11,8 +11,8 @@
- else
Aucune personne invitée
- .col-md-3.col-lg-3
- =form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do
- =text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation'
- =submit_tag 'Ajouter', class: 'btn btn-success'
+ .col-md-3.col-sm-3.col-xs-3.col-lg-3
+ = form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do
+ = text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation'
+ = submit_tag 'Ajouter', class: 'btn btn-success', id: 'send-invitation'
diff --git a/app/views/dossiers/_modal_historique.html.haml b/app/views/dossiers/_modal_historique.html.haml
deleted file mode 100644
index 27f470ea0..000000000
--- a/app/views/dossiers/_modal_historique.html.haml
+++ /dev/null
@@ -1,43 +0,0 @@
-#PJmodal.modal.fade{"aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"}
- .modal-dialog.modal-lg{:role => "document"}
- .modal-content
- .modal-header
- %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
- %span{"aria-hidden" => "true"} ×
- %h4#myModalLabel.modal-title
- Historique des
- %span#PJmodal_title
- .modal-body
- %table.table
- %thead
- %th
- Utilisateur
- %th
- Date d'envoi
- %th
- Lien
- %thead.tr_content#cerfa
- -if @facade.procedure.cerfa_flag?
- - if @facade.dossier.cerfa_available?
- - @facade.cerfas_ordered.each do |cerfa|
- %tr
- %td.col-md-6.col-lg-4
- = cerfa.user.email
- %td.col-md-6.col-lg-4
- = cerfa.created_at
- %td.col-md-6.col-lg-4
- =link_to 'Récupérer', cerfa.content_url, {target: :blank}
- - @facade.dossier.types_de_piece_justificative.each do |type_de_piece_justificative|
- %tbody.tr_content{id: "type_de_pj_#{type_de_piece_justificative.id}"}
- - @facade.dossier.retrieve_all_piece_justificative_by_type(type_de_piece_justificative.id).each do |piece_justificative|
- %tr
- %td.col-md-6.col-lg-4
- = piece_justificative.user.email
- %td.col-md-6.col-lg-4
- = piece_justificative.created_at
- %td.col-md-6.col-lg-4
- =link_to 'Récupérer', piece_justificative.content_url, {target: :blank}
-
-
-
- .modal-footer
diff --git a/app/views/dossiers/_pieces_justificatives.html.haml b/app/views/dossiers/_pieces_justificatives.html.haml
index 824a41aa7..888c65b1a 100644
--- a/app/views/dossiers/_pieces_justificatives.html.haml
+++ b/app/views/dossiers/_pieces_justificatives.html.haml
@@ -1,16 +1,15 @@
#pieces_justificatives
-
%table.table
- -if @facade.procedure.cerfa_flag?
+ - if @facade.procedure.cerfa_flag?
%tr{id: "piece_justificative_0"}
%th{class:'col-lg-6'}
='Formulaire'
- %td.col-lg-6.col-md-6
+ %td.col-lg-6.col-md-6.col-sm-6.col-xs-6
- if @facade.dossier.cerfa_available?
%a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter
%span{style:'margin-left:12px'}
\-
- %a.btn.glyphicon.glyphicon-time{style:'color: black; padding-top: 0',
+ %a.btn.fa.fa-timer{style:'color: black; padding-top: 0',
"data-target" => "#PJmodal",
"data-toggle" => "modal",
:type => "button",
@@ -23,7 +22,7 @@
%tr{ id: "piece_justificative_#{type_de_piece_justificative.id}" }
%th.col-lg-6
= type_de_piece_justificative.libelle
- %td.col-lg-6.col-md-6
+ %td.col-lg-6.col-md-6.col-sm-6.col-xs-6
- if type_de_piece_justificative.api_entreprise
%span.text-success Nous l'avons récupéré pour vous.
- elsif !(@pj = @facade.dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id)).nil?
@@ -33,7 +32,7 @@
%a{ href: "#{@pj.content_url}", target: '_blank' } Consulter
%span{style:'margin-left:12px'}
\-
- %a.btn.glyphicon.glyphicon-time{style:'color: black; padding-top: 0',
+ %a.btn.fa.fa-timer{style:'color: black; padding-top: 0',
"data-target" => "#PJmodal",
"data-toggle" => "modal",
:type => "button",
@@ -43,4 +42,4 @@
= 'Pièce non fournie'
-#- if gestionnaire_signed_in?
- =render partial: '/dossiers/modal_historique'
\ No newline at end of file
+ =render partial: '/dossiers/modal_historique'
diff --git a/app/views/dossiers/_tab_objects_dossier.html.haml b/app/views/dossiers/_tab_objects_dossier.html.haml
deleted file mode 100644
index 6e0c684fe..000000000
--- a/app/views/dossiers/_tab_objects_dossier.html.haml
+++ /dev/null
@@ -1,46 +0,0 @@
-%ul{class: "nav nav-tabs", role: "tablist"}
- %li{role: "presentation", class: "active"}
- %a{href: "#commentaires", 'aria-controls' => "commentaires", role: "tab", 'data-toggle' => "tab"}
- Commentaires
- %li{role: "presentation"}
- %a{href: "#commentaires_files", 'aria-controls' => "commentaires_files", role: "tab", 'data-toggle' => "tab"}
- Fichiers
-
- - if gestionnaire_signed_in? || @facade.dossier.owner?(current_user.email)
- %li{role: "presentation"}
- %a{href: "#invites", 'aria-controls' => "invites", role: "tab", 'data-toggle' => "tab"}
- Invités
-
- - if gestionnaire_signed_in? && (!request.env['PATH_INFO'].include?('users/dossiers') )
- %li{role: "presentation"}
- %a{href: "#followers", 'aria-controls' => "followers", role: "tab", 'data-toggle' => "tab"}
- Abonnés
- %li{role: "presentation"}
- %a{href: "#champs_private", 'aria-controls' => "champs_private", role: "tab", 'data-toggle' => "tab"}
- Champs privés
-
-%div{class: "tab-content"}
- %div{role: "tabpanel", class: "tab-pane fade in active", id:"commentaires"}
- %h3 Flux de commentaires
- %br
- = render partial: '/users/recapitulatif/commentaires_flux'
- %div{role: "tabpanel", class: "tab-pane fade", id:"commentaires_files"}
- = render partial: '/dossiers/commentaires_files'
-
- - if gestionnaire_signed_in? || @facade.dossier.owner?(current_user.email)
- %div{role: "tabpanel", class: "tab-pane fade", id:"invites"}
- = render partial: '/dossiers/invites'
- - if gestionnaire_signed_in? && !request.env['PATH_INFO'].include?('users/dossiers')
- %div{role: "tabpanel", class: "tab-pane fade", id:"followers"}
- = render partial: 'followers'
- %div{role: "tabpanel", class: "tab-pane fade", id:"champs_private"}
- %h3 Champs privés
- - if @champs.nil? || @champs.empty?
- %br
- %h4.text-primary
- Pas de champ privé pour ce dossier
- - else
- = form_for @facade.dossier, url: {controller: 'backoffice/private_formulaires', action: :update, dossier_id: @facade.dossier.id}, remote: true do
- = render partial: '/users/description/champs'
- %br
- = submit_tag :Enregistrer, {class: 'btn btn-success', style: 'float: right'}
\ No newline at end of file
diff --git a/app/views/dossiers/etapes/_etape1.html.haml b/app/views/dossiers/etapes/_etape1.html.haml
index f9de0d764..025e135bb 100644
--- a/app/views/dossiers/etapes/_etape1.html.haml
+++ b/app/views/dossiers/etapes/_etape1.html.haml
@@ -1,7 +1,5 @@
-.etape.etapes_menu.col-md-3.col-lg-3
- %h3
- Ma procédure
- %br
+.col-md-3.col-sm-3.col-xs-3.col-lg-3.center
+ %h3 Ma procédure
#logos.center{class: (@facade.entreprise.nil? ? '' : 'mask')}
- if @facade.procedure.euro_flag
@@ -11,15 +9,16 @@
#logo_procedure.flag
=image_tag( @facade.procedure.decorate.logo_img )
-.etape.etapes_informations.col-md-9.col-lg-9
+.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9
.row
- %h2#titre_procedure.text-info
- = @facade.procedure.libelle
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12.padding-left-30
+ %h2#titre_procedure.text-info
+ = @facade.procedure.libelle
- %p#description_procedure{style:'width: 95%;', class: (@facade.entreprise.nil? ? '' : 'mask')}
- = h @facade.procedure.description.html_safe
+ %p#description_procedure{style:'width: 95%;', class: (@facade.entreprise.nil? ? '' : 'mask')}
+ = h @facade.procedure.description.html_safe
- - unless @facade.procedure.lien_site_web.blank?
- .center
- %a{href: "#{@facade.procedure.lien_site_web.html_safe}", target: '_blank'}
- En savoir plus ...
\ No newline at end of file
+ - unless @facade.procedure.lien_site_web.blank?
+ .center
+ %a{href: "#{@facade.procedure.lien_site_web.html_safe}", target: '_blank'}
+ En savoir plus ...
diff --git a/app/views/dossiers/etapes/_etape2.html.haml b/app/views/dossiers/etapes/_etape2.html.haml
index 3f36a3c2a..fde33f55f 100644
--- a/app/views/dossiers/etapes/_etape2.html.haml
+++ b/app/views/dossiers/etapes/_etape2.html.haml
@@ -1,4 +1,4 @@
- if @facade.procedure.for_individual?
= render partial: 'dossiers/etapes/etape_2/individual'
- else
- = render partial: 'dossiers/etapes/etape_2/entreprise'
\ No newline at end of file
+ = render partial: 'dossiers/etapes/etape_2/entreprise'
diff --git a/app/views/dossiers/etapes/_etape3.html.haml b/app/views/dossiers/etapes/_etape3.html.haml
index 5e5735480..2190f7966 100644
--- a/app/views/dossiers/etapes/_etape3.html.haml
+++ b/app/views/dossiers/etapes/_etape3.html.haml
@@ -1,6 +1,6 @@
-.etape.etapes_menu.col-md-3.col-lg-3
+.etape.etapes_menu.col-md-3.col-sm-3.col-xs-3.col-lg-3
%h3
Ma zone d'intervention
-.etape.etapes_informations.col-md-9.col-lg-9
+.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9
.row
diff --git a/app/views/dossiers/etapes/_etape4.html.haml b/app/views/dossiers/etapes/_etape4.html.haml
index 64636c231..04556443b 100644
--- a/app/views/dossiers/etapes/_etape4.html.haml
+++ b/app/views/dossiers/etapes/_etape4.html.haml
@@ -1,6 +1,6 @@
-.etape.etapes_menu.col-md-3.col-lg-3
+.etape.etapes_menu.col-md-3.col-sm-3.col-xs-3.col-lg-3
%h3
Mon dossier
-.etape.etapes_informations.col-md-9.col-lg-9
+.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9
.row
diff --git a/app/views/dossiers/etapes/etape_2/_entreprise.html.haml b/app/views/dossiers/etapes/etape_2/_entreprise.html.haml
index 2e8f161e9..bac50fe87 100644
--- a/app/views/dossiers/etapes/etape_2/_entreprise.html.haml
+++ b/app/views/dossiers/etapes/etape_2/_entreprise.html.haml
@@ -1,4 +1,4 @@
-.etape.etapes_menu.col-md-3.col-lg-3
+.etape.etapes_menu.col-md-3.col-sm-3.col-xs-3.col-lg-3
%h3
Mes informations
%br
@@ -12,7 +12,7 @@
= f.submit 'Changer de SIRET', class: %w(btn btn-xs btn-primary)
-.etape.etapes_informations.col-md-9.col-lg-9
+.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9
.row
- if @facade.entreprise.nil?
#new_siret{style:'margin-left: 20%; margin-top: 5%'}
@@ -20,7 +20,7 @@
.form-group.form-group-lg
= f.text_field :siret, class: "form-control", placeholder: "Entrez votre Siret", value: @siret
= f.hidden_field :dossier_id, value: @facade.dossier.id
- = f.submit 'Valider', class: %w(btn btn-lg btn-success), data: { disable_with: "Recherche en cours ..." }
+ = f.submit 'Valider', class: %w(btn btn-lg btn-success), id: 'submit-siret', data: { disable_with: "Recherche en cours ..." }
- else
%br
#recap_info_entreprise
diff --git a/app/views/dossiers/etapes/etape_2/_individual.html.haml b/app/views/dossiers/etapes/etape_2/_individual.html.haml
index 96d7b1246..2c7423a64 100644
--- a/app/views/dossiers/etapes/etape_2/_individual.html.haml
+++ b/app/views/dossiers/etapes/etape_2/_individual.html.haml
@@ -1,45 +1,46 @@
-.etape.etapes_menu.col-md-3.col-lg-3
- %h3
- Mes informations
- %br
- %p.center
+.col-md-3.col-sm-3.col-xs-3.col-lg-3.center
+ %h3 Mes informations
+ %p
Les informations de bases
%br
vous concernant.
-.etape.etapes_informations.col-md-9.col-lg-9
- .row
- = form_for @facade.dossier, url: { controller: '/users/dossiers', action: :update } do |f|
- = f.hidden_field :id
+.etape.etapes_informations.col-md-9.col-sm-9.col-xs-9.col-lg-9
+ = form_for @facade.dossier, url: { controller: '/users/dossiers', action: :update } do |f|
+ .row
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12.padding-left-30
+ = f.hidden_field :id
- = f.fields_for :individual, @facade.individual do |ff|
- .form-group
- %label
- %h4
- Civilité
- = ff.select :gender, ['Mr', 'Mme']
- .form-group
- %label
- %h4
- Nom
- = ff.text_field :nom, {class: 'form-control'}
- .form-group
- %label
- %h4
- Prénom
- = ff.text_field :prenom, {class: 'form-control'}
- .form-group
- %label
- %h4
- Date de naissance
- = ff.text_field :birthdate, {class: 'form-control', 'data-provide' => 'datepicker', 'data-date-format' => 'dd/mm/yyyy'}
+ = f.fields_for :individual, @facade.individual do |ff|
+ .form-group
+ %label
+ %h4
+ Civilité
+ = ff.select :gender, ['Mr', 'Mme']
+ .form-group
+ %label
+ %h4
+ Nom *
+ = ff.text_field :nom, {class: 'form-control'}
+ .form-group
+ %label
+ %h4
+ Prénom *
+ = ff.text_field :prenom, {class: 'form-control'}
+ .form-group
+ %label
+ %h4
+ Date de naissance *
+ = ff.text_field :birthdate, {class: 'form-control', 'data-provide' => 'datepicker', 'data-date-format' => 'dd/mm/yyyy'}
- %p
- %label{ style:'font-weight:normal' }
- = f.check_box :autorisation_donnees
- = " ".html_safe
- Vos informations personnelles ne seront jamais utilisées dans un but lucratif ou commercial. Elles ne pourront être communiquées à de tiers personnes sans votre accord préalable. Elles pourront en revanche être communiquées aux administrations compétentes afin d'instruire votre dossier, conformément à la déclaration CNIL effectué par le service TPS.
- =link_to 'en savoir plus', cgu_path, target: '_blank'
-
- %br
- = f.submit 'Etape suivante', class: "btn btn btn-info", style: 'float:right', id: 'etape_suivante'
+ %p
+ %label{ style:'font-weight:normal' }
+ = f.check_box :autorisation_donnees
+ = " ".html_safe
+ Vos informations personnelles ne seront jamais utilisées dans un but lucratif ou commercial. Elles ne pourront être communiquées à de tiers personnes sans votre accord préalable. Elles pourront en revanche être communiquées aux administrations compétentes afin d'instruire votre dossier, conformément à la déclaration CNIL effectué par le service TPS.
+ =link_to 'en savoir plus', cgu_path, target: '_blank'
+ .row
+ .col-md-5.col-sm-5.col-xs-5.col-lg-5.col-xs-5
+ .col-md-2.col-sm-2.col-xs-2.col-lg-2.col-xs-2
+ = f.submit 'Etape suivante', class: "action", id: 'etape_suivante'
+ .col-md-5.col-sm-5.col-xs-5.col-lg-5.col-xs-5
diff --git a/app/views/gestionnaires/_login_banner.html.haml b/app/views/gestionnaires/_login_banner.html.haml
index 40651db9d..42d8b71d9 100644
--- a/app/views/gestionnaires/_login_banner.html.haml
+++ b/app/views/gestionnaires/_login_banner.html.haml
@@ -1,6 +1 @@
-%div.user
-
- %i.fa.fa-user
- = current_gestionnaire.email
-
- = link_to "Déconnexion", '/gestionnaires/sign_out', method: :delete, :class => 'btn btn-md'
\ No newline at end of file
+= link_to "", "/gestionnaires/sign_out", method: :delete, class: "btn btn-md fa fa-sign-out"
diff --git a/app/views/gestionnaires/passwords/edit.html.haml b/app/views/gestionnaires/passwords/edit.html.haml
index 7b387b366..a0d7ed99c 100644
--- a/app/views/gestionnaires/passwords/edit.html.haml
+++ b/app/views/gestionnaires/passwords/edit.html.haml
@@ -15,14 +15,14 @@
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-asterisk
+ %span.fa.fa-asterisk
= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control'
%br
%h4
= f.label 'Retaper le mot de passe'
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-asterisk
+ %span.fa.fa-asterisk
= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control'
%br
%br
diff --git a/app/views/gestionnaires/passwords/new.html.haml b/app/views/gestionnaires/passwords/new.html.haml
index b0e8cddb9..a8c09db1f 100644
--- a/app/views/gestionnaires/passwords/new.html.haml
+++ b/app/views/gestionnaires/passwords/new.html.haml
@@ -14,7 +14,7 @@
= f.label :email
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-user
+ %span.fa.fa-user
= f.email_field :email, class: 'form-control', placeholder: 'Email'
%br
%br
diff --git a/app/views/gestionnaires/sessions/new.html.haml b/app/views/gestionnaires/sessions/new.html.haml
index d6e4dc203..0180bd760 100644
--- a/app/views/gestionnaires/sessions/new.html.haml
+++ b/app/views/gestionnaires/sessions/new.html.haml
@@ -12,14 +12,14 @@
= f.label :email
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-user
+ %span.fa.fa-user
= f.email_field :email, class: 'form-control'
%br
%h4
= f.label :password
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-asterisk
+ %span.fa.fa-asterisk
= f.password_field :password, autocomplete: "off", class: 'form-control', value: @gestionnaire.password
%br
%br
diff --git a/app/views/layouts/_credentials.html.haml b/app/views/layouts/_credentials.html.haml
new file mode 100644
index 000000000..0622f4600
--- /dev/null
+++ b/app/views/layouts/_credentials.html.haml
@@ -0,0 +1,4 @@
+%div.dropdown-menu#credentials
+ %div.description= t("utils.deconnexion")
+ = @current_gestionnaire.email if @current_gestionnaire
+ = @current_user.email if @current_user
diff --git a/app/views/layouts/_etape_suivante.html.haml b/app/views/layouts/_etape_suivante.html.haml
index d4d00300a..145167c0d 100644
--- a/app/views/layouts/_etape_suivante.html.haml
+++ b/app/views/layouts/_etape_suivante.html.haml
@@ -1 +1 @@
-= submit_tag 'Etape suivante', class: %w(btn btn btn-info), style: 'float:right', id: 'etape_suivante', data: { disable_with: 'Etape suivante', submit: true}
\ No newline at end of file
+= submit_tag 'Etape suivante', class: %w(btn btn btn-info), style: 'float:right', id: 'etape_suivante', data: { disable_with: 'Etape suivante', submit: true}
diff --git a/app/views/layouts/_flash_messages.html.haml b/app/views/layouts/_flash_messages.html.haml
new file mode 100644
index 000000000..2ed1b4013
--- /dev/null
+++ b/app/views/layouts/_flash_messages.html.haml
@@ -0,0 +1,7 @@
+#flash_message.center
+- if flash.notice
+ .alert.alert-success
+ = flash.notice
+- if flash.alert
+ .alert.alert-danger
+ = flash.alert
diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml
new file mode 100644
index 000000000..41b2dbeff
--- /dev/null
+++ b/app/views/layouts/_footer.html.haml
@@ -0,0 +1,10 @@
+%div#footer
+ %p{class: "copyright col-md-push-#{12-main_container_size} col-md-#{main_container_size} col-lg-push-#{12-main_container_size} col-lg-#{main_container_size} text-muted small"}
+ = link_to 'SGMAP', "http://etatplateforme.modernisation.gouv.fr"
+ = Time.now.year
+ \-
+ = link_to 'Nouveautés', 'https://github.com/sgmap/tps/releases', target: '_blank'
+ \-
+ = link_to 'CGU / Mentions légales', cgu_path
+ \-
+ = link_to 'Contact', "mailto:"+t('dynamics.contact_email')
diff --git a/app/views/layouts/_main_container.html.haml b/app/views/layouts/_main_container.html.haml
new file mode 100644
index 000000000..362a66024
--- /dev/null
+++ b/app/views/layouts/_main_container.html.haml
@@ -0,0 +1,6 @@
+%div#main-container{class: "col-lg-#{main_container_size} col-md-#{main_container_size}"}
+ %div.row
+ = render partial: 'layouts/flash_messages'
+ %div.row
+ = yield
+ %div.row
diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml
index c67a744f2..447f070ce 100644
--- a/app/views/layouts/_navbar.html.haml
+++ b/app/views/layouts/_navbar.html.haml
@@ -1,43 +1,17 @@
-#beta{class:(Rails.env == 'production' ? '' : 'beta_staging')}
- - if Rails.env == 'production'
- Beta
- - else
- Env Test
-= image_tag('marianne_small.png', class: 'logo')
-%a{href: '/'}
- = image_tag(image_url(LOGO_NAME), class: 'logo') rescue nil
+%div.col-lg-2.col-md-2.col-sm-2.col-xs-2
+ %a#title_navbar{href: '/'}
+ %div.row#home
+ %div.col-lg-6.no-padding
+ = image_tag('marianne_small.png', class: 'logo')
+ %div.col-lg-6.no-padding#tps-title
+ TPS
-- if gestionnaire_signed_in? && user_signed_in?
- %a{href: (current_gestionnaire.procedure_filter.blank? ? backoffice_dossiers_path : backoffice_dossiers_procedure_path(current_gestionnaire.procedure_filter)), class: 'btn btn-md'}
- =t('dynamics.backoffice.dossiers')
- %a{href: users_dossiers_path, class: 'btn btn-md'}
- =t('dynamics.users.mes_dossiers')
-- elsif gestionnaire_signed_in?
- %a{href: (current_gestionnaire.procedure_filter.blank? ? backoffice_dossiers_path : backoffice_dossiers_procedure_path(current_gestionnaire.procedure_filter)), class: 'btn btn-md'}
- =t('dynamics.users.mes_dossiers')
-- elsif user_signed_in?
- %a{href: users_dossiers_path, class: 'btn btn-md'}
- =t('dynamics.users.mes_dossiers')
-- elsif administrateur_signed_in?
- %a{href: admin_procedures_path, class: 'btn btn-md'}
- =t('dynamics.admin.menu.title')
+%div.col-lg-10.col-md-10.col-sm-10.col-xs-10.no-padding
+ %div#navbar-body
+ %div.row
+ -begin
+ = render partial: @navbar_url
+ -rescue
+ = render partial: 'layouts/navbars/navbar_default'
-#sign_out
- -if user_signed_in?
- = render partial: 'users/login_banner'
- -elsif gestionnaire_signed_in?
- = render partial: 'gestionnaires/login_banner'
- -elsif administrateur_signed_in?
- = render partial: 'administrateurs/login_banner'
- -else
- = link_to "Utilisateur", '/users/sign_in', method: :get, :class => 'btn btn-md'
- -unless Features.unified_login
- = link_to "Accompagnateur", '/gestionnaires/sign_in', method: :get, :class => 'btn btn-md'
- = link_to "Administrateur", '/administrateurs/sign_in', method: :get, :class => 'btn btn-md'
-
-- if Rails.env != 'production'
- %div.staging_warning
- %b{style:'color: #B00100', 'data-placement' => 'bottom', 'data-original-title' => "Aucune donnée présente sur cette plateforme ne pourra être transférée sur l'environnement final de production.", 'data-toggle' => 'tooltip'}
- Vous vous trouvez actuellement sur la plateforme de test.
- %div.badge.progress-bar-danger
- ?
+ = render partial: 'layouts/navbars/navbar_log_options'
diff --git a/app/views/layouts/_notifications_alert.html.haml b/app/views/layouts/_notifications_alert.html.haml
new file mode 100644
index 000000000..372fe7497
--- /dev/null
+++ b/app/views/layouts/_notifications_alert.html.haml
@@ -0,0 +1 @@
+#notification_alert.alert.alert-success
diff --git a/app/views/layouts/_support_navigator_banner.html.haml b/app/views/layouts/_support_navigator_banner.html.haml
new file mode 100644
index 000000000..26a53c962
--- /dev/null
+++ b/app/views/layouts/_support_navigator_banner.html.haml
@@ -0,0 +1,9 @@
+- unless BrowserService.recommended_browser?
+ #support_navigator_banner.row
+ .col-md-12.col-sm-12.col-xs-12.col-lg-12
+ = BROWSER.value.name
+ = BROWSER.value.version
+ \-
+ Attention, votre navigateur n'est pas recommandé pour la navigation sur ce site internet. Aucun support ne pourra vous être prodigué en cas de dysfonctionnement.
+ %a{href: '/cgu/#navigateurs'}
+ Voir la liste des navigateurs compatibles.
diff --git a/app/views/layouts/_switch_devise_profile_module.html.haml b/app/views/layouts/_switch_devise_profile_module.html.haml
new file mode 100644
index 000000000..c8f3e6705
--- /dev/null
+++ b/app/views/layouts/_switch_devise_profile_module.html.haml
@@ -0,0 +1,25 @@
+- if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect?
+ #switch_menu.dropdown.dropup
+ %button.btn.btn-default.dropdown-toggle{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false}
+ %i.fa.fa-toggle-on
+ %span.caret
+ %ul.dropdown-menu.dropdown-menu-left
+ - if user_signed_in?
+ %li
+ = link_to(users_dossiers_path, id: :menu_item_procedure) do
+ %i.fa.fa-user
+
+ Utilisateur
+ - if gestionnaire_signed_in?
+ %li
+ = link_to(backoffice_dossiers_path) do
+ %i.fa.fa-user
+
+ Accompagnateur
+
+ - if administrateur_signed_in?
+ %li
+ = link_to(admin_procedures_path) do
+ %i.fa.fa-user
+
+ Administrateur
\ No newline at end of file
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index dff7894ba..1730f61a7 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -1,4 +1,3 @@
-!!!
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
@@ -7,11 +6,18 @@
%meta{'http-equiv' => "X-UA-Compatible", :content => "IE=edge"}
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
- = stylesheet_link_tag 'application_split2', media: 'all', 'data-turbolinks-track' => true
-
= javascript_include_tag 'application', 'data-turbolinks-track' => true
+
= csrf_meta_tags
+ = action_cable_meta_tag
%body
+ = render partial: 'layouts/support_navigator_banner'
+ #beta{class:(Rails.env == 'production' ? '' : 'beta_staging')}
+ - if Rails.env == 'production'
+ Beta
+ - else
+ Env Test
+
- if Rails.env == 'test'
%script{type: 'text/javascript'}
(typeof jQuery !== 'undefined') && (jQuery.fx.off = true);
@@ -23,37 +29,28 @@
="".html_safe
%div#wrap
- %div#header.navbar
- =render partial: "layouts/navbar"
+ %div.row
+ %div#header.navbar
+ = render partial: "layouts/navbar"
+ %div.row.no-margin
+ - if RenderPartialService.left_panel_exist? @left_pannel_url
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2#left-pannel
+ - if gestionnaire_signed_in?
+ #search-block
+ = render partial: 'layouts/left_panels/search_area'
- #flash_message.center
- - if flash.notice
- .alert.alert-success
- = flash.notice
- - if flash.alert
- .alert.alert-danger
- = flash.alert
- #main_div.main_div
- = yield
+ = render partial: @left_pannel_url
+ - main_container_size = 10
+ - else
+ - main_container_size = 12
- %br
+ =render partial: 'layouts/main_container', locals: {main_container_size: main_container_size}
+ #mask_search
+ %h1
+ %i.fa.fa-times{style:'position: fixed; top: 10; right: 30; color: white;'}
- #footer.navbar
- .container.center
- %p{style:'margin-top: 1em;'}
- %p{class: "copyright text-muted small"}
- =link_to 'SGMAP', "http://etatplateforme.modernisation.gouv.fr"
-
- 2016
-
- \-
-
- =link_to 'CGU / Mentions légales', cgu_path
-
- \-
-
- =link_to 'Contact', "mailto:"+t('dynamics.contact_email')
+ = render partial: 'layouts/switch_devise_profile_module'
+ = render partial: 'layouts/notifications_alert'
+ = render partial: 'layouts/footer', locals: {main_container_size: main_container_size}
= render partial: 'layouts/google_analytics'
-
-
diff --git a/app/views/layouts/left_panels/_left_panel_admin_accompagnateurscontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_accompagnateurscontroller_show.html.haml
new file mode 100644
index 000000000..bd8f7bb43
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_accompagnateurscontroller_show.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Accompagnateurs'}
diff --git a/app/views/layouts/left_panels/_left_panel_admin_mailscontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_admin_mailscontroller_index.html.haml
new file mode 100644
index 000000000..1bdf2e3b1
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_mailscontroller_index.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'E-mails'}
diff --git a/app/views/layouts/left_panels/_left_panel_admin_piecesjustificativescontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_piecesjustificativescontroller_show.html.haml
new file mode 100644
index 000000000..c5f7aff8c
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_piecesjustificativescontroller_show.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Pieces'}
diff --git a/app/views/layouts/left_panels/_left_panel_admin_previsualisationscontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_previsualisationscontroller_show.html.haml
new file mode 100644
index 000000000..2fc92cf37
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_previsualisationscontroller_show.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Prévisualisation'}
diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml
new file mode 100644
index 000000000..640ef345e
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml
@@ -0,0 +1 @@
+=render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index'
\ No newline at end of file
diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml
new file mode 100644
index 000000000..640ef345e
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml
@@ -0,0 +1 @@
+=render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index'
\ No newline at end of file
diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml
new file mode 100644
index 000000000..65c5ce32e
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Description'}
diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml
new file mode 100644
index 000000000..c246b2d97
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml
@@ -0,0 +1,33 @@
+%div#first-block
+ %div.en-cours
+ %b
+ = dossier_count = current_administrateur.procedures.count
+ = ("Procedures".pluralize(dossier_count)).upcase
+
+%div#action-block
+
+%div#menu-block
+ %div.split-hr-left
+ #procedure_list
+ %a{:href => "#{url_for :admin_procedures_draft}", id: "draft-procedures"}
+ %div.procedure_list_element{class: @draft_class}
+ = "Brouillons"
+ .badge.progress-bar-default
+ = current_administrateur.procedures.where(published: false, archived: false).count
+
+ %a{:href => "#{url_for :admin_procedures}", id: "active-procedures"}
+ %div.procedure_list_element{class: @active_class}
+ = "Actives"
+ .badge.progress-bar-success
+ = current_administrateur.procedures.where(published: true, archived: false).count
+
+ %a{:href => "#{url_for :admin_procedures_archived}", id: "archived-procedures"}
+ %div.procedure_list_element{class: @archived_class}
+ ="Archivées"
+ .badge.progress-bar-purple
+ = current_administrateur.procedures.where(archived: true).count
+
+ %div.split-hr-left
+
+
+%div#infos-block
diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml
new file mode 100644
index 000000000..01774dbe0
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml
@@ -0,0 +1,53 @@
+
+%div#first-block
+ %div.en-cours
+ -unless @procedure.logo.blank?
+ = image_tag @procedure.decorate.logo_img, style: 'width: 30px'
+ %b
+ =@procedure.libelle
+
+%div#action-block
+
+%div#menu-block
+ %div.split-hr-left
+ #procedure_list
+ %a{:href => "#{url_for admin_procedure_path(@procedure)}", id: 'onglet-infos'}
+ %div.procedure_list_element{class: ('active' if active == 'Informations')}
+ Informations
+
+ %a{:href => "#{url_for admin_procedure_accompagnateurs_path(@procedure)}", id: 'onglet-accompagnateurs'}
+ %div.procedure_list_element{class: ('active' if active == 'Accompagnateurs')}
+ =t('dynamics.admin.procedure.onglets.accompagnateurs')
+
+ - unless @procedure.locked?
+ %a{:href => "#{url_for edit_admin_procedure_path(@procedure)}", id: 'onglet-description'}
+ %div.procedure_list_element{class: ('active' if active == 'Description')}
+ Description
+
+ - unless @procedure.locked?
+ %a{:href => "#{url_for admin_procedure_types_de_champ_path(@procedure)}", id: 'onglet-champs'}
+ %div.procedure_list_element{class: ('active' if active == 'Champs')}
+ Champs
+
+ - unless @procedure.locked?
+ %a{:href => "#{url_for admin_procedure_pieces_justificatives_path(@procedure)}", id: 'onglet-pieces'}
+ %div.procedure_list_element{class: ('active' if active == 'Pieces')}
+ Pièces justificatives
+
+ - unless @procedure.locked?
+ %a{:href => "#{url_for admin_procedure_types_de_champ_private_path(@procedure)}", id: 'onglet-private-champs'}
+ %div.procedure_list_element{class: ('active' if active == 'Champs privés')}
+ Champs privés
+
+ %a{:href => "#{url_for admin_procedure_mails_path(@procedure)}", id: 'onglet-inemailsfos'}
+ %div.procedure_list_element{class: ('active' if active == 'E-mails')}
+ E-mails
+
+ %a{:href => "#{url_for admin_procedure_previsualisation_path(@procedure)}", id: 'onglet-preview'}
+ %div.procedure_list_element{class: ('active' if active == 'Prévisualisation')}
+ Prévisualisation
+
+ %div.split-hr-left
+
+
+%div#infos-block
diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml
new file mode 100644
index 000000000..261049466
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Informations'}
diff --git a/app/views/layouts/left_panels/_left_panel_admin_typesdechampcontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_typesdechampcontroller_show.html.haml
new file mode 100644
index 000000000..4e455ad7a
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_typesdechampcontroller_show.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: @types_de_champ_facade.active}
diff --git a/app/views/layouts/left_panels/_left_panel_admin_typesdechampprivatecontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_typesdechampprivatecontroller_show.html.haml
new file mode 100644
index 000000000..b7e8e7336
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_admin_typesdechampprivatecontroller_show.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: "Champs privés"}
diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossiers_procedurecontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossiers_procedurecontroller_index.html.haml
new file mode 100644
index 000000000..b4114cab1
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossiers_procedurecontroller_index.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/left_panels/left_panel_backoffice_dossierscontroller_index'
diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml
new file mode 100644
index 000000000..59b380de6
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml
@@ -0,0 +1,43 @@
+%div#first-block
+ %div.dossiers-en-cours
+ .count= @facade_data_view.total_dossier
+ .text= "SUIVIS"
+ %div.nouveaux-dossiers
+ .count= @facade_data_view.total_new_dossier
+ .text= "NOUVEAUX"
+ %div.nouvelles-notifications
+ .count= @facade_data_view.dossiers_with_unread_notifications.count
+ .text= "MODIFIÉS"
+
+%div#action-block
+
+%div#menu-block
+ %div.split-hr-left
+ #switch-buttons
+ #switch-procedures.active Procédures
+ #switch-notifications Notifications
+
+%div#infos-block
+ %div.split-hr-left
+ #procedure_list
+ - @facade_data_view.gestionnaire_procedures_name_and_id_list.each do |procedure|
+ = link_to backoffice_dossiers_procedure_path(procedure[:id]), {title: procedure[:libelle]} do
+ %div.procedure_list_element{ class: ('active' if procedure[:id] == @facade_data_view.procedure.id rescue '') }
+ = truncate(procedure[:libelle], length: 50)
+ - total_new = @facade_data_view.new_dossier_number procedure[:id]
+ - if total_new > 0
+ .badge.progress-bar-success{title:'Nouveaux dossiers'}
+ = total_new
+ -if procedure[:unread_notifications] > 0
+ .badge.progress-bar-warning{title: 'Notifications'}
+ = procedure[:unread_notifications]
+ #notifications_list.hidden
+ - if @facade_data_view.dossiers_with_unread_notifications.empty?
+ .no-notification= "Aucune notification pour le moment."
+ - else
+ - @facade_data_view.dossiers_with_unread_notifications.each do |dossier|
+ = link_to backoffice_dossier_path(dossier.id) do
+ .notification
+ .dossier-index= "Dossier n°#{dossier.id}"
+ .updated-at-index= dossier.first_unread_notification.created_at.strftime('%d/%m %H:%M')
+ .count= dossier.unreaded_notifications.count
diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_search.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_search.html.haml
new file mode 100644
index 000000000..7d73865db
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_search.html.haml
@@ -0,0 +1,2 @@
+= render partial: 'layouts/left_panels/left_panel_backoffice_dossierscontroller_index'
+
diff --git a/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml
new file mode 100644
index 000000000..ed3effe90
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml
@@ -0,0 +1,53 @@
+%div#first-block
+ %div.infos
+ #dossier_id= t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s
+
+%div#action-block
+ - if gestionnaire_signed_in?
+ - if !@facade.dossier.read_only?
+ = form_tag(url_for({controller: 'backoffice/dossiers', action: :valid, dossier_id: @facade.dossier.id}), class: 'form-inline', method: 'POST') do
+ %button.action{'data-toggle' => :tooltip, title: 'En cliquant ici, vous figez le dossier et autorisez le dépôt du dossier pour instruction.'}
+ = 'Déclarer complet'.upcase
+ - elsif @facade.dossier.submitted?
+ = form_tag(url_for({controller: 'backoffice/dossiers', action: :receive, dossier_id: @facade.dossier.id}), class: 'form-inline', method: 'POST') do
+ %button.action
+ = 'Accuser réception'.upcase
+ - elsif @facade.dossier.received?
+ = form_tag(url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Accepter') do
+ %button.action.close-dossier
+ %i.fa.fa-check
+ = form_tag(url_for({controller: 'backoffice/dossiers', action: :without_continuation, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Classer sans suite') do
+ %button.action.forget-dossier
+ %i.fa.fa-circle-o
+ = form_tag(url_for({controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Refuser') do
+ %button.action.refuse-dossier
+ %i.fa.fa-times
+
+%div#menu-block
+
+%div#infos-block
+ %div.split-hr-left
+ %div.dossier-state= @facade.dossier.display_state
+ %div.split-hr-left
+ %div.notifications
+ - if @facade.dossier.notifications.empty?
+ = "Aucune notification pour le moment."
+ - else
+ %i.fa.fa-bell-o
+ - @facade.last_notifications.each do |notification|
+ .notification
+ .updated-at= notification.updated_at.strftime('%d/%m/%Y %H:%M')
+ = render partial: "layouts/left_panels/type_notif_fa", locals: {notification: notification}
+ - if ['champs'].include?(notification.type_notif)
+ - if notification.liste.size > 1
+ .type= "Plusieurs attributs ont été changés, dont: #{notification.liste.join(" ")}"
+ - else
+ .type= "Un attribut à été changé: #{notification.liste.last}"
+ - elsif ['piece_justificative'].include?(notification.type_notif)
+ - if notification.liste.size > 1
+ .type= "Plusieurs pièces justificatives ont été changés, dont: #{notification.liste.join(" ")}"
+ - else
+ .type= "Une pièce justificative à été changée: #{notification.liste.last}"
+ - else
+ .type= notification.liste.last
+ .split-hr
diff --git a/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml
new file mode 100644
index 000000000..199d3cb54
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml
@@ -0,0 +1,54 @@
+%div#cgu_menu_block
+ #procedure_list{style: 'margin-top: 0;'}
+ = link_to cgu_path(:anchor => "editeur") do
+ %div.procedure_list_element
+ Editeur
+
+ = link_to cgu_path(:anchor => "ingenieurie_hebergement") do
+ %div.procedure_list_element
+ Ingénierie et hébergement informatique
+
+ = link_to cgu_path(:anchor => "object_website") do
+ %div.procedure_list_element
+ Object du site internet
+
+ = link_to cgu_path(:anchor => "acteurs") do
+ %div.procedure_list_element
+ Acteurs de TPS
+
+ = link_to cgu_path(:anchor => "CNIL") do
+ %div.procedure_list_element
+ Déclaration CNIL
+
+ = link_to cgu_path(:anchor => "data_collects") do
+ %div.procedure_list_element
+ Données collectées et responsabilité des organismes utilisateurs
+
+ = link_to cgu_path(:anchor => "individual_data") do
+ %div.procedure_list_element
+ Traitement des données à caractère personnel
+
+ = link_to cgu_path(:anchor => "entreprise_information") do
+ %div.procedure_list_element
+ Règles relatives aux informations sur les entreprises mises à disposibition
+
+ = link_to cgu_path(:anchor => "reproduction") do
+ %div.procedure_list_element
+ Droit de reproduction
+
+ = link_to cgu_path(:anchor => "propriete_intellectuelle") do
+ %div.procedure_list_element
+ Propriété intellectuelle
+
+ = link_to cgu_path(:anchor => "navigateurs") do
+ %div.procedure_list_element
+ Logiciels nécessaires à la consultation
+
+ = link_to cgu_path(:anchor => "conception") do
+ %div.procedure_list_element
+ Conception et Réalisation
+
+ %div.procedure_list_element
+
+ %div.procedure_list_element
+
diff --git a/app/views/layouts/left_panels/_left_panel_default.html.haml b/app/views/layouts/left_panels/_left_panel_default.html.haml
new file mode 100644
index 000000000..a8cd3d0b8
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_default.html.haml
@@ -0,0 +1,2 @@
+%div
+ Default Left Panel
\ No newline at end of file
diff --git a/app/views/layouts/left_panels/_left_panel_users_dossierscontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_users_dossierscontroller_index.html.haml
new file mode 100644
index 000000000..792e7c09c
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_users_dossierscontroller_index.html.haml
@@ -0,0 +1,51 @@
+%div#first-block
+ %div.en-cours
+ = dossier_count = current_user.dossiers.count
+ = ("Dossier".pluralize(dossier_count)).upcase
+ %br
+ = "EN COURS"
+
+%div#action-block
+
+%div#menu-block
+ %div.split-hr-left
+ #procedure_list
+ %a{:href => "#{url_for users_dossiers_path(liste: 'brouillon')}", 'data-toggle' => :tooltip, title: 'Les dossiers jamais proposés à la relecture.'}
+ %div.procedure_list_element{ class: @dossiers_list_facade.brouillon_class, id: 'brouillon' }
+ = "Brouillons"
+ .badge.progress-bar-default
+ = @dossiers_list_facade.brouillon_total
+
+ %a{:href => "#{url_for users_dossiers_path(liste: 'a_traiter')}", 'data-toggle' => :tooltip, title: 'Les dossiers qui requièrent une action de votre part.'}
+ %div.procedure_list_element{ class: @dossiers_list_facade.en_construction_class, id: 'a_traiter' }
+ = "En construction"
+ .badge.progress-bar-danger
+ = @dossiers_list_facade.en_construction_total
+
+ %a{:href => "#{url_for users_dossiers_path(liste: 'valides')}", 'data-toggle' => :tooltip, title: 'Les dossiers relus par votre accompagnateur pouvant être déposés pour examen.'}
+ %div.procedure_list_element{ class: @dossiers_list_facade.valides_class, id: 'valides' }
+ ="À déposer"
+ .badge.progress-bar-purple
+ = @dossiers_list_facade.valides_total
+
+ %a{:href => "#{url_for users_dossiers_path(liste: 'en_instruction')}", 'data-toggle' => :tooltip, title: 'Les dossiers en cours d\'examen par l\'administration compétante.'}
+ %div.procedure_list_element{ class: @dossiers_list_facade.en_instruction_class, id: 'en_instruction' }
+ ="En examen"
+ .badge.progress-bar-default
+ = @dossiers_list_facade.en_instruction_total
+
+ %a{:href => "#{url_for users_dossiers_path(liste: 'termine')}", 'data-toggle' => :tooltip, title: 'Les dossiers cloturés qui peuvent être "Accepté", "Refusé" ou "Sans suite".'}
+ %div.procedure_list_element{ class: @dossiers_list_facade.termine_class, id: 'termine' }
+ = "Cloturé"
+ .badge.progress-bar-success
+ = @dossiers_list_facade.termine_total
+
+ %a{:href => "#{url_for users_dossiers_path(liste: 'invite')}"}
+ %div.procedure_list_element{ class: @dossiers_list_facade.invite_class, id: 'invite' }
+ = "Invitation"
+ .badge.progress-bar-warning
+ = @dossiers_list_facade.invite_total
+ %div.split-hr-left
+
+
+%div#infos-block
diff --git a/app/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml
new file mode 100644
index 000000000..23397d47d
--- /dev/null
+++ b/app/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml
@@ -0,0 +1,18 @@
+%div#first-block
+ %div.en-cours
+ %h2 Récapitulatif
+ %div.infos
+ %div= t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s
+
+%div#action-block
+ - if @facade.dossier.validated?
+ = form_tag(url_for({controller: 'users/recapitulatif', action: :submit, dossier_id: @facade.dossier.id}), method: 'POST') do
+ %button#validate_button.action= 'Procéder au dépôt définitif'
+
+%div#menu-block
+
+%div#infos-block
+ - if user_signed_in? && current_user.email == @facade.dossier.user.email
+ %div.split-hr-left
+ %div.dossier-state= @facade.dossier.display_state
+ %div.split-hr-left
diff --git a/app/views/layouts/left_panels/_search_area.html.haml b/app/views/layouts/left_panels/_search_area.html.haml
new file mode 100644
index 000000000..3dfc58840
--- /dev/null
+++ b/app/views/layouts/left_panels/_search_area.html.haml
@@ -0,0 +1,7 @@
+#search_area
+ = form_tag(backoffice_dossiers_search_url, method: :get) do
+ .input-group
+ = text_field_tag('q', "#{@search_terms unless @search_terms.nil? }", id: 'q', placeholder: "Recherchez parmi tous vos dossiers", class:'form-control')
+ %span.input-group-btn
+ %button.btn.btn-default{ id:'search_button' }
+ %i.fa.fa-search
\ No newline at end of file
diff --git a/app/views/layouts/left_panels/_type_notif_fa.html.haml b/app/views/layouts/left_panels/_type_notif_fa.html.haml
new file mode 100644
index 000000000..3f7ea27fc
--- /dev/null
+++ b/app/views/layouts/left_panels/_type_notif_fa.html.haml
@@ -0,0 +1,9 @@
+- case notification.type_notif
+- when "commentaire"
+ .type-notif.fa.fa-comments-o
+- when "submitted"
+ .type-notif.fa.fa-thumbs-o-up
+- when "champs"
+ .type-notif.fa.fa-list-alt
+- when "piece_justificative"
+ .type-notif.fa.fa-chain
diff --git a/app/views/layouts/navbars/_navbar_admin_gestionnairescontroller_index.html.haml b/app/views/layouts/navbars/_navbar_admin_gestionnairescontroller_index.html.haml
new file mode 100644
index 000000000..b1e64c1e2
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_admin_gestionnairescontroller_index.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index'
\ No newline at end of file
diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_archived.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_archived.html.haml
new file mode 100644
index 000000000..b1e64c1e2
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_archived.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index'
\ No newline at end of file
diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_draft.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_draft.html.haml
new file mode 100644
index 000000000..b1e64c1e2
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_draft.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index'
\ No newline at end of file
diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml
new file mode 100644
index 000000000..b4d06fa30
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml
@@ -0,0 +1,26 @@
+%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info
+
+%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
+ %div{ style: "decorate:none; display: flex;box-shadow:none; float:right; display: flex; margin-top: 5px" }
+ %div{ style: "vertical-align: middle; margin-right: 10px; margin-top: auto; margin-bottom: auto;" }
+ = current_administrateur.email
+ .dropdown#admin_menu
+ %button.btn.btn-default.dropdown-toggle#dropdownMenuAdmin{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false}
+ %i.fa.fa-cog
+ %span.caret
+ %ul.dropdown-menu.dropdown-menu-right
+ %li
+ = link_to(admin_procedures_path, id: :menu_item_procedure) do
+ %i.fa.fa-list{ style: "background-size: 10px;"}
+
+ =t('dynamics.admin.menu.procedures')
+ %li
+ = link_to(admin_gestionnaires_path) do
+ %i.fa.fa-user
+
+ =t('dynamics.admin.menu.accompagnateurs')
+ %li.divider{ role: :separator}
+ %li
+ = link_to(admin_profile_path, id: :profile) do
+ %i.fa.fa-user
+ Profile
diff --git a/app/views/layouts/navbars/_navbar_admin_profilecontroller_show.html.haml b/app/views/layouts/navbars/_navbar_admin_profilecontroller_show.html.haml
new file mode 100644
index 000000000..b1e64c1e2
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_admin_profilecontroller_show.html.haml
@@ -0,0 +1 @@
+= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index'
\ No newline at end of file
diff --git a/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml
new file mode 100644
index 000000000..453341a12
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml
@@ -0,0 +1,12 @@
+%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info
+ = @facade_data_view.procedure_id.nil? ? "Tous les dossiers" : @facade_data_view.procedure.libelle
+%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
+ %div.row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12
+ %a.button_navbar#pref_list_dossier_open_action{href: '#', type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
+ %i.fa.fa-pencil
+ Modifier le tableau
+ %span.caret-right
+ %div.row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12
+ = render partial: "dossiers/download_dossiers"
diff --git a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_search.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_search.html.haml
new file mode 100644
index 000000000..6436c912c
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_search.html.haml
@@ -0,0 +1,2 @@
+%div.col-lg-11.col-md-11.col-sm-11.col-xs-11.main-info
+ Recherche dans tous les dossiers
diff --git a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml
new file mode 100644
index 000000000..744d4e583
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml
@@ -0,0 +1,39 @@
+%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info
+ %span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle }
+ = @facade.dossier.procedure.libelle
+%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
+ %div.row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12
+ - if current_gestionnaire.follow?(@facade.dossier.id)
+ = link_to backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), "data-method" => :put, class: "button-navbar-action",id: "suivre_dossier_#{@facade.dossier.id}" do
+ %i.fa.fa-user-times
+ Ne plus suivre
+ -else
+ = link_to backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'button-navbar-action', id: "suivre_dossier_#{@facade.dossier.id}" do
+ %i.fa.fa-user-plus
+ Suivre le dossier
+ %div.row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12
+ %div#invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
+ %i.fa.fa-user
+ = t('utils.involved')
+ %div.dropdown-menu.dropdown-menu-right.dropdown-pannel
+ %h4= t('dynamics.dossiers.followers.title')
+ %ul
+ - unless @facade.followers.empty?
+ - @facade.followers.each do |follower|
+ %li= follower.email
+ - else
+ = t('dynamics.dossiers.followers.empty')
+ %h4= t('dynamics.dossiers.invites.title')
+ %ul
+ - unless @facade.invites.empty?
+ - @facade.invites.each do |invite|
+ %li= invite.email
+ - else
+ = t('dynamics.dossiers.invites.empty')
+
+ %li
+ = form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline', id: 'send-invitation' do
+ = text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invitation-email'
+ = submit_tag 'Ajouter', class: 'btn btn-success'
diff --git a/app/views/layouts/navbars/_navbar_default.html.haml b/app/views/layouts/navbars/_navbar_default.html.haml
new file mode 100644
index 000000000..448f106a8
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_default.html.haml
@@ -0,0 +1 @@
+.col-lg-11.col-md-11.col-sm-11.col-xs-11
diff --git a/app/views/layouts/navbars/_navbar_log_options.html.haml b/app/views/layouts/navbars/_navbar_log_options.html.haml
new file mode 100644
index 000000000..2bf95e4fa
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_log_options.html.haml
@@ -0,0 +1,17 @@
+-#%span.fa.fa-sign-out
+
+-if user_signed_in?
+ .col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding
+ = render partial: 'users/login_banner'
+ = render partial: 'layouts/credentials'
+-elsif gestionnaire_signed_in?
+ .col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding
+ = render partial: 'gestionnaires/login_banner'
+ = render partial: 'layouts/credentials'
+-elsif administrateur_signed_in?
+ .col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding
+ = render partial: 'administrateurs/login_banner'
+ = render partial: 'layouts/credentials'
+-else
+ .col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_in
+ = link_to "Connexion", '/users/sign_in', :class => 'btn btn-lg'
\ No newline at end of file
diff --git a/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml b/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml
new file mode 100644
index 000000000..ba834c09f
--- /dev/null
+++ b/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml
@@ -0,0 +1,29 @@
+%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info
+ %span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle }
+ = @facade.dossier.procedure.libelle.truncate(60)
+%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
+ %div.row.centered-option
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12
+ %div#invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
+ %i.fa.fa-user
+ = t('utils.involved')
+ %div.dropdown-menu.dropdown-menu-right.dropdown-pannel
+ %h4= t('dynamics.dossiers.followers.title')
+ %ul
+ - unless @facade.followers.empty?
+ - @facade.followers.each do |follower|
+ %li= follower.email
+ - else
+ = t('dynamics.dossiers.followers.empty')
+ %h4= t('dynamics.dossiers.invites.title')
+ %ul
+ - unless @facade.invites.empty?
+ - @facade.invites.each do |invite|
+ %li= invite.email
+ - else
+ = t('dynamics.dossiers.invites.empty')
+
+ %li
+ = form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline', id: 'send-invitation' do
+ = text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation', id: 'invitation-email'
+ = submit_tag 'Ajouter', class: 'btn btn-success'
diff --git a/app/views/notification_mailer/dossier_closed.text.erb b/app/views/notification_mailer/dossier_closed.text.erb
index 57e7c03fa..81d692a64 100644
--- a/app/views/notification_mailer/dossier_closed.text.erb
+++ b/app/views/notification_mailer/dossier_closed.text.erb
@@ -6,5 +6,9 @@ A tout moment, vous pouvez consulter le contenu de vos dossiers et les éventuel
Bonne journée
+---
+Merci de ne pas répondre à ce mail. Postez directement vos questions dans votre dossier sur la plateforme.
+---
+
---
L'équide TPS - tps@apientreprise.fr
\ No newline at end of file
diff --git a/app/views/notification_mailer/dossier_refused.text.erb b/app/views/notification_mailer/dossier_refused.text.erb
index 1c061ad32..2024297be 100644
--- a/app/views/notification_mailer/dossier_refused.text.erb
+++ b/app/views/notification_mailer/dossier_refused.text.erb
@@ -6,5 +6,9 @@ Pour en savoir plus sur le motif du refus, vous pouvez consulter le contenu de v
Bonne journée,
+---
+Merci de ne pas répondre à ce mail. Postez directement vos questions dans votre dossier sur la plateforme.
+---
+
---
L'équide TPS - tps@apientreprise.fr
\ No newline at end of file
diff --git a/app/views/notification_mailer/dossier_submitted.text.erb b/app/views/notification_mailer/dossier_submitted.text.erb
index bc05f0e26..2357b8bbf 100644
--- a/app/views/notification_mailer/dossier_submitted.text.erb
+++ b/app/views/notification_mailer/dossier_submitted.text.erb
@@ -4,5 +4,9 @@ Nous vous confirmons que votre dossier N°<%=@dossier.id%> a été déposé aupr
Bonne journée,
+---
+Merci de ne pas répondre à ce mail. Postez directement vos questions dans votre dossier sur la plateforme.
+---
+
---
L'équide TPS - tps@apientreprise.fr
\ No newline at end of file
diff --git a/app/views/notification_mailer/dossier_validated.text.erb b/app/views/notification_mailer/dossier_validated.text.erb
index bfe057f15..a5b19304b 100644
--- a/app/views/notification_mailer/dossier_validated.text.erb
+++ b/app/views/notification_mailer/dossier_validated.text.erb
@@ -6,5 +6,9 @@ Afin de finaliser son dépôt, merci de vous rendre sur <%=users_dossier_recapit
Bonne journée,
+---
+Merci de ne pas répondre à ce mail. Postez directement vos questions dans votre dossier sur la plateforme.
+---
+
---
L'équide TPS - tps@apientreprise.fr
\ No newline at end of file
diff --git a/app/views/notification_mailer/dossier_without_continuation.text.erb b/app/views/notification_mailer/dossier_without_continuation.text.erb
index 66d0604c2..73fe7d8e2 100644
--- a/app/views/notification_mailer/dossier_without_continuation.text.erb
+++ b/app/views/notification_mailer/dossier_without_continuation.text.erb
@@ -6,5 +6,9 @@ Pour en savoir plus sur les raisons de ce classement sans suite, vous pouvez con
Bonne journée,
+---
+Merci de ne pas répondre à ce mail. Postez directement vos questions dans votre dossier sur la plateforme.
+---
+
---
L'équide TPS - tps@apientreprise.fr
\ No newline at end of file
diff --git a/app/views/notification_mailer/new_answer.text.erb b/app/views/notification_mailer/new_answer.text.erb
index 947d7826d..d6874bd6d 100644
--- a/app/views/notification_mailer/new_answer.text.erb
+++ b/app/views/notification_mailer/new_answer.text.erb
@@ -1,10 +1,14 @@
Bonjour <%= @user.email %>
-Un nouveau commentaire est disponible dans votre espace TPS.
+Un nouveau message est disponible dans votre espace TPS.
Pour le consulter, merci de vous rendre sur <%=users_dossier_recapitulatif_url(dossier_id: @dossier.id)%>
Bonne journée
+---
+Merci de ne pas répondre à ce mail. Postez directement vos questions dans votre dossier sur la plateforme.
+---
+
---
L'équide TPS - tps@apientreprise.fr
\ No newline at end of file
diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml
index 0e2e9e1ba..ef8e807e9 100644
--- a/app/views/root/landing.html.haml
+++ b/app/views/root/landing.html.haml
@@ -1,100 +1,51 @@
#landing.max-size
#title
%h1.center
- TPS
+ %img#logo-tps{src: image_url('logos/logo-tps.png')}
%h2.center
TéléProcédure Simplifiée
- %br
%h3.center
- Dématérialisez, réceptionnez et co-instruisez toutes vos démarches depuis un espace unique.
+ Plateforme publique pour réaliser des démarches administratives 100% en ligne.
%br
%br
.center
- %button.js-scrollTo.btn.btn-lg.btn-success{cible: '.demo_account'}
+ %button.background-tps.js-scrollTo.btn.btn-lg{cible: '.demo_account'}
Envie d'essayer ?
+#landing_body.max-size
+ .row#etapes.center
+ #create_1.col-lg-3.col-md-3.col-sm-3.col-xs-3
+ %img{src:image_url('etapes/create_1.png')}
+ %br
+ %h4 Administration
+ %h3.text-info Je construis ma démarche 100% en ligne
+ #complet_2.col-lg-3.col-md-3.col-sm-3.col-xs-3
+ %img{src:image_url('etapes/complet_2.png')}
+ %br
+ %h4 Usager
+ %h3.text-success Je remplis un dossier de manière simplifiée
+ #message_3.col-lg-3.col-md-3.col-sm-3.col-xs-3
+ %img{src:image_url('etapes/message_3.png')}
+ %br
+ %h4 Usager
+ %h3.text-warning Je dialogue avec mon administration en ligne
+ #shared_4.col-lg-3.col-md-3.col-sm-3.col-xs-3
+ %img{src:image_url('etapes/shared_4.png')}
+ %br
+ %h4 Usager et Administrations
+ %h3.text-danger
+ J'invite des partenaires à co-construire le dossier
-#suite.max-size
- .row.word.simplifier
- .col-md-6.col-lg-6
- = image_tag image_url('keywords/simplifier.png')
- .col-md-6.col-lg-6
- %ul.dynamic_ul
- %li
- Générateur simplifié de démarches en ligne pour les administrations
- %li
- Ne demander que les informations strictement nécessaires
- %li
- Profiter d’une identification simplifiée grâce à
- %a{href: 'http://www.modernisation.gouv.fr/ladministration-change-avec-le-numerique/par-son-systeme-dinformation/france-connect-un-acces-universel-aux-administrations-en-ligne',
- target: '_blank'}
- FranceConnect
+ .split-hr-left
- .row.word.echanger
- .col-md-6.col-lg-6
- %ul.dynamic_ul
- %li
- Tchatter avec les services traitant jusqu’à la complétude du dossier
- %li
- Etre notifié de manière électronique
- %li
- Accompagner les usagers dans leur démarche
- %li
- Vérifier les pièces au fur et à mesure
- .col-md-6.col-lg-6
- = image_tag image_url('keywords/echanger.png')
-
- .row.word.profiter
- .col-md-6.col-lg-6
- = image_tag image_url('keywords/profiter.png')
- .col-md-6.col-lg-6
- %ul.dynamic_ul
- %li
- Profiter des ressources cartographiques directement mobilisées, si nécessaire
- %li
- Récupérer des informations officielles collectées directement auprès des administrations
-
- .row.word.news
- .latest_release.col-md-7.col-lg-7
- - if @latest_release.nil?
- %p
- Erreur dans la récupération des données
- -else
- %h3.text-info
- = "Dernière version (#{@latest_release.tag_name} - #{@latest_release.published_at})"
- .body
- =@latest_release.body.html_safe
-
- .center
- \-
- %br
- %a{href: 'https://github.com/sgmap/tps/releases', target: '_blank'}
- = 'Voir toutes les versions'
-
- .col-md-5.col-lg-5
- #video.center
- %iframe{:allowfullscreen => "", :frameborder => "0", :height => "270", :src => "//www.dailymotion.com/embed/video/x3lp4cs", :width => "480"}
- %br
- =link_to 'Toutes les vidéos', '#', {style: 'text-decoration: none', class: 'all_video btn btn-default btn-sm'}
- #all_video{style:'display: none'}
- %br
- %ul
- %li
- =link_to "Création d'une démarche avec TPS (Téléprocédure Simplifiée)", "http://dai.ly/x3s2o65", {target: '_blank'}
- %li
- =link_to "Etape 2 avec TPS : saisine de l'administration par un usager avec France Connect", "http://dai.ly/x3s2oj6", {target: '_blank'}
- %li
- =link_to "Etape 3 avec TPS : l'accompagnement par les services et l'invitation d'autres partenaires publics à co-instruire", "http://dai.ly/x3s2oqp", {target: '_blank'}
- %li
- =link_to "TPS: dernière étape, la validation du dossier et notification", "http://dai.ly/x3s2p6k", {target: '_blank'}
-
- .row.word.demo_account.center
+ .row.demo_account.center
.col-md-4.col-lg-4
%h3.text-primary Acteurs publics
%h4 Créez des démarches en ligne simplifiées et sécurisées.
=link_to 'Démonstration', 'https://tps-dev.apientreprise.fr/administrateurs/sign_in/demo', {class: 'btn btn-lg btn-primary'}
+
.col-md-4.col-lg-4
%h3.text-warning Agents et services
%h4 Accompagnez et co-traitez les projets avec les usagers.
@@ -105,19 +56,31 @@
%h4 Profitez de démarches simplifiées et d’échanges continus avec les services traitants.
=link_to 'Démonstration', 'https://tps-dev.apientreprise.fr/users/sign_in/demo', {class: 'btn btn-lg btn-success'}
- .row.word.documentation
- .col-md-4.col-lg-4.center
- = image_tag image_url('keywords/documentation.png')
- .col-md-4.col-lg-4
- %ul.dynamic_ul
- %li
- =link_to 'Dépliant de présentation', '/data/TPS_Trois_volets.pdf', {target: '_blank'}
- %li
- =link_to 'Documentation d’utilisation', '/data/TPS_documentations_v1_1.pdf', {target: '_blank'}
- -#%li
- -# = link_to 'Documentation des APIs (béta)', '/docs', {target: '_blank'}
- .col-md-4.col-lg-4.center
- = link_to 'Demander un accès administrateur', 'https://tps.apientreprise.fr/users/dossiers/new?procedure_id=31', {class: 'btn btn-lg btn-primary', target: '_blank'}
+ .split-hr-left
+ #request_access.row.center
+ .col-xs-12.col-sm-12.col-md-12.col-lg-12
+ %h3 Envi de commencer à créer votre démarche ?
+ = link_to 'Demander un accès administrateur', 'https://tps.apientreprise.fr/users/dossiers/new?procedure_id=31', {class: 'btn btn-lg background-tps', target: '_blank'}
+
+ .split-hr-left
+
+ .center
+ .row
+ #utilisateurs.col-xs-12.col-sm-12.col-md-12.col-lg-12
+ %h4 Ils nous font confiances
+
+ Conseil Regional Ile de France, Politique de la ville du Pas de Calais (ensemble des administrations et collectivités territoriales concernées), DRIEA Ile de France
+ %br
+ Préfecture de la Martinique, DRIEE Ile de France, Ministère de l’écologie et du développement durable, MEEM, CCI Normandie, DGE
+
+ %br
+ .row
+ #partenaires.col-xs-12.col-sm-12.col-md-12.col-lg-12
+ %h4 Ils travaillent avec nous
+
+ Insee, Infogreffe, Ministère de la jeunesse et du sport, IGN, DGFIP, CGET, France Connect, Open Streetmap, la BAN, api.gouv.fr, Euroquity - BPI, FNTP, Qualibat
+
+ .split-hr-left
diff --git a/app/views/users/_login_banner.html.haml b/app/views/users/_login_banner.html.haml
index f467eebea..c002f3c99 100644
--- a/app/views/users/_login_banner.html.haml
+++ b/app/views/users/_login_banner.html.haml
@@ -1,13 +1,8 @@
-%div.user
- -if current_user.loged_in_with_france_connect?
- %div{ id: "fconnect-profile", "data-fc-logout-url" => '/users/sign_out" data-method="delete' }
- %a.text-info{ href: "#" }
- = "#{current_user.given_name} #{current_user.family_name}"
+- if current_user.loged_in_with_france_connect?
+ %div{ id: "fconnect-profile", "data-fc-logout-url" => '/users/sign_out" data-method="delete' }
+ %a.text-info{ href: "#" }
+ = "#{current_user.given_name} #{current_user.family_name}"
+ = link_to "", "/users/sign_out", method: :delete, class: "btn fa fa-power-off off-fc-link"
- = link_to "", '/users/sign_out', method: :delete, :class => 'btn fa fa-power-off off-fc-link'
-
- -else
- %i.fa.fa-user
- = current_user.email
-
- = link_to "Déconnexion", '/users/sign_out', method: :delete, :class => 'btn btn-md'
\ No newline at end of file
+- else
+ = link_to "", "/users/sign_out", method: :delete, class: "btn btn-md fa fa-sign-out"
diff --git a/app/views/users/carte/_init_carto.html.haml b/app/views/users/carte/_init_carto.html.haml
new file mode 100644
index 000000000..fdb2f12cc
--- /dev/null
+++ b/app/views/users/carte/_init_carto.html.haml
@@ -0,0 +1,4 @@
+%script{type: 'text/javascript'}
+ ="var dossier_id =#{dossier.id}"
+ $(document).on('page:load', initCarto);
+ $(document).ready(initCarto);
\ No newline at end of file
diff --git a/app/views/users/carte/_map.html.haml b/app/views/users/carte/_map.html.haml
new file mode 100644
index 000000000..1f165dccf
--- /dev/null
+++ b/app/views/users/carte/_map.html.haml
@@ -0,0 +1,13 @@
+#carte_page.row
+ #map{class: dossier.procedure.module_api_carto.classes }
+
+ - if dossier.procedure.module_api_carto.quartiers_prioritaires
+ #qp.list
+ %h3.text-info Quartiers prioritaites
+ %ul
+
+ - if dossier.procedure.module_api_carto.cadastre
+ #cadastre.list
+ %h3.text-warning Cadastres
+ %ul
+
diff --git a/app/views/users/carte/show.html.haml b/app/views/users/carte/show.html.haml
index 877279e05..ca76d5f34 100644
--- a/app/views/users/carte/show.html.haml
+++ b/app/views/users/carte/show.html.haml
@@ -1,46 +1,32 @@
-%h2
- ='Localisation'
-%h4.text-primary
- Positionnez-vous et dessinez sur la carte la zone d'action de votre demande.
-%br
-
-.content{style:'margin-bottom:60px'}
- %button#new.btn.btn-md.btn-success{type:'button'}
- %i.fa.fa-pencil
- Ajouter une zone
- -#\-
- -#%button#edit.btn.btn-sm.btn-info{type:'button'} Editer
- -#\-
- -#%button#delete.btn.btn-sm.btn-danger{type:'button'} Supprimer
-
- %span#search_by_address{style: 'margin-left: 20px'}
- %input.form-control{type: :address, placeholder: 'Rechercher une adresse'}
- %br
- %br
- #carte_page.row
- #map{class: @dossier.procedure.module_api_carto.classes }
-
- - if @dossier.procedure.module_api_carto.quartiers_prioritaires
- #qp.list
- %h3.text-info Quartiers prioritaites
- %ul
-
- - if @dossier.procedure.module_api_carto.cadastre
- #cadastre.list
- %h3.text-warning Cadastres
- %ul
-
- = form_tag(url_for({controller: :carte, action: :save, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST') do
+.row#carto_page
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12
+ %h2
+ ='Localisation'
+ %h4.text-primary
+ Positionnez-vous et dessinez sur la carte la zone d'action de votre demande.
%br
- %input{type: 'hidden', value: "#{@dossier.json_latlngs}", name: 'json_latlngs', id: 'json_latlngs'}
- %input{id: 'quartier_prioritaires', type:'hidden', value: "#{@dossier.quartier_prioritaires.to_json}"}
- %input{id: 'cadastres', type:'hidden', value: "#{@dossier.cadastres.to_json}"}
- -if @dossier.draft?
- =render partial: '/layouts/etape_suivante'
- -else
- =render partial: '/layouts/modifications_terminees'
+ .content{style:'margin-bottom:60px'}
+ %button#new.btn.btn-md.btn-success{type:'button'}
+ %i.fa.fa-pencil
+ Ajouter une zone
-%script{type: 'text/javascript'}
- ="var dossier_id =#{@dossier.id}"
- initCarto();
\ No newline at end of file
+ %span#search_by_address{style: 'margin-left: 20px'}
+ %input.form-control{type: :address, placeholder: 'Rechercher une adresse'}
+ %br
+ %br
+
+ =render partial: 'users/carte/map', locals: {dossier: @dossier}
+
+ = form_tag(url_for({controller: :carte, action: :save, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST') do
+ %br
+ %input{type: 'hidden', value: "#{@dossier.json_latlngs}", name: 'json_latlngs', id: 'json_latlngs'}
+ %input{id: 'quartier_prioritaires', type:'hidden', value: "#{@dossier.quartier_prioritaires.to_json}"}
+ %input{id: 'cadastres', type:'hidden', value: "#{@dossier.cadastres.to_json}"}
+
+ -if @dossier.draft?
+ =render partial: '/layouts/etape_suivante'
+ -else
+ =render partial: '/layouts/modifications_terminees'
+
+ = render partial: 'users/carte/init_carto', locals: {dossier: @dossier}
diff --git a/app/views/users/commentaires/_commentaire.html.haml b/app/views/users/commentaires/_commentaire.html.haml
new file mode 100644
index 000000000..c6eb31717
--- /dev/null
+++ b/app/views/users/commentaires/_commentaire.html.haml
@@ -0,0 +1,14 @@
+%div.commentaire
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.comment-header
+ = commentaire.header
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.content
+ = commentaire.body.html_safe
+ - if file = commentaire.piece_justificative
+ .row
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.file
+ = link_to file.content_url, class: 'link', target: '_blank' do
+ %span.fa.fa-file
+ %div
+ = file.original_filename
diff --git a/app/views/users/description/_champs.html.haml b/app/views/users/description/_champs.html.haml
index f56859ee2..7ee565d10 100644
--- a/app/views/users/description/_champs.html.haml
+++ b/app/views/users/description/_champs.html.haml
@@ -1,59 +1,14 @@
--actual_header_section = nil
--@champs.each do |champ|
- .row{class: (actual_header_section.nil? || champ.type_champ == 'header_section' ? '' : "header_section_"+actual_header_section.to_s)}
- %div{class: "type_champ-#{champ.type_champ}"}
+- render_partial_url = private ? 'users/description/champs/header_private_section' : 'users/description/champs/header_section'
+- @champs = @champs_private if private
+- @headers = @headers_private if private
- - if champ.type_champ == 'header_section'
- =render partial: 'users/description/champs/header_section', locals: {champ: champ}
- -actual_header_section = champ.id
-
- -else
- - unless champ.type_champ == 'checkbox' || champ.type_champ == 'engagement'
- %h4
- = champ.libelle
- - if champ.mandatory?
- = '*'
-
- -if champ.type_champ == 'textarea'
- =render partial: 'users/description/champs/textarea', locals: {champ: champ}
-
- -elsif champ.type_champ == 'checkbox'
- = render partial: 'users/description/champs/checkbox', locals: {champ: champ}
-
- -elsif champ.type_champ == 'civilite'
- =render partial: 'users/description/champs/civilite', locals: {champ: champ}
-
- - elsif champ.type_champ == 'datetime'
- =render partial: 'users/description/champs/datetime', locals: {champ: champ}
-
- - elsif champ.type_champ == 'yes_no'
- =render partial: 'users/description/champs/yes_no', locals: {champ: champ}
-
- - elsif champ.type_champ == 'drop_down_list'
- =render partial: 'users/description/champs/drop_down_list', locals: {champ: champ}
-
- - elsif champ.type_champ == 'pays'
- =render partial: 'users/description/champs/pays', locals: {champ: champ}
-
- - elsif champ.type_champ == 'regions'
- =render partial: 'users/description/champs/regions', locals: {champ: champ}
-
- - elsif champ.type_champ == 'engagement'
- =render partial: 'users/description/champs/engagement', locals: {champ: champ}
-
- - elsif champ.type_champ == 'departements'
- =render partial: 'users/description/champs/departements', locals: {champ: champ}
-
- -else
- %input.form-control{name:"champs['#{champ.id}']",
- placeholder: champ.libelle,
- id: "champs_#{champ.id}",
- value: champ.value,
- type: champ.type_champ,
- 'data-provide' => champ.data_provide,
- 'data-date-format' => champ.data_date_format}
-
- - unless champ.description.empty? || champ.type_champ == 'engagement'
+- unless @headers.blank?
+ - if @champs.first.type_champ != 'header_section'
+ =render partial: render_partial_url, locals: {libelle: 'Dossier', order_place: -1, champs: @champs}
+ - @headers.each do |header|
.row
- .col-lg-8.col-md-8{class: 'description_div', id:"description_champs_#{champ.id}"}
- = champ.description
+ %div{class: "type_champ-#{header.type_champ}"}
+ =render partial: render_partial_url, locals: {libelle: header.libelle, order_place: header.order_place, champs: @champs}
+- else
+ .row
+ =render partial: render_partial_url, locals: {libelle: 'Dossier', order_place: -1, champs: @champs}
diff --git a/app/views/users/description/_pieces_justificatives.html.haml b/app/views/users/description/_pieces_justificatives.html.haml
index e5fb27a14..b4de00fef 100644
--- a/app/views/users/description/_pieces_justificatives.html.haml
+++ b/app/views/users/description/_pieces_justificatives.html.haml
@@ -14,7 +14,7 @@
- @dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative|
%tr
- %th.col-lg-6
+ %th.col-lg-6.piece-libelle
= type_de_piece_justificative.libelle
%td.col-lg-5
-if type_de_piece_justificative.api_entreprise
diff --git a/app/views/users/description/_show.html.haml b/app/views/users/description/_show.html.haml
index 03217cb0e..b9daf89f5 100644
--- a/app/views/users/description/_show.html.haml
+++ b/app/views/users/description/_show.html.haml
@@ -1,12 +1,12 @@
.container#description_page
- unless @dossier.procedure.lien_notice.blank?
- #lien_notice_panel.row{style:'width: 280px; position: fixed; background-color: white; right: 5%; top: 80px;'}
+ #lien_notice_panel.row{style:'width: 280px; position: fixed; background-color: white; right: 5%; top: 80px; z-index: 200'}
.panel.panel-info{style:'margin-bottom:0'}
.panel-body.center
.row
- .col-md-1.col-lg-1
+ .col-md-1.col-lg-1.col-sm-1.col-xs-1
.fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'}
- .col-md-10.col-lg-10{style:'padding-right: 0px'}
+ .col-md-10.col-sm-10.col-xs-10.col-lg-10{style:'padding-right: 0px'}
%b
=link_to 'Accéder au guide', @dossier.procedure.lien_notice, {target: '_blank'}
pour remplir pour votre dossier
@@ -14,15 +14,11 @@
%h2.text-info
= @dossier.procedure.libelle
- - unless Features.opensimplif
- %h3 Votre dossier
-
-#TODO use form_for
= form_tag(url_for({controller: 'users/description', action: :create, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST', multipart: true) do
-
- #liste_champs
- -unless @champs.nil?
- =render partial: 'users/description/champs'
+ -unless @champs.nil?
+ #liste_champs
+ =render partial: 'users/description/champs', locals:{private: false}
-if !@procedure.lien_demarche.blank? || @procedure.cerfa_flag || @dossier.types_de_piece_justificative.size > 0
%br
@@ -43,14 +39,15 @@
.panel.panel-info
.panel-body.center
.row
- .col-md-1.col-lg-1
+ .col-md-1.col-lg-1.col-sm-1.col-xs-1
.fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'}
- .col-md-11.col-lg-11
+ .col-md-11.col-sm-11.col-xs-11.col-lg-11
Les documents administratifs ne sont pas indispensables afin d'initier votre dossier.
Vous pourrez dans tous les cas les compléter plus tard si vous ne les possédez pas de suite.
- - if user_signed_in?
+ -route = Rails.application.routes.recognize_path(request.referrer)
+ - unless route[:controller].match('admin')
%div{style: 'text-align:right'}
%h6 Tous les champs portant un * sont obligatoires.
@@ -61,4 +58,4 @@
= submit_tag 'Enregistrer un brouillon', id: 'brouillon', name: 'submit[brouillon]', class: %w(btn btn-xs btn-default), style: 'float:right; margin-right: 10px; margin-top: 6px', data: {disable_with: 'Enregistrer un brouillon', submit: true}
%br
- %br
\ No newline at end of file
+ %br
diff --git a/app/views/users/description/champs/_header_private_section.html.haml b/app/views/users/description/champs/_header_private_section.html.haml
new file mode 100644
index 000000000..f1ec1ce8f
--- /dev/null
+++ b/app/views/users/description/champs/_header_private_section.html.haml
@@ -0,0 +1,6 @@
+.row
+ .col-lg-12.col-md-12.col-sm-12.col-xs-12
+ %br
+ %h3.text-info
+ =libelle
+ = render partial: 'users/description/champs/render_list_champs', locals: {champs: champs, order_place: order_place}
diff --git a/app/views/users/description/champs/_header_section.html.haml b/app/views/users/description/champs/_header_section.html.haml
index ca20b7342..b2d4662d0 100644
--- a/app/views/users/description/champs/_header_section.html.haml
+++ b/app/views/users/description/champs/_header_section.html.haml
@@ -1,6 +1,9 @@
-%h3.text-primary.page-header
- =champ.libelle
- %span.mask_section{style:'float: right'}
- %a.mask_section_button.btn.btn-xs.btn-info{id: "mask_button_"+champ.id.to_s}
- Masquer la section
- %i.fa.fa-chevron-up
\ No newline at end of file
+.default_data_block.default_visible
+ %div.row.show-block.infos
+ %div.header
+ %div.col-lg-12.col-md-12.col-sm-12.col-xs-12.title
+ %div.carret-right
+ %div.carret-down
+ =libelle
+ %div.body
+ = render partial: 'users/description/champs/render_list_champs', locals: {champs: champs, order_place: order_place}
\ No newline at end of file
diff --git a/app/views/users/description/champs/_render_list_champs.html.haml b/app/views/users/description/champs/_render_list_champs.html.haml
new file mode 100644
index 000000000..e15eceef6
--- /dev/null
+++ b/app/views/users/description/champs/_render_list_champs.html.haml
@@ -0,0 +1,54 @@
+-champs.each do |champ|
+ - if champ.order_place > order_place
+ - if champ.type_champ == 'header_section'
+ - break
+
+ - unless champ.type_champ == 'checkbox' || champ.type_champ == 'engagement'
+ %h4
+ = champ.libelle
+ - if champ.mandatory?
+ = '*'
+
+ -if champ.type_champ == 'textarea'
+ =render partial: 'users/description/champs/textarea', locals: {champ: champ}
+
+ -elsif champ.type_champ == 'checkbox'
+ = render partial: 'users/description/champs/checkbox', locals: {champ: champ}
+
+ -elsif champ.type_champ == 'civilite'
+ =render partial: 'users/description/champs/civilite', locals: {champ: champ}
+
+ - elsif champ.type_champ == 'datetime'
+ =render partial: 'users/description/champs/datetime', locals: {champ: champ}
+
+ - elsif champ.type_champ == 'yes_no'
+ =render partial: 'users/description/champs/yes_no', locals: {champ: champ}
+
+ - elsif champ.type_champ == 'drop_down_list'
+ =render partial: 'users/description/champs/drop_down_list', locals: {champ: champ}
+
+ - elsif champ.type_champ == 'pays'
+ =render partial: 'users/description/champs/pays', locals: {champ: champ}
+
+ - elsif champ.type_champ == 'regions'
+ =render partial: 'users/description/champs/regions', locals: {champ: champ}
+
+ - elsif champ.type_champ == 'engagement'
+ =render partial: 'users/description/champs/engagement', locals: {champ: champ}
+
+ - elsif champ.type_champ == 'departements'
+ =render partial: 'users/description/champs/departements', locals: {champ: champ}
+
+ -else
+ %input.form-control{name:"champs['#{champ.id}']",
+ placeholder: champ.libelle,
+ id: "champs_#{champ.id}",
+ value: champ.value,
+ type: champ.type_champ,
+ 'data-provide' => champ.data_provide,
+ 'data-date-format' => champ.data_date_format}
+
+ - unless champ.description.empty? || champ.type_champ == 'engagement'
+ .row
+ .col-lg-8.col-md-8.col-sm-8.col-xs-8{class: 'description_div', id:"description_champs_#{champ.id}"}
+ = champ.description
diff --git a/app/views/users/dossiers/_list.html.haml b/app/views/users/dossiers/_list.html.haml
index 398b31876..e3c7b05aa 100644
--- a/app/views/users/dossiers/_list.html.haml
+++ b/app/views/users/dossiers/_list.html.haml
@@ -1,16 +1,16 @@
- unless smart_listing.empty?
%table#dossiers_list.table
%thead
- %th.col-md-1.col-lg-1= smart_listing.sortable 'Numéro', 'id'
- %th.col-md-5.col-lg-5= smart_listing.sortable 'Procédure', 'procedure.libelle'
- %th.col-md-2.col-lg-2= smart_listing.sortable 'État', 'state'
- %th.col-md-2.col-lg-2= smart_listing.sortable 'Date de mise à jour', 'updated_at'
+ %th#sort-id.col-md-1.col-lg-1.col-sm-1.col-xs-1= smart_listing.sortable 'Numéro', 'id'
+ %th#sort-libelle.col-md-5.col-sm-5.col-xs-5.col-lg-5= smart_listing.sortable 'Procédure', 'procedure.libelle'
+ %th#sort-state.col-md-2.col-sm-2.col-xs-2.col-lg-2= smart_listing.sortable 'État', 'state'
+ %th#sort-updated.col-md-2.col-sm-2.col-xs-2.col-lg-2= smart_listing.sortable 'Date de mise à jour', 'updated_at'
- if @liste == "brouillon"
- %th.col-md-2.col-lg-2= 'Action'
+ %th.col-md-2.col-sm-2.col-xs-2.col-lg-2= 'Action'
- @dossiers.each do |dossier|
- if dossier.kind_of? Invite
- -invite = dossier
- -dossier = invite.dossier.decorate
+ - invite = dossier
+ - dossier = invite.dossier.decorate
- else
- dossier = dossier.decorate
@@ -31,6 +31,7 @@
= smart_listing.paginate
= smart_listing.pagination_per_page_links
+ %br
- else
%h4.center
diff --git a/app/views/users/dossiers/_onglets.html.haml b/app/views/users/dossiers/_onglets.html.haml
deleted file mode 100644
index e4ee9a009..000000000
--- a/app/views/users/dossiers/_onglets.html.haml
+++ /dev/null
@@ -1,46 +0,0 @@
-%br
-#onglets
- %ul.nav.nav-tabs
- %li{ class: @dossiers_list_facade.brouillon_class }
- %a{:href => "#{url_for users_dossiers_path(liste: 'brouillon')}", 'data-toggle' => :tooltip, title: 'Les dossiers jamais proposés à la relecture.'}
- %h5.text-default
- = "Brouillons"
- .badge.progress-bar-default
- = @dossiers_list_facade.brouillon_total
-
- %li{ class: @dossiers_list_facade.en_construction_class }
- %a{:href => "#{url_for users_dossiers_path(liste: 'a_traiter')}", 'data-toggle' => :tooltip, title: 'Les dossiers qui requièrent une action de votre part.'}
- %h5.text-danger
- = "En construction"
- .badge.progress-bar-danger
- = @dossiers_list_facade.en_construction_total
-
- %li{ class: @dossiers_list_facade.valides_class }
- %a{:href => "#{url_for users_dossiers_path(liste: 'valides')}", 'data-toggle' => :tooltip, title: 'Les dossiers relus par votre accompagnateur pouvant être déposés pour examen.'}
- %h5.text-purple
- ="À déposer"
- .badge.progress-bar-purple
- = @dossiers_list_facade.valides_total
-
- %li{ class: @dossiers_list_facade.en_instruction_class }
- %a{:href => "#{url_for users_dossiers_path(liste: 'en_instruction')}", 'data-toggle' => :tooltip, title: 'Les dossiers en cours d\'examen par l\'administration compétante.'}
- %h5.text-default
- ="En examen"
- .badge.progress-bar-default
- = @dossiers_list_facade.en_instruction_total
-
- %li{ class: @dossiers_list_facade.termine_class }
- %a{:href => "#{url_for users_dossiers_path(liste: 'termine')}", 'data-toggle' => :tooltip, title: 'Les dossiers cloturés qui peuvent être "Accepté", "Refusé" ou "Sans suite".'}
- %h5.text-success
- = "Cloturé"
- .badge.progress-bar-success
- = @dossiers_list_facade.termine_total
-
- %ul.nav.nav-tabs.navbar-right{style:'border-bottom: none;'}
- %li{ class: @dossiers_list_facade.invite_class }
- %a{:href => "#{url_for users_dossiers_path(liste: 'invite')}"}
- %h5.text-warning
- = "Invitation"
- .badge.progress-bar-warning
- = @dossiers_list_facade.invite_total
-%br
diff --git a/app/views/users/dossiers/_state_description.html.haml b/app/views/users/dossiers/_state_description.html.haml
index 874173256..b6b43a6dc 100644
--- a/app/views/users/dossiers/_state_description.html.haml
+++ b/app/views/users/dossiers/_state_description.html.haml
@@ -2,9 +2,9 @@
.panel.panel-info
.panel-body.center
.row
- .col-md-1.col-lg-1
+ .col-md-1.col-lg-1.col-sm-1.col-xs-1
.fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'}
- .col-md-11.col-lg-11
+ .col-md-11.col-sm-11.col-xs-11.col-lg-11
-if dossiers_list_facade.liste == 'brouillon'
Les dossiers présents dans cette liste
%b
diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml
index 229fc6008..509f46629 100644
--- a/app/views/users/dossiers/index.html.haml
+++ b/app/views/users/dossiers/index.html.haml
@@ -1,13 +1,16 @@
#users_index
- %h1
- =t('dynamics.users.mes_dossiers')
+ .default_data_block.default_visible
+ %div.row.show-block#new_dossiers
+ %div.header
+ %div.col-lg-10.col-md-10.col-sm-10.col-xs-10.title
+ %div.carret-right
+ %div.carret-down
+ Dossiers
+ %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count
+ -#0
+ -#dossiers
+ %div.body
+ = smart_listing_render :dossiers
- -unless Features.opensimplif
- = render partial: 'onglets'
-
- = smart_listing_render :dossiers
-
- %br
- %br
- unless Features.opensimplif
= render partial: 'state_description', locals: {dossiers_list_facade: @dossiers_list_facade}
diff --git a/app/views/users/passwords/edit.html.haml b/app/views/users/passwords/edit.html.haml
index bcfb616b7..326e95239 100644
--- a/app/views/users/passwords/edit.html.haml
+++ b/app/views/users/passwords/edit.html.haml
@@ -43,14 +43,14 @@
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-asterisk
+ %span.fa.fa-asterisk
= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control'
%br
%h4
= f.label 'Retaper le mot de passe'
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-asterisk
+ %span.fa.fa-asterisk
= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control'
%br
%br
diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml
index a08703e6a..e597944e4 100644
--- a/app/views/users/passwords/new.html.haml
+++ b/app/views/users/passwords/new.html.haml
@@ -42,7 +42,7 @@
= f.label :email
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-user
+ %span.fa.fa-user
= f.email_field :email, class: 'form-control', placeholder: 'Email'
%br
%br
diff --git a/app/views/users/recapitulatif/_commentaires_flux.html.haml b/app/views/users/recapitulatif/_commentaires_flux.html.haml
deleted file mode 100644
index 38202fb3e..000000000
--- a/app/views/users/recapitulatif/_commentaires_flux.html.haml
+++ /dev/null
@@ -1,26 +0,0 @@
-.content#commentaires_flux{style:'width:100%;'}
- %div#commentaire_new{style: 'width:80%; margin-left:auto; margin-right:auto; margin-bottom:7%'}
- = form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: @facade.dossier.id, champ_id: @facade.champ_id }), class: 'form-inline', method: 'POST', multipart: true) do
- %textarea.form-control{id: 'texte_commentaire', class: 'wysihtml5', name: 'texte_commentaire', style: 'width: 100%; margin-bottom:2%', rows: '5', placeholder:"Commentaire"}
- %h4.text-primary{style: 'margin-top: 0px'} Ajout un fichier
- = file_field_tag "piece_justificative[content]", accept: PieceJustificative.accept_format, style: 'float: left; margin-left: 20px'
- %input.form-control.btn.btn-success{:type => 'submit', :value => 'Poster', style: 'float:right'}
-
- -@facade.commentaires.each do |com|
- %span.text-info#email_contact{style: 'font-weight:bold'}
- =com.email
- %span#created_at
- \-
- =com.created_at_fr
- - unless com.piece_justificative.nil?
- \-
- %span#piece_justificative
- %b
- = link_to com.piece_justificative.original_filename, com.piece_justificative.content_url, style:'color: green', target: '_blank'
-
- %br
- .description#body
- =com.body.html_safe
-
-
- %br
diff --git a/app/views/users/recapitulatif/show.html.haml b/app/views/users/recapitulatif/show.html.haml
index ee50144b6..fe7c1ec5d 100644
--- a/app/views/users/recapitulatif/show.html.haml
+++ b/app/views/users/recapitulatif/show.html.haml
@@ -1,31 +1,2 @@
-.row#recap_dossier
- .col-md-4.col-lg-4
- .row
- .col-md-6.col-lg-6
- %h2 Récapitulatif
-
- .col-md-5.col-lg-5
-
- .col-md-3.col-lg-3
- %h2#dossier_id{:class => 'text-info', :style => 'text-align:right; margin-bottom:15px'}
- = t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s
-
- - if user_signed_in? && current_user.email == @facade.dossier.user.email
- -if @facade.dossier.validated?
- %br
- = form_tag(url_for({controller: :recapitulatif, action: :submit, dossier_id: @facade.dossier.id}), method: 'POST') do
- %button#validate_button.btn.btn-success
- = 'Procéder au dépôt définitif'
- -else
- %h3{:class => 'text-success', :style => 'text-align:right'}
- = @facade.dossier.display_state
-
-%br
-- unless @facade.entreprise.nil?
- = render partial: '/dossiers/infos_entreprise'
-
-= render partial: '/dossiers/infos_dossier'
-
-%div
- %br
- = render partial: 'dossiers/tab_objects_dossier'
\ No newline at end of file
+%div.col-lg-12.col-md-12.col-sm-12.col-xs-12#users_recapitulatif_dossier_show
+ = render partial: "dossiers/dossier_show"
diff --git a/app/views/users/registrations/new.html.haml b/app/views/users/registrations/new.html.haml
index b44bc289c..dec162c92 100644
--- a/app/views/users/registrations/new.html.haml
+++ b/app/views/users/registrations/new.html.haml
@@ -42,19 +42,19 @@
= f.label :email
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-user
+ %span.fa.fa-user
= f.email_field :email, class: 'form-control', placeholder: 'Email', value: params[:user_email]
%br
%h4
= f.label :password
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-asterisk
+ %span.fa.fa-asterisk
= f.password_field :password, autocomplete: "off", class: 'form-control', placeholder: 'Mot de passe'
%br
.input-group
.input-group-addon
- %span.glyphicon.glyphicon-asterisk
+ %span.fa.fa-asterisk
= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control', placeholder: 'Répeter le mot de passe'
%br
%br
diff --git a/app/views/users/sessions/_resume_procedure.html.haml b/app/views/users/sessions/_resume_procedure.html.haml
index f99ce8bd8..3fdbfdaa2 100644
--- a/app/views/users/sessions/_resume_procedure.html.haml
+++ b/app/views/users/sessions/_resume_procedure.html.haml
@@ -14,5 +14,6 @@
= h @dossier.procedure.description.html_safe
- else
- = image_tag(image_url(LOGO_NAME), {id: 'logo_tps'})
+ #logo_procedure.flag
+ = image_tag(image_url(LOGO_NAME), {id: 'logo_tps'})
%br
\ No newline at end of file
diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml
index 718da7056..7d22b6700 100644
--- a/app/views/users/sessions/new.html.haml
+++ b/app/views/users/sessions/new.html.haml
@@ -32,6 +32,8 @@
.actions
= f.submit "Se connecter", class:'btn btn-primary'
%br
- = render "users/shared/links"
+ - if @user.email != DemoEmails[:gestionnaire] && @user.email != DemoEmails[:admin]
+ = render "users/shared/links"
+
diff --git a/app/views/users/shared/_links.html.erb b/app/views/users/shared/_links.html.erb
index b1d1b5381..d6c21977c 100644
--- a/app/views/users/shared/_links.html.erb
+++ b/app/views/users/shared/_links.html.erb
@@ -3,4 +3,4 @@
<% end -%>
-<%= link_to "Mot de passe oublié ?", new_password_path(resource_name) %>
+<%= link_to "Mot de passe oublié ?", new_password_path(resource_name) %>
\ No newline at end of file
diff --git a/config.ru b/config.ru
index bd83b2541..584d0390c 100644
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,8 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
+
+# Action Cable requires that all classes are loaded in advance
+Rails.application.eager_load!
+
run Rails.application
diff --git a/config/cable.yml b/config/cable.yml
new file mode 100644
index 000000000..33e584883
--- /dev/null
+++ b/config/cable.yml
@@ -0,0 +1,14 @@
+production:
+ adapter: redis
+ url: redis://localhost:6379
+
+staging:
+ adapter: redis
+ url: redis://localhost:6379
+
+development:
+ adapter: redis
+ url: redis://localhost:6379
+
+test:
+ adapter: async
diff --git a/config/deploy.rb b/config/deploy.rb
index 9159356bc..5c5afc91f 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -53,7 +53,7 @@ elsif ENV["to"] == "opensimplif"
appname = 'opensimplif'
elsif ENV["to"] == "tps_v2"
if ENV['branch'].nil?
- set :branch, 'tps_v2'
+ set :branch, 'staging_v2'
else
set :branch, ENV['branch']
end
@@ -67,7 +67,7 @@ set :rails_env, ENV["to"]
if ENV["to"] == "opensimplif"
set :rails_env, "production"
elsif ENV["to"] == "tps_v2"
- set :rails_env, "production"
+ set :rails_env, "staging"
end
# For system-wide RVM install.
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 52c597431..4b96a6c33 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -9,6 +9,9 @@ Rails.application.configure do
# Do not eager load code on boot.
config.eager_load = false
+ config.public_file_server.enabled = true
+ config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
+
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
@@ -42,5 +45,5 @@ Rails.application.configure do
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
-
+ config.action_cable.url = "ws://localhost:3000/cable"
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 5c1b32e48..8640a6aae 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -22,7 +22,7 @@ Rails.application.configure do
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
- config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
diff --git a/config/environments/test.rb b/config/environments/test.rb
index addde8b69..2d98c2462 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -13,8 +13,8 @@ Rails.application.configure do
config.eager_load = false
# Configure static file server for tests with Cache-Control for performance.
- config.serve_static_files = true
- config.static_cache_control = 'public, max-age=3600'
+ config.public_file_server.enabled = true
+ config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
# Show full error reports and disable caching.
config.consider_all_requests_local = true
diff --git a/config/initializers/active_model_serializer.rb b/config/initializers/active_model_serializer.rb
new file mode 100644
index 000000000..8cedccfe2
--- /dev/null
+++ b/config/initializers/active_model_serializer.rb
@@ -0,0 +1 @@
+ActiveModelSerializers.config.default_includes = '**'
\ No newline at end of file
diff --git a/config/initializers/demo_emails.rb b/config/initializers/demo_emails.rb
new file mode 100644
index 000000000..e9e52c963
--- /dev/null
+++ b/config/initializers/demo_emails.rb
@@ -0,0 +1,5 @@
+DemoEmails = {
+ user: 'demo@tps.fr',
+ gestionnaire: 'gestionnaire@apientreprise.fr',
+ admin: 'admin@tps.fr'
+}
\ No newline at end of file
diff --git a/config/initializers/features.yml b/config/initializers/features.yml
index e77e684a6..d243bd5f6 100644
--- a/config/initializers/features.yml
+++ b/config/initializers/features.yml
@@ -1,3 +1,2 @@
-remote_storage: true
-unified_login: false
+remote_storage: false
opensimplif: false
diff --git a/config/initializers/smart_listing.rb b/config/initializers/smart_listing.rb
new file mode 100644
index 000000000..90e3f99f9
--- /dev/null
+++ b/config/initializers/smart_listing.rb
@@ -0,0 +1,75 @@
+SmartListing.configure do |config|
+ config.global_options({
+ #:param_names => { # param names
+ #:page => :page,
+ #:per_page => :per_page,
+ #:sort => :sort,
+ #},
+ #:array => false, # controls whether smart list should be using arrays or AR collections
+ #:max_count => nil, # limit number of rows
+ #:unlimited_per_page => false, # allow infinite page size
+ #:paginate => true, # allow pagination
+ #:memorize_per_page => false, # save per page settings in the cookie
+ :page_sizes => [10, 20, 50, 100], # set available page sizes array
+ #:kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options
+ })
+
+ config.constants :classes, {
+ #:main => "smart-listing",
+ #:editable => "editable",
+ #:content => "content",
+ #:loading => "loading",
+ #:status => "smart-listing-status",
+ #:item_actions => "actions",
+ #:new_item_placeholder => "new-item-placeholder",
+ #:new_item_action => "new-item-action",
+ #:new_item_button => "btn",
+ #:hidden => "hidden",
+ #:autoselect => "autoselect",
+ #:callback => "callback",
+ #:pagination_per_page => "pagination-per-page text-center",
+ #:pagination_count => "count",
+ #:inline_editing => "info",
+ #:no_records => "no-records",
+ #:limit => "smart-listing-limit",
+ #:limit_alert => "smart-listing-limit-alert",
+ #:controls => "smart-listing-controls",
+ #:controls_reset => "reset",
+ #:filtering => "filter",
+ #:filtering_search => "glyphicon-search",
+ #:filtering_cancel => "glyphicon-remove",
+ #:filtering_disabled => "disabled",
+ #:sortable => "sortable",
+ #:icon_new => "glyphicon glyphicon-plus",
+ #:icon_edit => "glyphicon glyphicon-pencil",
+ #:icon_trash => "glyphicon glyphicon-trash",
+ #:icon_inactive => "glyphicon glyphicon-circle",
+ #:icon_show => "glyphicon glyphicon-share-alt",
+ #:icon_sort_none => "glyphicon glyphicon-resize-vertical",
+ #:icon_sort_up => "glyphicon glyphicon-chevron-up",
+ #:icon_sort_down => "glyphicon glyphicon-chevron-down",
+ }
+
+ config.constants :data_attributes, {
+ #:main => "smart-listing",
+ #:confirmation => "confirmation",
+ #:id => "id",
+ #:href => "href",
+ #:callback_href => "callback-href",
+ #:max_count => "max-count",
+ #:inline_edit_backup => "smart-listing-edit-backup",
+ #:params => "params",
+ #:observed => "observed",
+ #:href => "href",
+ #:autoshow => "autoshow",
+ #:popover => "slpopover",
+ }
+
+ config.constants :selectors, {
+ #:item_action_destroy => "a.destroy",
+ #:edit_cancel => "button.cancel",
+ #:row => "tr",
+ #:head => "thead",
+ #:filtering_icon => "i"
+ }
+end
diff --git a/config/initializers/stringupcasepatch.rb b/config/initializers/stringupcasepatch.rb
new file mode 100644
index 000000000..0c888e580
--- /dev/null
+++ b/config/initializers/stringupcasepatch.rb
@@ -0,0 +1,9 @@
+require "unicode_utils/upcase"
+
+class String
+
+ def upcase
+ UnicodeUtils.upcase(self)
+ end
+
+end
diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml
new file mode 100755
index 000000000..d1c57ae1f
--- /dev/null
+++ b/config/locales/devise.fr.yml
@@ -0,0 +1,62 @@
+# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
+
+fr:
+ devise:
+ confirmations:
+ confirmed: "Votre compte a été validé."
+ send_instructions: "Vous allez recevoir les instructions nécessaires à la confirmation de votre compte dans quelques minutes."
+ send_paranoid_instructions: "Si votre e-mail existe dans notre base de données, vous allez bientôt recevoir un e-mail contenant les instructions de confirmation de votre compte."
+ failure:
+ already_authenticated: "Vous êtes déjà connecté"
+ inactive: "Votre compte n'est pas encore activé."
+ invalid: "Email ou mot de passe incorrect."
+ last_attempt: "Vous avez droit à une tentative avant que votre compte ne soit verrouillé."
+ locked: "Votre compte est verrouillé."
+ not_found_in_database: "Email ou mot de passe invalide."
+ timeout: "Votre session est expirée. Veuillez vous reconnecter pour continuer."
+ unauthenticated: "Vous devez vous connecter ou vous inscrire pour continuer."
+ unconfirmed: "Vous devez valider votre compte pour continuer."
+ mailer:
+ confirmation_instructions:
+ subject: "Instructions de confirmation"
+ reset_password_instructions:
+ subject: "Instructions pour changer le mot de passe"
+ unlock_instructions:
+ subject: "Instructions pour déverrouiller le compte"
+ password_change:
+ subject: "Votre mot de passe a été modifié avec succés."
+ omniauth_callbacks:
+ failure: "Nous n'avons pas pu vous authentifier via %{kind} : '%{reason}'."
+ success: "Authentifié avec succès via %{kind}."
+ passwords:
+ no_token: "Vous ne pouvez accéder à cette page sans passer par un e-mail de réinitialisation de mot de passe. Si vous êtes passé par un e-mail de ce type, assurez-vous d'utiliser l'URL complète."
+ send_instructions: "Vous allez recevoir les instructions de réinitialisation du mot de passe dans quelques instants"
+ send_paranoid_instructions: "Si votre e-mail existe dans notre base de données, vous allez recevoir un lien de réinitialisation par e-mail"
+ updated: "Votre mot de passe a été édité avec succès, vous êtes maintenant connecté"
+ updated_not_active: "Votre mot de passe a été changé avec succès."
+ registrations:
+ destroyed: "Votre compte a été supprimé avec succès. Nous espérons vous revoir bientôt."
+ signed_up: "Bienvenue, vous êtes connecté."
+ signed_up_but_inactive: "Vous êtes bien enregistré. Vous ne pouvez cependant pas vous connecter car votre compte n'est pas encore activé."
+ signed_up_but_locked: "Vous êtes bien enregistré. Vous ne pouvez cependant pas vous connecter car votre compte est verrouillé."
+ signed_up_but_unconfirmed: "Un message contenant un lien de confirmation a été envoyé à votre adresse email. Ouvrez ce lien pour activer votre compte."
+ update_needs_confirmation: "Votre compte a bien été mis à jour mais nous devons vérifier votre nouvelle adresse email. Merci de vérifier vos emails et de cliquer sur le lien de confirmation pour finaliser la validation de votre nouvelle adresse."
+ updated: "Votre compte a été modifié avec succès."
+ sessions:
+ signed_in: "Connecté."
+ signed_out: "Déconnecté."
+ already_signed_out: "Déconnecté."
+ unlocks:
+ send_instructions: "Vous allez recevoir les instructions nécessaires au déverrouillage de votre compte dans quelques instants"
+ send_paranoid_instructions: "Si votre compte existe, vous allez bientôt recevoir un email contenant les instructions pour le déverrouiller."
+ unlocked: "Votre compte a été déverrouillé avec succès, vous êtes maintenant connecté."
+ errors:
+ messages:
+ already_confirmed: "a déjà été validé(e), veuillez essayer de vous connecter"
+ confirmation_period_expired: "à confirmer dans les %{period}, merci de faire une nouvelle demande"
+ expired: "a expiré, merci d'en faire une nouvelle demande"
+ not_found: "n'a pas été trouvé(e)"
+ not_locked: "n'était pas verrouillé(e)"
+ not_saved:
+ one: "1 erreur a empêché ce(tte) %{resource} d'être sauvegardé(e) :"
+ other: "%{count} erreurs ont empêché ce(tte) %{resource} d'être sauvegardé(e) :"
\ No newline at end of file
diff --git a/config/locales/dynamics/fr.yml b/config/locales/dynamics/fr.yml
index c85b36fab..ecc9c2b8d 100644
--- a/config/locales/dynamics/fr.yml
+++ b/config/locales/dynamics/fr.yml
@@ -13,7 +13,7 @@ fr:
title: 'Gestion de colonnes affichées'
description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans votre interface de suivi des dossiers.'
download_all_dossiers: 'Télécharger mes dossiers'
- limit_excess_download_all_dossiers: 'Limite de dossiers fixée à 200 pour le téléchargement'
+ limit_excess_download_all_dossiers: 'Limite de dossiers fixée à 400 pour le téléchargement'
format_csv: 'Au format CSV'
format_xlsx: 'Au format XLSX'
format_ods: 'Au format ODS'
@@ -28,6 +28,11 @@ fr:
numéro: 'Dossier n°'
followers:
title: "Personnes suivant l'activité de ce dossier"
+ empty: "Aucune personne ne suit ce dossier"
+ invites:
+ title: "Personnes invitées à voir ce dossier"
+ empty: "Aucune personne invitée"
+ liste_champs: "Champs du dossier"
admin:
connexion_title: Administration
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 065395716..8ac1da0bb 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -21,3 +21,9 @@
en:
hello: "Hello world"
+ utils:
+ deconnexion: "Logout"
+ involved: "See concerned people"
+ no-commentaires: "There is no message yet, feel free to start the first one."
+ depositaire: "Dépositaire"
+ pieces: "Pièces jointes"
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 5e2a85d91..795c51d50 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -20,6 +20,12 @@
# available at http://guides.rubyonrails.org/i18n.html.
fr:
+ utils:
+ deconnexion: "Déconnexion"
+ involved: "Voir les personnes impliquées"
+ no-commentaires: "Il n'y a aucun message dans le fil de discussion, n'hésitez pas à initier le premier."
+ depositaire: "Dépositaire"
+ pieces: "Pièces jointes"
will_paginate:
next_label: 'Suivant'
previous_label: 'Précédent'
@@ -179,4 +185,4 @@ fr:
other: "%{count} mois"
x_seconds:
one: 1 seconde
- other: "%{count} secondes"
\ No newline at end of file
+ other: "%{count} secondes"
diff --git a/config/locales/models/dossier/fr.yml b/config/locales/models/dossier/fr.yml
index 9663b2795..576c47885 100644
--- a/config/locales/models/dossier/fr.yml
+++ b/config/locales/models/dossier/fr.yml
@@ -26,10 +26,6 @@ fr:
mail_contact:
blank: 'doit être rempli'
invalid: 'est incorrect'
- nom_projet:
- blank: 'doit être rempli'
- description:
- blank: 'doit être remplie'
montant_projet:
blank: 'doit être rempli'
montant_aide_demande:
diff --git a/config/locales/smart_listing.fr.yml b/config/locales/smart_listing.fr.yml
new file mode 100644
index 000000000..b5448ecac
--- /dev/null
+++ b/config/locales/smart_listing.fr.yml
@@ -0,0 +1,15 @@
+fr:
+ smart_listing:
+ msgs:
+ destroy_confirmation: Destroy?
+ no_items: No items
+ actions:
+ destroy: Destroy
+ edit: Edit
+ show: Show
+ new: New item
+ views:
+ pagination:
+ per_page: Par page
+ unlimited: Unlimited
+ total: Total
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index d9daff608..aaef99490 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -65,7 +65,7 @@ Rails.application.routes.draw do
get '/add_siret' => 'dossiers/add_siret#show'
get '/description' => 'description#show'
- get '/description/error' => 'description#error'
+ # get '/description/error' => 'description#error'
post 'description' => 'description#create'
patch 'pieces_justificatives' => 'description#pieces_justificatives'
@@ -202,4 +202,6 @@ Rails.application.routes.draw do
end
apipie
+
+ mount ActionCable.server => '/cable'
end
diff --git a/config/unicorn.rb b/config/unicorn.rb
new file mode 100644
index 000000000..88a5d746a
--- /dev/null
+++ b/config/unicorn.rb
@@ -0,0 +1,109 @@
+# Sample verbose configuration file for Unicorn (not Rack)
+#
+# This configuration file documents many features of Unicorn
+# that may not be needed for some applications. See
+# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
+# for a much simpler configuration file.
+#
+# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
+# documentation.
+
+
+
+# Use at least one worker per core if you're on a dedicated server,
+# more will usually help for _short_ waits on databases/caches.
+worker_processes 2
+
+# Since Unicorn is never exposed to outside clients, it does not need to
+# run on the standard HTTP port (80), there is no reason to start Unicorn
+# as root unless it's from system init scripts.
+# If running the master process as root and the workers as an unprivileged
+# user, do this to switch euid/egid in the workers (also chowns logs):
+# user "unprivileged_user", "unprivileged_group"
+
+# Help ensure your application will always spawn in the symlinked
+# "current" directory that Capistrano sets up.
+
+# listen on both a Unix domain socket and a TCP port,
+# we use a shorter backlog for quicker failover when busy
+listen "127.0.0.1:3000", :tcp_nopush => true
+
+# nuke workers after 30 seconds instead of 60 seconds (the default)
+timeout 30
+
+# By default, the Unicorn logger will write to stderr.
+# Additionally, ome applications/frameworks log to stderr or stdout,
+# so prevent them from going to /dev/null when daemonized here:
+
+# combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings
+# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
+preload_app true
+GC.respond_to?(:copy_on_write_friendly=) and
+ GC.copy_on_write_friendly = true
+
+# Enable this flag to have unicorn test client connections by writing the
+# beginning of the HTTP headers before calling the application. This
+# prevents calling the application for connections that have disconnected
+# while queued. This is only guaranteed to detect clients on the same
+# host unicorn runs on, and unlikely to detect disconnects even on a
+# fast LAN.
+check_client_connection false
+
+# local variable to guard against running a hook multiple times
+run_once = true
+
+
+before_fork do |server, worker|
+ # the following is highly recomended for Rails + "preload_app true"
+ # as there's no need for the master process to hold a connection
+ defined?(ActiveRecord::Base) and
+ ActiveRecord::Base.connection.disconnect!
+
+ # Occasionally, it may be necessary to run non-idempotent code in the
+ # master before forking. Keep in mind the above disconnect! example
+ # is idempotent and does not need a guard.
+ if run_once
+ # do_something_once_here ...
+ run_once = false # prevent from firing again
+ end
+
+ # The following is only recommended for memory/DB-constrained
+ # installations. It is not needed if your system can house
+ # twice as many worker_processes as you have configured.
+ #
+ # # This allows a new master process to incrementally
+ # # phase out the old master process with SIGTTOU to avoid a
+ # # thundering herd (especially in the "preload_app false" case)
+ # # when doing a transparent upgrade. The last worker spawned
+ # # will then kill off the old master process with a SIGQUIT.
+ old_pid = "#{server.config[:pid]}.oldbin"
+ if old_pid != server.pid
+ begin
+ sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
+ Process.kill(sig, File.read(old_pid).to_i)
+ rescue Errno::ENOENT, Errno::ESRCH
+ end
+ end
+ #
+ # Throttle the master from forking too quickly by sleeping. Due
+ # to the implementation of standard Unix signal handlers, this
+ # helps (but does not completely) prevent identical, repeated signals
+ # from being lost when the receiving process is busy.
+ sleep 1
+end
+
+after_fork do |server, worker|
+ # per-process listener ports for debugging/admin/migrations
+ # addr = "127.0.0.1:#{9293 + worker.nr}"
+ # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
+
+ # the following is *required* for Rails + "preload_app true",
+ defined?(ActiveRecord::Base) and
+ ActiveRecord::Base.establish_connection
+
+ # if preload_app is true, then you may also want to check and
+ # restart any other shared sockets/descriptors such as Memcached,
+ # and Redis. TokyoCabinet file handles are safe to reuse
+ # between any number of forked children (assuming your kernel
+ # correctly implements pread()/pwrite() system calls)
+end
diff --git a/db/migrate/20161221153929_create_notification.rb b/db/migrate/20161221153929_create_notification.rb
new file mode 100644
index 000000000..745086412
--- /dev/null
+++ b/db/migrate/20161221153929_create_notification.rb
@@ -0,0 +1,16 @@
+class CreateNotification < ActiveRecord::Migration[5.0]
+ def change
+ create_table :notifications do |t|
+
+ t.boolean :already_read, default: false
+ t.string :liste, array: true
+ t.boolean :multiple, default: false
+ t.string :type_notif
+ t.datetime :created_at
+ t.datetime :updated_at
+
+ end
+
+ add_belongs_to :notifications, :dossier
+ end
+end
diff --git a/db/migrate/20161227103823_delete_old_attr_in_data_base.rb b/db/migrate/20161227103823_delete_old_attr_in_data_base.rb
new file mode 100644
index 000000000..92fa6a3e9
--- /dev/null
+++ b/db/migrate/20161227103823_delete_old_attr_in_data_base.rb
@@ -0,0 +1,7 @@
+class DeleteOldAttrInDataBase < ActiveRecord::Migration[5.0]
+ def change
+ remove_column :dossiers, :nom_projet
+ remove_column :procedures, :test
+ remove_column :notifications, :multiple
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 51e64b6d3..e9491dca0 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,4 +1,3 @@
-# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -11,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20161205110427) do
+ActiveRecord::Schema.define(version: 20161227103823) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -30,20 +29,18 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.datetime "created_at"
t.datetime "updated_at"
t.string "api_token"
+ t.index ["email"], name: "index_administrateurs_on_email", unique: true, using: :btree
+ t.index ["reset_password_token"], name: "index_administrateurs_on_reset_password_token", unique: true, using: :btree
end
- add_index "administrateurs", ["email"], name: "index_administrateurs_on_email", unique: true, using: :btree
- add_index "administrateurs", ["reset_password_token"], name: "index_administrateurs_on_reset_password_token", unique: true, using: :btree
-
create_table "administrateurs_gestionnaires", id: false, force: :cascade do |t|
t.integer "administrateur_id"
t.integer "gestionnaire_id"
+ t.index ["administrateur_id"], name: "index_administrateurs_gestionnaires_on_administrateur_id", using: :btree
+ t.index ["gestionnaire_id", "administrateur_id"], name: "unique_couple_administrateur_gestionnaire", unique: true, using: :btree
+ t.index ["gestionnaire_id"], name: "index_administrateurs_gestionnaires_on_gestionnaire_id", using: :btree
end
- add_index "administrateurs_gestionnaires", ["administrateur_id"], name: "index_administrateurs_gestionnaires_on_administrateur_id", using: :btree
- add_index "administrateurs_gestionnaires", ["gestionnaire_id", "administrateur_id"], name: "unique_couple_administrateur_gestionnaire", unique: true, using: :btree
- add_index "administrateurs_gestionnaires", ["gestionnaire_id"], name: "index_administrateurs_gestionnaires_on_gestionnaire_id", using: :btree
-
create_table "administrations", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
@@ -57,12 +54,11 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.inet "last_sign_in_ip"
t.datetime "created_at"
t.datetime "updated_at"
+ t.index ["email"], name: "index_administrations_on_email", unique: true, using: :btree
+ t.index ["reset_password_token"], name: "index_administrations_on_reset_password_token", unique: true, using: :btree
end
- add_index "administrations", ["email"], name: "index_administrations_on_email", unique: true, using: :btree
- add_index "administrations", ["reset_password_token"], name: "index_administrations_on_reset_password_token", unique: true, using: :btree
-
- create_table "ar_internal_metadata", primary_key: "key", force: :cascade do |t|
+ create_table "ar_internal_metadata", primary_key: "key", id: :string, force: :cascade do |t|
t.string "value"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
@@ -71,11 +67,10 @@ ActiveRecord::Schema.define(version: 20161205110427) do
create_table "assign_tos", id: false, force: :cascade do |t|
t.integer "gestionnaire_id"
t.integer "procedure_id"
+ t.index ["gestionnaire_id"], name: "index_assign_tos_on_gestionnaire_id", using: :btree
+ t.index ["procedure_id"], name: "index_assign_tos_on_procedure_id", using: :btree
end
- add_index "assign_tos", ["gestionnaire_id"], name: "index_assign_tos_on_gestionnaire_id", using: :btree
- add_index "assign_tos", ["procedure_id"], name: "index_assign_tos_on_procedure_id", using: :btree
-
create_table "cadastres", force: :cascade do |t|
t.string "surface_intersection"
t.float "surface_parcelle"
@@ -97,20 +92,18 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.integer "user_id"
t.string "original_filename"
t.string "content_secure_token"
+ t.index ["dossier_id"], name: "index_cerfas_on_dossier_id", using: :btree
end
- add_index "cerfas", ["dossier_id"], name: "index_cerfas_on_dossier_id", using: :btree
-
create_table "champs", force: :cascade do |t|
t.string "value"
t.integer "type_de_champ_id"
t.integer "dossier_id"
t.string "type"
+ t.index ["dossier_id"], name: "index_champs_on_dossier_id", using: :btree
+ t.index ["type_de_champ_id"], name: "index_champs_on_type_de_champ_id", using: :btree
end
- add_index "champs", ["dossier_id"], name: "index_champs_on_dossier_id", using: :btree
- add_index "champs", ["type_de_champ_id"], name: "index_champs_on_type_de_champ_id", using: :btree
-
create_table "commentaires", force: :cascade do |t|
t.string "email"
t.datetime "created_at", null: false
@@ -119,14 +112,12 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.datetime "updated_at", null: false
t.integer "piece_justificative_id"
t.integer "champ_id"
+ t.index ["champ_id"], name: "index_commentaires_on_champ_id", using: :btree
+ t.index ["dossier_id"], name: "index_commentaires_on_dossier_id", using: :btree
end
- add_index "commentaires", ["champ_id"], name: "index_commentaires_on_champ_id", using: :btree
- add_index "commentaires", ["dossier_id"], name: "index_commentaires_on_dossier_id", using: :btree
-
create_table "dossiers", force: :cascade do |t|
t.boolean "autorisation_donnees"
- t.string "nom_projet"
t.integer "procedure_id"
t.datetime "created_at"
t.datetime "updated_at"
@@ -136,18 +127,16 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.boolean "archived", default: false
t.boolean "mandataire_social", default: false
t.datetime "deposit_datetime"
+ t.index ["procedure_id"], name: "index_dossiers_on_procedure_id", using: :btree
+ t.index ["user_id"], name: "index_dossiers_on_user_id", using: :btree
end
- add_index "dossiers", ["procedure_id"], name: "index_dossiers_on_procedure_id", using: :btree
- add_index "dossiers", ["user_id"], name: "index_dossiers_on_user_id", using: :btree
-
create_table "drop_down_lists", force: :cascade do |t|
t.string "value"
t.integer "type_de_champ_id"
+ t.index ["type_de_champ_id"], name: "index_drop_down_lists_on_type_de_champ_id", using: :btree
end
- add_index "drop_down_lists", ["type_de_champ_id"], name: "index_drop_down_lists_on_type_de_champ_id", using: :btree
-
create_table "entreprises", force: :cascade do |t|
t.string "siren"
t.integer "capital_social"
@@ -162,10 +151,9 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.string "nom"
t.string "prenom"
t.integer "dossier_id"
+ t.index ["dossier_id"], name: "index_entreprises_on_dossier_id", using: :btree
end
- add_index "entreprises", ["dossier_id"], name: "index_entreprises_on_dossier_id", using: :btree
-
create_table "etablissements", force: :cascade do |t|
t.string "siret"
t.boolean "siege_social"
@@ -181,10 +169,9 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.string "code_insee_localite"
t.integer "dossier_id"
t.integer "entreprise_id"
+ t.index ["dossier_id"], name: "index_etablissements_on_dossier_id", using: :btree
end
- add_index "etablissements", ["dossier_id"], name: "index_etablissements_on_dossier_id", using: :btree
-
create_table "exercices", force: :cascade do |t|
t.string "ca"
t.datetime "dateFinExercice"
@@ -195,11 +182,10 @@ ActiveRecord::Schema.define(version: 20161205110427) do
create_table "follows", force: :cascade do |t|
t.integer "gestionnaire_id"
t.integer "dossier_id"
+ t.index ["dossier_id"], name: "index_follows_on_dossier_id", using: :btree
+ t.index ["gestionnaire_id"], name: "index_follows_on_gestionnaire_id", using: :btree
end
- add_index "follows", ["dossier_id"], name: "index_follows_on_dossier_id", using: :btree
- add_index "follows", ["gestionnaire_id"], name: "index_follows_on_gestionnaire_id", using: :btree
-
create_table "france_connect_informations", force: :cascade do |t|
t.string "gender"
t.string "given_name"
@@ -209,10 +195,9 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.string "france_connect_particulier_id"
t.integer "user_id"
t.string "email_france_connect"
+ t.index ["user_id"], name: "index_france_connect_informations_on_user_id", using: :btree
end
- add_index "france_connect_informations", ["user_id"], name: "index_france_connect_informations_on_user_id", using: :btree
-
create_table "gestionnaires", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
@@ -227,21 +212,19 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.datetime "created_at"
t.datetime "updated_at"
t.integer "procedure_filter"
+ t.index ["email"], name: "index_gestionnaires_on_email", unique: true, using: :btree
+ t.index ["reset_password_token"], name: "index_gestionnaires_on_reset_password_token", unique: true, using: :btree
end
- add_index "gestionnaires", ["email"], name: "index_gestionnaires_on_email", unique: true, using: :btree
- add_index "gestionnaires", ["reset_password_token"], name: "index_gestionnaires_on_reset_password_token", unique: true, using: :btree
-
create_table "individuals", force: :cascade do |t|
t.string "nom"
t.string "prenom"
t.string "birthdate"
t.integer "dossier_id"
t.string "gender"
+ t.index ["dossier_id"], name: "index_individuals_on_dossier_id", using: :btree
end
- add_index "individuals", ["dossier_id"], name: "index_individuals_on_dossier_id", using: :btree
-
create_table "invites", force: :cascade do |t|
t.string "email"
t.string "email_sender"
@@ -262,9 +245,18 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.boolean "use_api_carto", default: false
t.boolean "quartiers_prioritaires", default: false
t.boolean "cadastre", default: false
+ t.index ["procedure_id"], name: "index_module_api_cartos_on_procedure_id", unique: true, using: :btree
end
- add_index "module_api_cartos", ["procedure_id"], name: "index_module_api_cartos_on_procedure_id", unique: true, using: :btree
+ create_table "notifications", force: :cascade do |t|
+ t.boolean "already_read", default: false
+ t.string "liste", array: true
+ t.string "type_notif"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "dossier_id"
+ t.index ["dossier_id"], name: "index_notifications_on_dossier_id", using: :btree
+ end
create_table "pieces_justificatives", force: :cascade do |t|
t.string "content"
@@ -274,11 +266,10 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.integer "user_id"
t.string "original_filename"
t.string "content_secure_token"
+ t.index ["dossier_id"], name: "index_pieces_justificatives_on_dossier_id", using: :btree
+ t.index ["type_de_piece_justificative_id"], name: "index_pieces_justificatives_on_type_de_piece_justificative_id", using: :btree
end
- add_index "pieces_justificatives", ["dossier_id"], name: "index_pieces_justificatives_on_dossier_id", using: :btree
- add_index "pieces_justificatives", ["type_de_piece_justificative_id"], name: "index_pieces_justificatives_on_type_de_piece_justificative_id", using: :btree
-
create_table "preference_devise_profils", force: :cascade do |t|
t.string "last_current_devise_profil"
t.integer "administrateurs_id"
@@ -309,10 +300,9 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.string "path", limit: 30
t.integer "procedure_id"
t.integer "administrateur_id"
+ t.index ["path"], name: "index_procedure_paths_on_path", using: :btree
end
- add_index "procedure_paths", ["path"], name: "index_procedure_paths_on_path", using: :btree
-
create_table "procedures", force: :cascade do |t|
t.string "libelle"
t.string "description"
@@ -350,10 +340,9 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.date "date_declaration"
t.date "date_publication"
t.integer "entreprise_id"
+ t.index ["entreprise_id"], name: "index_rna_informations_on_entreprise_id", using: :btree
end
- add_index "rna_informations", ["entreprise_id"], name: "index_rna_informations_on_entreprise_id", using: :btree
-
create_table "types_de_champ", force: :cascade do |t|
t.string "libelle"
t.string "type_champ"
@@ -389,11 +378,10 @@ ActiveRecord::Schema.define(version: 20161205110427) do
t.datetime "updated_at"
t.string "siret"
t.string "loged_in_with_france_connect", default: "false"
+ t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
+ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
end
- add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
- add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
-
add_foreign_key "cerfas", "dossiers"
add_foreign_key "commentaires", "dossiers"
add_foreign_key "dossiers", "users"
diff --git a/lib/github/api.rb b/lib/github/api.rb
deleted file mode 100644
index 8aab0ce86..000000000
--- a/lib/github/api.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class Github::API
-
- def self.base_uri
- 'https://api.github.com'
- end
-
- def self.latest_release
- call '/repos/sgmap/tps/releases/latest'
- end
-
- private
-
- def self.call(end_point, params = {})
- RestClient::Resource.new(
- base_uri+end_point, timeout: 5
- ).get(params: params)
- rescue RestClient::Forbidden
- nil
- end
-end
diff --git a/lib/github/releases.rb b/lib/github/releases.rb
deleted file mode 100644
index ec8ef101b..000000000
--- a/lib/github/releases.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class Github::Releases
-
- def self.latest
- latest_release = Github::API.latest_release
- return nil if latest_release.nil?
-
- release = Hashie::Mash.new JSON.parse(latest_release)
- release.published_at = release.published_at.to_date.strftime('%d/%m/%Y')
- release
- end
-end
\ No newline at end of file
diff --git a/public/fonts/bootstrap/glyphicons-halflings-regular.woff b/public/fonts/bootstrap/glyphicons-halflings-regular.woff
old mode 100755
new mode 100644
diff --git a/public/fonts/bootstrap/glyphicons-halflings-regular.woff2 b/public/fonts/bootstrap/glyphicons-halflings-regular.woff2
new file mode 100644
index 000000000..64539b54c
Binary files /dev/null and b/public/fonts/bootstrap/glyphicons-halflings-regular.woff2 differ
diff --git a/spec/controllers/admin/accompagnateurs_controller_spec.rb b/spec/controllers/admin/accompagnateurs_controller_spec.rb
index 285b43feb..748e3a815 100644
--- a/spec/controllers/admin/accompagnateurs_controller_spec.rb
+++ b/spec/controllers/admin/accompagnateurs_controller_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Admin::AccompagnateursController, type: :controller do
+describe Admin::AccompagnateursController, type: :controller do
let(:admin) { create(:administrateur) }
let(:procedure) { create :procedure, administrateur: admin }
let(:gestionnaire) { create :gestionnaire, administrateurs: [admin] }
@@ -10,12 +10,12 @@ describe Admin::AccompagnateursController, type: :controller do
end
describe 'GET #show' do
- subject { get :show, procedure_id: procedure.id }
- it { expect(subject.status).to eq(200) }
+ subject { get :show, params: {procedure_id: procedure.id} }
+ it { expect(subject.status).to eq(200) }
end
describe 'PUT #update' do
- subject { put :update, accompagnateur_id: gestionnaire.id ,procedure_id: procedure.id, to: 'assign' }
+ subject { put :update, params: {accompagnateur_id: gestionnaire.id, procedure_id: procedure.id, to: 'assign'} }
it { expect(subject).to redirect_to admin_procedure_accompagnateurs_path(procedure_id: procedure.id) }
@@ -27,7 +27,7 @@ describe Admin::AccompagnateursController, type: :controller do
it { expect(flash[:notice]).to be_present }
it 'default pref list dossier procedure columns are created' do
- expect(procedure.preference_list_dossiers.size).to eq gestionnaire.preference_list_dossiers.where('procedure_id IS NULL').size
+ expect(procedure.preference_list_dossiers.size).to eq gestionnaire.preference_list_dossiers.where('procedure_id IS NULL').size
end
end
end
diff --git a/spec/controllers/admin/gestionnaires_controller_spec.rb b/spec/controllers/admin/gestionnaires_controller_spec.rb
index f00c5970c..ca1de17d6 100644
--- a/spec/controllers/admin/gestionnaires_controller_spec.rb
+++ b/spec/controllers/admin/gestionnaires_controller_spec.rb
@@ -17,7 +17,7 @@ describe Admin::GestionnairesController, type: :controller do
describe 'POST #create' do
let(:email) { 'test@plop.com' }
let(:procedure_id) { nil }
- subject { post :create, gestionnaire: {email: email}, procedure_id: procedure_id }
+ subject { post :create, params: {gestionnaire: {email: email}, procedure_id: procedure_id} }
context 'When email is valid' do
before do
@@ -150,7 +150,6 @@ describe Admin::GestionnairesController, type: :controller do
context 'unified login' do
before do
- allow(Features).to receive(:unified_login).and_return(true)
subject
end
@@ -175,7 +174,7 @@ describe Admin::GestionnairesController, type: :controller do
let!(:admin) { create :administrateur }
let!(:gestionnaire) { create :gestionnaire, email: email, administrateurs: [admin] }
- subject { delete :destroy, id: gestionnaire.id }
+ subject { delete :destroy, params: {id: gestionnaire.id} }
context "when gestionaire_id is valid" do
before do
diff --git a/spec/controllers/admin/mails_controller_spec.rb b/spec/controllers/admin/mails_controller_spec.rb
index acb973e24..a51045d9e 100644
--- a/spec/controllers/admin/mails_controller_spec.rb
+++ b/spec/controllers/admin/mails_controller_spec.rb
@@ -8,7 +8,7 @@ describe Admin::MailsController, type: :controller do
end
describe 'GET index' do
- subject { get :index, procedure_id: procedure.id }
+ subject { get :index, params: {procedure_id: procedure.id} }
it { expect(subject.status).to eq 200 }
end
@@ -19,12 +19,12 @@ describe Admin::MailsController, type: :controller do
context 'when is mail_received id' do
subject { patch :update,
- procedure_id: procedure.id,
- id: procedure.mail_received.id,
- mail_received: {
- object: object,
- body: body
- } }
+ params: {procedure_id: procedure.id,
+ id: procedure.mail_received.id,
+ mail_received: {
+ object: object,
+ body: body
+ }} }
it { expect(subject).to redirect_to admin_procedure_mails_path }
diff --git a/spec/controllers/admin/pieces_justificatives_controller_spec.rb b/spec/controllers/admin/pieces_justificatives_controller_spec.rb
index 5c33da67e..53f3212b7 100644
--- a/spec/controllers/admin/pieces_justificatives_controller_spec.rb
+++ b/spec/controllers/admin/pieces_justificatives_controller_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Admin::PiecesJustificativesController, type: :controller do
+describe Admin::PiecesJustificativesController, type: :controller do
let(:admin) { create(:administrateur) }
let(:published) { false }
let(:procedure) { create(:procedure, administrateur: admin, published: published) }
@@ -11,7 +11,7 @@ describe Admin::PiecesJustificativesController, type: :controller do
describe 'GET #show' do
let(:procedure_id) { procedure.id }
- subject { get :show, procedure_id: procedure_id }
+ subject { get :show, params: {procedure_id: procedure_id} }
context 'when procedure is not found' do
let(:procedure_id) { 9_999_999 }
@@ -36,22 +36,22 @@ describe Admin::PiecesJustificativesController, type: :controller do
let(:description) { "relevé d'identité bancaire" }
let(:update_params) do
{
- types_de_piece_justificative_attributes:
- {
- '0' =>
- {
- libelle: libelle,
- description: description
- }
- }
+ types_de_piece_justificative_attributes:
+ {
+ '0' =>
+ {
+ libelle: libelle,
+ description: description
+ }
+ }
}
end
- let(:request) { put :update, procedure_id: procedure_id, format: :js, procedure: update_params }
+ let(:request) { put :update, params: {procedure_id: procedure_id, format: :js, procedure: update_params} }
subject { request }
it { is_expected.to render_template('show') }
- it { expect{ subject }.to change(TypeDePieceJustificative, :count).by(1) }
+ it { expect { subject }.to change(TypeDePieceJustificative, :count).by(1) }
it 'adds type de pj to procedure' do
request
procedure.reload
@@ -67,7 +67,7 @@ describe Admin::PiecesJustificativesController, type: :controller do
context 'when libelle is blank' do
let(:libelle) { '' }
- it { expect{ subject }.not_to change(TypeDePieceJustificative, :count) }
+ it { expect { subject }.not_to change(TypeDePieceJustificative, :count) }
end
end
@@ -75,7 +75,7 @@ describe Admin::PiecesJustificativesController, type: :controller do
let!(:pj) { create(:type_de_piece_justificative, procedure: procedure) }
let(:procedure_id) { procedure.id }
let(:pj_id) { pj.id }
- let(:request) { delete :destroy, procedure_id: procedure_id, id: pj_id }
+ let(:request) { delete :destroy, params: {procedure_id: procedure_id, id: pj_id} }
subject { request }
context 'when procedure is not found' do
let(:procedure_id) { 9_999_999 }
@@ -93,12 +93,12 @@ describe Admin::PiecesJustificativesController, type: :controller do
end
context 'when pj is found' do
it { expect(subject.status).to eq(200) }
- it { expect{ subject }.to change(TypeDePieceJustificative, :count).by(-1) }
+ it { expect { subject }.to change(TypeDePieceJustificative, :count).by(-1) }
end
end
describe 'POST #move_up' do
- subject { post :move_up, procedure_id: procedure.id, index: index, format: :js }
+ subject { post :move_up, params: {procedure_id: procedure.id, index: index, format: :js} }
context 'when procedure have no type de champ' do
let(:index) { 0 }
@@ -124,7 +124,7 @@ describe Admin::PiecesJustificativesController, type: :controller do
it { expect(subject.status).to eq(200) }
it { expect(subject).to render_template('show') }
it 'changes order places' do
- post :move_up, procedure_id: procedure.id, index: index, format: :js
+ post :move_up, params: {procedure_id: procedure.id, index: index, format: :js}
type_de_piece_justificative_0.reload
type_de_piece_justificative_1.reload
expect(type_de_piece_justificative_0.order_place).to eq(1)
@@ -135,7 +135,7 @@ describe Admin::PiecesJustificativesController, type: :controller do
end
describe 'POST #move_down' do
- let(:request) { post :move_down, procedure_id: procedure.id, index: index, format: :js }
+ let(:request) { post :move_down, params: {procedure_id: procedure.id, index: index, format: :js} }
let(:index) { 0 }
subject { request }
diff --git a/spec/controllers/admin/previsualisations_controller_spec.rb b/spec/controllers/admin/previsualisations_controller_spec.rb
index 8c9836bfb..b418b672e 100644
--- a/spec/controllers/admin/previsualisations_controller_spec.rb
+++ b/spec/controllers/admin/previsualisations_controller_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Admin::PrevisualisationsController, type: :controller do
+describe Admin::PrevisualisationsController, type: :controller do
let(:admin) { create(:administrateur) }
let(:procedure) { create :procedure, administrateur: admin }
@@ -9,8 +9,8 @@ describe Admin::PrevisualisationsController, type: :controller do
end
describe 'GET #show' do
- subject { get :show, procedure_id: procedure.id }
- it { expect(subject.status).to eq(200) }
+ subject { get :show, params: {procedure_id: procedure.id} }
+ it { expect(subject.status).to eq(200) }
end
end
\ No newline at end of file
diff --git a/spec/controllers/admin/procedures_controller_spec.rb b/spec/controllers/admin/procedures_controller_spec.rb
index c72a02d35..0ccbbbdb1 100644
--- a/spec/controllers/admin/procedures_controller_spec.rb
+++ b/spec/controllers/admin/procedures_controller_spec.rb
@@ -58,7 +58,7 @@ describe Admin::ProceduresController, type: :controller do
let(:procedure_published) { create :procedure, published: true, archived: false }
let(:procedure_archived) { create :procedure, published: false, archived: true }
- subject { delete :destroy, id: procedure.id }
+ subject { delete :destroy, params: {id: procedure.id} }
context 'when procedure is draft' do
let!(:procedure) { procedure_draft }
@@ -98,7 +98,7 @@ describe Admin::ProceduresController, type: :controller do
let(:procedure) { create(:procedure, administrateur: admin, published: published) }
let(:procedure_id) { procedure.id }
- subject { get :edit, id: procedure_id }
+ subject { get :edit, params: {id: procedure_id} }
context 'when user is not connected' do
before do
@@ -130,14 +130,14 @@ describe Admin::ProceduresController, type: :controller do
describe 'POST #create' do
context 'when all attributs are filled' do
describe 'new procedure in database' do
- subject { post :create, procedure: procedure_params }
+ subject { post :create, params: {procedure: procedure_params} }
it { expect { subject }.to change { Procedure.count }.by(1) }
end
context 'when procedure is correctly save' do
before do
- post :create, procedure: procedure_params
+ post :create, params: {procedure: procedure_params}
end
describe 'procedure attributs in database' do
@@ -175,7 +175,7 @@ describe Admin::ProceduresController, type: :controller do
let(:description) { '' }
describe 'no new procedure in database' do
- subject { post :create, procedure: procedure_params }
+ subject { post :create, params: {procedure: procedure_params} }
it { expect { subject }.to change { Procedure.count }.by(0) }
@@ -186,7 +186,7 @@ describe Admin::ProceduresController, type: :controller do
describe 'flash message is present' do
before do
- post :create, procedure: procedure_params
+ post :create, params: {procedure: procedure_params}
end
it { expect(flash[:alert]).to be_present }
@@ -202,14 +202,14 @@ describe Admin::ProceduresController, type: :controller do
sign_out admin
end
- subject { put :update, id: procedure.id }
+ subject { put :update, params: {id: procedure.id} }
it { expect(subject).to redirect_to new_administrateur_session_path }
end
context 'when administrateur is connected' do
before do
- put :update, id: procedure.id, procedure: procedure_params
+ put :update, params: {id: procedure.id, procedure: procedure_params}
procedure.reload
end
@@ -270,7 +270,7 @@ describe Admin::ProceduresController, type: :controller do
context 'when admin is the owner of the procedure' do
before do
- put :publish, procedure_id: procedure.id, procedure_path: procedure_path
+ put :publish, params: {procedure_id: procedure.id, procedure_path: procedure_path}
procedure.reload
procedure2.reload
end
@@ -299,7 +299,7 @@ describe Admin::ProceduresController, type: :controller do
it 'archive previous procedure' do
expect(procedure2.published).to be_truthy
expect(procedure2.archived).to be_truthy
- expect(procedure2.path).not_to be_nil
+ expect(procedure2.path).to be_nil
end
end
@@ -338,7 +338,7 @@ describe Admin::ProceduresController, type: :controller do
sign_out admin
sign_in admin_2
- put :publish, procedure_id: procedure.id, procedure_path: 'fake_path'
+ put :publish, params: {procedure_id: procedure.id, procedure_path: 'fake_path'}
procedure.reload
end
@@ -354,7 +354,7 @@ describe Admin::ProceduresController, type: :controller do
context 'when admin is the owner of the procedure' do
before do
- put :archive, procedure_id: procedure.id
+ put :archive, params: {procedure_id: procedure.id}
procedure.reload
end
@@ -366,7 +366,7 @@ describe Admin::ProceduresController, type: :controller do
context 'when owner want to re-enable procedure' do
before do
- put :publish, procedure_id: procedure.id, procedure_path: 'fake_path'
+ put :publish, params: {procedure_id: procedure.id, procedure_path: 'fake_path'}
procedure.reload
end
@@ -383,7 +383,7 @@ describe Admin::ProceduresController, type: :controller do
sign_out admin
sign_in admin_2
- put :archive, procedure_id: procedure.id
+ put :archive, params: {procedure_id: procedure.id}
procedure.reload
end
@@ -394,7 +394,7 @@ describe Admin::ProceduresController, type: :controller do
describe 'PUT #clone' do
let!(:procedure) { create(:procedure, administrateur: admin) }
- subject { put :clone, procedure_id: procedure.id }
+ subject { put :clone, params: {procedure_id: procedure.id} }
it { expect { subject }.to change(Procedure, :count).by(1) }
@@ -452,7 +452,7 @@ describe Admin::ProceduresController, type: :controller do
subject
end
- subject { get :path_list, request: procedure2.path }
+ subject { get :path_list, params: {request: procedure2.path} }
it { expect(response.status).to eq(200) }
it { expect(body.size).to eq(1) }
@@ -476,7 +476,7 @@ describe Admin::ProceduresController, type: :controller do
describe 'POST transfer' do
let!(:procedure) { create :procedure, administrateur: admin }
- subject { post :transfer, email_admin: email_admin, procedure_id: procedure.id }
+ subject { post :transfer, params: {email_admin: email_admin, procedure_id: procedure.id} }
context 'when admin is unknow' do
let(:email_admin) { 'plop' }
diff --git a/spec/controllers/admin/types_de_champ_controller_spec.rb b/spec/controllers/admin/types_de_champ_controller_spec.rb
index c50d36a4f..45ef564ff 100644
--- a/spec/controllers/admin/types_de_champ_controller_spec.rb
+++ b/spec/controllers/admin/types_de_champ_controller_spec.rb
@@ -13,7 +13,7 @@ describe Admin::TypesDeChampController, type: :controller do
let(:procedure) { create(:procedure, administrateur: admin, published: published) }
let(:procedure_id) { procedure.id }
- subject { get :show, procedure_id: procedure_id }
+ subject { get :show, params: {procedure_id: procedure_id} }
context 'when procedure is not found' do
let(:procedure_id) { 9_999_999 }
@@ -65,7 +65,7 @@ describe Admin::TypesDeChampController, type: :controller do
}
end
- let(:request) { put :update, format: :js, procedure_id: procedure.id, procedure: procedure_params }
+ let(:request) { put :update, params: {procedure_id: procedure.id, procedure: procedure_params}, format: :js }
context 'when procedure is found' do
it { expect { request }.to change(TypeDeChamp, :count).by(1) }
@@ -123,7 +123,7 @@ describe Admin::TypesDeChampController, type: :controller do
end
end
context 'when procedure is not found' do
- subject { put :update, format: :js, procedure_id: 9_999_999, procedure: procedure_params }
+ subject { put :update, format: :js, params: {procedure_id: 9_999_999, procedure: procedure_params} }
it 'creates type de champ' do
expect(subject.status).to eq(404)
end
@@ -132,7 +132,7 @@ describe Admin::TypesDeChampController, type: :controller do
describe '#destroy' do
before do
- delete :destroy, procedure_id: procedure.id, id: type_de_champ_id, format: :js
+ delete :destroy, params: {procedure_id: procedure.id, id: type_de_champ_id, format: :js}
end
context 'when type de champs does not exist' do
@@ -156,7 +156,7 @@ describe Admin::TypesDeChampController, type: :controller do
end
describe 'POST #move_up' do
- subject { post :move_up, procedure_id: procedure.id, index: index, format: :js }
+ subject { post :move_up, params: {procedure_id: procedure.id, index: index, format: :js} }
context 'when procedure have no type de champ' do
let(:index) { 0 }
@@ -182,7 +182,7 @@ describe Admin::TypesDeChampController, type: :controller do
it { expect(subject.status).to eq(200) }
it { expect(subject).to render_template('show') }
it 'changes order places' do
- post :move_up, procedure_id: procedure.id, index: index, format: :js
+ post :move_up, params: {procedure_id: procedure.id, index: index, format: :js}
type_de_champ_0.reload
type_de_champ_1.reload
expect(type_de_champ_0.order_place).to eq(1)
@@ -193,7 +193,7 @@ describe Admin::TypesDeChampController, type: :controller do
end
describe 'POST #move_down' do
- let(:request) { post :move_down, procedure_id: procedure.id, index: index, format: :js }
+ let(:request) { post :move_down, params: {procedure_id: procedure.id, index: index, format: :js} }
let(:index) { 0 }
subject { request }
diff --git a/spec/controllers/admin/types_de_champ_private_controller_spec.rb b/spec/controllers/admin/types_de_champ_private_controller_spec.rb
index 635fca004..c458bd172 100644
--- a/spec/controllers/admin/types_de_champ_private_controller_spec.rb
+++ b/spec/controllers/admin/types_de_champ_private_controller_spec.rb
@@ -13,7 +13,7 @@ describe Admin::TypesDeChampPrivateController, type: :controller do
let(:procedure) { create(:procedure, administrateur: admin, published: published) }
let(:procedure_id) { procedure.id }
- subject { get :show, procedure_id: procedure_id }
+ subject { get :show, params: {procedure_id: procedure_id} }
context 'when procedure is not found' do
let(:procedure_id) { 9_999_999 }
@@ -41,35 +41,35 @@ describe Admin::TypesDeChampPrivateController, type: :controller do
let(:mandatory) { 'on' }
let(:procedure_params) do
- { types_de_champ_private_attributes:
- { '0' =>
- {
- libelle: libelle,
- type_champ: type_champ,
- description: description,
- order_place: order_place,
- id: types_de_champ_id,
- mandatory: mandatory,
- type: 'TypeDeChampPrivate'
- },
- '1' =>
- {
- libelle: '',
- type_champ: 'text',
- description: '',
- order_place: '1',
- id: '',
- mandatory: false,
- type: 'TypeDeChampPrivate'
- }
- }
+ {types_de_champ_private_attributes:
+ {'0' =>
+ {
+ libelle: libelle,
+ type_champ: type_champ,
+ description: description,
+ order_place: order_place,
+ id: types_de_champ_id,
+ mandatory: mandatory,
+ type: 'TypeDeChampPrivate'
+ },
+ '1' =>
+ {
+ libelle: '',
+ type_champ: 'text',
+ description: '',
+ order_place: '1',
+ id: '',
+ mandatory: false,
+ type: 'TypeDeChampPrivate'
+ }
+ }
}
end
- let(:request) { put :update, format: :js, procedure_id: procedure.id, procedure: procedure_params }
+ let(:request) { put :update, params: {format: :js, procedure_id: procedure.id, procedure: procedure_params} }
context 'when procedure is found' do
- it { expect{ request }.to change(TypeDeChamp, :count).by(1) }
+ it { expect { request }.to change(TypeDeChamp, :count).by(1) }
describe 'created type de champ' do
before do
@@ -106,7 +106,7 @@ describe Admin::TypesDeChampPrivateController, type: :controller do
end
end
context 'when procedure is not found' do
- subject { put :update, format: :js, procedure_id: 9_999_999, procedure: procedure_params }
+ subject { put :update, params: {format: :js, procedure_id: 9_999_999, procedure: procedure_params} }
it 'creates type de champ' do
expect(subject.status).to eq(404)
end
@@ -115,7 +115,7 @@ describe Admin::TypesDeChampPrivateController, type: :controller do
describe '#destroy' do
before do
- delete :destroy, procedure_id: procedure.id, id: type_de_champ_id, format: :js
+ delete :destroy, params: {procedure_id: procedure.id, id: type_de_champ_id, format: :js}
end
context 'when type de champs does not exist' do
@@ -139,7 +139,7 @@ describe Admin::TypesDeChampPrivateController, type: :controller do
end
describe 'POST #move_up' do
- subject { post :move_up, procedure_id: procedure.id, index: index, format: :js }
+ subject { post :move_up, params: {procedure_id: procedure.id, index: index, format: :js} }
context 'when procedure have no type de champ' do
let(:index) { 0 }
@@ -165,7 +165,7 @@ describe Admin::TypesDeChampPrivateController, type: :controller do
it { expect(subject.status).to eq(200) }
it { expect(subject).to render_template('show') }
it 'changes order places' do
- post :move_up, procedure_id: procedure.id, index: index, format: :js
+ post :move_up, params: {procedure_id: procedure.id, index: index, format: :js}
type_de_champ_0.reload
type_de_champ_1.reload
expect(type_de_champ_0.order_place).to eq(1)
@@ -176,7 +176,7 @@ describe Admin::TypesDeChampPrivateController, type: :controller do
end
describe 'POST #move_down' do
- let(:request) { post :move_down, procedure_id: procedure.id, index: index, format: :js }
+ let(:request) { post :move_down, params: {procedure_id: procedure.id, index: index, format: :js} }
let(:index) { 0 }
subject { request }
diff --git a/spec/controllers/administrateur/sessions_controller_spec.rb b/spec/controllers/administrateur/sessions_controller_spec.rb
index ff0981e00..a4717fca7 100644
--- a/spec/controllers/administrateur/sessions_controller_spec.rb
+++ b/spec/controllers/administrateur/sessions_controller_spec.rb
@@ -5,6 +5,27 @@ describe Administrateurs::SessionsController, type: :controller do
@request.env["devise.mapping"] = Devise.mappings[:administrateur]
end
+ describe '.demo' do
+ subject { get :demo }
+
+ context 'when rails env is production' do
+ before do
+ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
+ end
+
+ it { is_expected.to redirect_to root_path }
+ end
+
+ context 'when rails env is not production' do
+ it { expect(subject.status).to eq 200 }
+
+ it 'Administrateur demo is initiated' do
+ expect(Administrateur).to receive(:new).with(email: 'admin@tps.fr', password: 'password').and_return(Administrateur)
+ subject
+ end
+ end
+ end
+
describe '.create' do
it { expect(described_class).to be < Sessions::SessionsController }
end
diff --git a/spec/controllers/administrations_controller_spec.rb b/spec/controllers/administrations_controller_spec.rb
new file mode 100644
index 000000000..2481e327b
--- /dev/null
+++ b/spec/controllers/administrations_controller_spec.rb
@@ -0,0 +1,55 @@
+require 'spec_helper'
+
+describe AdministrationsController, type: :controller do
+
+ let(:administration) { create :administration }
+
+ describe 'GET #index' do
+
+ subject { get :index }
+
+ context 'when administration user is not connect' do
+ it { expect(subject.status).to eq 302 }
+ end
+
+ context 'when administration user is connect' do
+
+ before do
+ sign_in administration
+ end
+
+ it { expect(subject.status).to eq 200 }
+ end
+ end
+
+ describe 'POST #create' do
+
+ let(:email) { 'plop@plop.com' }
+ let(:password) { 'password' }
+
+ before do
+ sign_in administration
+ end
+
+ subject { post :create, administrateur: {email: email, password: password} }
+
+ context 'when email and password are correct' do
+ it 'add new administrateur in database' do
+ expect { subject }.to change(Administrateur, :count).by(1)
+ end
+
+ it 'alert new mail are send' do
+ expect(NewAdminMailer).to receive(:new_admin_email).and_return(NewAdminMailer)
+ expect(NewAdminMailer).to receive(:deliver_now!)
+ subject
+ end
+
+ end
+
+ context 'when email or password are missing' do
+ let(:email) { '' }
+
+ it { expect { subject }.to change(Administrateur, :count).by(0) }
+ end
+ end
+end
diff --git a/spec/controllers/api/v1/dossiers_controller_spec.rb b/spec/controllers/api/v1/dossiers_controller_spec.rb
index 0c00308bb..0b842f727 100644
--- a/spec/controllers/api/v1/dossiers_controller_spec.rb
+++ b/spec/controllers/api/v1/dossiers_controller_spec.rb
@@ -8,7 +8,7 @@ describe API::V1::DossiersController do
it { expect(described_class).to be < APIController }
describe 'GET index' do
- let(:retour) { get :index, token: admin.api_token, procedure_id: procedure_id }
+ let(:retour) { get :index, params: {token: admin.api_token, procedure_id: procedure_id} }
subject { retour }
@@ -58,7 +58,7 @@ describe API::V1::DossiersController do
end
context 'when there are multiple pages' do
- let(:retour) { get :index, token: admin.api_token, procedure_id: procedure_id, page: 2 }
+ let(:retour) { get :index, params: {token: admin.api_token, procedure_id: procedure_id, page: 2} }
let!(:dossier1) { create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated') }
let!(:dossier2) { create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated') }
@@ -79,7 +79,7 @@ describe API::V1::DossiersController do
end
describe 'GET show' do
- let(:retour) { get :show, token: admin.api_token, procedure_id: procedure_id, id: dossier_id }
+ let(:retour) { get :show, params: {token: admin.api_token, procedure_id: procedure_id, id: dossier_id} }
subject { retour }
context 'when procedure is not found' do
@@ -121,6 +121,7 @@ describe API::V1::DossiersController do
it 'return REST code 200', :show_in_doc do
expect(retour.code).to eq('200')
end
+
it { expect(subject[:id]).to eq(dossier.id) }
it { expect(subject[:state]).to eq(dossier.state) }
it { expect(subject[:created_at]).to eq('2008-09-01T08:05:00.000Z') }
@@ -177,7 +178,7 @@ describe API::V1::DossiersController do
end
end
- describe 'piece justificative', vcr: { cassette_name: 'controllers_api_v1_dossiers_controller_piece_justificative' } do
+ describe 'piece justificative', vcr: {cassette_name: 'controllers_api_v1_dossiers_controller_piece_justificative'} do
before do
create :piece_justificative, :rib, dossier: dossier, type_de_piece_justificative: dossier.procedure.types_de_piece_justificative.first, user: dossier.user
end
@@ -187,17 +188,14 @@ describe API::V1::DossiersController do
subject {
super()[:pieces_justificatives].first }
- it { expect(subject.keys.include?(:url)).to be_truthy }
+ it { expect(subject.keys.include?(:content_url)).to be_truthy }
it { expect(subject[:created_at]).not_to be_nil }
it { expect(subject[:type_de_piece_justificative_id]).not_to be_nil }
it { expect(subject.keys.include?(:user)).to be_truthy }
describe 'user' do
- let(:field_list) { [
- :url, :created_at, :type_de_piece_justificative_id] }
- subject {
- super()[:user] }
+ subject { super()[:user] }
it { expect(subject[:email]).not_to be_nil }
end
@@ -278,7 +276,7 @@ describe API::V1::DossiersController do
it { expect(subject.first[:email]).to eq 'plop@plip.com' }
end
- describe 'cerfa', vcr: { cassette_name: 'controllers_api_v1_dossiers_controller_cerfa' } do
+ describe 'cerfa', vcr: {cassette_name: 'controllers_api_v1_dossiers_controller_cerfa'} do
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, :with_cerfa_upload, procedure: procedure) } }
let(:content) { File.open('./spec/support/files/piece_justificative_388.pdf') }
@@ -293,9 +291,9 @@ describe API::V1::DossiersController do
it { expect(subject[:created_at]).not_to be_nil }
if Features.remote_storage
- it { expect(subject[:url]).to match /^https:\/\/storage.apientreprise.fr\/tps_dev\/cerfa-.*\.pdf$/ }
+ it { expect(subject[:content_url]).to match /^https:\/\/storage.apientreprise.fr\/tps_dev\/cerfa-.*\.pdf$/ }
else
- it { expect(subject[:url]).to match /^http:\/\/.*downloads.*_CERFA\.pdf$/ }
+ it { expect(subject[:content_url]).to match /^http:\/\/.*downloads.*_CERFA\.pdf$/ }
end
describe 'user' do
diff --git a/spec/controllers/api/v1/procedures_controller_spec.rb b/spec/controllers/api/v1/procedures_controller_spec.rb
index f478cd5db..0c10d9cd2 100644
--- a/spec/controllers/api/v1/procedures_controller_spec.rb
+++ b/spec/controllers/api/v1/procedures_controller_spec.rb
@@ -1,22 +1,22 @@
require 'spec_helper'
-describe API::V1::ProceduresController do
+describe API::V1::ProceduresController, type: :controller do
let(:admin) { create(:administrateur) }
it { expect(described_class).to be < APIController }
describe 'GET show' do
context 'when procedure does not exist' do
- subject { get :show, id: 999_999_999, token: admin.api_token }
+ subject { get :show, params: {id: 999_999_999, token: admin.api_token }}
it { expect(subject.status).to eq(404) }
end
context 'when procedure does not belong to administrateur' do
let(:procedure) { create(:procedure, administrateur: create(:administrateur)) }
- subject { get :show, id: procedure, token: admin.api_token }
+ subject { get :show, params:{id: procedure, token: admin.api_token }}
it { expect(subject.status).to eq(404) }
end
context 'when procedure exist' do
let(:procedure) { create(:procedure, :with_two_type_de_piece_justificative, :with_type_de_champ, administrateur: admin) }
- subject { get :show, id: procedure, token: admin.api_token }
+ subject { get :show, params:{id: procedure, token: admin.api_token }}
it 'return REST code 200', :show_in_doc do
expect(subject.status).to eq(200)
@@ -25,7 +25,7 @@ describe API::V1::ProceduresController do
describe 'body' do
let(:module_api_carto) { create(:module_api_carto, use_api_carto: true, quartiers_prioritaires: true, cadastre: true) }
let(:procedure) { create(:procedure, :with_type_de_champ, :with_two_type_de_piece_justificative, module_api_carto: module_api_carto, administrateur: admin) }
- let(:response) { get :show, id: procedure.id, token: admin.api_token }
+ let(:response) { get :show, params:{id: procedure.id, token: admin.api_token }}
subject { JSON.parse(response.body, symbolize_names: true)[:procedure] }
it { expect(subject[:id]).to eq(procedure.id) }
@@ -43,7 +43,7 @@ describe API::V1::ProceduresController do
let(:champ) { procedure.types_de_champ.first }
it { expect(subject[:id]).to eq(champ.id) }
it { expect(subject[:libelle]).to eq(champ.libelle) }
- it { expect(subject[:type]).to eq(champ.type_champ) }
+ it { expect(subject[:type_champ]).to eq(champ.type_champ) }
it { expect(subject[:order_place]).to eq(champ.order_place) }
it { expect(subject[:description]).to eq(champ.description) }
end
diff --git a/spec/controllers/api_controller_spec.rb b/spec/controllers/api_controller_spec.rb
index ce9f22f9d..a5ff814e5 100644
--- a/spec/controllers/api_controller_spec.rb
+++ b/spec/controllers/api_controller_spec.rb
@@ -5,6 +5,7 @@ describe APIController, type: :controller do
def show
render json: {}, satus: 200
end
+
def index
render json: {}, satus: 200
end
@@ -13,17 +14,17 @@ describe APIController, type: :controller do
describe 'GET index' do
context 'when token is missing' do
subject { get :index }
- it { expect(subject.status).to eq(401) }
+ it { expect(subject.status).to eq(401) }
end
context 'when token does not exist' do
let(:token) { 'invalid_token' }
- subject { get :index, token: token }
- it { expect(subject.status).to eq(401) }
+ subject { get :index, params: {token: token} }
+ it { expect(subject.status).to eq(401) }
end
context 'when token exist' do
let(:administrateur) { create(:administrateur) }
- subject { get :index, token: administrateur.api_token }
- it { expect(subject.status).to eq(200) }
+ subject { get :index, params: {token: administrateur.api_token} }
+ it { expect(subject.status).to eq(200) }
end
end
end
\ No newline at end of file
diff --git a/spec/controllers/backoffice/commentaires_controller_spec.rb b/spec/controllers/backoffice/commentaires_controller_spec.rb
index 231f12c69..2fccafe5e 100644
--- a/spec/controllers/backoffice/commentaires_controller_spec.rb
+++ b/spec/controllers/backoffice/commentaires_controller_spec.rb
@@ -17,7 +17,7 @@ describe Backoffice::CommentairesController, type: :controller do
end
context "création correct d'un commentaire" do
- subject { post :create, dossier_id: dossier_id, email_commentaire: email_commentaire, texte_commentaire: texte_commentaire }
+ subject { post :create, params: {dossier_id: dossier_id, email_commentaire: email_commentaire, texte_commentaire: texte_commentaire} }
it 'depuis la page admin' do
expect(subject).to redirect_to("/backoffice/dossiers/#{dossier_id}")
@@ -36,13 +36,17 @@ describe Backoffice::CommentairesController, type: :controller do
expect { subject }.to change(Follow, :count).by(0)
end
end
+
+ it 'Internal notification is not create' do
+ expect { subject }.to change(Notification, :count).by (0)
+ end
end
context 'when document is upload whith a commentaire', vcr: {cassette_name: 'controllers_backoffice_commentaires_controller_doc_upload_with_comment'} do
let(:document_upload) { Rack::Test::UploadedFile.new("./spec/support/files/piece_justificative_0.pdf", 'application/pdf') }
subject do
- post :create, dossier_id: dossier_id, email_commentaire: email_commentaire, texte_commentaire: texte_commentaire, piece_justificative: {content: document_upload}
+ post :create, params: {dossier_id: dossier_id, email_commentaire: email_commentaire, texte_commentaire: texte_commentaire, piece_justificative: {content: document_upload}}
end
it 'create a new piece justificative' do
@@ -54,6 +58,10 @@ describe Backoffice::CommentairesController, type: :controller do
subject
end
+ it 'Internal notification is not create' do
+ expect { subject }.to change(Notification, :count).by (0)
+ end
+
describe 'piece justificative created' do
let(:pj) { PieceJustificative.last }
@@ -91,7 +99,7 @@ describe Backoffice::CommentairesController, type: :controller do
sign_in create(:gestionnaire)
dossier.updated!
- post :create, dossier_id: dossier_id, texte_commentaire: texte_commentaire
+ post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire}
dossier.reload
end
@@ -103,7 +111,7 @@ describe Backoffice::CommentairesController, type: :controller do
expect(NotificationMailer).to receive(:new_answer).and_return(NotificationMailer)
expect(NotificationMailer).to receive(:deliver_now!)
- post :create, dossier_id: dossier_id, texte_commentaire: texte_commentaire
+ post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire}
end
end
end
@@ -117,7 +125,7 @@ describe Backoffice::CommentairesController, type: :controller do
expect(NotificationMailer).not_to receive(:new_answer)
expect(NotificationMailer).not_to receive(:deliver_now!)
- post :create, dossier_id: dossier_id, texte_commentaire: texte_commentaire
+ post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire}
end
end
end
diff --git a/spec/controllers/backoffice/dossiers/procedure_controller_spec.rb b/spec/controllers/backoffice/dossiers/procedure_controller_spec.rb
new file mode 100644
index 000000000..7967e1010
--- /dev/null
+++ b/spec/controllers/backoffice/dossiers/procedure_controller_spec.rb
@@ -0,0 +1,38 @@
+require 'spec_helper'
+
+describe Backoffice::Dossiers::ProcedureController, type: :controller do
+ let(:gestionnaire) { create :gestionnaire }
+ let(:procedure) { create :procedure }
+
+ before do
+ create :assign_to, gestionnaire: gestionnaire, procedure: procedure
+ sign_in gestionnaire
+ gestionnaire.build_default_preferences_list_dossier procedure.id
+ end
+
+ describe 'GET #index' do
+ let(:procedure_id) { procedure.id }
+
+ subject { get :index, params: {id: procedure_id} }
+
+ it { expect(subject.status).to eq 200 }
+
+ context 'when procedure id is not found' do
+ let(:procedure_id) { 100000 }
+
+ before do
+ subject
+ end
+
+ it { expect(response.status).to eq 302 }
+ it { is_expected.to redirect_to backoffice_dossiers_path }
+ it { expect(flash[:alert]).to be_present}
+ end
+ end
+
+ describe 'GET #filter' do
+ subject { get :filter, params: {id: procedure.id, filter_input: {"entreprise.raison_sociale" => "plop"}} }
+
+ it { is_expected.to redirect_to backoffice_dossiers_procedure_path(id: procedure.id) }
+ end
+end
\ No newline at end of file
diff --git a/spec/controllers/backoffice/dossiers_controller_spec.rb b/spec/controllers/backoffice/dossiers_controller_spec.rb
index 542b7fc12..96e838d19 100644
--- a/spec/controllers/backoffice/dossiers_controller_spec.rb
+++ b/spec/controllers/backoffice/dossiers_controller_spec.rb
@@ -1,4 +1,4 @@
-require 'rails_helper'
+require 'spec_helper'
describe Backoffice::DossiersController, type: :controller do
before do
@@ -6,7 +6,7 @@ describe Backoffice::DossiersController, type: :controller do
end
let(:procedure) { create :procedure }
- let(:dossier) { create(:dossier, :with_entreprise, procedure: procedure) }
+ let(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: :initiated) }
let(:dossier_archived) { create(:dossier, :with_entreprise, archived: true) }
let(:dossier_id) { dossier.id }
@@ -17,35 +17,61 @@ describe Backoffice::DossiersController, type: :controller do
create :assign_to, procedure: procedure, gestionnaire: gestionnaire
end
+ describe 'GET #index' do
+ subject { get :index }
+
+ before do
+ sign_in gestionnaire
+ end
+
+ context 'when gestionnaire is assign to a procedure' do
+ it { is_expected.to redirect_to backoffice_dossiers_procedure_path(id: procedure.id) }
+ end
+
+ context 'when gestionnaire is not assign to a procedure' do
+ before do
+ AssignTo.where(procedure: procedure, gestionnaire: gestionnaire).delete_all
+ end
+
+ it { is_expected.to redirect_to root_path }
+ end
+ end
+
describe 'GET #show' do
+ subject { get :show, params: {id: dossier_id} }
+
context 'gestionnaire is connected' do
before do
sign_in gestionnaire
end
it 'returns http success' do
- get :show, id: dossier_id
- expect(response).to have_http_status(200)
+ expect(subject).to have_http_status(200)
+ end
+
+ describe 'all notifications unread are changed' do
+ it do
+ expect(Notification).to receive(:where).with(dossier_id: dossier_id).and_return(Notification::ActiveRecord_Relation)
+ expect(Notification::ActiveRecord_Relation).to receive(:update_all).with(already_read: true).and_return(true)
+
+ subject
+ end
end
context ' when dossier is archived' do
- before do
- get :show, id: dossier_archived.id
- end
- it { expect(response).to redirect_to('/backoffice') }
+ let(:dossier_id) { dossier_archived }
+
+ it { expect(subject).to redirect_to('/backoffice') }
end
context 'when dossier id does not exist' do
- before do
- get :show, id: bad_dossier_id
- end
- it { expect(response).to redirect_to('/backoffice') }
+ let(:dossier_id) { bad_dossier_id }
+
+ it { expect(subject).to redirect_to('/backoffice') }
end
end
context 'gestionnaire does not connected but dossier id is correct' do
- subject { get :show, id: dossier_id }
-
it { is_expected.to redirect_to('/gestionnaires/sign_in') }
end
end
@@ -57,8 +83,8 @@ describe Backoffice::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :a_traiter
- expect(response).to have_http_status(200)
+ get :index, params: {liste: :a_traiter}
+ expect(response).to have_http_status(302)
end
end
end
@@ -70,8 +96,8 @@ describe Backoffice::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :fige
- expect(response).to have_http_status(200)
+ get :index, params: {liste: :fige}
+ expect(response).to have_http_status(302)
end
end
end
@@ -83,8 +109,8 @@ describe Backoffice::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :termine
- expect(response).to have_http_status(200)
+ get :index, params: {liste: :termine}
+ expect(response).to have_http_status(302)
end
end
end
@@ -96,8 +122,8 @@ describe Backoffice::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :list_fake
- expect(response).to redirect_to(backoffice_dossiers_path)
+ get :index, params: {liste: :list_fake}
+ expect(response).to redirect_to(backoffice_dossiers_procedure_path(id: gestionnaire.procedures.first.id))
end
end
end
@@ -108,7 +134,7 @@ describe Backoffice::DossiersController, type: :controller do
end
it 'returns http success' do
- post :search, search_terms: 'test'
+ post :search, params: {search_terms: 'test'}
expect(response).to have_http_status(200)
end
@@ -120,7 +146,7 @@ describe Backoffice::DossiersController, type: :controller do
sign_in gestionnaire
end
- subject { post :valid, dossier_id: dossier_id }
+ subject { post :valid, params: {dossier_id: dossier_id} }
it 'change state to validated' do
subject
@@ -135,6 +161,8 @@ describe Backoffice::DossiersController, type: :controller do
subject
end
+
+ it { is_expected.to redirect_to backoffice_dossier_path(id: dossier.id) }
end
describe 'POST #receive' do
@@ -143,7 +171,7 @@ describe Backoffice::DossiersController, type: :controller do
sign_in gestionnaire
end
- subject { post :receive, dossier_id: dossier_id }
+ subject { post :receive, params: {dossier_id: dossier_id} }
context 'when it post a receive instruction' do
before do
@@ -162,6 +190,8 @@ describe Backoffice::DossiersController, type: :controller do
subject
end
+
+ it { is_expected.to redirect_to backoffice_dossier_path(id: dossier.id) }
end
describe 'POST #refuse' do
@@ -170,7 +200,7 @@ describe Backoffice::DossiersController, type: :controller do
sign_in gestionnaire
end
- subject { post :refuse, dossier_id: dossier_id }
+ subject { post :refuse, params: {dossier_id: dossier_id} }
it 'change state to refused' do
subject
@@ -185,6 +215,8 @@ describe Backoffice::DossiersController, type: :controller do
subject
end
+
+ it { is_expected.to redirect_to backoffice_dossier_path(id: dossier.id) }
end
describe 'POST #without_continuation' do
@@ -192,7 +224,7 @@ describe Backoffice::DossiersController, type: :controller do
dossier.without_continuation!
sign_in gestionnaire
end
- subject { post :without_continuation, dossier_id: dossier_id }
+ subject { post :without_continuation, params: {dossier_id: dossier_id} }
it 'change state to without_continuation' do
@@ -208,6 +240,8 @@ describe Backoffice::DossiersController, type: :controller do
subject
end
+
+ it { is_expected.to redirect_to backoffice_dossier_path(id: dossier.id) }
end
describe 'POST #close' do
@@ -215,7 +249,7 @@ describe Backoffice::DossiersController, type: :controller do
dossier.received!
sign_in gestionnaire
end
- subject { post :close, dossier_id: dossier_id }
+ subject { post :close, params: {dossier_id: dossier_id} }
it 'change state to closed' do
subject
@@ -230,6 +264,8 @@ describe Backoffice::DossiersController, type: :controller do
subject
end
+
+ it { is_expected.to redirect_to backoffice_dossier_path(id: dossier.id) }
end
describe 'PUT #toggle_follow' do
@@ -237,7 +273,7 @@ describe Backoffice::DossiersController, type: :controller do
sign_in gestionnaire
end
- subject { put :follow, dossier_id: dossier_id }
+ subject { put :follow, params: {dossier_id: dossier_id} }
it { expect(subject.status).to eq 302 }
diff --git a/spec/controllers/backoffice/preference_list_dossier_controller_spec.rb b/spec/controllers/backoffice/preference_list_dossier_controller_spec.rb
index 06ccf9b55..ec365de42 100644
--- a/spec/controllers/backoffice/preference_list_dossier_controller_spec.rb
+++ b/spec/controllers/backoffice/preference_list_dossier_controller_spec.rb
@@ -13,11 +13,12 @@ describe Backoffice::PreferenceListDossierController, type: :controller do
end
describe '#POST add' do
- subject { post :add, libelle: libelle,
- table: table,
- attr: attr,
- attr_decorate: attr_decorate,
- bootstrap_lg: bootstrap_lg }
+ subject { post :add,
+ params: {libelle: libelle,
+ table: table,
+ attr: attr,
+ attr_decorate: attr_decorate,
+ bootstrap_lg: bootstrap_lg} }
it { expect(subject.status).to eq 200 }
it { expect { subject }.to change(PreferenceListDossier, :count).by(1) }
@@ -44,7 +45,7 @@ describe Backoffice::PreferenceListDossierController, type: :controller do
describe '#DELETE delete' do
let!(:pref) { create :preference_list_dossier }
- subject { delete :delete, pref_id: pref.id }
+ subject { delete :delete, params: {pref_id: pref.id} }
it { expect(subject.status).to eq 200 }
it { expect { subject }.to change(PreferenceListDossier, :count).by(-1) }
diff --git a/spec/controllers/backoffice/private_formulaires_controller_spec.rb b/spec/controllers/backoffice/private_formulaires_controller_spec.rb
index 80b5bb345..2ff55d3bd 100644
--- a/spec/controllers/backoffice/private_formulaires_controller_spec.rb
+++ b/spec/controllers/backoffice/private_formulaires_controller_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe Backoffice::PrivateFormulairesController, type: :controller do
let(:gestionnaire) { create :gestionnaire }
- let(:dossier) { create :dossier }
+ let(:dossier) { create :dossier, state: :initiated }
let(:dossier_champs_first) { 'plop' }
before do
@@ -12,10 +12,11 @@ describe Backoffice::PrivateFormulairesController, type: :controller do
end
describe '#PATCH update' do
- subject { patch :update, dossier_id: dossier.id,
- champs: {
- "'#{dossier.champs_private.first.id}'" => dossier_champs_first
- } }
+ subject { patch :update,
+ params: {dossier_id: dossier.id,
+ champs: {
+ "'#{dossier.champs_private.first.id}'" => dossier_champs_first
+ }} }
before do
subject
diff --git a/spec/controllers/backoffice_controller_spec.rb b/spec/controllers/backoffice_controller_spec.rb
index b802d38e3..00db207ae 100644
--- a/spec/controllers/backoffice_controller_spec.rb
+++ b/spec/controllers/backoffice_controller_spec.rb
@@ -19,4 +19,4 @@ describe BackofficeController, type: :controller do
it { expect(response).to redirect_to :backoffice_dossiers }
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/controllers/ban/search_controller_spec.rb b/spec/controllers/ban/search_controller_spec.rb
index 5d799817e..e51ef2a52 100644
--- a/spec/controllers/ban/search_controller_spec.rb
+++ b/spec/controllers/ban/search_controller_spec.rb
@@ -1,16 +1,47 @@
require 'spec_helper'
describe Ban::SearchController, type: :controller do
- describe '#GET' do
-
- let (:request) { '' }
+ describe '#GET get' do
+ subject { get :get, params: {request: request} }
before do
- stub_request(:get, "http://api-adresse.data.gouv.fr/search?limit=5&q=").
- to_return(:status => 200, :body => 'Missing query', :headers => {})
- get :get, request: request
+ subject
end
- it { expect(response.status).to eq 200 }
+ context 'when request return result', vcr: {cassette_name: 'bano_search_paris'} do
+ let (:request) { 'Paris' }
+
+ it { expect(response.status).to eq 200 }
+ it { expect(response.body).to eq '[{"label":"Paris"},{"label":"Paris 63120 Courpière"},{"label":"PARIS (Vaillac) 46240 Cœur de Causse"},{"label":"Paris 40500 Saint-Sever"},{"label":"Paris Buton 37140 Bourgueil"}]' }
+ end
+
+ context 'when request return nothing', vcr: {cassette_name: 'bano_search_nothing'} do
+
+ let (:request) { 'je recherche pas grand chose' }
+
+ it { expect(response.status).to eq 200 }
+ it { expect(response.body).to eq "[]" }
+ end
+ end
+
+ describe '#GET get_address_point' do
+ let(:dossier_id) { "1" }
+ subject { get :get_address_point, params: {request: request, dossier_id: dossier_id} }
+
+ before do
+ subject
+ end
+
+ context 'when request return result', vcr: {cassette_name: 'ban_search_paris'} do
+ let(:request) { 'Paris' }
+
+ it { expect(response.body).to eq ({lon: '2.3469', lat: '48.8589', zoom: '14', dossier_id: dossier_id}).to_json }
+ end
+
+ context 'when request return nothing', vcr: {cassette_name: 'ban_search_nothing'} do
+ let(:request) { 'je recherche pas grand chose' }
+
+ it { expect(response.body).to eq ({lon: nil, lat: nil, zoom: '14', dossier_id: dossier_id}).to_json }
+ end
end
end
diff --git a/spec/controllers/cgu_controller_spec.rb b/spec/controllers/cgu_controller_spec.rb
new file mode 100644
index 000000000..d49b16ed2
--- /dev/null
+++ b/spec/controllers/cgu_controller_spec.rb
@@ -0,0 +1,10 @@
+require 'spec_helper'
+
+describe CguController, type: :controller do
+ describe 'GET #index' do
+
+ subject { get :index }
+
+ it { expect(subject.status).to eq 200 }
+ end
+end
\ No newline at end of file
diff --git a/spec/controllers/demo_controller_spec.rb b/spec/controllers/demo_controller_spec.rb
new file mode 100644
index 000000000..6541d1efc
--- /dev/null
+++ b/spec/controllers/demo_controller_spec.rb
@@ -0,0 +1,18 @@
+require 'spec_helper'
+
+describe DemoController, type: :controller do
+ describe 'GET #index' do
+
+ subject { get :index }
+
+ it { expect(subject.status).to eq 200 }
+
+ context 'when rails environnement is production' do
+ before do
+ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
+ end
+
+ it { expect(subject.status).to eq 302 }
+ end
+ end
+end
\ No newline at end of file
diff --git a/spec/controllers/france_connect/particulier_controller_spec.rb b/spec/controllers/france_connect/particulier_controller_spec.rb
index bab1adab4..c0a6857b3 100644
--- a/spec/controllers/france_connect/particulier_controller_spec.rb
+++ b/spec/controllers/france_connect/particulier_controller_spec.rb
@@ -38,7 +38,7 @@ describe FranceConnect::ParticulierController, type: :controller do
let!(:france_connect_information) { create(:france_connect_information, france_connect_particulier_id: france_connect_particulier_id, given_name: given_name, family_name: family_name, birthdate: birthdate, gender: gender, birthplace: birthplace) }
context {
- subject { get :callback, code: code }
+ subject { get :callback, params: {code: code} }
it 'does not create a new france_connect_information in database' do
expect { subject }.not_to change { FranceConnectInformation.count }
@@ -49,7 +49,7 @@ describe FranceConnect::ParticulierController, type: :controller do
before do
create(:user, email: email, france_connect_information: france_connect_information)
- get :callback, code: code
+ get :callback, params: {code: code}
end
let(:email) { 'plop@plop.com' }
@@ -63,7 +63,7 @@ describe FranceConnect::ParticulierController, type: :controller do
it 'redirect to stored location' do
subject.store_location_for(:user, stored_location)
- get :callback, code: code
+ get :callback, params: {code: code}
expect(response).to redirect_to(stored_location)
end
end
@@ -72,7 +72,7 @@ describe FranceConnect::ParticulierController, type: :controller do
let(:salt) { FranceConnectSaltService.new(france_connect_information).salt }
before do
- get :callback, code: code
+ get :callback, params: {code: code}
end
it 'redirects to check email FC page' do
@@ -84,13 +84,13 @@ describe FranceConnect::ParticulierController, type: :controller do
context 'when france_connect_particulier_id does not exist in database' do
let(:last_france_connect_information) { FranceConnectInformation.last }
let(:salt) { FranceConnectSaltService.new(last_france_connect_information).salt }
- subject { get :callback, code: code }
+ subject { get :callback, params: {code: code} }
it { expect { subject }.to change { FranceConnectInformation.count }.by(1) }
describe 'FranceConnectInformation attributs' do
before do
- get :callback, code: code
+ get :callback, params: {code: code}
end
subject { last_france_connect_information }
@@ -113,7 +113,7 @@ describe FranceConnect::ParticulierController, type: :controller do
context 'when code is not correct' do
before do
allow(FranceConnectService).to receive(:retrieve_user_informations_particulier) { raise Rack::OAuth2::Client::Error.new(500, error: 'Unknown') }
- get :callback, code: code
+ get :callback, params: {code: code}
end
it 'redirect to login page' do
@@ -134,7 +134,7 @@ describe FranceConnect::ParticulierController, type: :controller do
let(:france_connect_information_id) { france_connect_information.id }
let(:salt) { FranceConnectSaltService.new(france_connect_information).salt }
- subject { post :check_email, fci_id: france_connect_information_id, salt: salt, user: {email_france_connect: email} }
+ subject { post :check_email, params: {fci_id: france_connect_information_id, salt: salt, user: {email_france_connect: email}} }
context 'when salt and fci_id does not matches' do
let(:france_connect_information_fake) { create(:france_connect_information, france_connect_particulier_id: 'iugfjh') }
@@ -177,7 +177,7 @@ describe FranceConnect::ParticulierController, type: :controller do
subject
end
- subject { post :check_email, fci_id: france_connect_information_id, salt: salt, user: {email_france_connect: email, password: password} }
+ subject { post :check_email, params: {fci_id: france_connect_information_id, salt: salt, user: {email_france_connect: email, password: password}} }
context 'when email and password couple is valid' do
it { expect { subject }.not_to change { User.count } }
@@ -205,7 +205,7 @@ describe FranceConnect::ParticulierController, type: :controller do
let(:france_connect_information_id) { france_connect_information.id }
let(:salt) { FranceConnectSaltService.new(france_connect_information).salt }
- subject { post :create, fci_id: france_connect_information_id, salt: salt, user:{email_france_connect: france_connect_information.email_france_connect} }
+ subject { post :create, params: {fci_id: france_connect_information_id, salt: salt, user: {email_france_connect: france_connect_information.email_france_connect}} }
context 'when email is filled' do
let(:email) { 'plop@gmail.com' }
@@ -218,7 +218,7 @@ describe FranceConnect::ParticulierController, type: :controller do
let(:email) { '' }
it { expect { subject }.not_to change { User.count } }
- it { expect(subject).to redirect_to(france_connect_particulier_new_path(fci_id: france_connect_information_id, salt: salt, user:{email_france_connect: france_connect_information.email_france_connect})) }
+ it { expect(subject).to redirect_to(france_connect_particulier_new_path(fci_id: france_connect_information_id, salt: salt, user: {email_france_connect: france_connect_information.email_france_connect})) }
end
end
end
diff --git a/spec/controllers/gestionnaires/passwords_controller_spec.rb b/spec/controllers/gestionnaires/passwords_controller_spec.rb
index c094f606e..257109531 100644
--- a/spec/controllers/gestionnaires/passwords_controller_spec.rb
+++ b/spec/controllers/gestionnaires/passwords_controller_spec.rb
@@ -9,22 +9,33 @@ describe Gestionnaires::PasswordsController, type: :controller do
context "unified login" do
let(:gestionnaire) { create(:gestionnaire, email: 'unique@plop.com', password: 'password') }
let(:user) { create(:user, email: 'unique@plop.com', password: 'password') }
+ let(:administrateur) { create(:administrateur, email: 'unique@plop.com', password: 'password') }
before do
- allow(Features).to receive(:unified_login).and_return(true)
@token = gestionnaire.send(:set_reset_password_token)
user # make sure it's created
+ administrateur # make sure it's created
end
it "also signs user in" do
- put :update, gestionnaire: {
+ put :update, params: {gestionnaire: {
reset_password_token: @token,
password: "supersecret",
password_confirmation: "supersecret",
- }
+ }}
expect(subject.current_gestionnaire).to eq(gestionnaire)
expect(subject.current_user).to eq(user)
end
+
+ it "also signs administrateur in" do
+ put :update, params: {gestionnaire: {
+ reset_password_token: @token,
+ password: "supersecret",
+ password_confirmation: "supersecret",
+ }}
+ expect(subject.current_administrateur).to eq(administrateur)
+ expect(subject.current_user).to eq(user)
+ end
end
end
end
diff --git a/spec/controllers/gestionnaires/sessions_controller_spec.rb b/spec/controllers/gestionnaires/sessions_controller_spec.rb
index 6bc0cead1..c01483e41 100644
--- a/spec/controllers/gestionnaires/sessions_controller_spec.rb
+++ b/spec/controllers/gestionnaires/sessions_controller_spec.rb
@@ -6,14 +6,23 @@ describe Gestionnaires::SessionsController, type: :controller do
end
describe '.demo' do
- context 'when server is on env production' do
+ subject { get :demo }
+
+ context 'when rails env is production' do
before do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
end
- subject { get :demo }
- it { expect(subject).to redirect_to root_path }
+ it { is_expected.to redirect_to root_path }
+ end
+ context 'when rails env is not production' do
+ it { expect(subject.status).to eq 200 }
+
+ it 'Gestionnaire demo is initiated' do
+ expect(Gestionnaire).to receive(:new).with(email: 'gestionnaire@apientreprise.fr', password: 'password').and_return(Gestionnaire)
+ subject
+ end
end
end
diff --git a/spec/controllers/invites_controller_spec.rb b/spec/controllers/invites_controller_spec.rb
index e528188cd..9f6d38d81 100644
--- a/spec/controllers/invites_controller_spec.rb
+++ b/spec/controllers/invites_controller_spec.rb
@@ -11,7 +11,7 @@ describe InvitesController, type: :controller do
sign_in create(:gestionnaire)
end
- subject { post :create, dossier_id: dossier.id, email: email }
+ subject { post :create, params: {dossier_id: dossier.id, email: email} }
it { expect { subject }.to change(InviteGestionnaire, :count).by(1) }
diff --git a/spec/controllers/ping_controller_spec.rb b/spec/controllers/ping_controller_spec.rb
new file mode 100644
index 000000000..dfa381838
--- /dev/null
+++ b/spec/controllers/ping_controller_spec.rb
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe PingController, type: :controller do
+ describe 'GET #index' do
+
+ subject { get :index }
+
+ it { expect(subject.status).to eq 200 }
+
+ context 'when base is un-plug' do
+
+ before do
+ allow(ActiveRecord::Base).to receive(:connected?).and_return(false)
+ end
+
+ it { expect(subject.status).to eq 500 }
+ end
+ end
+end
\ No newline at end of file
diff --git a/spec/controllers/root_controller_spec.rb b/spec/controllers/root_controller_spec.rb
index a96f202cf..a4d6406fb 100644
--- a/spec/controllers/root_controller_spec.rb
+++ b/spec/controllers/root_controller_spec.rb
@@ -1,7 +1,6 @@
require 'spec_helper'
describe RootController, type: :controller do
-
subject { get :index }
context 'when User is connected' do
@@ -13,11 +12,29 @@ describe RootController, type: :controller do
end
context 'when Gestionnaire is connected' do
+ let(:gestionnaire) { create(:gestionnaire) }
+
before do
- sign_in create(:gestionnaire)
+ sign_in gestionnaire
end
- it { expect(subject).to redirect_to(backoffice_dossiers_path) }
+ context 'when gestionnaire is affect to a procedure' do
+ before do
+ create :assign_to, procedure: (create :procedure), gestionnaire: gestionnaire
+ end
+
+ it { expect(subject).to redirect_to(backoffice_dossiers_procedure_path(id: Procedure.all.first.id)) }
+ end
+
+ context 'when gestionnaire is not affect to a procedure' do
+ render_views
+
+ before do
+ subject
+ end
+
+ it { expect(response.body).to have_css('#landing') }
+ end
end
context 'when Administrateur is connected' do
@@ -45,13 +62,11 @@ describe RootController, type: :controller do
render_views
before do
- allow(Features).to receive(:unified_login).and_return(true)
subject
end
it "won't have gestionnaire login link" do
expect(response.body).to have_css("a[href='#{new_user_session_path}']")
- expect(response.body).to_not have_css("a[href='#{new_gestionnaire_session_path}']")
end
end
end
diff --git a/spec/controllers/users/carte_controller_shared_example.rb b/spec/controllers/users/carte_controller_shared_example.rb
index eaacbddab..438964660 100644
--- a/spec/controllers/users/carte_controller_shared_example.rb
+++ b/spec/controllers/users/carte_controller_shared_example.rb
@@ -7,10 +7,10 @@ shared_examples 'carte_controller_spec' do
dossier.state = 'validated'
dossier.save
- get :show, dossier_id: dossier.id
+ get :show, params: {dossier_id: dossier.id}
end
- it { is_expected.to redirect_to root_path}
+ it { is_expected.to redirect_to root_path }
end
end
@@ -18,7 +18,7 @@ shared_examples 'carte_controller_spec' do
let(:dossier) { create(:dossier) }
before do
- get :show, dossier_id: dossier.id
+ get :show, params: {dossier_id: dossier.id}
end
it { is_expected.to redirect_to(root_path) }
@@ -31,26 +31,26 @@ shared_examples 'carte_controller_spec' do
end
it 'redirects to users/sign_in' do
- get :show, dossier_id: dossier.id
+ get :show, params: {dossier_id: dossier.id}
expect(response).to redirect_to('/users/sign_in')
end
end
it 'returns http success if carto is activated' do
- get :show, dossier_id: dossier.id
+ get :show, params: {dossier_id: dossier.id}
expect(response).to have_http_status(:success)
end
context 'when procedure not have activate api carto' do
it 'redirection on user dossier list' do
- get :show, dossier_id: dossier_with_no_carto.id
+ get :show, params: {dossier_id: dossier_with_no_carto.id}
expect(response).to redirect_to(root_path)
end
end
context 'when dossier id not exist' do
it 'redirection on user dossier list' do
- get :show, dossier_id: bad_dossier_id
+ get :show, params: {dossier_id: bad_dossier_id}
expect(response).to redirect_to(root_path)
end
end
@@ -61,7 +61,7 @@ shared_examples 'carte_controller_spec' do
describe 'POST #save' do
context 'Aucune localisation n\'a jamais été enregistrée' do
it do
- post :save, dossier_id: dossier.id, json_latlngs: ''
+ post :save, params: {dossier_id: dossier.id, json_latlngs: ''}
expect(response).to redirect_to("/users/dossiers/#{dossier.id}/description")
end
end
@@ -69,7 +69,7 @@ shared_examples 'carte_controller_spec' do
context 'En train de modifier la localisation' do
let(:dossier) { create(:dossier, state: 'initiated') }
before do
- post :save, dossier_id: dossier.id, json_latlngs: ''
+ post :save, params: {dossier_id: dossier.id, json_latlngs: ''}
end
it 'Redirection vers la page récapitulatif' do
@@ -85,7 +85,7 @@ shared_examples 'carte_controller_spec' do
to receive(:to_params).
and_return({"QPCODE1234" => {:code => "QPCODE1234", :nom => "QP de test", :commune => "Paris", :geometry => {:type => "MultiPolygon", :coordinates => [[[[2.38715792094576, 48.8723062632126], [2.38724851642619, 48.8721392348061]]]]}}})
- post :save, dossier_id: dossier.id, json_latlngs: json_latlngs
+ post :save, params: {dossier_id: dossier.id, json_latlngs: json_latlngs}
end
context 'when json_latlngs params is empty' do
@@ -132,7 +132,7 @@ shared_examples 'carte_controller_spec' do
to receive(:to_params).
and_return([{:surface_intersection => "0.0006", :surface_parcelle => 11252.692583090324, :numero => "0013", :feuille => 1, :section => "CD", :code_dep => "30", :nom_com => "Le Grau-du-Roi", :code_com => "133", :code_arr => "000", :geometry => {:type => "MultiPolygon", :coordinates => [[[[4.134084, 43.5209193], [4.1346615, 43.5212035], [4.1346984, 43.521189], [4.135096, 43.5213848], [4.1350839, 43.5214122], [4.1352697, 43.521505], [4.1356278, 43.5211065], [4.1357402, 43.5207188], [4.1350935, 43.5203936], [4.135002, 43.5204366], [4.1346051, 43.5202412], [4.134584, 43.5202472], [4.1345572, 43.5202551], [4.134356, 43.5203137], [4.1342488, 43.5203448], [4.134084, 43.5209193]]]]}}])
- post :save, dossier_id: dossier.id, json_latlngs: json_latlngs
+ post :save, params: {dossier_id: dossier.id, json_latlngs: json_latlngs}
end
context 'when json_latlngs params is empty' do
@@ -179,6 +179,24 @@ shared_examples 'carte_controller_spec' do
end
describe '#get_position' do
+
+ context 'when etablissement is nil' do
+ before do
+ dossier.update etablissement: nil
+
+ stub_request(:get, /http:\/\/api-adresse[.]data[.]gouv[.]fr\/search[?]limit=1&q=/)
+ .to_return(status: 200, body: '{"query": "babouba", "version": "draft", "licence": "ODbL 1.0", "features": [], "type": "FeatureCollection", "attribution": "BAN"}', headers: {})
+ get :get_position, params: {dossier_id: dossier.id}
+ end
+
+ subject { JSON.parse(response.body) }
+
+ it 'on enregistre des coordonnées lat et lon avec les valeurs par defaut' do
+ expect(subject['lat']).to eq('46.538192')
+ expect(subject['lon']).to eq('2.428462')
+ end
+ end
+
context 'Geocodeur renvoie les positions par defaut' do
let(:etablissement) { create(:etablissement, adresse: bad_adresse, numero_voie: 'dzj', type_voie: 'fzjfk', nom_voie: 'hdidjkz', complement_adresse: 'fjef', code_postal: 'fjeiefk', localite: 'zjfkfz') }
let(:dossier) { create(:dossier, etablissement: etablissement) }
@@ -186,7 +204,7 @@ shared_examples 'carte_controller_spec' do
before do
stub_request(:get, /http:\/\/api-adresse[.]data[.]gouv[.]fr\/search[?]limit=1&q=/)
.to_return(status: 200, body: '{"query": "babouba", "version": "draft", "licence": "ODbL 1.0", "features": [], "type": "FeatureCollection", "attribution": "BAN"}', headers: {})
- get :get_position, dossier_id: dossier.id
+ get :get_position, params: {dossier_id: dossier.id}
end
subject { JSON.parse(response.body) }
@@ -202,7 +220,7 @@ shared_examples 'carte_controller_spec' do
stub_request(:get, "http://api-adresse.data.gouv.fr/search?limit=1&q=#{adresse}")
.to_return(status: 200, body: '{"query": "50 avenue des champs u00e9lysu00e9es Paris 75008", "version": "draft", "licence": "ODbL 1.0", "features": [{"geometry": {"coordinates": [2.306888, 48.870374], "type": "Point"}, "type": "Feature", "properties": {"city": "Paris", "label": "50 Avenue des Champs u00c9lysu00e9es 75008 Paris", "housenumber": "50", "id": "ADRNIVX_0000000270748251", "postcode": "75008", "name": "50 Avenue des Champs u00c9lysu00e9es", "citycode": "75108", "context": "75, u00cele-de-France", "score": 0.9054545454545454, "type": "housenumber"}}], "type": "FeatureCollection", "attribution": "BAN"}', headers: {})
- get :get_position, dossier_id: dossier.id
+ get :get_position, params: {dossier_id: dossier.id}
end
subject { JSON.parse(response.body) }
@@ -230,7 +248,7 @@ shared_examples 'carte_controller_spec' do
to receive(:to_params).
and_return({"QPCODE1234" => {:code => "QPCODE1234", :geometry => {:type => "MultiPolygon", :coordinates => [[[[2.38715792094576, 48.8723062632126], [2.38724851642619, 48.8721392348061]]]]}}})
- post :get_qp, dossier_id: dossier.id, coordinates: coordinates
+ post :get_qp, params: {dossier_id: dossier.id, coordinates: coordinates}
end
context 'when coordinates are empty' do
diff --git a/spec/controllers/users/commentaires_controller_spec.rb b/spec/controllers/users/commentaires_controller_spec.rb
index 58d4bf6f3..b03cc9225 100644
--- a/spec/controllers/users/commentaires_controller_spec.rb
+++ b/spec/controllers/users/commentaires_controller_spec.rb
@@ -14,7 +14,7 @@ describe Users::CommentairesController, type: :controller do
context 'création correct d\'un commentaire' do
subject do
sign_in dossier.user
- post :create, dossier_id: dossier_id, texte_commentaire: texte_commentaire
+ post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire}
end
it 'depuis la page récapitulatif' do
@@ -28,14 +28,18 @@ describe Users::CommentairesController, type: :controller do
subject
end
+
+ it 'Notification interne is create' do
+ expect { subject }.to change(Notification, :count).by (1)
+ end
end
- context 'when document is upload whith a commentaire', vcr: { cassette_name: 'controllers_sers_commentaires_controller_upload_doc' } do
+ context 'when document is upload whith a commentaire', vcr: {cassette_name: 'controllers_sers_commentaires_controller_upload_doc'} do
let(:document_upload) { Rack::Test::UploadedFile.new("./spec/support/files/piece_justificative_0.pdf", 'application/pdf') }
subject do
sign_in dossier.user
- post :create, dossier_id: dossier_id, texte_commentaire: texte_commentaire, piece_justificative: {content: document_upload}
+ post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire, piece_justificative: {content: document_upload}}
end
it 'create a new piece justificative' do
@@ -84,7 +88,7 @@ describe Users::CommentairesController, type: :controller do
sign_in dossier.user
dossier.replied!
- post :create, dossier_id: dossier_id, texte_commentaire: texte_commentaire
+ post :create, params: {dossier_id: dossier_id, texte_commentaire: texte_commentaire}
dossier.reload
end
diff --git a/spec/controllers/users/description_controller_shared_example.rb b/spec/controllers/users/description_controller_shared_example.rb
index 22f170dbd..c08c8bbd2 100644
--- a/spec/controllers/users/description_controller_shared_example.rb
+++ b/spec/controllers/users/description_controller_shared_example.rb
@@ -9,7 +9,7 @@ shared_examples 'description_controller_spec' do
end
it 'redirects to users/sign_in' do
- get :show, dossier_id: dossier_id
+ get :show, params: {dossier_id: dossier_id}
expect(response).to redirect_to('/users/sign_in')
end
end
@@ -20,13 +20,15 @@ shared_examples 'description_controller_spec' do
end
it 'returns http success' do
- get :show, dossier_id: dossier_id
+ get :show, params: {dossier_id: dossier_id}
expect(response).to have_http_status(:success)
end
end
it 'redirection vers start si mauvais dossier ID' do
- get :show, dossier_id: bad_dossier_id
+ get :show, params: {dossier_id: bad_dossier_id}
+
+ expect(flash[:alert]).to be_present
expect(response).to redirect_to(root_path)
end
@@ -38,7 +40,7 @@ shared_examples 'description_controller_spec' do
dossier.state = 'validated'
dossier.save
- get :show, dossier_id: dossier.id
+ get :show, params: {dossier_id: dossier.id}
end
it { is_expected.to redirect_to root_path }
@@ -46,7 +48,7 @@ shared_examples 'description_controller_spec' do
end
describe 'before action check_autorisation_donnees' do
- subject { get :show, dossier_id: dossier_id }
+ subject { get :show, params: {dossier_id: dossier_id} }
context 'when dossier does not have a valid autorisations_donness (nil)' do
before do
@@ -66,7 +68,7 @@ shared_examples 'description_controller_spec' do
end
describe 'before action check_starter_dossier_informations' do
- subject { get :show, dossier_id: dossier_id }
+ subject { get :show, params: {dossier_id: dossier_id} }
context 'when dossier does not have an enterprise datas' do
before do
@@ -96,7 +98,7 @@ shared_examples 'description_controller_spec' do
describe 'Premier enregistrement des données' do
let(:submit) { {nouveaux: 'nouveaux'} }
- subject { post :create, dossier_id: dossier_id, submit: submit }
+ subject { post :create, params: {dossier_id: dossier_id, submit: submit} }
before do
dossier.draft!
@@ -128,7 +130,7 @@ shared_examples 'description_controller_spec' do
context 'En train de manipuler un dossier non brouillon' do
before do
dossier.initiated!
- post :create, dossier_id: dossier_id
+ post :create, params: {dossier_id: dossier_id}
dossier.reload
end
@@ -143,10 +145,17 @@ shared_examples 'description_controller_spec' do
end
context 'Quand la procédure accepte les CERFA' do
+ subject { post :create, params: {dossier_id: dossier_id,
+ cerfa_pdf: cerfa_pdf} }
+
+ it 'Notification interne is create' do
+ expect { subject }.to change(Notification, :count).by (1)
+ end
+
context 'Sauvegarde du CERFA PDF', vcr: {cassette_name: 'controllers_users_description_controller_save_cerfa'} do
before do
- post :create, dossier_id: dossier_id,
- cerfa_pdf: cerfa_pdf
+ post :create, params: {dossier_id: dossier_id,
+ cerfa_pdf: cerfa_pdf}
dossier.reload
end
@@ -172,7 +181,7 @@ shared_examples 'description_controller_spec' do
let(:cerfas) { Cerfa.where(dossier_id: dossier_id) }
before do
- post :create, dossier_id: dossier_id, cerfa_pdf: cerfa_pdf
+ post :create, params: {dossier_id: dossier_id, cerfa_pdf: cerfa_pdf}
end
it "il y a deux CERFA PDF pour ce dossier" do
@@ -186,8 +195,8 @@ shared_examples 'description_controller_spec' do
context 'Sauvegarde du CERFA PDF' do
let!(:procedure) { create(:procedure) }
before do
- post :create, dossier_id: dossier_id,
- cerfa_pdf: cerfa_pdf
+ post :create, params: {dossier_id: dossier_id,
+ cerfa_pdf: cerfa_pdf}
dossier.reload
end
@@ -205,17 +214,17 @@ shared_examples 'description_controller_spec' do
let(:dossier_minute_value) { '00' }
before do
- post :create, {dossier_id: dossier_id,
- champs: {
- "'#{dossier.champs.first.id}'" => dossier_champs_first,
- "'#{dossier.champs.second.id}'" => dossier_date_value
- },
- time_hour: {
- "'#{dossier.champs.second.id}'" => dossier_hour_value,
- },
- time_minute: {
- "'#{dossier.champs.second.id}'" => dossier_minute_value,
- }
+ post :create, params: {dossier_id: dossier_id,
+ champs: {
+ "'#{dossier.champs.first.id}'" => dossier_champs_first,
+ "'#{dossier.champs.second.id}'" => dossier_date_value
+ },
+ time_hour: {
+ "'#{dossier.champs.second.id}'" => dossier_hour_value,
+ },
+ time_minute: {
+ "'#{dossier.champs.second.id}'" => dossier_minute_value,
+ }
}
dossier.reload
end
@@ -245,9 +254,9 @@ shared_examples 'description_controller_spec' do
context 'Sauvegarde des pièces justificatives', vcr: {cassette_name: 'controllers_users_description_controller_sauvegarde_pj'} do
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
before do
- post :create, {dossier_id: dossier_id,
- 'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
- 'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
+ post :create, params: {dossier_id: dossier_id,
+ 'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
+ 'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
dossier.reload
end
@@ -255,9 +264,9 @@ shared_examples 'description_controller_spec' do
it 'ClamavService safe_file? is call' do
expect(ClamavService).to receive(:safe_file?).twice
- post :create, {dossier_id: dossier_id,
- 'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
- 'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
+ post :create, params: {dossier_id: dossier_id,
+ 'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
+ 'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
end
end
@@ -277,9 +286,9 @@ shared_examples 'description_controller_spec' do
describe 'POST #pieces_justificatives', vcr: {cassette_name: 'controllers_users_description_controller_pieces_justificatives'} do
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
- subject { patch :pieces_justificatives, {dossier_id: dossier.id,
- 'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
- 'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1} }
+ subject { patch :pieces_justificatives, params: {dossier_id: dossier.id,
+ 'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
+ 'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1} }
context 'when user is a guest' do
let(:guest) { create :user }
@@ -290,6 +299,10 @@ shared_examples 'description_controller_spec' do
sign_in guest
end
+ it 'Notification interne is create' do
+ expect { subject }.to change(Notification, :count).by (1)
+ end
+
context 'when PJ have no documents' do
it { expect(dossier.pieces_justificatives.size).to eq 0 }
@@ -348,9 +361,9 @@ end
shared_examples 'description_controller_spec_POST_piece_justificatives_for_owner' do
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
- subject { patch :pieces_justificatives, {dossier_id: dossier.id,
- 'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
- 'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1} }
+ subject { patch :pieces_justificatives, params: {dossier_id: dossier.id,
+ 'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
+ 'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1} }
context 'when user is the owner', vcr: {cassette_name: 'controllers_users_description_controller_pieces_justificatives'} do
before do
diff --git a/spec/controllers/users/description_controller_spec.rb b/spec/controllers/users/description_controller_spec.rb
index b459d6341..ace2b9f1b 100644
--- a/spec/controllers/users/description_controller_spec.rb
+++ b/spec/controllers/users/description_controller_spec.rb
@@ -7,7 +7,7 @@ describe Users::DescriptionController, type: :controller, vcr: {cassette_name: '
let(:invite_by_user) { create :user, email: 'invite@plop.com' }
let(:procedure) { create(:procedure, :with_two_type_de_piece_justificative, :with_type_de_champ, :with_datetime, cerfa_flag: true) }
- let(:dossier) { create(:dossier, procedure: procedure, user: owner_user) }
+ let(:dossier) { create(:dossier, procedure: procedure, user: owner_user, state: 'initiated') }
let(:dossier_id) { dossier.id }
let(:bad_dossier_id) { Dossier.count + 10000 }
diff --git a/spec/controllers/users/dossiers/add_siret_controller_spec.rb b/spec/controllers/users/dossiers/add_siret_controller_spec.rb
index 44083e035..45962c0fc 100644
--- a/spec/controllers/users/dossiers/add_siret_controller_spec.rb
+++ b/spec/controllers/users/dossiers/add_siret_controller_spec.rb
@@ -9,7 +9,7 @@ describe Users::Dossiers::AddSiretController, type: :controller do
sign_in dossier.user
end
- subject { get :show, dossier_id: dossier.id }
+ subject { get :show, params:{dossier_id: dossier.id }}
context 'when dossier is not attached at a procedure with individual siret attribut' do
it { is_expected.to redirect_to users_dossiers_path }
diff --git a/spec/controllers/users/dossiers/commentaires_controller_spec.rb b/spec/controllers/users/dossiers/commentaires_controller_spec.rb
index 76abacf2d..871da0722 100644
--- a/spec/controllers/users/dossiers/commentaires_controller_spec.rb
+++ b/spec/controllers/users/dossiers/commentaires_controller_spec.rb
@@ -12,7 +12,7 @@ describe Users::Dossiers::CommentairesController, type: :controller do
sign_in invite.user
dossier.replied!
- post :create, dossier_id: dossier.id, texte_commentaire: texte_commentaire
+ post :create, params:{dossier_id: dossier.id, texte_commentaire: texte_commentaire}
dossier.reload
end
diff --git a/spec/controllers/users/dossiers/invites_controller_spec.rb b/spec/controllers/users/dossiers/invites_controller_spec.rb
index 7b7b60beb..e2d71450a 100644
--- a/spec/controllers/users/dossiers/invites_controller_spec.rb
+++ b/spec/controllers/users/dossiers/invites_controller_spec.rb
@@ -1,6 +1,4 @@
-RSpec.describe Users::Dossiers::InvitesController, type: :controller do
-
-
+describe Users::Dossiers::InvitesController, type: :controller do
describe '#authenticate_user!' do
let(:user) { create :user }
let(:invite) { create :invite }
@@ -8,7 +6,7 @@ RSpec.describe Users::Dossiers::InvitesController, type: :controller do
context 'when email is not set' do
context 'when user is not connected' do
before do
- get :show, id: invite.id
+ get :show, params: {id: invite.id}
end
it { is_expected.to redirect_to new_user_session_path }
@@ -20,7 +18,7 @@ RSpec.describe Users::Dossiers::InvitesController, type: :controller do
before do
sign_in invite.user
- get :show, id: invite.id
+ get :show, params: {id: invite.id}
end
# it { expect(response.status).to eq 200 }
@@ -29,7 +27,7 @@ RSpec.describe Users::Dossiers::InvitesController, type: :controller do
context 'when email is set' do
before do
- get :show, id: invite.id, email: email
+ get :show, params: {id: invite.id, email: email}
end
context 'when email is blank' do
@@ -53,4 +51,28 @@ RSpec.describe Users::Dossiers::InvitesController, type: :controller do
end
end
end
+
+ describe '#GET show' do
+ let(:user) { create :user }
+
+ let(:invite) { create :invite, email: email, dossier: (create :dossier) }
+
+ subject { get :show, params: {id: invite.id} }
+
+ before do
+ sign_in user
+ end
+
+ context 'when invitation ID is attach at the user email account' do
+ let(:email) { user.email }
+ it { expect(subject.status).to eq 200 }
+ end
+
+ context 'when invitation ID is not attach at the user email account' do
+ let(:email) { 'fake@email.com' }
+
+ it { expect(subject.status).to eq 302 }
+ it { is_expected.to redirect_to users_dossiers_path }
+ end
+ end
end
\ No newline at end of file
diff --git a/spec/controllers/users/dossiers_controller_spec.rb b/spec/controllers/users/dossiers_controller_spec.rb
index 9bdb158de..83cc615f3 100644
--- a/spec/controllers/users/dossiers_controller_spec.rb
+++ b/spec/controllers/users/dossiers_controller_spec.rb
@@ -27,12 +27,12 @@ describe Users::DossiersController, type: :controller do
sign_in dossier.user
end
it 'returns http success with dossier_id valid' do
- get :show, id: dossier_id
+ get :show, params: {id: dossier_id}
expect(response).to have_http_status(:success)
end
it 'redirection vers liste dossier si mauvais dossier ID' do
- get :show, id: siret_not_found
+ get :show, params: {id: siret_not_found}
expect(response).to redirect_to root_path
end
@@ -42,7 +42,7 @@ describe Users::DossiersController, type: :controller do
dossier.state = 'validated'
dossier.save
- get :show, id: dossier.id
+ get :show, params: {id: dossier.id}
end
it { is_expected.to redirect_to root_path }
@@ -51,7 +51,7 @@ describe Users::DossiersController, type: :controller do
end
describe 'GET #new' do
- subject { get :new, procedure_id: procedure_id }
+ subject { get :new, params: {procedure_id: procedure_id} }
context 'when params procedure_id is present' do
context 'when procedure_id is valid' do
@@ -69,7 +69,7 @@ describe Users::DossiersController, type: :controller do
context 'when user have not a saved siret' do
context 'when siret is present on request' do
- subject { get :new, procedure_id: procedure_id, siret: siret }
+ subject { get :new, params: {procedure_id: procedure_id, siret: siret} }
before do
subject
@@ -97,7 +97,7 @@ describe Users::DossiersController, type: :controller do
end
context 'when siret is present on request' do
- subject { get :new, procedure_id: procedure_id, siret: siret }
+ subject { get :new, params: {procedure_id: procedure_id, siret: siret} }
before do
subject
@@ -153,7 +153,7 @@ describe Users::DossiersController, type: :controller do
end
describe 'GET #commencer' do
- subject { get :commencer, procedure_path: procedure.path }
+ subject { get :commencer, params: {procedure_path: procedure.path} }
it { expect(subject.status).to eq 302 }
it { expect(subject).to redirect_to new_users_dossier_path(procedure_id: procedure.id) }
@@ -198,7 +198,7 @@ describe Users::DossiersController, type: :controller do
sign_in user
end
- subject { post :siret_informations, dossier_id: dossier.id, dossier: {siret: example_siret} }
+ subject { post :siret_informations, params: {dossier_id: dossier.id, dossier: {siret: example_siret}} }
it 'create a dossier' do
expect { subject }.to change { Dossier.count }.by(0)
@@ -322,7 +322,7 @@ describe Users::DossiersController, type: :controller do
end
let(:siret_not_found) { '11111111111111' }
- subject { post :siret_informations, dossier_id: dossier.id, dossier: {siret: siret_not_found} }
+ subject { post :siret_informations, params: {dossier_id: dossier.id, dossier: {siret: siret_not_found}} }
it 'does not create new dossier' do
expect { subject }.not_to change { Dossier.count }
@@ -337,7 +337,7 @@ describe Users::DossiersController, type: :controller do
context 'when REST error 400 is return' do
let(:status_entreprise_call) { 400 }
- subject { post :siret_informations, dossier_id: dossier.id, dossier: {siret: siret} }
+ subject { post :siret_informations, params: {dossier_id: dossier.id, dossier: {siret: siret}} }
before do
sign_in user
@@ -350,13 +350,30 @@ describe Users::DossiersController, type: :controller do
end
describe 'PUT #update' do
- subject { put :update, id: dossier_id, dossier: {id: dossier_id, autorisation_donnees: autorisation_donnees} }
+ let(:params) { {id: dossier_id, dossier: {id: dossier_id, autorisation_donnees: autorisation_donnees}} }
+ subject { put :update, params: params }
before do
sign_in dossier.user
subject
end
+ context 'when procedure is for individual' do
+ let(:params) { {id: dossier_id, dossier: {id: dossier_id, autorisation_donnees: '1', individual_attributes: individual_params}} }
+ let(:individual_params) { {gender: 'Mr', nom: 'Julien', prenom: 'Xavier', birthdate: '20/01/1991'} }
+ let(:procedure) { create(:procedure, :published, for_individual: true) }
+
+ before do
+ dossier.reload
+ end
+
+ it { expect(dossier.individual.gender).to eq 'Mr' }
+ it { expect(dossier.individual.nom).to eq 'Julien' }
+ it { expect(dossier.individual.prenom).to eq 'Xavier' }
+ it { expect(dossier.individual.birthdate).to eq '20/01/1991' }
+ it { expect(dossier.procedure.for_individual).to eq true }
+ end
+
context 'when Checkbox is checked' do
let(:autorisation_donnees) { '1' }
@@ -399,11 +416,11 @@ describe Users::DossiersController, type: :controller do
end
describe 'DELETE #destroy' do
- let(:user) { create(:user) }
- let!(:dossier_draft) { create :dossier, state: "draft", user: user }
+ let(:user) { create(:user) }
+ let!(:dossier_draft) { create :dossier, state: "draft", user: user }
let!(:dossier_not_draft) { create :dossier, state: "initiated", user: user }
- subject { delete :destroy, id: dossier.id }
+ subject { delete :destroy, params: {id: dossier.id} }
before do
sign_in user
@@ -441,7 +458,7 @@ describe Users::DossiersController, type: :controller do
describe 'PUT #change_siret' do
let(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure) }
- subject { put :change_siret, dossier_id: dossier.id }
+ subject { put :change_siret, params: {dossier_id: dossier.id} }
before do
sign_in user
@@ -462,7 +479,7 @@ describe Users::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :a_traiter
+ get :index, params: {liste: :a_traiter}
expect(response).to have_http_status(200)
end
end
@@ -475,7 +492,7 @@ describe Users::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :valides
+ get :index, params: {liste: :valides}
expect(response).to have_http_status(200)
end
end
@@ -488,7 +505,7 @@ describe Users::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :en_instruction
+ get :index, params: {liste: :en_instruction}
expect(response).to have_http_status(200)
end
end
@@ -501,7 +518,7 @@ describe Users::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :brouillon
+ get :index, params: {liste: :brouillon}
expect(response).to have_http_status(200)
end
end
@@ -514,7 +531,7 @@ describe Users::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :termine
+ get :index, params: {liste: :termine}
expect(response).to have_http_status(200)
end
end
@@ -527,7 +544,7 @@ describe Users::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :invite
+ get :index, params: {liste: :invite}
expect(response).to have_http_status(200)
end
end
@@ -540,7 +557,7 @@ describe Users::DossiersController, type: :controller do
end
it 'returns http success' do
- get :index, liste: :list_fake
+ get :index, params: {liste: :list_fake}
expect(response).to redirect_to(users_dossiers_path)
end
end
diff --git a/spec/controllers/users/passwords_controller_spec.rb b/spec/controllers/users/passwords_controller_spec.rb
index 83d877b4e..37a8f18e6 100644
--- a/spec/controllers/users/passwords_controller_spec.rb
+++ b/spec/controllers/users/passwords_controller_spec.rb
@@ -9,22 +9,33 @@ describe Users::PasswordsController, type: :controller do
context "unified login" do
let(:user) { create(:user, email: 'unique@plop.com', password: 'password') }
let(:gestionnaire) { create(:gestionnaire, email: 'unique@plop.com', password: 'password') }
+ let(:administrateur) { create(:administrateur, email: 'unique@plop.com', password: 'password') }
before do
- allow(Features).to receive(:unified_login).and_return(true)
@token = user.send(:set_reset_password_token)
gestionnaire # make sure it's created
+ administrateur # make sure it's created
end
it "also signs gestionnaire in" do
- put :update, user: {
- reset_password_token: @token,
- password: "supersecret",
- password_confirmation: "supersecret",
- }
+ put :update, params: {user: {
+ reset_password_token: @token,
+ password: "supersecret",
+ password_confirmation: "supersecret",
+ }}
expect(subject.current_user).to eq(user)
expect(subject.current_gestionnaire).to eq(gestionnaire)
end
+
+ it "also signs administrateur in" do
+ put :update, params: {user: {
+ reset_password_token: @token,
+ password: "supersecret",
+ password_confirmation: "supersecret",
+ }}
+ expect(subject.current_user).to eq(user)
+ expect(subject.current_administrateur).to eq(administrateur)
+ end
end
end
end
diff --git a/spec/controllers/users/recapitulatif_controller_spec.rb b/spec/controllers/users/recapitulatif_controller_spec.rb
index 79402c694..3cbbe1696 100644
--- a/spec/controllers/users/recapitulatif_controller_spec.rb
+++ b/spec/controllers/users/recapitulatif_controller_spec.rb
@@ -10,12 +10,12 @@ describe Users::RecapitulatifController, type: :controller do
describe 'GET #show' do
it 'returns http success' do
- get :show, dossier_id: dossier.id
+ get :show, params: {dossier_id: dossier.id}
expect(response).to have_http_status(:success)
end
it 'redirection vers siret si mauvais dossier ID' do
- get :show, dossier_id: bad_dossier_id
+ get :show, params: {dossier_id: bad_dossier_id}
expect(response).to redirect_to('/')
end
@@ -27,7 +27,7 @@ describe Users::RecapitulatifController, type: :controller do
dossier.state = 'draft'
dossier.save
- get :show, dossier_id: dossier.id
+ get :show, params: {dossier_id: dossier.id}
end
it { is_expected.to redirect_to root_path }
@@ -39,7 +39,7 @@ describe Users::RecapitulatifController, type: :controller do
describe 'POST #initiate' do
context 'when an user initiate his dossier' do
before do
- post :initiate, dossier_id: dossier.id
+ post :initiate, params: {dossier_id: dossier.id}
end
it 'dossier change his state for closed' do
@@ -59,7 +59,7 @@ describe Users::RecapitulatifController, type: :controller do
before do
dossier.validated!
- Timecop.freeze(deposit_datetime) { post :submit, dossier_id: dossier.id }
+ Timecop.freeze(deposit_datetime) { post :submit, params: {dossier_id: dossier.id} }
dossier.reload
end
@@ -80,10 +80,12 @@ describe Users::RecapitulatifController, type: :controller do
expect(NotificationMailer).to receive(:deliver_now!)
dossier.validated!
- post :submit, dossier_id: dossier.id
+ post :submit, params: {dossier_id: dossier.id}
end
+ it 'Internal notification is created' do
+ expect(Notification.where(dossier_id: dossier.id, type_notif: 'submitted').first).not_to be_nil
+ end
end
end
-
end
diff --git a/spec/controllers/users/registrations_controller_spec.rb b/spec/controllers/users/registrations_controller_spec.rb
index 89a5ea952..e65f10a98 100644
--- a/spec/controllers/users/registrations_controller_spec.rb
+++ b/spec/controllers/users/registrations_controller_spec.rb
@@ -12,7 +12,7 @@ describe Users::RegistrationsController, type: :controller do
end
describe '.create' do
- subject { post :create, user: user }
+ subject { post :create, params: {user: user }}
context 'when user is correct' do
it { expect(described_class).to be < Devise::RegistrationsController }
diff --git a/spec/controllers/users/sessions_controller_spec.rb b/spec/controllers/users/sessions_controller_spec.rb
index 1f51dc107..ebfb037b7 100644
--- a/spec/controllers/users/sessions_controller_spec.rb
+++ b/spec/controllers/users/sessions_controller_spec.rb
@@ -9,14 +9,23 @@ describe Users::SessionsController, type: :controller do
end
describe '.demo' do
- context 'when server is on env production' do
+ subject { get :demo }
+
+ context 'when rails env is production' do
before do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
end
- subject { get :demo }
- it { expect(subject).to redirect_to root_path }
+ it { is_expected.to redirect_to root_path }
+ end
+ context 'when rails env is not production' do
+ it { expect(subject.status).to eq 200 }
+
+ it 'User demo is initiated' do
+ expect(User).to receive(:new).with(email: 'demo@tps.fr', password: 'password').and_return(User)
+ subject
+ end
end
end
@@ -25,7 +34,7 @@ describe Users::SessionsController, type: :controller do
describe 'France Connect attribut' do
before do
- post :create, user: {email: user.email, password: user.password}
+ post :create, params: {user: {email: user.email, password: user.password}}
user.reload
end
@@ -35,38 +44,61 @@ describe Users::SessionsController, type: :controller do
end
context "unified login" do
- let(:user) { create(:user, email: 'unique@plop.com', password: 'password') }
- let(:gestionnaire) { create(:gestionnaire, email: 'unique@plop.com', password: 'password') }
- before { allow(Features).to receive(:unified_login).and_return(true) }
+ let(:email) { 'unique@plop.com' }
+ let(:password) { 'password' }
+
+ let(:user) { create(:user, email: email, password: password) }
+ let(:gestionnaire) { create(:gestionnaire, email: email, password: password) }
+ let(:administrateur) { create(:administrateur, email: email, password: password) }
it 'signs user in' do
- post :create, user: { email: user.email, password: user.password }
+ post :create, params: {user: {email: user.email, password: user.password}}
expect(@response.redirect?).to be(true)
expect(subject.current_user).to eq(user)
expect(subject.current_gestionnaire).to be(nil)
+ expect(subject.current_administrateur).to be(nil)
expect(user.reload.loged_in_with_france_connect).to be(nil)
end
it 'signs gestionnaire in' do
- post :create, user: { email: gestionnaire.email, password: gestionnaire.password }
+ post :create, params: {user: {email: gestionnaire.email, password: gestionnaire.password}}
expect(@response.redirect?).to be(true)
expect(subject.current_user).to be(nil)
expect(subject.current_gestionnaire).to eq(gestionnaire)
+ expect(subject.current_administrateur).to be(nil)
end
- it 'signs user + gestionnaire in' do
- post :create, user: { email: user.email, password: gestionnaire.password }
+ it 'signs administrateur in' do
+ post :create, params: {user: {email: administrateur.email, password: administrateur.password}}
expect(@response.redirect?).to be(true)
- expect(subject.current_user).to eq(user)
- expect(subject.current_gestionnaire).to eq(gestionnaire)
- expect(user.reload.loged_in_with_france_connect).to be(nil)
+ expect(subject.current_user).to be(nil)
+ expect(subject.current_gestionnaire).to be(nil)
+ expect(subject.current_administrateur).to eq(administrateur)
end
+ context {
+ before do
+ user
+ gestionnaire
+ end
+
+ it 'signs user + gestionnaire + administrateur in' do
+
+ post :create, params: {user: {email: administrateur.email, password: administrateur.password}}
+ expect(@response.redirect?).to be(true)
+ expect(subject.current_user).to eq(user)
+ expect(subject.current_gestionnaire).to eq(gestionnaire)
+ expect(subject.current_administrateur).to eq(administrateur)
+ expect(user.reload.loged_in_with_france_connect).to be(nil)
+ end
+ }
+
it 'fails to sign in with bad credentials' do
- post :create, user: { email: user.email, password: 'wrong_password' }
+ post :create, params: {user: {email: user.email, password: 'wrong_password'}}
expect(@response.unauthorized?).to be(true)
expect(subject.current_user).to be(nil)
expect(subject.current_gestionnaire).to be(nil)
+ expect(subject.current_administrateur).to be(nil)
end
end
end
@@ -136,6 +168,22 @@ describe Users::SessionsController, type: :controller do
delete :destroy
expect(@response.headers["Location"]).to eq(FRANCE_CONNECT.particulier_logout_endpoint)
end
+
+ context "when associated administrateur" do
+ let(:administrateur) { create(:administrateur, email: 'unique@plop.com', password: 'password') }
+
+ it 'signs user + gestionnaire + administrateur out' do
+ sign_in user
+ sign_in gestionnaire
+ sign_in administrateur
+ delete :destroy
+ expect(@response.redirect?).to be(true)
+ expect(subject.current_user).to be(nil)
+ expect(subject.current_gestionnaire).to be(nil)
+ expect(subject.current_administrateur).to be(nil)
+ end
+ end
+
end
end
@@ -143,7 +191,7 @@ describe Users::SessionsController, type: :controller do
subject { get :new }
context 'when procedure_id is not present in user_return_to session params' do
- it { expect(subject.status).to eq 200}
+ it { expect(subject.status).to eq 200 }
end
context 'when procedure_id is present in user_return_to session params' do
@@ -152,7 +200,7 @@ describe Users::SessionsController, type: :controller do
session["user_return_to"] = '?procedure_id=0'
end
- it { expect(subject.status).to eq 302}
+ it { expect(subject.status).to eq 302 }
it { expect(subject).to redirect_to root_path }
end
@@ -162,7 +210,7 @@ describe Users::SessionsController, type: :controller do
session["user_return_to"] = "?procedure_id=#{procedure.id}"
end
- it { expect(subject.status).to eq 302}
+ it { expect(subject.status).to eq 302 }
it { expect(subject).to redirect_to root_path }
end
@@ -173,7 +221,7 @@ describe Users::SessionsController, type: :controller do
session["user_return_to"] = "?procedure_id=#{procedure.id}"
end
- it { expect(subject.status).to eq 200}
+ it { expect(subject.status).to eq 200 }
end
end
end
diff --git a/spec/controllers/user_controller_shared_example.rb b/spec/controllers/users_controller_shared_example.rb
similarity index 92%
rename from spec/controllers/user_controller_shared_example.rb
rename to spec/controllers/users_controller_shared_example.rb
index efe90eb88..8db590de5 100644
--- a/spec/controllers/user_controller_shared_example.rb
+++ b/spec/controllers/users_controller_shared_example.rb
@@ -1,6 +1,6 @@
shared_examples 'current_user_dossier_spec' do
context 'when no dossier_id is filled' do
- it { expect { subject.current_user_dossier }.to raise_error }
+ it { expect { subject.current_user_dossier }.to raise_error ActiveRecord::RecordNotFound }
end
context 'when dossier_id is given as a param' do
@@ -11,7 +11,7 @@ shared_examples 'current_user_dossier_spec' do
end
context 'when dossier id is incorrect' do
- it { expect { subject.current_user_dossier 1 }.to raise_error }
+ it { expect { subject.current_user_dossier 1 }.to raise_error ActiveRecord::RecordNotFound }
end
end
@@ -27,7 +27,7 @@ shared_examples 'current_user_dossier_spec' do
end
context 'when dossier id is incorrect' do
- it { expect { subject.current_user_dossier }.to raise_error }
+ it { expect { subject.current_user_dossier }.to raise_error ActiveRecord::RecordNotFound }
end
context 'when dossier_id is given as a param' do
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index eee59c898..c04cdf687 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-require 'controllers/user_controller_shared_example'
+require 'controllers/users_controller_shared_example'
describe UsersController, type: :controller do
describe '#current_user_dossier' do
diff --git a/spec/decorators/champ_decorator_spec.rb b/spec/decorators/champ_decorator_spec.rb
new file mode 100644
index 000000000..5d25679ca
--- /dev/null
+++ b/spec/decorators/champ_decorator_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe ChampDecorator do
+ let(:champ) {create :champ, type_de_champ: (create :type_de_champ_public, type_champ: :checkbox)}
+ let(:decorator) { champ.decorate }
+
+ describe 'value' do
+ subject { decorator.value }
+
+ context 'when type_champ is checkbox' do
+
+ context 'when value is on' do
+ before do
+ champ.update value: 'on'
+ end
+
+ it { is_expected.to eq 'Oui' }
+ end
+
+ context 'when value is other' do
+ it { is_expected.to eq 'Non' }
+ end
+ end
+ end
+end
diff --git a/spec/decorators/commentaire_decorator_spec.rb b/spec/decorators/commentaire_decorator_spec.rb
index 22fbda305..94b7be294 100644
--- a/spec/decorators/commentaire_decorator_spec.rb
+++ b/spec/decorators/commentaire_decorator_spec.rb
@@ -1,4 +1,14 @@
require 'spec_helper'
describe CommentaireDecorator do
+ let(:commentaire) { Timecop.freeze(Time.local(2008, 9, 1, 10, 5, 0)) {create :commentaire} }
+ let(:decorator) { commentaire.decorate }
+
+ describe 'created_at_fr' do
+ subject { decorator.created_at_fr }
+
+ context 'when created_at have a value' do
+ it { is_expected.to eq '01/09/2008 - 10:05' }
+ end
+ end
end
diff --git a/spec/decorators/dossier_decorator_spec.rb b/spec/decorators/dossier_decorator_spec.rb
index 1dfef816a..1870683fd 100644
--- a/spec/decorators/dossier_decorator_spec.rb
+++ b/spec/decorators/dossier_decorator_spec.rb
@@ -1,9 +1,14 @@
require 'spec_helper'
describe DossierDecorator do
- let(:dossier) { create(:dossier, updated_at: Time.new(2015, 12, 24, 14, 10)) }
+ let(:dossier) { create(:dossier, created_at: Time.new(2015, 12, 24, 14, 10), updated_at: Time.new(2015, 12, 24, 14, 10)) }
subject { dossier.decorate }
+ describe 'first_creation' do
+ subject { super().first_creation }
+ it { is_expected.to eq('24/12/2015 14:10') }
+ end
+
describe 'last_update' do
subject { super().last_update }
it { is_expected.to eq('24/12/2015 14:10') }
diff --git a/spec/decorators/france_connect_inforation_decorator_spec.rb b/spec/decorators/france_connect_inforation_decorator_spec.rb
new file mode 100644
index 000000000..9d273c487
--- /dev/null
+++ b/spec/decorators/france_connect_inforation_decorator_spec.rb
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe FranceConnectInformationDecorator do
+ let(:gender) { 'female' }
+ let(:france_connect_information) { create :france_connect_information, gender: gender }
+
+ subject { france_connect_information.decorate.gender_fr }
+
+ context 'when france connect user is a male' do
+ let(:gender) { 'male' }
+ it { is_expected.to eq 'Mr' }
+ end
+
+ context 'when france connect user is a female' do
+ it { is_expected.to eq 'Mme' }
+ end
+end
diff --git a/spec/decorators/procedures_decorator_spec.rb b/spec/decorators/procedures_decorator_spec.rb
new file mode 100644
index 000000000..be53606b2
--- /dev/null
+++ b/spec/decorators/procedures_decorator_spec.rb
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe ProceduresDecorator do
+
+ before do
+ create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
+ create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
+ create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
+ end
+
+ let(:procedure) { Procedure.all.paginate(page: 1) }
+
+ subject { procedure.decorate }
+
+ it { expect(subject.current_page).not_to be_nil }
+ it { expect(subject.per_page).not_to be_nil }
+ it { expect(subject.offset).not_to be_nil }
+ it { expect(subject.total_entries).not_to be_nil }
+ it { expect(subject.total_pages).not_to be_nil }
+end
\ No newline at end of file
diff --git a/spec/facades/dossiers_list_facades_spec.rb b/spec/facades/dossiers_list_facades_spec.rb
index 7dcd9a6e0..f10826990 100644
--- a/spec/facades/dossiers_list_facades_spec.rb
+++ b/spec/facades/dossiers_list_facades_spec.rb
@@ -50,10 +50,12 @@ describe DossiersListFacades do
it { expect(subject.first[:id]).to eq procedure.id }
it { expect(subject.first[:libelle]).to eq procedure.libelle }
+ it { expect(subject.first[:unread_notifications]).to eq 0 }
+
it { expect(subject.last[:id]).to eq procedure_2.id }
it { expect(subject.last[:libelle]).to eq procedure_2.libelle }
-
+ it { expect(subject.last[:unread_notifications]).to eq 0 }
end
describe '#active_filter?' do
diff --git a/spec/facades/invite_dossier_facades_spec.rb b/spec/facades/invite_dossier_facades_spec.rb
new file mode 100644
index 000000000..63093b2e9
--- /dev/null
+++ b/spec/facades/invite_dossier_facades_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe InviteDossierFacades do
+
+ let(:dossier) { create :dossier }
+ let(:email) { 'email@octo.com' }
+
+ subject { described_class.new dossier.id, email }
+
+ before do
+ create :invite, email: email, dossier: dossier
+ end
+
+ it { expect(subject.dossier).to eq dossier }
+end
\ No newline at end of file
diff --git a/spec/factories/administration.rb b/spec/factories/administration.rb
new file mode 100644
index 000000000..8313af360
--- /dev/null
+++ b/spec/factories/administration.rb
@@ -0,0 +1,7 @@
+FactoryGirl.define do
+ sequence(:administration_email) { |n| "plop#{n}@plop.com" }
+ factory :administration do
+ email { generate(:administration_email) }
+ password 'password'
+ end
+end
\ No newline at end of file
diff --git a/spec/factories/commentaire.rb b/spec/factories/commentaire.rb
index 791e295db..bb0a148ca 100644
--- a/spec/factories/commentaire.rb
+++ b/spec/factories/commentaire.rb
@@ -1,5 +1,11 @@
FactoryGirl.define do
factory :commentaire do
body 'plop'
+
+ before(:create) do |commentaire, _evaluator|
+ unless commentaire.dossier
+ commentaire.dossier = create :dossier
+ end
+ end
end
end
diff --git a/spec/factories/drop_down_list.rb b/spec/factories/drop_down_list.rb
new file mode 100644
index 000000000..6b81511cf
--- /dev/null
+++ b/spec/factories/drop_down_list.rb
@@ -0,0 +1,5 @@
+FactoryGirl.define do
+ factory :drop_down_list do
+ value ''
+ end
+end
diff --git a/spec/factories/gestionnaire.rb b/spec/factories/gestionnaire.rb
index dcdb76c62..63004f8e9 100644
--- a/spec/factories/gestionnaire.rb
+++ b/spec/factories/gestionnaire.rb
@@ -1,5 +1,5 @@
FactoryGirl.define do
- sequence(:gestionnaire_email) { |n| "plop#{n}@plop.com" }
+ sequence(:gestionnaire_email) { |n| "gest#{n}@plop.com" }
factory :gestionnaire do
email { generate(:gestionnaire_email) }
password 'password'
diff --git a/spec/factories/notification.rb b/spec/factories/notification.rb
new file mode 100644
index 000000000..fe4d8ecd8
--- /dev/null
+++ b/spec/factories/notification.rb
@@ -0,0 +1,12 @@
+FactoryGirl.define do
+ factory :notification do
+ type_notif 'commentaire'
+ liste []
+
+ before(:create) do |notification, _evaluator|
+ unless notification.dossier
+ notification.dossier = create :dossier
+ end
+ end
+ end
+end
diff --git a/spec/factories/procedure.rb b/spec/factories/procedure.rb
index 11cd238b1..740faf5bc 100644
--- a/spec/factories/procedure.rb
+++ b/spec/factories/procedure.rb
@@ -22,6 +22,12 @@ FactoryGirl.define do
end
end
+ trait :for_individual do
+ after(:build) do |procedure, _evaluator|
+ procedure.for_individual = true
+ end
+ end
+
trait :with_type_de_champ do
after(:build) do |procedure, _evaluator|
type_de_champ = create(:type_de_champ_public)
diff --git a/spec/features/admin/connection_spec.rb b/spec/features/admin/connection_spec.rb
index 6d67e8ece..0511521da 100644
--- a/spec/features/admin/connection_spec.rb
+++ b/spec/features/admin/connection_spec.rb
@@ -25,14 +25,15 @@ feature 'Administrator connection' do
end
scenario 'it displays the menu' do
expect(page).to have_css('a#profile')
- expect(page).to have_css('a#admin_sign_out')
+ expect(page).to have_css('#sign_out')
+ expect(page).to have_css('a.fa-sign-out')
end
context 'when clicking on sign_out' do
before do
stub_request(:get, "https://api.github.com/repos/sgmap/tps/releases/latest").
to_return(:status => 200, :body => '{"tag_name": "plip", "body": "blabla", "published_at": "2016-02-09T16:46:47Z"}', :headers => {})
- page.find_by_id('admin_sign_out').click
+ page.find_by_id('sign_out').find('a.fa-sign-out').click
end
scenario 'admin is redireted to home page' do
expect(page).to have_css('#landing')
@@ -52,7 +53,7 @@ feature 'Administrator connection' do
end
scenario 'it redirects to procedure page' do
- expect(page).to have_content('Gestion des procédures')
+ expect(page).to have_content('Procédures')
end
end
end
diff --git a/spec/features/admin/procedure_cloning_spec.rb b/spec/features/admin/procedure_cloning_spec.rb
new file mode 100644
index 000000000..78e13045a
--- /dev/null
+++ b/spec/features/admin/procedure_cloning_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+feature 'As an administrateur I wanna clone a procedure', js: true do
+
+ let(:administrateur) { create(:administrateur) }
+
+ before do
+ login_as administrateur, scope: :administrateur
+ visit root_path
+ end
+
+ context 'Cloning procedure' do
+
+ before 'Create procedure' do
+ page.find_by_id('new-procedure').click
+ fill_in 'procedure_libelle', with: 'libelle de la procedure'
+ page.execute_script("$('#procedure_description').data('wysihtml5').editor.setValue('description de la procedure')")
+ page.find_by_id('save-procedure').click
+ end
+
+ scenario 'Cloning' do
+ visit admin_procedures_draft_path
+ expect(page.find_by_id('procedures')['data-item-count']).to eq('1')
+ page.all('.clone-btn').first.click
+ visit admin_procedures_draft_path
+ expect(page.find_by_id('procedures')['data-item-count']).to eq('2')
+ end
+ end
+end
diff --git a/spec/features/admin/procedure_creation_spec.rb b/spec/features/admin/procedure_creation_spec.rb
new file mode 100644
index 000000000..61f538018
--- /dev/null
+++ b/spec/features/admin/procedure_creation_spec.rb
@@ -0,0 +1,101 @@
+require 'spec_helper'
+
+feature 'As an administrateur I wanna create a new procedure', js: true do
+
+ let(:administrateur) { create(:administrateur) }
+
+ before do
+ login_as administrateur, scope: :administrateur
+ visit root_path
+ end
+
+ context 'Right after sign_in I shall see all procedure states links' do
+
+ scenario 'Finding draft procedures' do
+ page.find_by_id('draft-procedures').trigger('click')
+ expect(page).to have_current_path(admin_procedures_draft_path, only_path: true)
+ end
+
+ scenario 'Finding active procedures' do
+ page.find_by_id('active-procedures').trigger('click')
+ expect(page).to have_current_path(admin_procedures_path, only_path: true)
+ end
+
+ scenario 'Finding archived procedures' do
+ page.find_by_id('archived-procedures').trigger('click')
+ expect(page).to have_current_path(admin_procedures_archived_path, only_path: true)
+ end
+ end
+
+ context 'Creating a new procedure' do
+
+ scenario 'Finding new procedure link' do
+ page.find_by_id('new-procedure').click
+ expect(page).to have_current_path(new_admin_procedure_path, only_path: true)
+ end
+
+ scenario 'Finding save button for new procedure, libelle and description required' do
+ page.find_by_id('new-procedure').click
+ page.find_by_id('save-procedure').click
+ page.find_by_id('flash_message').visible?
+ fill_in 'procedure_libelle', with: 'libelle de la procedure'
+ page.execute_script("$('#procedure_description').data('wysihtml5').editor.setValue('description de la procedure')")
+ page.find_by_id('save-procedure').click
+ expect(page).to have_current_path(admin_procedure_types_de_champ_path(Procedure.first.id.to_s))
+ end
+ end
+
+ context 'Editing a new procedure' do
+
+ before 'Create procedure' do
+ page.find_by_id('new-procedure').click
+ fill_in 'procedure_libelle', with: 'libelle de la procedure'
+ page.execute_script("$('#procedure_description').data('wysihtml5').editor.setValue('description de la procedure')")
+ page.find_by_id('save-procedure').click
+ end
+
+ scenario 'Add champ, add file, visualize them in procedure preview' do
+ page.find_by_id('procedure_types_de_champ_attributes_0_libelle').set 'libelle de champ'
+ page.find_by_id('add_type_de_champ').click
+ page.find_by_id('procedure_types_de_champ_attributes_1_libelle')
+ expect(Procedure.first.types_de_champ.first.libelle).to eq('libelle de champ')
+
+ page.find_by_id('onglet-pieces').trigger('click')
+ expect(page).to have_current_path(admin_procedure_pieces_justificatives_path(Procedure.first.id.to_s))
+ page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece'
+ page.find_by_id('add_piece_justificative').click
+ page.find_by_id('procedure_types_de_piece_justificative_attributes_1_libelle')
+
+ page.find_by_id('onglet-preview').trigger('click')
+ expect(page).to have_current_path(admin_procedure_previsualisation_path(Procedure.first.id.to_s))
+ expect(page.find_by_id('champs_1')['placeholder']).to eq('libelle de champ')
+ expect(page.first('.piece-libelle').text).to eq('libelle de piece')
+ end
+
+ scenario 'After adding champ and file, check impossibility to publish procedure, add accompagnateur and make publication' do
+ page.find_by_id('procedure_types_de_champ_attributes_0_libelle').set 'libelle de champ'
+ page.find_by_id('add_type_de_champ').click
+ page.find_by_id('onglet-pieces').trigger('click')
+ page.find_by_id('procedure_types_de_piece_justificative_attributes_0_libelle').set 'libelle de piece'
+ page.find_by_id('add_piece_justificative').click
+
+ page.find_by_id('onglet-infos').trigger('click')
+ expect(page).to have_current_path(admin_procedure_path(Procedure.first.id.to_s))
+ expect(page.find_by_id('publish-procedure')['disabled']).to eq('disabled')
+
+ page.find_by_id('onglet-accompagnateurs').click
+ expect(page).to have_current_path(admin_procedure_accompagnateurs_path(Procedure.first.id.to_s))
+ page.find_by_id('gestionnaire_email').set 'gestionnaire@apientreprise.fr'
+ page.find_by_id('add-gestionnaire-email').click
+ page.first('.gestionnaire-affectation').click
+
+ page.find_by_id('onglet-infos').click
+ expect(page).to have_selector('#publish-procedure', visible: true)
+ page.find_by_id('publish-procedure').click
+
+ expect(page.find_by_id('procedure_path')['value']).to eq('libelle_de_la_procedure')
+ page.find_by_id('publish').click
+ expect(page).to have_selector('.procedure-lien')
+ end
+ end
+end
diff --git a/spec/features/admin/procedure_locked_spec.rb b/spec/features/admin/procedure_locked_spec.rb
index 4676e9043..bfd9fc2d6 100644
--- a/spec/features/admin/procedure_locked_spec.rb
+++ b/spec/features/admin/procedure_locked_spec.rb
@@ -16,44 +16,4 @@ feature 'procedure locked' do
expect(page).not_to have_content('La procédure ne peut plus être modifiée car elle a été publiée')
end
end
- context 'when procedure is published' do
- let(:published) { true }
- before do
- visit admin_procedure_path(procedure)
- end
-
- scenario 'info label is present' do
- expect(page).to have_content('La procédure ne peut plus être modifiée car elle a été publiée')
- end
-
- context 'when user click on Description tab' do
- before do
- page.click_on 'Description'
- end
-
- scenario 'page doest not change' do
- expect(page).to have_css('#procedure_show')
- end
- end
-
- context 'when user click on Champs tab' do
- before do
- page.click_on 'Champs'
- end
-
- scenario 'page doest not change' do
- expect(page).to have_css('#procedure_show')
- end
- end
-
- context 'when user click on Pieces Justificatives tab' do
- before do
- page.click_on 'Pièces justificatives'
- end
-
- scenario 'page doest not change' do
- expect(page).to have_css('#procedure_show')
- end
- end
- end
end
diff --git a/spec/features/backoffice/add_commentaire_spec.rb b/spec/features/backoffice/add_commentaire_spec.rb
index 2d821dc1e..723f2e416 100644
--- a/spec/features/backoffice/add_commentaire_spec.rb
+++ b/spec/features/backoffice/add_commentaire_spec.rb
@@ -14,20 +14,6 @@ feature 'add commentaire on backoffice' do
visit backoffice_dossier_path(dossier)
end
- context 'Affichage du flux de commentaire' do
- scenario 'l\'email du contact est présent' do
- expect(page).to have_selector('span[id=email_contact]')
- end
-
- scenario 'la date du commentaire est présent' do
- expect(page).to have_selector('span[id=created_at]')
- end
-
- scenario 'le corps du commentaire est présent' do
- expect(page).to have_selector('div[class=description][id=body]')
- end
- end
-
context 'Affichage du formulaire de commentaire' do
scenario 'Le formulaire envoie vers /dossiers/:dossier_id/commentaire en #POST' do
expect(page).to have_selector("form[action='/backoffice/commentaires?dossier_id=#{dossier_id}'][method=post]")
diff --git a/spec/features/backoffice/connection_spec.rb b/spec/features/backoffice/connection_spec.rb
index 20dab8f8b..c428b965b 100644
--- a/spec/features/backoffice/connection_spec.rb
+++ b/spec/features/backoffice/connection_spec.rb
@@ -16,7 +16,7 @@ feature 'when gestionnaire come to /backoffice and is not authenticated' do
page.click_on 'Se connecter'
end
scenario 'he stay on the same page with an error' do
- expect(page).to have_content('email ou mot de passe incorrect.')
+ expect(page).to have_content('Email ou mot de passe incorrect.')
end
end
context 'when user enter good credentials' do
@@ -24,6 +24,7 @@ feature 'when gestionnaire come to /backoffice and is not authenticated' do
let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) }
before do
+ create :assign_to, gestionnaire: gestionnaire, procedure: procedure
page.find_by_id(:gestionnaire_email).set gestionnaire.email
page.find_by_id(:gestionnaire_password).set gestionnaire.password
page.click_on 'Se connecter'
@@ -32,4 +33,4 @@ feature 'when gestionnaire come to /backoffice and is not authenticated' do
expect(page).to have_css('#backoffice_index')
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/features/backoffice/flux_de_commentaires_spec.rb b/spec/features/backoffice/flux_de_commentaires_spec.rb
index 5550feb62..833225cbb 100644
--- a/spec/features/backoffice/flux_de_commentaires_spec.rb
+++ b/spec/features/backoffice/flux_de_commentaires_spec.rb
@@ -19,11 +19,12 @@ feature 'backoffice: flux de commentaires' do
end
scenario "seuls les commentaires généraux sont affichés" do
- comments = find("#commentaires_flux")
- expect(comments).to have_selector(".description", count: 1)
+ comments = find(".commentaires")
+ expect(comments).to have_selector(".content", count: 1)
end
scenario "affichage des commentaires du champs", js: true do
+ pending 'later: open simplif'
find("#liste_champs th", text: champ1.libelle).click_link("COM")
expect(page).to have_css("#modalCommentairesDossierParChamp.in")
@@ -32,6 +33,7 @@ feature 'backoffice: flux de commentaires' do
end
scenario "crée un commentaire sur un champ", js: true do
+ pending 'later: open simplif'
# ouverture modale
find("#liste_champs th", text: champ1.libelle).click_link("COM")
diff --git a/spec/features/backoffice/index_show_procedure_spec.rb b/spec/features/backoffice/index_show_procedure_spec.rb
new file mode 100644
index 000000000..1e8a0ec14
--- /dev/null
+++ b/spec/features/backoffice/index_show_procedure_spec.rb
@@ -0,0 +1,99 @@
+require 'spec_helper'
+
+feature 'As an Accompagnateur I can navigate and use each functionnality around procedures and their dossiers', js: true do
+
+ let(:user) { create(:user) }
+ let(:gestionnaire) { create(:gestionnaire) }
+ let(:procedure_1) { create(:procedure, :with_type_de_champ, libelle: 'procedure 1') }
+ let(:procedure_2) { create(:procedure, :with_type_de_champ, libelle: 'procedure 2') }
+
+ before 'Assign procedures to Accompagnateur and generating dossiers for each' do
+ create :assign_to, gestionnaire: gestionnaire, procedure: procedure_1
+ create :assign_to, gestionnaire: gestionnaire, procedure: procedure_2
+ 20.times do
+ Dossier.create(procedure_id: procedure_1.id.to_s, user: user, state: 'validated')
+ end
+ 15.times do
+ Dossier.create(procedure_id: procedure_2.id.to_s, user: user, state: 'validated')
+ end
+ login_as gestionnaire, scope: :gestionnaire
+ visit backoffice_path
+ end
+
+ context 'On index' do
+
+ scenario 'Switching between procedures' do
+ page.all('#procedure_list a').first.trigger('click')
+ expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_1.id.to_s), only_path: true)
+ expect(page.find('#all_dossiers .count').text).to eq('20 dossiers')
+ page.all('#procedure_list a').last.trigger('click')
+ expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_2.id.to_s), only_path: true)
+ expect(page.find('#all_dossiers .count').text).to eq('15 dossiers')
+ end
+
+ scenario 'Searching with search bar' do
+ page.find_by_id('search_area').trigger('click')
+ fill_in 'q', with: '15'
+ page.find_by_id('search_button').trigger('click')
+ page.find_by_id('tr_dossier_15').trigger('click')
+ expect(page).to have_current_path("/backoffice/dossiers/15")
+ end
+
+ scenario 'Following dossier' do
+ page.all('#procedure_list a').first.trigger('click')
+ expect(page.all('#follow_dossiers .smart-listing')[0]['data-item-count']).to eq ("0")
+ page.find_by_id('all_dossiers').trigger('click')
+ expect(page.all('#dossiers_list a').first.text).to eq('Suivre')
+ page.all('#dossiers_list a').first.trigger('click')
+ expect(page.all('#follow_dossiers .smart-listing')[0]['data-item-count']).to eq ("1")
+ end
+
+ scenario 'Using sort and pagination' do
+ visit "/backoffice/dossiers/procedure/1?all_state_dossiers_smart_listing[sort][id]=asc"
+ wait_for_ajax
+ expect(page.all("#all_state_dossiers .dossier-row")[0]['id']).to eq('tr_dossier_1')
+ visit "/backoffice/dossiers/procedure/1?all_state_dossiers_smart_listing[sort][id]=desc"
+ wait_for_ajax
+ expect(page.all(".dossier-row")[0]['id']).to eq('tr_dossier_20')
+ page.find('#all_state_dossiers .next_page a').trigger('click')
+ wait_for_ajax
+ page.find('#all_state_dossiers .next_page a').trigger('click')
+ wait_for_ajax
+ expect(page.all(".dossier-row")[0]['id']).to eq('tr_dossier_6')
+ page.find('#all_state_dossiers .prev a').trigger('click')
+ wait_for_ajax
+ expect(page.all(".dossier-row")[0]['id']).to eq('tr_dossier_13')
+ end
+
+ scenario 'Using filter' do
+ end
+
+ scenario 'Have an export button' do
+ expect(page.all('.export-link')[0].text).to eq('Au format CSV')
+ expect(page.all('.export-link')[1].text).to eq('Au format XLSX')
+ expect(page.all('.export-link')[2].text).to eq('Au format ODS')
+ end
+ end
+
+ context 'On show' do
+
+ scenario 'Following dossier' do
+ expect(page.all('#follow_dossiers .count').first.text).to eq('0 dossiers')
+ visit "/backoffice/dossiers/procedure/1?all_state_dossiers_smart_listing[sort][id]=asc"
+ page.find_by_id("suivre_dossier_1").trigger('click')
+ visit "backoffice/dossiers/4"
+ page.find_by_id("suivre_dossier_4").trigger('click')
+ visit "/backoffice/dossiers/procedure/1"
+ expect(page.all('#follow_dossiers .count').first.text).to eq('2 dossiers')
+ end
+
+ scenario 'Adding message' do
+ page.find_by_id('tr_dossier_4').trigger('click')
+ expect(page).to have_current_path(backoffice_dossier_path(4), only_path: true)
+ page.find_by_id('open-message').trigger('click')
+ page.execute_script("$('#texte_commentaire').data('wysihtml5').editor.setValue('Contenu du nouveau message')")
+ page.find_by_id('save-message').trigger('click')
+ expect(page.find('.last-commentaire .content').text).to eq('Contenu du nouveau message')
+ end
+ end
+end
diff --git a/spec/features/backoffice/invitation_spec.rb b/spec/features/backoffice/invitation_spec.rb
new file mode 100644
index 000000000..ffeb61158
--- /dev/null
+++ b/spec/features/backoffice/invitation_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+feature 'As an Accompagnateur I can send invitations from dossiers', js: true do
+
+ let(:user) { create(:user) }
+ let(:gestionnaire) { create(:gestionnaire) }
+ let(:procedure_1) { create(:procedure, :with_type_de_champ, libelle: 'procedure 1') }
+
+ before 'Assign procedures to Accompagnateur and generating dossiers for each' do
+ create :assign_to, gestionnaire: gestionnaire, procedure: procedure_1
+ Dossier.create(procedure_id: procedure_1.id.to_s, user: user, state: 'initiated')
+ login_as gestionnaire, scope: :gestionnaire
+ visit backoffice_dossier_path(1)
+ end
+
+ context 'On dossier show' do
+
+ scenario 'Sending invitation' do
+ page.find('#invitations').click
+ page.find('#invitation-email').set('toto@email.com')
+ page.find('#send-invitation .btn-success').trigger('click')
+ end
+
+ end
+end
diff --git a/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb b/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb
index d64ae23c7..8b75df35e 100644
--- a/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb
+++ b/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb
@@ -52,7 +52,7 @@ feature 'usage of pref list dossier lateral panel', js: true do
scenario 'dossier is brought up to date' do
wait_for_ajax
- expect(page).to have_selector("a.sortable[data-attr='entreprise.siren']")
+ expect(page).to have_selector("a.sortable[data-attr='entreprise.siren']", visible: false)
end
context 'when on click on delete attribut button' do
@@ -65,9 +65,9 @@ feature 'usage of pref list dossier lateral panel', js: true do
expect(page).not_to have_css('#delete_pref_list_entreprise_siren')
end
- scenario 'dossier is brought up to date' do
+ scenario 'dossier is brought up to date', js: true do
wait_for_ajax
- expect(page).not_to have_selector("a.sortable[data-attr='entreprise.siren']")
+ expect(page).not_to have_selector("a.sortable[data-attr='entreprise.siren']", visible: true)
end
context 'when on click on close pref list button' do
diff --git a/spec/features/backoffice/lateral_page_pref_list_dossier_by_procedure_backoffice_spec.rb b/spec/features/backoffice/lateral_page_pref_list_dossier_by_procedure_backoffice_spec.rb
index d9b97d581..a86eb9612 100644
--- a/spec/features/backoffice/lateral_page_pref_list_dossier_by_procedure_backoffice_spec.rb
+++ b/spec/features/backoffice/lateral_page_pref_list_dossier_by_procedure_backoffice_spec.rb
@@ -67,7 +67,7 @@ feature 'usage of pref list dossier lateral panel by procedure', js: true do
scenario 'dossier is brought up to date' do
wait_for_ajax
- expect(page).not_to have_selector("a.sortable[data-attr='entreprise.siren']")
+ expect(page).not_to have_selector("a.sortable[data-attr='entreprise.siren']", visible: false)
end
context 'when on click on close pref list button' do
diff --git a/spec/features/backoffice/navigate_to_dossier_spec.rb b/spec/features/backoffice/navigate_to_dossier_spec.rb
index 1c19cb3f9..3cb14cbf6 100644
--- a/spec/features/backoffice/navigate_to_dossier_spec.rb
+++ b/spec/features/backoffice/navigate_to_dossier_spec.rb
@@ -9,6 +9,7 @@ feature 'on backoffice page' do
before do
create :assign_to, gestionnaire: gestionnaire, procedure: procedure
+ create :follow, gestionnaire: gestionnaire, dossier: dossier
visit backoffice_path
end
@@ -22,7 +23,7 @@ feature 'on backoffice page' do
end
context 'when he click on first dossier', js: true do
before do
- page.find("#tr_dossier_#{dossier.id}").click
+ page.find("#tr_dossier_#{dossier.id}", visible: true).click
end
scenario 'it redirect to dossier page' do
@@ -36,9 +37,10 @@ feature 'on backoffice page' do
before do
create :assign_to, gestionnaire: gestionnaire, procedure: procedure_individual
+ create :follow, gestionnaire: gestionnaire, dossier: dossier_individual
- visit backoffice_path
- page.find("#tr_dossier_#{dossier_individual.id}").click
+ visit backoffice_dossiers_procedure_path(id: procedure_individual.id)
+ page.find("#tr_dossier_#{dossier_individual.id}", visible: true).click
end
scenario 'it redirect to dossier page' do
@@ -46,4 +48,4 @@ feature 'on backoffice page' do
end
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/features/backoffice/onglets_link_spec.rb b/spec/features/backoffice/onglets_link_spec.rb
deleted file mode 100644
index 087bb3d95..000000000
--- a/spec/features/backoffice/onglets_link_spec.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-require 'spec_helper'
-
-feature 'on click on tabs button' do
- let(:administrateur) { create(:administrateur) }
- let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) }
-
- let(:procedure) { create :procedure, administrateur: administrateur }
-
- before do
- create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated')
- create(:dossier, :with_entreprise, procedure: procedure, state: 'replied')
- create(:dossier, :with_entreprise, procedure: procedure, state: 'updated')
- create(:dossier, :with_entreprise, procedure: procedure, state: 'validated')
- create(:dossier, :with_entreprise, procedure: procedure, state: 'submitted')
- create(:dossier, :with_entreprise, procedure: procedure, state: 'received')
- create(:dossier, :with_entreprise, procedure: procedure, state: 'closed')
- create(:dossier, :with_entreprise, procedure: procedure, state: 'refused')
- create(:dossier, :with_entreprise, procedure: procedure, state: 'without_continuation')
-
- create :assign_to, gestionnaire: gestionnaire, procedure: procedure
-
- login_as gestionnaire, scope: :gestionnaire
- end
-
- context 'when gestionnaire is logged in' do
- context 'when he click on tabs nouveaux' do
- before do
- visit backoffice_dossiers_url(liste: :nouveaux)
- page.click_on 'Nouveaux 1'
- end
-
- scenario 'it redirect to backoffice dossier termine' do
- expect(page).to have_css('#backoffice_index')
- end
- end
-
- context 'when he click on tabs a traite' do
- before do
- visit backoffice_dossiers_url(liste: :a_traiter)
- page.click_on 'Ouverts 2'
- end
-
- scenario 'it redirect to backoffice dossier termine' do
- expect(page).to have_css('#backoffice_index')
- end
- end
-
- context 'when he click on tabs en attente' do
- before do
- visit backoffice_dossiers_url(liste: :figes)
- page.click_on 'Figés 1'
- end
-
- scenario 'it redirect to backoffice dossier en attente' do
- expect(page).to have_css('#backoffice_index')
- end
- end
-
- context 'when he click on tabs a receptionner' do
- before do
- visit backoffice_dossiers_url(liste: :deposes)
- page.click_on 'À réceptionner 1'
- end
-
- scenario 'it redirect to backoffice dossier a_receptionner' do
- expect(page).to have_css('#backoffice_index')
- end
- end
-
- context 'when he click on tabs a instruire' do
- before do
- visit backoffice_dossiers_url(liste: :a_instruire)
- page.click_on 'À instruire 1'
- end
-
- scenario 'it redirect to backoffice dossier termine' do
- expect(page).to have_css('#backoffice_index')
- end
- end
-
- context 'when he click on tabs termine' do
- before do
- visit backoffice_dossiers_url(liste: :termine)
- page.click_on 'Terminé 3'
- end
-
- scenario 'it redirect to backoffice dossier termine' do
- expect(page).to have_css('#backoffice_index')
- end
- end
- end
-
- context "OpenSimplif" do
- before do
- allow(Features).to receive(:opensimplif).and_return(true)
- visit backoffice_dossiers_url
- end
-
- scenario "it hides the tabs" do
- expect(page).to_not have_content('Nouveaux')
- end
- end
-end
diff --git a/spec/features/france_connect/france_connect_particulier_spec.rb b/spec/features/france_connect/france_connect_particulier_spec.rb
index b28bcc36f..01592e8af 100644
--- a/spec/features/france_connect/france_connect_particulier_spec.rb
+++ b/spec/features/france_connect/france_connect_particulier_spec.rb
@@ -62,7 +62,7 @@ feature 'France Connect Particulier Connexion' do
end
scenario 'he is redirected to user dossiers page' do
- expect(page).to have_content('Mes dossiers')
+ expect(page).to have_content('Dossiers')
end
end
end
@@ -74,7 +74,7 @@ feature 'France Connect Particulier Connexion' do
end
scenario 'he is redirected to user dossiers page' do
- expect(page).to have_content('Mes dossiers')
+ expect(page).to have_content('Dossiers')
end
end
end
@@ -96,4 +96,4 @@ feature 'France Connect Particulier Connexion' do
end
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/features/users/complete_demande_spec.rb b/spec/features/users/complete_demande_spec.rb
index 61f071c0c..55f2f3d4d 100644
--- a/spec/features/users/complete_demande_spec.rb
+++ b/spec/features/users/complete_demande_spec.rb
@@ -72,7 +72,7 @@ feature 'user path for dossier creation' do
page.click_on 'Soumettre mon dossier'
end
scenario 'user is on recap page' do
- expect(page).to have_css('#recap_dossier')
+ expect(page).to have_css('#users_recapitulatif_dossier_show')
end
end
end
diff --git a/spec/features/users/dossier_creation_spec.rb b/spec/features/users/dossier_creation_spec.rb
new file mode 100644
index 000000000..3d19d4118
--- /dev/null
+++ b/spec/features/users/dossier_creation_spec.rb
@@ -0,0 +1,53 @@
+require 'spec_helper'
+
+feature 'As a User I wanna create a dossier', js: true do
+
+ let(:user) { create(:user) }
+ let(:siret) { '40307130100044' }
+ let(:siren) { siret[0...9] }
+
+ context 'Right after sign_in I shall see inscription by credentials/siret, I can create a new Dossier' do
+ let(:procedure_with_siret) { create(:procedure, :published, :with_api_carto, :with_type_de_champ, :with_two_type_de_piece_justificative) }
+ let(:procedure_for_individual) { create(:procedure, :published, :for_individual, :with_api_carto, :with_type_de_champ, :with_two_type_de_piece_justificative) }
+
+ scenario 'Identification for individual' do
+ login_as user, scope: :user
+ visit commencer_path(procedure_path: procedure_for_individual.path)
+ fill_in 'dossier_individual_attributes_nom', with: 'Nom'
+ fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
+ fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
+ find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
+ page.find_by_id('etape_suivante').trigger('click')
+ expect(page).to have_current_path(users_dossier_carte_path(Dossier.first.id.to_s), only_path: true)
+ page.find_by_id('etape_suivante').trigger('click')
+ fill_in 'champs_1', with: 'contenu du champ 1'
+ page.find_by_id('suivant').trigger('click')
+ expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true)
+ end
+
+ scenario 'Identification through siret', vcr: {cassette_name: 'search_ban_paris'} do
+ login_as user, scope: :user
+ visit commencer_path(procedure_path: procedure_with_siret.path)
+ expect(page).to have_current_path(users_dossier_path(Dossier.first.id.to_s), only_path: true)
+ fill_in 'dossier_siret', with: siret
+ stub_request(:get, "https://api-dev.apientreprise.fr/v2/etablissements/#{siret}?token=#{SIADETOKEN}")
+ .to_return(status: 200, body: File.read('spec/support/files/etablissement.json'))
+ stub_request(:get, "https://api-dev.apientreprise.fr/v2/entreprises/#{siren}?token=#{SIADETOKEN}")
+ .to_return(status: 200, body: File.read('spec/support/files/entreprise.json'))
+ stub_request(:get, "https://api-dev.apientreprise.fr/v1/etablissements/exercices/#{siret}?token=#{SIADETOKEN}")
+ .to_return(status: 200, body: File.read('spec/support/files/exercices.json'))
+ stub_request(:get, "https://api-dev.apientreprise.fr/v1/associations/#{siret}?token=#{SIADETOKEN}")
+ .to_return(status: 404, body: '')
+ page.find_by_id('dossier_siret').set siret
+ page.find_by_id('submit-siret').trigger('click')
+ expect(page).to have_css('#recap_info_entreprise')
+ find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
+ page.find_by_id('etape_suivante').trigger('click')
+ expect(page).to have_current_path(users_dossier_carte_path(Dossier.first.id.to_s), only_path: true)
+ page.find_by_id('etape_suivante').trigger('click')
+ fill_in 'champs_1', with: 'contenu du champ 1'
+ page.find_by_id('suivant').trigger('click')
+ expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true)
+ end
+ end
+end
diff --git a/spec/features/users/dossier_edition_spec.rb b/spec/features/users/dossier_edition_spec.rb
new file mode 100644
index 000000000..27ee4c077
--- /dev/null
+++ b/spec/features/users/dossier_edition_spec.rb
@@ -0,0 +1,52 @@
+require 'spec_helper'
+
+feature 'As a User I want to edit a dossier I own', js: true do
+
+ let(:user) { create(:user) }
+ let(:procedure_for_individual) { create(:procedure, :published, :for_individual, :with_api_carto, :with_type_de_champ, :with_two_type_de_piece_justificative) }
+
+ before "Create dossier" do
+ login_as user, scope: :user
+ visit commencer_path(procedure_path: procedure_for_individual.path)
+ fill_in 'dossier_individual_attributes_nom', with: 'Nom'
+ fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
+ fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
+ find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
+ page.find_by_id('etape_suivante').trigger('click')
+ page.find_by_id('etape_suivante').trigger('click')
+ page.find_by_id('suivant').trigger('click')
+ visit root_path
+ end
+
+ context 'After sign_in, I can navigate through dossiers indexes and edit a dossier' do
+
+ scenario 'After sign_in, I can see dossiers "à traiter" (default), and other indexes' do
+ expect(page.find('#a_traiter')['class'] ).to eq('active procedure_list_element')
+ page.find_by_id('brouillon').trigger('click')
+ page.find_by_id('a_traiter').trigger('click')
+ page.find_by_id('valides').trigger('click')
+ page.find_by_id('en_instruction').trigger('click')
+ page.find_by_id('termine').trigger('click')
+ page.find_by_id('invite').trigger('click')
+ end
+
+ scenario 'Getting a dossier, I want to create a new message on' do
+ page.find_by_id('tr_dossier_' + Dossier.last.id.to_s).trigger('click')
+ expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true)
+ page.find_by_id('open-message').trigger('click')
+ page.execute_script("$('#texte_commentaire').data('wysihtml5').editor.setValue('Contenu du nouveau message')")
+ page.find_by_id('save-message').trigger('click')
+ expect(page.find('.last-commentaire .content').text).to eq('Contenu du nouveau message')
+ end
+
+ scenario 'On the same dossier, I want to edit informations' do
+ page.find_by_id('tr_dossier_' + Dossier.last.id.to_s).trigger('click')
+ page.find_by_id('edit-dossier').trigger('click')
+ expect(page).to have_current_path(users_dossier_description_path(Dossier.first.id.to_s), only_path: true)
+ fill_in 'champs_1', with: 'Contenu du champ 1'
+ page.find_by_id('modification_terminee').trigger('click')
+ expect(page).to have_current_path(users_dossier_recapitulatif_path(Dossier.first.id.to_s), only_path: true)
+ expect(page.find('#champ-1-value').text).to eq('Contenu du champ 1')
+ end
+ end
+end
diff --git a/spec/features/users/dossier_index_spec.rb b/spec/features/users/dossier_index_spec.rb
new file mode 100644
index 000000000..98dba283e
--- /dev/null
+++ b/spec/features/users/dossier_index_spec.rb
@@ -0,0 +1,52 @@
+require 'spec_helper'
+
+feature 'As a User I want to sort and paginate dossiers', js: true do
+
+ let(:user) { create(:user) }
+ let(:procedure_for_individual) { create(:procedure, :published, :for_individual) }
+
+ before "Create dossier" do
+ login_as user, scope: :user
+ visit commencer_path(procedure_path: procedure_for_individual.path)
+ fill_in 'dossier_individual_attributes_nom', with: 'Nom'
+ fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
+ fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
+ find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
+ page.find_by_id('etape_suivante').trigger('click')
+ page.find_by_id('suivant').trigger('click')
+ 50.times do
+ Dossier.create(procedure_id: 1, user_id: 1, state: "initiated")
+ end
+ visit root_path
+ end
+
+ context 'After sign_in, I can see my 51 dossiers on the index' do
+
+ scenario 'Using sort' do
+ expect(page.all(:css, '#dossiers_list tr')[0].text.split(" ").first).to eq('1')
+ expect(page.all(:css, '#dossiers_list tr')[2].text.split(" ").first).to eq('2')
+ visit "/users/dossiers?dossiers_smart_listing[sort][id]=desc"
+ expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('51')
+ expect(page.all(:css, '#dossiers_list tr')[2].text.split(" ").first).to eq('50')
+ visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc"
+ expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('1')
+ expect(page.all(:css, '#dossiers_list tr')[2].text.split(" ").first).to eq('2')
+ end
+
+ scenario 'Using pagination' do
+ expect(page.all(:css, '#dossiers_list tr')[0].text.split(" ").first).to eq('1')
+ page.find('.next_page a').trigger('click')
+ wait_for_ajax
+ expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('8')
+ page.find('.next_page a').trigger('click')
+ wait_for_ajax
+ expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('15')
+ page.find('.prev a').trigger('click')
+ wait_for_ajax
+ page.find('.prev a').trigger('click')
+ wait_for_ajax
+ expect(page.all(:css, '#dossiers_list tr')[1].text.split(" ").first).to eq('1')
+ end
+ end
+
+end
diff --git a/spec/features/users/flux_de_commentaires_spec.rb b/spec/features/users/flux_de_commentaires_spec.rb
index 7a6e7fe61..0c087f429 100644
--- a/spec/features/users/flux_de_commentaires_spec.rb
+++ b/spec/features/users/flux_de_commentaires_spec.rb
@@ -19,11 +19,12 @@ feature 'users: flux de commentaires' do
end
scenario "seuls les commentaires généraux sont affichés" do
- comments = find("#commentaires_flux")
- expect(comments).to have_selector(".description", count: 1)
+ comments = find(".commentaires")
+ expect(comments).to have_selector(".content", count: 1)
end
scenario "affichage des commentaires du champs", js: true do
+ pending 'later: open simplif'
th = find("#liste_champs th", text: champ1.libelle)
th.click_link("COM")
expect(page).to have_css("#modalCommentairesDossierParChamp.in")
@@ -33,6 +34,7 @@ feature 'users: flux de commentaires' do
end
scenario "crée un commentaire sur un champ", js: true do
+ pending 'later: open simplif'
# ouverture modale
find("#liste_champs th", text: champ1.libelle).click_link("COM")
diff --git a/spec/features/users/invitation_spec.rb b/spec/features/users/invitation_spec.rb
new file mode 100644
index 000000000..0ae2f9bb5
--- /dev/null
+++ b/spec/features/users/invitation_spec.rb
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+feature 'As a User I can send invitations from dossiers', js: true do
+
+ let(:user) { create(:user) }
+ let(:procedure_1) { create(:procedure, :with_type_de_champ, libelle: 'procedure 1') }
+
+ before 'Assign procedures to Accompagnateur and generating dossiers for each' do
+ Dossier.create(procedure_id: procedure_1.id.to_s, user: user, state: 'initiated')
+ login_as user, scope: :user
+ visit users_dossier_recapitulatif_path(1)
+ end
+
+ context 'On dossier show' do
+
+ scenario 'Sending invitation' do
+ page.find('#invitations').click
+ fill_in 'invitation-email', with: 'toto@email.com'
+ page.find('#send-invitation .btn-success').trigger('click')
+ end
+
+ end
+end
diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/features/users/list_dossiers_spec.rb
index b3a767551..d970de7b4 100644
--- a/spec/features/users/list_dossiers_spec.rb
+++ b/spec/features/users/list_dossiers_spec.rb
@@ -37,7 +37,7 @@ feature 'user access to the list of his dossier' do
page.find("#tr_dossier_#{dossier1.id}").click
end
scenario 'user is redirected to dossier page' do
- expect(page).to have_css('#recap_dossier')
+ expect(page).to have_css('#users_recapitulatif_dossier_show')
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/features/users/start_demande_spec.rb b/spec/features/users/start_demande_spec.rb
index 664fc8729..a1448e139 100644
--- a/spec/features/users/start_demande_spec.rb
+++ b/spec/features/users/start_demande_spec.rb
@@ -44,4 +44,4 @@ feature 'user arrive on siret page' do
end
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/fixtures/cassettes/ban_search_nothing.yml b/spec/fixtures/cassettes/ban_search_nothing.yml
new file mode 100644
index 000000000..5e36790fd
--- /dev/null
+++ b/spec/fixtures/cassettes/ban_search_nothing.yml
@@ -0,0 +1,42 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://api-adresse.data.gouv.fr/search?limit=1&q=je%20recherche%20pas%20grand%20chose
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - nginx/1.11.3
+ Date:
+ - Fri, 16 Dec 2016 14:17:40 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '163'
+ Connection:
+ - keep-alive
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - X-Requested-With
+ body:
+ encoding: UTF-8
+ string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
+ 1.0", "query": "je recherche pas grand chose", "type": "FeatureCollection",
+ "features": []}'
+ http_version:
+ recorded_at: Fri, 16 Dec 2016 14:17:40 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/cassettes/ban_search_paris.yml b/spec/fixtures/cassettes/ban_search_paris.yml
new file mode 100644
index 000000000..d61951ec1
--- /dev/null
+++ b/spec/fixtures/cassettes/ban_search_paris.yml
@@ -0,0 +1,45 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://api-adresse.data.gouv.fr/search?limit=1&q=Paris
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - nginx/1.11.3
+ Date:
+ - Fri, 16 Dec 2016 14:16:43 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '457'
+ Connection:
+ - keep-alive
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - X-Requested-With
+ body:
+ encoding: UTF-8
+ string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
+ 1.0", "query": "Paris", "type": "FeatureCollection", "features": [{"geometry":
+ {"type": "Point", "coordinates": [2.3469, 48.8589]}, "properties": {"adm_weight":
+ "6", "citycode": "75056", "name": "Paris", "city": "Paris", "postcode": "75000",
+ "context": "75, \u00cele-de-France", "score": 1.0, "label": "Paris", "id":
+ "75056", "type": "city", "population": "2244"}, "type": "Feature"}]}'
+ http_version:
+ recorded_at: Fri, 16 Dec 2016 14:16:43 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/cassettes/bano_octo.yml b/spec/fixtures/cassettes/bano_octo.yml
new file mode 100644
index 000000000..ddf8b0b82
--- /dev/null
+++ b/spec/fixtures/cassettes/bano_octo.yml
@@ -0,0 +1,47 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://api-adresse.data.gouv.fr/search?limit=1&q=50%20av%20des%20champs%20elysees
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - nginx/1.11.3
+ Date:
+ - Fri, 16 Dec 2016 16:22:23 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '628'
+ Connection:
+ - keep-alive
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - X-Requested-With
+ body:
+ encoding: UTF-8
+ string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
+ 1.0", "query": "50 av des champs elysees", "type": "FeatureCollection", "features":
+ [{"geometry": {"type": "Point", "coordinates": [2.306888, 48.870374]}, "properties":
+ {"citycode": "75108", "postcode": "75008", "name": "50 Avenue des Champs \u00c9lys\u00e9es",
+ "id": "ADRNIVX_0000000270748251", "type": "housenumber", "context": "75, \u00cele-de-France",
+ "score": 0.7561038961038961, "label": "50 Avenue des Champs \u00c9lys\u00e9es
+ 75008 Paris", "city": "Paris", "housenumber": "50", "street": "Avenue des
+ Champs \u00c9lys\u00e9es"}, "type": "Feature"}]}'
+ http_version:
+ recorded_at: Fri, 16 Dec 2016 16:22:23 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/cassettes/bano_search_nothing.yml b/spec/fixtures/cassettes/bano_search_nothing.yml
new file mode 100644
index 000000000..597c71025
--- /dev/null
+++ b/spec/fixtures/cassettes/bano_search_nothing.yml
@@ -0,0 +1,42 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://api-adresse.data.gouv.fr/search?limit=5&q=je%20recherche%20pas%20grand%20chose
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - nginx/1.11.3
+ Date:
+ - Fri, 16 Dec 2016 16:45:53 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '163'
+ Connection:
+ - keep-alive
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - X-Requested-With
+ body:
+ encoding: UTF-8
+ string: '{"limit": 5, "attribution": "BAN", "version": "draft", "licence": "ODbL
+ 1.0", "query": "je recherche pas grand chose", "type": "FeatureCollection",
+ "features": []}'
+ http_version:
+ recorded_at: Fri, 16 Dec 2016 16:45:53 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/cassettes/bano_search_paris.yml b/spec/fixtures/cassettes/bano_search_paris.yml
new file mode 100644
index 000000000..571c86ffe
--- /dev/null
+++ b/spec/fixtures/cassettes/bano_search_paris.yml
@@ -0,0 +1,63 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://api-adresse.data.gouv.fr/search?limit=5&q=Paris
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - nginx/1.11.3
+ Date:
+ - Fri, 16 Dec 2016 16:43:34 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '1887'
+ Connection:
+ - keep-alive
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - X-Requested-With
+ body:
+ encoding: UTF-8
+ string: '{"limit": 5, "attribution": "BAN", "version": "draft", "licence": "ODbL
+ 1.0", "query": "Paris", "type": "FeatureCollection", "features": [{"geometry":
+ {"type": "Point", "coordinates": [2.3469, 48.8589]}, "properties": {"adm_weight":
+ "6", "citycode": "75056", "name": "Paris", "city": "Paris", "postcode": "75000",
+ "context": "75, \u00cele-de-France", "score": 1.0, "label": "Paris", "id":
+ "75056", "type": "city", "population": "2244"}, "type": "Feature"}, {"geometry":
+ {"type": "Point", "coordinates": [3.564293, 45.766413]}, "properties": {"citycode":
+ "63125", "postcode": "63120", "name": "Paris", "city": "Courpi\u00e8re", "context":
+ "63, Puy-de-D\u00f4me, Auvergne", "score": 0.8255363636363636, "label": "Paris
+ 63120 Courpi\u00e8re", "id": "63125_B221_03549b", "type": "locality"}, "type":
+ "Feature"}, {"geometry": {"type": "Point", "coordinates": [1.550208, 44.673592]},
+ "properties": {"citycode": "46138", "postcode": "46240", "name": "PARIS (Vaillac)",
+ "city": "C\u0153ur de Causse", "context": "46, Lot, Midi-Pyr\u00e9n\u00e9es",
+ "score": 0.824090909090909, "label": "PARIS (Vaillac) 46240 C\u0153ur de Causse",
+ "id": "46138_XXXX_6ee4ec", "type": "street"}, "type": "Feature"}, {"geometry":
+ {"type": "Point", "coordinates": [-0.526884, 43.762253]}, "properties": {"citycode":
+ "40282", "postcode": "40500", "name": "Paris", "city": "Saint-Sever", "context":
+ "40, Landes, Aquitaine", "score": 0.8236181818181818, "label": "Paris 40500
+ Saint-Sever", "id": "40282_B237_2364e3", "type": "locality"}, "type": "Feature"},
+ {"geometry": {"type": "Point", "coordinates": [0.157613, 47.336685]}, "properties":
+ {"citycode": "37031", "postcode": "37140", "name": "Paris Buton", "city":
+ "Bourgueil", "context": "37, Indre-et-Loire, Centre Val-de-Loire", "score":
+ 0.8235454545454545, "label": "Paris Buton 37140 Bourgueil", "id": "37031_X027_0a5e7a",
+ "type": "locality"}, "type": "Feature"}]}'
+ http_version:
+ recorded_at: Fri, 16 Dec 2016 16:43:34 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/cassettes/geoapi_departements.yml b/spec/fixtures/cassettes/geoapi_departements.yml
new file mode 100644
index 000000000..6eee3d2bf
--- /dev/null
+++ b/spec/fixtures/cassettes/geoapi_departements.yml
@@ -0,0 +1,70 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://geo.api.gouv.fr/departements?fields=nom
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 16 Dec 2016 09:25:41 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ - Accept-Encoding
+ X-Powered-By:
+ - Express
+ Access-Control-Allow-Origin:
+ - "*"
+ Etag:
+ - W/"cc1-lXUcIlpPmDfvrGONl0WWsQ"
+ Strict-Transport-Security:
+ - max-age=15552000
+ Content-Encoding:
+ - gzip
+ body:
+ encoding: ASCII-8BIT
+ string: !binary |-
+ H4sIAAAAAAAAA22Wy27bMBBFfyXwJpsKqF96dOfYrZsibow4MFAUXTARGxOQ
+ xZYSjbpF/yfZ5w/0YyVlpDq0sxTmajg8vJzh1z+9Um9773oTVfbe9O51Lt3H
+ 237v75suUpUSsQFjRaGkQXAYBH/IKspl9FHYWkZLo3eyvGeqEdStqIomhfsJ
+ CccnCRfCqFptA1VMlcmbx/sN10nCsCzL4O80CKvm8YE/Z4zaO4T6b4OQQ/ef
+ YD8guJN7o8G3T4YX2rpqHSgb3WyaZ7LuE+dUFDuRa8Dpk99UlLUoUAHJTTfC
+ yLJmgUT2Eo5e2CIN2U03POw+uU21Mc3jb65AcC5cSb/Flc275IPJsQGiVgjF
+ BRTT5tn5KD+/huMGBN0KHMnzidlqish7aqQNliDkmTa5fuAZDAh5pu0dDmBA
+ xjPTPG9ZOgm/t4YhQvWhSNbRlVYsmXA/qFJVdfMY5CDeuTDAOqQvD5fPCbRz
+ fQd2SG5zabCrIWnNlfuRzh4S18fmyQhb1MhLXJdF0W5trQqhgtUJ7rLMubEh
+ ubWxFzosnwQvqxDNkOw+WSNQHqldCbczbHxEbv44/MKh50fE5iWoaURuB+zH
+ CrJrY9GkLtzFVT8tE5FhKwPgEdFdaUYIzkV89SfnPiK4K/07JDciuYU/s1fY
+ j8hwIcqg147J0LUTnvqY8A6AjhVEuBB736m7wxsT30JaU2/a+ha6ks5pEBKg
+ E/K6j8lvoc2d2gi05jEhniYmvc9uUuxogDHpfXadBBWR2bViQTGJXQfAYgJb
+ inaYujEgFEwbE9nS7r1mFnaimNyWe9M8lc2Tn7X/vcd8rwzl7p9uRzE5Ium1
+ UW7SiIIXKybUC7ePmw2fGzGpel8cx8n1eEbGJHsw1UqEYzQh4UPwFVsnhL0S
+ 3lzdbhNSXomdVgwGLbF97JxISHXpXjAgnpDkSvpLdzqHEyI8iLzzwwuWEOSX
+ nSxcLi5EjjNpf0Wr1sGUkOZKbznQUmK8dSt3eFKy86FXe09KiGuBaZeS4FrY
+ +yK4synprWWZO/ticfJbO/exZ6TkdrDHiYTU1rp6IJCUzL6EMzQlrFtp3LvU
+ N+uzXJ5dyOK7NmjOGeG9r6owU3bcGdur3h5zt88s8GDrk5Vr0XU0k+55AF0I
+ s/CpjoySBUCFk5yHTSkj07kVuSy0/cFiguvi0tfujRJMsSy4M3O7F8FmkmAW
+ irOb5smWiq/kLAnauNjrmi/YzF+Jb/8A5ygzwMEMAAA=
+ http_version:
+ recorded_at: Fri, 16 Dec 2016 09:25:37 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/cassettes/geoapi_regions.yml b/spec/fixtures/cassettes/geoapi_regions.yml
new file mode 100644
index 000000000..2de462046
--- /dev/null
+++ b/spec/fixtures/cassettes/geoapi_regions.yml
@@ -0,0 +1,57 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://geo.api.gouv.fr/regions?fields=nom
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - nginx
+ Date:
+ - Fri, 16 Dec 2016 09:24:28 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Transfer-Encoding:
+ - chunked
+ Connection:
+ - keep-alive
+ Vary:
+ - Accept-Encoding
+ - Accept-Encoding
+ X-Powered-By:
+ - Express
+ Access-Control-Allow-Origin:
+ - "*"
+ Etag:
+ - W/"2dd-2SAFdhiM3SIQ2017gqYxbw"
+ Strict-Transport-Security:
+ - max-age=15552000
+ Content-Encoding:
+ - gzip
+ body:
+ encoding: ASCII-8BIT
+ string: !binary |-
+ H4sIAAAAAAAAA11Ry2rDMBD8FeNLLxE0rybpzTE0F6eYHHopPSyWSASyNllJ
+ Abf0F/ofvucP/GO1aIvXPQm0M7MzO68fqcU6fUx3AaQyGM4qnaQVStX/3U/T
+ z8kfYA/ktdWXwAEzBtiFBiwfztmwgOTQtcFqtEx/MdJv0HvOf2DT7ssoIZV4
+ IrAVA025xVxZT0q8gEmkSgrUxJAzvmyLgY54tL+CJyVyrH3XDt5mK7b9GakG
+ KzWXW4/nUpTgosMcDGgnSl0BjRhzfqzMOKh68AnqM0QfGUll+7dAItD8jgtu
+ vITGxXAG/udbcvktKR9lhzxL3kZ2CdrHLaLQNQanrShRewzREPVXVG5grpaj
+ Hu0xKImVOPQ8p41BK/ZaalE21LW2a0dUXmEWropi1MOpu8XE5syx61FMwqvq
+ i/4Biby7eZXIu+w90GBswyPlSI7F3fRqb99L+pyA3QIAAA==
+ http_version:
+ recorded_at: Fri, 16 Dec 2016 09:24:25 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/cassettes/github_lastrelease.yml b/spec/fixtures/cassettes/github_lastrelease.yml
new file mode 100644
index 000000000..163e5bdea
--- /dev/null
+++ b/spec/fixtures/cassettes/github_lastrelease.yml
@@ -0,0 +1,93 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: https://api.github.com/repos/sgmap/tps/releases/latest
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - GitHub.com
+ Date:
+ - Thu, 15 Dec 2016 15:48:21 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Transfer-Encoding:
+ - chunked
+ Status:
+ - 200 OK
+ X-Ratelimit-Limit:
+ - '60'
+ X-Ratelimit-Remaining:
+ - '46'
+ X-Ratelimit-Reset:
+ - '1481819650'
+ Cache-Control:
+ - public, max-age=60, s-maxage=60
+ Vary:
+ - Accept
+ - Accept-Encoding
+ Etag:
+ - W/"104562bed37a43b27f0e4ba70c1d2cff"
+ Last-Modified:
+ - Thu, 17 Nov 2016 10:56:47 GMT
+ X-Github-Media-Type:
+ - github.v3
+ Access-Control-Expose-Headers:
+ - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
+ X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
+ Access-Control-Allow-Origin:
+ - "*"
+ Content-Security-Policy:
+ - default-src 'none'
+ Strict-Transport-Security:
+ - max-age=31536000; includeSubdomains; preload
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - deny
+ X-Xss-Protection:
+ - 1; mode=block
+ X-Served-By:
+ - 46808ddc41c302090177e58148908b23
+ Content-Encoding:
+ - gzip
+ X-Github-Request-Id:
+ - B918B84A:73B5:C61DB9:5852BB44
+ body:
+ encoding: ASCII-8BIT
+ string: !binary |-
+ H4sIAAAAAAAAA6VVy27bMBD8FUKXXBzTap4V0hZFeikQNIe0RdEHDFqiZQaU
+ yHJJt6mRf+nV3+Ef65BSnMTIA0ZPssTd4ezs7niRBaezIpt5b6ngXFg1rJWf
+ hcmwNA130hriVDfCcgTgXUtBkvj+4fHBwdFeNsgEkfQ0/i8Y3oEALVhtRLWB
+ 1n2kbYj1iIs3rWjkQIuJ1NeAn/lGb4DfqfaBOr2o+TwfHg9jqarKir7wQYaT
+ cQSHeOsAL1wt/RjKNcormuGsEeSlQ3Ife4oz2XqhnCRmhWPlTDSWmPRMNKul
+ VsYJr0zLKsn0jvxtjfPxd2WIlHQ0BFTlxNRnxVRokmhA8DPjsmKRaVOrFnd+
+ uQz6fd4TzvdG+f7LwxEC5wIENzuVPt5oG0i60rQeDFP/A79JfzN/FSWoXY8S
+ tchiw54anwhHfE3nafXXYVOjtfmFzE2q92fzLjhf54BS91u19db5yFlw42cS
+ KoF6nJha0XPTfY9Iil/w+BirKiIQ9HVyc6Y3Fu0eRp8BKr9asFikNUxQYUKl
+ UzYOyDbq3MsDjnG1aNWfNGjb4CCPkJ5cYQtxUzzy5BxztU1il7Dg1qm5KK+i
+ BE6WUs0h59ZgG5nA8lc2ru8ntDqKq7wci6qJK5RW63qQWSd7y1uvW+mk8Lhf
+ YAOzF6P8cDfPd/Ojj/mo2DsuXoy+AsqGicb6Pxx1cFjsH8Wo3vSKbz+im7iJ
+ 0Jve9Iwb90m3BvVH2e1R+qRblImprlDbyWzv9QcT5hIGs1rSCcf7d/e9PQm6
+ e2qVnp9aNtXhdzSpaHy9uTFJnjVCRS8RLcyNyJRqtWSrv9HyfgZEd85X7QS4
+ XWdvTExVsj6Li41yrFJUBhgoI7talmqqkBivYCBlAs5jMoVL6YeJG+9JnfCe
+ ZfoK5m/vmuvjxZzdWi6tPTeycUzDsEWJEq2oW4xAcHhnqyXEWVv3ajlk5y2z
+ MsC0IZpxkADm3tm4bNnpxecB+3J2Ef3+/N3FkL1DrTrQ4K5WqIy667x3ahI8
+ qCS5omo3ShFsugfGRc9Uf2pgQWVa90f7eBvTqToJNRraltKlBsbyUYwGlx3I
+ EAhlg5VDW2QyJPYzKNZKRjtiOlVgqzz+4AgY6e7UtgdoZtf/AIfUb6aECAAA
+ http_version:
+ recorded_at: Thu, 15 Dec 2016 15:48:21 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/cassettes/search_ban_paris.yml b/spec/fixtures/cassettes/search_ban_paris.yml
new file mode 100644
index 000000000..e0f65331e
--- /dev/null
+++ b/spec/fixtures/cassettes/search_ban_paris.yml
@@ -0,0 +1,48 @@
+---
+http_interactions:
+- request:
+ method: get
+ uri: http://api-adresse.data.gouv.fr/search?limit=1&q=50%20AV%20DES%20CHAMPS%20ELYSEES%20complement_adresse%2075008%20PARIS%208
+ body:
+ encoding: US-ASCII
+ string: ''
+ headers:
+ Accept:
+ - "*/*"
+ Accept-Encoding:
+ - gzip, deflate
+ User-Agent:
+ - rest-client/2.0.0 (darwin15.6.0 x86_64) ruby/2.3.1p112
+ response:
+ status:
+ code: 200
+ message: OK
+ headers:
+ Server:
+ - nginx/1.11.3
+ Date:
+ - Tue, 20 Dec 2016 11:36:58 GMT
+ Content-Type:
+ - application/json; charset=utf-8
+ Content-Length:
+ - '660'
+ Connection:
+ - keep-alive
+ Access-Control-Allow-Origin:
+ - "*"
+ Access-Control-Allow-Headers:
+ - X-Requested-With
+ body:
+ encoding: UTF-8
+ string: '{"limit": 1, "attribution": "BAN", "version": "draft", "licence": "ODbL
+ 1.0", "query": "50 AV DES CHAMPS ELYSEES complement_adresse 75008 PARIS 8",
+ "type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates":
+ [2.306888, 48.870374]}, "properties": {"citycode": "75108", "postcode": "75008",
+ "name": "50 Avenue des Champs \u00c9lys\u00e9es", "id": "ADRNIVX_0000000270748251",
+ "type": "housenumber", "context": "75, \u00cele-de-France", "score": 0.596517719568567,
+ "label": "50 Avenue des Champs \u00c9lys\u00e9es 75008 Paris", "city": "Paris",
+ "housenumber": "50", "street": "Avenue des Champs \u00c9lys\u00e9es"}, "type":
+ "Feature"}]}'
+ http_version:
+ recorded_at: Tue, 20 Dec 2016 11:36:58 GMT
+recorded_with: VCR 3.0.3
diff --git a/spec/fixtures/file.pdf b/spec/fixtures/file.pdf
new file mode 100644
index 000000000..e69de29bb
diff --git a/spec/lib/carto/geo_api/driver_spec.rb b/spec/lib/carto/geo_api/driver_spec.rb
new file mode 100644
index 000000000..25ca47dd5
--- /dev/null
+++ b/spec/lib/carto/geo_api/driver_spec.rb
@@ -0,0 +1,35 @@
+require 'spec_helper'
+
+describe Carto::GeoAPI::Driver do
+
+ describe '.regions', vcr: {cassette_name: 'geoapi_regions'} do
+ subject { described_class.regions }
+
+ it { expect(subject.code).to eq 200 }
+ end
+
+ describe '.departements', vcr: {cassette_name: 'geoapi_departements'} do
+ subject { described_class.departements }
+
+ it { expect(subject.code).to eq 200 }
+ end
+
+ describe '.pays' do
+ subject { described_class.pays }
+
+ it { is_expected.to eq File.open('app/lib/carto/geo_api/pays.json').read }
+
+ end
+
+ describe 'departements_url' do
+ subject { described_class.departements_url }
+
+ it { is_expected.to eq 'https://geo.api.gouv.fr/departements' }
+ end
+
+ describe 'regions_url' do
+ subject { described_class.regions_url }
+
+ it { is_expected.to eq 'https://geo.api.gouv.fr/regions' }
+ end
+end
\ No newline at end of file
diff --git a/spec/lib/carto/geocodeur_spec.rb b/spec/lib/carto/geocodeur_spec.rb
new file mode 100644
index 000000000..a9a071010
--- /dev/null
+++ b/spec/lib/carto/geocodeur_spec.rb
@@ -0,0 +1,26 @@
+require 'spec_helper'
+
+describe Carto::Geocodeur do
+ let(:address) { '50 av des champs elysees' }
+ describe '.convert_adresse_to_point', vcr: { cassette_name: 'bano_octo' } do
+ it 'return a point' do
+ expect(described_class.convert_adresse_to_point(address).class).to eq(RGeo::Cartesian::PointImpl)
+ end
+ context 'when RestClient::Exception' do
+ before do
+ allow_any_instance_of(Carto::Bano::Driver).to receive(:call).and_raise(RestClient::Exception)
+ end
+ it 'return nil' do
+ expect(described_class.convert_adresse_to_point(address)).to be_nil
+ end
+ end
+ context 'when JSON::ParserError' do
+ before do
+ allow_any_instance_of(Carto::Bano::PointRetriever).to receive(:point).and_raise(JSON::ParserError)
+ end
+ it 'return nil' do
+ expect(described_class.convert_adresse_to_point(address)).to be_nil
+ end
+ end
+ end
+end
diff --git a/spec/lib/carto/sgmap/api_spec.rb b/spec/lib/carto/sgmap/api_spec.rb
index fb9e5a49b..1a383a96f 100644
--- a/spec/lib/carto/sgmap/api_spec.rb
+++ b/spec/lib/carto/sgmap/api_spec.rb
@@ -20,6 +20,16 @@ describe CARTO::SGMAP::API do
end
end
+ context 'when request return 500' do
+ let(:geojson) { File.read('spec/support/files/geojson/request_qp.json') }
+ let(:status) { 500 }
+ let(:body) { 'toto' }
+
+ it 'raises RestClient::ResourceNotFound' do
+ expect { subject }.to raise_error(RestClient::ResourceNotFound)
+ end
+ end
+
context 'when geojson exist' do
let(:geojson) { File.read('spec/support/files/geojson/request_qp.json') }
let(:status) { 200 }
diff --git a/spec/lib/file_size_validator_spec.rb b/spec/lib/file_size_validator_spec.rb
new file mode 100644
index 000000000..aafde89c2
--- /dev/null
+++ b/spec/lib/file_size_validator_spec.rb
@@ -0,0 +1,48 @@
+require 'spec_helper'
+
+describe FileSizeValidator, lib: true do
+ let(:validator) { FileSizeValidator.new(options) }
+ let(:attachment) { CerfaUploader.new }
+ let(:note) { create(:cerfa) }
+
+ describe 'options uses an integer' do
+ let(:options) { { maximum: 10, attributes: { content: attachment } } }
+
+ it 'attachment exceeds maximum limit' do
+ allow(attachment).to receive(:size) { 100 }
+ validator.validate_each(note, :content, attachment)
+ expect(note.errors).to have_key(:content)
+ end
+
+ it 'attachment under maximum limit' do
+ allow(attachment).to receive(:size) { 1 }
+ validator.validate_each(note, :content, attachment)
+ expect(note.errors).not_to have_key(:content)
+ end
+ end
+
+ describe 'options uses a symbol' do
+ let(:options) do
+ {
+ maximum: :test,
+ attributes: { content: attachment }
+ }
+ end
+
+ before do
+ allow(note).to receive(:test) { 10 }
+ end
+
+ it 'attachment exceeds maximum limit' do
+ allow(attachment).to receive(:size) { 100 }
+ validator.validate_each(note, :content, attachment)
+ expect(note.errors).to have_key(:content)
+ end
+
+ it 'attachment under maximum limit' do
+ allow(attachment).to receive(:size) { 1 }
+ validator.validate_each(note, :content, attachment)
+ expect(note.errors).not_to have_key(:content)
+ end
+ end
+end
\ No newline at end of file
diff --git a/spec/lib/github/api_spec.rb b/spec/lib/github/api_spec.rb
new file mode 100644
index 000000000..f605391cc
--- /dev/null
+++ b/spec/lib/github/api_spec.rb
@@ -0,0 +1,26 @@
+require 'spec_helper'
+
+describe Github::API do
+
+ describe '.base_uri' do
+ it { expect(described_class.base_uri).to eq 'https://api.github.com' }
+ end
+
+ describe '.latest_release' do
+ subject { described_class.latest_release }
+
+ context 'when github is up', vcr: {cassette_name: 'github_lastrelease'} do
+ it { expect(subject).to be_a RestClient::Response }
+ it { expect(subject.code).to eq 200 }
+ end
+
+ context 'when github is down' do
+
+ before do
+ allow_any_instance_of(RestClient::Resource).to receive(:get).and_raise(RestClient::Forbidden)
+ end
+
+ it { is_expected.to be_nil }
+ end
+ end
+end
\ No newline at end of file
diff --git a/spec/lib/github/releases_spec.rb b/spec/lib/github/releases_spec.rb
new file mode 100644
index 000000000..41bcfc049
--- /dev/null
+++ b/spec/lib/github/releases_spec.rb
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe Github::Releases do
+
+ describe '.latest' do
+
+ subject { described_class.latest }
+
+ context 'when github is up', vcr: {cassette_name: 'github_lastrelease'} do
+ it { expect(subject.url).to eq 'https://api.github.com/repos/sgmap/tps/releases/4685573' }
+ it { expect(subject.body).to match /.*[Nouveautés].*/ }
+ it { expect(subject.published_at).to match /[0-9][0-9][\/][0-9][0-9][\/][0-9][0-9][0-9][0-9]/ }
+ end
+
+ context 'when github is down' do
+ before do
+ allow_any_instance_of(RestClient::Resource).to receive(:get).and_raise(RestClient::Forbidden)
+ end
+
+ it { is_expected.to be_nil }
+ end
+ end
+end
\ No newline at end of file
diff --git a/spec/mailers/notification_mailer_spec.rb b/spec/mailers/notification_mailer_spec.rb
index 34a373b35..1b54455c4 100644
--- a/spec/mailers/notification_mailer_spec.rb
+++ b/spec/mailers/notification_mailer_spec.rb
@@ -1,4 +1,4 @@
-require "rails_helper"
+require "spec_helper"
RSpec.describe NotificationMailer, type: :mailer do
describe ".new_answer" do
diff --git a/spec/models/administrateur_spec.rb b/spec/models/administrateur_spec.rb
index d41a54b36..238c3376f 100644
--- a/spec/models/administrateur_spec.rb
+++ b/spec/models/administrateur_spec.rb
@@ -42,4 +42,28 @@ describe Administrateur, type: :model do
expect(admin_1.api_token).to eq(new_token)
end
end
+
+ context 'unified login' do
+ it 'syncs credentials to associated user' do
+ administrateur = create(:administrateur)
+ user = create(:user, email: administrateur.email)
+
+ administrateur.update_attributes(email: 'whoami@plop.com', password: 'super secret')
+
+ user.reload
+ expect(user.email).to eq('whoami@plop.com')
+ expect(user.valid_password?('super secret')).to be(true)
+ end
+
+ it 'syncs credentials to associated administrateur' do
+ administrateur = create(:administrateur)
+ gestionnaire = create(:gestionnaire, email: administrateur.email)
+
+ administrateur.update_attributes(email: 'whoami@plop.com', password: 'super secret')
+
+ gestionnaire.reload
+ expect(gestionnaire.email).to eq('whoami@plop.com')
+ expect(gestionnaire.valid_password?('super secret')).to be(true)
+ end
+ end
end
diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb
index 6cc4ebed6..ddbf350ce 100644
--- a/spec/models/dossier_spec.rb
+++ b/spec/models/dossier_spec.rb
@@ -5,7 +5,6 @@ describe Dossier do
describe 'database columns' do
it { is_expected.to have_db_column(:autorisation_donnees) }
- it { is_expected.to have_db_column(:nom_projet) }
it { is_expected.to have_db_column(:created_at) }
it { is_expected.to have_db_column(:updated_at) }
it { is_expected.to have_db_column(:state) }
@@ -27,6 +26,7 @@ describe Dossier do
it { is_expected.to belong_to(:user) }
it { is_expected.to have_many(:invites) }
it { is_expected.to have_many(:follows) }
+ it { is_expected.to have_many(:notifications) }
end
describe 'delegation' do
@@ -639,7 +639,7 @@ describe Dossier do
it { expect(subject[:entreprise_nom]).to be_nil }
it { expect(subject[:entreprise_prenom]).to be_nil }
- it { expect(subject.count).to eq(EntrepriseSerializer.new(Entreprise.new).as_json[:entreprise].count + EtablissementSerializer.new(Etablissement.new).as_json[:etablissement].count) }
+ it { expect(subject.count).to eq(EntrepriseSerializer.new(Entreprise.new).as_json.count + EtablissementSerializer.new(Etablissement.new).as_json.count) }
end
describe '#export_default_columns' do
diff --git a/spec/models/drop_down_list_spec.rb b/spec/models/drop_down_list_spec.rb
new file mode 100644
index 000000000..523ab2ae1
--- /dev/null
+++ b/spec/models/drop_down_list_spec.rb
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+describe DropDownList do
+ describe 'database columns' do
+ it { is_expected.to have_db_column(:value) }
+ end
+
+ describe 'associations' do
+ it { is_expected.to belong_to(:type_de_champ) }
+ end
+
+ describe '#options' do
+ let(:value) { "Cohésion sociale
+Dév.Eco / Emploi
+Cadre de vie / Urb.
+Pilotage / Ingénierie
+" }
+ let(:dropdownlist) { create :drop_down_list, value: value }
+
+ it { expect(dropdownlist.options).to eq ["Cohésion sociale", "Dév.Eco / Emploi", "Cadre de vie / Urb.", "Pilotage / Ingénierie"] }
+
+ context 'when one value is empty' do
+ let(:value) { "Cohésion sociale
+
+Cadre de vie / Urb.
+Pilotage / Ingénierie
+" }
+
+ it { expect(dropdownlist.options).to eq ["Cohésion sociale", "Cadre de vie / Urb.", "Pilotage / Ingénierie"] }
+ end
+ end
+end
diff --git a/spec/models/france_connect_information_spec.rb b/spec/models/france_connect_information_spec.rb
index 515987a16..2bc10de48 100644
--- a/spec/models/france_connect_information_spec.rb
+++ b/spec/models/france_connect_information_spec.rb
@@ -1,4 +1,4 @@
-require 'rails_helper'
+require 'spec_helper'
describe FranceConnectInformation, type: :model do
describe 'database columns' do
diff --git a/spec/models/gestionnaire_spec.rb b/spec/models/gestionnaire_spec.rb
index 61f71acec..e61990c7b 100644
--- a/spec/models/gestionnaire_spec.rb
+++ b/spec/models/gestionnaire_spec.rb
@@ -1,4 +1,4 @@
-require 'rails_helper'
+require 'spec_helper'
describe Gestionnaire, type: :model do
let(:admin) { create :administrateur }
@@ -116,7 +116,7 @@ describe Gestionnaire, type: :model do
end
describe '#dossiers_follow' do
- let!(:dossier) { create :dossier, procedure: procedure }
+ let!(:dossier) { create :dossier, procedure: procedure, state: :initiated }
before do
create :follow, dossier_id: dossier.id, gestionnaire_id: gestionnaire.id
@@ -186,8 +186,6 @@ describe Gestionnaire, type: :model do
end
context 'unified login' do
- before { allow(Features).to receive(:unified_login).and_return(true) }
-
it 'syncs credentials to associated user' do
gestionnaire = create(:gestionnaire)
user = create(:user, email: gestionnaire.email)
@@ -198,5 +196,52 @@ describe Gestionnaire, type: :model do
expect(user.email).to eq('whoami@plop.com')
expect(user.valid_password?('super secret')).to be(true)
end
+
+ it 'syncs credentials to associated administrateur' do
+ gestionnaire = create(:gestionnaire)
+ admin = create(:administrateur, email: gestionnaire.email)
+
+ gestionnaire.update_attributes(email: 'whoami@plop.com', password: 'super secret')
+
+ admin.reload
+ expect(admin.email).to eq('whoami@plop.com')
+ expect(admin.valid_password?('super secret')).to be(true)
+ end
+ end
+
+ describe '#notifications_for' do
+ subject { gestionnaire.notifications_for procedure }
+
+ context 'when gestionnaire follow any dossier' do
+ it { is_expected.to eq 0 }
+ it { expect(gestionnaire.follows.count).to eq 0 }
+ it { expect_any_instance_of(Dossier::ActiveRecord_AssociationRelation).not_to receive(:inject)
+ subject }
+ end
+
+ context 'when gestionnaire follow any dossier into the procedure past in params' do
+ before do
+ create :follow, gestionnaire: gestionnaire, dossier: create(:dossier, procedure: procedure_2)
+ end
+
+ it { is_expected.to eq 0 }
+ it { expect(gestionnaire.follows.count).to eq 1 }
+ it { expect_any_instance_of(Dossier::ActiveRecord_AssociationRelation).not_to receive(:inject)
+ subject }
+ end
+
+ context 'when gestionnaire follow a dossier with a notification into the procedure past in params' do
+ let(:dossier) { create(:dossier, procedure: procedure, state: 'initiated') }
+
+ before do
+ create :follow, gestionnaire: gestionnaire, dossier: dossier
+ create :notification, dossier: dossier
+ end
+
+ it { is_expected.to eq 1 }
+ it { expect(gestionnaire.follows.count).to eq 1 }
+ it { expect_any_instance_of(Dossier::ActiveRecord_AssociationRelation).to receive(:inject)
+ subject }
+ end
end
end
diff --git a/spec/models/individual_spec.rb b/spec/models/individual_spec.rb
index e0d02e03b..b8d20aa42 100644
--- a/spec/models/individual_spec.rb
+++ b/spec/models/individual_spec.rb
@@ -1,6 +1,7 @@
require 'spec_helper'
describe Individual do
+ it { is_expected.to have_db_column(:gender) }
it { is_expected.to have_db_column(:nom) }
it { is_expected.to have_db_column(:prenom) }
it { is_expected.to have_db_column(:birthdate) }
diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb
new file mode 100644
index 000000000..0a945ff9f
--- /dev/null
+++ b/spec/models/notification_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe Notification do
+ it { is_expected.to have_db_column(:already_read) }
+ it { is_expected.to have_db_column(:liste) }
+ it { is_expected.to have_db_column(:type_notif) }
+ it { is_expected.to have_db_column(:created_at) }
+ it { is_expected.to have_db_column(:updated_at) }
+
+ it { is_expected.to belong_to(:dossier) }
+end
diff --git a/spec/models/quartier_prioritaire_spec.rb b/spec/models/quartier_prioritaire_spec.rb
index 50ae8dcb1..30c52cd47 100644
--- a/spec/models/quartier_prioritaire_spec.rb
+++ b/spec/models/quartier_prioritaire_spec.rb
@@ -7,4 +7,14 @@ describe QuartierPrioritaire do
it { is_expected.to have_db_column(:geometry) }
it { is_expected.to belong_to(:dossier) }
+
+ describe 'geometry' do
+
+ let(:qp) { create :quartier_prioritaire, geometry: qp_geometry }
+ let(:qp_geometry) { File.open('spec/support/files/qp_geometry_value.txt').read }
+
+ subject { qp.geometry }
+
+ it { is_expected.to eq JSON.parse(qp_geometry) }
+ end
end
diff --git a/spec/models/search_spec.rb b/spec/models/search_spec.rb
index 4e7d20ec2..ba760cdd6 100644
--- a/spec/models/search_spec.rb
+++ b/spec/models/search_spec.rb
@@ -1,4 +1,4 @@
-require 'rails_helper'
+require 'spec_helper'
describe Search do
describe '.results' do
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 3cbb0283c..8cac2f476 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1,4 +1,4 @@
-require 'rails_helper'
+require 'spec_helper'
describe User, type: :model do
describe 'database columns' do
@@ -74,8 +74,6 @@ describe User, type: :model do
end
context 'unified login' do
- before { allow(Features).to receive(:unified_login).and_return(true) }
-
it 'syncs credentials to associated gestionnaire' do
user = create(:user)
gestionnaire = create(:gestionnaire, email: user.email)
@@ -86,5 +84,16 @@ describe User, type: :model do
expect(gestionnaire.email).to eq('whoami@plop.com')
expect(gestionnaire.valid_password?('super secret')).to be(true)
end
+
+ it 'syncs credentials to associated administrateur' do
+ user = create(:user)
+ admin = create(:administrateur, email: user.email)
+
+ user.update_attributes(email: 'whoami@plop.com', password: 'super secret')
+
+ admin.reload
+ expect(admin.email).to eq('whoami@plop.com')
+ expect(admin.valid_password?('super secret')).to be(true)
+ end
end
end
diff --git a/spec/services/clamav_service_spec.rb b/spec/services/clamav_service_spec.rb
new file mode 100644
index 000000000..36bf7e20a
--- /dev/null
+++ b/spec/services/clamav_service_spec.rb
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe ClamavService do
+ describe '.safe_file?' do
+ let(:path_file) { '/tmp/plop.txt' }
+
+ subject { ClamavService.safe_file? path_file }
+
+ before do
+ allow_any_instance_of(ClamAV::Client).to receive(:initialize).and_return(ClamAV::Client)
+ allow_any_instance_of(ClamAV::Client).to receive(:execute).and_return([ClamAV::SuccessResponse])
+ end
+
+ it 'change permission of file path' do
+ allow(FileUtils).to receive(:chmod).with(0666, path_file).and_return(true)
+
+ subject
+ end
+ end
+end
\ No newline at end of file
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
new file mode 100644
index 000000000..d091c69b2
--- /dev/null
+++ b/spec/services/notification_service_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+describe NotificationService do
+
+ describe '.notify' do
+ let(:dossier) { create :dossier }
+ let(:service) { described_class.new type_notif, dossier.id }
+
+ subject { service.notify }
+
+ context 'when is the first notification for dossier_id and type_notif and alread_read is false' do
+ let(:type_notif) { 'commentaire' }
+
+ it { expect { subject }.to change(Notification, :count).by (1) }
+
+ context 'when is not the first notification' do
+ before do
+ create :notification, dossier: dossier, type_notif: type_notif
+ end
+
+ it { expect { subject }.to change(Notification, :count).by (0) }
+ end
+ end
+ end
+
+ describe 'text_for_notif' do
+ pending
+ end
+end
\ No newline at end of file
diff --git a/spec/services/render_partial_service_spec.rb b/spec/services/render_partial_service_spec.rb
new file mode 100644
index 000000000..ea94d3d5a
--- /dev/null
+++ b/spec/services/render_partial_service_spec.rb
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe RenderPartialService do
+ let(:service) { RenderPartialService.new(controller, method) }
+ let(:controller) { ApplicationController }
+ let(:method) { :index }
+
+ describe 'navbar' do
+ subject { service.navbar }
+
+ it { is_expected.to eq 'layouts/navbars/navbar_'+controller.to_s.parameterize + '_' + method.to_s }
+ end
+
+ describe 'left_panel' do
+ subject { service.left_panel }
+
+ it { is_expected.to eq 'layouts/left_panels/left_panel_'+controller.to_s.parameterize + '_' + method.to_s }
+ end
+
+ describe 'left_panel_exist?' do
+ pending
+ end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 38f9934da..4e7319f2a 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,9 +19,11 @@
ENV['RAILS_ENV'] ||= 'test'
-# require 'simplecov'
-# SimpleCov.start 'rails'
-# puts "required simplecov"
+if ENV['COV']
+ require 'simplecov'
+ SimpleCov.start 'rails'
+ puts "required simplecov"
+end
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
@@ -34,12 +36,14 @@ require 'factory_girl'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
+Capybara.ignore_hidden_elements = false
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, js_errors: true, port: 44_678 + ENV['TEST_ENV_NUMBER'].to_i, phantomjs_options: ['--proxy-type=none'], timeout: 180)
end
+ActiveSupport::Deprecation.silenced = true
-Capybara.default_wait_time = 1
+Capybara.default_max_wait_time = 1
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
@@ -75,20 +79,6 @@ module SmartListing
end
end
-class Features
- #def self.remote_storage
- # true
- #end
-
- def self.unified_login
- false
- end
-
- def self.opensimplif
- false
- end
-end
-
WebMock.disable_net_connect!(allow_localhost: true)
RSpec.configure do |config|
@@ -97,6 +87,9 @@ RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.tty = true
+ config.include Shoulda::Matchers::ActiveRecord, type: :model
+ config.include Shoulda::Matchers::ActiveModel, type: :model
+ config.include Shoulda::Matchers::Independent, type: :model
config.use_transactional_fixtures = false
@@ -106,8 +99,8 @@ RSpec.configure do |config|
config.order = 'random'
- config.include Devise::TestHelpers, type: :view
- config.include Devise::TestHelpers, type: :controller
+ config.include Devise::Test::ControllerHelpers, type: :controller
+ config.include Devise::Test::ControllerHelpers, type: :view
config.include FactoryGirl::Syntax::Methods
@@ -123,7 +116,7 @@ RSpec.configure do |config|
if Features.remote_storage
VCR.use_cassette("ovh_storage_init") do
CarrierWave.configure do |config|
- config.fog_credentials = { provider: 'OpenStack' }
+ config.fog_credentials = {provider: 'OpenStack'}
end
end
end
diff --git a/spec/support/controller_helpers.rb b/spec/support/controller_helpers.rb
index 4275b0ac9..97f2a814b 100644
--- a/spec/support/controller_helpers.rb
+++ b/spec/support/controller_helpers.rb
@@ -1,4 +1,4 @@
RSpec.configure do |config|
- config.include Devise::TestHelpers, type: :controller
+ # config.include Devise::TestHelpers, type: :controller
end
diff --git a/spec/support/files/qp_geometry_value.txt b/spec/support/files/qp_geometry_value.txt
new file mode 100644
index 000000000..48f65586f
--- /dev/null
+++ b/spec/support/files/qp_geometry_value.txt
@@ -0,0 +1 @@
+{"type":"MultiPolygon","coordinates":[[[[2.38715792094576,48.8723062632126],[2.38724851642619,48.8721392348061],[2.38678085384716,48.8719220893659],[2.38633738240483,48.8717237578549],[2.38609586027749,48.8716280999195],[2.38605124105111,48.8715945992388],[2.3860322294289,48.8714739763158],[2.38584201426809,48.871477436017],[2.38549018688243,48.8711988685955],[2.3847131238363,48.8711581514328],[2.38456321667197,48.871046276737],[2.38399052331168,48.8706208170053],[2.38360191758092,48.8708580436239],[2.38327605046433,48.8710901961983],[2.38309839743687,48.8712403530784],[2.38266225967958,48.8707713649412],[2.38241266242756,48.8706657452938],[2.38225272864375,48.8708522158955],[2.3816589129511,48.8706099279225],[2.38217684575416,48.8696293927465],[2.3813323946917,48.8693336454235],[2.38116284423201,48.8692617302053],[2.38102304120661,48.8692106353737],[2.38089564019462,48.8691470209824],[2.38046878406977,48.8689316744956],[2.38138018644769,48.8682641345705],[2.3827339154111,48.8672468211538],[2.38276764871741,48.8671817516194],[2.38280143346623,48.86711233313],[2.38320484958438,48.867166128404],[2.38351899626771,48.8672021358613],[2.38407130306803,48.867327647506],[2.38520873913933,48.8675766516676],[2.38540634609132,48.8672380292181],[2.38560931824849,48.8668888144892],[2.38575328614569,48.8669312917934],[2.38591109926571,48.8667019875268],[2.38608247325439,48.8664593865795],[2.38666746249723,48.8666154228843],[2.38701536810061,48.8667080313517],[2.38769179685241,48.8669156421332],[2.38900935039287,48.8673198797417],[2.38949419005144,48.8666604544278],[2.38962931386602,48.866531627899],[2.38965167069692,48.8664831775661],[2.38967299457085,48.8661124003313],[2.38969829850293,48.8659959856804],[2.38973026178903,48.8658270583162],[2.38978630142747,48.8656960367641],[2.38984706535962,48.8655128865008],[2.38939866205044,48.8653900952304],[2.38799947908499,48.8648613237082],[2.38727612482644,48.8645887321245],[2.38694662671035,48.8644565359098],[2.38664445103082,48.8648693394735],[2.38730003148295,48.8651088986138],[2.38702856851918,48.8656160912563],[2.38638397882637,48.865454705665],[2.3861549727405,48.8658006858579],[2.3857746963571,48.8663752048761],[2.38561263663448,48.8663286686078],[2.38546706691925,48.8663735933533],[2.38538036276113,48.8664579631081],[2.38540601228398,48.8665189837463],[2.38542609757617,48.866573975407],[2.38547057596048,48.8668485114634],[2.38507779908135,48.8675155002413],[2.3838732681436,48.867226601879],[2.38286537990766,48.8670017526772],[2.38129651181187,48.8666147483129],[2.38059252155565,48.8664348506944],[2.3801970311808,48.8663356744736],[2.3799301662615,48.8666508618816],[2.37925850064165,48.8673065930564],[2.3785647338769,48.8679828884228],[2.37846997413068,48.8680399505172],[2.37838805417244,48.868051223699],[2.37780968376037,48.8687667923651],[2.37748516369911,48.8692273669111],[2.3773861330759,48.8691863761821],[2.37687958488135,48.869025463728],[2.37630512358494,48.8688407980208],[2.37597254926961,48.8687230498181],[2.37507587633699,48.8684665601072],[2.37492768670682,48.8684333992801],[2.37439190673631,48.8690043766908],[2.37391591497758,48.8694740461451],[2.37332649157944,48.8700834111043],[2.37307231644407,48.8703599809689],[2.37289664296134,48.8705703907562],[2.37335014200329,48.8707229750483],[2.37351974048976,48.870790406631],[2.37369757821002,48.8708542927215],[2.37412205760839,48.8710390713461],[2.37427393633362,48.871108216843],[2.37438520998938,48.8711501751961],[2.37499080431527,48.8713547778326],[2.37507756519099,48.8713939041221],[2.37636624690889,48.8718416365513],[2.37609257147548,48.8721775047226],[2.37588132608287,48.8720993914931],[2.37577167753849,48.8722464601818],[2.37558693330393,48.8724817396403],[2.37520133944578,48.8723489389121],[2.37495662563781,48.8727176985769],[2.37465949141444,48.8731353900483],[2.37449630918011,48.8729116442696],[2.37442486314075,48.8728429195767],[2.37381777610594,48.8725366834313],[2.37293303754446,48.8720751871293],[2.37272648739235,48.8720192381635],[2.37195611319364,48.871802061146],[2.37155129417782,48.8722469050457],[2.371316312272,48.8725127740773],[2.37060074696615,48.8733993619047],[2.37031563028607,48.8737521970836],[2.3703324631712,48.8739384534716],[2.37032483861717,48.8741191635795],[2.37030717350514,48.8745633511804],[2.37031832081888,48.8752226185085],[2.37115209270841,48.8749347105359],[2.3712713448868,48.8748840856635],[2.37142731949166,48.8748381483797],[2.37175395297293,48.8747732979311],[2.37249018705873,48.8746602443171],[2.37318688709594,48.8745460942291],[2.37336988749776,48.8745218691668],[2.37402019201213,48.8742968423894],[2.37407172139682,48.874311022755],[2.37411755847646,48.8743373575228],[2.3741631163138,48.8743876167128],[2.37500604651213,48.873652616334],[2.37631214864991,48.872504643992],[2.37682235233832,48.8720201650376],[2.377060807185,48.8721111312308],[2.37747228107229,48.8722463592837],[2.37764347562913,48.8722940275693],[2.3781164440579,48.8724187972395],[2.37870228889716,48.8725657296093],[2.37922004888481,48.8727069207783],[2.37983448272221,48.8728557980653],[2.38055413098825,48.8729890232522],[2.38191008538867,48.8732676299099],[2.38259976775091,48.8733970942162],[2.38308555462766,48.873476033271],[2.38344597173961,48.8732053917987],[2.38383745217691,48.8728850499623],[2.38424290942455,48.8731208753131],[2.38421016360887,48.8731589861482],[2.3845880512008,48.8733122551963],[2.38496227923534,48.8728909750237],[2.38575864042278,48.8732077898345],[2.38592069747405,48.8729101518962],[2.3862548101951,48.8729882675479],[2.38629686945576,48.8729038198139],[2.38689176242455,48.873094061243],[2.38730637511344,48.872481244183],[2.38698319693408,48.8724041533073],[2.3870377063482,48.8722764552525],[2.38715792094576,48.8723062632126]]]]}
\ No newline at end of file
diff --git a/spec/support/shared_exemples_for_dossier.rb b/spec/support/shared_exemples_for_dossier.rb
index d3462e894..7a39ffa22 100644
--- a/spec/support/shared_exemples_for_dossier.rb
+++ b/spec/support/shared_exemples_for_dossier.rb
@@ -4,7 +4,7 @@ RSpec.shared_examples 'not owner of dossier' do |controller, redirect|
let(:dossier_2) { create(:dossier) }
before do
- get controller, dossier_id: dossier_2.id
+ get controller, params:{dossier_id: dossier_2.id}
end
it 'redirect to home page' do
diff --git a/spec/support/wait_for_ajax.rb b/spec/support/wait_for_ajax.rb
index 698ba493c..a81aac2af 100644
--- a/spec/support/wait_for_ajax.rb
+++ b/spec/support/wait_for_ajax.rb
@@ -1,7 +1,7 @@
# spec/support/wait_for_ajax.rb
module WaitForAjax
def wait_for_ajax
- Timeout.timeout(Capybara.default_wait_time) do
+ Timeout.timeout(Capybara.default_max_wait_time) do
loop until finished_all_ajax_requests?
end
end
diff --git a/spec/uploaders/base_uploader_spec.rb b/spec/uploaders/base_uploader_spec.rb
new file mode 100644
index 000000000..5adf98b35
--- /dev/null
+++ b/spec/uploaders/base_uploader_spec.rb
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+describe BaseUploader do
+ let(:uploader) { described_class.new }
+
+ describe '#cache_dir' do
+
+ subject { uploader.cache_dir }
+
+ context 'when rails env is not production' do
+ it { is_expected.to eq '/tmp/tps-dev-cache' }
+ end
+
+ context 'when rails env is not production' do
+ before do
+ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
+ end
+
+ it { is_expected.to eq '/tmp/tps-cache' }
+
+ context 'when is opensimplif' do
+ before do
+ allow(Features).to receive(:opensimplif?).and_return(true)
+ end
+
+ it { is_expected.to eq '/tmp/opensimplif-cache' }
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/spec/uploaders/remote_downloader_spec.rb b/spec/uploaders/remote_downloader_spec.rb
new file mode 100644
index 000000000..f2e7e7770
--- /dev/null
+++ b/spec/uploaders/remote_downloader_spec.rb
@@ -0,0 +1,12 @@
+require 'spec_helper'
+
+describe RemoteDownloader do
+
+ let(:filename) { 'file_name.pdf' }
+
+ subject { described_class.new filename }
+
+ describe '#url' do
+ it { expect(subject.url).to eq 'https://storage.apientreprise.fr/tps_dev/file_name.pdf' }
+ end
+end
\ No newline at end of file
diff --git a/spec/views/admin/gestionnaires/index.html.haml_spec.rb b/spec/views/admin/gestionnaires/index.html.haml_spec.rb
index 222b43b2c..9c57ee063 100644
--- a/spec/views/admin/gestionnaires/index.html.haml_spec.rb
+++ b/spec/views/admin/gestionnaires/index.html.haml_spec.rb
@@ -29,6 +29,6 @@ describe 'admin/gestionnaires/index.html.haml', type: :view do
array: true))
render
end
- it { expect(rendered).to match(/plop\d+@plop.com/) }
+ it { expect(rendered).to match(/gest\d+@plop.com/) }
end
end
\ No newline at end of file
diff --git a/spec/views/admin/previsualisations/show.html.haml_spec.rb b/spec/views/admin/previsualisations/show.html.haml_spec.rb
index 82263c78b..f0983b660 100644
--- a/spec/views/admin/previsualisations/show.html.haml_spec.rb
+++ b/spec/views/admin/previsualisations/show.html.haml_spec.rb
@@ -1,6 +1,10 @@
require 'spec_helper'
describe 'admin/previsualisations/show.html.haml', type: :view do
+ before do
+ @request.env['HTTP_REFERER'] = admin_procedures_url
+ end
+
let(:user) { create(:user) }
let(:cerfa_flag) { true }
let(:procedure) { create(:procedure, :with_two_type_de_piece_justificative, :with_type_de_champ, cerfa_flag: cerfa_flag) }
@@ -79,13 +83,11 @@ describe 'admin/previsualisations/show.html.haml', type: :view do
describe 'first champs' do
subject { dossier.champs.first }
- it { expect(rendered).to have_css(".type_champ-#{subject.type_champ}") }
it { expect(rendered).to have_css("#champs_#{subject.id}") }
end
describe 'last champs' do
subject { dossier.champs.last }
- it { expect(rendered).to have_css(".type_champ-#{subject.type_champ}") }
it { expect(rendered).to have_css("#champs_#{subject.id}") }
end
end
@@ -102,12 +104,6 @@ describe 'admin/previsualisations/show.html.haml', type: :view do
expect(rendered).to have_css("#piece_justificative_#{all_type_pj_procedure_id[0]}")
end
end
-
- context 'la liste des pièces récupérées automatiquement est signaliée' do
- it 'Attestation MSA' do
- expect(rendered).to have_selector("#piece_justificative_#{all_type_pj_procedure_id[1]}", "Nous l'avons récupéré pour vous.")
- end
- end
end
context 'Envoi des CERFA désactivé' do
diff --git a/spec/views/admin/procedures/show.html.haml_spec.rb b/spec/views/admin/procedures/show.html.haml_spec.rb
index 71fcbfed6..445685f4e 100644
--- a/spec/views/admin/procedures/show.html.haml_spec.rb
+++ b/spec/views/admin/procedures/show.html.haml_spec.rb
@@ -30,7 +30,7 @@ describe 'admin/procedures/show.html.haml', type: :view do
end
describe 'publish button is visible' do
- it { expect(rendered).to have_css('a#publish') }
+ it { expect(rendered).to have_css('a#publish-procedure') }
it { expect(rendered).not_to have_css('button#archive') }
it { expect(rendered).not_to have_css('a#reenable') }
end
diff --git a/spec/views/backoffice/dossiers/index_html.haml_spec.rb b/spec/views/backoffice/dossiers/index_html.haml_spec.rb
index 879b76cf2..84a3eef1f 100644
--- a/spec/views/backoffice/dossiers/index_html.haml_spec.rb
+++ b/spec/views/backoffice/dossiers/index_html.haml_spec.rb
@@ -16,6 +16,12 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do
let!(:decorate_dossier_refused) { create(:dossier, :with_entreprise, procedure: procedure, state: 'refused').decorate }
let!(:decorate_dossier_without_continuation) { create(:dossier, :with_entreprise, procedure: procedure, state: 'without_continuation').decorate }
+ let(:dossiers_list_facade) { DossiersListFacades.new gestionnaire, nil }
+
+ let(:new_dossiers_list) { dossiers_list_facade.service.nouveaux }
+ let(:follow_dossiers_list) { dossiers_list_facade.service.suivi }
+ let(:all_state_dossiers_list) { dossiers_list_facade.service.all_state }
+
before do
decorate_dossier_replied.entreprise.update_column(:raison_sociale, 'plap')
decorate_dossier_updated.entreprise.update_column(:raison_sociale, 'plep')
@@ -52,120 +58,42 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do
create :assign_to, gestionnaire: gestionnaire, procedure: procedure
sign_in gestionnaire
+
+ assign :facade_data_view, dossiers_list_facade
+
+ assign(:new_dossiers, (smart_listing_create :new_dossiers,
+ new_dossiers_list,
+ partial: "backoffice/dossiers/list",
+ array: true))
+
+ assign(:follow_dossiers, (smart_listing_create :follow_dossiers,
+ follow_dossiers_list,
+ partial: "backoffice/dossiers/list",
+ array: true))
+
+ assign(:all_state_dossiers, (smart_listing_create :all_state_dossiers,
+ all_state_dossiers_list,
+ partial: "backoffice/dossiers/list",
+ array: true))
+
+ render
end
- shared_examples 'check_tab_content' do
- before do
- assign :dossiers_list_facade, (DossiersListFacades.new gestionnaire, liste)
- assign(:dossiers, (smart_listing_create :dossiers,
- dossiers_to_display,
- partial: "backoffice/dossiers/list",
- array: true))
- render
- end
+ subject { rendered }
- subject { rendered }
+ it { is_expected.to have_content('Nouveaux dossiers 1 dossiers') }
+ it { is_expected.to have_content('Dossiers suivis 0 dossiers') }
+ it { is_expected.to have_content('Tous les dossiers 9 dossiers') }
- describe 'pref list column' do
- it { is_expected.to have_css('#backoffice_index') }
- it { is_expected.to have_content(procedure.libelle) }
- it { is_expected.to have_content(decorate_dossier_at_check.entreprise.raison_sociale) }
- it { is_expected.to have_content(decorate_dossier_at_check.display_state) }
- it { is_expected.to have_content(decorate_dossier_at_check.last_update) }
- end
+ it { is_expected.to have_content('État') }
+ it { is_expected.to have_content('Libellé procédure') }
+ it { is_expected.to have_content('Raison sociale') }
+ it { is_expected.to have_content('Mise à jour le') }
- it { is_expected.to have_css("#suivre_dossier_#{dossiers_to_display.first.id}") }
-
- it { expect(dossiers_to_display.count).to eq total_dossiers }
-
- describe 'active tab' do
- it { is_expected.to have_selector(active_class) }
- end
- end
-
- describe 'on tab nouveaux' do
- let(:total_dossiers) { 1 }
- let(:active_class) { '.active .text-info' }
- let(:dossiers_to_display) { gestionnaire.dossiers.nouveaux }
- let(:liste) { 'nouveaux' }
-
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_initiated }
- end
- end
-
- describe 'on tab a_traiter' do
- let(:total_dossiers) { 2 }
- let(:active_class) { '.active .text-danger' }
- let(:dossiers_to_display) { gestionnaire.dossiers.ouvert }
- let(:liste) { 'a_traiter' }
-
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_updated }
- end
-
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_replied }
- end
- end
-
- describe 'on tab figes' do
- let(:total_dossiers) { 1 }
- let(:active_class) { '.active .text-default' }
- let(:dossiers_to_display) { gestionnaire.dossiers.fige }
- let(:liste) { 'fige' }
-
- describe 'for state replied' do
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_validated }
- end
- end
- end
-
- describe 'on tab deposes' do
- let(:total_dossiers) { 1 }
- let(:active_class) { '.active .text-purple' }
- let(:dossiers_to_display) { gestionnaire.dossiers.deposes }
- let(:liste) { 'deposes' }
-
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_submitted }
- end
- end
-
- describe 'on tab a_instruire' do
- let(:total_dossiers) { 1 }
- let(:active_class) { '.active .text-warning' }
- let(:dossiers_to_display) { gestionnaire.dossiers.a_instruire }
- let(:liste) { 'a_instruire' }
-
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_received }
- end
- end
-
- describe 'on tab termine' do
- let(:total_dossiers) { 3 }
- let(:active_class) { '.active .text-success' }
- let(:dossiers_to_display) { gestionnaire.dossiers.termine }
- let(:liste) { 'termine' }
-
- describe 'for state closed' do
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_closed }
- end
- end
-
- describe 'for state refused' do
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_refused }
- end
- end
-
- describe 'for state without_continuation' do
- it_behaves_like 'check_tab_content' do
- let(:decorate_dossier_at_check) { decorate_dossier_without_continuation }
- end
- end
- end
+ it { is_expected.to have_content('plap') }
+ it { is_expected.to have_content('plep') }
+ it { is_expected.to have_content('plip') }
+ it { is_expected.to have_content('plop') }
+ it { is_expected.to have_content('plup') }
+ it { is_expected.to have_content('plyp') }
end
\ No newline at end of file
diff --git a/spec/views/backoffice/dossiers/show.html.html_spec.rb b/spec/views/backoffice/dossiers/show.html.html_spec.rb
index d09aadeaa..4003a65ef 100644
--- a/spec/views/backoffice/dossiers/show.html.html_spec.rb
+++ b/spec/views/backoffice/dossiers/show.html.html_spec.rb
@@ -31,11 +31,6 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do
expect(rendered).to have_selector('#infos_dossier')
end
- it 'dossier number is present' do
- expect(rendered).to have_selector('#dossier_id')
- expect(rendered).to have_content(dossier_id)
- end
-
context 'edit link are present' do
it 'edit carto' do
expect(rendered).to_not have_selector('a[id=modif_carte]')
@@ -50,199 +45,4 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do
end
end
end
-
- context 'dossier state changements' do
- context 'when dossier have state initiated' do
- let(:state) { 'initiated' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Nouveau') }
-
- it 'button Déclarer complet is present' do
- expect(rendered).to have_css('.action_button')
- expect(rendered).to have_content('Déclarer complet')
- end
- end
-
- context 'when dossier have state replied' do
- let(:state) { 'replied' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Répondu') }
-
- it 'button Déclarer complet is present' do
- expect(rendered).to have_css('.action_button')
- expect(rendered).to have_content('Déclarer complet')
- end
- end
-
- context 'when dossier have state update' do
- let(:state) { 'updated' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Mis à jour') }
-
- it 'button Déclarer complet is present' do
- expect(rendered).to have_css('.action_button')
- expect(rendered).to have_content('Déclarer complet')
- end
- end
-
- context 'when dossier have state validated' do
- let(:state) { 'validated' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Figé') }
-
- it 'button Déclarer complet is not present' do
- expect(rendered).not_to have_css('.action_button')
- expect(rendered).not_to have_content('Déclarer complet')
- end
- end
-
- context 'when dossier have state submitted' do
- let(:state) { 'submitted' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Déposé') }
-
- it 'button Accuser réception is present' do
- expect(rendered).to have_css('.action_button')
- expect(rendered).to have_content('Accuser réception')
- end
-
- it 'button Déclarer complet is not present' do
- expect(rendered).not_to have_content('Accepter le dossier')
- end
- end
-
- context 'when dossier have state received' do
- let(:state) { 'received' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Reçu') }
-
- it 'button accepter / refuser / classer sans suite are present' do
- expect(rendered).to have_css('.action_button[data-toggle="tooltip"][title="Accepter"]')
- expect(rendered).to have_css('.action_button[data-toggle="tooltip"][title="Classer sans suite"]')
- expect(rendered).to have_css('.action_button[data-toggle="tooltip"][title="Refuser"]')
- end
- end
-
- context 'when dossier have state closed' do
- let(:state) { 'closed' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Accepté') }
-
- it 'button Accepter le dossier is not present' do
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Accepter"]')
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Classer sans suite"]')
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Refuser"]')
- end
- end
-
- context 'when dossier have state without_continuation' do
- let(:state) { 'without_continuation' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Sans suite') }
-
- it 'button Déclarer complet is not present' do
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Accepter"]')
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Classer sans suite"]')
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Refuser"]')
- end
- end
-
- context 'when dossier have state refused' do
- let(:state) { 'refused' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Refusé') }
-
- it 'button Déclarer complet is not present' do
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Accepter"]')
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Classer sans suite"]')
- expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Refuser"]')
- end
- end
- end
-
- #TODO réactiver
- # context 'la liste des pièces justificatives est présente' do
- # context 'Attestation MSA' do
- # let(:id_piece_justificative) { 93 }
- #
- # it 'la ligne de la pièce justificative est présente' do
- # expect(rendered).to have_selector("tr[id=piece_justificative_#{id_piece_justificative}]")
- # end
- #
- # it 'le bouton "Récupérer" est présent' do
- # expect(rendered.find("tr[id=piece_justificative_#{id_piece_justificative}]")).to have_selector("a[href='']")
- # expect(rendered.find("tr[id=piece_justificative_#{id_piece_justificative}]")).to have_content('Récupérer')
- # end
- # end
- #
- # context 'Attestation RDI' do
- # let(:id_piece_justificative) { 103 }
- #
- # it 'la ligne de la pièce justificative est présente' do
- # expect(rendered).to have_selector("tr[id=piece_justificative_#{id_piece_justificative}]")
- # end
- #
- # it 'le libelle "Pièce manquante" est présent' do
- # expect(rendered.find("tr[id=piece_justificative_#{id_piece_justificative}]")).to have_content('Pièce non fournie')
- # end
- # end
- #
- # context 'Devis' do
- # let(:id_piece_justificative) { 388 }
- # let(:content) { File.open('./spec/support/files/piece_justificative_388.pdf') }
- #
- # before do
- # piece_justificative = dossier.pieces_justificatives.where(type_de_piece_justificative_id: 388).first
- # piece_justificative.content = content
- # piece_justificative.save!
- # visit "/admin/dossiers/#{dossier_id}"
- # end
- #
- # it 'la ligne de la pièce justificative est présente' do
- # expect(rendered).to have_selector("tr[id=piece_justificative_#{id_piece_justificative}]")
- # end
- #
- # it 'le libelle "Consulter" est présent' do
- # expect(rendered.find("tr[id=piece_justificative_#{id_piece_justificative}] a")[:href]).to have_content('piece_justificative_388.pdf')
- # expect(rendered.find("tr[id=piece_justificative_#{id_piece_justificative}]")).to have_content('Consulter')
- # end
- # end
- # end
- #
end
diff --git a/spec/views/dossiers/_infos_dossier_spec.rb b/spec/views/dossiers/_infos_dossier_spec.rb
index cb77000e1..ed6c1e76f 100644
--- a/spec/views/dossiers/_infos_dossier_spec.rb
+++ b/spec/views/dossiers/_infos_dossier_spec.rb
@@ -21,9 +21,5 @@ describe 'dossiers/_infos_dossier.html.haml', type: :view do
it { expect(rendered).to have_content(champs.last.libelle) }
it { expect(rendered).to have_content(champs.last.value) }
-
- context 'when api carto is used' do
- it { expect(rendered).to have_css('#map') }
- end
end
end
diff --git a/spec/views/layouts/_navbar_spec.rb b/spec/views/layouts/_navbar_spec.rb
index c9e9b887e..a23f67cae 100644
--- a/spec/views/layouts/_navbar_spec.rb
+++ b/spec/views/layouts/_navbar_spec.rb
@@ -13,12 +13,7 @@ describe 'layouts/_navbar.html.haml', type: :view do
render
end
subject { rendered }
- it { is_expected.to match(/href="\/users\/sign_in">Utilisateur/) }
- it { is_expected.to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) }
- it { is_expected.to match(/href="\/administrateurs\/sign_in">Administrateur/) }
- it { is_expected.not_to match(/Mes Dossiers/) }
- it { is_expected.not_to match(/Mes Procédures/) }
- it { is_expected.not_to match(/Se déconnecter/) }
+ it { is_expected.to match(/Connexion/) }
end
context 'when administrateur is connected' do
@@ -30,12 +25,7 @@ describe 'layouts/_navbar.html.haml', type: :view do
end
subject { rendered }
- it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) }
- it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) }
- it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) }
- it { is_expected.not_to match(/Mes dossiers/) }
- it { is_expected.to match(/Mes procédures/) }
- it { is_expected.to match(/Se déconnecter/) }
+ it { is_expected.to match(/Déconnexion/) }
end
context 'when gestionnaire is connected' do
@@ -47,11 +37,6 @@ describe 'layouts/_navbar.html.haml', type: :view do
end
subject { rendered }
- it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) }
- it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) }
- it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) }
- it { is_expected.not_to match(/Mes procédures/) }
- it { is_expected.to match(/Mes dossiers/) }
it { is_expected.to match(/Déconnexion/) }
end
diff --git a/spec/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show_spec.rb b/spec/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show_spec.rb
new file mode 100644
index 000000000..cf3c4b45b
--- /dev/null
+++ b/spec/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_show_spec.rb
@@ -0,0 +1,170 @@
+require 'spec_helper'
+
+describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml', type: :view do
+
+ let!(:dossier) { create(:dossier, :with_entreprise, state: state) }
+ let(:state) { 'draft' }
+ let(:gestionnaire) { create(:gestionnaire) }
+
+ before do
+ sign_in gestionnaire
+ assign(:facade, (DossierFacades.new dossier.id, gestionnaire.email))
+
+ @request.env['PATH_INFO'] = 'backoffice/user'
+
+ render
+ end
+
+ subject { rendered }
+
+ it 'dossier number is present' do
+ expect(rendered).to have_selector('#dossier_id')
+ expect(rendered).to have_content(dossier.id)
+ end
+
+ context 'button dossier state changements' do
+ context 'when dossier have state initiated' do
+ let(:state) { 'initiated' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Nouveau') }
+
+ it 'button Déclarer complet is present' do
+ expect(rendered).to have_css('.action')
+ expect(rendered).to have_content('DÉCLARER COMPLET')
+ end
+ end
+
+ context 'when dossier have state replied' do
+ let(:state) { 'replied' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Répondu') }
+
+ it 'button Déclarer complet is present' do
+ expect(rendered).to have_css('.action')
+ expect(rendered).to have_content('DÉCLARER COMPLET')
+ end
+ end
+
+ context 'when dossier have state update' do
+ let(:state) { 'updated' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Mis à jour') }
+
+ it 'button Déclarer complet is present' do
+ expect(rendered).to have_css('.action')
+ expect(rendered).to have_content('DÉCLARER COMPLET')
+ end
+ end
+
+ context 'when dossier have state validated' do
+ let(:state) { 'validated' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Figé') }
+
+ it 'button Déclarer complet is not present' do
+ expect(rendered).not_to have_css('.action')
+ expect(rendered).not_to have_content('Déclarer complet')
+ end
+ end
+
+ context 'when dossier have state submitted' do
+ let(:state) { 'submitted' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Déposé') }
+
+ it 'button Accuser réception is present' do
+ expect(rendered).to have_css('.action')
+ expect(rendered).to have_content('ACCUSER RÉCEPTION')
+ end
+
+ it 'button Déclarer complet is not present' do
+ expect(rendered).not_to have_content('Accepter le dossier')
+ end
+ end
+
+ context 'when dossier have state received' do
+ let(:state) { 'received' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Reçu') }
+
+ it 'button accepter / refuser / classer sans suite are present' do
+ expect(rendered).to have_css('form[data-toggle="tooltip"][title="Accepter"]')
+ expect(rendered).to have_css('form[data-toggle="tooltip"][title="Classer sans suite"]')
+ expect(rendered).to have_css('form[data-toggle="tooltip"][title="Refuser"]')
+ end
+ end
+
+ context 'when dossier have state closed' do
+ let(:state) { 'closed' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Accepté') }
+
+ it 'button Accepter le dossier is not present' do
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Accepter"]')
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Classer sans suite"]')
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Refuser"]')
+ end
+ end
+
+ context 'when dossier have state without_continuation' do
+ let(:state) { 'without_continuation' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Sans suite') }
+
+ it 'button Déclarer complet is not present' do
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Accepter"]')
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Classer sans suite"]')
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Refuser"]')
+ end
+ end
+
+ context 'when dossier have state refused' do
+ let(:state) { 'refused' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Refusé') }
+
+ it 'button Déclarer complet is not present' do
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Accepter"]')
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Classer sans suite"]')
+ expect(rendered).not_to have_css('form[data-toggle="tooltip"][title="Refuser"]')
+ end
+ end
+ end
+
+end
\ No newline at end of file
diff --git a/spec/views/layouts/left_panels/_left_panel_users_dossierscontroller_index_spec.rb b/spec/views/layouts/left_panels/_left_panel_users_dossierscontroller_index_spec.rb
new file mode 100644
index 000000000..51958638c
--- /dev/null
+++ b/spec/views/layouts/left_panels/_left_panel_users_dossierscontroller_index_spec.rb
@@ -0,0 +1,65 @@
+require 'spec_helper'
+
+describe 'layouts/left_panels/_left_panel_users_dossierscontroller_index.html.haml', type: :view do
+
+ shared_examples 'active_tab' do
+ let(:user) { create :user }
+
+ before do
+ sign_in user
+
+ assign :dossiers_list_facade, (DossiersListFacades.new user, param_list)
+
+ render
+ end
+
+ subject { rendered }
+
+ let(:active_class) { 'div.procedure_list_element.active '+active_klass }
+ let(:param_list) { liste }
+
+ it { is_expected.to have_selector(active_class) }
+ end
+
+ describe 'list brouillon' do
+ let(:active_klass) { '.progress-bar-default' }
+ let(:liste) { 'brouillon' }
+
+ it_behaves_like 'active_tab'
+ end
+
+ describe 'list en construction' do
+ let(:active_klass) { '.progress-bar-danger' }
+ let(:liste) { 'a_traiter' }
+
+ it_behaves_like 'active_tab'
+ end
+
+ describe 'list a depose' do
+ let(:active_klass) { '.progress-bar-purple' }
+ let(:liste) { 'valides' }
+
+ it_behaves_like 'active_tab'
+ end
+
+ describe 'list en examen' do
+ let(:active_klass) { '.progress-bar-default' }
+ let(:liste) { 'en_instruction' }
+
+ it_behaves_like 'active_tab'
+ end
+
+ describe 'list cloture' do
+ let(:active_klass) { '.progress-bar-success' }
+ let(:liste) { 'termine' }
+
+ it_behaves_like 'active_tab'
+ end
+
+ describe 'list invite' do
+ let(:active_klass) { '.progress-bar-warning' }
+ let(:liste) { 'invite' }
+
+ it_behaves_like 'active_tab'
+ end
+end
\ No newline at end of file
diff --git a/spec/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show_spec.rb b/spec/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show_spec.rb
new file mode 100644
index 000000000..3271d23ce
--- /dev/null
+++ b/spec/views/layouts/left_panels/_left_panel_users_recapitulatifcontroller_show_spec.rb
@@ -0,0 +1,123 @@
+require 'spec_helper'
+
+describe 'layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.html.haml', type: :view do
+ let(:dossier) { create(:dossier, :with_entreprise, state: state, procedure: create(:procedure, :with_api_carto, :with_two_type_de_piece_justificative, for_individual: true, individual_with_siret: true)) }
+ let(:dossier_id) { dossier.id }
+ let(:state) { 'draft' }
+
+ before do
+ sign_in dossier.user
+ assign(:facade, DossierFacades.new(dossier.id, dossier.user.email))
+ end
+
+ context 'buttons to change dossier state' do
+ context 'when dossier state is initiated' do
+ let(:state) { 'initiated' }
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Nouveau') }
+ end
+
+ context 'when dossier state is replied' do
+ let(:state) { 'replied' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Répondu') }
+ end
+
+ context 'when dossier state is updated' do
+ let(:state) { 'updated' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Mis à jour') }
+ end
+
+ context 'when dossier state is validated' do
+ let(:state) { 'validated' }
+
+ before do
+ render
+ end
+
+ it 'button Procéder au dépôt définitif est present' do
+ expect(rendered).to have_css('#validate_button')
+ expect(rendered).to have_content('Procéder au dépôt définitif')
+ end
+
+ it 'button Editer mon dossier n\'est plus present' do
+ expect(rendered).not_to have_css('#maj_infos')
+ expect(rendered).not_to have_content('Modifier mon dossier')
+ end
+
+ it 'button Modifier les document n\'est plus present' do
+ expect(rendered).not_to have_content('Modifier les documents')
+ end
+ end
+
+ context 'when dossier state is submitted' do
+ let(:state) { 'submitted' }
+
+ before do
+ render
+ end
+
+ it { expect(rendered).to have_content('Déposé') }
+
+ it 'button Editer mon dossier n\'est plus present' do
+ expect(rendered).not_to have_css('#maj_infos')
+ expect(rendered).not_to have_content('Modifier mon dossier')
+ end
+ end
+
+ context 'when dossier state is closed' do
+ let(:state) { 'closed' }
+
+ before do
+ render
+ end
+ it { expect(rendered).to have_content('Accepté') }
+
+ it 'button Editer mon dossier n\'est plus present' do
+ expect(rendered).not_to have_css('#maj_infos')
+ expect(rendered).not_to have_content('Modifier mon dossier')
+ end
+ end
+
+ context 'when dossier state is refused' do
+ let(:state) { 'refused' }
+
+ before do
+ render
+ end
+ it { expect(rendered).to have_content('Refusé') }
+
+ it 'button Editer mon dossier n\'est plus present' do
+ expect(rendered).not_to have_css('#maj_infos')
+ expect(rendered).not_to have_content('Modifier mon dossier')
+ end
+ end
+
+ context 'when dossier state is without_continuation' do
+ let(:state) { 'without_continuation' }
+
+ before do
+ render
+ end
+ it { expect(rendered).to have_content('Sans suite') }
+
+ it 'button Editer mon dossier n\'est plus present' do
+ expect(rendered).not_to have_css('#maj_infos')
+ expect(rendered).not_to have_content('Modifier mon dossier')
+ end
+ end
+ end
+
+end
\ No newline at end of file
diff --git a/spec/views/users/carte/show.html.haml_spec.rb b/spec/views/users/carte/show.html.haml_spec.rb
index f80425633..a20b907f0 100644
--- a/spec/views/users/carte/show.html.haml_spec.rb
+++ b/spec/views/users/carte/show.html.haml_spec.rb
@@ -23,7 +23,7 @@ describe 'users/carte/show.html.haml', type: :view do
context 'présence des inputs hidden' do
it 'stockage du json des polygons dessinés' do
- expect(rendered).to have_selector('input[type=hidden][id=json_latlngs][name=json_latlngs]')
+ expect(rendered).to have_selector('input[type=hidden][id=json_latlngs][name=json_latlngs]', visible: false)
end
end
diff --git a/spec/views/users/description/show.html.haml_spec.rb b/spec/views/users/description/show.html.haml_spec.rb
index 4a44776b7..8d4434af2 100644
--- a/spec/views/users/description/show.html.haml_spec.rb
+++ b/spec/views/users/description/show.html.haml_spec.rb
@@ -73,13 +73,11 @@ describe 'users/description/show.html.haml', type: :view do
describe 'first champs' do
subject { dossier.champs.first }
- it { expect(rendered).to have_css(".type_champ-#{subject.type_champ}") }
it { expect(rendered).to have_css("#champs_#{subject.id}") }
end
describe 'last champs' do
subject { dossier.champs.last }
- it { expect(rendered).to have_css(".type_champ-#{subject.type_champ}") }
it { expect(rendered).to have_css("#champs_#{subject.id}") }
end
@@ -102,12 +100,6 @@ describe 'users/description/show.html.haml', type: :view do
expect(rendered).to have_css("#piece_justificative_#{all_type_pj_procedure_id[0]}")
end
end
-
- context 'la liste des pièces récupérées automatiquement est signaliée' do
- it 'Attestation MSA' do
- expect(rendered).to have_selector("#piece_justificative_#{all_type_pj_procedure_id[1]}", "Nous l'avons récupéré pour vous.")
- end
- end
end
context 'Envoi des CERFA désactivé' do
diff --git a/spec/views/users/dossiers/index_html.haml_spec.rb b/spec/views/users/dossiers/index_html.haml_spec.rb
index 6cc25cc27..72d7381a0 100644
--- a/spec/views/users/dossiers/index_html.haml_spec.rb
+++ b/spec/views/users/dossiers/index_html.haml_spec.rb
@@ -40,10 +40,6 @@ describe 'users/dossiers/index.html.haml', type: :view do
end
it { expect(dossiers_to_display.count).to eq total_dossiers }
-
- describe 'active tab' do
- it { is_expected.to have_selector(active_class) }
- end
end
describe 'on tab en construction' do
diff --git a/spec/views/users/recapitulatif/_commentaires_flux_spec.rb b/spec/views/users/recapitulatif/_commentaires_flux_spec.rb
deleted file mode 100644
index b930f8d18..000000000
--- a/spec/views/users/recapitulatif/_commentaires_flux_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'spec_helper'
-
-describe 'users/recapitulatif/_commentaires_flux.html.haml', type: :view, vcr: { cassette_name: 'views_users_recapitulatif_commentaires_flux' } do
- let(:dossier) { create(:dossier) }
- let(:dossier_id) { dossier.id }
- let(:email_commentaire) { 'mon_mail_de_commentaire@test.com' }
-
- let(:document_upload) { Rack::Test::UploadedFile.new("./spec/support/files/piece_justificative_0.pdf", 'application/pdf') }
- let(:pj) { create :piece_justificative, content: document_upload }
-
- let!(:commentaire) { create(:commentaire, dossier: dossier, email: email_commentaire, body: 'ma super description', piece_justificative: pj) }
- let(:body) { 'Commentaire de test' }
-
- before do
- assign(:facade, DossierFacades.new(dossier.id, dossier.user.email))
- render
- end
-
- context 'Affichage du flux de commentaire' do
- it 'l\'email du contact est présent' do
- expect(rendered).to have_selector('span[id=email_contact]')
- end
-
- it 'la date du commentaire est présent' do
- expect(rendered).to have_selector('span[id=created_at]')
- end
-
- it 'le corps du commentaire est présent' do
- expect(rendered).to have_selector('div[class=description][id=body]')
- end
-
- context 'when commentaire as PJ' do
- it 'commentaire present the link' do
- expect(rendered).to have_css('#piece_justificative')
- end
- end
- end
-
- context 'Affichage du formulaire de commentaire' do
- it 'Le formulaire envoie vers /dossiers/:dossier_id/commentaire en #POST' do
- expect(rendered).to have_selector("form[action='/users/dossiers/#{dossier_id}/commentaire'][method=post]")
- end
-
- it 'Champs de texte' do
- expect(rendered).to have_selector('textarea[id=texte_commentaire][name=texte_commentaire]')
- end
-
- describe 'File input' do
- it 'have file_input tag' do
- expect(rendered).to have_css('#piece_justificative_content')
- end
- end
- end
-end
diff --git a/spec/views/users/recapitulatif/show.html.haml_spec.rb b/spec/views/users/recapitulatif/show.html.haml_spec.rb
index 739319181..63ba3bee8 100644
--- a/spec/views/users/recapitulatif/show.html.haml_spec.rb
+++ b/spec/views/users/recapitulatif/show.html.haml_spec.rb
@@ -21,10 +21,11 @@ describe 'users/recapitulatif/show.html.haml', type: :view do
end
it 'le flux de commentaire est présent' do
- expect(rendered).to have_selector('#commentaires_flux')
+ expect(rendered).to have_selector('#messages')
end
it 'le numéro de dossier est présent' do
+ pending 'move to test layout'
expect(rendered).to have_selector('#dossier_id')
expect(rendered).to have_content(dossier_id)
end
@@ -64,120 +65,17 @@ describe 'users/recapitulatif/show.html.haml', type: :view do
end
end
- context 'buttons to change dossier state' do
- context 'when dossier state is initiated' do
- let(:state) { 'initiated' }
- before do
- render
- end
-
- it { expect(rendered).to have_content('Nouveau') }
-
- it 'button Modifier les document est present' do
- expect(rendered).to have_content('Modifier les documents')
- expect(rendered).to have_css('#UploadPJmodal')
- end
-
+ context 'when dossier state is initiated' do
+ let(:state) { 'initiated' }
+ before do
+ render
end
- context 'when dossier state is replied' do
- let(:state) { 'replied' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Répondu') }
+ it 'button Modifier les document est present' do
+ expect(rendered).to have_content('Modifier les documents')
+ expect(rendered).to have_css('#UploadPJmodal')
end
- context 'when dossier state is updated' do
- let(:state) { 'updated' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Mis à jour') }
- end
-
- context 'when dossier state is validated' do
- let(:state) { 'validated' }
-
- before do
- render
- end
-
- it 'button Procéder au dépôt définitif est present' do
- expect(rendered).to have_css('#validate_button')
- expect(rendered).to have_content('Procéder au dépôt définitif')
- end
-
- it 'button Editer mon dossier n\'est plus present' do
- expect(rendered).not_to have_css('#maj_infos')
- expect(rendered).not_to have_content('Modifier mon dossier')
- end
-
- it 'button Modifier les document n\'est plus present' do
- expect(rendered).not_to have_content('Modifier les documents')
- end
- end
-
- context 'when dossier state is submitted' do
- let(:state) { 'submitted' }
-
- before do
- render
- end
-
- it { expect(rendered).to have_content('Déposé') }
-
- it 'button Editer mon dossier n\'est plus present' do
- expect(rendered).not_to have_css('#maj_infos')
- expect(rendered).not_to have_content('Modifier mon dossier')
- end
- end
-
- context 'when dossier state is closed' do
- let(:state) { 'closed' }
-
- before do
- render
- end
- it { expect(rendered).to have_content('Accepté') }
-
- it 'button Editer mon dossier n\'est plus present' do
- expect(rendered).not_to have_css('#maj_infos')
- expect(rendered).not_to have_content('Modifier mon dossier')
- end
- end
-
- context 'when dossier state is refused' do
- let(:state) { 'refused' }
-
- before do
- render
- end
- it { expect(rendered).to have_content('Refusé') }
-
- it 'button Editer mon dossier n\'est plus present' do
- expect(rendered).not_to have_css('#maj_infos')
- expect(rendered).not_to have_content('Modifier mon dossier')
- end
- end
-
- context 'when dossier state is without_continuation' do
- let(:state) { 'without_continuation' }
-
- before do
- render
- end
- it { expect(rendered).to have_content('Sans suite') }
-
- it 'button Editer mon dossier n\'est plus present' do
- expect(rendered).not_to have_css('#maj_infos')
- expect(rendered).not_to have_content('Modifier mon dossier')
- end
- end
end
context 'when invite is logged' do
diff --git a/spec/views/users/siret/index.html.haml_spec.rb b/spec/views/users/siret/index.html.haml_spec.rb
index 5740ac7af..4ba45d6c6 100644
--- a/spec/views/users/siret/index.html.haml_spec.rb
+++ b/spec/views/users/siret/index.html.haml_spec.rb
@@ -25,7 +25,7 @@ describe 'users/siret/index.html.haml', type: :view do
end
context 'stockage de l\'ID de la procédure dans un champs hidden' do
- it {expect(rendered).to have_selector("input[type=hidden][id=procedure_id][name=procedure_id][value='#{procedure.id}']")}
+ it {expect(rendered).to have_selector("input[type=hidden][id=procedure_id][name=procedure_id][value='#{procedure.id}']", visible: false)}
end
it 'le titre de la procédure est présent sur la page' do