diff --git a/.haml-lint.yml b/.haml-lint.yml new file mode 100644 index 000000000..e1fc25e4d --- /dev/null +++ b/.haml-lint.yml @@ -0,0 +1,119 @@ +linters: + AlignmentTabs: + enabled: true + + AltText: + enabled: false + + ClassAttributeWithStaticValue: + enabled: true + + ClassesBeforeIds: + enabled: false + + ConsecutiveComments: + enabled: false + + ConsecutiveSilentScripts: + enabled: false + max_consecutive: 2 + + EmptyObjectReference: + enabled: true + + EmptyScript: + enabled: true + + FinalNewline: + enabled: true + present: true + + HtmlAttributes: + enabled: true + + IdNames: + enabled: false + style: lisp_case + + ImplicitDiv: + enabled: false + + Indentation: + enabled: true + character: space # or tab + width: 2 # ignored if character == tab + + InstanceVariables: + enabled: false + file_types: partials + matchers: + all: .* + partials: \A_.*\.haml\z + + LeadingCommentSpace: + enabled: true + + LineLength: + enabled: false + max: 80 + + MultilinePipe: + enabled: true + + MultilineScript: + enabled: true + + ObjectReferenceAttributes: + enabled: true + + RepeatedId: + enabled: false + severity: error + + RuboCop: + enabled: false + # These cops are incredibly noisy when it comes to HAML templates, so we + # ignore them. + ignored_cops: + - Lint/BlockAlignment + - Lint/EndAlignment + - Lint/Void + - Metrics/BlockLength + - Metrics/LineLength + - Style/AlignParameters + - Style/BlockNesting + - Style/ElseAlignment + - Style/EndOfLine + - Style/FileName + - Style/FinalNewline + - Style/FrozenStringLiteralComment + - Style/IfUnlessModifier + - Style/IndentationWidth + - Style/Next + - Style/TrailingBlankLines + - Style/TrailingWhitespace + - Style/WhileUntilModifier + + RubyComments: + enabled: true + + SpaceBeforeScript: + enabled: true + + SpaceInsideHashAttributes: + enabled: true + style: space + + TagName: + enabled: true + + TrailingWhitespace: + enabled: true + + UnnecessaryInterpolation: + enabled: true + + # Disabled because too agressive, but to enable + # locally from time to time + UnnecessaryStringOutput: + enabled: false diff --git a/Gemfile b/Gemfile index e6d77a9ab..24f75ba73 100644 --- a/Gemfile +++ b/Gemfile @@ -93,6 +93,8 @@ gem 'simple_form' gem 'newrelic_rpm' +gem 'scenic' + # Sidekiq gem 'sidekiq' gem 'sidekiq-cron', '~> 0.4.4' @@ -114,7 +116,6 @@ group :test do gem 'guard-livereload', '~> 2.4', require: false gem 'vcr' gem 'rails-controller-testing' - gem 'sqlite3' end group :development do @@ -122,6 +123,7 @@ group :development do gem 'web-console' gem 'rack-handlers' gem 'xray-rails' + gem 'haml-lint' end group :development, :test do @@ -145,6 +147,3 @@ group :production, :staging do gem 'sentry-raven' end -group :production, :staging, :development do - gem 'scenic' -end diff --git a/Gemfile.lock b/Gemfile.lock index 40665e46f..b6a8ceacf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -69,7 +69,7 @@ GEM i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.0) + addressable (2.5.1) public_suffix (~> 2.0, >= 2.0.2) apipie-rails (0.3.7) json @@ -78,6 +78,7 @@ GEM actionpack (>= 3.0) activemodel (>= 3.0) responders + ast (2.3.0) attr_required (1.0.1) autoprefixer-rails (6.5.4) execjs @@ -97,7 +98,7 @@ GEM browser (2.3.0) builder (3.2.3) byebug (9.0.6) - capybara (2.11.0) + capybara (2.13.0) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -313,12 +314,20 @@ GEM rspec (>= 2.99.0, < 4.0) haml (4.0.7) tilt + haml-lint (0.999.999) + haml_lint haml-rails (0.9.0) actionpack (>= 4.0.1) activesupport (>= 4.0.1) haml (>= 4.0.6, < 5.0) html2haml (>= 1.0.1) railties (>= 4.0.1) + haml_lint (0.24.0) + haml (>= 4.0, < 5.1) + rainbow + rake (>= 10, < 13) + rubocop (>= 0.47.0) + sysexits (~> 1.1) hashdiff (0.3.1) hashie (3.4.6) html2haml (2.0.0) @@ -412,11 +421,14 @@ GEM openstack (3.3.7) json orm_adapter (0.5.0) + parser (2.4.0.0) + ast (~> 2.2) pg (0.19.0) - poltergeist (1.12.0) + poltergeist (1.14.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) + powerpack (0.1.1) pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -424,7 +436,7 @@ GEM pry-byebug (3.4.2) byebug (~> 9.0) pry (~> 0.10) - public_suffix (2.0.4) + public_suffix (2.0.5) rack (2.0.1) rack-handlers (0.7.3) rack @@ -463,6 +475,7 @@ GEM method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) + rainbow (2.2.1) raindrops (0.17.0) rake (12.0.0) rb-fsevent (0.9.8) @@ -513,6 +526,13 @@ GEM rspec-mocks (~> 3.5.0) rspec-support (~> 3.5.0) rspec-support (3.5.0) + rubocop (0.48.1) + parser (>= 2.3.3.1, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.8.1) ruby_dep (1.5.0) ruby_parser (3.8.3) sexp_processor (~> 4.1) @@ -574,13 +594,13 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.3.13) swd (1.0.1) activesupport (>= 3) attr_required (>= 0.0.5) httpclient (>= 2.4) i18n json (>= 1.4.3) + sysexits (1.2.0) therubyracer (0.12.2) libv8 (~> 3.16.14.0) ref @@ -599,6 +619,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.2) + unicode-display_width (1.1.3) unicode_utils (1.4.0) unicorn (5.2.0) kgio (~> 2.6) @@ -626,7 +647,7 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff - websocket-driver (0.6.4) + websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) will_paginate (3.1.5) @@ -667,6 +688,7 @@ DEPENDENCIES guard guard-livereload (~> 2.4) guard-rspec + haml-lint haml-rails hashie jquery-rails @@ -705,7 +727,6 @@ DEPENDENCIES spreadsheet_architect spring spring-commands-rspec - sqlite3 therubyracer timecop turbolinks (~> 5.0) diff --git a/Guardfile b/Guardfile index 22f0a831c..5a91521bb 100644 --- a/Guardfile +++ b/Guardfile @@ -73,6 +73,7 @@ guard :rspec, cmd: 'spring rspec' do 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{^app/services/(.+)_(service)\.rb$}) { |m| "spec/services/#{m[1]}_service_spec.rb" } watch(%r{^spec/support/(.+)\.rb$}) { "spec" } watch('config/routes.rb') { "spec/routing" } watch('app/controllers/application_controller.rb') { "spec/controllers" } diff --git a/README.md b/README.md index efadabf4a..2d9a96a0b 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,18 @@ ## Context -TéléProcédure Simplifiée, ou TPS pour les intimes, est une plateforme 100% web et 0% email, conçue afin de répondre au besoin urgent de l'État d'appliquer la directive sur le 100% démat' à l'horizon 2018 pour les démarches administratives. +TéléProcédure Simplifiée, ou TPS pour les intimes, est une plateforme 100 % web et 0 % email, conçue afin de répondre au besoin urgent de l'État d'appliquer la directive sur le 100 % démat' à l'horizon 2018 pour les démarches administratives. -## Technologies utilisées +## Dépendances -Ruby : 2.3.1 -Rails : 5.0.0.1 +### Tous environnements + +- postgresql + +### Tests + +- PhantomJS ## Initialisation de l'environnement de développement @@ -20,32 +25,23 @@ Afin d'initialiser l'environnement de développement, éxécutez la commande sui ## Création de la base de données -L'application utilise une base de donnée Postgresql. Pour en installer une, utilisez la commande suivante : - - sudo apt-get install postgresql - Les informations nécessaire à l'initialisation de la base doivent être pré-configurées à la main grâce à la procédure suivante : su - postgres psql - > create user tps with password 'lol' superuser; + > create user tps_development with password 'tps_development' superuser; + > create user tps_test with password 'tps_test' superuser; > \q - Afin de générer la BDD de l'application, il est nécessaire d'éxécuter les commandes suivantes : rake db:create db:schema:load db:migrate rake db:create db:schema:load db:migrate RAILS_ENV=test -## Installation de Phantom JS +## Exécution des tests (RSpec) -Installer PhantomJS qui est utilisé par les tests automatisés de l'application. - - -## Exécution des tests (Rspec) - -Pour éxécuter les tests de l'application, plusieurs possibilités : +Pour exécuter les tests de l'application, plusieurs possibilités : - Lancer tous les tests @@ -62,8 +58,11 @@ Pour éxécuter les tests de l'application, plusieurs possibilités : rake spec SPEC=file_path/file_name_spec.rb rspec file_path/file_name_spec.rb +## Linting -## Regénérer les binstubs +- Linter les fichiers HAML : `bundle exec haml-lint app/views/` + +## Régénérer les binstubs bundle binstub railties --force rake rails:update:bin diff --git a/app/assets/images/landing/users/Pilat.sketch b/app/assets/images/landing/users/Pilat.sketch new file mode 100644 index 000000000..43648403d Binary files /dev/null and b/app/assets/images/landing/users/Pilat.sketch differ diff --git a/app/assets/javascripts/new-description.js b/app/assets/javascripts/new-description.js new file mode 100644 index 000000000..8de71855e --- /dev/null +++ b/app/assets/javascripts/new-description.js @@ -0,0 +1,36 @@ +(function() { + var showNotFound = function() { + $('.dossier-link .text-info').hide(); + $('.dossier-link .text-warning').show(); + }; + + var showData = function(data) { + $('.dossier-link .procedureLibelle').text(data.procedureLibelle); + $('.dossier-link .text-info').show(); + $('.dossier-link .text-warning').hide(); + }; + + var hideEverything = function() { + $('.dossier-link .text-info').hide(); + $('.dossier-link .text-warning').hide(); + }; + + var fetchProcedureLibelle = function(e) { + var dossierId = $(e.target).val(); + if(dossierId) { + $.get('/users/dossiers/' + dossierId + '/procedure_libelle') + .done(showData) + .fail(showNotFound); + } else { + hideEverything(); + } + }; + + var timeOut = null; + var debounceFetchProcedureLibelle = function(e) { + if(timeOut){ clearTimeout(timeOut); } + timeOut = setTimeout(function() { fetchProcedureLibelle(e); }, 300); + }; + + $(document).on('input', '[data-type=dossier-link]', debounceFetchProcedureLibelle); +})(); diff --git a/app/assets/javascripts/toggle_chart.js b/app/assets/javascripts/toggle_chart.js new file mode 100644 index 000000000..e2ed52b3c --- /dev/null +++ b/app/assets/javascripts/toggle_chart.js @@ -0,0 +1,20 @@ +var TPS = TPS || {}; + +TPS.toggleChart = function(event, chartClass) { + var nextSelectorItem = $(event.target), + nextChart = $(chartClass), + nextChartId = nextChart.children().first().attr("id"), + currentSelectorItem = nextSelectorItem.parent().find(".segmented-control-item-active"), + currentChart = nextSelectorItem.parent().parent().find(".chart:not(.hidden)"); + + // Change the current selector and the next selector states + currentSelectorItem.toggleClass("segmented-control-item-active"); + nextSelectorItem.toggleClass("segmented-control-item-active"); + + // Hide the currently shown chart and show the new one + currentChart.toggleClass("hidden"); + nextChart.toggleClass("hidden"); + + // Reflow needed, see https://github.com/highcharts/highcharts/issues/1979 + Chartkick.charts[nextChartId].getChartObject().reflow(); +} diff --git a/app/assets/stylesheets/administrations/stats.scss b/app/assets/stylesheets/administrations/stats.scss deleted file mode 100644 index 005075eff..000000000 --- a/app/assets/stylesheets/administrations/stats.scss +++ /dev/null @@ -1,9 +0,0 @@ -@import "card"; - -.stats { - .stat-card { - @extend .card; - margin: 15px auto; - max-width: 1200px; - } -} diff --git a/app/assets/stylesheets/stats.scss b/app/assets/stylesheets/stats.scss new file mode 100644 index 000000000..48d602275 --- /dev/null +++ b/app/assets/stylesheets/stats.scss @@ -0,0 +1,124 @@ +@import "card"; + +$dark-grey: #333333; +$light-grey: #999999; +$blue: rgba(61, 149, 236, 1); +$blue-hover: rgba(61, 149, 236, 0.8); + +$default-space: 15px; + +$new-h1-margin-bottom: 4 * $default-space; +.new-h1 { + color: $dark-grey; + text-align: center; + margin-top: 0; + margin-bottom: $new-h1-margin-bottom; +} + +$statistiques-padding-top: $default-space * 2; +.statistiques { + width: 1040px; + margin: 0 auto; + padding-top: $statistiques-padding-top; +} + +.stat-cards { + .stat-card:nth-of-type(even) { + margin-right: 0px; + } +} + +$stat-card-margin-bottom: 3 * $default-space; +.stat-card { + @extend .card; + margin-bottom: $stat-card-margin-bottom; + border-radius: 5px; + box-shadow: none; + border: 1px solid rgba(0, 0, 0, 0.15); +} + +$stat-card-half-horizontal-spacing: 4 * $default-space; +.stat-card-half { + width: calc((100% - #{$stat-card-half-horizontal-spacing}) / 2); + margin-right: 3 * $default-space; +} + +.stat-card-title { + color: $dark-grey; + font-size: 26px; + font-weight: 500; + width: 200px; +} + +$segmented-control-margin-top: $default-space; +.segmented-control { + border-radius: 36px; + height: 36px; + line-height: 36px; + font-size: 0; + padding: 0; + display: inline-block; + margin-top: $segmented-control-margin-top; +} + +$segmented-control-item-horizontal-padding: $default-space; +$segmented-control-item-border-radius: 2 * $default-space; +.segmented-control-item { + color: $blue; + display: inline-block; + font-size: 15px; + border: 2px solid $blue; + margin-right: -2px; + padding-left: $segmented-control-item-horizontal-padding; + padding-right: $segmented-control-item-horizontal-padding; + color: $blue; + + &:first-of-type { + border-radius: $segmented-control-item-border-radius 0px 0px $segmented-control-item-border-radius; + } + + &:last-of-type { + border-radius: 0px $segmented-control-item-border-radius $segmented-control-item-border-radius 0px; + margin-right: 0; + } + + &:hover { + background-color: $blue-hover; + color: white; + cursor: pointer; + } +} + +.segmented-control-item-active { + background-color: $blue; + color: white; +} + +.chart-container { + margin-top: 36px; +} + +.chart { + width: 100%; +} + +$big-number-card-padding: 2 * $segmented-control-item-border-radius; +.big-number-card { + padding: $big-number-card-padding; +} + +.big-number-card-title { + display: block; + text-align: center; + margin: 0 auto; + color: $light-grey; +} + +.big-number-card-number { + display: block; + text-align: center; + font-size: 90px; + line-height: 90px; + font-weight: bold; + color: $blue; +} diff --git a/app/controllers/administrations/stats_controller.rb b/app/controllers/administrations/stats_controller.rb deleted file mode 100644 index ea04c0ebb..000000000 --- a/app/controllers/administrations/stats_controller.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Administrations - class StatsController < ApplicationController - before_action :authenticate_administration! - - def index - procedures = Procedure.where(created_at: Time.current.all_quarter).group("date_trunc('day', created_at)").count - dossiers = Dossier.where(created_at: Time.current.all_quarter).group("date_trunc('day', created_at)").count - @procedures = clean_hash(procedures) - @dossiers = clean_hash(dossiers) - end - - private - - def clean_hash h - h.keys.each{ |key| h[key.to_date] = h[key]; h.delete(key) } - min_date = h.keys.min - max_date = h.keys.max - (min_date..max_date).each do |date| - h[date] = 0 if h[date].nil? - end - h - end - end -end diff --git a/app/controllers/backoffice/private_formulaires_controller.rb b/app/controllers/backoffice/private_formulaires_controller.rb index 8a9283959..81a728085 100644 --- a/app/controllers/backoffice/private_formulaires_controller.rb +++ b/app/controllers/backoffice/private_formulaires_controller.rb @@ -5,7 +5,7 @@ class Backoffice::PrivateFormulairesController < ApplicationController dossier = current_gestionnaire.dossiers.find(params[:dossier_id]) unless params[:champs].nil? - champs_service_errors = ChampsService.save_formulaire dossier.champs_private, params + champs_service_errors = ChampsService.save_champs dossier.champs_private, params if champs_service_errors.empty? flash[:notice] = "Formulaire enregistré" diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb new file mode 100644 index 000000000..04a1f303c --- /dev/null +++ b/app/controllers/stats_controller.rb @@ -0,0 +1,56 @@ +class StatsController < ApplicationController + + def index + procedures = Procedure.where(:published => true) + dossiers = Dossier.where.not(:state => :draft) + + @procedures_30_days_flow = thirty_days_flow_hash(procedures) + @dossiers_30_days_flow = thirty_days_flow_hash(dossiers) + + @procedures_cumulative = cumulative_hash(procedures) + @dossiers_cumulative = cumulative_hash(dossiers) + + @procedures_count = procedures.count + @dossiers_count = dossiers.count + end + + private + + def thirty_days_flow_hash(association) + min_date = 30.days.ago.to_date + max_date = Time.now.to_date + + thirty_days_flow_hash = association + .where(:created_at => min_date..max_date) + .group("date_trunc('day', created_at)") + .count + + clean_hash(thirty_days_flow_hash, min_date, max_date) + end + + def clean_hash(h, min_date, max_date) + # Convert keys to date + h = Hash[h.map { |(k, v)| [k.to_date, v] }] + + # Add missing vales where count is 0 + (min_date..max_date).each do |date| + if h[date].nil? + h[date] = 0 + end + end + + h + end + + def cumulative_hash(association) + sum = 0 + association + .group("DATE_TRUNC('month', created_at)") + .count + .to_a + .sort{ |x, y| x[0] <=> y[0] } + .map { |x, y| { x => (sum += y)} } + .reduce({}, :merge) + end + +end diff --git a/app/controllers/users/description_controller.rb b/app/controllers/users/description_controller.rb index 71bc8aa29..a45a402fb 100644 --- a/app/controllers/users/description_controller.rb +++ b/app/controllers/users/description_controller.rb @@ -12,10 +12,7 @@ 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 + @headers = @champs.select { |c| c.type_champ == 'header_section' } unless @dossier.can_be_initiated? flash[:alert] = t('errors.messages.procedure_archived') @@ -34,18 +31,12 @@ class Users::DescriptionController < UsersController @champs = @dossier.ordered_champs - mandatory = true - mandatory = !(params[:submit].keys.first == 'brouillon') unless params[:submit].nil? + check_mandatory_fields = !draft_submission? - unless @dossier.update_attributes(create_params) - @dossier = @dossier.decorate - - 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 + if params[:champs] + champs_service_errors = ChampsService.save_champs @dossier.champs, + params, + check_mandatory_fields unless champs_service_errors.empty? flash.alert = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'
' }).html_safe @@ -53,33 +44,30 @@ class Users::DescriptionController < UsersController end end - if @procedure.cerfa_flag? - unless params[:cerfa_pdf].nil? - cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user) - unless cerfa.save - flash.alert = cerfa.errors.full_messages.join('
').html_safe - return redirect_to users_dossier_description_path(dossier_id: @dossier.id) - end + if @procedure.cerfa_flag? && params[:cerfa_pdf] + cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user) + unless cerfa.save + flash.alert = cerfa.errors.full_messages.join('
').html_safe + return redirect_to users_dossier_description_path(dossier_id: @dossier.id) end end - unless (errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).empty? + errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params) + unless errors_upload.empty? flash.alert = errors_upload.html_safe return redirect_to users_dossier_description_path(dossier_id: @dossier.id) end - - if mandatory + if draft_submission? + flash.notice = 'Votre brouillon a bien été sauvegardé.' + redirect_to url_for(controller: :dossiers, action: :index, liste: :brouillon) + else if @dossier.draft? @dossier.initiated! NotificationMailer.send_notification(@dossier, @dossier.procedure.initiated_mail).deliver_now! end - flash.notice = 'Félicitations, votre demande a bien été enregistrée.' redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: @dossier.id) - else - flash.notice = 'Votre brouillon a bien été sauvegardé.' - redirect_to url_for(controller: :dossiers, action: :index, liste: :brouillon) end end @@ -123,6 +111,10 @@ class Users::DescriptionController < UsersController private + def draft_submission? + params[:submit] && params[:submit].keys.first == 'brouillon' + end + def check_autorisation_donnees @dossier = current_user_dossier @@ -137,9 +129,4 @@ class Users::DescriptionController < UsersController redirect_to url_for(users_dossier_path(@dossier.id)) end end - - def create_params - params.permit() - end - end diff --git a/app/controllers/users/dossiers_controller.rb b/app/controllers/users/dossiers_controller.rb index fe4421dab..4eade942c 100644 --- a/app/controllers/users/dossiers_controller.rb +++ b/app/controllers/users/dossiers_controller.rb @@ -154,6 +154,13 @@ class Users::DossiersController < UsersController redirect_to url_for users_dossiers_path end + def procedure_libelle + dossier = Dossier.find(params[:dossier_id]) + render json: { procedureLibelle: dossier.procedure.libelle } + rescue ActiveRecord::RecordNotFound + render json: {}, status: 404 + end + private def check_siret diff --git a/app/models/champ.rb b/app/models/champ.rb index e4a6e820e..ce12e32a3 100644 --- a/app/models/champ.rb +++ b/app/models/champ.rb @@ -28,6 +28,10 @@ class Champ < ActiveRecord::Base same_date? num, '%M' end + def mandatory_and_blank? + mandatory? && value.blank? + end + def same_date? num, compare if type_champ == 'datetime' && !value.nil? if value.to_datetime.strftime(compare) == num diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 5cf14b5ea..bdadb8c00 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -210,19 +210,16 @@ class Dossier < ActiveRecord::Base def convert_specific_hash_values_to_string(hash_to_convert) hash = {} hash_to_convert.each do |key, value| - value = value.to_s if !value.kind_of?(Time) && !value.nil? + value = serialize_value_for_export(value) hash.store(key, value) end return hash end - def convert_specific_array_values_to_string(array_to_convert) - array = [] - array_to_convert.each do |value| - value = value.to_s if !value.kind_of?(Time) && !value.nil? - array << value + def full_data_strings_array + data_with_champs.map do |value| + serialize_value_for_export(value) end - return array end def export_entreprise_data @@ -306,4 +303,8 @@ class Dossier < ActiveRecord::Base end end + def serialize_value_for_export(value) + value.nil? || value.kind_of?(Time) ? value : value.to_s + end + end diff --git a/app/models/notification.rb b/app/models/notification.rb index e538f0a25..4ff810f37 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -1,6 +1,5 @@ class Notification < ActiveRecord::Base belongs_to :dossier - serialize :liste if Rails.env.test? # after_save :broadcast_notification diff --git a/app/models/procedure.rb b/app/models/procedure.rb index 0ffbc4714..0a1b46f92 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -135,7 +135,7 @@ class Procedure < ActiveRecord::Base headers = exportable_dossiers.any? ? exportable_dossiers.first.export_headers : [] data = exportable_dossiers.map do |dossier| - dossier.convert_specific_array_values_to_string(dossier.data_with_champs) + dossier.full_data_strings_array end { diff --git a/app/models/type_de_champ.rb b/app/models/type_de_champ.rb index 2dbfb2d90..dcdf0a102 100644 --- a/app/models/type_de_champ.rb +++ b/app/models/type_de_champ.rb @@ -18,7 +18,8 @@ class TypeDeChamp < ActiveRecord::Base departements: 'departements', engagement: 'engagement', header_section: 'header_section', - explication: 'explication' + explication: 'explication', + dossier_link: 'dossier_link' } belongs_to :procedure diff --git a/app/services/champs_service.rb b/app/services/champs_service.rb index 04fdf9602..31b53973f 100644 --- a/app/services/champs_service.rb +++ b/app/services/champs_service.rb @@ -1,27 +1,41 @@ class ChampsService - def self.save_formulaire champs, params, check_mandatory=true - errors = Array.new + class << self + def save_champs(champs, params, check_mandatory = true) + fill_champs(champs, params) - champs.each do |champ| - champ.value = params[:champs]["'#{champ.id}'"] + champs.select(&:changed?).each(&:save) - if champ.type_champ == 'datetime' - champ.value = params[:champs]["'#{champ.id}'"]+ - ' ' + - params[:time_hour]["'#{champ.id}'"] + - ':' + - params[:time_minute]["'#{champ.id}'"] - end - - if check_mandatory - if champ.mandatory? && (champ.value.nil? || champ.value.blank?) - errors.push({message: "Le champ #{champ.libelle} doit être rempli."}) - end - end - - champ.save if champ.changed? + check_mandatory ? build_error_messages(champs) : [] end - errors + private + + def fill_champs(champs, h) + datetimes, not_datetimes = champs.partition { |c| c.type_champ == 'datetime' } + + not_datetimes.each { |c| c.value = h[:champs]["'#{c.id}'"] } + datetimes.each { |c| c.value = parse_datetime(c.id, h) } + end + + def parse_datetime(champ_id, h) + "#{h[:champs]["'#{champ_id}'"]} #{extract_hour(champ_id, h)}:#{extract_minute(champ_id, h)}" + end + + def extract_hour(champ_id, h) + h[:time_hour]["'#{champ_id}'"] + end + + def extract_minute(champ_id, h) + h[:time_minute]["'#{champ_id}'"] + end + + def build_error_messages(champs) + champs.select(&:mandatory_and_blank?) + .map { |c| build_champ_error_message(c) } + end + + def build_champ_error_message(champ) + { message: "Le champ #{champ.libelle} doit être rempli." } + end end end diff --git a/app/views/admin/accompagnateurs/_list_assign.html.haml b/app/views/admin/accompagnateurs/_list_assign.html.haml index 3dac05419..faeec752d 100644 --- a/app/views/admin/accompagnateurs/_list_assign.html.haml +++ b/app/views/admin/accompagnateurs/_list_assign.html.haml @@ -1,17 +1,17 @@ -.row{style:'height: 34px'} +.row{ style: 'height: 34px;' } - unless smart_listing.empty? %table.table#liste_gestionnaire %thead %th Enlever - %th#email{style:'text-align: right'} Email + %th#email{ style: 'text-align: right;' } Email - @accompagnateurs_assign.each do |accompagnateur| %tr %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'} + %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 + %td{ style: 'padding-top: 11px; font-size: 15px; text-align: right;' }= accompagnateur.email = smart_listing.paginate = smart_listing.pagination_per_page_links diff --git a/app/views/admin/accompagnateurs/_list_not_assign.html.haml b/app/views/admin/accompagnateurs/_list_not_assign.html.haml index 3eb519dcd..d016ffe90 100644 --- a/app/views/admin/accompagnateurs/_list_not_assign.html.haml +++ b/app/views/admin/accompagnateurs/_list_not_assign.html.haml @@ -1,8 +1,8 @@ -= smart_listing_controls_for(:accompagnateurs_not_assign, {class: "form-inline text-right"}) do += smart_listing_controls_for(:accompagnateurs_not_assign, { class: "form-inline text-right" }) do .form-group.filter.input-append = text_field_tag :filter, '', class: "search form-control", placeholder: "Recherche...", autocomplete: :off - %button.btn.btn-primary{type: :submit} + %button.btn.btn-primary{ type: :submit } %span.fa.fa-search - unless smart_listing.empty? @@ -14,9 +14,9 @@ - @accompagnateurs_not_assign.each do |accompagnateur| %tr - %td.col-xs-11{style:'padding-top: 11px; font-size:15px'}= accompagnateur.email + %td.col-xs-11{ style: 'padding-top: 11px; font-size: 15px;' }= accompagnateur.email %td.center - %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'} + %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 d62a10c54..251f89880 100644 --- a/app/views/admin/accompagnateurs/show.html.haml +++ b/app/views/admin/accompagnateurs/show.html.haml @@ -9,15 +9,15 @@ %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| + = form_for @gestionnaire, url: { controller: 'admin/gestionnaires', action: :create } do |f| .row .col-xs-5 = hidden_field_tag :procedure_id, params[:procedure_id] - =render partial: 'admin/gestionnaires/informations', locals: {f: f} + = render partial: 'admin/gestionnaires/informations', locals: { f: f } .col-xs-2 %br %br - = f.submit 'Valider', class: 'btn btn-info', style: 'float:left', id: 'add-gestionnaire-email' + = f.submit 'Valider', class: 'btn btn-info', style: 'float: left;', id: 'add-gestionnaire-email' .col-xs-6 %h3.text-success Affectés = smart_listing_render :accompagnateurs_assign diff --git a/app/views/admin/change_dossier_state/check.html.haml b/app/views/admin/change_dossier_state/check.html.haml index 796518ae7..e92ed72d8 100644 --- a/app/views/admin/change_dossier_state/check.html.haml +++ b/app/views/admin/change_dossier_state/check.html.haml @@ -10,8 +10,8 @@ = @dossier.decorate.display_state %br État souhaité : - %select{id: :next_state, name: :next_state} + %select{ id: :next_state, name: :next_state } - Dossier.states.each do |state| - %option{value: state[0]} - =DossierDecorator.case_state_fr state[1] + %option{ value: state[0] } + = DossierDecorator.case_state_fr state[1] = f.submit 'Valider' diff --git a/app/views/admin/gestionnaires/_informations.html.haml b/app/views/admin/gestionnaires/_informations.html.haml index b7c9a268c..29b25928d 100644 --- a/app/views/admin/gestionnaires/_informations.html.haml +++ b/app/views/admin/gestionnaires/_informations.html.haml @@ -1,4 +1,4 @@ --{email: 'Email*'}.each do |key, value| +- { email: 'Email*' }.each do |key, value| .form-group %h4 = value diff --git a/app/views/admin/gestionnaires/_list.html.haml b/app/views/admin/gestionnaires/_list.html.haml index 48cdd8f68..259f3c31f 100644 --- a/app/views/admin/gestionnaires/_list.html.haml +++ b/app/views/admin/gestionnaires/_list.html.haml @@ -2,17 +2,17 @@ %table.table#liste_gestionnaire %thead %th#libelle= smart_listing.sortable 'Email', 'email' - %th= '' + %th - @gestionnaires.each do |gestionnaire| %tr - %td{style:'padding-top: 11px; font-size:15px'}= gestionnaire.email - %td{ style: 'text-align:right' } + %td{ style: 'padding-top: 11px; font-size: 15px;' }= gestionnaire.email + %td{ style: 'text-align: right;' } .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.fa.fa-minus{style: 'top: 0'} + = link_to 'Valider', admin_gestionnaire_path(id: gestionnaire.id), { method: :delete, class: 'btn btn-sm btn-success' } + .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 aa9836843..13efab7f2 100644 --- a/app/views/admin/gestionnaires/index.html.haml +++ b/app/views/admin/gestionnaires/index.html.haml @@ -9,11 +9,11 @@ .col-xs-6 %h3 Ajouter un accompagnateur #procedure_new.section.section-label - = form_for @gestionnaire, url: {controller: 'admin/gestionnaires', action: :create} do |f| + = form_for @gestionnaire, url: { controller: 'admin/gestionnaires', action: :create } do |f| .row .col-xs-5 - = render partial: 'informations', locals: {f: f} + = render partial: 'informations', locals: { f: f } .col-xs-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/mail_templates/edit.html.haml b/app/views/admin/mail_templates/edit.html.haml index 31ff8fd7f..99e7e7c1a 100644 --- a/app/views/admin/mail_templates/edit.html.haml +++ b/app/views/admin/mail_templates/edit.html.haml @@ -9,7 +9,7 @@ .row .col-md-6 = f.input :object, label: "Objet de l'email" - = f.input :body, label: "Corps de l'email", input_html: {class: 'wysihtml5'} + = f.input :body, label: "Corps de l'email", input_html: { class: 'wysihtml5' } .text-right = link_to "Annuler", admin_procedure_mail_templates_path(@procedure), class: "btn btn-default" = f.button :submit, 'Mettre à jour', class: "btn-success" @@ -27,4 +27,4 @@ %td.center = "--#{balise.first}--" %td - =balise.second[:description] + = balise.second[:description] diff --git a/app/views/admin/pieces_justificatives/_fields.html.haml b/app/views/admin/pieces_justificatives/_fields.html.haml index 7c7871a32..7cbdf5a99 100644 --- a/app/views/admin/pieces_justificatives/_fields.html.haml +++ b/app/views/admin/pieces_justificatives/_fields.html.haml @@ -2,16 +2,16 @@ .form-inline .form-group %h4 Libellé - =ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé' + = ff.text_field :libelle, class: 'form-control libelle', placeholder: 'Libellé' .form-group %h4 Description - =ff.text_area :description, class: 'form-control description', placeholder: 'Description' + = ff.text_area :description, class: 'form-control description', placeholder: 'Description' .form-group %h4 Lien du formulaire vierge %small (optionel) - =ff.url_field :lien_demarche, class: 'form-control', placeholder: 'Lien du document vierge' + = ff.url_field :lien_demarche, class: 'form-control', placeholder: 'Lien du document vierge' .form-group = ff.hidden_field :order_place, value: ff.index diff --git a/app/views/admin/pieces_justificatives/_form.html.haml b/app/views/admin/pieces_justificatives/_form.html.haml index 7891ae363..6bdb2c4b4 100644 --- a/app/views/admin/pieces_justificatives/_form.html.haml +++ b/app/views/admin/pieces_justificatives/_form.html.haml @@ -1,7 +1,7 @@ -= form_for [:admin, @procedure], url: admin_procedure_pieces_justificatives_path(@procedure) , remote: true do |f| += form_for [:admin, @procedure], url: admin_procedure_pieces_justificatives_path(@procedure), remote: true do |f| #liste_piece_justificative - = render partial: 'fields', locals:{ types_de_piece_justificative: @procedure.types_de_piece_justificative_ordered.decorate, f: f } + = render partial: 'fields', locals: { types_de_piece_justificative: @procedure.types_de_piece_justificative_ordered.decorate, f: f } = f.submit "Enregistrer", class: 'btn btn-success', id: :save %hr #new_type_de_piece_justificative - = render partial: 'fields', locals:{ types_de_piece_justificative: TypeDePieceJustificative.new.decorate, f: f } + = render partial: 'fields', locals: { types_de_piece_justificative: TypeDePieceJustificative.new.decorate, f: f } diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index b1aef83f2..476b8d250 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -2,7 +2,7 @@ .alert.alert-info Cette procédure est publiée, certains éléments de la description ne sont plus modifiables --{libelle: 'Libellé*', description: 'Description*', organisation: 'Organisation', direction: 'Direction', lien_site_web: 'Lien site internet', lien_notice: 'Lien notice'}.each do |key, value| +- { libelle: 'Libellé*', description: 'Description*', organisation: 'Organisation', direction: 'Direction', lien_site_web: 'Lien site internet', lien_notice: 'Lien notice' }.each do |key, value| .form-group %h4 = value @@ -16,17 +16,17 @@ .col-md-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'} - = f.file_field :logo, accept: 'image/png, image/jpg, image/jpeg', style: 'display:inline' + = image_tag @procedure.decorate.logo_img, { style: 'height: 40px; display: inline; margin-right: 6px;', id: 'preview_procedure_logo' } + = f.file_field :logo, accept: 'image/png, image/jpg, image/jpeg', style: 'display: inline' - %div{style:'margin-top:5px'} + %div{ style: 'margin-top: 5px;' } %i Fichier accepté : JPG / JPEG / PNG .col-md-6 %h4 Drapeau européen .checkbox %label - =f.check_box :euro_flag + = f.check_box :euro_flag Afficher le drapeau européen - unless @procedure.locked? @@ -37,7 +37,7 @@ = f.fields_for :module_api_carto, @procedure.module_api_carto do |ff| .checkbox %label - =ff.check_box :use_api_carto, id: :procedure_module_api_carto_use_api_carto + = ff.check_box :use_api_carto, id: :procedure_module_api_carto_use_api_carto Utilisation de la cartographie %ul#modules_api_carto @@ -67,7 +67,7 @@ %h4 Particuliers .checkbox %label - =f.check_box :for_individual + = f.check_box :for_individual Cette procédure s'adresse à un public qui %b ne possède pas (ou pas encore) de numéro SIRET, @@ -83,7 +83,7 @@ .col-md-6 %h4 Options avancées - %label{ for: :auto_archive_on} Archivage automatique le + %label{ for: :auto_archive_on } Archivage automatique le = f.text_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on.try{ |d| d.strftime("%d-%m-%Y") }, data: { provide: 'datepicker', 'date-language' => 'fr', 'date-format' => 'dd/mm/yyyy' } (à 00h00) %p.help-block diff --git a/app/views/admin/procedures/_list.html.haml b/app/views/admin/procedures/_list.html.haml index ba30f2e6f..cc2f21c65 100644 --- a/app/views/admin/procedures/_list.html.haml +++ b/app/views/admin/procedures/_list.html.haml @@ -4,13 +4,13 @@ %th#ID= smart_listing.sortable 'ID', 'id' %th#libelle= smart_listing.sortable 'Libellé', 'libelle' - if @active_class - %th#lien Lien + %th Lien %th#created_at= smart_listing.sortable 'Date création', 'created_at' - %th#lien Actions + %th Actions - @procedures.each do |procedure| - procedure = procedure.decorate - %tr{id: "tr_dossier_#{procedure.id}", 'data-dossier_url' => admin_procedure_path(id: procedure.id)} + %tr{ id: "tr_dossier_#{procedure.id}", 'data-dossier_url' => admin_procedure_path(id: procedure.id) } %td= procedure.id %td.col-xs-6 = procedure.libelle diff --git a/app/views/admin/procedures/_modal_publish.html.haml b/app/views/admin/procedures/_modal_publish.html.haml index a241ae444..2619ca5e5 100644 --- a/app/views/admin/procedures/_modal_publish.html.haml +++ b/app/views/admin/procedures/_modal_publish.html.haml @@ -1,17 +1,17 @@ -#publishModal.modal.fade{"aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"} - .modal-dialog.modal-lg{:role => "document"} +#publishModal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" } + .modal-dialog.modal-lg{ :role => "document" } = form_tag admin_procedure_publish_path(procedure_id: @procedure.id), method: :put, remote: true do .modal-content .modal-header - %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"} - %span{"aria-hidden" => "true"} × + %button.close{ "aria-label" => "Close", "data-dismiss" => "modal", :type => "button" } + %span{ "aria-hidden" => "true" } × %h4#myModalLabel.modal-title - =@procedure.archived?? 'Réactiver' : 'Publier' + = @procedure.archived? ? 'Réactiver' : 'Publier' la procédure %span#publishModal_title .modal-body Vous vous apprêtez à - =@procedure.archived?? 'republier' : 'publier' + = @procedure.archived? ? 'republier' : 'publier' votre procédure au public. - unless @procedure.archived? %b @@ -23,13 +23,13 @@ %br %h4 Lien de la procédure %p.center - ="#{root_url}commencer/" + = "#{root_url}commencer/" = text_field_tag('procedure_path', @procedure.default_path, id: 'procedure_path', placeholder: 'Chemin vers la procédure', - class:'form-control', + class: 'form-control', maxlength: 30, - style: 'width: 300px; display: inline') + style: 'width: 300px; display: inline;') #path_messages #path_is_mine.text-warning.center.message Ce lien est déjà utilisé par une de vos procédure. @@ -42,7 +42,7 @@ #path_is_invalid.text-danger.center.message Ce lien n'est pas valide. Il doit comporter au moins 3 caractères et seuls les caractères a-z, 0-9 et '_' sont autorisés. .modal-footer - = submit_tag "#{@procedure.archived?? 'Réactiver' : 'Publier'}", class: %w(btn btn btn-success), + = submit_tag "#{@procedure.archived? ? 'Réactiver' : 'Publier'}", class: %w(btn btn btn-success), id: 'publish', disabled: :disabled = button_tag 'Annuler', class: %w(btn btn btn-default), id: 'cancel', data: { dismiss: 'modal' } diff --git a/app/views/admin/procedures/_modal_transfer.html.haml b/app/views/admin/procedures/_modal_transfer.html.haml index bda255d8f..02a1a121e 100644 --- a/app/views/admin/procedures/_modal_transfer.html.haml +++ b/app/views/admin/procedures/_modal_transfer.html.haml @@ -1,21 +1,21 @@ -#transferModal.modal.fade{"aria-labelledby" => "TransferProcedureModal", :role => "dialog", :tabindex => "-1"} - .modal-dialog.modal-md{:role => "document"} +#transferModal.modal.fade{ "aria-labelledby" => "TransferProcedureModal", :role => "dialog", :tabindex => "-1" } + .modal-dialog.modal-md{ :role => "document" } = form_tag admin_procedure_transfer_path(procedure_id: @procedure.id), method: :post, remote: true do .modal-content .modal-header - %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"} - %span{"aria-hidden" => "true"} × + %button.close{ "aria-label" => "Close", "data-dismiss" => "modal", :type => "button" } + %span{ "aria-hidden" => "true" } × %h4#myModalLabel.modal-title Petit transfert de procédure entre administrateur .modal-body %p Cette fonctionnalité vous permet de transmettre un clone de votre procédure à un autre administrateur. - %div{style:'margin-top:20px'} - = text_field_tag :email_admin, '', {class: 'form-control', + %div{ style:'margin-top:20px' } + = text_field_tag :email_admin, '', { class: 'form-control', type: 'email', placeholder: 'Email administrateur cible', - style: 'width: 300px; margin-left:auto; margin-right:auto'} - %div#not_found_admin.center.text-danger{style:'display:none; margin-top: 10px'} + style: 'width: 300px; margin-left:auto; margin-right:auto' } + %div#not_found_admin.center.text-danger{ style:'display: none; margin-top: 10px;' } Cet administrateur n'existe pas. .modal-footer = submit_tag "Envoyer", class: 'btn btn-success' diff --git a/app/views/admin/procedures/_onglets.html.haml b/app/views/admin/procedures/_onglets.html.haml index ca258a54d..bede00304 100644 --- a/app/views/admin/procedures/_onglets.html.haml +++ b/app/views/admin/procedures/_onglets.html.haml @@ -1,17 +1,17 @@ #onglets %ul.nav.nav-tabs - %li{class: @draft_class} - %a{:href => "#{url_for :admin_procedures_draft}"} + %li{ class: @draft_class } + %a{ :href => "#{url_for :admin_procedures_draft}" } %h5.text-primary - ="Brouillons" + Brouillons - %li{class: @active_class} - %a{:href => "#{url_for :admin_procedures}"} + %li{ class: @active_class } + %a{ :href => "#{url_for :admin_procedures}" } %h5.text-success - = "Actives" + Actives - %li{class: @archived_class} - %a{:href => "#{url_for :admin_procedures_archived}"} - %h5{style: 'color: black'} - ="Archivées" + %li{ class: @archived_class } + %a{ :href => "#{url_for :admin_procedures_archived}" } + %h5{ style: 'color: black;' } + Archivées %br diff --git a/app/views/admin/procedures/edit.html.haml b/app/views/admin/procedures/edit.html.haml index de42e8835..6ffe6fb12 100644 --- a/app/views/admin/procedures/edit.html.haml +++ b/app/views/admin/procedures/edit.html.haml @@ -1,6 +1,6 @@ .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} + = form_for @procedure, url: url_for({ controller: 'admin/procedures', action: :update, id: @procedure.id }), multipart: true do |f| + = render partial: 'informations', locals: { f: f } .text-right = f.submit 'Enregistrer', class: 'btn btn-success' diff --git a/app/views/admin/procedures/index.html.haml b/app/views/admin/procedures/index.html.haml index 8ebb524ef..570a8cb9b 100644 --- a/app/views/admin/procedures/index.html.haml +++ b/app/views/admin/procedures/index.html.haml @@ -1,14 +1,14 @@ #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 + .row.show-block#new_dossiers + .header + .col-lg-10.col-md-10.col-sm-10.col-xs-10.title + .carret-right + .carret-down Procédures - %a{href:'/admin/procedures/new'} + %a{ href: '/admin/procedures/new' } %div#new-procedure.col-lg-2.col-md-2.col-sm-2.col-xs-2.action Nouvelle - %div.body + .body = smart_listing_render :procedures diff --git a/app/views/admin/procedures/new.html.haml b/app/views/admin/procedures/new.html.haml index b6c555d99..1b203b146 100644 --- a/app/views/admin/procedures/new.html.haml +++ b/app/views/admin/procedures/new.html.haml @@ -1,8 +1,8 @@ .row.white-back %h2 - =t('dynamics.admin.dossiers.tableau_de_bord.nouvelle_procedure') + = 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', id: 'save-procedure', style: 'float:right' + = 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 7249a0ed6..3913a4235 100644 --- a/app/views/admin/procedures/show.html.haml +++ b/app/views/admin/procedures/show.html.haml @@ -1,40 +1,40 @@ .row.white-back #procedure_show - -unless @facade.procedure.published? + - 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'} + %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 - %a.btn.btn-success{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px', id: 'publish-procedure'} + %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 - =render partial: '/admin/procedures/modal_publish' + = 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'} + %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' + = 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'} + %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} + = 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' + Archiver #confirm - %button#valid.btn.btn-small.btn-success{type: :submit} + %button#valid.btn.btn-small.btn-success{ type: :submit } %i.fa.fa-check Valider - %button#cancel.btn.btn-small.btn-danger{type: :button} + %button#cancel.btn.btn-small.btn-danger{ type: :button } %i.fa.fa-remove Annuler @@ -45,7 +45,7 @@ %div %h3 Lien procédure - %div{style:'margin-left:3%'} + %div{ style: 'margin-left: 3%;' } - if @facade.procedure.published? = link_to @facade.procedure.lien, @facade.procedure.lien, target: '_blank' - else @@ -55,7 +55,7 @@ %br %h3 Détails - .row{style:'margin-right:3%; margin-left:3%;'} + .row{ style: 'margin-right: 3%; margin-left: 3%;' } .description.col-xs-6.col-md-3.procedure-description %h4.text-info = @facade.procedure.libelle @@ -90,10 +90,10 @@ %br %br %h3 - =t('dynamics.admin.procedure.stats.title') + = t('dynamics.admin.procedure.stats.title') .row - .col-xs-6{style:'margin-left:3%'} + .col-xs-6{ style: 'margin-left: 3%;' } %h4 Total %div = @facade.dossiers_total @@ -129,4 +129,4 @@ - if @facade.dossiers_for_pie_highchart.blank? Aucune statistique pour le moment - else - =pie_chart @facade.dossiers_for_pie_highchart + = pie_chart @facade.dossiers_for_pie_highchart diff --git a/app/views/admin/types_de_champ/_fields.html.haml b/app/views/admin/types_de_champ/_fields.html.haml index d69bf51a3..3e84b68d7 100644 --- a/app/views/admin/types_de_champ/_fields.html.haml +++ b/app/views/admin/types_de_champ/_fields.html.haml @@ -14,7 +14,7 @@ %h4 Description = ff.text_area :description, class: 'form-control description', placeholder: 'Description', rows: 3 - .form-group.drop_down_list{ class: (%w(drop_down_list multiple_drop_down_list).include?(type_champ) ? 'show_inline' : nil), style: 'margin-right: 5px' } + .form-group.drop_down_list{ class: (%w(drop_down_list multiple_drop_down_list).include?(type_champ) ? 'show_inline' : nil), style: 'margin-right: 5px;' } %h4 Liste déroulante = ff.fields_for :drop_down_list_attributes, ff.object.object.drop_down_list do |fff| ~ fff.text_area :value, class: 'form-control drop_down_list', placeholder: "Ecrire une valeur par ligne et --valeur-- pour un séparateur.", rows: 3, cols: 30 diff --git a/app/views/admin/types_de_champ/_form.html.haml b/app/views/admin/types_de_champ/_form.html.haml index 2c5aaa880..fad5752ec 100644 --- a/app/views/admin/types_de_champ/_form.html.haml +++ b/app/views/admin/types_de_champ/_form.html.haml @@ -1,4 +1,4 @@ -= form_for [:admin, @procedure], url: @types_de_champ_facade.url , remote: true do |f| += form_for [:admin, @procedure], url: @types_de_champ_facade.url, remote: true do |f| = render partial: 'admin/types_de_champ/fields', locals: { types_de_champ: @types_de_champ_facade.types_de_champ, f: f } = f.submit "Enregistrer", class: 'btn btn-success', id: :save %hr diff --git a/app/views/administrateurs/sessions/new.html.haml b/app/views/administrateurs/sessions/new.html.haml index a2b8d0435..7ebe37ba9 100644 --- a/app/views/administrateurs/sessions/new.html.haml +++ b/app/views/administrateurs/sessions/new.html.haml @@ -3,12 +3,12 @@ = image_tag(image_url(LOGO_NAME)) %br %h2#login_admin - =t('dynamics.admin.connexion_title') + = t('dynamics.admin.connexion_title') %br %br #new_user - = form_for @administrateur, url: {controller: 'administrateurs/sessions', action: :create } do |f| + = form_for @administrateur, url: { controller: 'administrateurs/sessions', action: :create } do |f| %h4 = f.label :email .input-group @@ -25,5 +25,5 @@ %br %br .actions - = f.submit "Se connecter", class:'btn btn-primary' + = f.submit "Se connecter", class: 'btn btn-primary' %br diff --git a/app/views/administrations/index.html.haml b/app/views/administrations/index.html.haml index 4e83c9cfc..c4e7eefc5 100644 --- a/app/views/administrations/index.html.haml +++ b/app/views/administrations/index.html.haml @@ -1,19 +1,16 @@ .container .mt-1 - = form_for @admin, url: {controller: 'administrations', action: :create} do |f| + = form_for @admin, url: { controller: 'administrations', action: :create } do |f| .form-group.form-inline.text-center = f.text_field :email, placeholder: :email, class: 'form-control' = f.text_field :password, placeholder: :password, class: 'form-control' = f.submit 'Créer un administrateur', class: 'btn btn-success', id: 'submit_new_administrateur' - .text-center - =link_to 'Stats', administrations_stats_path, style: 'margin-bottom: 50px; display: block', 'data-no-turbolink': true - = smart_listing_render :admins %br %br .text-center - =link_to 'Deconnexion', '/administrations/sign_out', method: :delete + = link_to 'Deconnexion', '/administrations/sign_out', method: :delete diff --git a/app/views/administrations/stats/index.html.haml b/app/views/administrations/stats/index.html.haml deleted file mode 100644 index e24ecb500..000000000 --- a/app/views/administrations/stats/index.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -= javascript_include_tag 'https://code.highcharts.com/highcharts.js', 'chartkick' - -.container - .stats - .stat-card - %h1 Procédures créées - = line_chart @procedures - - .stat-card - %h1 Dossiers créés - = line_chart @dossiers diff --git a/app/views/backoffice/dossiers/_filter_framed.html.haml b/app/views/backoffice/dossiers/_filter_framed.html.haml index 5e8337870..cbf9c1d2e 100644 --- a/app/views/backoffice/dossiers/_filter_framed.html.haml +++ b/app/views/backoffice/dossiers/_filter_framed.html.haml @@ -1,10 +1,10 @@ -%div.filter_framed.panel.panel-primary{id: "#{filter_framed_id}", style:'width: 300px; height: 100px; position: absolute; top: 0; left: 0; display: none'} +.filter_framed.panel.panel-primary{ id: "#{filter_framed_id}", style: 'width: 300px; height: 100px; position: absolute; top: 0; left: 0; display: none;' } .panel-heading = preference.libelle - =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}"} + = 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 - %div.btn.btn-sm.btn-danger.erase-filter + .btn.btn-sm.btn-danger.erase-filter %i.fa.fa-remove diff --git a/app/views/backoffice/dossiers/_followers.html.haml b/app/views/backoffice/dossiers/_followers.html.haml index c9cd2b528..633e2dcc1 100644 --- a/app/views/backoffice/dossiers/_followers.html.haml +++ b/app/views/backoffice/dossiers/_followers.html.haml @@ -1,5 +1,5 @@ %h3 - =t('dynamics.dossiers.followers.title') + = t('dynamics.dossiers.followers.title') %br .row diff --git a/app/views/backoffice/dossiers/_list.html.haml b/app/views/backoffice/dossiers/_list.html.haml index bf18a4ad2..1aebea3ba 100644 --- a/app/views/backoffice/dossiers/_list.html.haml +++ b/app/views/backoffice/dossiers/_list.html.haml @@ -8,21 +8,21 @@ - @facade_data_view.preference_list_dossiers_filter.each do |preference| - unless preference.libelle == 'Statut' || preference.libelle == 'État' - %th{class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}"} + %th{ class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}" } - if preference.table.to_s.include? 'champs' = preference.libelle - -else + - else = smart_listing.sortable preference.libelle, preference.table_attr - 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('.', '_')}"} + %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-xs-1.center Actions %th.col-xs-1.center Abonnés - unless smart_listing.empty? - smart_listing.collection.each do |dossier| - %tr.dossier-row{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => backoffice_dossier_url(id: dossier.id)} + %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.col-xs-1.center - total_notif = dossier.notifications.where(already_read: false).count @@ -54,9 +54,9 @@ %td.center - if current_gestionnaire.follow?(dossier.id) = link_to('Quitter'.html_safe, backoffice_dossier_follow_path(dossier_id: dossier.id), 'data-method' => :put, class: 'btn-sm btn-danger', id: "suivre_dossier_#{dossier.id}") - -else + - else = link_to('Suivre', backoffice_dossier_follow_path(dossier_id: dossier.id), 'data-method' => :put, class: 'btn-sm btn-primary', id: "suivre_dossier_#{dossier.id}") - %td.center{style:"color: #{dossier.total_follow == 0 ? 'red' : ''}"} + %td.center{ style: "color: #{dossier.total_follow == 0 ? 'red' : ''}" } = dossier.total_follow = smart_listing.paginate diff --git a/app/views/backoffice/dossiers/_pref_list.html.haml b/app/views/backoffice/dossiers/_pref_list.html.haml index 00fe0f247..b92e4a41c 100644 --- a/app/views/backoffice/dossiers/_pref_list.html.haml +++ b/app/views/backoffice/dossiers/_pref_list.html.haml @@ -1,10 +1,10 @@ %button#pref_list_dossier_close_action.btn.btn-danger.btn-xs.fixed-right %i.fa.fa-close %h3 - =t('dynamics.backoffice.pref_list.title') + = t('dynamics.backoffice.pref_list.title') -%p{style:'margin-top: 15px; margin-bottom: 20px'} - =t('dynamics.backoffice.pref_list.description') +%p{ style: 'margin-top: 15px; margin-bottom: 20px;' } + = t('dynamics.backoffice.pref_list.description') %h4.text-primary Actuelles @@ -16,10 +16,10 @@ = hidden_field_tag :pref_id, preference.id = hidden_field_tag :procedure_id, preference.procedure_id = preference.libelle - %button.btn.btn-default.btn-xs{type: :submit, id: "delete_pref_list_#{preference[:table]}_#{preference[:attr]}"} + %button.btn.btn-default.btn-xs{ type: :submit, id: "delete_pref_list_#{preference[:table]}_#{preference[:attr]}" } %i.fa.fa-minus -%h4.text-success{style:'margin-top: 15px'} +%h4.text-success{ style: 'margin-top: 15px;' } Disponibles %table @@ -27,7 +27,7 @@ - if index%2 == 0 || tables.first.to_s.include?('champs') %tr - %td.col-xs-5{style: 'vertical-align: top', colspan: (tables.first == :champs ? 2 : 1)} + %td.col-xs-5{ style: 'vertical-align: top;', colspan: (tables.first == :champs ? 2 : 1) } %h5= tables.first.to_s.gsub('_', ' ').capitalize %ul - if tables.second @@ -42,5 +42,5 @@ = 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]}"} + %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 60ac57068..b7d58ceea 100644 --- a/app/views/backoffice/dossiers/_state_description.html.haml +++ b/app/views/backoffice/dossiers/_state_description.html.haml @@ -1,21 +1,21 @@ -#state_description.row{style:'width: 50%; margin-left: auto; margin-right: auto'} +#state_description.row{ style: 'width: 50%; margin-left: auto; margin-right: auto;' } .panel.panel-info .panel-body.center .row .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%'} + .fa.fa-info-circle.text-info{ style: 'font-size: 2em; margin-top: 20%;' } .col-xs-11 - -if dossiers_list_facade.liste == 'nouveaux' + - if dossiers_list_facade.liste == 'nouveaux' Tous les dossiers présents dans cette liste sont ceux qui %b n'ont jamais été ouvert par votre service. Il attende une première lecture et intervention de votre part. - -elsif dossiers_list_facade.liste == 'a_traiter' + - elsif dossiers_list_facade.liste == 'a_traiter' Tous les dossiers présents dans cette liste sont ceux qui sont %b en cours de construction avec l'usager. Ils ne sont pas figés et ne sont donc pas complets. - -elsif dossiers_list_facade.liste == 'fige' + - elsif dossiers_list_facade.liste == 'fige' Tous les dossiers présents dans cette liste ont été déclarés %b complets @@ -23,14 +23,14 @@ %b plus modifiables par l'usager. Ils attendent donc leurs dépots officiels qui doit être effectué par l'usager. - -elsif dossiers_list_facade.liste == 'deposes' + - elsif dossiers_list_facade.liste == 'deposes' Tous les dossiers présents dans cette liste ont été %b officiellement déposé par l'usager pour examen. Il faut donc que vous confirmiez par "accusé de réception" la bonne réception de toutes les informations et documents demandés avant examen final. - -elsif dossiers_list_facade.liste == 'a_instruire' + - elsif dossiers_list_facade.liste == 'a_instruire' Tous les dossiers présents dans cette liste sont à instruire. Ceux sont tous les dossiers %b qui ont reçu bonne réception. - -elsif dossiers_list_facade.liste == 'termine' + - elsif dossiers_list_facade.liste == 'termine' Tous les dossiers présents dans cette liste sont considérés comme cloturé car ils ont tous reçu un verdict final qui peut être "Validé", "Refusé" ou "Sans suite". diff --git a/app/views/backoffice/dossiers/index.html.haml b/app/views/backoffice/dossiers/index.html.haml index 561c8df4b..f10570616 100644 --- a/app/views/backoffice/dossiers/index.html.haml +++ b/app/views/backoffice/dossiers/index.html.haml @@ -16,13 +16,13 @@ .row.center .col-xs-3 - =link_to 'Tous les états', '?liste=all_state', class: 'text-info', style:"text-decoration: #{@facade_data_view.liste == 'all_state'? 'underline' : ''}" + = link_to 'Tous les états', '?liste=all_state', class: 'text-info', style: "text-decoration: #{@facade_data_view.liste == 'all_state'? 'underline' : ''}" .col-xs-3 - =link_to 'En construction', '?liste=a_traiter', class: 'text-danger', style:"text-decoration: #{@facade_data_view.liste == 'a_traiter'? 'underline' : ''}" + = link_to 'En construction', '?liste=a_traiter', class: 'text-danger', style: "text-decoration: #{@facade_data_view.liste == 'a_traiter'? 'underline' : ''}" .col-xs-3 - =link_to 'En instruction', '?liste=a_instruire', class: 'text-warning', style:"text-decoration: #{@facade_data_view.liste == 'a_instruire'? 'underline' : ''}" + = link_to 'En instruction', '?liste=a_instruire', class: 'text-warning', style: "text-decoration: #{@facade_data_view.liste == 'a_instruire'? 'underline' : ''}" .col-xs-3 - =link_to 'Terminés', '?liste=termine', class: 'text-success', style:"text-decoration: #{@facade_data_view.liste == 'termine'? 'underline' : ''}" + = link_to 'Terminés', '?liste=termine', class: 'text-success', style: "text-decoration: #{@facade_data_view.liste == 'termine'? 'underline' : ''}" .default_data_block.default_visible .row.show-block#follow_dossiers diff --git a/app/views/backoffice/dossiers/search.html.haml b/app/views/backoffice/dossiers/search.html.haml index 8700346d4..34ffd639d 100644 --- a/app/views/backoffice/dossiers/search.html.haml +++ b/app/views/backoffice/dossiers/search.html.haml @@ -3,14 +3,14 @@ = 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 + .row.show-block#new_dossiers + .header + .col-lg-10.col-md-10.col-sm-10.col-xs-10.title + .carret-right + .carret-down Résultat de la recherche - %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count - =@dossiers.count + .col-lg-2.col-md-2.col-sm-2.col-xs-2.count + = @dossiers.count dossiers - %div.body + .body = smart_listing_render :search diff --git a/app/views/cgu/index.html.haml b/app/views/cgu/index.html.haml index cb51ab8dc..7f2116cd0 100644 --- a/app/views/cgu/index.html.haml +++ b/app/views/cgu/index.html.haml @@ -41,14 +41,14 @@ %br %h3#object_website Object du site internet - %a{:href => "https://tps.apientreprise.fr/"} + %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/"} + %a{ :href => "https://tps.apientreprise.fr/" } TPS %p Les acteurs de TPS sont les suivants : %ul @@ -64,7 +64,7 @@ %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. + %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. @@ -78,7 +78,7 @@ %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 + %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. @@ -97,9 +97,9 @@ %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 + %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 + %a{ :href => "http://www.sirene.fr/sirene/public/static/mentions-legales" } Condition légales d’utilisation de service SIRENE %br %h4 INFOGREFFE : %p @@ -112,9 +112,9 @@ 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 + %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 + %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 : @@ -122,18 +122,18 @@ %p %strong> France CONNECT \ : informations complémentaires : - %a{:href => "https://franceconnect.gouv.fr/"} https://franceconnect.gouv.fr/ + %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/ + %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/ + %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 + %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 : @@ -143,7 +143,7 @@ %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 + %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 diff --git a/app/views/commencer/archived.html.haml b/app/views/commencer/archived.html.haml index d550d24e4..84c72ab34 100644 --- a/app/views/commencer/archived.html.haml +++ b/app/views/commencer/archived.html.haml @@ -1,8 +1,8 @@ %br -%div{style: 'text-align: center; max-width:500px; margin-left:auto; margin-right:auto; padding: 20px;'} +%div{ style: 'text-align: center; max-width: 500px; margin-left: auto; margin-right: auto; padding: 20px;' } = render partial: 'users/sessions/resume_procedure' -.center{style:'margin-top: -20px'} +.center{ style: 'margin-top: -20px;' } %h3 La campagne de création de nouveau dossier %br @@ -11,5 +11,5 @@ %br %p Si vous avez déjà déposé un ou plusieurs dossiers : - %a.btn.btn-lg.btn-info{href: new_user_session_path} + %a.btn.btn-lg.btn-info{ href: new_user_session_path } Accéder à mon espace en ligne. diff --git a/app/views/demo/_list.html.haml b/app/views/demo/_list.html.haml index ebc52f855..60ea99bdc 100644 --- a/app/views/demo/_list.html.haml +++ b/app/views/demo/_list.html.haml @@ -1,7 +1,7 @@ - unless smart_listing.empty? %table.table %tr - %th{colspan: 4} + %th{ colspan: 4 } %h4 Lien vers les procédures TPS %tr %th= smart_listing.sortable 'ID', 'id' diff --git a/app/views/dossiers/_commentaires_files.html.haml b/app/views/dossiers/_commentaires_files.html.haml index 86980162a..f8414e4db 100644 --- a/app/views/dossiers/_commentaires_files.html.haml +++ b/app/views/dossiers/_commentaires_files.html.haml @@ -16,7 +16,7 @@ %tr %td= file.user.nil? ? 'Accompagnateur' : file.user.email %td= file.created_at.localtime - %td= link_to file.original_filename, file.content_url, style:'color: green', target: '_blank' + %td= link_to file.original_filename, file.content_url, style: 'color: green;', target: '_blank' - else %h4.text-primary Pas de fichier dans le flux de commentaires. diff --git a/app/views/dossiers/_dossier_show.html.haml b/app/views/dossiers/_dossier_show.html.haml index 842c9740c..be5f83190 100644 --- a/app/views/dossiers/_dossier_show.html.haml +++ b/app/views/dossiers/_dossier_show.html.haml @@ -2,66 +2,66 @@ - if @facade.procedure.individual_with_siret .default_data_block - %div.row.show-block.infos - %div.header - %div.col-xs-8.title-no-expanse - %div.carret-right + .row.show-block.infos + .header + .col-xs-8.title-no-expanse + .carret-right INFORMATIONS DU DEMANDEUR - 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" + %a#add_siret.action{ href: users_dossier_add_siret_path(dossier_id: @facade.dossier.id) } + .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-xs-12.title - %div.carret-right - %div.carret-down + .row.show-block.infos#infos_entreprise + .header + .col-xs-12.title + .carret-right + .carret-down INFORMATIONS DU DEMANDEUR - %div.body.display-block-on-print + .body.display-block-on-print = render partial: '/dossiers/infos_entreprise' .default_data_block.default_visible - %div.row.show-block.infos#infos_dossier - %div.header - %div.col-xs-10.title - %div.carret-right - %div.carret-down + .row.show-block.infos#infos_dossier + .header + .col-xs-10.title + .carret-right + .carret-down CONSTRUCTION DU DOSSIER = render partial: '/dossiers/edit_dossier' - %div.body.display-block-on-print + .body.display-block-on-print = render partial: '/dossiers/infos_dossier' - if @facade.dossier.procedure.module_api_carto.use_api_carto .default_data_block.default_visible.no-page-break-inside - %div.row.show-block#carto - %div.header - %div.col-xs-10.title - %div.carret-right - %div.carret-down + .row.show-block#carto + .header + .col-xs-10.title + .carret-right + .carret-down CARTOGRAPHIE = render partial: '/dossiers/edit_carto' - %div.body.display-block-on-print - %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}"} + .body.display-block-on-print + %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} + = 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-xs-10.title - %div.carret-right - %div.carret-down + .row.show-block#private-fields + .header + .col-xs-10.title + .carret-right + .carret-down = "formulaire privé".upcase - %div.col-xs-2.count + .col-xs-2.count - private_fields_count = @champs_private.count = (private_fields_count == 1) ? "1 champ" : "#{private_fields_count} champs" - %div.body + .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 index 71a010a84..369bd4327 100644 --- a/app/views/dossiers/_download_dossiers.html.haml +++ b/app/views/dossiers/_download_dossiers.html.haml @@ -5,11 +5,11 @@ %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 + = 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 + = 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 index 08380a1a6..91ece5bd1 100644 --- a/app/views/dossiers/_edit_carto.html.haml +++ b/app/views/dossiers/_edit_carto.html.haml @@ -1,5 +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 + %a#maj_carte.action{ href: "/users/dossiers/#{@facade.dossier.id}/carte" } + .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 index 5f07d7ccc..d02c08c89 100644 --- a/app/views/dossiers/_edit_dossier.html.haml +++ b/app/views/dossiers/_edit_dossier.html.haml @@ -1,5 +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"} + %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 index c65d90d10..61a8dc794 100644 --- a/app/views/dossiers/_edit_pieces_jointes.html.haml +++ b/app/views/dossiers/_edit_pieces_jointes.html.haml @@ -1,11 +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", + .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'} + 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 index c51812500..fc5971888 100644 --- a/app/views/dossiers/_infos_carto.html.haml +++ b/app/views/dossiers/_infos_carto.html.haml @@ -1,11 +1,11 @@ .row .col-xs-12 - #map.mini{class: @facade.dossier.procedure.module_api_carto.classes} + #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}"} + %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'} + %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 39772f897..954aa6856 100644 --- a/app/views/dossiers/_infos_dossier.html.haml +++ b/app/views/dossiers/_infos_dossier.html.haml @@ -1,26 +1,26 @@ -%div.row +.row .col-xs-12 - if @facade.procedure.for_individual? .row.title-row - %div.col-xs-4.split-hr - %div.col-xs-4.dossier-title= t('utils.depositaire').upcase - %div.col-xs-4.split-hr + .col-xs-4.split-hr + .col-xs-4.dossier-title= t('utils.depositaire').upcase + .col-xs-4.split-hr .row - %div.col-xs-6.depositaire-label Civilité - %div.col-xs-1.comments-off= "-" - %div.col-xs-5.depositaire-info= @facade.individual.gender + .col-xs-6.depositaire-label Civilité + .col-xs-1.comments-off= "-" + .col-xs-5.depositaire-info= @facade.individual.gender .row - %div.col-xs-6.depositaire-label Nom - %div.col-xs-1.comments-off= "-" - %div.col-xs-5.depositaire-info= @facade.individual.nom + .col-xs-6.depositaire-label Nom + .col-xs-1.comments-off= "-" + .col-xs-5.depositaire-info= @facade.individual.nom .row - %div.col-xs-6.depositaire-label Prénom - %div.col-xs-1.comments-off= "-" - %div.col-xs-5.despositaire-info= @facade.individual.prenom + .col-xs-6.depositaire-label Prénom + .col-xs-1.comments-off= "-" + .col-xs-5.despositaire-info= @facade.individual.prenom .row - %div.col-xs-6.depositaire-label Date de naissance - %div.col-xs-1.comments-off= "-" - %div.col-xs-5.depositaire-info= @facade.individual.birthdate + .col-xs-6.depositaire-label Date de naissance + .col-xs-1.comments-off= "-" + .col-xs-5.depositaire-info= @facade.individual.birthdate .row.margin-top-20 - unless @facade.champs.nil? @@ -28,32 +28,39 @@ - next if champ.type_champ == 'explication' - if champ.type_champ == 'header_section' .row.title-row.margin-top-40 - %div.col-xs-3.split-hr - %div.col-xs-6.dossier-title= champ.libelle.upcase - %div.col-xs-3.split-hr + .col-xs-3.split-hr + .col-xs-6.dossier-title= champ.libelle.upcase + .col-xs-3.split-hr - else .row - %div.col-xs-6.depositaire-label= champ.libelle - %div.col-md-1.col-lg-1.col-sm-1.col-xs-1.comments-off + .col-xs-6.depositaire-label= champ.libelle + .col-xs-1.comments-off = "-" - %div.col-xs-5.depositaire-info{ id: "champ-#{champ.id}-value" } + .col-xs-5.depositaire-info{ id: "champ-#{champ.id}-value" } - unless champ.decorate.value.blank? - = champ.decorate.value.html_safe + - if champ.type_champ == 'dossier_link' + - dossier = Dossier.find_by(id: champ.decorate.value) + - if dossier && gestionnaire_signed_in? + = link_to(dossier.procedure.libelle, backoffice_dossier_path(champ.decorate.value), target: '_blank') + - else + = dossier.nil? ? 'pas de dossier associé' : dossier.procedure.libelle + - else + = champ.decorate.value.html_safe - 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 (" + 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 + = "#{@facade.dossier.user.given_name} #{@facade.dossier.user.family_name}" + ) +.row - if @facade.procedure.cerfa_flag? || @facade.dossier.types_de_piece_justificative.count > 0 .col-xs-12 .row.title-row - %div.col-xs-4.split-hr - %div.col-xs-4.dossier-title= t('utils.pieces').upcase - %div.col-xs-4.split-hr + .col-xs-4.split-hr + .col-xs-4.dossier-title= t('utils.pieces').upcase + .col-xs-4.split-hr .col-xs-12#pieces_justificatives.margin-bot-40 .row @@ -65,39 +72,39 @@ .col-xs-5.despositaire-info - if @facade.dossier.cerfa_available? %a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter - %span{style:'margin-left:12px'} + %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' + Pièce non fournie .row .col-xs-12 - @facade.types_de_pieces_justificatives.each do |type_de_piece_justificative| .row.piece-row .col-xs-12{ id: "piece_justificative_#{type_de_piece_justificative.id}" } .row - %div.col-xs-6.depositaire-label= type_de_piece_justificative.libelle - %div.col-xs-1.comments-off= "-" - %div.col-xs-5.despositaire-info + .col-xs-6.depositaire-label= type_de_piece_justificative.libelle + .col-xs-1.comments-off= "-" + .col-xs-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'} + %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' + Pièce non fournie - 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 .row .col-xs-4 - %a#maj_pj.action{"data-target" => "#UploadPJmodal", "data-toggle" => "modal", :type => "button"} + %a#maj_pj.action{ "data-target" => "#UploadPJmodal", "data-toggle" => "modal", :type => "button" } .col-xs-4.action Modifier les documents %br @@ -105,12 +112,12 @@ .col-xs-4 - if gestionnaire_signed_in? - #PJmodal.modal.fade{"aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"} - .modal-dialog.modal-lg{:role => "document"} + #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"} × + %button.close{ "aria-label" => "Close", "data-dismiss" => "modal", :type => "button" } + %span{ "aria-hidden" => "true" } × %h4#myModalLabel.modal-title Historique des %span#PJmodal_title @@ -124,7 +131,7 @@ %th Lien %thead.tr_content#cerfa - -if @facade.procedure.cerfa_flag? + - if @facade.procedure.cerfa_flag? - if @facade.dossier.cerfa_available? - @facade.cerfas_ordered.each do |cerfa| %tr @@ -133,9 +140,9 @@ %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} + = 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}"} + %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 @@ -143,15 +150,15 @@ %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} + = link_to 'Récupérer', piece_justificative.content_url, { target: :blank } .modal-footer -#modalCommentairesDossierParChamp.modal.fade{"tabindex" => -1, "role" => "dialog"} - .modal-dialog{"role" => "document"} +#modalCommentairesDossierParChamp.modal.fade{ "tabindex" => -1, "role" => "dialog" } + .modal-dialog{ "role" => "document" } .modal-content .modal-header - %button.close{"data-dismiss" => "modal", "aria-label" => "Fermer"} - %span{"aria-hidden" => true} + %button.close{ "data-dismiss" => "modal", "aria-label" => "Fermer" } + %span{ "aria-hidden" => true } × .modal-title Commentaires @@ -159,5 +166,5 @@ %p Chargement des commentaires en cours... .modal-footer - %button.btn.btn-primary{"data-dismiss" => "modal"} + %button.btn.btn-primary{ "data-dismiss" => "modal" } Fermer diff --git a/app/views/dossiers/_infos_entreprise.html.haml b/app/views/dossiers/_infos_entreprise.html.haml index 599c9b7bb..661634697 100644 --- a/app/views/dossiers/_infos_entreprise.html.haml +++ b/app/views/dossiers/_infos_entreprise.html.haml @@ -2,51 +2,51 @@ %h4 = @facade.entreprise.raison_sociale_or_name .row.split-row - %div.col-xs-12.split-hr -%div.row + .col-xs-12.split-hr +.row .col-xs-12 .row - %div.col-xs-4.entreprise-label Siret : - %div.col-xs-8.entreprise-info= @facade.etablissement.siret + .col-xs-4.entreprise-label Siret : + .col-xs-8.entreprise-info= @facade.etablissement.siret - if @facade.etablissement.siret != @facade.entreprise.siret_siege_social .row - %div.col-xs-4.entreprise-label SIRET siège social : - %div.col-xs-8.entreprise-info= @facade.entreprise.siret_siege_social + .col-xs-4.entreprise-label SIRET siège social : + .col-xs-8.entreprise-info= @facade.entreprise.siret_siege_social .row - %div.col-xs-4.entreprise-label Forme juridique : - %div.col-xs-8.entreprise-info= @facade.entreprise.forme_juridique + .col-xs-4.entreprise-label Forme juridique : + .col-xs-8.entreprise-info= @facade.entreprise.forme_juridique .row - %div.col-xs-4.entreprise-label Libellé naf : - %div.col-xs-8.entreprise-info= @facade.etablissement.libelle_naf + .col-xs-4.entreprise-label Libellé naf : + .col-xs-8.entreprise-info= @facade.etablissement.libelle_naf .row - %div.col-xs-4.entreprise-label Code naf : - %div.col-xs-8.entreprise-info= @facade.etablissement.naf + .col-xs-4.entreprise-label Code naf : + .col-xs-8.entreprise-info= @facade.etablissement.naf .row - %div.col-xs-4.entreprise-label Date de création : - %div.col-xs-8.entreprise-info= Time.at(@facade.entreprise.date_creation).strftime "%d-%m-%Y" + .col-xs-4.entreprise-label Date de création : + .col-xs-8.entreprise-info= Time.at(@facade.entreprise.date_creation).strftime "%d-%m-%Y" .row - %div.col-xs-4.entreprise-label Effectif organisation : - %div.col-xs-8.entreprise-info= @facade.entreprise.effectif + .col-xs-4.entreprise-label Effectif organisation : + .col-xs-8.entreprise-info= @facade.entreprise.effectif .row - %div.col-xs-4.entreprise-label Code effectif : - %div.col-xs-8.entreprise-info= @facade.entreprise.code_effectif_entreprise + .col-xs-4.entreprise-label Code effectif : + .col-xs-8.entreprise-info= @facade.entreprise.code_effectif_entreprise .row - %div.col-xs-4.entreprise-label Numéro TVA intracommunautaire : - %div.col-xs-8.entreprise-info= @facade.entreprise.numero_tva_intracommunautaire + .col-xs-4.entreprise-label Numéro TVA intracommunautaire : + .col-xs-8.entreprise-info= @facade.entreprise.numero_tva_intracommunautaire .row - %div.col-xs-4.entreprise-label Adresse : - %div.col-xs-8.entreprise-info + .col-xs-4.entreprise-label Adresse : + .col-xs-8.entreprise-info - @facade.etablissement.adresse.split("\n").each do |line| = line .row - %div.col-xs-4.entreprise-label Capital social : - %div.col-xs-8.entreprise-info= @facade.entreprise.pretty_capital_social + .col-xs-4.entreprise-label Capital social : + .col-xs-8.entreprise-info= @facade.entreprise.pretty_capital_social .row - %div.col-xs-4.entreprise-label Exercices : - %div.col-xs-8.entreprise-info + .col-xs-4.entreprise-label Exercices : + .col-xs-8.entreprise-info - @facade.etablissement.exercices.each_with_index do |exercice, index| %strong = "#{exercice.dateFinExercice.year} : " @@ -54,6 +54,6 @@ %br .row.split-row - %div.col-xs-12.split-hr + .col-xs-12.split-hr - unless @facade.entreprise.rna_information.nil? = 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 index 5268bdadb..78d1df89f 100644 --- a/app/views/dossiers/_infos_pieces_jointes.html.haml +++ b/app/views/dossiers/_infos_pieces_jointes.html.haml @@ -8,14 +8,14 @@ .col-xs-5 - if @facade.dossier.cerfa_available? %a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter - %span{style:'margin-left:12px'} + %span{ style: 'margin-left: 12px;' } \- - %a.btn.fa.fa-timer{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", "data-modal_title" => 'formulaires', - "data-modal_index" => 'cerfa'} + "data-modal_index" => 'cerfa' } - else = 'Pièce non fournie' @@ -30,20 +30,20 @@ - 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? + -# - if user_signed_in? + -# = 'Pièce fournie' + -# - elsif gestionnaire_signed_in? %a{ href: "#{@pj.content_url}", target: '_blank' } Consulter - %span{style:'margin-left:12px'} + %span{ style: 'margin-left: 12px;' } \- - %a.btn.fa.fa-timer{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", "data-modal_title" => type_de_piece_justificative.libelle, - "data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}"} + "data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}" } - else = 'Pièce non fournie' - -#- if gestionnaire_signed_in? + -# - 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 index 295f6be56..f1b75dc53 100644 --- a/app/views/dossiers/_infos_private_fields.html.haml +++ b/app/views/dossiers/_infos_private_fields.html.haml @@ -1,6 +1,6 @@ -.row{style: 'margin-top: -20px'} +.row{ style: 'margin-top: -20px;' } .col-xs-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} + = 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'} + = submit_tag :Enregistrer, { class: 'btn-action' } diff --git a/app/views/dossiers/_invites.html.haml b/app/views/dossiers/_invites.html.haml index 88bead8bb..0d8f47d58 100644 --- a/app/views/dossiers/_invites.html.haml +++ b/app/views/dossiers/_invites.html.haml @@ -14,4 +14,4 @@ .col-xs-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', data: {confirm: "Envoyer l'invitation ?"} + = submit_tag 'Ajouter', class: 'btn btn-success', id: 'send-invitation', data: { confirm: "Envoyer l'invitation ?" } diff --git a/app/views/dossiers/_messagerie.html.haml b/app/views/dossiers/_messagerie.html.haml index 58a8ac81b..eb8b59324 100644 --- a/app/views/dossiers/_messagerie.html.haml +++ b/app/views/dossiers/_messagerie.html.haml @@ -1,4 +1,4 @@ -.default_data_block{style:'margin-top: 40px'} +.default_data_block{ style: 'margin-top: 40px;' } .row.show-block.clearfix#messages .header .col-xs-10.title diff --git a/app/views/dossiers/_pieces_justificatives.html.haml b/app/views/dossiers/_pieces_justificatives.html.haml index 888c65b1a..f547b1a4d 100644 --- a/app/views/dossiers/_pieces_justificatives.html.haml +++ b/app/views/dossiers/_pieces_justificatives.html.haml @@ -1,22 +1,22 @@ #pieces_justificatives %table.table - if @facade.procedure.cerfa_flag? - %tr{id: "piece_justificative_0"} - %th{class:'col-lg-6'} - ='Formulaire' + %tr{ id: "piece_justificative_0" } + %th.col-lg-6 + Formulaire %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'} + %span{ style: 'margin-left: 12px;' } \- - %a.btn.fa.fa-timer{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", "data-modal_title" => 'formulaires', - "data-modal_index" => 'cerfa'} + "data-modal_index" => 'cerfa' } - else - = 'Pièce non fournie' + Pièce non fournie - @facade.dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative| %tr{ id: "piece_justificative_#{type_de_piece_justificative.id}" } @@ -26,20 +26,20 @@ - 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? + -# - if user_signed_in? + -# = 'Pièce fournie' + -# - elsif gestionnaire_signed_in? %a{ href: "#{@pj.content_url}", target: '_blank' } Consulter - %span{style:'margin-left:12px'} + %span{ style: 'margin-left: 12px;' } \- - %a.btn.fa.fa-timer{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", "data-modal_title" => type_de_piece_justificative.libelle, - "data-modal_index" => "type_de_pj_#{type_de_piece_justificative.id}"} + "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' + -# - if gestionnaire_signed_in? + = render partial: '/dossiers/modal_historique' diff --git a/app/views/dossiers/_show.html.haml b/app/views/dossiers/_show.html.haml index 4874bedb6..61ab17978 100644 --- a/app/views/dossiers/_show.html.haml +++ b/app/views/dossiers/_show.html.haml @@ -6,9 +6,9 @@ .row.etape.etape_2 = render partial: '/dossiers/etapes/etape2' - -#- if @facade.procedure.module_api_carto.use_api_carto? - -# .row.etape.etape_3 - -# = render partial: '/dossiers/etapes/etape3' + -# - if @facade.procedure.module_api_carto.use_api_carto? + -# .row.etape.etape_3 + -# = render partial: '/dossiers/etapes/etape3' -# - -#.row.etape.etape_4 - -# = render partial: '/dossiers/etapes/etape4' + -# .row.etape.etape_4 + -# = render partial: '/dossiers/etapes/etape4' diff --git a/app/views/dossiers/commentaires/_commentaire.html.haml b/app/views/dossiers/commentaires/_commentaire.html.haml index 576903f08..b5c928460 100644 --- a/app/views/dossiers/commentaires/_commentaire.html.haml +++ b/app/views/dossiers/commentaires/_commentaire.html.haml @@ -1,4 +1,4 @@ -%div.commentaire +.commentaire .comment-header = commentaire.header .content diff --git a/app/views/dossiers/commentaires/_form.html.haml b/app/views/dossiers/commentaires/_form.html.haml index e245c4964..d2b56b0f8 100644 --- a/app/views/dossiers/commentaires/_form.html.haml +++ b/app/views/dossiers/commentaires/_form.html.haml @@ -1,11 +1,10 @@ = form_tag(url_for({ controller: 'commentaires', action: :create, dossier_id: dossier_facade.dossier.id, champ_id: dossier_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"} + %textarea.form-control.wysihtml5{ id: 'texte_commentaire', name: 'texte_commentaire', style: 'width: 100%; margin-bottom: 2%;', rows: '5', placeholder: "Commentaire" } .row .col-md-6 - %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' - + %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;' .col-md-6.text-right %input#save-message.form-control.btn.btn-danger{ type: 'submit', value: 'ENVOYER' } diff --git a/app/views/dossiers/etapes/_etape1.html.haml b/app/views/dossiers/etapes/_etape1.html.haml index 784796e4b..5e1d46dbc 100644 --- a/app/views/dossiers/etapes/_etape1.html.haml +++ b/app/views/dossiers/etapes/_etape1.html.haml @@ -1,13 +1,13 @@ .col-xs-3.center %h3 Ma procédure - #logos.center{class: (@facade.entreprise.nil? ? '' : 'mask')} + #logos.center{ class: (@facade.entreprise.nil? ? '' : 'mask') } - if @facade.procedure.euro_flag #euro_flag.flag - =image_tag('drapeau_europe.png') + = image_tag('drapeau_europe.png') #logo_procedure.flag - =image_tag( @facade.procedure.decorate.logo_img ) + = image_tag( @facade.procedure.decorate.logo_img ) .etape.etapes_informations.col-xs-9 .row @@ -15,10 +15,10 @@ %h2#titre_procedure.text-info = @facade.procedure.libelle - %p#description_procedure{style:'width: 95%;', class: (@facade.entreprise.nil? ? '' : 'mask')} + %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'} + %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 fde33f55f..0c18f10e7 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' + = render partial: 'dossiers/etapes/etape_2/individual' - else = render partial: 'dossiers/etapes/etape_2/entreprise' diff --git a/app/views/dossiers/etapes/etape_2/_entreprise.html.haml b/app/views/dossiers/etapes/etape_2/_entreprise.html.haml index 6f0d121f8..c817a95a9 100644 --- a/app/views/dossiers/etapes/etape_2/_entreprise.html.haml +++ b/app/views/dossiers/etapes/etape_2/_entreprise.html.haml @@ -3,7 +3,7 @@ Mes informations %br - unless @facade.entreprise.nil? - .center{style:'margin-left: -5%'} + .center{ style: 'margin-left: -5%;' } Vous êtes authentifié avec le SIRET %h3.text-success @@ -15,8 +15,8 @@ .etape.etapes_informations.col-xs-9 .row - if @facade.entreprise.nil? - #new_siret{style:'margin-left: 20%; margin-top: 5%'} - = form_for @facade.dossier, html: {class: 'form-inline'}, url: users_dossier_siret_informations_path(dossier_id: @facade.dossier.id), method: :post, remote: true do |f| + #new_siret{ style: 'margin-left: 20%; margin-top: 5%;' } + = form_for @facade.dossier, html: { class: 'form-inline' }, url: users_dossier_siret_informations_path(dossier_id: @facade.dossier.id), method: :post, remote: true do |f| .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 @@ -26,15 +26,15 @@ #recap_info_entreprise = render partial: '/dossiers/infos_entreprise' - %p#insee_infogreffe{style:'color:grey; float:right'} + %p#insee_infogreffe{ style: 'color: grey; float: right;' } %i Informations récupérées auprès de l'INSEE et d'INFOGREFFE %br = form_for @facade.dossier, url: { controller: '/users/dossiers', action: :update } do |f| = f.hidden_field :id - %label{ style:'font-weight:normal' } + %label{ style: 'font-weight: normal;' } = f.check_box :autorisation_donnees J'autorise les décideurs publics à vérifier les informations de mon organisation auprès des administrations concernées. Ces informations resteront strictement confidentielles. %br - = f.submit 'Etape suivante', class: "btn btn btn-info", style: 'float:right', id: 'etape_suivante', disabled: :disabled + = f.submit 'Etape suivante', class: "btn btn btn-info", style: 'float: right;', id: 'etape_suivante', disabled: :disabled diff --git a/app/views/dossiers/etapes/etape_2/_individual.html.haml b/app/views/dossiers/etapes/etape_2/_individual.html.haml index 48bc13797..2e2298c33 100644 --- a/app/views/dossiers/etapes/etape_2/_individual.html.haml +++ b/app/views/dossiers/etapes/etape_2/_individual.html.haml @@ -21,24 +21,24 @@ %label %h4 Nom * - = ff.text_field :nom, {class: 'form-control'} + = ff.text_field :nom, { class: 'form-control', required: true } .form-group %label %h4 Prénom * - = ff.text_field :prenom, {class: 'form-control'} + = ff.text_field :prenom, { class: 'form-control', required: true } .form-group %label %h4 Date de naissance * - = ff.date_field :birthdate, {class: 'form-control', placeholder: 'jj/mm/aaaa'} + = ff.date_field :birthdate, { class: 'form-control', placeholder: 'jj/mm/aaaa', required: true } %p - %label{ style:'font-weight:normal' } + %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' + = link_to 'en savoir plus', cgu_path, target: '_blank' .row .col-xs-5.col-xs-5 .col-xs-2.col-xs-2 diff --git a/app/views/france_connect/particulier/check_email.html.haml b/app/views/france_connect/particulier/check_email.html.haml index 9ec330f2b..da4efd5be 100644 --- a/app/views/france_connect/particulier/check_email.html.haml +++ b/app/views/france_connect/particulier/check_email.html.haml @@ -1,9 +1,9 @@ %h2.text-info - = image_tag('logo_FC_02_small.png', style: 'height: 55px') + = image_tag('logo_FC_02_small.png', style: 'height: 55px;')  France Connect - Particulier %h3 Nouvelle connexion -%h4.text-warning{style:'margin-left: 20px'} Email déjà utilisé +%h4.text-warning{ style: 'margin-left: 20px;' } Email déjà utilisé %br %p @@ -13,11 +13,11 @@ %br .center #france_connect_particulier_email - = form_for @user, url: {controller: 'france_connect/particulier', action: :check_email}, method: :post do |f| + = form_for @user, url: { controller: 'france_connect/particulier', action: :check_email }, method: :post do |f| .form-group.form-group-lg = f.text_field :email_france_connect, class: "form-control", readonly: 'readonly' %br = f.password_field :password, class: "form-control", placeholder: "Entrez votre mot de passe" = hidden_field_tag :fci_id, params[:fci_id] = hidden_field_tag :salt, params[:salt] - = f.submit 'Terminer', class: %w(btn btn-lg btn-success), style: 'margin-top:20px;', id: 'valid_new_fcp' + = f.submit 'Terminer', class: %w(btn btn-lg btn-success), style: 'margin-top: 20px;', id: 'valid_new_fcp' diff --git a/app/views/france_connect/particulier/new.html.haml b/app/views/france_connect/particulier/new.html.haml index 494d40c6b..22f6c8e72 100644 --- a/app/views/france_connect/particulier/new.html.haml +++ b/app/views/france_connect/particulier/new.html.haml @@ -1,5 +1,5 @@ %h2.text-info - = image_tag('logo_FC_02_small.png', style: 'height: 55px') + = image_tag('logo_FC_02_small.png', style: 'height: 55px;')  France Connect - Particulier %h3 Nouvelle connexion @@ -24,9 +24,9 @@ .center #france_connect_particulier_email - = form_for @user, url: {controller: 'france_connect/particulier', action: :check_email}, method: :post do |f| + = form_for @user, url: { controller: 'france_connect/particulier', action: :check_email }, method: :post do |f| .form-group.form-group-lg = f.text_field :email_france_connect, class: "form-control", placeholder: "Entrez votre email" = hidden_field_tag :fci_id, params[:fci_id] = hidden_field_tag :salt, params[:salt] - = f.submit 'Terminer', class: %w(btn btn-lg btn-success), style: 'margin-top:20px;', id: 'valid_new_fcp' + = f.submit 'Terminer', class: %w(btn btn-lg btn-success), style: 'margin-top: 20px;', id: 'valid_new_fcp' diff --git a/app/views/gestionnaires/passwords/edit.html.haml b/app/views/gestionnaires/passwords/edit.html.haml index 7e41675f0..13888a958 100644 --- a/app/views/gestionnaires/passwords/edit.html.haml +++ b/app/views/gestionnaires/passwords/edit.html.haml @@ -27,5 +27,5 @@ %br %br .actions - = f.submit "Changer", class:'btn btn-primary' + = f.submit "Changer", class: 'btn btn-primary' %br diff --git a/app/views/gestionnaires/passwords/new.html.haml b/app/views/gestionnaires/passwords/new.html.haml index 45e53763f..5cb58e0b1 100644 --- a/app/views/gestionnaires/passwords/new.html.haml +++ b/app/views/gestionnaires/passwords/new.html.haml @@ -19,5 +19,5 @@ %br %br .actions - = f.submit "Renvoyer", class:'btn btn-primary' + = f.submit "Renvoyer", class: 'btn btn-primary' %br diff --git a/app/views/gestionnaires/sessions/new.html.haml b/app/views/gestionnaires/sessions/new.html.haml index 0180bd760..051112da6 100644 --- a/app/views/gestionnaires/sessions/new.html.haml +++ b/app/views/gestionnaires/sessions/new.html.haml @@ -24,6 +24,6 @@ %br %br .actions - = f.submit "Se connecter", class:'btn btn-primary' + = f.submit "Se connecter", class: 'btn btn-primary' %br = render "gestionnaires/shared/links" diff --git a/app/views/layouts/_credentials.html.haml b/app/views/layouts/_credentials.html.haml index 0622f4600..0f5457453 100644 --- a/app/views/layouts/_credentials.html.haml +++ b/app/views/layouts/_credentials.html.haml @@ -1,4 +1,4 @@ -%div.dropdown-menu#credentials - %div.description= t("utils.deconnexion") +.dropdown-menu#credentials + .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 145167c0d..23b68d504 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} += 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/_footer.html.haml b/app/views/layouts/_footer.html.haml index 41b2dbeff..aa3ee661b 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -1,10 +1,12 @@ %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"} + %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 'Statistiques', stats_path + \- = link_to 'CGU / Mentions légales', cgu_path \- = link_to 'Contact', "mailto:"+t('dynamics.contact_email') diff --git a/app/views/layouts/_ie_lt_10.html.haml b/app/views/layouts/_ie_lt_10.html.haml index 1c2ebbad5..da6c5365f 100644 --- a/app/views/layouts/_ie_lt_10.html.haml +++ b/app/views/layouts/_ie_lt_10.html.haml @@ -1,8 +1,8 @@ -="".html_safe += "".html_safe diff --git a/app/views/layouts/_modifications_terminees.html.haml b/app/views/layouts/_modifications_terminees.html.haml index 731af5544..d653f1044 100644 --- a/app/views/layouts/_modifications_terminees.html.haml +++ b/app/views/layouts/_modifications_terminees.html.haml @@ -1,3 +1,3 @@ -%div{style: 'float:right'} - %a.btn{href: "/users/dossiers/#{@dossier.id}/recapitulatif"} Retour - = submit_tag 'Modification terminée', class: %w(btn btn btn-info), id: 'modification_terminee', data: { disable_with: 'Modification terminée', submit: true} +%div{ style: 'float: right;' } + %a.btn{ href: "/users/dossiers/#{@dossier.id}/recapitulatif" } Retour + = submit_tag 'Modification terminée', class: %w(btn btn btn-info), id: 'modification_terminee', data: { disable_with: 'Modification terminée', submit: true } diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index e06e7ac45..226fa8396 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -1,5 +1,5 @@ .col-xs-2 - %a#title_navbar{href: '/'} + %a#title_navbar{ href: '/' } .row#home .col-lg-6.no-padding = image_tag('marianne_small.png', class: 'logo') @@ -9,9 +9,9 @@ .col-xs-10.no-padding #navbar-body .row - -begin + - begin = render partial: @navbar_url - -rescue + - rescue = render partial: 'layouts/navbars/navbar_default' = render partial: 'layouts/navbars/navbar_log_options' diff --git a/app/views/layouts/_support_navigator_banner.html.haml b/app/views/layouts/_support_navigator_banner.html.haml index 16c371807..8f892a3b8 100644 --- a/app/views/layouts/_support_navigator_banner.html.haml +++ b/app/views/layouts/_support_navigator_banner.html.haml @@ -5,5 +5,5 @@ = 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'} + %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 index 53d89fe35..53d3f2134 100644 --- a/app/views/layouts/_switch_devise_profile_module.html.haml +++ b/app/views/layouts/_switch_devise_profile_module.html.haml @@ -1,6 +1,6 @@ - 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} + %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 diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ab1caee1b..053d04646 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,10 +1,10 @@ %html %head - %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ + %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }/ %meta{ name: "turbolinks-cache-control", content: "no-cache" } %title - =t('dynamics.page_title') - %meta{'http-equiv' => "X-UA-Compatible", :content => "IE=edge"} + = t('dynamics.page_title') + %meta{ 'http-equiv' => "X-UA-Compatible", :content => "IE=edge" } = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = stylesheet_link_tag 'print', media: 'print', 'data-turbolinks-track' => true @@ -14,14 +14,14 @@ = action_cable_meta_tag %body = render partial: 'layouts/support_navigator_banner' - #beta{class:(Rails.env == 'production' ? '' : 'beta_staging')} + #beta{ class: (Rails.env == 'production' ? '' : 'beta_staging') } - if Rails.env == 'production' Beta - else Env Test - if Rails.env == 'test' - %script{type: 'text/javascript'} + %script{ type: 'text/javascript' } (typeof jQuery !== 'undefined') && (jQuery.fx.off = true); @@ -29,12 +29,12 @@ %div#wrap - %div.row + .row %div#header.navbar = render partial: "layouts/navbar" - %div.row.no-margin + .row.no-margin - if RenderPartialService.left_panel_exist? @left_pannel_url - %div.col-xs-2#left-panel + .col-xs-2#left-panel - if gestionnaire_signed_in? #search-block = render partial: 'layouts/left_panels/search_area' @@ -44,13 +44,13 @@ - else - main_container_size = 12 - =render partial: 'layouts/main_container', locals: {main_container_size: main_container_size} + = 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;'} + %i.fa.fa-times{ style: 'position: fixed; top: 10; right: 30; color: white;' } = 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/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 index bd8f7bb43..acfb49356 100644 --- 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 @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Accompagnateurs'} += render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Accompagnateurs' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml b/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml index 1bdf2e3b1..6d4ad3d89 100644 --- a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml +++ b/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'E-mails'} += 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_mailtemplatescontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml index 1bdf2e3b1..6d4ad3d89 100644 --- a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml +++ b/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'E-mails'} += 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 index c5f7aff8c..ac8b092e3 100644 --- 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 @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Pieces'} += 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 index 2fc92cf37..fc2b3685f 100644 --- 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 @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Prévisualisation'} += 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 index 36682366a..fb215e59f 100644 --- 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 @@ -1 +1 @@ -=render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index' += render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index' 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 index 36682366a..fb215e59f 100644 --- 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 @@ -1 +1 @@ -=render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index' += render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index' 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 index 65c5ce32e..43587373d 100644 --- 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 @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Description'} += 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 index c246b2d97..53fcb38c2 100644 --- 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 @@ -1,5 +1,5 @@ %div#first-block - %div.en-cours + .en-cours %b = dossier_count = current_administrateur.procedures.count = ("Procedures".pluralize(dossier_count)).upcase @@ -7,27 +7,27 @@ %div#action-block %div#menu-block - %div.split-hr-left + .split-hr-left #procedure_list - %a{:href => "#{url_for :admin_procedures_draft}", id: "draft-procedures"} - %div.procedure_list_element{class: @draft_class} - = "Brouillons" + %a{ :href => "#{url_for :admin_procedures_draft}", id: "draft-procedures" } + .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" + %a{ :href => "#{url_for :admin_procedures}", id: "active-procedures" } + .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" + %a{ :href => "#{url_for :admin_procedures_archived}", id: "archived-procedures" } + .procedure_list_element{ class: @archived_class } + Archivées .badge.progress-bar-purple = current_administrateur.procedures.where(archived: true).count - %div.split-hr-left + .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 index fe18dc18d..60036b2a5 100644 --- 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 @@ -1,51 +1,51 @@ %div#first-block - %div.en-cours - -unless @procedure.logo.blank? - = image_tag @procedure.decorate.logo_img, style: 'width: 30px' + .en-cours + - unless @procedure.logo.blank? + = image_tag @procedure.decorate.logo_img, style: 'width: 30px;' %b - =@procedure.libelle + = @procedure.libelle %div#action-block %div#menu-block - %div.split-hr-left + .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')} + %a{ :href => "#{url_for admin_procedure_path(@procedure)}", id: 'onglet-infos' } + .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') + %a{ :href => "#{url_for admin_procedure_accompagnateurs_path(@procedure)}", id: 'onglet-accompagnateurs' } + .procedure_list_element{ class: ('active' if active == 'Accompagnateurs') } + = t('dynamics.admin.procedure.onglets.accompagnateurs') - %a{:href => "#{url_for edit_admin_procedure_path(@procedure)}", id: 'onglet-description'} - %div.procedure_list_element{class: ('active' if active == 'Description')} + %a{ :href => "#{url_for edit_admin_procedure_path(@procedure)}", id: 'onglet-description' } + .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')} + %a{ :href => "#{url_for admin_procedure_types_de_champ_path(@procedure)}", id: 'onglet-champs' } + .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')} + %a{ :href => "#{url_for admin_procedure_pieces_justificatives_path(@procedure)}", id: 'onglet-pieces' } + .procedure_list_element{ class: ('active' if active == 'Pieces') } Pièces jointes - 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')} + %a{ :href => "#{url_for admin_procedure_types_de_champ_private_path(@procedure)}", id: 'onglet-private-champs' } + .procedure_list_element{ class: ('active' if active == 'Champs privés') } Champs privés - %a{:href => "#{url_for admin_procedure_mail_templates_path(@procedure)}", id: 'onglet-inemailsfos'} - %div.procedure_list_element{class: ('active' if active == 'E-mails')} + %a{ :href => "#{url_for admin_procedure_mail_templates_path(@procedure)}", id: 'onglet-inemailsfos' } + .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')} + %a{ :href => "#{url_for admin_procedure_previsualisation_path(@procedure)}", id: 'onglet-preview' } + .procedure_list_element{ class: ('active' if active == 'Prévisualisation') } Prévisualisation - %div.split-hr-left + .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 index 261049466..ffc8baf08 100644 --- 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 @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: 'Informations'} += 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 index 4e455ad7a..b1ee2bd6f 100644 --- 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 @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: @types_de_champ_facade.active} += 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 index b7e8e7336..7c678cf26 100644 --- 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 @@ -1 +1 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: {active: "Champs privés"} += 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_dossierscontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_backoffice_dossierscontroller_index.html.haml index 6f8b17d10..cd378550c 100644 --- 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 @@ -1,40 +1,40 @@ %div#first-block - %div.dossiers-en-cours + .dossiers-en-cours .count= @facade_data_view.total_dossier_follow - .text= "SUIVIS" - %div.nouveaux-dossiers + .text SUIVIS + .nouveaux-dossiers .count= @facade_data_view.total_new_dossier - .text= "NOUVEAUX" - %div.nouvelles-notifications + .text NOUVEAUX + .nouvelles-notifications .count= @facade_data_view.dossiers_with_unread_notifications.count - .text= "MODIFIÉS" + .text MODIFIÉS %div#action-block %div#menu-block - %div.split-hr-left + .split-hr-left #switch-buttons #switch-procedures.active Procédures #switch-notifications Notifications %div#infos-block - %div.split-hr-left + .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 '') } + = link_to backoffice_dossiers_procedure_path(procedure[:id]), { title: procedure[:libelle] } do + .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'} + .badge.progress-bar-success{ title: 'Nouveaux dossiers' } = total_new - -if procedure[:unread_notifications] > 0 - .badge.progress-bar-warning{title: 'Notifications'} + - 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." + .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 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 index 12f7b4e7c..8ffd1196e 100644 --- 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 @@ -10,13 +10,13 @@ - elsif @facade.dossier.received? %ul.list-inline %li - = link_to url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'btn btn-success', method: :post, title: 'Accepter', data: { toggle: :tooltip, confirm: "Accepter ce dossier ?" } do + = link_to url_for({ controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id }), class: 'btn btn-success', method: :post, title: 'Accepter', data: { toggle: :tooltip, confirm: "Accepter ce dossier ?" } do %i.fa.fa-check %li - = link_to url_for({controller: 'backoffice/dossiers', action: :without_continuation, dossier_id: @facade.dossier.id}), class: 'btn btn-warning', method: :post, title: 'Classer sans suite', data: { toggle: :tooltip, confirm: "Classer sans suite ce dossier ?" } do + = link_to url_for({ controller: 'backoffice/dossiers', action: :without_continuation, dossier_id: @facade.dossier.id }), class: 'btn btn-warning', method: :post, title: 'Classer sans suite', data: { toggle: :tooltip, confirm: "Classer sans suite ce dossier ?" } do %i.fa.fa-circle-o %li - = link_to url_for({controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id}), class: 'btn btn-danger', method: :post, title: 'Refuser', data: { toggle: :tooltip, confirm: "Refuser ce dossier ?" } do + = link_to url_for({ controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id }), class: 'btn btn-danger', method: :post, title: 'Refuser', data: { toggle: :tooltip, confirm: "Refuser ce dossier ?" } do %i.fa.fa-times = link_to 'Reouvrir', backoffice_dossier_reopen_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block', data: { confirm: "Confirmer vous la réouverture de ce dossier ?" } @@ -46,7 +46,7 @@ - @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} + = 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(" ")}" 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 index dacf8761d..1d386a756 100644 --- a/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml +++ b/app/views/layouts/left_panels/_left_panel_cgucontroller_index.html.haml @@ -1,53 +1,53 @@ %div#cgu_menu_block - #procedure_list{style: 'margin-top: 0;'} + #procedure_list{ style: 'margin-top: 0;' } = link_to cgu_path(:anchor => "editeur") do - %div.procedure_list_element + .procedure_list_element Editeur = link_to cgu_path(:anchor => "ingenieurie_hebergement") do - %div.procedure_list_element + .procedure_list_element Ingénierie et hébergement informatique = link_to cgu_path(:anchor => "object_website") do - %div.procedure_list_element + .procedure_list_element Object du site internet = link_to cgu_path(:anchor => "acteurs") do - %div.procedure_list_element + .procedure_list_element Acteurs de TPS = link_to cgu_path(:anchor => "CNIL") do - %div.procedure_list_element + .procedure_list_element Déclaration CNIL = link_to cgu_path(:anchor => "data_collects") do - %div.procedure_list_element + .procedure_list_element Données collectées et responsabilité des organismes utilisateurs = link_to cgu_path(:anchor => "individual_data") do - %div.procedure_list_element + .procedure_list_element Traitement des données à caractère personnel = link_to cgu_path(:anchor => "entreprise_information") do - %div.procedure_list_element + .procedure_list_element Règles relatives aux informations sur les entreprises mises à disposibition = link_to cgu_path(:anchor => "reproduction") do - %div.procedure_list_element + .procedure_list_element Droit de reproduction = link_to cgu_path(:anchor => "propriete_intellectuelle") do - %div.procedure_list_element + .procedure_list_element Propriété intellectuelle = link_to cgu_path(:anchor => "navigateurs") do - %div.procedure_list_element + .procedure_list_element Logiciels nécessaires à la consultation = link_to cgu_path(:anchor => "conception") do - %div.procedure_list_element + .procedure_list_element Conception et Réalisation - %div.procedure_list_element + .procedure_list_element - %div.procedure_list_element + .procedure_list_element 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 index a6f39fe6d..06d8817d7 100644 --- 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 @@ -1,46 +1,46 @@ %div#first-block - %div.en-cours + .en-cours = dossier_count = current_user.dossiers.count = ("Dossier".pluralize(dossier_count)).upcase %br - = "EN COURS" + EN COURS %div#action-block %div#menu-block - %div.split-hr-left + .split-hr-left #procedure_list - unless current_user.dossiers.count == 0 - %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" + %a{ :href => "#{url_for users_dossiers_path(liste: 'brouillon')}", 'data-toggle' => :tooltip, title: 'Les dossiers jamais proposés à la relecture.' } + .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" + %a{ :href => "#{url_for users_dossiers_path(liste: 'a_traiter')}", 'data-toggle' => :tooltip, title: 'Les dossiers qui requièrent une action de votre part.' } + .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: '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 instruction" + %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.' } + .procedure_list_element{ class: @dossiers_list_facade.en_instruction_class, id: 'en_instruction' } + En instruction .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' } - = "Terminé" + %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".' } + .procedure_list_element{ class: @dossiers_list_facade.termine_class, id: 'termine' } + Terminé .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" + %a{ :href => "#{url_for users_dossiers_path(liste: 'invite')}" } + .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 + .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 index ee301158d..6b4a877c2 100644 --- 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 @@ -1,12 +1,12 @@ %div#first-block - %div.en-cours + .en-cours %h2 Récapitulatif - %div.infos + .infos %div= t('dynamics.dossiers.numéro') + @facade.dossier.id.to_s %div#menu-block %div#infos-block - %div.split-hr-left - %div.dossier-state= @facade.dossier.display_state - %div.split-hr-left + .split-hr-left + .dossier-state= @facade.dossier.display_state + .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 index 09577eaa6..c4a49ea26 100644 --- a/app/views/layouts/left_panels/_search_area.html.haml +++ b/app/views/layouts/left_panels/_search_area.html.haml @@ -1,7 +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') + = 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' } + %button.btn.btn-default{ id: 'search_button' } %i.fa.fa-search diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml index 13fdaf3c7..6202a734e 100644 --- a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml +++ b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml @@ -1,25 +1,25 @@ .col-xs-7.main-info .col-xs-3.options - %div{ style: "decorate:none; display: flex;box-shadow:none; float:right; display: flex; margin-top: 5px" } + %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} + %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;"} + %i.fa.fa-list{ style: "background-size: 10px;" }   - =t('dynamics.admin.menu.procedures') + = 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} + = t('dynamics.admin.menu.accompagnateurs') + %li.divider{ role: :separator } %li = link_to(admin_profile_path, id: :profile) do %i.fa.fa-user 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 index 79fba1681..64e5e776d 100644 --- a/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml +++ b/app/views/layouts/navbars/_navbar_backoffice_dossiers_procedurecontroller_index.html.haml @@ -1,12 +1,12 @@ .col-xs-7.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 } +.col-lg-3.col-md-3.col-sm-3.col-xs-3.options + .row + .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 + .row + .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_show.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml index d6c9f218f..194f5d82f 100644 --- a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml +++ b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml @@ -5,10 +5,10 @@ .row .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 + = 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 + - 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 @@ -38,4 +38,4 @@ %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', data: {confirm: "Envoyer l'invitation ?"} + = submit_tag 'Ajouter', class: 'btn btn-success', data: { confirm: "Envoyer l'invitation ?" } diff --git a/app/views/layouts/navbars/_navbar_log_options.html.haml b/app/views/layouts/navbars/_navbar_log_options.html.haml index 56d847d1c..6d04a698a 100644 --- a/app/views/layouts/navbars/_navbar_log_options.html.haml +++ b/app/views/layouts/navbars/_navbar_log_options.html.haml @@ -1,15 +1,15 @@ --if user_signed_in? +- if user_signed_in? #sign_out.col-xs-2.no-padding = render partial: 'users/login_banner' = render partial: 'layouts/credentials' --elsif gestionnaire_signed_in? +- elsif gestionnaire_signed_in? #sign_out.col-xs-2.no-padding = render partial: 'gestionnaires/login_banner' = render partial: 'layouts/credentials' --elsif administrateur_signed_in? +- elsif administrateur_signed_in? #sign_out.col-xs-2.no-padding = render partial: 'administrateurs/login_banner' = render partial: 'layouts/credentials' --else +- else #sign_in.col-xs-2 = link_to "Connexion", new_user_session_path, :class => 'btn btn-lg btn-primary' diff --git a/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml b/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml index 6be6d4927..f9eb9e83c 100644 --- a/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml +++ b/app/views/layouts/navbars/_navbar_users_recapitulatifcontroller_show.html.haml @@ -1,15 +1,15 @@ .col-xs-7.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 +.col-lg-3.col-md-3.col-sm-3.col-xs-3.options + .row.centered-option + .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') .badge.progress-bar-info = @facade.dossier.invites.count - %div.dropdown-menu.dropdown-menu-right.dropdown-pannel + .dropdown-menu.dropdown-menu-right.dropdown-pannel %h4= t('dynamics.dossiers.followers.title') %ul - unless @facade.followers.empty? @@ -28,4 +28,4 @@ %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', data: {confirm: "Envoyer l'invitation ?"} + = submit_tag 'Ajouter', class: 'btn btn-success', data: { confirm: "Envoyer l'invitation ?" } diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index 2326d629d..513517202 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -19,22 +19,22 @@ #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')} + %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')} + %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')} + %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')} + %img{ src: image_url('etapes/shared_4.png') } %br %h4 Usager et Administrations %h3.text-danger @@ -46,17 +46,17 @@ .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', "#{@demo_environment_host}/administrateurs/sign_in/demo", {class: 'btn btn-lg btn-primary'} + = link_to 'Démonstration', "#{@demo_environment_host}/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. - =link_to 'Démonstration', "#{@demo_environment_host}/gestionnaires/sign_in/demo", {class: 'btn btn-lg btn-warning'} + = link_to 'Démonstration', "#{@demo_environment_host}/gestionnaires/sign_in/demo", { class: 'btn btn-lg btn-warning' } .col-md-4.col-lg-4 %h3.text-success Usagers %h4 Profitez de démarches simplifiées et d’échanges continus avec les services traitants. - =link_to 'Démonstration', "#{@demo_environment_host}/users/sign_in/demo", {class: 'btn btn-lg btn-success'} + = link_to 'Démonstration', "#{@demo_environment_host}/users/sign_in/demo", { class: 'btn btn-lg btn-success' } .split-hr-left @@ -82,6 +82,6 @@ .col-xs-12.col-sm-12.col-md-12.col-lg-12 %h3 Envie 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'} + = 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 diff --git a/app/views/stats/index.html.haml b/app/views/stats/index.html.haml new file mode 100644 index 000000000..42d6ea90c --- /dev/null +++ b/app/views/stats/index.html.haml @@ -0,0 +1,53 @@ += javascript_include_tag 'https://code.highcharts.com/highcharts.js', 'chartkick' + +.statistiques + + %h1.new-h1 Statistiques + + .stat-cards + + .stat-card.stat-card-half.pull-left + %ul.segmented-control.pull-right + %li.segmented-control-item.segmented-control-item-active{ :onclick => "TPS.toggleChart(event, '.cumulative-procedures-chart');" } + Cumul + %li.segmented-control-item{ :onclick => "TPS.toggleChart(event, '.flux-procedures-chart');" } + Flux (30 jours) + %span.stat-card-title.pull-left Démarches dématérialisées + .clearfix + + .chart-container + .chart.cumulative-procedures-chart + = area_chart @procedures_cumulative, + :colors => ["rgba(61, 149, 236, 1)"] + .chart.flux-procedures-chart.hidden + = line_chart @procedures_30_days_flow, + :colors => ["rgba(61, 149, 236, 1)"] + + .stat-card.stat-card-half.pull-left + %ul.segmented-control.pull-right + %li.segmented-control-item.segmented-control-item-active{ :onclick => "TPS.toggleChart(event, '.cumulative-dossiers-chart');" } + Cumul + %li.segmented-control-item{ :onclick => "TPS.toggleChart(event, '.flux-dossiers-chart');" } + Flux (30 jours) + %span.stat-card-title.pull-left Dossiers déposés + .clearfix + + .chart-container + .chart.cumulative-dossiers-chart + = area_chart @dossiers_cumulative, + :colors => ["rgba(61, 149, 236, 1)"] + .chart.flux-dossiers-chart.hidden + = line_chart @dossiers_30_days_flow, + :colors => ["rgba(61, 149, 236, 1)"] + + .stat-card.stat-card-half.big-number-card.pull-left + %span.big-number-card-title TOTAL DÉMARCHES DÉMATÉRIALISÉES + %span.big-number-card-number + = @procedures_count + + .stat-card.stat-card-half.big-number-card.pull-left + %span.big-number-card-title TOTAL DOSSIERS DÉPOSÉS + %span.big-number-card-number + = @dossiers_count + + .clearfix diff --git a/app/views/users/carte/_init_carto.html.haml b/app/views/users/carte/_init_carto.html.haml index 8516fe270..53ff3a6ba 100644 --- a/app/views/users/carte/_init_carto.html.haml +++ b/app/views/users/carte/_init_carto.html.haml @@ -1,3 +1,3 @@ -%script{type: 'text/javascript'} - ="var dossier_id =#{dossier.id}" +%script{ type: 'text/javascript' } + = "var dossier_id =#{dossier.id}" $(document).on('turbolinks:load', initCarto); diff --git a/app/views/users/carte/_map.html.haml b/app/views/users/carte/_map.html.haml index db98c073b..8915c35d0 100644 --- a/app/views/users/carte/_map.html.haml +++ b/app/views/users/carte/_map.html.haml @@ -1,5 +1,5 @@ #carte_page.row - #map{class: dossier.procedure.module_api_carto.classes } + #map{ class: dossier.procedure.module_api_carto.classes } - if dossier.procedure.module_api_carto.quartiers_prioritaires #qp.list diff --git a/app/views/users/carte/show.html.haml b/app/views/users/carte/show.html.haml index ca76d5f34..de4a0505f 100644 --- a/app/views/users/carte/show.html.haml +++ b/app/views/users/carte/show.html.haml @@ -1,32 +1,32 @@ .row#carto_page .col-lg-12.col-md-12.col-sm-12.col-xs-12 %h2 - ='Localisation' + 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'} + .content{ style: 'margin-bottom: 60px;' } + %button#new.btn.btn-md.btn-success{ type: 'button' } %i.fa.fa-pencil Ajouter une zone - %span#search_by_address{style: 'margin-left: 20px'} - %input.form-control{type: :address, placeholder: 'Rechercher une adresse'} + %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} + = 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 + = 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}"} + %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' + - if @dossier.draft? + = render partial: '/layouts/etape_suivante' + - else + = render partial: '/layouts/modifications_terminees' - = render partial: 'users/carte/init_carto', locals: {dossier: @dossier} + = render partial: 'users/carte/init_carto', locals: { dossier: @dossier } diff --git a/app/views/users/description/_champs.html.haml b/app/views/users/description/_champs.html.haml index 7ee565d10..d6c5184b7 100644 --- a/app/views/users/description/_champs.html.haml +++ b/app/views/users/description/_champs.html.haml @@ -4,11 +4,11 @@ - unless @headers.blank? - if @champs.first.type_champ != 'header_section' - =render partial: render_partial_url, locals: {libelle: 'Dossier', order_place: -1, champs: @champs} + = render partial: render_partial_url, locals: { libelle: 'Dossier', order_place: -1, champs: @champs } - @headers.each do |header| .row - %div{class: "type_champ-#{header.type_champ}"} - =render partial: render_partial_url, locals: {libelle: header.libelle, order_place: header.order_place, champs: @champs} + %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} + = 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 c7905af28..e3a109ba9 100644 --- a/app/views/users/description/_pieces_justificatives.html.haml +++ b/app/views/users/description/_pieces_justificatives.html.haml @@ -4,19 +4,19 @@ %th Formulaire de demande ou CERFA (complété et numérisé) %td - -unless dossier.procedure.lien_demarche.blank? + - unless dossier.procedure.lien_demarche.blank? %em Récupérer le formulaire de demande ou CERFA vierge pour mon dossier : = link_to "Télécharger", "#{dossier.procedure.lien_demarche}", target: :blank, id: :lien_cerfa - -# %a{ id: 'lien_cerfa', href: "#{dossier.procedure.lien_demarche}", target: '_blank'} Télécharger + -# %a{ id: 'lien_cerfa', href: "#{dossier.procedure.lien_demarche}", target: '_blank' } Télécharger %td - -if dossier.cerfa_available? + - if dossier.cerfa_available? %span.btn.btn-sm.btn-file.btn-success Modifier - %input{type: 'file', name:'cerfa_pdf', id:'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes } - -else - %input{type: 'file', name:'cerfa_pdf', id:'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes } + %input{ type: 'file', name: 'cerfa_pdf', id: 'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes } + - else + %input{ type: 'file', name: 'cerfa_pdf', id: 'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes } - dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative| %tr @@ -30,12 +30,12 @@ = link_to "Télécharger", type_de_piece_justificative.lien_demarche, target: :blank %td - -if type_de_piece_justificative.api_entreprise + - if type_de_piece_justificative.api_entreprise %span.text-success{ id: "piece_justificative_#{type_de_piece_justificative.id}" } Nous l'avons récupéré pour vous. - -else - -if dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id).nil? + - else + - if dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id).nil? = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes - -else + - else %span.btn.btn-sm.btn-file.btn-success Modifier = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes diff --git a/app/views/users/description/_show.html.haml b/app/views/users/description/_show.html.haml index ac21a126e..627773625 100644 --- a/app/views/users/description/_show.html.haml +++ b/app/views/users/description/_show.html.haml @@ -1,38 +1,39 @@ .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; z-index: 200'} - .panel.panel-info{style:'margin-bottom:0'} + #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-xs-1 - .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} - .col-xs-10{style:'padding-right: 0px'} + .fa.fa-info-circle.text-info{ style: 'font-size: 2em; margin-top: 20%;' } + .col-xs-10{ style: 'padding-right: 0px;' } %b - =link_to 'Accéder au guide', @dossier.procedure.lien_notice, {target: '_blank'} + = link_to 'Accéder au guide', @dossier.procedure.lien_notice, { target: '_blank' } pour remplir pour votre dossier %h2.text-info = @dossier.procedure.libelle - -#TODO use form_for - = form_tag(url_for({controller: 'users/description', action: :update, dossier_id: @dossier.id}), class: 'form', method: 'POST', multipart: true) do - -unless @champs.nil? + -# TODO use form_for + = form_tag(url_for({ controller: 'users/description', action: :update, dossier_id: @dossier.id }), class: 'form', method: 'POST', multipart: true) do + - unless @champs.nil? #liste_champs - =render partial: 'users/description/champs', locals:{private: false} + = render partial: 'users/description/champs', locals: { private: false } - -if !@procedure.lien_demarche.blank? || @procedure.cerfa_flag || @dossier.types_de_piece_justificative.size > 0 + - if !@procedure.lien_demarche.blank? || @procedure.cerfa_flag || @dossier.types_de_piece_justificative.size > 0 %br %h3 Pièces jointes - //TODO a refactorer + -# TODO a refactorer .row .col-lg-8 = render partial: 'users/description/pieces_justificatives', locals: { dossier: @dossier } - -route = Rails.application.routes.recognize_path(request.referrer) # WTF ? + -# WTF ? + - route = Rails.application.routes.recognize_path(request.referrer) - unless route[:controller].match('admin') - %div{style: 'text-align:right'} + %div{ style: 'text-align: right;' } %h6 Tous les champs portant un * sont obligatoires. - if !@dossier.can_be_initiated? @@ -41,5 +42,5 @@ - elsif !@dossier.draft? = render partial: '/layouts/modifications_terminees' - else - = submit_tag 'Soumettre mon dossier', id: 'suivant', name: 'submit[nouveaux]', class: 'btn btn btn-success', style: 'float:right', disabled: @procedure.archived?, data: { disable_with: 'Soumettre votre dossier', submit: true} - = submit_tag 'Enregistrer un brouillon', id: 'brouillon', name: 'submit[brouillon]', class: 'btn btn-xs btn-default', style: 'float:right; margin-right: 10px; margin-top: 6px', disabled: @procedure.archived?, data: {disable_with: 'Enregistrer un brouillon', submit: true} + = submit_tag 'Soumettre mon dossier', id: 'suivant', name: 'submit[nouveaux]', class: 'btn btn btn-success', style: 'float: right;', disabled: @procedure.archived?, data: { disable_with: 'Soumettre votre dossier', submit: true } + = submit_tag 'Enregistrer un brouillon', id: 'brouillon', name: 'submit[brouillon]', class: 'btn btn-xs btn-default', style: 'float: right; margin-right: 10px; margin-top: 6px;', disabled: @procedure.archived?, data: { disable_with: 'Enregistrer un brouillon', submit: true } diff --git a/app/views/users/description/champs/_checkbox.html.haml b/app/views/users/description/champs/_checkbox.html.haml index db7928656..1471a1873 100644 --- a/app/views/users/description/champs/_checkbox.html.haml +++ b/app/views/users/description/champs/_checkbox.html.haml @@ -1 +1 @@ -%input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.object.value == 'on')} +%input{ type: 'checkbox', style: 'margin-left: 15px;', name: "champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.object.value == 'on') } diff --git a/app/views/users/description/champs/_datetime.html.haml b/app/views/users/description/champs/_datetime.html.haml index b79cb05c6..e50212c17 100644 --- a/app/views/users/description/champs/_datetime.html.haml +++ b/app/views/users/description/champs/_datetime.html.haml @@ -1,21 +1,21 @@ -%input.form-control{name:"champs['#{champ.id}']", +%input.form-control{ name: "champs['#{champ.id}']", placeholder: champ.libelle, id: "champs_#{champ.id}", value: (champ.value.split(/[ ][0-9]*:[0-9]*/).first unless champ.value.nil?), type: champ.type_champ, 'data-provide' => champ.data_provide, - 'data-date-format' => champ.data_date_format} + 'data-date-format' => champ.data_date_format } -%select.form-control{name:"time_hour['#{champ.id}']", style: 'margin-left: 5px', id:"time_hour_#{champ.id}"} +%select.form-control{ name: "time_hour['#{champ.id}']", style: 'margin-left: 5px;', id: "time_hour_#{champ.id}" } - (0..23).each do |num| - num = "%.2i" %num - %option{value: num, selected: (:selected if champ.same_hour?(num))} + %option{ value: num, selected: (:selected if champ.same_hour?(num)) } = num h -%select.form-control{name:"time_minute['#{champ.id}']", id:"time_minute_#{champ.id}"} +%select.form-control{ name: "time_minute['#{champ.id}']", id: "time_minute_#{champ.id}" } - (0..59).each do |num| - num = "%.2i" %num - if num.to_i%5 == 0 - %option{value: num, selected: (:selected if champ.same_minute?(num))} + %option{ value: num, selected: (:selected if champ.same_minute?(num)) } = num min diff --git a/app/views/users/description/champs/_dossier_link.html.haml b/app/views/users/description/champs/_dossier_link.html.haml new file mode 100644 index 000000000..41d6f0526 --- /dev/null +++ b/app/views/users/description/champs/_dossier_link.html.haml @@ -0,0 +1,21 @@ +- dossier = Dossier.find_by(id: champ.value) +- show_procedure_libelle = dossier ? true : false +- show_warning = !show_procedure_libelle && champ.value.present? +- procedure_libelle = dossier.nil? ? '' : dossier.procedure.libelle + +.dossier-link + %input.form-control{ name: "champs['#{ champ.id }']", + placeholder: champ.libelle, + id: "champs_#{ champ.id }", + value: champ.value, + type: 'number', + 'autocomplete' => 'off', + 'data-type' => 'dossier-link' } + + .help-block + %p.text-info{ style: show_procedure_libelle ? nil : 'display: none;' } + ce dossier répond à la procédure : + %br + %span.procedureLibelle= procedure_libelle + %p.text-warning{ style: show_warning ? nil : 'display: none;' } + ce dossier est inconnu diff --git a/app/views/users/description/champs/_drop_down_list.html.haml b/app/views/users/description/champs/_drop_down_list.html.haml index eebb763f1..9404af5f6 100644 --- a/app/views/users/description/champs/_drop_down_list.html.haml +++ b/app/views/users/description/champs/_drop_down_list.html.haml @@ -1,6 +1,7 @@ - if champ.drop_down_list && champ.drop_down_list.options.any? - = select_tag("champs['#{champ.id}']", - options_for_select(champ.drop_down_list.options, selected: champ.drop_down_list.selected_options(champ), - disabled: champ.drop_down_list.disabled_options), - multiple: champ.drop_down_list.multiple, - class: champ.drop_down_list.multiple ? 'select2' : nil) + = select_tag("champs['#{champ.id}']", + options_for_select(champ.drop_down_list.options, + selected: champ.drop_down_list.selected_options(champ), + disabled: champ.drop_down_list.disabled_options), + multiple: champ.drop_down_list.multiple, + class: champ.drop_down_list.multiple ? 'select2' : nil) diff --git a/app/views/users/description/champs/_engagement.html.haml b/app/views/users/description/champs/_engagement.html.haml index bae7b55ad..2b51d09c9 100644 --- a/app/views/users/description/champs/_engagement.html.haml +++ b/app/views/users/description/champs/_engagement.html.haml @@ -1,2 +1,2 @@ -%input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} -%input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')} +%input{ type: 'hidden', name: "champs['#{champ.id}']", id: "champs_#{champ.id}", value: '' } +%input{ type: 'checkbox', style: 'margin-left: 15px;', name: "champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on') } diff --git a/app/views/users/description/champs/_header_private_section.html.haml b/app/views/users/description/champs/_header_private_section.html.haml index f1ec1ce8f..b9d8bdacd 100644 --- a/app/views/users/description/champs/_header_private_section.html.haml +++ b/app/views/users/description/champs/_header_private_section.html.haml @@ -2,5 +2,5 @@ .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} + = 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 cc2c1099f..410563165 100644 --- a/app/views/users/description/champs/_header_section.html.haml +++ b/app/views/users/description/champs/_header_section.html.haml @@ -4,6 +4,6 @@ .col-xs-12.title .carret-right .carret-down - =libelle + = libelle .body - = render partial: 'users/description/champs/render_list_champs', locals: {champs: champs, order_place: order_place} + = render partial: 'users/description/champs/render_list_champs', locals: { champs: champs, order_place: order_place } diff --git a/app/views/users/description/champs/_render_list_champs.html.haml b/app/views/users/description/champs/_render_list_champs.html.haml index 1c131361e..0d1f91f76 100644 --- a/app/views/users/description/champs/_render_list_champs.html.haml +++ b/app/views/users/description/champs/_render_list_champs.html.haml @@ -6,7 +6,7 @@ .row %div{ class: if champ.type_champ == 'textarea' || champ.type_champ == 'engagement' then 'col-md-12' else 'col-md-6' end } .form-group - %label{ for: "champs_#{ champ.id }"} + %label{ for: "champs_#{champ.id}" } = champ.libelle - if champ.mandatory? * @@ -41,17 +41,20 @@ - elsif champ.type_champ == 'departements' = render partial: 'users/description/champs/departements', locals: { champ: champ } + - elsif champ.type_champ == 'dossier_link' + = render partial: 'users/description/champs/dossier_link', locals: { champ: champ } + - elsif champ.type_champ == 'explication' - else - %input.form-control{name:"champs['#{ champ.id }']", + %input.form-control{ name: "champs['#{champ.id}']", placeholder: champ.libelle, - id: "champs_#{ champ.id }", + id: "champs_#{champ.id}", value: champ.value, type: champ.type_champ, 'data-provide' => champ.data_provide, - 'data-date-format' => champ.data_date_format} + 'data-date-format' => champ.data_date_format } - unless champ.description.empty? - %div{ id:"description_champs_#{ champ.id }", class: ('help-block' unless champ.type_champ == 'engagement') } + %div{ id: "description_champs_#{champ.id}", class: ('help-block' unless champ.type_champ == 'engagement') } = champ.description_with_links diff --git a/app/views/users/description/champs/_textarea.html.haml b/app/views/users/description/champs/_textarea.html.haml index 9ea66d68e..1ca81e00f 100644 --- a/app/views/users/description/champs/_textarea.html.haml +++ b/app/views/users/description/champs/_textarea.html.haml @@ -1,5 +1,5 @@ -%textarea.form-control.wysihtml5{name:"champs['#{champ.id}']", +%textarea.form-control.wysihtml5{ name: "champs['#{champ.id}']", placeholder: champ.description, id: "champs_#{champ.id}", - row: '6'} + row: '6' } = champ.value diff --git a/app/views/users/dossiers/_list.html.haml b/app/views/users/dossiers/_list.html.haml index 9707d9e68..89d902533 100644 --- a/app/views/users/dossiers/_list.html.haml +++ b/app/views/users/dossiers/_list.html.haml @@ -19,13 +19,13 @@ - dossier_url = users_dossier_recapitulatif_path(dossier) unless dossier.brouillon? - dossier_url = users_dossier_description_path(dossier) if dossier.brouillon? - %tr{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => dossier_url} + %tr{ id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => dossier_url } %td.center = dossier.id %td = dossier.procedure.libelle - %td{id: "dossier_#{dossier.id}_state"}= dossier.display_state + %td{ id: "dossier_#{dossier.id}_state" }= dossier.display_state %td= dossier.last_update %td= link_to('X', url_for(controller: 'dossiers', action: :destroy, id: dossier.id), 'data-method' => :delete, class: 'btn-sm btn-danger') if @liste == "brouillon" diff --git a/app/views/users/dossiers/_state_description.html.haml b/app/views/users/dossiers/_state_description.html.haml index 6d66eb71b..52d13cab2 100644 --- a/app/views/users/dossiers/_state_description.html.haml +++ b/app/views/users/dossiers/_state_description.html.haml @@ -1,37 +1,37 @@ -#state_description.row{style:'width: 55%; margin-left: auto; margin-right: auto'} +#state_description.row{ style: 'width: 55%; margin-left: auto; margin-right: auto;' } .panel.panel-info .panel-body.center .row .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%'} + .fa.fa-info-circle.text-info{ style: 'font-size: 2em; margin-top: 20%;' } .col-xs-11 - -if dossiers_list_facade.liste == 'brouillon' + - if dossiers_list_facade.liste == 'brouillon' Les dossiers présents dans cette liste %b n'ont pas encore été soumis aux services instructeurs. Ils ne sont visibles que par vous. - -elsif dossiers_list_facade.liste == 'nouveaux' + - elsif dossiers_list_facade.liste == 'nouveaux' Les dossiers présents dans cette liste %b n'ont pas encore été ouverts par les services instructeurs. Une notification vous sera envoyée quand votre demande aura été étudiée. - -elsif dossiers_list_facade.liste == 'a_traiter' + - elsif dossiers_list_facade.liste == 'a_traiter' Les dossiers présents dans cette liste sont %b visibles par les services instructeurs. %br Ces dossiers ne sont pas encore figés et peuvent être modifiés à souhait. - -elsif dossiers_list_facade.liste == 'en_attente' + - elsif dossiers_list_facade.liste == 'en_attente' Les dossiers présents dans cette liste sont %b en cours de relecture par les services instructeurs. Il reviendra vers vous si des informations ou documents sont manquants pour le futur examen de votre dossier. - -elsif dossiers_list_facade.liste == 'valides' + - elsif dossiers_list_facade.liste == 'valides' Les dossiers présents dans cette liste ont été %b relus et considérés comme complets pour examen par les services instructeurs. Ceux-ci ne peuvent maintenant plus être modifiés. Il faut que vous procédiez à leur dépôt afin qu'une décision finale soit rendue. - -elsif dossiers_list_facade.liste == 'en_instruction' + - elsif dossiers_list_facade.liste == 'en_instruction' Les dossiers présents dans cette liste sont %b en cours de réception @@ -39,12 +39,12 @@ %b en cours d'examen par les services instructeurs. Une notification vous sera envoyée une fois qu'une décision aura été rendue. - -elsif dossiers_list_facade.liste == 'termine' + - elsif dossiers_list_facade.liste == 'termine' Les dossiers présents dans cette liste sont ceux qui ont été instruits et pour lesquels %b une décision finale a été rendue. Ils peuvent posséder trois états différents : Accepté, Refusé ou Sans Suite. - -elsif dossiers_list_facade.liste == 'invite' + - elsif dossiers_list_facade.liste == 'invite' Les dossiers présents dans cette liste sont ceux %b auxquels vous avez été invités diff --git a/app/views/users/dossiers/index.html.haml b/app/views/users/dossiers/index.html.haml index fce9b71a8..3811c1ed8 100644 --- a/app/views/users/dossiers/index.html.haml +++ b/app/views/users/dossiers/index.html.haml @@ -1,15 +1,15 @@ #users_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 + .row.show-block#new_dossiers + .header + .col-lg-10.col-md-10.col-sm-10.col-xs-10.title + .carret-right + .carret-down Dossiers - %div.col-lg-2.col-md-2.col-sm-2.col-xs-2.count - -#0 - -#dossiers - %div.body + .col-lg-2.col-md-2.col-sm-2.col-xs-2.count + -# 0 + -# dossiers + .body = smart_listing_render :dossiers - = render partial: 'state_description', locals: {dossiers_list_facade: @dossiers_list_facade} + = 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 204370695..2e6a246f4 100644 --- a/app/views/users/passwords/edit.html.haml +++ b/app/views/users/passwords/edit.html.haml @@ -1,30 +1,30 @@ --#

