Add draft/publish status for procedure.
This commit is contained in:
parent
b987b86bd8
commit
2791988da2
22 changed files with 341 additions and 71 deletions
19
app/views/admin/procedures/_draft_list.html.haml
Normal file
19
app/views/admin/procedures/_draft_list.html.haml
Normal file
|
@ -0,0 +1,19 @@
|
|||
- unless smart_listing.empty?
|
||||
%table.table
|
||||
%thead
|
||||
%th#ID= smart_listing.sortable 'ID', 'id'
|
||||
%th#libelle= smart_listing.sortable 'Libellé', 'libelle'
|
||||
|
||||
- @procedures.each do |procedure|
|
||||
- procedure = procedure.decorate
|
||||
%tr
|
||||
%td.col-md-1.col-lg-1= procedure.id
|
||||
%td.col-md-6.col-lg-6
|
||||
= link_to(procedure.libelle, "/admin/procedures/#{procedure.id}")
|
||||
|
||||
= smart_listing.paginate
|
||||
= smart_listing.pagination_per_page_links
|
||||
|
||||
- else
|
||||
%h4.center
|
||||
Aucune procédure
|
|
@ -1,5 +1,10 @@
|
|||
#onglets
|
||||
%ul.nav.nav-tabs
|
||||
%li{class: @draft_class}
|
||||
%a{:href => "#{url_for :admin_procedures_draft}"}
|
||||
%h5{style: 'color: black'}
|
||||
="Brouillons"
|
||||
|
||||
%li{class: @active_class}
|
||||
%a{:href => "#{url_for :admin_procedures}"}
|
||||
%h5.text-success
|
||||
|
|
|
@ -1,30 +1,48 @@
|
|||
#procedure_show
|
||||
=render partial: 'head', locals: {active: 'Informations'}
|
||||
|
||||
= form_tag admin_procedure_archive_path(procedure_id: @facade.procedure.id, archive: !@facade.procedure.archived?), method: :put, style:'float: right; margin-top: 10px' do
|
||||
%button#archive.btn.btn-small.btn-default.text-info{type: :button}
|
||||
%i.fa.fa-eraser
|
||||
- if @facade.procedure.archived
|
||||
= 'Réactiver'
|
||||
- else
|
||||
= 'Archiver'
|
||||
#confirm
|
||||
%button#valid.btn.btn-small.btn-success{type: :submit}
|
||||
%i.fa.fa-check
|
||||
Valider
|
||||
%button#cancel.btn.btn-small.btn-danger{type: :button}
|
||||
%i.fa.fa-remove
|
||||
Annuler
|
||||
-if ! @facade.procedure.published?
|
||||
= form_tag admin_procedure_publish_path(procedure_id: @facade.procedure.id, publish: true), method: :put, style:'float: right; margin-top: 10px' do
|
||||
%button#archive.btn.btn-small.btn-success.text-info{type: :button}
|
||||
%i.fa.fa-eraser
|
||||
Publier
|
||||
#confirm
|
||||
%button#valid.btn.btn-small.btn-success{type: :submit}
|
||||
%i.fa.fa-check
|
||||
Valider
|
||||
%button#cancel.btn.btn-small.btn-danger{type: :button}
|
||||
%i.fa.fa-remove
|
||||
Annuler
|
||||
|
||||
-else
|
||||
= form_tag admin_procedure_archive_path(procedure_id: @facade.procedure.id, archive: !@facade.procedure.archived?), method: :put, style:'float: right; margin-top: 10px' do
|
||||
%button#archive.btn.btn-small.btn-default.text-info{type: :button}
|
||||
%i.fa.fa-eraser
|
||||
- if @facade.procedure.archived
|
||||
= 'Réactiver'
|
||||
- else
|
||||
= 'Archiver'
|
||||
#confirm
|
||||
%button#valid.btn.btn-small.btn-success{type: :submit}
|
||||
%i.fa.fa-check
|
||||
Valider
|
||||
%button#cancel.btn.btn-small.btn-danger{type: :button}
|
||||
%i.fa.fa-remove
|
||||
Annuler
|
||||
|
||||
- if @facade.procedure.locked?
|
||||
#procedure_locked.center
|
||||
%h5
|
||||
.label.label-info La procédure ne peut plus être modifiée car un usagé a déjà déposé un dossier
|
||||
.label.label-info La procédure ne peut plus être modifiée car elle a été publiée
|
||||
|
||||
%div
|
||||
%h3 Lien procédure
|
||||
%div{style:'margin-left:3%'}
|
||||
= @facade.procedure.lien
|
||||
-if @facade.procedure.published?
|
||||
= @facade.procedure.lien
|
||||
-else
|
||||
%b
|
||||
Cette procédure n'a pas encore été publiée et n'est donc pas accessible par le public.
|
||||
|
||||
%br
|
||||
%h3 Détails
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue