[后端]前台我的提交页面 增强提交序号的显示,原来是显示真实id即随机的散列值,不好看,现在改成自然数序列,但需要结合javascript生成,且是相对值,因为数据库里没有这个字段,有点别扭了. 第二,添加了用户没有提交记录的反馈. 第三,本打算增加筛选功能,但因为URL难以统一作罢,只有在增加新的url才能较好的处理,下次再说拜
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
<li role="presentation" class="active">
|
||||
<a href="/submission/my_submissions/">我的提交</a></li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
{% if submissions %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr class="" success>
|
||||
@@ -24,7 +26,8 @@
|
||||
<tbody>
|
||||
{% for item in submissions %}
|
||||
<tr class="{{ item.result|translate_result_class }}">
|
||||
<th scope="row"><a href="/my_submission/{{ item.id }}/">{{ item.id }}</a></th>
|
||||
<th scope="row"><a href="/my_submission/{{ item.id }}/" id="id_{{ forloop.counter }}">{{ forloop.counter
|
||||
}}</a></th>
|
||||
<td>{{ item.create_time }}</td>
|
||||
<td>{{ item.result|translate_result }}</td>
|
||||
<td>
|
||||
@@ -42,6 +45,9 @@
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>你还没有提交记录!</p>
|
||||
{% endif %}
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
{% if previous_page %}
|
||||
@@ -57,4 +63,12 @@
|
||||
</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 %}
|
||||
|
||||
Reference in New Issue
Block a user