Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve download button on customform response page #3687

Merged
merged 3 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion esp/public/media/scripts/customforms_response.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ var createGrid=function(form_data){
$j.each(form_data['questions'], function(index, val) {
// Substitute in custom formatter defined above in order to link to uploaded files.
if (val[2] == "file") {
$j("#jqGrid_" + val[0] + " div").prepend("<a title='Bulk Download All Files' href='/customforms/bulkdownloadfiles?form_id="+$j('#form_id').val()+"&question_name="+val[0]+"'><span class='ui-icon ui-icon-circle-arrow-s'></span></a> ");
$j("#download-legend").show();
$j("#jqGrid_" + val[0] + " div").append(" <a title='Bulk Download All Files' href='/customforms/bulkdownloadfiles?form_id="+$j('#form_id').val()+"&question_name="+val[0]+"'><span style='font-size: 14px;' class='glyphicon glyphicon-download-alt'</span></a>");
$j("#jqGrid_" + val[0] + " div a").click(function(e) {
e.stopPropagation();
});
Expand Down
2 changes: 2 additions & 0 deletions esp/templates/customforms/view_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% block fulltitle %}Form responses{% endblock %}

{% block stylesheets %}
{{ block.super }}
<link href="https://ajax.aspnetcdn.com/ajax/jquery.ui/{{ settings.JQUERY_UI_VERSION }}/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" href="/media/styles/jquery-ui/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" href="/media/styles/customforms-responses.css" />
Expand All @@ -24,6 +25,7 @@ <h2>{{form.title}} (ID# {{ form.id }})</h2>
<div id="jqGridPager"></div>
</div>
<br/><br/>
<p id="download-legend" hidden><span style="font-size: 14px;" class="glyphicon glyphicon-download-alt"></span>: Download Files as Zip Folder</p>
<p><a href="/customforms/exceldata/{{form.id}}/">Download as Excel</a></p>
<script type="text/javascript" src="/media/scripts/customforms_response.js"></script>
{% endblock %}
Expand Down