Add move operation for documents plugin
This commit is contained in:
parent
3fb3fa409b
commit
3a4519757e
10 changed files with 41 additions and 0 deletions
|
|
@ -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'
|
||||
|
|
|
|||
12
plugins/documents/app/views/documents/_move.html.haml
Normal file
12
plugins/documents/app/views/documents/_move.html.haml
Normal 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'}
|
||||
2
plugins/documents/app/views/documents/move.js.haml
Normal file
2
plugins/documents/app/views/documents/move.js.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$('#modalContainer').html('#{j(render("move"))}');
|
||||
$('#modalContainer').modal();
|
||||
Loading…
Add table
Add a link
Reference in a new issue