Add export modal and buttons to library and info page

This commit is contained in:
JonnyWong16 2020-08-03 20:55:50 -07:00
parent 621fb95227
commit 43fefcf748
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
5 changed files with 129 additions and 3 deletions

View file

@ -320,6 +320,12 @@ DOCUMENTATION :: END
</div>
<div class="button-bar">
% if _session['user_group'] == 'admin':
<div class="btn-group">
<button class="btn btn-dark export-button" id="toggle-export-modal" data-toggle="modal" data-target="#export-modal"
data-id="${data['section_id']}">
<i class="fa fa-file-export"></i> Export Metadata
</button>
</div>
<div class="btn-group">
<button class="btn btn-dark refresh-export-table-button" id="refresh-export-table">
<i class="fa fa-refresh"></i> Refresh exports
@ -403,6 +409,8 @@ DOCUMENTATION :: END
</div>
</div>
</div>
<div id="export-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="export-modal">
</div>
</%def>
<%def name="javascriptIncludes()">
@ -551,6 +559,18 @@ DOCUMENTATION :: END
});
});
$("#toggle-export-modal").click(function() {
$.ajax({
url: 'export_metadata_modal',
data: { section_id: $(this).data('id') },
cache: false,
async: true,
complete: function(xhr, status) {
$("#export-modal").html(xhr.responseText);
}
});
});
$('#row-edit-mode').on('click', function() {
$('#row-edit-mode-alert').fadeIn(200);