Sign up

+-#

Sign up

-# --#<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> --# <%= devise_error_messages! %> +-# <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> +-# <%= devise_error_messages! %> -# --#
--# <%= f.label :email %>
--# <%= f.email_field :email, autofocus: true %> --#
+-#
+-# <%= f.label :email %>
+-# <%= f.email_field :email, autofocus: true %> +-#
-# --#
--# <%= f.label :password %> --# <% if @validatable %> --# (<%= @minimum_password_length %> characters minimum) --# <% end %>
--# <%= f.password_field :password, autocomplete: "off" %> --#
+-#
+-# <%= f.label :password %> +-# <% if @validatable %> +-# (<%= @minimum_password_length %> characters minimum) +-# <% end %>
+-# <%= f.password_field :password, autocomplete: "off" %> +-#
-# --#
--# <%= f.label :password_confirmation %>
--# <%= f.password_field :password_confirmation, autocomplete: "off" %> --#
+-#
+-# <%= f.label :password_confirmation %>
+-# <%= f.password_field :password_confirmation, autocomplete: "off" %> +-#
-# --#
--# <%= f.submit "Sign up" %> --#
--#<% end %> +-#
+-# <%= f.submit "Sign up" %> +-#
+-# <% end %> = devise_error_messages! @@ -56,5 +56,5 @@ %br %br .actions - = f.submit "Changer", class:'btn btn-primary' + = f.submit "Changer", class: 'btn btn-primary' %br diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index 79e45d45c..8a62b7652 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -1,30 +1,30 @@ --#

