Browse Source

fixed small issue in vanilla js filter idea

master
crunk 3 years ago
parent
commit
0e9506e326
  1. 2
      library/csvparser/csvparser.py
  2. 4
      library/static/js/script.js
  3. 4
      library/templates/menu.html

2
library/csvparser/csvparser.py

@ -26,7 +26,7 @@ def getpublications():
pubinfo = {
"Title": row["Publication"],
"Author": row["Author"],
"Type": row["Type"],
"Type": row["Type"].lower(),
"Year": year,
}
publications[row["Id"]] = pubinfo

4
library/static/js/script.js

@ -26,8 +26,8 @@ function update() {
filterSelection("all")
function filterSelection(c) {
var x, i;
allpublications = document.getElementsByClassName("filter");
var i;
var allpublications = document.getElementsByClassName("filter");
if (c == "all") {
for (i = 0; i < allpublications.length; i++) {
addClass(allpublications[i], "show");

4
library/templates/menu.html

@ -1,6 +1,6 @@
{% block menu %}
<a href="/"><button>All books</button></a>
<a href="/upload"><button>Upload</button></a>
<button onclick="filterSelection('all')">All books</button>
<button><a href="/upload">Upload</a></button>
<div class="dropdown">
<button class="dropbtn">Type</button>
<div class="dropdown-content">

Loading…
Cancel
Save