mirror of
https://github.com/tiyn/container-critique.git
synced 2025-04-03 00:27:48 +02:00
fonts: set fonts
This commit is contained in:
parent
d2ad7b3125
commit
a6e1735cac
@ -14,6 +14,9 @@ def rating_to_star(rating):
|
|||||||
string: unicode-formatted star-rating string.
|
string: unicode-formatted star-rating string.
|
||||||
"""
|
"""
|
||||||
res = u"\u272D"*int(rating/20)
|
res = u"\u272D"*int(rating/20)
|
||||||
|
length = len(res)
|
||||||
if rating/20 % 1 >= 0.5:
|
if rating/20 % 1 >= 0.5:
|
||||||
res += u"\u00BD"
|
length += 1
|
||||||
|
res += u" \u2BE8 "
|
||||||
|
res += (u"\u2606" * (5 - length))
|
||||||
return res
|
return res
|
||||||
|
@ -85,8 +85,9 @@ class Database:
|
|||||||
crs.execute(query)
|
crs.execute(query)
|
||||||
query = "CREATE TABLE IF NOT EXISTS " + self.ITEM_TABLE_FILE + \
|
query = "CREATE TABLE IF NOT EXISTS " + self.ITEM_TABLE_FILE + \
|
||||||
"(id INTEGER PRIMARY KEY AUTOINCREMENT," + \
|
"(id INTEGER PRIMARY KEY AUTOINCREMENT," + \
|
||||||
|
"name CHAR(32) NOT NULL," + \
|
||||||
"date CHAR(4)," + \
|
"date CHAR(4)," + \
|
||||||
"name CHAR(32) NOT NULL UNIQUE)"
|
"UNIQUE(date, name))"
|
||||||
crs.execute(query)
|
crs.execute(query)
|
||||||
query = "CREATE TABLE IF NOT EXISTS " + self.ENTRY_TABLE_FILE + \
|
query = "CREATE TABLE IF NOT EXISTS " + self.ENTRY_TABLE_FILE + \
|
||||||
"(id INTEGER PRIMARY KEY AUTOINCREMENT," + \
|
"(id INTEGER PRIMARY KEY AUTOINCREMENT," + \
|
||||||
@ -118,8 +119,8 @@ class Database:
|
|||||||
"(`name`,`date`)" + "VALUES (?, ?)"
|
"(`name`,`date`)" + "VALUES (?, ?)"
|
||||||
crs.execute(query, (name, date))
|
crs.execute(query, (name, date))
|
||||||
query = "SELECT id FROM " + self.ITEM_TABLE_FILE + \
|
query = "SELECT id FROM " + self.ITEM_TABLE_FILE + \
|
||||||
" WHERE name = ?"
|
" WHERE name = ? AND date = ?"
|
||||||
crs.execute(query, (name, ))
|
crs.execute(query, (name, date))
|
||||||
item_id = crs.fetchone()[0]
|
item_id = crs.fetchone()[0]
|
||||||
reviewed = dt.today().strftime('%Y-%m-%d')
|
reviewed = dt.today().strftime('%Y-%m-%d')
|
||||||
query = "INSERT INTO " + self.ENTRY_TABLE_FILE + \
|
query = "INSERT INTO " + self.ENTRY_TABLE_FILE + \
|
||||||
@ -209,7 +210,7 @@ class Database:
|
|||||||
return user
|
return user
|
||||||
|
|
||||||
def db_to_item(self, ident, name, date):
|
def db_to_item(self, ident, name, date):
|
||||||
item = Item(date, name)
|
item = Item(name, date)
|
||||||
item.set_id(ident)
|
item.set_id(ident)
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
@ -3,6 +3,20 @@
|
|||||||
--transtime: 0.7s;
|
--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;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@ -38,7 +52,7 @@ body {
|
|||||||
|
|
||||||
body,
|
body,
|
||||||
html {
|
html {
|
||||||
font-family: sans-serif;
|
font-family: LocalSans, sans-serif;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
@ -83,7 +97,7 @@ span {
|
|||||||
|
|
||||||
.main-menu-dropdown span {
|
.main-menu-dropdown span {
|
||||||
float: left;
|
float: left;
|
||||||
font-family: monospace;
|
font-family: LocalMono, monospace;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 100px;
|
line-height: 100px;
|
||||||
@ -152,7 +166,7 @@ span {
|
|||||||
|
|
||||||
.main-menu {
|
.main-menu {
|
||||||
float: right;
|
float: right;
|
||||||
font-family: monospace;
|
font-family: LocalMono, monospace;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 100px;
|
line-height: 100px;
|
||||||
|
BIN
src/static/fonts/jetbrainsmono-medium.woff2
Normal file
BIN
src/static/fonts/jetbrainsmono-medium.woff2
Normal file
Binary file not shown.
BIN
src/static/fonts/linux_libertine.woff2
Normal file
BIN
src/static/fonts/linux_libertine.woff2
Normal file
Binary file not shown.
@ -4,14 +4,14 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="archive">
|
<div class="archive">
|
||||||
<h1>Archive</h1><br>
|
<h1>Archive</h1><br>
|
||||||
{% 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 -%}
|
{% 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 -%}
|
||||||
</li>
|
</li>
|
||||||
{% set ns.open_li = False -%}
|
{% set ns.open_li = False -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% if entry.item.date != ns.last_year -%}
|
{% if entry.item.date != ns.prev_item_date -%}
|
||||||
{% if ns.last_year != "" -%}
|
{% if ns.prev_item_date != "" -%}
|
||||||
</ul>
|
</ul>
|
||||||
{% set ns.open_ul = False -%}
|
{% set ns.open_ul = False -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
@ -19,21 +19,18 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{% set ns.open_ul = True -%}
|
{% set ns.open_ul = True -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% if ns.last_name == entry.item.name and ns.last_year == entry.item.date -%}
|
{% if ns.prev_item_id == entry.item.id -%}
|
||||||
<br>
|
<br>
|
||||||
<a href="{{ url_for('entry', ident=entry.id) }}">
|
|
||||||
{{ r_to_star(entry.rating) }} by {{ entry.user.name }}
|
|
||||||
</a>
|
|
||||||
{% else -%}
|
{% else -%}
|
||||||
<li>
|
<li>
|
||||||
{{ entry.item.name }}<br>
|
{{ entry.item.name }}<br>
|
||||||
<a href="{{ url_for('entry', ident=entry.id) }}">
|
|
||||||
{{ r_to_star(entry.rating) }} by {{ entry.user.name }}
|
|
||||||
</a>
|
|
||||||
{% set ns.open_li = True -%}
|
{% set ns.open_li = True -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% set ns.last_year = entry.item.date -%}
|
<a href="{{ url_for('entry', ident=entry.id) }}">
|
||||||
{% set ns.last_name = entry.item.name -%}
|
{{ entry.reviewed }} {{ r_to_star(entry.rating) }} by {{ entry.user.name }}
|
||||||
|
</a>
|
||||||
|
{% set ns.prev_item_date = entry.item.date -%}
|
||||||
|
{% set ns.prev_item_id = entry.item.id -%}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
{% if ns.open_li -%}
|
{% if ns.open_li -%}
|
||||||
</li>
|
</li>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{% extends "template.html" -%}
|
{% extends "template.html" -%}
|
||||||
|
|
||||||
{% block content -%}
|
{% block content -%}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="important">
|
<div class="important">
|
||||||
Error<br>
|
Error<br>
|
||||||
<span>{{ errorcode }}</span>
|
<span>{{ errorcode }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
{% extends "template.html" -%}
|
{% extends "template.html" -%}
|
||||||
|
|
||||||
{% block content -%}
|
{% block content -%}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="blog">
|
<div class="blog">
|
||||||
<h1>Blog</h1><br>
|
<h1>Blog</h1><br>
|
||||||
{% for entry in entries -%}
|
{% for entry in entries -%}
|
||||||
<div class="entry">
|
<div class="entry">
|
||||||
<h1 id="{{ entry.id }}">
|
<h1 id="{{ entry.id }}">
|
||||||
<a href="{{ url_for('entry', ident=entry.id) }}">
|
<a href="{{ url_for('entry', ident=entry.id) }}">
|
||||||
{{ entry.item.name }} ({{ entry.item.date }}) {{ r_to_star(entry.rating) }}
|
{{ entry.item.name }} ({{ entry.item.date }}) {{ r_to_star(entry.rating) }}
|
||||||
</a>
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
<small>
|
<small>
|
||||||
rated {{ entry.rating }}/100 by
|
rated {{ entry.rating }}/100 by
|
||||||
<a href="{{ url_for('user', name=entry.user.name) }}">
|
<a href="{{ url_for('user', name=entry.user.name) }}">
|
||||||
{{ entry.user.name }}
|
{{ entry.user.name }}
|
||||||
</a>
|
</a> on {{ entry.reviewed }}
|
||||||
</small><br>
|
</small><br>
|
||||||
{% autoescape off -%}
|
{% autoescape off -%}
|
||||||
{{ entry.text }}
|
{{ entry.text }}
|
||||||
{% endautoescape -%}
|
{% endautoescape -%}
|
||||||
</div><br>
|
</div><br>
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
{% extends "template.html" -%}
|
{% extends "template.html" -%}
|
||||||
|
|
||||||
{% block content -%}
|
{% block content -%}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="logging">
|
<div class="logging">
|
||||||
<h1>Sign In</h1>
|
<h1>Sign In</h1>
|
||||||
<form action="" method="post" novalidate>
|
<form action="" method="post" novalidate>
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<p>
|
<p>
|
||||||
{{ form.username.label }}<br>
|
{{ form.username.label }}<br>
|
||||||
{{ form.username(size=32) }}
|
{{ form.username(size=32) }}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{{ form.password.label }}<br>
|
{{ form.password.label }}<br>
|
||||||
{{ form.password(size=32) }}
|
{{ form.password(size=32) }}
|
||||||
</p>
|
</p>
|
||||||
<p>{{ form.submit() }}</p>
|
<p>{{ form.submit() }}</p>
|
||||||
{% for mesg in get_flashed_messages() -%}
|
{% for mesg in get_flashed_messages() -%}
|
||||||
<p>{{ mesg }}</p>
|
<p>{{ mesg }}</p>
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
{% extends "template.html" -%}
|
{% extends "template.html" -%}
|
||||||
|
|
||||||
{% block content -%}
|
{% block content -%}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="logging">
|
<div class="logging">
|
||||||
<h1>Register</h1>
|
<h1>Register</h1>
|
||||||
<form action="" method="post" novalidate>
|
<form action="" method="post" novalidate>
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<p>
|
<p>
|
||||||
{{ form.username.label }}<br>
|
{{ form.username.label }}<br>
|
||||||
{{ form.username(size=32) }}
|
{{ form.username(size=32) }}
|
||||||
{% for error in form.username.errors -%}
|
{% for error in form.username.errors -%}
|
||||||
<span style="color: red;">[{{ error }}]</span>
|
<span style="color: red;">[{{ error }}]</span>
|
||||||
|
{% endfor -%}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{ form.password.label }}<br>
|
||||||
|
{{ form.password(size=32) }}
|
||||||
|
{% for error in form.password.errors -%}
|
||||||
|
<span style="color: red;">[{{ error }}]</span>
|
||||||
|
{% endfor -%}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{ form.password2.label }}<br>
|
||||||
|
{{ form.password2(size=32) }}
|
||||||
|
{% for error in form.password2.errors -%}
|
||||||
|
<span style="color: red;">[{{ error }}]</span>
|
||||||
|
{% endfor -%}
|
||||||
|
</p>
|
||||||
|
<p>{{ form.submit() }}</p>
|
||||||
|
{% for mesg in get_flashed_messages() -%}
|
||||||
|
<p>{{ mesg }}</p>
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
</p>
|
</form>
|
||||||
<p>
|
</div>
|
||||||
{{ form.password.label }}<br>
|
|
||||||
{{ form.password(size=32) }}
|
|
||||||
{% for error in form.password.errors -%}
|
|
||||||
<span style="color: red;">[{{ error }}]</span>
|
|
||||||
{% endfor -%}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
{{ form.password2.label }}<br>
|
|
||||||
{{ form.password2(size=32) }}
|
|
||||||
{% for error in form.password2.errors -%}
|
|
||||||
<span style="color: red;">[{{ error }}]</span>
|
|
||||||
{% endfor -%}
|
|
||||||
</p>
|
|
||||||
<p>{{ form.submit() }}</p>
|
|
||||||
{% for mesg in get_flashed_messages() -%}
|
|
||||||
<p>{{ mesg }}</p>
|
|
||||||
{% endfor -%}
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
{% extends "template.html" -%}
|
{% extends "template.html" -%}
|
||||||
|
|
||||||
{% block content -%}
|
{% block content -%}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="standalone">
|
<div class="standalone">
|
||||||
<h1>
|
<h1>
|
||||||
{{ entry.item.name }} ({{ entry.item.date }})
|
{{ entry.item.name }} ({{ entry.item.date }})
|
||||||
{{ r_to_star(entry.rating) }}
|
{{ r_to_star(entry.rating) }}
|
||||||
</h1>
|
</h1>
|
||||||
<small>
|
<small>
|
||||||
rated {{ entry.rating }}/100 by
|
rated {{ entry.rating }}/100 by
|
||||||
<a href="{{ url_for('user', name=entry.user.name) }}">
|
<a href="{{ url_for('user', name=entry.user.name) }}">
|
||||||
{{ entry.user.name }}
|
{{ entry.user.name }}
|
||||||
</a>
|
</a>
|
||||||
on
|
on
|
||||||
<a href="{{ url_for('index', _anchor=entry.id) }}">
|
<a href="{{ url_for('index', _anchor=entry.id) }}">
|
||||||
{{ entry.reviewed }}
|
{{ entry.reviewed }}
|
||||||
</a>
|
</a>
|
||||||
</small><br>
|
</small><br>
|
||||||
{% if current_user.id == entry.user.id -%}
|
{% if current_user.id == entry.user.id -%}
|
||||||
<small>
|
<small>
|
||||||
[
|
[
|
||||||
<a href="{{ url_for('delete_entry', ident=entry.id) }}">
|
<a href="{{ url_for('delete_entry', ident=entry.id) }}">
|
||||||
delete entry
|
delete entry
|
||||||
</a>
|
</a>
|
||||||
]
|
]
|
||||||
</small><br>
|
</small><br>
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% autoescape off -%}
|
{% autoescape off -%}
|
||||||
{{ entry.text }}
|
{{ entry.text }}
|
||||||
{% endautoescape -%}<br>
|
{% endautoescape -%}<br>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
|
@ -4,26 +4,40 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="archive">
|
<div class="archive">
|
||||||
<h1>User: {{ name }}</h1><br>
|
<h1>User: {{ name }}</h1><br>
|
||||||
{% set ns = namespace(last_year="") -%}
|
{% set ns = namespace(prev_item_date="", prev_item_id=None, open_li = False, open_ul = False) -%}
|
||||||
{% for entry in entries -%}
|
{% for entry in entries -%}
|
||||||
{% if entry.item.date != ns.last_year -%}
|
{% if ns.prev_item_id != entry.item.id and ns.prev_item_id != None -%}
|
||||||
{% if ns.last_year != "" -%}
|
</li>
|
||||||
</ul>
|
{% set ns.open_li = False -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
<h2> {{ entry.item.date }} </h2>
|
{% if entry.item.date != ns.prev_item_date -%}
|
||||||
<ul>
|
{% if ns.prev_item_date != "" -%}
|
||||||
{% endif -%}
|
</ul>
|
||||||
{% set ns.last_year = entry.item.date -%}
|
{% set ns.open_ul = False -%}
|
||||||
<li>
|
{% endif -%}
|
||||||
{{ entry.item.name }}
|
<h2> {{ entry.item.date }} </h2>
|
||||||
<a href="{{ url_for('entry', ident=entry.id) }}">
|
<ul>
|
||||||
{{ r_to_star(entry.rating) }} by {{ entry.user.name }}
|
{% set ns.open_ul = True -%}
|
||||||
</a>
|
{% endif -%}
|
||||||
</li><br>
|
{% if ns.prev_item_id == entry.item.id -%}
|
||||||
{% endfor -%}
|
<br>
|
||||||
{% autoescape off -%}
|
{% else -%}
|
||||||
{{ content_string }}
|
<li>
|
||||||
{% endautoescape -%}
|
{{ entry.item.name }}<br>
|
||||||
|
{% set ns.open_li = True -%}
|
||||||
|
{% endif -%}
|
||||||
|
<a href="{{ url_for('entry', ident=entry.id) }}">
|
||||||
|
{{ entry.reviewed }} {{ r_to_star(entry.rating) }}
|
||||||
|
</a>
|
||||||
|
{% set ns.prev_item_date = entry.item.date -%}
|
||||||
|
{% set ns.prev_item_id = entry.item.id -%}
|
||||||
|
{% endfor -%}
|
||||||
|
{% if ns.open_li -%}
|
||||||
|
</li>
|
||||||
|
{% endif -%}
|
||||||
|
{% if ns.open_ul -%}
|
||||||
|
</ul>
|
||||||
|
{% endif -%}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock -%}
|
{% endblock -%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user