29 lines
1.7 KiB
HTML
29 lines
1.7 KiB
HTML
{% extends 'layout.html' %}
|
|
{% block nav_timeline %} active {% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container">
|
|
<div class="row">
|
|
{% for post in posts if not post.hidden %}
|
|
<div class="card mx-xs-2 mb-3" style="word-wrap: break-word; width: 100%;">
|
|
<div class="card-header"><b>{{ post.poster }}</b> at {{ post.timePosted.strftime('%Y-%m-%d %-H:%M') }}
|
|
<span style="float: right">
|
|
{% if logged_in|lower in post.likes %}
|
|
<form style="display: inline;" method="POST" action="/unlike/{{ post._id }}"><button type="submit" class="btn btn-danger btn-sm"><i class="fas fa-heart"></i> {{ post.likes|count }}</button></form>
|
|
{% else %}
|
|
<form style="display: inline;" method="POST" action="/like/{{ post._id }}"><button type="submit" class="btn btn-outline-danger btn-sm"><i class="fas fa-heart"></i> {{ post.likes|count }}</button></form>
|
|
{% endif %}
|
|
<a href="/reply/{{ post._id }}" class="btn btn-primary btn-sm"><i class="far fa-reply"></i></a>
|
|
{% if logged_in == post.poster %}
|
|
<a href="/delete/{{ post._id }}" class="btn btn-danger btn-sm"><i class="far fa-trash-alt"></i></a>
|
|
{% endif %}
|
|
</span>
|
|
</div>
|
|
<div class="card-body">
|
|
{{ post.content }}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|