Commit b1f99e34 authored by Ross Jones's avatar Ross Jones
Browse files

Update comments on the show page

parent 35130425
$(function() {
console.log('Looking for an issue')
var spinConfig = {
lines: 9, // The number of lines to draw
length: 5, // The length of each line
......@@ -26,20 +23,33 @@ console.log('Looking for an issue')
if('ISSUE_ID' in window) {
// Get count of comments
$.ajax({
url: '/comment/issue/count/'+window.ISSUE_ID,
data: '',
dataType: 'html',
success: function(data, textStatus, xhr) {
var count = parseInt(data, 10);
var plural = "";
if (count > 1) plural = "s";
$('.comment_count').text(count + " comment" + plural);
},
error: function(xhr, status, exception) {
$('.comment_count').text("");
}
});
var url = '/comment/issue/get/'+window.ISSUE_ID+'?comments_per_page=999999';
console.log("Calling " + url)
$.ajax({
url: url,
data: '',
dataType: 'html',
success: function(data, textStatus, xhr) {
console.log("Success")
commentsSpinner.stop();
$('#issue-comments-container').html(data);
comments();
},
error: function(xhr, status, exception) {
console.log("Fail")
commentsSpinner.stop();
$(spinDiv).hide();
$('#comments .boxed')
......
......@@ -166,7 +166,9 @@ dataset - package object
<i class="icon-exclamation-sign"></i> {{issue.status.title()}}
</span>
{{h.linked_user(issue.user.name)}} opened this issue {{issue.time_ago}} &middot;
<span class="comment_count">
{{ ungettext('{number} comment', '{number} comments', comment_count).format(number=comment_count) }}
</span>
</div>
</div>
......
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