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:
@@ -16,11 +16,12 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Modal Dialog Box, jquery used to show / set content -->
|
||||||
<div id="dbox" class="modal fade" tabindex="-1" role="dialog">
|
<div id="dbox" class="modal fade" tabindex="-1" role="dialog">
|
||||||
<div class="modal-dialog mw-100 w-75">
|
<div class="modal-dialog mw-100 w-100">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 id="dbox-title" class="modal-title">Add / Remove Books to / from Loan</h5>
|
<h5 id="dbox-title" class="modal-title"></h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -28,23 +29,6 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div id="dbox-content" class="row">
|
<div id="dbox-content" class="row">
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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')
|
$('#dbox').modal('show')
|
||||||
$.post( "/books_for_loan/" + {{loan_id}}, function(data) {$('#bfl-existing').html(data) } );
|
$.post( "/books_for_loan/" + {{loan_id}}, function(data) {$('#bfl-existing').html(data) } );
|
||||||
}
|
}
|
||||||
@@ -95,5 +114,5 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% if not InDBox %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user