Sign up

+-#

Sign up

-# --#<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> --# <%= devise_error_messages! %> +-# <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> +-# <%= devise_error_messages! %> -# --#
--# <%= f.label :email %>
--# <%= f.email_field :email, autofocus: true %> --#
+-#
+-# <%= f.label :email %>
+-# <%= f.email_field :email, autofocus: true %> +-#
-# --#
--# <%= f.label :password %> --# <% if @validatable %> --# (<%= @minimum_password_length %> characters minimum) --# <% end %>
--# <%= f.password_field :password, autocomplete: "off" %> --#
+-#
+-# <%= f.label :password %> +-# <% if @validatable %> +-# (<%= @minimum_password_length %> characters minimum) +-# <% end %>
+-# <%= f.password_field :password, autocomplete: "off" %> +-#
-# --#
--# <%= f.label :password_confirmation %>
--# <%= f.password_field :password_confirmation, autocomplete: "off" %> --#
+-#
+-# <%= f.label :password_confirmation %>
+-# <%= f.password_field :password_confirmation, autocomplete: "off" %> +-#
-# --#
--# <%= f.submit "Sign up" %> --#
--#<% end %> +-#
+-# <%= f.submit "Sign up" %> +-#
+-# <% end %> = devise_error_messages! @@ -48,5 +48,5 @@ %br %br .actions - = f.submit "Renvoyer", class:'btn btn-primary' + = f.submit "Renvoyer", class: 'btn btn-primary' %br diff --git a/app/views/users/recapitulatif/_modal_upload_pj.html.haml b/app/views/users/recapitulatif/_modal_upload_pj.html.haml index cba2b0b7d..63c3e5322 100644 --- a/app/views/users/recapitulatif/_modal_upload_pj.html.haml +++ b/app/views/users/recapitulatif/_modal_upload_pj.html.haml @@ -1,12 +1,12 @@ -#UploadPJmodal.modal.fade{"aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1"} - .modal-dialog{:role => "document"} +#UploadPJmodal.modal.fade{ "aria-labelledby" => "myModalLabel", :role => "dialog", :tabindex => "-1" } + .modal-dialog{ :role => "document" } .modal-content - @dossier = @facade.dossier - = form_tag(url_for({controller: '/users/description', action: :pieces_justificatives, dossier_id: @dossier.id}), class: 'form-inline', method: 'PATCH', multipart: true) do + = form_tag(url_for({ controller: '/users/description', action: :pieces_justificatives, dossier_id: @dossier.id }), class: 'form-inline', method: 'PATCH', multipart: true) do .modal-header - %button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"} - %span{"aria-hidden" => "true"} × + %button.close{ "aria-label" => "Close", "data-dismiss" => "modal", :type => "button" } + %span{ "aria-hidden" => "true" } × %h4.modal-title Modification des documents @@ -14,4 +14,4 @@ = render partial: 'users/description/pieces_justificatives', locals: { dossier: @dossier } .modal-footer - = submit_tag 'Modification terminée', class: %w(btn btn btn-info), id: 'modification_terminee', data: { disable_with: 'Modification terminée', submit: true} + = submit_tag 'Modification terminée', class: %w(btn btn btn-info), id: 'modification_terminee', data: { disable_with: 'Modification terminée', submit: true } diff --git a/app/views/users/recapitulatif/show.html.haml b/app/views/users/recapitulatif/show.html.haml index fe7c1ec5d..672ab5867 100644 --- a/app/views/users/recapitulatif/show.html.haml +++ b/app/views/users/recapitulatif/show.html.haml @@ -1,2 +1,2 @@ -%div.col-lg-12.col-md-12.col-sm-12.col-xs-12#users_recapitulatif_dossier_show +.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 9a0fd5934..82da47322 100644 --- a/app/views/users/registrations/new.html.haml +++ b/app/views/users/registrations/new.html.haml @@ -1,30 +1,30 @@ --#

