Commit adc7c13f by Kevin Luo

Fix pending name changes template

- Strings marked for translation need to be wrapped in quotes to be
string type.
- Update old post function call
- Remove extra close brackets in function definitions
- Wrap href attribute in quotes
- Move square bracket outside of translated text
parent 851fe47a
...@@ -3,24 +3,24 @@ ...@@ -3,24 +3,24 @@
<%inherit file="main.html" /> <%inherit file="main.html" />
<script> <script>
function name_confirm(id) { function name_confirm(id) {
postJSON('/accept_name_change',{"id":id}, $.post('/accept_name_change',{"id":id},
function(data){ function(data){
if(data.success){ if(data.success){
$("#div"+id).html(${_("Accepted")}); $("#div"+id).html("${_('Accepted')}");
} else { } else {
alert(${_('Error')}); alert("${_('Error')}");
} } }
}); });
} }
function name_deny(id) { function name_deny(id) {
postJSON('/reject_name_change',{"id":id}, $.post('/reject_name_change',{"id":id},
function(data){ function(data){
if(data.success){ if(data.success){
$("#div"+id).html(${_("Rejected")}); $("#div"+id).html("${_('Rejected')}");
} else { } else {
alert(${_('Error')}); alert("${_('Error')}");
} } }
}); });
} }
</script> </script>
...@@ -32,12 +32,12 @@ function name_deny(id) { ...@@ -32,12 +32,12 @@ function name_deny(id) {
<table> <table>
% for s in students: % for s in students:
<tr> <tr>
<td><a href=/profile/${s['uid']}/>${s['old_name']}</td> <td><a href="/profile/${s['uid']}"/>${s['old_name']}</td>
<td>${s['new_name']|h}</td> <td>${s['new_name']|h}</td>
<td>${s['email']|h}</td> <td>${s['email']|h}</td>
<td>${s['rationale']|h}</td> <td>${s['rationale']|h}</td>
<td><span id="div${s['cid']}"><span onclick="name_confirm(${s['cid']});">[${_("Confirm")}]</span> <td><span id="div${s['cid']}"><span onclick="name_confirm(${s['cid']});">[${_("Confirm")}]</span>
<span onclick="name_deny(${s['cid']});">${_("[Reject]")}</span></span></td></tr> <span onclick="name_deny(${s['cid']});">[${_("Reject")}]</span></span></td></tr>
% endfor % endfor
</table> </table>
</section> </section>
......
Markdown is supported
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