Thank you. This post has been successfully flagged as inappropriate. If warranted, appropriate action will be taken
Thank you. This comment has been successfully flagged as inappropriate. If warranted, appropriate action will be taken

Sign up | login
docpid


Post

Like Button in Template File



{% if documentpreference.value == 1 %}
<span id="image1"><img src="{% static 'images/Like-button-clicked.png' %}" style="width: 16px; height:16px;" class="likebutton clickable"></span> <span id="postlikecount">{{eachdocument.likes}}</span>
{% else %}
<span id="image1"><img src="{% static 'images/Like-button.png' %}" style="width: 16px; height:16px;" class="likebutton clickable"></span> <span id="postlikecount">{{eachdocument.likes}}</span>
{% endif %}
{% if documentpreference.value == 2 %}
   |   <span id="image2"><img src="{% static 'images/Dislike-button-clicked.png' %}" style="width: 16px; height:16px;" class="dislikebutton clickable" data-imgid="dislike1"></span> <span id="postdislikecount">{{eachdocument.dislikes}}</span>
{% else %}
|   <span id="image2"><img src="{% static 'images/Dislike-button.png' %}" style="width: 16px; height:16px;" class="dislikebutton clickable" data-imgid="dislike2"></span> <span id="postdislikecount">{{eachdocument.dislikes}}</span>
{% endif %}
 



Tags of Post: Like, dislike, button, template file, django, python

Author: dlhylton

Published on May 6, 2018

630 views

Report Post

Unwanted commercial content or spam
Sexually explicit material
Hate speech or graphic violence
Harrassment or bullying


|

Are you sure you want to delete this post?





|
1 follower
1 | 0

0 comments



Comment








Title Successfully Changed
The tags have been successfully changed
Post Successfully Edited
Comment Edited Successfully
Comment Posted Successfully
The comment has been successfully deleted




Home | Posts | Documents | Users | Public Pages | Contact