1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-04 13:43:48 +00:00

Revert "Revert "Moving away from matchups_array and saving matches individually""

This reverts commit 7b3fe2aaad.
This commit is contained in:
2015-04-25 21:44:08 -04:00
parent 7b3fe2aaad
commit b86211102b
6 changed files with 67 additions and 11 deletions

View File

@@ -9,5 +9,11 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/1.10.6/js/jquery.dataTables.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.map"></script>
<!-- File saver does more than excel exports but that is currently what we are using it for -->
<script src="https://rawgithub.com/eligrey/FileSaver.js/master/FileSaver.js" type="text/javascript"></script>
<style>
</style>

View File

@@ -3,11 +3,26 @@
#html, #body, #wrapper { width:100%; }
</style>
<script src="https://rawgithub.com/eligrey/FileSaver.js/master/FileSaver.js" type="text/javascript"></script>
<script>
function exportDataToRtf() {
var blob = new Blob([document.getElementById("exportable").innerHTML], {
type: "application/octet-stream"
});
saveAs(blob, "brackets.rtf");
}
</script>
<%= link_to "Back to #{@tournament.name} weights", "/static_pages/weights?tournament=#{@tournament.id}" %>
<br>
<br>
<button type="submit" class="btn btn-primary" onclick="exportDataToRtf()">Export to file for printing</button>
<!--[if lte IE 9]>
<div>Excel export does not work on IE versions lower than 10. Please use chrome or update IE.</div>
<!--<![endif]-->
<br>
<br>
<div id="exportable">
<% @tournament.weights.sort_by{|w| w.max}.each do |w| %>
<div class="pagebreak">
<% @weight = w %>
@@ -32,4 +47,5 @@
<%= render 'fourPoolSemiBracket' %>
<% end %>
</div>
<% end %>
<% end %>
</div>