From a0ab2bae04d01fd2a5bb661c2639593d3f810aca Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Wed, 17 Oct 2018 19:50:03 +0200 Subject: [PATCH 1/4] [Fix #2861] Coquille --- app/views/users/passwords/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index fab006b53..e1c8a35d9 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -14,4 +14,4 @@ = f.label :email, 'Email' = f.email_field :email, autofocus: true - = f.submit 'Réinitialier', class: 'button primary' + = f.submit 'Réinitialiser', class: 'button primary' From fd9bdbf31d240fc72f74f5f0937fe6019f61692d Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Wed, 17 Oct 2018 21:38:07 +0200 Subject: [PATCH 2/4] StatsController: avoid doing useless queries --- app/controllers/stats_controller.rb | 32 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index ee4d45a2d..a338729ca 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -23,22 +23,24 @@ class StatsController < ApplicationController @procedures_count_per_administrateur = procedures_count_per_administrateur(procedures) - @dossier_instruction_mean_time = Rails.cache.fetch("dossier_instruction_mean_time", expires_in: 1.day) do - dossier_instruction_mean_time(dossiers) + if administration_signed_in? + @dossier_instruction_mean_time = Rails.cache.fetch("dossier_instruction_mean_time", expires_in: 1.day) do + dossier_instruction_mean_time(dossiers) + end + + @dossier_filling_mean_time = Rails.cache.fetch("dossier_filling_mean_time", expires_in: 1.day) do + dossier_filling_mean_time(dossiers) + end + + @avis_usage = avis_usage + @avis_average_answer_time = avis_average_answer_time + @avis_answer_percentages = avis_answer_percentages + + @motivation_usage_dossier = motivation_usage_dossier + @motivation_usage_procedure = motivation_usage_procedure + + @cloned_from_library_procedures_ratio = cloned_from_library_procedures_ratio end - - @dossier_filling_mean_time = Rails.cache.fetch("dossier_filling_mean_time", expires_in: 1.day) do - dossier_filling_mean_time(dossiers) - end - - @avis_usage = avis_usage - @avis_average_answer_time = avis_average_answer_time - @avis_answer_percentages = avis_answer_percentages - - @motivation_usage_dossier = motivation_usage_dossier - @motivation_usage_procedure = motivation_usage_procedure - - @cloned_from_library_procedures_ratio = cloned_from_library_procedures_ratio end def download From 0090ed2e1f2a7c7befba21b14d932d0a39d526b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chai=CC=88b=20Martinez?= Date: Tue, 2 Oct 2018 18:23:26 +0200 Subject: [PATCH 3/4] Modification de texte pour le cadre juridique, afin de le rendre plus clair et simple a remplir. --- .../admin/procedures/_informations.html.haml | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index ad7076495..7baa9060b 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -47,24 +47,34 @@ .form-group %h4 Cadre juridique * - %p Indiquez la référence ou l'URL du texte juridique ou chargez la délibération qui justifie cette démarche - = f.label :cadre_juridique, 'Référence ou texte de loi' - = f.text_field :cadre_juridique, class: 'form-control', placeholder: 'https://www.legifrance.gouv.fr/' + %p Texte qui justifie le droit de collecter les données demandées dans votre démarche auprès des usagers, par exemple : + %ul + %li Texte de loi (loi, décret, circulaire, arrêté,…) + %li Texte juridique (statuts, délibération, décision du conseil d'administration…) + %li En savoir plus + %p.help-block + %i.fa.fa-info-circle + Vous pouvez saisir un lien vers ce texte ou importer celui-ci directement. - = f.label :deliberation, 'Délibération' - - deliberation = @procedure.deliberation - - if !deliberation.attached? - = f.file_field :deliberation, - direct_upload: true - - else - %a{ href: url_for(deliberation), target: '_blank' } - = deliberation.filename.to_s - - if @procedure.persisted? - = link_to 'supprimer', delete_deliberation_admin_procedure_path(@procedure), method: :delete - %br - Modifier : - = f.file_field :deliberation, - direct_upload: true + .row + .col-md-6 + = f.label :cadre_juridique, 'Lien vers le texte' + = f.text_field :cadre_juridique, class: 'form-control', placeholder: 'https://www.legifrance.gouv.fr/' + .col-md-6 + = f.label :deliberation, 'Importer le texte' + - deliberation = @procedure.deliberation + - if !deliberation.attached? + = f.file_field :deliberation, + direct_upload: true + - else + %a{ href: url_for(deliberation), target: '_blank' } + = deliberation.filename.to_s + - if @procedure.persisted? + = link_to 'supprimer', delete_deliberation_admin_procedure_path(@procedure), method: :delete + %br + Modifier : + = f.file_field :deliberation, + direct_upload: true .form-group %h4 Notice explicative de la démarche From 7eeaac5d819ad02e58ff22ab961fce1fa0635ad7 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Thu, 18 Oct 2018 11:46:25 +0200 Subject: [PATCH 4/4] Hide the mean verification/instruction times for a special demarche MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is not relevant for this demarche, and we’re doing them a favor --- .../new_user/dossiers/show/_status_overview.html.haml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/new_user/dossiers/show/_status_overview.html.haml b/app/views/new_user/dossiers/show/_status_overview.html.haml index 97dc76c4b..167883f63 100644 --- a/app/views/new_user/dossiers/show/_status_overview.html.haml +++ b/app/views/new_user/dossiers/show/_status_overview.html.haml @@ -1,3 +1,7 @@ +- procedure_id_for_which_we_hide_the_time_means = 6547 +- procedure_path_for_which_we_hide_the_time_means = 'deposer-une-offre-de-stage' +- show_time_means = dossier.procedure.id != procedure_id_for_which_we_hide_the_time_means && dossier.procedure.path != procedure_path_for_which_we_hide_the_time_means + .status-overview - if !dossier.termine? %ul.status-timeline @@ -26,7 +30,8 @@ = succeed '.' do %strong votre dossier passera directement en instruction - - if dossier.procedure.mean_verification_time + / FIXME: remove the custom procedure switch at some point + - if dossier.procedure.mean_verification_time && show_time_means - cache(dossier.procedure, expires_in: 1.week) do %p Le temps moyen de vérification pour cette démarche est de #{distance_of_time_in_words(dossier.procedure.mean_verification_time)}. @@ -39,7 +44,9 @@ %strong vous recevrez un email avec le résultat. - - if dossier.procedure.mean_instruction_time + + / FIXME: remove the custom procedure switch at some point + - if dossier.procedure.mean_instruction_time && show_time_means - cache(dossier.procedure, expires_in: 1.week) do %p Le temps moyen d’instruction pour cette démarche est de #{distance_of_time_in_words(dossier.procedure.mean_instruction_time)}.