Admin can be transfer a clone of a procédure at an other admin
This commit is contained in:
parent
e7830deefa
commit
2ad816b6b3
9 changed files with 137 additions and 20 deletions
23
app/views/admin/procedures/_modal_transfer.html.haml
Normal file
23
app/views/admin/procedures/_modal_transfer.html.haml
Normal file
|
@ -0,0 +1,23 @@
|
|||
#transferModal.modal.fade{"aria-labelledby" => "TransferProcedureModal", :role => "dialog", :tabindex => "-1"}
|
||||
.modal-dialog.modal-md{:role => "document"}
|
||||
= form_tag admin_procedure_transfer_path(procedure_id: @procedure.id), method: :post, remote: true do
|
||||
.modal-content
|
||||
.modal-header
|
||||
%button.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
|
||||
%span{"aria-hidden" => "true"} ×
|
||||
%h4#myModalLabel.modal-title
|
||||
Petit transfert de procédure entre administrateur
|
||||
.modal-body
|
||||
%p
|
||||
Cette fonctionnalité vous permet de transmettre un clone de votre procédure à un autre administrateur.
|
||||
%div{style:'margin-top:20px'}
|
||||
= text_field_tag :email_admin, '', {class: 'form-control',
|
||||
type: 'email',
|
||||
placeholder: 'Email administrateur cible',
|
||||
maxlength: 30,
|
||||
style: 'width: 300px; margin-left:auto; margin-right:auto'}
|
||||
%div#not_found_admin.center.text-danger{style:'display:none; margin-top: 10px'}
|
||||
Cet administrateur n'existe pas.
|
||||
.modal-footer
|
||||
= submit_tag "Envoyer", class: 'btn btn-success'
|
||||
= button_tag 'Annuler', class: %w(btn btn btn-default), id: 'cancel', data: { dismiss: 'modal' }
|
|
@ -1,19 +1,26 @@
|
|||
#procedure_show
|
||||
=render partial: 'head', locals: {active: 'Informations'}
|
||||
|
||||
-if ! @facade.procedure.published?
|
||||
-unless @facade.procedure.published?
|
||||
%a#publish.btn.btn-success{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px'}
|
||||
%i.fa.fa-eraser
|
||||
Publier
|
||||
%br
|
||||
=render partial: '/admin/procedures/modal_publish'
|
||||
|
||||
=render partial: '/admin/procedures/modal_publish'
|
||||
|
||||
%a#reenable.btn.btn-small.btn-default{"data-target" => "#transferModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px'}
|
||||
%i.fa.fa-exchange
|
||||
Transférer
|
||||
|
||||
=render partial: '/admin/procedures/modal_transfer'
|
||||
|
||||
-if @facade.procedure.archived?
|
||||
%a#reenable.btn.btn-small.btn-default.text-info{"data-target" => "#publishModal", "data-toggle" => "modal", :type => "button", style:'float: right; margin-top: 10px'}
|
||||
%i.fa.fa-eraser
|
||||
Réactiver
|
||||
%br
|
||||
=render partial: '/admin/procedures/modal_publish'
|
||||
|
||||
=render partial: '/admin/procedures/modal_publish'
|
||||
|
||||
-elsif @facade.procedure.published?
|
||||
= 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}
|
||||
|
|
11
app/views/admin/procedures/transfer.js.erb
Normal file
11
app/views/admin/procedures/transfer.js.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
<%- if response.status == 404 %>
|
||||
transfer_errors_message(true);
|
||||
<%- else %>
|
||||
<% flash.each do |type, message| %>
|
||||
$("#flash_message").html("<div class=\"alert alert-success\"> <%= message.html_safe %></div>")
|
||||
<% end %>
|
||||
<% flash.clear %>
|
||||
transfer_errors_message(false);
|
||||
$("#email_admin").val('');
|
||||
$("button#cancel").click();
|
||||
<%- end %>
|
Loading…
Add table
Add a link
Reference in a new issue