diff --git a/src/content.py b/src/content.py index f77bbaf..fc586e6 100644 --- a/src/content.py +++ b/src/content.py @@ -14,6 +14,9 @@ def rating_to_star(rating): string: unicode-formatted star-rating string. """ res = u"\u272D"*int(rating/20) + length = len(res) if rating/20 % 1 >= 0.5: - res += u"\u00BD" + length += 1 + res += u" \u2BE8 " + res += (u"\u2606" * (5 - length)) return res diff --git a/src/database.py b/src/database.py index 89bb19e..ea472ef 100644 --- a/src/database.py +++ b/src/database.py @@ -85,8 +85,9 @@ class Database: crs.execute(query) query = "CREATE TABLE IF NOT EXISTS " + self.ITEM_TABLE_FILE + \ "(id INTEGER PRIMARY KEY AUTOINCREMENT," + \ + "name CHAR(32) NOT NULL," + \ "date CHAR(4)," + \ - "name CHAR(32) NOT NULL UNIQUE)" + "UNIQUE(date, name))" crs.execute(query) query = "CREATE TABLE IF NOT EXISTS " + self.ENTRY_TABLE_FILE + \ "(id INTEGER PRIMARY KEY AUTOINCREMENT," + \ @@ -118,8 +119,8 @@ class Database: "(`name`,`date`)" + "VALUES (?, ?)" crs.execute(query, (name, date)) query = "SELECT id FROM " + self.ITEM_TABLE_FILE + \ - " WHERE name = ?" - crs.execute(query, (name, )) + " WHERE name = ? AND date = ?" + crs.execute(query, (name, date)) item_id = crs.fetchone()[0] reviewed = dt.today().strftime('%Y-%m-%d') query = "INSERT INTO " + self.ENTRY_TABLE_FILE + \ @@ -209,7 +210,7 @@ class Database: return user def db_to_item(self, ident, name, date): - item = Item(date, name) + item = Item(name, date) item.set_id(ident) return item diff --git a/src/static/css/style.css b/src/static/css/style.css index a74c4a4..a8d7c83 100644 --- a/src/static/css/style.css +++ b/src/static/css/style.css @@ -3,6 +3,20 @@ --transtime: 0.7s; } + + +@font-face{ + font-family: "LocalMono"; + src: url("/static/fonts/jetbrainsmono-medium.woff2") format("woff2"); +} + +@font-face { + font-family: "LocalSans"; + font-style: normal; + font-weight: 400; + src: url("/static/fonts/linux_libertine.woff2") format("woff2"); +} + * { margin: 0; padding: 0; @@ -38,7 +52,7 @@ body { body, html { - font-family: sans-serif; + font-family: LocalSans, sans-serif; height: 100%; max-width: 100%; overflow-x: hidden; @@ -83,7 +97,7 @@ span { .main-menu-dropdown span { float: left; - font-family: monospace; + font-family: LocalMono, monospace; font-size: 30px; font-weight: bold; line-height: 100px; @@ -152,7 +166,7 @@ span { .main-menu { float: right; - font-family: monospace; + font-family: LocalMono, monospace; font-size: 30px; font-weight: bold; line-height: 100px; diff --git a/src/static/fonts/jetbrainsmono-medium.woff2 b/src/static/fonts/jetbrainsmono-medium.woff2 new file mode 100644 index 0000000..484c9e6 Binary files /dev/null and b/src/static/fonts/jetbrainsmono-medium.woff2 differ diff --git a/src/static/fonts/linux_libertine.woff2 b/src/static/fonts/linux_libertine.woff2 new file mode 100644 index 0000000..4356db1 Binary files /dev/null and b/src/static/fonts/linux_libertine.woff2 differ diff --git a/src/templates/archive.html b/src/templates/archive.html index 00929e3..5662f07 100644 --- a/src/templates/archive.html +++ b/src/templates/archive.html @@ -4,14 +4,14 @@

Archive


- {% set ns = namespace(last_year="", last_name="", open_li = False, open_ul = False) -%} + {% set ns = namespace(prev_item_date="", prev_item_id=None, open_li = False, open_ul = False) -%} {% for entry in entries -%} - {% if ns.last_name != entry.item.name and ns.last_name != "" -%} + {% if ns.prev_item_id != entry.item.id and ns.prev_item_id != None -%} {% set ns.open_li = False -%} {% endif -%} - {% if entry.item.date != ns.last_year -%} - {% if ns.last_year != "" -%} + {% if entry.item.date != ns.prev_item_date -%} + {% if ns.prev_item_date != "" -%} {% set ns.open_ul = False -%} {% endif -%} @@ -19,21 +19,18 @@ - {% endif -%} -

{{ entry.item.date }}

- + {% set ns.open_ul = False -%} + {% endif -%} +

{{ entry.item.date }}

+ + {% endif -%}
{% endblock -%}