fixes
This commit is contained in:
parent
b40d5a2ee4
commit
7b90fc2f3a
5 changed files with 22 additions and 7 deletions
|
@ -58,8 +58,7 @@ article {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title,
|
.inline {
|
||||||
.title_full {
|
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ Licensed under the AGPL-3.0-or-later. See LICENSE for details.
|
||||||
<article>
|
<article>
|
||||||
<form id="form" action="/log_in" method="post">
|
<form id="form" action="/log_in" method="post">
|
||||||
<label for="textInput">Create your user:</label>
|
<label for="textInput">Create your user:</label>
|
||||||
<input id="title_input" type="text" name="username" required>
|
<input class="inline" type="text" name="username" required>
|
||||||
<input id="title_input" type="text" name="password" required>
|
<input class="inline" type="password" name="password" required>
|
||||||
<input type="submit" value="Create Account / Log In">
|
<input type="submit" value="Create Account / Log In">
|
||||||
</form>
|
</form>
|
||||||
</article>
|
</article>
|
||||||
|
|
|
@ -27,7 +27,8 @@ Licensed under the AGPL-3.0-or-later. See LICENSE for details.
|
||||||
{% for post_id, title, user_id, description in posts %}
|
{% for post_id, title, user_id, description in posts %}
|
||||||
<a href="/view?post={{ post_id }}">
|
<a href="/view?post={{ post_id }}">
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<h3 class="title">{{ title }}</h3>
|
<h3 class="inline">{{ title }}</h3>
|
||||||
|
<p class="inline"> by {{ user_id }}</p>
|
||||||
<p class="description">{{ description }}</p>
|
<p class="description">{{ description }}</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -25,8 +25,8 @@ Licensed under the AGPL-3.0-or-later. See LICENSE for details.
|
||||||
</header>
|
</header>
|
||||||
<article>
|
<article>
|
||||||
<div class="post">
|
<div class="post">
|
||||||
<h3 class="title_full">{{ title }}</h3>
|
<h3 class="inline">{{ title }}</h3>
|
||||||
<p class="title_full"> by {{ user }}</p>
|
<p class="inline"> by {{ user }}</p>
|
||||||
<p class="description_full">{{ description }}</p>
|
<p class="description_full">{{ description }}</p>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
15
src/wsgi.py
15
src/wsgi.py
|
@ -40,6 +40,21 @@ def index():
|
||||||
status = "Log In"
|
status = "Log In"
|
||||||
else:
|
else:
|
||||||
status = "Log Out"
|
status = "Log Out"
|
||||||
|
for i in range(len(posts)):
|
||||||
|
cursor.execute(
|
||||||
|
"""
|
||||||
|
SELECT users.username
|
||||||
|
FROM posts
|
||||||
|
JOIN users ON posts.user_id = users.id
|
||||||
|
WHERE posts.id = ?
|
||||||
|
""",
|
||||||
|
(posts[i][2],),
|
||||||
|
)
|
||||||
|
|
||||||
|
username = cursor.fetchone()
|
||||||
|
if not username:
|
||||||
|
username = ("Unknown",)
|
||||||
|
posts[i] = (posts[i][0], posts[i][1], username[0], posts[i][3])
|
||||||
return render_template("index.html", posts=posts, status=status)
|
return render_template("index.html", posts=posts, status=status)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue