Add move operation for documents plugin

This commit is contained in:
Patrick Gansterer 2020-03-06 14:30:27 +01:00
parent 3fb3fa409b
commit 3a4519757e
10 changed files with 41 additions and 0 deletions

View file

@ -16,5 +16,6 @@
%td= h show_user(document.created_by)
%td
- if document.created_by == current_user or current_user.role_admin?
= link_to t('ui.move'), document_move_path(document), remote: true, class: 'btn btn-mini'
= link_to t('ui.delete'), document, :method => :delete, :data => {:confirm => t('ui.confirm_delete', name: document.name)},
class: 'btn btn-mini btn-danger'

View file

@ -0,0 +1,12 @@
.modal-header
= close_button :modal
%h3= t('.title')
.modal-body
= link_to t('.root_folder'), document_path(@document, parent_id: nil), method: :patch
- Document.walk_tree do |document, level|
- if document.folder?
%br
= (' ' * 2 * (level + 1)).html_safe
= link_to document.name, document_path(@document, parent_id: document.id), method: :patch
.modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}

View file

@ -0,0 +1,2 @@
$('#modalContainer').html('#{j(render("move"))}');
$('#modalContainer').modal();