<!-- articlapp\detail.html -->
{% extends 'base.html' %}
{% block content %}
<div style="text-align: center; max-width: 700px; margin: 4rem auto">
<h1>
{{ target_article.title }}
</h1>
<h4>
{{ target_article.writer.profile.nickname }}
</h4>
<img style="width:100%; border-radius: 2rem;"
src="{{ target_article.image.url }}" alt="">
<p>
{{ target_article.content }}
</p>
{% if target_article.writer == user %}
<a href="{% url 'articleapp:update' pk=target_article.pk %}" class="btn btn-danger rounded-pill col-3">
Update
</a>
<a href="{% url 'articleapp:delete' pk=target_article.pk %}" class="btn btn-danger rounded-pill col-3">
Delete
</a>
<hr>
{% endif %}
{% for comment in target_article.comment.all %}
{% include 'commentapp/detail.html' with comment=comment %}
{% endfor %}
{% include 'commentapp/create.html' with article=target_article %}
</div>
{% endblock %}
<!-- commentapp\detail.html -->
<div style="border: 1px solid; text-align: left; padding: 4%; margin: 1rem 0; border-radius: 1rem; border-color: #bbb">
<div>
<strong>
{% if comment.writer.profile.nickname %}
{{ comment.writer.profile.nickname }}
{% else %}
No nickname
{% endif %}
</strong>
<!--   : 띄어쓰기 -->
   
{{ comment.created_at }}
</div>
<div style="margin: 1rem 0;">
{{ comment.content }}
</div>
</div>