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

comment: add the no-js support, fix name for validation

parent 7697b5da
<%page args='id,package_version_id'/>
<%page args='id,package_version_id,filename=""'/>
<script type="text/javascript">
$(document).ready(function () {
<% if not hasattr(c,'fileName'): setattr(c,'fileName','') %>
comment_form(${id}, '${h.url(controller='comments', action='ajax_call')}', "${h.url(controller='comments',action='reload_comments')}",${package_version_id}, '${c.fileName}', '')
var filename = '${c.fileName}'
comment_form(${id}, '${h.url(controller='comments', action='ajax_call')}', "${h.url(controller='comments',action='reload_comments')}",${package_version_id}, filename, '')
});
</script>
<fieldset id="comment_fs${id}" style="border:solid">
......@@ -16,7 +17,17 @@
</td>
<td>
<% options=(("info","info"),("idea","idea"),("success","good point"),("failure","bad point")) %>
${ h.html.tags.select('typei'+str(id),None,options)}
${ h.html.tags.select('type',None,options,id='typei'+str(id))}
</td>
</tr>
<tr class='no-js'>
<td>
${ _('choose a comment to answer')}
</td>
<td>
<% options=[(int(i.id),str(i.id)+' : '+str(i.text[:10])) for i in c.comments]
options.append(('',''))%>
${h.html.tags.select('parent',"",options,id='answer'+str(id))}
</td>
</tr>
<tr>
......@@ -24,7 +35,7 @@
${ _('comment')}:
</td>
<td>
${ h.html.tags.textarea('commenti'+str(id),rows=5,cols=40)}
${ h.html.tags.textarea('content',rows=5,cols=40,id='commenti'+str(id))}
</td>
</tr>
<tr>
......@@ -32,7 +43,7 @@
${ _('from line')}
</td>
<td>
${ h.html.tags.text('start'+str(id))}
${ h.html.tags.text(id='start'+str(id),name='start')}
</td>
</tr>
<tr>
......@@ -40,10 +51,15 @@
${ _('to line')}
</td>
<td>
${ h.html.tags.text('stop'+str(id))}
${ h.html.tags.text(id='stop'+str(id),name='stop')}
</td>
</tr>
</table>
<span class='no-js' style='visibility:hidden; display:NONE;'>
${h.html.tags.text('file',value=filename)}
${h.html.tags.text('revision',value=package_version_id)}
</span>
<br/>
${ h.html.tags.submit('send'+str(id), _('Submit'),id='send'+str(id)) }
${ h.html.tags.submit('send', _('Submit'),id='send'+str(id)) }
</fieldset>
\ No newline at end of file
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