Commit 96d9aa98 authored by Okhin's avatar Okhin

Fixing the JS and the templates toget rid of django_und, and refresh the display value

parent 8dc0468e
Pipeline #2681 passed with stages
in 3 minutes and 41 seconds
......@@ -103,16 +103,13 @@
<td>{{article.lang}}</td>
<td class="title-cell"><a target="_blank" href="{{article.url}}"><strong>{{article.title}}</strong></a></td>
<td>
{% if filter_view == "published" %}
{{article.und_score}}
{% else %}
<span id="score_{{article.id}}">{{article.score}}</span>
{% if filter_view != "published" %}
<ul class="votes-list">
<li class="actions-item" onclick="javascript:call_upvote({{article.id}})">
<span id="count_up_{{article.id}}">{{article.und_score_up}}</span>
<i class="fa fa-thumbs-up" aria-hidden="true" style="color:green"></i>
</li>
<li class="actions-item" onclick="javascript:call_downvote({{article.id}})">
<span id="count_down_{{article.id}}">{{article.und_score_down}}</span>
<i class="fa fa-thumbs-down" aria-hidden="true" style="color:red"></i>
</li>
</ul>
......
......@@ -30,13 +30,13 @@ $(function () {
window.call_upvote = function(id) {
$.post("/api/articles/" + id + "/upvote/", function response(data) {
$("#count_up_" + id).text(data.und_score_up);
$("#score_" + id).text(data.score);
});
}
window.call_downvote = function(id) {
$.post("/api/articles/" + id + "/downvote/", function response(data) {
$("#count_down_" + id).text(data.und_score_down);
$("#score_" + id).text(data.score);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment