Add lien demarche to type de piece justificative
This commit is contained in:
parent
333ea9a610
commit
566fd8bc74
6 changed files with 33 additions and 12 deletions
|
@ -22,7 +22,7 @@ class Admin::PiecesJustificativesController < AdminController
|
||||||
def update_params
|
def update_params
|
||||||
params
|
params
|
||||||
.require(:procedure)
|
.require(:procedure)
|
||||||
.permit(types_de_piece_justificative_attributes: [:libelle, :description, :id, :order_place])
|
.permit(types_de_piece_justificative_attributes: [:libelle, :description, :id, :order_place, :lien_demarche])
|
||||||
end
|
end
|
||||||
|
|
||||||
def move_up
|
def move_up
|
||||||
|
|
|
@ -6,6 +6,12 @@
|
||||||
.form-group
|
.form-group
|
||||||
%h4 Description
|
%h4 Description
|
||||||
=ff.text_area :description, class: 'form-control description', placeholder: 'Description'
|
=ff.text_area :description, class: 'form-control description', placeholder: 'Description'
|
||||||
|
.form-group
|
||||||
|
%h4
|
||||||
|
Lien du formulaire vierge
|
||||||
|
%small
|
||||||
|
(optionel)
|
||||||
|
=ff.url_field :lien_demarche, class: 'form-control', placeholder: 'Lien du document vierge'
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
= ff.hidden_field :order_place, value: ff.index
|
= ff.hidden_field :order_place, value: ff.index
|
||||||
|
@ -23,4 +29,3 @@
|
||||||
= f.submit('Ajouter la pièce', class: 'btn btn-success', id: 'add_piece_justificative')
|
= f.submit('Ajouter la pièce', class: 'btn btn-success', id: 'add_piece_justificative')
|
||||||
- else
|
- else
|
||||||
= link_to("", admin_procedure_piece_justificative_path(@procedure, ff.object.id), method: :delete, remote: true, id: "delete_type_de_piece_justificative_#{ff.object.id}", class: %w(form-control btn btn-danger fa fa-trash-o) )
|
= link_to("", admin_procedure_piece_justificative_path(@procedure, ff.object.id), method: :delete, remote: true, id: "delete_type_de_piece_justificative_#{ff.object.id}", class: %w(form-control btn btn-danger fa fa-trash-o) )
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
-unless dossier.procedure.lien_demarche.blank?
|
|
||||||
%p
|
|
||||||
Récupérer le formulaire de demande ou CERFA vierge pour mon dossier :
|
|
||||||
= link_to "Télécharger", dossier.procedure.lien_demarche, target: '_blank', id: 'lien_cerfa'
|
|
||||||
|
|
||||||
%table.table
|
%table.table
|
||||||
- if dossier.procedure.cerfa_flag
|
- if dossier.procedure.cerfa_flag
|
||||||
%tr
|
%tr
|
||||||
%th.col-lg-6
|
%th
|
||||||
Formulaire de demande ou CERFA (complété et numérisé)
|
Formulaire de demande ou CERFA (complété et numérisé)
|
||||||
|
%td
|
||||||
|
-unless dossier.procedure.lien_demarche.blank?
|
||||||
|
%em
|
||||||
|
Récupérer le formulaire de demande ou CERFA vierge pour mon dossier :
|
||||||
|
= link_to "Télécharger", "#{dossier.procedure.lien_demarche}", target: :blank, id: :lien_cerfa
|
||||||
|
-# %a{ id: 'lien_cerfa', href: "#{dossier.procedure.lien_demarche}", target: '_blank'} Télécharger
|
||||||
|
|
||||||
%td.col-lg-5
|
%td
|
||||||
-if dossier.cerfa_available?
|
-if dossier.cerfa_available?
|
||||||
%span.btn.btn-sm.btn-file.btn-success
|
%span.btn.btn-sm.btn-file.btn-success
|
||||||
Modifier
|
Modifier
|
||||||
|
@ -19,9 +21,16 @@
|
||||||
|
|
||||||
- dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative|
|
- dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative|
|
||||||
%tr
|
%tr
|
||||||
%th.col-lg-6.piece-libelle
|
%th.piece-libelle
|
||||||
= type_de_piece_justificative.libelle
|
= type_de_piece_justificative.libelle
|
||||||
%td.col-lg-5
|
|
||||||
|
%td
|
||||||
|
- unless type_de_piece_justificative.lien_demarche.blank?
|
||||||
|
%em
|
||||||
|
Récupérer le formulaire vierge pour mon dossier :
|
||||||
|
= link_to "Télécharger", type_de_piece_justificative.lien_demarche, target: :blank
|
||||||
|
|
||||||
|
%td
|
||||||
-if type_de_piece_justificative.api_entreprise
|
-if type_de_piece_justificative.api_entreprise
|
||||||
%span.text-success{ id: "piece_justificative_#{type_de_piece_justificative.id}" } Nous l'avons récupéré pour vous.
|
%span.text-success{ id: "piece_justificative_#{type_de_piece_justificative.id}" } Nous l'avons récupéré pour vous.
|
||||||
-else
|
-else
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
%br
|
%br
|
||||||
%h3 Documents administratifs
|
%h3 Documents administratifs
|
||||||
|
|
||||||
|
|
||||||
//TODO a refactorer
|
//TODO a refactorer
|
||||||
.row
|
.row
|
||||||
.col-lg-8
|
.col-lg-8
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddLienToTypeDePieceJustificative < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_column :types_de_piece_justificative, :lien_demarche, :string, default: nil
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20161227103823) do
|
ActiveRecord::Schema.define(version: 20170118144306) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -361,6 +361,7 @@ ActiveRecord::Schema.define(version: 20161227103823) do
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.integer "procedure_id"
|
t.integer "procedure_id"
|
||||||
t.integer "order_place"
|
t.integer "order_place"
|
||||||
|
t.string "lien_demarche"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "users", force: :cascade do |t|
|
create_table "users", force: :cascade do |t|
|
||||||
|
|
Loading…
Reference in a new issue