unsure whether interface should look like this
@ -5,6 +5,7 @@ import csv
|
||||
import os
|
||||
|
||||
script_dir = os.path.dirname(__file__)
|
||||
image_dir = os.path.abspath(os.path.join(script_dir, "../static/images"))
|
||||
|
||||
|
||||
def parsecsv():
|
||||
@ -23,17 +24,27 @@ def getpublications():
|
||||
year = row["Year"]
|
||||
if not year:
|
||||
year = "Unknown"
|
||||
|
||||
pubinfo = {
|
||||
"Title": row["Publication"],
|
||||
"Author": row["Author"],
|
||||
"Type": row["Type"].lower().title(),
|
||||
"Year": year,
|
||||
"License": row["LicenseShort"].lower().title(),
|
||||
"Image": hasimage(row["Id"])
|
||||
}
|
||||
publications[row["Id"]] = pubinfo
|
||||
return publications
|
||||
|
||||
|
||||
def hasimage(id):
|
||||
image_file = os.path.join(image_dir, "image-{0}.jpg".format(id))
|
||||
if os.path.exists(image_file):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def gettypes():
|
||||
libcsv = open(os.path.join(script_dir, "varlib.csv"), "r")
|
||||
with libcsv:
|
||||
|
@ -9,6 +9,10 @@
|
||||
background-color: #62b264;
|
||||
}
|
||||
|
||||
#leftmostbtn{
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block;
|
||||
}
|
||||
|
@ -6,10 +6,8 @@ html, body {
|
||||
body:after {
|
||||
font-size: .8em;
|
||||
background-color: #EB4377;
|
||||
/*color: rgba(223, 183, 180, .3);*/
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
bottom: 1em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@ -30,7 +28,7 @@ body:after {
|
||||
|
||||
#varia {
|
||||
line-height: 1.03em;
|
||||
position: absolute;
|
||||
position: relative;
|
||||
top: 10%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
@ -40,19 +38,37 @@ body:after {
|
||||
text-align: center;
|
||||
font-family: alphaClouds;
|
||||
mix-blend-mode: exclusion;
|
||||
margin: 30px 0;
|
||||
}
|
||||
|
||||
@supports (-webkit-text-stroke: 1px lightpink) {
|
||||
#varia {
|
||||
-webkit-text-stroke: 1px lightpink;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
margin 0 auto;
|
||||
}
|
||||
|
||||
#leftmostbtn{
|
||||
margin-left: 1em;
|
||||
#bookshelf {
|
||||
max-width: 90%;
|
||||
margin-top: 3em;
|
||||
display: block;
|
||||
columns: 30rem;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
#bookshelf > div {
|
||||
width: 100%;
|
||||
break-inside: avoid;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
#bookshelf > div > a {
|
||||
color: black;
|
||||
}
|
||||
|
||||
button {
|
||||
z-index: 10;
|
||||
border: 3px solid black;
|
||||
@ -70,9 +86,11 @@ table {
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
tr {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
td {
|
||||
margin:0;
|
||||
padding: 0.5em;
|
||||
@ -81,3 +99,10 @@ td {
|
||||
border: 1px solid black;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
.tdimage {
|
||||
padding: 0
|
||||
}
|
||||
.tdimage > img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
BIN
library/static/images/image-11.jpg
Normal file
After Width: | Height: | Size: 129 KiB |
BIN
library/static/images/image-16.jpg
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
library/static/images/image-2.jpg
Normal file
After Width: | Height: | Size: 108 KiB |
BIN
library/static/images/image-22.jpg
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
library/static/images/image-42.jpg
Normal file
After Width: | Height: | Size: 134 KiB |
BIN
library/static/images/image-5.jpg
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
library/static/images/image-60.jpg
Normal file
After Width: | Height: | Size: 130 KiB |
BIN
library/static/images/image-7.jpg
Normal file
After Width: | Height: | Size: 133 KiB |
BIN
library/static/images/image-8.jpg
Normal file
After Width: | Height: | Size: 117 KiB |
@ -4,12 +4,32 @@
|
||||
<div id="nav" class="container">
|
||||
{% include 'menu.html' %}
|
||||
</div>
|
||||
<div id="main">
|
||||
<ul>
|
||||
<div id="bookshelf">
|
||||
{% for id, pubinfo in publications.items() %}
|
||||
<li class='filter {{ pubinfo["Type"] }} {{ pubinfo["Year"] }} {{ pubinfo["License"] }}'><a href='{{ id }}'>{{ pubinfo["Author"] }} - {{ pubinfo["Title"] }}</a></li>
|
||||
<div class='book filter {{ pubinfo["Type"] }} {{ pubinfo["Year"] }} {{ pubinfo["License"] }}'>
|
||||
<a href='{{ id }}'>
|
||||
<table>
|
||||
<tbody>
|
||||
{%if pubinfo["Image"]%}
|
||||
<tr>
|
||||
<td colspan="2" class="tdimage">
|
||||
<img src="{{ url_for('static', filename='images/image-{0}.jpg'.format(id))}}" alt="">
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>Author/Editor</td>
|
||||
<td>{{ pubinfo["Author"] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Title</td>
|
||||
<td>{{ pubinfo["Title"] }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</a>
|
||||
</div>
|
||||
{% endfor%}
|
||||
</ul>
|
||||
</div>
|
||||
<script src="{{ url_for('static', filename='js/dropdown.js')}}"></script>
|
||||
{% endblock %}
|
||||
|