add some fontawesome icons

This commit is contained in:
lza_menace 2022-09-04 22:32:12 -07:00
parent 08050e56c6
commit f93bd618ad
12 changed files with 47 additions and 0 deletions

View file

@ -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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -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>

View file

@ -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">