.container#description_page %h2 = @dossier.procedure.libelle %h3 Votre dossier %br -#TODO use form_for = form_tag(url_for({controller: :description, action: :create, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST', multipart: true) do %div .row .col-md-12 %h4 Libellé pour votre dossier * = text_field_tag :nom_projet, @dossier.nom_projet, placeholder: 'Nom du projet', class: 'form-control' %br .row .col-md-12 %h4 Description * = text_area_tag :description, @dossier.description, rows: '6', placeholder: 'Description du projet', class: 'form-control wysihtml5' #liste_champs -unless @champs.nil? -@champs.each do |champ| .row %div{class: "type_champ-#{champ.type_champ}"} -if champ.type_champ == 'checkbox' %h4{style:'margin-left:15px;'} = champ.libelle - if champ.mandatory? = '*' %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')} -else %h4 = champ.libelle - if champ.mandatory? = '*' -if champ.type_champ == 'textarea' %textarea.form-control{name:"champs['#{champ.id}']", placeholder: champ.libelle, id: "champs_#{champ.id}"} =champ.value -else %input.form-control{name:"champs['#{champ.id}']", placeholder: champ.libelle, id: "champs_#{champ.id}", value: champ.value, type:"#{champ.type_champ}", 'data-provide' => ('datepicker' if champ.type_champ == 'datetime'), 'data-date-format' => ('dd/mm/yyyy' if champ.type_champ == 'datetime')} -if !@procedure.lien_demarche.blank? || @procedure.cerfa_flag || @dossier.pieces_justificatives.size > 1 %br %h3 Documents administratifs -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 %br //TODO a refactorer %table{class:'table', style:'width:55%; margin-left:5%'} - if @procedure.cerfa_flag %tr %th{class:'col-lg-6'} ='Formulaire' %td{class:'col-lg-5'} -if @dossier.cerfa_available? %span.btn.btn-sm.btn-file.btn-success Modifier %input{type: 'file', name:'cerfa_pdf', id:'cerfa_pdf', accept: "application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.spreadsheet", :max_file_size => 3.megabytes } -else %input{type: 'file', name:'cerfa_pdf', id:'cerfa_pdf', accept: "application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.spreadsheet", :max_file_size => 3.megabytes } - @dossier.pieces_justificatives.each do |piece_justificative| %tr %th.col-lg-6 = piece_justificative.libelle %td.col-lg-5 -if piece_justificative.api_entreprise %span.text-success{ id: "piece_justificative_#{piece_justificative.type}" } Nous l'avons récupéré pour vous. -else -if piece_justificative.empty? = file_field_tag "piece_justificative_#{piece_justificative.type}", accept: " application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.spreadsheet", :max_file_size => 3.megabytes -else %span.btn.btn-sm.btn-file.btn-success Modifier = file_field_tag "piece_justificative_#{piece_justificative.type}", accept: " application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.oasis.opendocument.text, application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.spreadsheet", :max_file_size => 3.megabytes %div{style: 'text-align:right'} %h6 Tous les champs portant un * sont obligatoires. -if !@dossier.draft? =render partial: '/layouts/modifications_terminees' -else = submit_tag 'Soumettre mon dossier', id: 'suivant', class: %w(btn btn btn-success), style: 'float:right', data: { disable_with: 'Soumettre votre dossier', submit: true} %br %br