Navigation bar to show global highlighted on global page
This commit is contained in:
parent
cf1259a311
commit
19aee623b1
3 changed files with 20 additions and 2 deletions
|
@ -95,7 +95,7 @@ def timeline_view():
|
|||
@app.route('/global', methods=['GET'])
|
||||
def global_timeline():
|
||||
logged_in = True if 'username' in session.keys() else False
|
||||
return render_template('timeline.html', logged_in=logged_in, posts=timeline.global_timeline())
|
||||
return render_template('global.html', logged_in=logged_in, posts=timeline.global_timeline())
|
||||
|
||||
|
||||
@app.route('/settings', methods=['GET', 'POST'])
|
||||
|
|
17
templates/global.html
Normal file
17
templates/global.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block nav_global %} active {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{% for post in posts if not post.hidden %}
|
||||
<div class="card" style="word-wrap: break-word; margin-bottom: 16px; width: 100%;">
|
||||
<div class="card-header"><b><a href="/profile/{{ post.poster }}">{{ post.poster }}</a></b> at {{ post.timePosted.strftime('%Y-%m-%d %-H:%M') }} {% if logged_in == post.poster %} <span style="float: right"><a href="/delete/{{ post._id }}" class="btn btn-danger btn-sm"><i class="far fa-trash-alt"></i></a></span>{% endif %}</div>
|
||||
<div class="card-body">
|
||||
{{ post.content }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block nav_timeline %} active {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
|
Loading…
Add table
Reference in a new issue