swap order of books in series works - still has debugs, and only works on current series, e.g. if you are in a series in a series, it will need you to manually do the same move in both series - I think I wont fix this bit, but we will see

This commit is contained in:
2020-11-28 17:43:03 +11:00
parent 422db5b6aa
commit ae1aba5e1d
3 changed files with 39 additions and 6 deletions

View File

@@ -1,4 +1,3 @@
<form action="" method="POST">
<table id="book_table" class="table table-striped table-sm small" data-toolbar="#toolbar" data-search="true">
<thead>
<tr class="thead-light"><th>Title</th><th>Book Number</th></tr>
@@ -11,9 +10,21 @@
{% if book.parent_ref|length %}
{% set style="style=visibility:hidden" %}
{% endif %}
<button type="submit" name="move_button" value="up-{{book.id}}" id="up-{{book.id}}" class="btn btn-outline-primary btn-small" {{style}}>
<i class="fas fa-angle-double-up"></i></button>
<button type="submit" name="move_button" value="down-{{book.id}}" id="down-{{book.id}}" class="btn btn-outline-primary btn-small" {{style}}>
<button name="move_button" value="up-{{book.id}}" id="up-{{book.id}}" class="btn btn-outline-primary btn-small" {{style}}
onClick="$.ajax({
type: 'POST', url: '/books_for_series/{{series.id}}',
data: '&id={{series.id}}&move_button=up-{{book.id}}',
success: function(data){
$('#books_for_series_bit').html(data); }
} );">
<i class="fas fa-angle-double-up" ></i></button>
<button name="move_button" value="down-{{book.id}}" id="down-{{book.id}}" class="btn btn-outline-primary btn-small" {{style}}
onClick="$.ajax({
type: 'POST', url: '/books_for_series/{{series.id}}',
data: '&id={{series.id}}&move_button=down-{{book.id}}',
success: function(data){
$('#books_for_series_bit').html(data); }
} );">
<i class="fas fa-angle-double-down"></i></button>
<a href="/book/{{book.id}}">{{book.title}}</a>
</td>
@@ -53,7 +64,6 @@
{% endfor %}
</tbody>
</table>
</form>
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.22/js/dataTables.bootstrap4.min.js"></script>