[后端]去掉了用于生产序号的javascript,改为使用模板过滤器实现(我的所有提交)

This commit is contained in:
esp 2015-08-22 19:38:51 +08:00
parent 4361f4d6e4
commit 35c4b09f57
2 changed files with 3 additions and 11 deletions

View File

@ -147,4 +147,4 @@ def my_submission_list_page(request, page=1):
return render(request, "oj/submission/my_submissions_list.html",
{"submissions": current_page, "page": int(page),
"previous_page": previous_page, "next_page": next_page})
"previous_page": previous_page, "next_page": next_page, "startId":int(page)*20-20})

View File

@ -26,8 +26,8 @@
<tbody>
{% for item in submissions %}
<tr class="{{ item.result|translate_result_class }}">
<th scope="row"><a href="/my_submission/{{ item.id }}/" id="id_{{ forloop.counter }}">{{ forloop.counter
}}</a></th>
<th scope="row"><a href="/my_submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
{{ forloop.counter |add:startId }}</a></th>
<td>{{ item.create_time }}</td>
<td>{{ item.result|translate_result }}</td>
<td>
@ -63,12 +63,4 @@
</ul>
</nav>
</div>
<script>
for (var i = 1; true; i++) {
if (!document.getElementById("id_"+i)) break;
document.getElementById("id_"+i).innerHTML= ""+(i+{{page}}*20-20);
}
</script>
{% endblock %}