survey/app/views/admin/surveys/index.html.erb

52 lines
1.3 KiB
Plaintext
Raw Normal View History

2014-10-06 05:55:25 +00:00
<%= render_filter @filter_fields, "index_table" %>
<span id="index_table">
<%= render 'index'%>
</span>
2017-04-11 06:10:01 +00:00
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<div id="downloadModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="downloadModalLabel" aria-hidden="true">
<div class="modal-header">
<h3 id="downloadModalLabel">Download</h3>
</div>
<div class="modal-body">
<p id="wait-zone" style="text-align: center;">
Please wait while we prepare your download. This may take a while.
<br />
<img src="/assets/spin.gif" />
</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
<script type="text/javascript">
var downloadModal = $("#downloadModal");
$(document).on("click", ".export-xls", function(){
var link = $(this).attr("href");
$.ajax({
url : link,
type : "get",
dataType : "json"
}).done(function(data){
})
checkForThread();
downloadModal.modal("show");
return false;
})
var checkForThread = function(){
$.ajax({
url : "/admin/surveys/checkforthread",
type : "get",
dataType : "json"
}).done(function(data){
console.log("Status : " + data.status);
if(!data.status){
checkForThread();
}
})
}
</script>