black autoformatting

This commit is contained in:
crunk 2023-12-01 15:58:33 +01:00
parent 452bf73b84
commit 4a2e6f76ca
5 changed files with 17 additions and 10 deletions

View File

@ -140,7 +140,6 @@ class CsvParser:
fieldsofinterest[row["Id"]] = fields fieldsofinterest[row["Id"]] = fields
return fieldsofinterest return fieldsofinterest
def getfullpublication(self, pubid): def getfullpublication(self, pubid):
"""For the single book view, most complete overview""" """For the single book view, most complete overview"""
libcsv = open(os.path.join(DATA_DIR, self.csv_file), "r") libcsv = open(os.path.join(DATA_DIR, self.csv_file), "r")

View File

@ -1,8 +1,13 @@
"""Form object declaration.""" """Form object declaration."""
from flask_wtf import FlaskForm from flask_wtf import FlaskForm
from flask_wtf.file import FileAllowed, FileField from flask_wtf.file import FileAllowed, FileField
from wtforms import (IntegerField, RadioField, StringField, SubmitField, from wtforms import (
validators) IntegerField,
RadioField,
StringField,
SubmitField,
validators,
)
from wtforms.validators import Length, NumberRange from wtforms.validators import Length, NumberRange
@ -33,7 +38,7 @@ class PublicationForm(FlaskForm):
year = IntegerField( year = IntegerField(
"Year:", "Year:",
[validators.InputRequired(), NumberRange(min=0, max=2050)], [validators.InputRequired(), NumberRange(min=0, max=2050)],
default=2023 default=2023,
) )
fields = StringField("Fields:") fields = StringField("Fields:")
type = StringField( type = StringField(

View File

@ -28,6 +28,7 @@ csvparser = CsvParser(
APP.config["LIBRARY_FILENAME"], APP.config["IMAGE_FOLDER"] APP.config["LIBRARY_FILENAME"], APP.config["IMAGE_FOLDER"]
) )
@APP.route("/") @APP.route("/")
def index(): def index():
"""Main route, shows all the books and you can filter them """Main route, shows all the books and you can filter them

View File

@ -1,6 +1,7 @@
html, body { html, body {
margin: 0; margin: 0;
font-family: libreBaskerville, serif; font-family: "libreBaskerville";
font-style: normal;
background-repeat: no-repeat; background-repeat: no-repeat;
background-attachment: fixed; background-attachment: fixed;
} }
@ -23,7 +24,7 @@ body:after {
@font-face { @font-face {
font-family: libreBaskerville; font-family: "libreBaskerville";
src: url(../fonts/LibreBaskerville-Regular.otf); src: url(../fonts/LibreBaskerville-Regular.otf);
} }
@ -137,6 +138,7 @@ table {
background-color: #f1f1f1; background-color: #f1f1f1;
border-spacing: 0; border-spacing: 0;
} }
tbody:hover {background-color: #ddd;}
tr { tr {
margin: 0; margin: 0;

View File

@ -1,8 +1,8 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block main %} {% block main %}
<div id="nav" class="container"> <nav id="nav" class="container">
{% include 'menu.html' %} {% include 'menu.html' %}
</div> </nav>
<div id="bookshelf"> <div id="bookshelf">
{% for id, pubinfo in publications.items() %} {% for id, pubinfo in publications.items() %}
<div id="{{ id }}" class='book filter {{ pubinfo["Type"] }} {{ pubinfo["Year"] }} {{ pubinfo["License"] }}'> <div id="{{ id }}" class='book filter {{ pubinfo["Type"] }} {{ pubinfo["Year"] }} {{ pubinfo["License"] }}'>
@ -17,11 +17,11 @@
</tr> </tr>
{% endif %} {% endif %}
<tr> <tr>
<td>Author/Editor</td> <td class="author">Author/Editor:</td>
<td>{{ pubinfo["Author"] }}</td> <td>{{ pubinfo["Author"] }}</td>
</tr> </tr>
<tr> <tr>
<td>Title</td> <td class="title">Title:</td>
<td>{{ pubinfo["Title"] }}</td> <td>{{ pubinfo["Title"] }}</td>
</tr> </tr>
</tbody> </tbody>