diff --git a/flaskr/__init__.py b/flaskr/__init__.py index 5a93cc4..089524d 100644 --- a/flaskr/__init__.py +++ b/flaskr/__init__.py @@ -17,7 +17,7 @@ def optimize_css(): static_dir = root + '/undercover/flaskr/static/' css = open(static_dir + 'styles.css', 'r').read() minified_with_comments = "".join(list(map( - lambda line: line if 'media' in line else line.replace(' ', ''), + lambda line: line if 'media' in line or 'padding' in line or 'transition' in line else line.replace(' ', ''), css.split('\n') ))) minified = re.sub( r'/\*[\s\S]*?\*/', "", minified_with_comments) diff --git a/flaskr/db.py b/flaskr/db.py index b33c6ae..82a6e17 100644 --- a/flaskr/db.py +++ b/flaskr/db.py @@ -1,6 +1,6 @@ import bcrypt import os -import psycopg2 +import psycopg from dataclasses import dataclass @@ -25,7 +25,7 @@ class UserWithHash: def connect(): - return psycopg2.connect( + return psycopg.connect( host=os.environ['UNDERCOVER_POSTGRES_HOST'], dbname=os.environ['UNDERCOVER_POSTGRES_DBNAME'], port=os.environ['UNDERCOVER_POSTGRES_PORT'], @@ -90,8 +90,8 @@ def edit_letter(letter_id: int, letter_title: str, letter_content: str): def get_user_letters(user_id: int) -> [Letter]: with connect() as con: cur = con.cursor() - cur.execute("SELECT id, letter_name, letter_data FROM letter_data WHERE user_id = %s", str(user_id)) - return map(lambda row: Letter(row[0], row[1], row[2]), cur.fetchall()) + cur.execute("SELECT id, letter_name, letter_data FROM letter_data WHERE user_id = %s", (str(user_id),)) + return list(map(lambda row: Letter(row[0], row[1], row[2]), cur.fetchall())) def get_user(email: str) -> User: diff --git a/flaskr/static/styles.css b/flaskr/static/styles.css index aec1a20..7d2b8e2 100644 --- a/flaskr/static/styles.css +++ b/flaskr/static/styles.css @@ -11,17 +11,20 @@ body { font-family: sans; } +h1, h2 { + text-align: center; +} + /* Small screens */ @media only screen and (max-width: 1080px) { body { - width: 95vw; - font-size: 200%; + width: 85vw; } h1 { - font-size: 400%; + font-size: 300%; } h2 { - font-size: 300%; + font-size: 200%; line-height: 100%; margin-top: 0; margin-bottom: 0.5em; diff --git a/flaskr/templates/writing.html b/flaskr/templates/writing.html index d81909e..4de21dd 100644 --- a/flaskr/templates/writing.html +++ b/flaskr/templates/writing.html @@ -1,9 +1,10 @@ +
- + + -