Skip to content

Commit ac745b8

Browse files
authored
Merge pull request #16 from farooq13/feature
improved
2 parents d3c8e47 + f7e8ac3 commit ac745b8

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

base/templates/base/post_component.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77
<a href="{% url 'post-edit' post.id %}"><i class="fa-regular fa-pen-to-square"></i></a>
88
</div>
99
{% endif %}
10-
<h3 class="font-bold"><a href="{% url 'profile' post.author.profile.pk %}">@{{post.author.username}} {{ post.author.name }} </a><span>{{ post.created_on|timesince }}</span></h3>
10+
<div style="vertical-align: middle;">
11+
<img src="{{ post.author.profile.picture.url }}" alt="" style="width: 50px; height: 50px; border-radius: 50px; float:left;">
12+
</div>
13+
<h3 class="font-bold mt-2">
14+
<a href="{% url 'profile' post.author.profile.pk %}" class="space-x-4">@{{post.author.username}} {{ post.author.name }}
15+
</a>
16+
<span>{{ post.created_on|timesince }}</span>
17+
</h3>
18+
<br>
19+
1120
<p><a href="{% url 'post-detail' post.id %}">{{ post.body }}</a></p>
1221
{% if post.image %}
1322
<img src="{{ post.image.url }}" alt="" style="height: 50vh; max-width: 50%; margin-top: 10px; border-radius: 10px;">

base/templates/base/post_detail.html

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<h3 class="font-bold"><a href="{% url 'profile' post.author.pk %}">@{{post.author.username}} {{ post.author.name }} </a><span>{{ post.created_on|timesince }}</span></h3>
3131
</div>
3232
<p class="mt-4"><a href="{% url 'post-detail' post.pk %}">{{ post.body }}</a></p>
33+
{% if post.image %}
34+
<img src="{{ post.image.url }}" alt="" style="height: 50vh;max-width: 50%;border-radius: 10px; margin-top: 10px;">
35+
{% endif %}
3336
<div class="flex flex-row space-x-12 mt-8 mx-6">
3437
<form action="{% url 'post-like' post.pk %}" method="POST">
3538
{% csrf_token %}

0 commit comments

Comments
 (0)