Sign up

+-#

Sign up

-# --#<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> --# <%= devise_error_messages! %> +-# <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> +-# <%= devise_error_messages! %> -# --#
--# <%= f.label :email %>
--# <%= f.email_field :email, autofocus: true %> --#
+-#
+-# <%= f.label :email %>
+-# <%= f.email_field :email, autofocus: true %> +-#
-# --#
--# <%= f.label :password %> --# <% if @validatable %> --# (<%= @minimum_password_length %> characters minimum) --# <% end %>
--# <%= f.password_field :password, autocomplete: "off" %> --#
+-#
+-# <%= f.label :password %> +-# <% if @validatable %> +-# (<%= @minimum_password_length %> characters minimum) +-# <% end %>
+-# <%= f.password_field :password, autocomplete: "off" %> +-#
-# --#
--# <%= f.label :password_confirmation %>
--# <%= f.password_field :password_confirmation, autocomplete: "off" %> --#
+-#
+-# <%= f.label :password_confirmation %>
+-# <%= f.password_field :password_confirmation, autocomplete: "off" %> +-#
-# --#
--# <%= f.submit "Sign up" %> --#
--#<% end %> +-#
+-# <%= f.submit "Sign up" %> +-#
+-# <% end %> = devise_error_messages! @@ -60,5 +60,5 @@ %br %br .actions - = f.submit "S'enregistrer", class:'btn btn-primary' + = f.submit "S'enregistrer", class: 'btn btn-primary' %br diff --git a/app/views/users/sessions/_resume_procedure.html.haml b/app/views/users/sessions/_resume_procedure.html.haml index 590169cad..236bf7a10 100644 --- a/app/views/users/sessions/_resume_procedure.html.haml +++ b/app/views/users/sessions/_resume_procedure.html.haml @@ -1,14 +1,14 @@ - if @dossier .panel.panel-default .panel-body - = link_to 'X', users_no_procedure_url, class: 'btn btn-xs', style:'float: right' + = link_to 'X', users_no_procedure_url, class: 'btn btn-xs', style: 'float: right;' - if @dossier.procedure.euro_flag #euro_flag.flag - =image_tag('drapeau_europe.png') + = image_tag('drapeau_europe.png') #logo_procedure.flag - =image_tag( @dossier.procedure.decorate.logo_img ) + = image_tag( @dossier.procedure.decorate.logo_img ) %h2#titre_procedure.text-info = @dossier.procedure.libelle @@ -17,4 +17,4 @@ - else #logo_procedure.flag - = image_tag(image_url(LOGO_NAME), {id: 'logo_tps'}) + = image_tag(image_url(LOGO_NAME), { id: 'logo_tps' }) diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index 30847c93e..add5365c3 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -3,13 +3,13 @@ = render partial: 'users/sessions/resume_procedure' %h2#login_user - =t('dynamics.users.connexion_title') + = t('dynamics.users.connexion_title') - %a.btn_fc#btn_fcp{href: '/france_connect/particulier'} + %a.btn_fc#btn_fcp{ href: '/france_connect/particulier' } = image_tag 'franceconnect_logo.png' %br - %a.text-info{href: 'https://fcp.integ01.dev-franceconnect.fr/a-propos', target: '_blank'} + %a.text-info{ href: 'https://fcp.integ01.dev-franceconnect.fr/a-propos', target: '_blank' } Qu’est-ce que FranceConnect ? %hr @@ -21,7 +21,7 @@ - if devise_mapping.rememberable? = f.input :remember_me, as: :boolean, label: 'Se souvenir de moi' .text-center - = f.submit "Se connecter", class:'btn btn-primary' + = f.submit "Se connecter", class: 'btn btn-primary' - if @user.email != DemoEmails[:gestionnaire] && @user.email != DemoEmails[:admin] = render "users/shared/links" diff --git a/app/views/users/siret/_pro.html.haml b/app/views/users/siret/_pro.html.haml index 43836722b..34fe7aaaf 100644 --- a/app/views/users/siret/_pro.html.haml +++ b/app/views/users/siret/_pro.html.haml @@ -1,4 +1,4 @@ -%p.lead{id: 'pro_section'} +%p.lead{ id: 'pro_section' } .flag = image_tag(image_url(LOGO_NAME)) %br @@ -9,9 +9,9 @@ = @procedure.description.html_safe %br - = form_tag(url_for({controller: :dossiers, action: :create}), class: 'form-inline', method: 'POST') do |f| + = form_tag(url_for({ controller: :dossiers, action: :create }), class: 'form-inline', method: 'POST') do |f| .form-group.form-group-lg - = text_field_tag :siret, nil, :class => "form-control", :placeholder => "Entrez votre Siret", :id => "siret", :name => "siret", :maxlength => 14, :style => 'margin-bottom:10px', value: @siret + = text_field_tag :siret, nil, :class => "form-control", :placeholder => "Entrez votre Siret", :id => "siret", :name => "siret", :maxlength => 14, :style => 'margin-bottom: 10px', value: @siret %br - = submit_tag "Commencer", class: %w(btn btn-lg btn-success), style: 'margin-top:20px;', data: { disable_with: "Commencer", submit: true} - %input{type: 'hidden', value: "#{@procedure.id}", name: 'procedure_id', id: 'procedure_id'} + = submit_tag "Commencer", class: %w(btn btn-lg btn-success), style: 'margin-top: 20px;', data: { disable_with: "Commencer", submit: true } + %input{ type: 'hidden', value: "#{@procedure.id}", name: 'procedure_id', id: 'procedure_id' } diff --git a/circle.yml b/circle.yml index d16255161..f8a57d372 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,12 @@ database: override: - - bundle exec rake db:drop db:create db:migrate RAILS_ENV=test + - cp config/database.yml.ci config/database.yml + - bundle exec rake db:create db:schema:load db:migrate RAILS_ENV=test + +test: + override: + - bundle exec rspec + - bundle exec haml-lint app/views/ deployment: staging: diff --git a/config/application.rb b/config/application.rb index 8edea6693..b3c5dc10c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -23,7 +23,6 @@ module TPS config.autoload_paths += %W(#{config.root}/lib #{config.root}/app/validators #{config.root}/app/facades) config.assets.paths << Rails.root.join('app', 'assets', 'javascript') - config.assets.precompile += %w( application_split2.css ) if Rails.env.production? URL = "https://tps.apientreprise.fr/" diff --git a/config/database.yml b/config/database.yml index 76a34a338..75dedfa2d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -4,12 +4,14 @@ development: database: tps_development host: localhost pool: 5 - username: tps - password: lol - + username: tps_development + password: tps_development test: - adapter: sqlite3 + adapter: postgresql + encoding: unicode + database: tps_test + host: localhost pool: 5 - timeout: 5000 - database: db/test.sqlite3 + username: tps_test + password: tps_test diff --git a/config/database.yml.ci b/config/database.yml.ci new file mode 100644 index 000000000..3d17efadf --- /dev/null +++ b/config/database.yml.ci @@ -0,0 +1,6 @@ +test: + adapter: postgresql + database: app_test + pool: 5 + username: + password: diff --git a/config/locales/models/type_de_champ/fr.yml b/config/locales/models/type_de_champ/fr.yml index 06206a682..1e3414f1f 100644 --- a/config/locales/models/type_de_champ/fr.yml +++ b/config/locales/models/type_de_champ/fr.yml @@ -24,3 +24,4 @@ fr: header_section: 'Titre de section' explication: 'Explication' multiple_drop_down_list: 'Menu déroulant à choix multiples' + dossier_link: 'Lien vers un autre dossier' diff --git a/config/routes.rb b/config/routes.rb index 5811b4890..6f0d9edad 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -45,14 +45,14 @@ Rails.application.routes.draw do authenticate :administration do resources :administrations, only: [:index, :create] namespace :administrations do - resources :stats, only: [:index] - require 'sidekiq/web' require 'sidekiq/cron/web' mount Sidekiq::Web => '/sidekiq' end end + resources :stats, only: [:index] + namespace :france_connect do get 'particulier' => 'particulier#login' get 'particulier/callback' => 'particulier#callback' @@ -94,6 +94,8 @@ Rails.application.routes.draw do post '/siret_informations' => 'dossiers#siret_informations' put '/change_siret' => 'dossiers#change_siret' + + get 'procedure_libelle' => 'dossiers#procedure_libelle' end resource :dossiers end diff --git a/db/migrate/20160127170437_change_date_creation_type_to_entreprise.rb b/db/migrate/20160127170437_change_date_creation_type_to_entreprise.rb index 5168938c7..6451dc0d1 100644 --- a/db/migrate/20160127170437_change_date_creation_type_to_entreprise.rb +++ b/db/migrate/20160127170437_change_date_creation_type_to_entreprise.rb @@ -1,10 +1,6 @@ class ChangeDateCreationTypeToEntreprise < ActiveRecord::Migration def up - if Rails.env.test? - change_column :entreprises, :date_creation, "timestamp" - else - change_column :entreprises, :date_creation, "timestamp USING to_timestamp(date_creation) at time zone 'UTC-2'" - end + change_column :entreprises, :date_creation, "timestamp USING to_timestamp(date_creation) at time zone 'UTC-2'" end def down diff --git a/db/migrate/20161025150900_create_searches.rb b/db/migrate/20161025150900_create_searches.rb index 5252c6006..3b2ee975f 100644 --- a/db/migrate/20161025150900_create_searches.rb +++ b/db/migrate/20161025150900_create_searches.rb @@ -9,7 +9,7 @@ class CreateSearches < ActiveRecord::Migration add_index :individuals, :dossier_id add_index :pieces_justificatives, :dossier_id add_index :rna_informations, :entreprise_id - create_view :searches unless Rails.env.test? #, materialized: true + create_view :searches end def down @@ -22,6 +22,6 @@ class CreateSearches < ActiveRecord::Migration remove_index :individuals, :dossier_id remove_index :pieces_justificatives, :dossier_id remove_index :rna_informations, :entreprise_id - drop_view :searches unless Rails.env.test? #, materialized: true + drop_view :searches end end diff --git a/db/migrate/20161102154835_update_searches_to_version_2.rb b/db/migrate/20161102154835_update_searches_to_version_2.rb index b749a08ea..55223b4cf 100644 --- a/db/migrate/20161102154835_update_searches_to_version_2.rb +++ b/db/migrate/20161102154835_update_searches_to_version_2.rb @@ -1,9 +1,9 @@ class UpdateSearchesToVersion2 < ActiveRecord::Migration def up - replace_view :searches, version: 2 unless Rails.env.test? + replace_view :searches, version: 2 end def down - replace_view :searches, version: 1 unless Rails.env.test? + replace_view :searches, version: 1 end end diff --git a/spec/controllers/stats_controller_spec.rb b/spec/controllers/stats_controller_spec.rb new file mode 100644 index 000000000..58727e970 --- /dev/null +++ b/spec/controllers/stats_controller_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe StatsController, type: :controller do + describe '#thirty_days_flow_hash' do + before do + FactoryGirl.create(:procedure, :created_at => 45.days.ago) + FactoryGirl.create(:procedure, :created_at => 15.days.ago) + FactoryGirl.create(:procedure, :created_at => 1.day.ago) + + @expected_hash = {} + (30.days.ago.to_date..Time.now.to_date).each do |day| + if [15.days.ago.to_date, 1.day.ago.to_date].include?(day) + @expected_hash[day] = 1 + else + @expected_hash[day] = 0 + end + end + end + + let (:association) { Procedure.all } + + subject { StatsController.new.send(:thirty_days_flow_hash, association) } + + it { expect(subject).to eq(@expected_hash) } + end + + describe '#cumulative_hash' do + before do + FactoryGirl.create(:procedure, :created_at => 45.days.ago) + FactoryGirl.create(:procedure, :created_at => 15.days.ago) + FactoryGirl.create(:procedure, :created_at => 15.days.ago) + end + + let (:association) { Procedure.all } + + subject { StatsController.new.send(:cumulative_hash, association) } + + it { expect(subject).to eq({ + 45.days.ago.beginning_of_month => 1, + 15.days.ago.beginning_of_month => 3 + }) } + end +end diff --git a/spec/controllers/users/carte_controller_shared_example.rb b/spec/controllers/users/carte_controller_shared_example.rb index 6e5fe11a1..55d63d266 100644 --- a/spec/controllers/users/carte_controller_shared_example.rb +++ b/spec/controllers/users/carte_controller_shared_example.rb @@ -164,7 +164,7 @@ shared_examples 'carte_controller_spec' do subject { Cadastre.last } it { expect(subject.surface_intersection).to eq('0.0006') } - it { expect(subject.surface_parcelle).to eq(11252.692583090324) } + it { expect(subject.surface_parcelle).to eq(11252.6925830903) } it { expect(subject.numero).to eq('0013') } it { expect(subject.feuille).to eq(1) } it { expect(subject.section).to eq('CD') } diff --git a/spec/controllers/users/dossiers_controller_spec.rb b/spec/controllers/users/dossiers_controller_spec.rb index 6d77ce488..601b243bc 100644 --- a/spec/controllers/users/dossiers_controller_spec.rb +++ b/spec/controllers/users/dossiers_controller_spec.rb @@ -554,4 +554,28 @@ describe Users::DossiersController, type: :controller do end end + describe 'Get #procedure_libelle' do + let!(:dossier) { create(:dossier, procedure: procedure) } + + context 'when user is connected' do + before { sign_in user } + + context 'when the dossier exist' do + before { get :procedure_libelle, params: { dossier_id: dossier.id } } + it 'returns the procedure name' do + expect(JSON.parse(response.body)).to eq('procedureLibelle' => procedure.libelle) + end + end + + context 'when the dossier does not exist' do + before { get :procedure_libelle, params: { dossier_id: 666 } } + it { expect(response.code).to eq('404') } + end + end + + context 'when user is not connected' do + before { get :procedure_libelle, params: { dossier_id: dossier.id } } + it { expect(response.code).to eq('302') } + end + end end diff --git a/spec/features/admin/procedure_creation_spec.rb b/spec/features/admin/procedure_creation_spec.rb index 8081ca485..fbf76005a 100644 --- a/spec/features/admin/procedure_creation_spec.rb +++ b/spec/features/admin/procedure_creation_spec.rb @@ -67,7 +67,7 @@ feature 'As an administrateur I wanna create a new procedure', js: true do 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.find("input[type='text']")['placeholder']).to eq('libelle de champ') expect(page.first('.piece-libelle').text).to eq('libelle de piece') end diff --git a/spec/features/users/drawing_a_zone_with_freedraw_spec.rb b/spec/features/users/drawing_a_zone_with_freedraw_spec.rb index b7a4f8495..57633a08b 100644 --- a/spec/features/users/drawing_a_zone_with_freedraw_spec.rb +++ b/spec/features/users/drawing_a_zone_with_freedraw_spec.rb @@ -15,13 +15,24 @@ feature 'drawing a zone with freedraw' do expect(page).to have_css('#login_user') end - context 'when he enter login information' do + scenario 'he logs in and he is redirected to carte page', vcr: { cassette_name: 'drawing_a_zone_with_freedraw_redirected_to_carte_page' } do + within('#new_user') do + page.find_by_id('user_email').set user.email + page.find_by_id('user_password').set user.password + page.click_on 'Se connecter' + end + expect(page).to have_css('.content #map') + end + end + + context 'when user is logged in' do + before do + login_as user, scope: :user + end + + context 'when he is visiting the map page' do before do - within('#new_user') do - page.find_by_id('user_email').set user.email - page.find_by_id('user_password').set user.password - page.click_on 'Se connecter' - end + visit users_dossier_carte_path dossier_id: dossier.id end context 'when procedure have api carto activated' do @@ -41,33 +52,6 @@ feature 'drawing a zone with freedraw' do expect(page).to have_content('Le status de votre dossier n\'autorise pas cette URL') end end - - context 'when draw a zone on #map', js: true, vcr: { cassette_name: 'drawing_a_zone_with_freedraw_when_draw_a_zone_on_map' } do - context 'when module quartiers prioritaires is activated' do - let(:module_api_carto) { create(:module_api_carto, :with_quartiers_prioritaires) } - - before do - allow(ModuleApiCartoService). - to receive(:generate_qp). - and_return({"QPCODE1234" => {:code => "QPCODE1234", :nom => "Quartier de test", :commune => "Paris", :geometry => {:type => "MultiPolygon", :coordinates => [[[[2.38715792094576, 48.8723062632126], [2.38724851642619, 48.8721392348061]]]]}}}) - - page.execute_script('freeDraw.fire("markers", {latLngs: []});') - wait_for_ajax - end - - scenario 'div #map .qp is present' do - expect(page).to have_css('.content #map.qp') - end - - scenario 'QP name is present on page' do - expect(page).to have_content('Quartier de test') - end - - scenario 'Commune is present on page' do - expect(page).to have_content('Paris') - end - end - end end end end diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/features/users/list_dossiers_spec.rb index d970de7b4..1ae783994 100644 --- a/spec/features/users/list_dossiers_spec.rb +++ b/spec/features/users/list_dossiers_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' feature 'user access to the list of his dossier' do - let(:user) { create(:user) } let!(:last_updated_dossier) { create(:dossier, :with_entreprise, user: user, state: 'replied')} let!(:dossier1) { create(:dossier, :with_entreprise, user: user, state: 'replied') } diff --git a/spec/fixtures/cassettes/drawing_a_zone_with_freedraw_when_draw_a_zone_on_map.yml b/spec/fixtures/cassettes/drawing_a_zone_with_freedraw_when_draw_a_zone_on_map.yml deleted file mode 100644 index 290ed6d79..000000000 --- a/spec/fixtures/cassettes/drawing_a_zone_with_freedraw_when_draw_a_zone_on_map.yml +++ /dev/null @@ -1,143 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://auth.cloud.ovh.net/v2.0/tokens - body: - encoding: UTF-8 - string: '{"auth":{"passwordCredentials":{"username":"ovh_fake_username","password":"ovh_fake_password"},"tenantName":"ovh_fake_tenant_name"}}' - headers: - User-Agent: - - fog/1.38.0 fog-core/1.38.0 - Content-Type: - - application/json - response: - status: - code: 200 - message: '' - headers: - Vary: - - X-Auth-Token - Content-Type: - - application/json - Content-Length: - - '7079' - Date: - - Thu, 12 May 2016 14:05:17 GMT - Connection: - - close - body: - encoding: UTF-8 - string: '{"access": {"token": {"issued_at": "2016-05-12T14:05:17.214079", "expires": - "2016-05-13T14:05:17Z", "id": "ff665d4700654b6d9c94964dfc1a262f", "tenant": - {"id": "a24c37ed11a84896914514384898c34b", "enabled": true, "name": "2627898119540674", - "description": "apientreprise"}, "audit_ids": ["Y2ixVCRJQe-D6IN-cPQQsw"]}, - "serviceCatalog": [{"endpoints": [{"adminURL": "https://compute.gra1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "region": "GRA1", "internalURL": "https://compute.gra1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "id": "17f6ef1cc63e492ab8d3f2bda8428cb0", "publicURL": "https://compute.gra1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b"}, - {"adminURL": "https://compute.bhs1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "region": "BHS1", "internalURL": "https://compute.bhs1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "id": "21fdd202afd04470bbaf84f9396d0dcc", "publicURL": "https://compute.bhs1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b"}, - {"adminURL": "https://compute.sbg1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "region": "SBG1", "internalURL": "https://compute.sbg1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "id": "a707bffedf1c4b80a124c585c67c1639", "publicURL": "https://compute.sbg1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b"}], - "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": - "https://network.compute.gra1.cloud.ovh.net/", "region": "GRA1", "internalURL": - "https://network.compute.gra1.cloud.ovh.net/", "id": "26a339a8c7d5463f89ca937068ebbcd4", - "publicURL": "https://network.compute.gra1.cloud.ovh.net/"}, {"adminURL": - "https://network.compute.bhs1.cloud.ovh.net/", "region": "BHS1", "internalURL": - "https://network.compute.bhs1.cloud.ovh.net/", "id": "3fe2326789ec4e37af2e6b2c80a90876", - "publicURL": "https://network.compute.bhs1.cloud.ovh.net/"}, {"adminURL": - "https://network.compute.sbg1.cloud.ovh.net/", "region": "SBG1", "internalURL": - "https://network.compute.sbg1.cloud.ovh.net/", "id": "075839111e7a41f1bb458926e5f04cec", - "publicURL": "https://network.compute.sbg1.cloud.ovh.net/"}], "endpoints_links": - [], "type": "network", "name": "neutron"}, {"endpoints": [{"adminURL": "https://volume.compute.gra1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "region": "GRA1", "internalURL": "https://volume.compute.gra1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "id": "7231957fdf0346e5adebe860ac5e5e57", "publicURL": "https://volume.compute.gra1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b"}, - {"adminURL": "https://volume.compute.bhs1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "region": "BHS1", "internalURL": "https://volume.compute.bhs1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "id": "2f5b68f95d7b4b1fad1a683dac8e8ca3", "publicURL": "https://volume.compute.bhs1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b"}, - {"adminURL": "https://volume.compute.sbg1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "region": "SBG1", "internalURL": "https://volume.compute.sbg1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b", - "id": "021b61bd7313479e8f8d77d21c7b434a", "publicURL": "https://volume.compute.sbg1.cloud.ovh.net/v2/a24c37ed11a84896914514384898c34b"}], - "endpoints_links": [], "type": "volumev2", "name": "cinderv2"}, {"endpoints": - [{"adminURL": "https://image.compute.gra1.cloud.ovh.net/", "region": "GRA1", - "internalURL": "https://image.compute.gra1.cloud.ovh.net/", "id": "56795c82f1744e47b7782f1fc2407212", - "publicURL": "https://image.compute.gra1.cloud.ovh.net/"}, {"adminURL": "https://image.compute.bhs1.cloud.ovh.net/", - "region": "BHS1", "internalURL": "https://image.compute.bhs1.cloud.ovh.net/", - "id": "5eaa4cbe80354ea482f2b0477c9c16f0", "publicURL": "https://image.compute.bhs1.cloud.ovh.net/"}, - {"adminURL": "https://image.compute.sbg1.cloud.ovh.net/", "region": "SBG1", - "internalURL": "https://image.compute.sbg1.cloud.ovh.net/", "id": "15758b246d1340e887a2170bd3399071", - "publicURL": "https://image.compute.sbg1.cloud.ovh.net/"}], "endpoints_links": - [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "https://volume.compute.gra1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b", - "region": "GRA1", "internalURL": "https://volume.compute.gra1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b", - "id": "a6936c8876c1490cbf91d0707e78d350", "publicURL": "https://volume.compute.gra1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b"}, - {"adminURL": "https://volume.compute.bhs1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b", - "region": "BHS1", "internalURL": "https://volume.compute.bhs1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b", - "id": "43bc107cf78448faa9e5a6b3a5ca48dd", "publicURL": "https://volume.compute.bhs1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b"}, - {"adminURL": "https://volume.compute.sbg1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b", - "region": "SBG1", "internalURL": "https://volume.compute.sbg1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b", - "id": "2be04ee1ddb148c19e91d3da5934fa55", "publicURL": "https://volume.compute.sbg1.cloud.ovh.net/v1/a24c37ed11a84896914514384898c34b"}], - "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": - [{"adminURL": "https://storage.gra1.cloud.ovh.net", "region": "GRA1", "internalURL": - "http://127.0.0.1:8888/v1/AUTH_a24c37ed11a84896914514384898c34b", "id": "c96f61d071a74e36bd3c07e53d241ce3", - "publicURL": "https://storage.gra1.cloud.ovh.net/v1/AUTH_a24c37ed11a84896914514384898c34b"}, - {"adminURL": "https://storage.bhs1.cloud.ovh.net:8888/", "region": "BHS1", - "internalURL": "http://127.0.0.1:8888/v1/AUTH_a24c37ed11a84896914514384898c34b", - "id": "3327534a1a824389aae5d663b9821d67", "publicURL": "https://storage.bhs1.cloud.ovh.net/v1/AUTH_a24c37ed11a84896914514384898c34b"}, - {"adminURL": "https://storage.sbg1.cloud.ovh.net", "region": "SBG1", "internalURL": - "http://127.0.0.1:8888/v1/AUTH_a24c37ed11a84896914514384898c34b", "id": "2af96b87ad484cb7879a9ea554d5418c", - "publicURL": "https://storage.sbg1.cloud.ovh.net/v1/AUTH_a24c37ed11a84896914514384898c34b"}], - "endpoints_links": [], "type": "object-store", "name": "swift"}, {"endpoints": - [{"adminURL": "https://auth.cloud.ovh.net:35357/v2.0", "region": "GRA1", "internalURL": - "http://127.0.0.1:5000/v2.0", "id": "62101e498fc3404dbc18ec80888992cb", "publicURL": - "https://auth.cloud.ovh.net/v2.0"}, {"adminURL": "https://auth.cloud.ovh.net:35357/v2.0", - "region": "BHS1", "internalURL": "http://127.0.0.1:5000/v2.0", "id": "00e403276b3246c4a5c54dc7133f9f0a", - "publicURL": "https://auth.cloud.ovh.net/v2.0"}, {"adminURL": "https://auth.cloud.ovh.net:35357/v2.0", - "region": "SBG1", "internalURL": "http://127.0.0.1:5000/v2.0", "id": "6094ef2ed9f240ed9b648dfcc0d9f923", - "publicURL": "https://auth.cloud.ovh.net/v2.0"}], "endpoints_links": [], "type": - "identity", "name": "keystone"}], "user": {"username": "MhsuDbK4DsPr", "roles_links": - [], "id": "43914cf4645747ba90d075c62ebb5018", "roles": [{"name": "_member_"}], - "name": "MhsuDbK4DsPr"}, "metadata": {"is_admin": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab"]}}}' - http_version: - recorded_at: Thu, 12 May 2016 14:05:17 GMT -- request: - method: get - uri: http://api-adresse.data.gouv.fr/search?limit=1&q=6%20RUE%20RAOUL%20NORDLING%20IMMEUBLE%20BORA%2092270%20BOIS%20COLOMBES - body: - encoding: US-ASCII - string: '' - headers: - Accept: - - "*/*; q=0.5, application/xml" - Accept-Encoding: - - gzip, deflate - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx/1.6.2 - Date: - - Thu, 12 May 2016 14:13:15 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '189' - 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": "6 RUE RAOUL NORDLING IMMEUBLE BORA 92270 BOIS COLOMBES", "type": - "FeatureCollection", "features": []}' - http_version: - recorded_at: Thu, 12 May 2016 14:13:16 GMT -recorded_with: VCR 3.0.1 diff --git a/spec/models/champ_shared_example.rb b/spec/models/champ_shared_example.rb index 9922fd38d..b404154df 100644 --- a/spec/models/champ_shared_example.rb +++ b/spec/models/champ_shared_example.rb @@ -14,6 +14,33 @@ shared_examples 'champ_spec' do it { is_expected.to delegate_method(:order_place).to(:type_de_champ) } end + describe 'mandatory_and_blank?' do + let(:type_de_champ) { TypeDeChamp.new(mandatory: mandatory) } + let(:champ) { Champ.new(type_de_champ: type_de_champ, value: value) } + let(:value) { '' } + let(:mandatory) { true } + + context 'when mandatory and blank' do + it { expect(champ.mandatory_and_blank?).to be(true) } + end + + context 'when not blank' do + let(:value) { 'yop' } + it { expect(champ.mandatory_and_blank?).to be(false) } + end + + context 'when not mandatory' do + let(:mandatory) { false } + it { expect(champ.mandatory_and_blank?).to be(false) } + end + + context 'when not mandatory or blank' do + let(:value) { 'u' } + let(:mandatory) { false } + it { expect(champ.mandatory_and_blank?).to be(false) } + end + end + describe 'data_provide' do let(:champ) { create :champ } diff --git a/spec/models/concern/mail_template_concern_spec.rb b/spec/models/concern/mail_template_concern_spec.rb index f177a360a..b82d78117 100644 --- a/spec/models/concern/mail_template_concern_spec.rb +++ b/spec/models/concern/mail_template_concern_spec.rb @@ -8,8 +8,8 @@ describe MailTemplateConcern do it 'works' do initiated_mail.object = '[TPS] --numero_dossier-- --libelle_procedure-- --lien_dossier--' expected = - "[TPS] 1 Demande de subvention " + - "http://localhost:3000/users/dossiers/1/recapitulatif" + "[TPS] #{dossier.id} Demande de subvention " + + "http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif" expect(initiated_mail.object_for_dossier(dossier)).to eq(expected) end diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index ddc469b50..63092998b 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -512,14 +512,6 @@ describe Dossier do it { expect(subject[:state]).to be_a(String) } end - describe '#convert_specific_array_values_to_string(array_to_convert)' do - let(:procedure) { create(:procedure) } - let(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure) } - let(:dossier_data_with_champs) { dossier.data_with_champs } - - subject { dossier.convert_specific_hash_values_to_string(dossier_data_with_champs) } - end - describe '#export_entreprise_data' do let(:procedure) { create(:procedure) } let(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure) } @@ -624,6 +616,52 @@ describe Dossier do it { expect(subject[9]).to eq(dossier.followers_gestionnaires_emails) } it { expect(subject.count).to eq(DossierProcedureSerializer.new(dossier).attributes.count + dossier.procedure.types_de_champ.count + dossier.export_entreprise_data.count) } end + + describe "#full_data_string" do + let(:expected_string) { + [ + dossier.id.to_s, + dossier.created_at, + dossier.updated_at, + "false", + "false", + "draft", + dossier.initiated_at, + dossier.received_at, + dossier.processed_at, + gestionnaire.email, + nil, + "44011762001530", + "true", + "4950Z", + "Transports par conduites", + "GRTGAZ IMMEUBLE BORA 6 RUE RAOUL NORDLING 92270 BOIS COLOMBES", + "6", + "RUE", + "RAOUL NORDLING", + "IMMEUBLE BORA", + "92270", + "BOIS COLOMBES", + "92009", + "440117620", + "537100000", + "FR27440117620", + "SA à conseil d'administration (s.a.i.)", + "5599", + "GRTGAZ", + "GRTGAZ", + "44011762001530", + "51", + dossier.entreprise.date_creation, + nil, + nil + ] + } + + subject { dossier } + + it { expect(dossier.full_data_strings_array).to eq(expected_string)} + end end describe '#Dossier.to_csv' do diff --git a/spec/services/champs_service_spec.rb b/spec/services/champs_service_spec.rb new file mode 100644 index 000000000..4e8ce53a1 --- /dev/null +++ b/spec/services/champs_service_spec.rb @@ -0,0 +1,49 @@ +require 'spec_helper' + +describe ChampsService do + describe 'save_champs' do + let!(:champ) { Champ.create(value: 'toto', type_de_champ: TypeDeChamp.new) } + let!(:champ_mandatory_empty) { Champ.create(type_de_champ: TypeDeChamp.new(libelle: 'mandatory', mandatory: true)) } + let!(:champ_datetime) do + champ_datetime = TypeDeChamp.new(type_champ: 'datetime') + Champ.create(type_de_champ: champ_datetime) + end + let!(:champs) { [champ, champ_mandatory_empty, champ_datetime] } + + before :each do + params_hash = { + champs: { + "'#{champ.id}'" => 'yop', + "'#{champ_datetime.id}'" => 'd' + }, + time_hour: { "'#{champ_datetime.id}'" => '12' }, + time_minute: { "'#{champ_datetime.id}'" => '24' } + } + @errors = ChampsService.save_champs(champs, params_hash, check_mandatory) + champs.each(&:reload) + end + + context 'check_mandatory is true' do + let(:check_mandatory) { true } + it 'saves the changed champ' do + expect(champ.value).to eq('yop') + end + + it 'parses and save the date' do + expect(champ_datetime.value).to eq('d 12:24') + end + + it 'adds error for the missing mandatory champ' do + expect(@errors).to match([{ message: 'Le champ mandatory doit être rempli.' }]) + end + end + + context 'check_mandatory is false' do + let(:check_mandatory) { false } + + it 'does not add errors' do + expect(@errors).to match([]) + end + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f3b8d6030..d28fae75d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -55,7 +55,7 @@ VCR.configure do |c| c.configure_rspec_metadata! end -DatabaseCleaner.strategy = :truncation +DatabaseCleaner.strategy = :transaction SIADETOKEN = :valid_token unless defined? SIADETOKEN BROWSER.value = Browser.new('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)') diff --git a/spec/views/users/description/champs/_dossier_link.html.haml_spec.rb b/spec/views/users/description/champs/_dossier_link.html.haml_spec.rb new file mode 100644 index 000000000..a61f09532 --- /dev/null +++ b/spec/views/users/description/champs/_dossier_link.html.haml_spec.rb @@ -0,0 +1,47 @@ +require 'spec_helper' + +describe 'users/description/champs/dossier_link.html.haml', type: :view do + let(:type_champ) { create(:type_de_champ_public, type_champ: :dossier_link) } + + before do + render 'users/description/champs/dossier_link.html.haml', champ: champ + end + + context 'When no dossier is provided' do + let!(:champ) { create(:champ, type_de_champ: type_champ, value: nil) } + + it 'should not display the procedure libelle' do + expect(rendered).to have_css('.text-info[style*="display: none"]') + end + + it 'should not display a warning' do + expect(rendered).to have_css('.text-warning[style*="display: none"]') + end + end + + context 'When a dossier whith a procedure is provided' do + let!(:procedure) { create(:procedure) } + let!(:dossier) { create(:dossier, procedure: procedure) } + let!(:champ) { create(:champ, type_de_champ: type_champ, value: dossier.id) } + + it 'should display the procedure libelle' do + expect(rendered).not_to have_css('.text-info[style*="display: none"]') + end + + it 'should not display a warning' do + expect(rendered).to have_css('.text-warning[style*="display: none"]') + end + end + + context 'When a unknown dossier id is provided' do + let!(:champ) { create(:champ, type_de_champ: type_champ, value: 666) } + + it 'should not display the procedure libelle' do + expect(rendered).to have_css('.text-info[style*="display: none"]') + end + + it 'should display a warning' do + expect(rendered).not_to have_css('.text-warning[style*="display: none"]') + end + end +end diff --git a/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb b/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb index a60d0e86b..17ca6d9d3 100644 --- a/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb +++ b/spec/views/users/description/champs/_render_list_champs.html.haml_spec.rb @@ -24,4 +24,18 @@ describe 'users/description/champs/render_list_champs.html.haml', type: :view do expect(rendered).to have_css('input[type=checkbox][checked]') end end + + context 'with a dossier_link' do + let(:type_champ) { create(:type_de_champ_public, type_champ: :dossier_link) } + let!(:champ) { create(:champ, type_de_champ: type_champ, value: nil) } + + before do + render 'users/description/champs/render_list_champs.html.haml', champs: Champ.all, order_place: 0 + end + + it 'should render a number input with the right data-attribute' do + expect(view).to render_template(partial: 'users/description/champs/_dossier_link', + locals: { champ: champ }) + end + end end