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/controllers/admin/procedures_controller.rb b/app/controllers/admin/procedures_controller.rb index 1f6539c6d..a6e8f7fec 100644 --- a/app/controllers/admin/procedures_controller.rb +++ b/app/controllers/admin/procedures_controller.rb @@ -187,7 +187,7 @@ class Admin::ProceduresController < AdminController private def create_procedure_params - params.require(:procedure).permit(:libelle, :description, :organisation, :direction, :lien_demarche, :euro_flag, :logo, :cerfa_flag, module_api_carto_attributes: [:id, :use_api_carto, :quartiers_prioritaires, :cadastre]).merge(administrateur_id: current_administrateur.id) + params.require(:procedure).permit(:libelle, :description, :organisation, :direction, :lien_demarche, :lien_site_web, :lien_notice, :euro_flag, :logo, :cerfa_flag, module_api_carto_attributes: [:id, :use_api_carto, :quartiers_prioritaires, :cadastre]).merge(administrateur_id: current_administrateur.id) end def create_module_api_carto_params diff --git a/app/views/admin/procedures/_informations.html.haml b/app/views/admin/procedures/_informations.html.haml index 6be1a248f..c28e08a77 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', lien_site_web: 'Lien site internet', lien_notice: 'Lien notice'}.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/dossiers/etapes/_etape1.html.haml b/app/views/dossiers/etapes/_etape1.html.haml index 9b3a10025..b6353413c 100644 --- a/app/views/dossiers/etapes/_etape1.html.haml +++ b/app/views/dossiers/etapes/_etape1.html.haml @@ -17,4 +17,8 @@ = @facade.procedure.libelle %p#description_procedure{style:'width: 95%;', class: (@facade.entreprise.nil? ? '' : 'mask')} - = h @facade.procedure.description.html_safe \ No newline at end of file + = h @facade.procedure.description.html_safe + + - unless @facade.procedure.lien_site_web.blank? + .center + =link_to truncate(@facade.procedure.lien_site_web, length: 40), @facade.procedure.lien_site_web, {target: '_blank'} \ No newline at end of file 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..294884e26 100644 --- a/app/views/users/description/_show.html.haml +++ b/app/views/users/description/_show.html.haml @@ -1,6 +1,19 @@ .container#description_page - %h2 + - unless @dossier.procedure.lien_notice.blank? + #lien_notice_panel.row{style:'width: 280px; position: fixed; background-color: white; right: 5%; top: 80px;'} + .panel.panel-info{style:'margin-bottom:0'} + .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-10.col-lg-10{style:'padding-right: 0px'} + %b + =link_to 'Accéder au guide', @dossier.procedure.lien_notice, {target: '_blank'} + pour remplir pour votre dossier + + %h2.text-info = @dossier.procedure.libelle + %h3 Votre dossier -#TODO use form_for @@ -16,8 +29,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 diff --git a/db/migrate/20160824094151_add_lien_site_web_in_procedure_table.rb b/db/migrate/20160824094151_add_lien_site_web_in_procedure_table.rb new file mode 100644 index 000000000..3635b2cd9 --- /dev/null +++ b/db/migrate/20160824094151_add_lien_site_web_in_procedure_table.rb @@ -0,0 +1,5 @@ +class AddLienSiteWebInProcedureTable < ActiveRecord::Migration + def change + add_column :procedures, :lien_site_web, :string + end +end diff --git a/db/migrate/20160824094451_add_lien_notice_in_procedure_table.rb b/db/migrate/20160824094451_add_lien_notice_in_procedure_table.rb new file mode 100644 index 000000000..218805fee --- /dev/null +++ b/db/migrate/20160824094451_add_lien_notice_in_procedure_table.rb @@ -0,0 +1,5 @@ +class AddLienNoticeInProcedureTable < ActiveRecord::Migration + def change + add_column :procedures, :lien_notice, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 86f0bac18..80b669500 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160809083606) do +ActiveRecord::Schema.define(version: 20160822142045) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"