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
ab1f3b30
Commit
ab1f3b30
authored
Aug 13, 2012
by
Baptiste Mouterde
Committed by
ikoalaz
Aug 13, 2012
Browse files
comment: fix indent, fix weird class name, fix debexup/debexdown with form, add link for comments
parent
924da963
Changes
1
Hide whitespace changes
Inline
Side-by-side
debexpo/templates/comments/comment.mako
View file @
ab1f3b30
<%page args='id,comment,main_page=False'/>
<% if comment and hasattr(comment,'index') and not main_page:
margin=20*comment.index
margin_left='style=margin-left:%dpx'%margin
margin_left='style=
"
margin-left:%dpx
"
'%margin
else:
margin_left=''
%>
<% if not hasattr(comment,'anchor') and hasattr(comment,'start'):
setattr(comment,'anchor','l%ss' %comment.start)
if hasattr(comment,'anchor') and comment.package_version.commit_id:
if hasattr(comment,'anchor') and comment.package_version.commit_id:
if comment.file == None :
link=url(controller='source_browser',action='index',packageName=comment.package_version.package.name,revision=comment.package_version.commit_id[:8],fileName="")+'#%s'%comment.anchor
else:
link=url(controller='source_browser',action='index',packageName=comment.package_version.package.name,revision=comment.package_version.commit_id[:8],fileName=comment.file)+'#%s'%comment.anchor
setattr(comment,'anchor',link)
else:
else:
setattr(comment,'anchor','')
%>
<div ${margin_left} class="comment
ment
viewer">
<div ${margin_left
|n
} class="commentviewer">
<fieldset class="${comment.style}">
<legend class='comment
ment
header'>${comment.user.name} : ${comment.time}</legend>
<div class="comment
ment
" id="comment${comment.id}">${comment.text}</div>
<legend class='commentheader
${comment.style}
'>${comment.user.name} : ${
str(
comment.time
)[:19]
}</legend>
<div class="comment" id="comment${
id}.${
comment.id}">${comment.text}</div>
%if comment.package_version.commit_id:
<span class='showcode'>
<a class='idlink' href='${comment.anchor}'>show code</a>
</span>
<a class='idlink' href='${comment.anchor}'>show code</a>
%endif
<div class='comment
ment
footer'>
<div class='commentfooter'>
<table>
<tr>
%if 'user_id' in session and not main_page:
...
...
@@ -34,23 +34,28 @@ else:
value="${comment.id}">answer!
</button>
</td>
%if comment.vote:
%if comment.vote and not comment.user_id==session['user_id']:
<td>
<button class="debexup ${id}" style='display:None' id="up${comment.id}"
value='up'></button>
${ h.html.tags.form(h.url(controller='comments',action='score'), method='post') }
${ h.html.tags.text('id',value=comment.id,id=None,style='display:None')}
${ h.html.tags.checkbox('value',value='True',id=None,checked='True',style='display:None')}
${ h.html.tags.submit('submit',_(' '),id="up"+str(id)+'.'+str(comment.id),class_='debexup '+str(id))}
${ h.html.tags.end_form() }
</td>
<td>
<button class="debexdown ${id}" style='display:None' id="down${comment.id}"
value='down'></button>
${ h.html.tags.form(h.url(controller='comments',action='score'), method='post') }
${ h.html.tags.text('id',value=comment.id,id=None,style='display:None')}
${ h.html.tags.checkbox('value',value='False',id=None,checked='False',style='display:None')}
${ h.html.tags.submit('submit',_(' '),id="down"+str(id)+'.'+str(comment.id),class_='debexdown '+str(id))}
${ h.html.tags.end_form() }
</td>
%endif
%endif
<td>
<span class='score'> score : ${comment.score} </span>
</td>
<td
class='no-js'
>
<
span
class='score'>id : ${comment.id}</
span
>
<td>
<
a href="#comment${id}.${comment.id}"
class='score'>id : ${comment.id}</
a
>
</td>
</tr>
</table>
...
...
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