|
45 | 45 | {% block inner_content %} |
46 | 46 | <div id="toolbar-holder" style="display: none;"> |
47 | 47 | <div class="btn-group pull-left" data-toggle="buttons"> |
48 | | - <label class="btn btn-default active btn-responsive"> |
| 48 | + <label id="completed" class="btn btn-default btn-responsive"> |
49 | 49 | <input type="radio" name="show_state" autocomplete="off" value="Completed" checked> {{ _("Completed") }} |
50 | 50 | </label> |
51 | | - <label class="btn btn-default btn-responsive"> |
| 51 | + <label id="placed" class="btn btn-default btn-responsive"> |
52 | 52 | <input type="radio" name="show_state" autocomplete="off" value="Placed"> {{ _("Placed") }} |
53 | 53 | </label> |
54 | | - <label class="btn btn-default btn-responsive"> |
| 54 | + <label id="pending" class="btn btn-default btn-responsive"> |
55 | 55 | <input type="radio" name="show_state" autocomplete="off" value="Pending"> {{ _("Pending") }} |
56 | 56 | </label> |
57 | | - <label class="btn btn-default btn-responsive"> |
| 57 | + <label id="expired" class="btn btn-default btn-responsive"> |
58 | 58 | <input type="radio" name="show_state" autocomplete="off" value="Expired"> {{ _("Expired") }} |
59 | 59 | </label> |
60 | | - <label class="btn btn-default btn-responsive"> |
| 60 | + <label id="cancelled" class="btn btn-default btn-responsive"> |
61 | 61 | <input type="radio" name="show_state" autocomplete="off" value="Cancelled"> {{ _("Cancelled") }} |
62 | 62 | </label> |
63 | | - <label class="btn btn-default btn-responsive"> |
| 63 | + <label id="checked-in" class="btn btn-default btn-responsive"> |
64 | 64 | <input type="radio" name="show_state" autocomplete="off" value="checked_in"> {{ _("Checked In") }} |
65 | 65 | </label> |
66 | | - <label class="btn btn-default btn-responsive"> |
| 66 | + <label id="not-checked-in" class="btn btn-default btn-responsive"> |
67 | 67 | <input type="radio" name="show_state" autocomplete="off" |
68 | 68 | value="not_checked_in"> {{ _("Not Checked In") }} |
69 | 69 | </label> |
70 | | - <label class="btn btn-default btn-responsive"> |
| 70 | + <label id="all" class="btn btn-default btn-responsive"> |
71 | 71 | <input type="radio" name="show_state" autocomplete="off" value="all"> {{ _("All") }} |
72 | 72 | </label> |
73 | 73 |
|
@@ -169,7 +169,7 @@ <h3>{{ _("View Attendees") }}</h3> |
169 | 169 | <script src="{{ url_for('static', filename='vendor/datatables.net/js/jquery.dataTables.min.js') }}"></script> |
170 | 170 | <script src="{{ url_for('static', filename='vendor/datatables.net-bs/js/dataTables.bootstrap.min.js') }}"></script> |
171 | 171 | <script type="text/javascript"> |
172 | | - |
| 172 | + var options = ['#completed', '#placed', '#pending', '#expired', '#cancelled', '#all']; |
173 | 173 | $.fn.dataTable.ext.search.push( |
174 | 174 | function (settings, data, dataIndex) { |
175 | 175 | var user_option = $("input[name=show_state]:checked").val(); |
@@ -203,11 +203,20 @@ <h3>{{ _("View Attendees") }}</h3> |
203 | 203 | "order": [[1, 'asc']], |
204 | 204 | "scrollX": true |
205 | 205 | }); |
206 | | - |
207 | | - $("div.toolbar").prepend($("#toolbar-holder").html()); |
208 | | - |
| 206 | + if ($.inArray(window.location.hash, options) != -1) |
| 207 | + { |
| 208 | + $(window.location.hash).button('toggle'); |
| 209 | + $("div.toolbar").prepend($("#toolbar-holder").html()); |
| 210 | + } |
| 211 | + else |
| 212 | + { |
| 213 | + $('#Completed').button('toggle'); |
| 214 | + $("div.toolbar").prepend($("#toolbar-holder").html()); |
| 215 | + } |
209 | 216 | $("input[name=show_state]").change(function () { |
210 | 217 | table.draw(); |
| 218 | + window.location.hash = $("input[name=show_state]:checked").val(); |
| 219 | + |
211 | 220 | }); |
212 | 221 |
|
213 | 222 | table.on('draw', function () { |
|
0 commit comments