Add procedure edition functionality
This commit is contained in:
parent
49627fccad
commit
270d28f6da
12 changed files with 314 additions and 2 deletions
|
@ -1 +0,0 @@
|
|||
%p Coucou
|
36
app/views/admin/procedures/_informations.html.haml
Normal file
36
app/views/admin/procedures/_informations.html.haml
Normal file
|
@ -0,0 +1,36 @@
|
|||
%br
|
||||
.form-group{class: ('has-error' if @procedure.errors.messages[:libelle])}
|
||||
%h4 Libellé*
|
||||
=f.text_field :libelle, class: 'form-control', placeholder: 'Libellé'
|
||||
|
||||
.form-group{class: ('has-error' if @procedure.errors.messages[:description])}
|
||||
%h4 Description*
|
||||
=f.text_area :description, class: 'form-control', placeholder: 'Description'
|
||||
|
||||
.form-group{class: ('has-error' if @procedure.errors.messages[:lien_demarche])}
|
||||
%h4 Lien Démarche*
|
||||
=f.text_field :lien_demarche, class: 'form-control', placeholder: 'Lien Démarche'
|
||||
|
||||
.form-group{class: ('has-error' if @procedure.errors.messages[:organisation])}
|
||||
%h4 Organisation
|
||||
=f.text_field :organisation, class: 'form-control', placeholder: 'Organisation'
|
||||
|
||||
.form-group{class: ('has-error' if @procedure.errors.messages[:direction])}
|
||||
%h4 Direction
|
||||
=f.text_field :direction, class: 'form-control', placeholder: 'Direction'
|
||||
|
||||
%br
|
||||
|
||||
%label{ style:'font-weight:normal' }
|
||||
=f.check_box :use_api_carto
|
||||
Utilisation de l'API Carto
|
||||
|
||||
%br
|
||||
%br
|
||||
%h4
|
||||
Liste des champs à remplir pour un dossier
|
||||
|
||||
%br
|
||||
%br
|
||||
%h4
|
||||
Liste des pièces justificatives à fournir pour un dossier
|
17
app/views/admin/procedures/index.html.haml
Normal file
17
app/views/admin/procedures/index.html.haml
Normal file
|
@ -0,0 +1,17 @@
|
|||
= link_to("Nouvelle procédure", "/admin/procedures/new", class: 'btn btn-success', style: 'float:right')
|
||||
%h2 Gestion des procédures
|
||||
%br
|
||||
%br
|
||||
%table.table
|
||||
%thead.row
|
||||
%th.col-md-4.col-lg-1 ID
|
||||
%th.col-md-4.col-lg-4 Libellé
|
||||
%th.col-md-2.col-lg-4 Organisation
|
||||
%th.col-md-2.col-lg-3 Direction
|
||||
- @procedures.each do |procedure|
|
||||
%tr
|
||||
%td= procedure.id
|
||||
%td
|
||||
= link_to(procedure.libelle, "/admin/procedures/#{procedure.id}")
|
||||
%td= procedure.organisation
|
||||
%td= procedure.direction
|
7
app/views/admin/procedures/new.html.haml
Normal file
7
app/views/admin/procedures/new.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
%h2 Nouvelle procédure
|
||||
|
||||
#procedure_new.section.section-label
|
||||
= form_for @procedure, url: {controller: 'admin/procedures', action: :create} do |f|
|
||||
=render partial: 'informations', locals: {f: f}
|
||||
%br
|
||||
=f.submit 'Valider', class: 'btn btn-info', style: 'float:right'
|
8
app/views/admin/procedures/show.html.haml
Normal file
8
app/views/admin/procedures/show.html.haml
Normal file
|
@ -0,0 +1,8 @@
|
|||
%h2.text-info
|
||||
=@procedure.libelle
|
||||
|
||||
#procedure_new.section.section-label
|
||||
= form_for @procedure, url: {controller: 'admin/procedures', action: :update} do |f|
|
||||
=render partial: 'informations', locals: {f: f}
|
||||
%br
|
||||
=f.submit 'Editer', class: 'btn btn-success', style: 'float:right'
|
Loading…
Add table
Add a link
Reference in a new issue