made DBox empty, and set content for loan specific data in books_for_loan, so DBox can be reused elsewhere, AND, so all content in the DBox for Loan is set in the one html file, not split over to base.html
This commit is contained in:
@@ -20,8 +20,27 @@
|
||||
} )
|
||||
}
|
||||
|
||||
function ShowDBox()
|
||||
function ShowLoanDBox()
|
||||
{
|
||||
$('#dbox-title').html('Add / Remove Books to / from Loan')
|
||||
div=`
|
||||
<div id="bfl-existing" class="col-lg-10 px-0"></div>
|
||||
<div class="col">
|
||||
<button id="bfl-remsel-btn" class="btn btn-danger disabled" disabled onClick="RemoveSelFromLoan()">Remove Selected</button>
|
||||
</div>
|
||||
<div id="bfl-search" class="input-group">
|
||||
<input class="form-control" type="text" id="bfl-search-term" placeholder="title of book(s) to add">
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-primary" onClick="FindNewBFL()">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div id="bfl-new" class="col-lg-10 px-0 py-4"></div>
|
||||
<div class="col py-4">
|
||||
<button id="bfl-addsel-btn" class="btn btn-success disabled" disabled style="display:none" onClick="AddSelToLoan()">Add Selected</button>
|
||||
</div>
|
||||
`
|
||||
$('#dbox-content').html(div)
|
||||
$('#dbox').modal('show')
|
||||
$.post( "/books_for_loan/" + {{loan_id}}, function(data) {$('#bfl-existing').html(data) } );
|
||||
}
|
||||
@@ -95,5 +114,5 @@
|
||||
</table>
|
||||
|
||||
{% if not InDBox %}
|
||||
<button type="button" class="btn btn-primary" onClick="ShowDBox()">Add/Remove Books in Loan</button>
|
||||
<button type="button" class="btn btn-primary" onClick="ShowLoanDBox()">Add/Remove Books in Loan</button>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user