44 lines
2.7 KiB
HTML
44 lines
2.7 KiB
HTML
{% extends 'layout.html' %}
|
|
{% block content %}
|
|
<div class="container">
|
|
<div class="row">
|
|
{% for post in posts %}
|
|
<div class="card" style="word-wrap: brea-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 post.edited %}<i>(Edited)</i>{% endif %}
|
|
<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|lower == post.poster|lower %}
|
|
<a href="/editpost/{{ post._id }}" class="btn btn-primary btn-sm"><i class="far fa-edit"></i></a>
|
|
{% endif %}
|
|
{% if logged_in|lower == post.poster|lower %}
|
|
<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 class="card" style="word-wrap: break-word; margin-bottom: 16px; width: 100%;">
|
|
<div class="card-header">Replying to <b>{{ reply_to.poster }}</b> at {{ reply_to.timePosted.strftime('%Y-%m-%d %-H:%M') }} {% if reply_to.edited %}<i>(Edited)</i>{% endif %}</div>
|
|
<div class="card-body">
|
|
{{ reply_to.content }}
|
|
</div>
|
|
<div class="card-footer">
|
|
<form method="POST" action="/reply/{{ reply_to._id }}" class="input-group">
|
|
<input type="text" name="status" style="margin-right: 16px;" class="form-control" value="@{{ reply_to.poster }} " autofocus onfocus="var temp_value=this.value; this.value=''; this.value=temp_value"/>
|
|
<input type="submit" class="btn btn-primary" value="Do Post" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|