-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.html
31 lines (25 loc) · 1.17 KB
/
home.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{% extends "layout.html" %}
{% block content %}
{% for post in posts %}
{% if post.author != current_user and post.author.id in subs%}
<article class="media content-section">
<img class="rounded-circle article-img" src="{{ url_for('static', filename='profile_pics/' + post.author.image_file) }}">
<div class="media-body">
<div class="article-metadata">
<a class="mr-2" href="{{ url_for('user_posts', username=post.author.username) }}">{{ post.author.username }}</a>
<small class="text-muted">{{ post.date_posted.strftime('%Y-%m-%d') }}</small>
</div>
<h2><a class="article-title" href="{{ url_for('post', post_id=post.id) }}">{{ post.title }}</a></h2>
{% if post.image_file%}
<p class="article-content more">
<img class="post-img" src="{{ url_for('static', filename='post_pics/' + post.image_file) }}">
{{ post.content }}
</p>
{% else %}
<p class="article-content more">{{ post.content }}</p>
{% endif %}
</div>
</article>
{% endif %}
{% endfor %}
{% endblock %}