Make the unibar clickable
This commit is contained in:
parent
6f84d8f4ae
commit
6a8a0c40e6
3 changed files with 64 additions and 12 deletions
|
@ -239,7 +239,9 @@ svg text {
|
|||
width:100%
|
||||
}
|
||||
|
||||
|
||||
.unibar a {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.Added,.unplayed,.Unplayed {
|
||||
background-color:var(--unplayed-color)!important;
|
||||
|
|
37
library.py
37
library.py
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
import cardstring,gamesort,skeleton
|
||||
import cardstring,gamesort,skeleton,variables
|
||||
|
||||
"""
|
||||
Generates library page
|
||||
|
@ -17,15 +17,40 @@ def library(local=False):
|
|||
filewrite = open(output, "a")
|
||||
filewrite.write(" <section id=\"library-top\" class=\"library\">\n <div>\n <div class=\"unibar\">\n <div>\n <span>Total Found</span> " + str(gamesort.total(gamesort.games)) + "\n </div>\n")
|
||||
if gamesort.unplayed(gamesort.games) > 0:
|
||||
filewrite.write(" <div class=\"unplayed\" style=\"flex: " + str(gamesort.unplayed(gamesort.games)) + " 1 0%;\">" + str(gamesort.unplayed(gamesort.games)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"unplayed\" style=\"flex: " + str(gamesort.unplayed(gamesort.games)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/all-unplayed/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/all-unplayed")
|
||||
filewrite.write("\">" + str(gamesort.unplayed(gamesort.games)) + "</a></div>\n")
|
||||
if gamesort.unfinished(gamesort.games) > 0:
|
||||
filewrite.write(" <div class=\"unfinished\" style=\"flex: " + str(gamesort.unfinished(gamesort.games)) + " 1 0%;\">" + str(gamesort.unfinished(gamesort.games)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"unfinished\" style=\"flex: " + str(gamesort.unfinished(gamesort.games)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/all-unfinished/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/all-unfinished")
|
||||
filewrite.write("\">" + str(gamesort.unfinished(gamesort.games)) + "</a></div>\n")
|
||||
if gamesort.beaten(gamesort.games) > 0:
|
||||
filewrite.write(" <div class=\"beaten\" style=\"flex: " + str(gamesort.beaten(gamesort.games)) + " 1 0%;\">" + str(gamesort.beaten(gamesort.games)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"beaten\" style=\"flex: " + str(gamesort.beaten(gamesort.games)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/all-beaten/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/all-beaten")
|
||||
filewrite.write("\">" + str(gamesort.beaten(gamesort.games)) + "</a></div>\n")
|
||||
if gamesort.completed(gamesort.games) > 0:
|
||||
filewrite.write(" <div class=\"completed\" style=\"flex: " + str(gamesort.completed(gamesort.games)) + " 1 0%;\">" + str(gamesort.completed(gamesort.games)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"completed\" style=\"flex: " + str(gamesort.completed(gamesort.games)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/all-completed/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/all-completed")
|
||||
filewrite.write("\">" + str(gamesort.completed(gamesort.games)) + "</a></div>\n")
|
||||
if gamesort.endless(gamesort.games) > 0:
|
||||
filewrite.write(" <div class=\"endless\" style=\"flex: " + str(gamesort.endless(gamesort.games)) + " 1 0%;\">" + str(gamesort.endless(gamesort.games)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"endless\" style=\"flex: " + str(gamesort.endless(gamesort.games)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/all-endless/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/all-endless")
|
||||
filewrite.write("\">" + str(gamesort.endless(gamesort.games)) + "</a></div>\n")
|
||||
filewrite.write(" </div>\n <div class=\"library-list sorted\">\n")
|
||||
|
||||
newgames = sorted(gamesort.games,key=lambda d: d["id"])
|
||||
|
|
|
@ -128,15 +128,40 @@ def sublibrary(local=False):
|
|||
filewrite.write("\">1 Status<span class=\"filter_clear\">x</span></a></span>\n")
|
||||
filewrite.write(" </div>\n</div> <div class=\"unibar\">\n <div>\n <span>Total Found</span> " + str(gamesort.total(filterlist)) + "\n </div>\n")
|
||||
if gamesort.unplayed(filterlist) > 0:
|
||||
filewrite.write(" <div class=\"unplayed\" style=\"flex: " + str(gamesort.unplayed(filterlist)) + " 1 0%;\">" + str(gamesort.unplayed(filterlist)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"unplayed\" style=\"flex: " + str(gamesort.unplayed(filterlist)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/" + console["shortname"].lower() + "-unplayed/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/" + console["shortname"].lower() + "-unplayed")
|
||||
filewrite.write("\">" + str(gamesort.unplayed(filterlist)) + "</a></div>\n")
|
||||
if gamesort.unfinished(filterlist) > 0:
|
||||
filewrite.write(" <div class=\"unfinished\" style=\"flex: " + str(gamesort.unfinished(filterlist)) + " 1 0%;\">" + str(gamesort.unfinished(filterlist)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"unfinished\" style=\"flex: " + str(gamesort.unfinished(filterlist)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/" + console["shortname"].lower() + "-unfinished/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/" + console["shortname"].lower() + "-unfinished")
|
||||
filewrite.write("\">" + str(gamesort.unfinished(filterlist)) + "</a></div>\n")
|
||||
if gamesort.beaten(filterlist) > 0:
|
||||
filewrite.write(" <div class=\"beaten\" style=\"flex: " + str(gamesort.beaten(filterlist)) + " 1 0%;\">" + str(gamesort.beaten(filterlist)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"beaten\" style=\"flex: " + str(gamesort.beaten(filterlist)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/" + console["shortname"].lower() + "-beaten/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/" + console["shortname"].lower() + "-beaten")
|
||||
filewrite.write("\">" + str(gamesort.beaten(filterlist)) + "</a></div>\n")
|
||||
if gamesort.completed(filterlist) > 0:
|
||||
filewrite.write(" <div class=\"completed\" style=\"flex: " + str(gamesort.completed(filterlist)) + " 1 0%;\">" + str(gamesort.completed(filterlist)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"completed\" style=\"flex: " + str(gamesort.completed(filterlist)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/" + console["shortname"].lower() + "-completed/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/" + console["shortname"].lower() + "-completed")
|
||||
filewrite.write("\">" + str(gamesort.completed(filterlist)) + "</a></div>\n")
|
||||
if gamesort.endless(filterlist) > 0:
|
||||
filewrite.write(" <div class=\"endless\" style=\"flex: " + str(gamesort.endless(filterlist)) + " 1 0%;\">" + str(gamesort.endless(filterlist)) + "</div>\n")
|
||||
filewrite.write(" <div class=\"endless\" style=\"flex: " + str(gamesort.endless(filterlist)) + " 1 0%;\"><a href=\"")
|
||||
if local:
|
||||
filewrite.write(variables.localpath + "build/library/" + console["shortname"].lower() + "-endless/index.html")
|
||||
else:
|
||||
filewrite.write(variables.serverpath + "library/" + console["shortname"].lower() + "-endless")
|
||||
filewrite.write("\">" + str(gamesort.endless(filterlist)) + "</a></div>\n")
|
||||
filewrite.write(" </div>\n <div class=\"library-list sorted\">\n")
|
||||
|
||||
newgames = sorted(filterlist,key=lambda d: d["id"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue