完善筛选的交互

This commit is contained in:
virusdefender
2016-03-28 18:25:40 +08:00
parent fd790453a1
commit c323ff2395
4 changed files with 12 additions and 11 deletions

View File

@@ -0,0 +1,3 @@
<input type="checkbox" id="auto-refresh" {% if auto_refresh %}checked{% endif %}
onchange="if(this.checked){location.href+='?auto_refresh=true'}else{location.href=location.href.replace('?auto_refresh=true', '')}">
自动刷新

View File

@@ -0,0 +1,5 @@
<div class="form-group">
<label>仅显示当前可参加的比赛
<input id="join" type="checkbox" {% if join %}checked{% endif %} onchange="if(this.checked){location.href='/contests/?join=True'}else{location.href='/contests/'}">
</label>
</div>

View File

@@ -55,11 +55,7 @@
</tbody> </tbody>
</table> </table>
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}
<div class="form-group"> {% include "oj/contest/_contest_filter.html" %}
<label>仅显示当前可参加的比赛
<input id="join" type="checkbox" {% if join %}checked{% endif %} onchange="if(this.checked){location.href='/contests/?join=True'}else{location.href='/contests/'}">
</label>
</div>
{% endif %} {% endif %}
<nav> <nav>
<ul class="pager"> <ul class="pager">
@@ -77,6 +73,7 @@
</nav> </nav>
{% else %} {% else %}
<p>当前没有合适的比赛,你可以尝试到<a href="/groups/">小组列表</a>申请加入一些小组,以便参加小组内部的比赛</p> <p>当前没有合适的比赛,你可以尝试到<a href="/groups/">小组列表</a>申请加入一些小组,以便参加小组内部的比赛</p>
{% include "oj/contest/_contest_filter.html" %}
{% endif %} {% endif %}
</div> </div>
</div> </div>

View File

@@ -70,14 +70,10 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<input type="checkbox" id="auto-refresh" {% if auto_refresh %}checked{% endif %} {% include "oj/contest/_contest_auto_refresh_check.html" %}
onchange="if(this.checked){location.href+='?auto_refresh=true'}else{location.href=location.href.replace('?auto_refresh=true', '')}">
自动刷新
{% else %} {% else %}
<p>还没有结果</p> <p>还没有结果</p>
<input type="checkbox" id="auto-refresh" {% if auto_refresh %}checked{% endif %} {% include "oj/contest/_contest_auto_refresh_check.html" %}
onchange="if(this.checked){location.href+='?auto_refresh=true'}else{location.href=location.href.replace('?auto_refresh=true', '')}">
自动刷新
{% endif %} {% endif %}
</div> </div>