Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 26 additions & 31 deletions website/templates/issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,54 +156,49 @@ <h4>Screenshot:</h4><hr>
</a>
<hr>
</div>
{% if object.get_ocr %}
<div class="col-lg-12">
<h4>OCR Results:</h4><hr>
<div class="alert alert-info">{{object.get_ocr}}</div><hr>
</div>
{% endif %}
</div>

<form id="comments_form" method="post" action="{% url 'comments.views.AddComment' pk=issue.pk %}">
{% csrf_token %}

<div class="form-group">
<textarea placeholder="Comment" class="form-control" name="text_comment" ></textarea> <br>
</div>
<button class="btn btn-small" type="submit" >Add Comment</button>
<br><br>
<textarea placeholder="Comment" class="form-control" name="text_comment" ></textarea>
</div>
<button class="btn btn-small" type="submit">Add Comment</button>
</form>

{% if all_comment %}
<h3>Comments:</h3>


{% for comment in all_comment %}
<hr>
<div class="comment">
<div class="date">{{ comment.created_date }}</div>
<strong><a href="{{ comment.author_url }}">{{ comment.author }}</a></strong>
<p>{{ comment.text|linebreaks }} </p>

{% if user.username == comment.author %}
<!-- Edit BUtton -->
<form class="form-inline" style="display:inline-block;" id="edit_form" method="post" action="{% url 'comments.views.EditCommentPage' pk=comment.pk %}">
{% csrf_token %}
<button class="btn btn-small" style="position:absolute;left:75%;" type="submit" >Edit</button>
</form>
<!--Edit button -->

<!-- Delete Button -->
<form class="form-inline" style="display:inline-block;" id="delete_form" method="post" action="{% url 'comments.views.DeleteComment' pk=comment.pk %}">
{% csrf_token %}
<button class="btn btn-small btn-danger" style="position:absolute;left:80%;" type="submit" >Delete</button>
</form>
<!-- Delete Button -->

{% else %}
<br><br>

{% endif %}

</div>
<div style="display: inline-flex;">
<div class="date">{{ comment.created_date }}</div>
{% if user.username == comment.author %}
<form class="form-inline" id="edit_form" method="post" action="{% url 'comments.views.EditCommentPage' pk=comment.pk %}">
{% csrf_token %}
<button class="btn btn-xs btn-primary" type="submit">Edit</button>
</form>
<form class="form-inline" id="delete_form" method="post" action="{% url 'comments.views.DeleteComment' pk=comment.pk %}">
{% csrf_token %}
<button class="btn btn-xs btn-danger" type="submit">Delete</button>
</form>
{% endif %}
</div>
<div>
<strong><a href="{{ comment.author_url }}">{{ comment.author }}</a></strong>
<p>{{ comment.text|linebreaks }}</p>
</div>
</div>
{% empty %}
{% endfor %}
{% endif %}

{% endblock %}