Browse Source

MERGER

master
Cristina Cochior 4 years ago
parent
commit
654074d812
  1. 4
      library_julie.py
  2. 46
      templates/layout_julie.html

4
library_julie.py

@ -66,7 +66,7 @@ def home():
# We have our query string nicely serialized as a Python dictionary
args = request.args
# We'll create a string to display the parameters & values
serialized = ", ".join(f"{k}: {v}" for k, v in request.args.items())
# serialized = ", ".join(f"{k}: {v}" for k, v in request.args.items())
# Display the query string to the client in a different format
# return f"(Query) {serialized}", 200
urllibrarian=request.args.getlist('librarian') # new
@ -103,4 +103,4 @@ def test():
print("hallo")
print(listofselecteddocs)
print("hola")
return render_template('test.html')
return render_template('test.html')

46
templates/layout_julie.html

@ -5,11 +5,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Library</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/main-new.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
<!--TEST-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
@ -139,7 +139,7 @@
});
/////DISPLAY FILES/////////////
$(".file-names").click(function(event){
// alert(listofselecteddocs);
// if classname in listselecteddocs, checkbox is checked;
@ -170,9 +170,9 @@
checkboite = "<br /><input type='checkbox' class='addtoprint' id='"+classname+"' name='"+classname+"' value='print' checked><label for='"+classname+"'> Add to print</label>";
} else {
checkboite = "<br /><input type='checkbox' class='addtoprint' id='"+classname+"' name='"+classname+"' value='print'><label for='"+classname+"'> Add to print</label>";
}
}
if ((extension=="jpg") || (extension=="jpeg") || (extension=="png") || (extension=="gif") || (extension=="tiff")) {
$(".name-elements").append("<li><img class='listed-images' src='/files/"+ledocument+"'>"+checkboite+"</li>");
}
@ -203,7 +203,7 @@
var listofselecteddocs = [];
$(document.body).on("click", "input[type='checkbox']", function() {
$(document.body).on("click", "input[type='checkbox']", function() {
var self=$(this);
if(self.is(":checked")){
theid = self.attr("id");
@ -247,9 +247,9 @@ $.ajax({
<body>
<div class="nav-top">
<ul>
<li><a class="nav-button" style="text-align: left;" href="bought">BOUGHT</a></li>
<li><a class="nav-button" style="text-align: center;" href="stolen">STOLEN</a>
<li><a class="nav-button" style="text-align: right;" href="repurposed">REPURPOSED</a>
<li><span class="nav-button" style="text-align: left;" id="bought">BOUGHT</span></li>
<li><span class="nav-button" style="text-align: center;" id="stolen">STOLEN</span>
<li><span class="nav-button" style="text-align: right;" id="repurposed">REPURPOSED</span>
</ul>
</div>
<div class="main">
@ -258,8 +258,7 @@ $.ajax({
<div id="listofpeople">
{% for librarian in librarians %}
<!-- <a href="#" class="librarian-names">{{ librarian }}</a> -->
<span class="librarian-names">{{ librarian }}</span>
<span class="librarian-names" id={{librarian}}>{{librarian}}</span>
{% endfor %}
</div>
@ -313,30 +312,11 @@ $.ajax({
</div>
<div class="nav-bottom">
<ul>
<li><a class="nav-button" style="text-align: left;" href="copied">COPIED</a></li>
<li><a class="nav-button" style="text-align: center;" href="found">FOUND</a></li>
<li><a class="nav-button" style="text-align: right;" href="gift">GIFT</a></li>
<li><span class="nav-button" style="text-align: left;" id="copied">COPIED</span></li>
<li><span class="nav-button" style="text-align: center;" id="found">FOUND</span></li>
<li><span class="nav-button" style="text-align: right;" id="gift">GIFT</span></li>
</ul>
</div>
</body>
</html>
<!--
https://stackoverflow.com/questions/42661249/making-a-checkbox-persistent-on-page-reload
https://stackoverflow.com/questions/1154258/persistence-of-checkbox-values
https://stackoverflow.com/questions/31671918/how-to-persist-checkbox-checked-state-after-page-reload
https://stackoverflow.com/questions/42525002/localstorage-for-checkboxes
https://developer.tizen.org/community/code-snippet/web-code-snippet/how-save-checkbox-status-localstorage
https://www.sitepoint.com/quick-tip-persist-checkbox-checked-state-after-page-reload/
https://stackoverflow.com/questions/40935362/how-to-persist-checkbox-selection-with-page-refresh
-->
Loading…
Cancel
Save