add some fontawesome icons

migrate-new-models
lza_menace 2 years ago
parent 08050e56c6
commit f93bd618ad

@ -61,6 +61,24 @@ class Post(Model):
approved = BooleanField(default=False)
approved_by = ForeignKeyField(User, null=True)
def get_random(self):
all_posts = Post.select().where(Post.approved == True)
return choice([i.id for i in all_posts])
def get_previous(self):
prev = Post.select().where(Post.id == self.id - 1).first()
if prev and prev.approved:
return prev.id
else:
return None
def get_next(self):
next = Post.select().where(Post.id == self.id + 1).first()
if next and next.approved:
return next.id
else:
return None
def get_image_path(self, thumbnail=False):
save_path_base = path.join(config.DATA_FOLDER, "uploads")
if thumbnail:

File diff suppressed because one or more lines are too long

@ -47,6 +47,7 @@
<meta name="msapplication-TileColor" content="#da532c">
<meta name="keywords" content="wownero, wow, memes, monero, xmr, cryptocurrency">
<link href="/static/css/bulma.min.css" rel="stylesheet">
<link href="/static/css/font-awesome.all.min.css" rel="stylesheet">
<link href="/static/css/custom.css" rel="stylesheet">
<title>SuchWow!</title>
</head>

@ -12,6 +12,28 @@
<li class="is-active"><a href="#" aria-current="page">Post {{ post.id }}</a></li>
</ul>
</nav>
<div class="tabs is-fullwidth">
<ul>
<li>
<a {% if post.get_previous() %}href="{{ url_for('post.read', id=post.get_previous()) }}"{% else %}class="disabled"{% endif %}>
<span class="icon"><i class="fas fa-angle-left" aria-hidden="true"></i></span>
<span>Previous</span>
</a>
</li>
<li>
<a href="{{ url_for('post.read', id=post.get_random()) }}">
<span class="icon"><i class="fas fa-question" aria-hidden="true"></i></span>
<span>Random</span>
</a>
</li>
<li>
<a {% if post.get_next() %}href="{{ url_for('post.read', id=post.get_next()) }}"{% else %}class="disabled"{% endif %}>
<span>Next</span>
<span class="icon"><i class="fas fa-angle-right" aria-hidden="true"></i></span>
</a>
</li>
</ul>
</div>
<!-- Post Info -->
<section class="section">
<div class="content">

Loading…
Cancel
Save