|
|
|
@ -6,17 +6,21 @@ |
|
|
|
|
|
|
|
|
|
|
|
{% block content %} |
|
|
|
{% block content %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="post_padding"> |
|
|
|
|
|
|
|
<h1><a href="{{ post.url }}">{{ post.title }}</a></h1> |
|
|
|
|
|
|
|
<div class="postintro"> |
|
|
|
|
|
|
|
{{ post.date }} - {{ post.author.username }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<img src="{% static 'media/' %}{{ post.image_url }}"/> |
|
|
|
<img src="{% static 'media/' %}{{ post.image_url }}"/> |
|
|
|
|
|
|
|
|
|
|
|
<div class="padding"> |
|
|
|
<div class="post_padding"> |
|
|
|
|
|
|
|
|
|
|
|
<h1><a href="{{ post.url }}">{{ post.title }}</a></h1> |
|
|
|
|
|
|
|
<p class="contentbody"> |
|
|
|
<p class="contentbody"> |
|
|
|
{{ post.body }} |
|
|
|
{{ post.body }} |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<div class="info"> |
|
|
|
|
|
|
|
{{ post.date }} - {{ post.author.username }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<br/> |
|
|
|
<br/> |
|
|
|
|
|
|
|
|
|
|
|
<form action="{% url 'news:comment' post.id %}" method="post"> |
|
|
|
<form action="{% url 'news:comment' post.id %}" method="post"> |
|
|
|
@ -25,7 +29,7 @@ |
|
|
|
<p> |
|
|
|
<p> |
|
|
|
<textarea name="body" rows="8" cols="80"></textarea> |
|
|
|
<textarea name="body" rows="8" cols="80"></textarea> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<input type="submit" value="Submit"> |
|
|
|
<button class="primary_button" type="submit">Submit</button> |
|
|
|
</form> |
|
|
|
</form> |
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript"> |
|
|
|
<script type="text/javascript"> |
|
|
|
@ -40,46 +44,46 @@ |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<br/> |
|
|
|
<br/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Comments --> |
|
|
|
{% for comment in comments %} |
|
|
|
{% for comment in comments %} |
|
|
|
<p> |
|
|
|
|
|
|
|
{% for n in comment.level %}<ul>{% endfor %} |
|
|
|
{% for n in comment.level %}<ul>{% endfor %} |
|
|
|
|
|
|
|
|
|
|
|
<span class="info">{{ comment.author.username }} - {{ comment.date }} - score = {{ comment.score }}</span> |
|
|
|
<span class="info">{{ comment.author.username }} - {{ comment.date }} - score = {{ comment.score }}</span> |
|
|
|
<br/> |
|
|
|
<br/> |
|
|
|
{{ comment.body }} |
|
|
|
{{ comment.body }} |
|
|
|
|
|
|
|
|
|
|
|
<p> |
|
|
|
<div> |
|
|
|
{% if comment.upvoted == False %} |
|
|
|
{% if comment.upvoted == False %} |
|
|
|
<form action="{% url 'news:upvote' comment.id %}" method="post" class="inline"> |
|
|
|
<form action="{% url 'news:upvote' comment.id %}" method="post" class="inline"> |
|
|
|
{% csrf_token %} |
|
|
|
{% csrf_token %} |
|
|
|
<input type="submit" value="+1"> |
|
|
|
<button class="primary_button" type="submit">+1</button> |
|
|
|
</form> |
|
|
|
</form> |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
{% if comment.is_deletable %} |
|
|
|
{% if comment.is_deletable %} |
|
|
|
<form action="{% url 'news:delete_comment' comment.id %}" method="post" class="inline"> |
|
|
|
<form action="{% url 'news:delete_comment' comment.id %}" method="post" class="inline"> |
|
|
|
{% csrf_token %} |
|
|
|
{% csrf_token %} |
|
|
|
<input type="submit" value="delete"> |
|
|
|
<button class="secondary_button" type="submit">delete</button> |
|
|
|
</form> |
|
|
|
</form> |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
<button onclick="myFunction('div_{{ comment.id }}')" class="inline">reply</button> |
|
|
|
<button class="secondary_button inline" onclick="myFunction('div_{{ comment.id }}')">reply</button> |
|
|
|
|
|
|
|
|
|
|
|
<div id="div_{{ comment.id }}" class="inline" style="display:none"> |
|
|
|
<div id="div_{{ comment.id }}" class="inline reply_form" style="display:none"> |
|
|
|
<form action="{% url 'news:comment_with_parent' post.id comment.id %}" method="post"> |
|
|
|
<form action="{% url 'news:comment_with_parent' post.id comment.id %}" method="post"> |
|
|
|
{% csrf_token %} |
|
|
|
{% csrf_token %} |
|
|
|
<textarea name="body" rows="8" cols="80"></textarea> |
|
|
|
<textarea name="body" rows="3" cols="22"></textarea> |
|
|
|
<input type="submit" value="Submit"> |
|
|
|
<button class="primary_button" type="submit">Submit</button> |
|
|
|
</form> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
{% for n in comment.level %}</ul>{% endfor %} |
|
|
|
{% for n in comment.level %}</ul>{% endfor %} |
|
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% endfor %} |
|
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
{% endblock content %} |
|
|
|
{% endblock content %} |
|
|
|
|