From 42943aad19543edab580ee49913e562ad644164e Mon Sep 17 00:00:00 2001 From: Xavier J Date: Wed, 24 Aug 2016 11:40:53 +0200 Subject: [PATCH] Explicit the use of lien_demarche attr --- app/assets/javascripts/procedure.js | 19 +++++++++++++++++-- app/assets/stylesheets/procedure.scss | 4 ++++ .../admin/procedures/_informations.html.haml | 5 ++++- .../dossiers/_pieces_justificatives.html.haml | 3 --- .../_pieces_justificatives.html.haml | 12 +++++++++++- app/views/users/description/_show.html.haml | 4 ++-- 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/procedure.js b/app/assets/javascripts/procedure.js index ab110a53f..875e5f504 100644 --- a/app/assets/javascripts/procedure.js +++ b/app/assets/javascripts/procedure.js @@ -1,5 +1,10 @@ -$(document).on('page:load', buttons_api_carto); -$(document).ready(buttons_api_carto); +$(document).on('page:load', button_edit_procedure_init); +$(document).ready(button_edit_procedure_init); + +function button_edit_procedure_init(){ + buttons_api_carto(); + button_cerfa(); +} function buttons_api_carto () { @@ -9,4 +14,14 @@ function buttons_api_carto () { if ($('#procedure_module_api_carto_use_api_carto').is(':checked')) $("#modules_api_carto").show(); +} + +function button_cerfa () { + + $("#procedure_cerfa_flag").on('change', function() { + $("#procedure_lien_demarche").toggle() + }); + + if ($('#procedure_cerfa_flag').is(':checked')) + $("#procedure_lien_demarche").show(); } \ No newline at end of file diff --git a/app/assets/stylesheets/procedure.scss b/app/assets/stylesheets/procedure.scss index 9edc53793..c35fb74aa 100644 --- a/app/assets/stylesheets/procedure.scss +++ b/app/assets/stylesheets/procedure.scss @@ -1,3 +1,7 @@ #modules_api_carto { display: none; +} + +#procedure_lien_demarche{ + display: none; } \ No newline at end of file diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index 6be1a248f..264dd40b1 100644 --- a/app/views/admin/procedures/_informations.html.haml +++ b/app/views/admin/procedures/_informations.html.haml @@ -1,7 +1,7 @@ %br --{libelle: 'Libellé*', description: 'Description*', lien_demarche: 'Lien démarche', organisation: 'Organisation', direction: 'Direction'}.each do |key, value| +-{libelle: 'Libellé*', description: 'Description*', organisation: 'Organisation', direction: 'Direction'}.each do |key, value| .form-group{class: ('has-error' if @procedure.errors.messages[key])} %h4 =value @@ -47,8 +47,11 @@ %label = ff.check_box :cadastre Cadastre + .col-md-6.col-lg-6 %h4 Formulaire / CERFA %label =f.check_box :cerfa_flag Activer l'envoi de formulaire / CERFA + %br + =f.text_field :lien_demarche, class: 'form-control', placeholder: 'URL vers le formulaire vierge (facultatif)' diff --git a/app/views/dossiers/_pieces_justificatives.html.haml b/app/views/dossiers/_pieces_justificatives.html.haml index 69a367896..18fedcae7 100644 --- a/app/views/dossiers/_pieces_justificatives.html.haml +++ b/app/views/dossiers/_pieces_justificatives.html.haml @@ -7,9 +7,6 @@ ='Formulaire' %td.col-lg-6.col-md-6 - if @facade.dossier.cerfa_available? - -#- if user_signed_in? - -# = 'Pièce fournie' - -#- elsif gestionnaire_signed_in? %a{ href: "#{@facade.dossier.cerfa.last.content_url}", target: '_blank' } Consulter %span{style:'margin-left:12px'} \- diff --git a/app/views/users/description/_pieces_justificatives.html.haml b/app/views/users/description/_pieces_justificatives.html.haml index e440520e8..df889d102 100644 --- a/app/views/users/description/_pieces_justificatives.html.haml +++ b/app/views/users/description/_pieces_justificatives.html.haml @@ -2,7 +2,7 @@ - if @dossier.procedure.cerfa_flag %tr %th{class:'col-lg-6'} - ='Formulaire' + ='Formulaire / CERFA' %td{class:'col-lg-5'} -if @dossier.cerfa_available? @@ -27,3 +27,13 @@ Modifier = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 3.megabytes + +#state_description.row{style:'width: 50%; margin-left:20px'} + .panel.panel-info + .panel-body.center + .row + .col-md-1.col-lg-1 + .fa.fa-info-circle.text-info{style:'font-size: 2em; margin-top: 20%'} + .col-md-11.col-lg-11 + Les documents administratifs ne sont pas indispensable afin d'initier votre dossier. + Vous pourrez dans tous les cas les compléter plus tard si vous ne les possédez pas de suite. \ No newline at end of file diff --git a/app/views/users/description/_show.html.haml b/app/views/users/description/_show.html.haml index 463ac15e8..df4862777 100644 --- a/app/views/users/description/_show.html.haml +++ b/app/views/users/description/_show.html.haml @@ -16,8 +16,8 @@ -unless @procedure.lien_demarche.blank? %p - Formulaire / documentation de la démarche : - %a{style:'font-size:0.9em; padding-left:3px', id: 'lien_cerfa' ,href: "#{@procedure.lien_demarche}", :target => '_blank'} Accéder + Récupérer le formulaire / CERFA vierge pour mon dossier : + %a{style:'font-size:0.9em; padding-left:3px', id: 'lien_cerfa' ,href: "#{@procedure.lien_demarche}", :target => '_blank'} Télécharger %br