Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
990f35ba
Commit
990f35ba
authored
Aug 11, 2012
by
Baptiste Mouterde
Committed by
ikoalaz
Aug 11, 2012
Browse files
comment: add filename as arg, add user check
parent
7584bd55
Changes
1
Hide whitespace changes
Inline
Side-by-side
debexpo/templates/comments/comments.mako
View file @
990f35ba
# -*- coding: utf-8 -*-
<%page args='id,package_version_id,comment=None'/>
<%page args='id,package_version_id,comment=None
,filename=""
'/>
<span id='comments${id}'>
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function () {
highlight(null);
$(".idlink").click(function (event) {
window.location = this;
highlight(event);
});
$("#form").hide();
$(".toggle").click(function () {
var id = "" + this.id;
var to_toggle = id.split('.');
if (to_toggle[1] == 'form') {
$("#related").html(window.getSelection().toString())
$(document).ready(function () {
highlight(null);
$(".idlink").click(function (event) {
window.location = this;
highlight(event);
});
$("#form").hide();
$(".toggle").click(function () {
var id = "" + this.id;
var to_toggle = id.split('.');
if (to_toggle[1] == 'form') {
$("#related").html(window.getSelection().toString())
}
$("#" + to_toggle[1]).show()
}
$("#" + to_toggle[1]).show()
});
});
});
</script>
%if comment is not None:
<%include file='./comment.mako' args='id=id,comment=comment,main_page=True'/>
</script>
%if comment is not None:
<%include file='./comment.mako' args='id=id,comment=comment,main_page=True'/>
</span>
%else:
%if not hasattr(c,'comments'):
<span>no Comments yet,
%else:
%if not hasattr(c,'comments'):
<span>no Comments yet,
%else:
<span>
%endif
%if 'user_id' in session:
<button class="toggle" id='first.form'>comment!</button> </span>
%endif
%if hasattr(c,'comments'):
%for comment in c.comments:
<%include file='./comment.mako' args='id=id,comment=comment'/>
%endfor
%endif
<div id="form${id}">
<%include file='./form.mako' args='id=id,package_version_id=package_version_id'/>
</div>
<span>
%endif
%if 'user_id' in session:
<button class="toggle" id='first.form'>comment!</button> </span>
%endif
%if hasattr(c,'comments'):
%for comment in c.comments:
<%include file='./comment.mako' args='id=id,comment=comment'/>
%endfor
%endif
</span>
%if 'user_id' in session:
<div id="form${id}">
<% print filename %>
<%include file='./form.mako' args='id=id,package_version_id=package_version_id,filename=filename'/>
</div>
<script type="text/javascript">
%if hasattr(c,'fileName') and c.fileName !='':
var filename = '${c.fileName}';
%elif comment is not None :
var filename = '${comment.file}';
%else:
var filename = "";
%endif
$(document).ready(function () {
console.log('loading comment ${id}')
comments(${id}, "${h.url(controller='comments',action='reload_comments')}", '${h.url(controller='comments', action='ajax_call')}', "${h.url(controller='comments',action='score_ajax')}",${package_version_id}, filename);
})
$(document).ready(function () {
console.log('loading comment ${id}')
comments(${id}, "${h.url(controller='comments',action='reload_comments')}", '${h.url(controller='comments', action='ajax_call')}', "${h.url(controller='comments',action='score_ajax')}",${package_version_id}, '${filename}');
})
</script>
%endif
</span>
\ No newline at end of file
%endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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