Enable republish on démarches dépubliée
This commit is contained in:
parent
60998f410d
commit
b516cbc179
4 changed files with 118 additions and 17 deletions
|
@ -195,7 +195,11 @@ class Procedure < ApplicationRecord
|
|||
def path_available?(administrateur, path)
|
||||
procedure = other_procedure_with_path(path)
|
||||
|
||||
procedure.blank? || administrateur.owns?(procedure)
|
||||
procedure.blank? || (administrateur.owns?(procedure) && canonical_procedure_child?(procedure))
|
||||
end
|
||||
|
||||
def canonical_procedure_child?(procedure)
|
||||
!canonical_procedure || canonical_procedure == procedure || canonical_procedure == procedure.canonical_procedure
|
||||
end
|
||||
|
||||
def locked?
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
= render partial: 'admin/closed_mail_template_attestation_inconsistency_alert'
|
||||
.row.white-back
|
||||
#procedure_show
|
||||
= render 'modal_publish', procedure: @procedure, administrateur: @current_administrateur
|
||||
= render partial: '/admin/procedures/modal_transfer'
|
||||
= render 'modal_publish', procedure: @procedure, administrateur: @current_administrateur
|
||||
= render 'modal_transfer'
|
||||
|
||||
#procedure_show
|
||||
- if @procedure.brouillon?
|
||||
- if @procedure.missing_steps.present?
|
||||
- missing_elements = []
|
||||
|
@ -12,20 +12,20 @@
|
|||
- if @procedure.service.nil?
|
||||
- missing_elements << 'un service'
|
||||
- message = "Affectez #{missing_elements.join(' et ')} à votre démarche."
|
||||
%a.action_button.btn.btn-success#disabled-publish-procedure{ data: { toggle: :tooltip, placement: :bottom }, style: 'float: right; margin-top: 10px;', disabled: true, title: message }
|
||||
%button.action_button.btn.btn-success#disabled-publish-procedure{ data: { toggle: :tooltip, placement: :bottom }, style: 'float: right; margin-top: 10px;', disabled: true, title: message }
|
||||
%i.fa.fa-eraser
|
||||
Publier
|
||||
- else
|
||||
%a.btn.btn-success#publish-procedure{ data: { target: '#publish-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px;' }
|
||||
%button.btn.btn-success#publish-procedure{ data: { target: '#publish-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px;' }
|
||||
%i.fa.fa-eraser
|
||||
Publier
|
||||
|
||||
%a.btn.btn-default#transfer-procedure{ data: { target: '#transfer-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px; margin-right: 10px;' }
|
||||
%button.btn.btn-default#transfer-procedure{ data: { target: '#transfer-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px; margin-right: 10px;' }
|
||||
%i.fa.fa-exchange
|
||||
Envoyer une copie
|
||||
|
||||
- if @procedure.close?
|
||||
%a.btn.btn-default#reopen-procedure{ data: { target: '#publish-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px; margin-right: 10px;' }
|
||||
- if @procedure.close? || @procedure.depubliee?
|
||||
%button.btn.btn-default#reopen-procedure{ data: { target: '#publish-modal', toggle: :modal }, type: 'button', style: 'float: right; margin-top: 10px; margin-right: 10px;' }
|
||||
%i.fa.fa-rocket
|
||||
Réactiver
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue