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

comment: fix indent, fix weird class name, fix debexup/debexdown with form, add link for comments

parent 924da963
<%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="commentmentviewer">
<div ${margin_left|n} class="commentviewer">
<fieldset class="${comment.style}">
<legend class='commentmentheader'>${comment.user.name} : ${comment.time}</legend>
<div class="commentment" 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='commentmentfooter'>
<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>
......
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