Commit 6223798a authored by Baptiste Mouterde's avatar Baptiste Mouterde Committed by ikoalaz
Browse files

comment : add no js support, fix div/span issue, add the missing div that screws up the validator

parent 02509671
# -*- coding: utf-8 -*-
<%page args='id,package_version_id,comment=None,filename=""'/>
<span id='comments${id}'>
<%page args='id,package_version_id,comment=None,filename="",nojs=False'/>
<div id='comments${id}'>
%if not nojs:
<script type="text/javascript">
$(document).ready(function () {
highlight(null);
$(".idlink").click(function (event) {
......@@ -23,36 +23,38 @@
});
});
</script>
%endif
%if comment is not None:
<%include file='./comment.mako' args='id=id,comment=comment,main_page=True'/>
</span>
</div>
%else:
%if not hasattr(c,'comments'):
<span>no Comments yet,
<div>no Comments yet,
%else:
<span>
<div>
%endif
%if 'user_id' in session:
<button class="toggle" id='first.form'>comment!</button> </span>
<button class="toggle" id='first.form'>comment!</button> </div>
%endif
%if hasattr(c,'comments'):
%for comment in c.comments:
<%include file='./comment.mako' args='id=id,comment=comment'/>
%endfor
%endif
</span>
</div>
%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>
%if not nojs:
<script type="text/javascript">
$(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}');
comment_form(${id}, '${h.url(controller='comments', action='ajax_call')}', "${h.url(controller='comments',action='reload_comments')}",${package_version_id}, '${filename}', '')
})
</script>
%endif
%endif
</div>
%endif
Supports Markdown
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