Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MJU-POPS
ckanext-dgu
Commits
b1f99e34
Commit
b1f99e34
authored
Feb 29, 2016
by
Ross Jones
Browse files
Update comments on the show page
parent
35130425
Changes
2
Hide whitespace changes
Inline
Side-by-side
ckanext/dgu/theme/src/scripts/dgu-issues.js
View file @
b1f99e34
$
(
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
'
)
...
...
ckanext/dgu/theme/templates/issues/show.html
View file @
b1f99e34
...
...
@@ -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}}
·
<span
class=
"comment_count"
>
{{ ungettext('{number} comment', '{number} comments', comment_count).format(number=comment_count) }}
</span>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment