Merge branch 'dev'

This commit is contained in:
gregoirenovel 2018-10-18 14:00:06 +02:00
commit 6029e816c4
4 changed files with 54 additions and 35 deletions

View file

@ -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

View file

@ -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 <a href="https://doc.demarches-simplifiees.fr/tutoriels/tutoriel-administrateur#cadre-juridique" target="_blank">En savoir plus</a>
%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

View file

@ -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 dinstruction pour cette démarche est de #{distance_of_time_in_words(dossier.procedure.mean_instruction_time)}.

View file

@ -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'