修改前台提交列表的显示样式,使之与其他列表形式更加统一,修改显示的颜色有原来的class=success等等改为alert-success,并增加strong标签[CI SKIP]

This commit is contained in:
esp
2015-08-29 17:06:00 +08:00
parent a6c33bed36
commit 9bf3dad91e
3 changed files with 128 additions and 44 deletions

View File

@@ -1,10 +1,83 @@
<!DOCTYPE html> {% extends "oj_base.html" %}
<html lang="en"> {% block body %}
<head> {% load problem %}
<meta charset="UTF-8"> <div class="container main">
<title></title> <div class="row">
</head> <div class="col-md-9 col-lg-9">
<body> <div class="row">
<div class="right">
<form class="form-inline" method="get">
<div class="form-group-sm">
<input name="keyword" class="form-control" placeholder="请输入关键词">
<input type="submit" value="搜索" class="btn btn-primary">
</div>
</form>
</div>
</div>
<div>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>#</th>
<th>题目</th>
<th><a href="/problems/?order_by=difficulty">难度</a></th>
<th><a href="/problems/?order_by=acceptance">通过率</a></th>
</tr>
</thead>
<tbody>
{% for item in problems %}
<tr>
<th><span class="glyphicon glyphicon-ok ac-flag"></span></th>
<th scope="row"><a href="/problem/{{ item.id }}/" target="_blank">{{ item.id }}</a></th>
<td><a href="/problem/{{ item.id }}/" target="_blank">{{ item.title }}</a></td>
<td>{{ item.difficulty }}</td>
<td>{{ item|accepted_radio }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<nav>
<ul class="pager">
{% if previous_page %}
<li class="previous"><a
href="/problems/{{ previous_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if tag %}?tag={{ tag }}{% endif %}">
<span aria-hidden="true">&larr;</span> 上一页</a></li>
{% endif %}
{% if next_page %}
<li class="next"><a
href="/problems/{{ next_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if tag %}?tag={{ tag }}{% endif %}">下一页 <span
aria-hidden="true">&rarr;</span></a></li>
{% endif %}
</ul>
</nav>
</div>
</div>
</body> <div class="col-md-3 col-lg-3">
</html> {% include "oj/announcement/_announcement_panel.html" %}
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
<span class="glyphicon glyphicon-tag" aria-hidden="true"></span>
分类
</h3>
</div>
<ul class="list-group">
{% for item in tags %}
<li class="list-group-item problem-tag" onclick="location.href='/problems/?tag={{ item.name }}'">
<span class="badge">{{ item.problem_number }}</span>
{{ item.name }}
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% endblock %}
{% block js_block %}
<script src="/static/js/app/oj/problem/problem_list.js"></script>
{% endblock %}

View File

@@ -17,17 +17,19 @@
<tr class="" success> <tr class="" success>
<th>#</th> <th>#</th>
<th>提交时间</th> <th>提交时间</th>
<th>结果</th>
<th>运行时间</th>
<th>语言</th> <th>语言</th>
<th>运行时间</th>
<th>结果</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for item in submissions %} {% for item in submissions %}
<tr class="{{ item.result|translate_result_class }}"> <tr>
<th scope="row"><a href="/submission/{{ item.id }}/">{{ forloop.counter }}</a></th> <th scope="row"><a href="/submission/{{ item.id }}/">{{ forloop.counter }}</a></th>
<td>{{ item.create_time }}</td> <td>{{ item.create_time }}</td>
<td>{{ item.result|translate_result }}</td> <td>
{{ item.language|translate_language }}
</td>
<td> <td>
{% if item.accepted_answer_time %} {% if item.accepted_answer_time %}
{{ item.accepted_answer_time }}ms {{ item.accepted_answer_time }}ms
@@ -35,8 +37,8 @@
-- --
{% endif %} {% endif %}
</td> </td>
<td> <td class="alert-{{ item.result|translate_result_class }}">
{{ item.language|translate_language }} <strong>{{ item.result|translate_result }}</strong>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

@@ -5,13 +5,30 @@
{% load submission %} {% load submission %}
<div class="container main"> <div class="container main">
<div class="col-md-9 col-lg-9"> <div class="col-md-9 col-lg-9">
<table class="table table-bordered"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th>提交时间</th> <th>提交时间</th>
<th><div class="dropdown"> <th>
<a href="#" class="dropdown-toggle" id="resultFilter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <div class="dropdown">
<a href="#" class="dropdown-toggle" id="languageFilter" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
语言<span class="caret"></span>
</a>
<ul class="dropdown-menu" aria-labelledby="languageFilter">
<li><a href="/submissions/?language=1">C</a></li>
<li><a href="/submissions/?language=2">C++</a></li>
<li><a href="/submissions/?language=3">Java</a></li>
<li><a href="/submissions/">取消筛选</a></li>
</ul>
</div>
</th>
<th>运行时间</th>
<th>
<div class="dropdown">
<a href="#" class="dropdown-toggle" id="resultFilter" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
结果<span class="caret"></span> 结果<span class="caret"></span>
</a> </a>
<ul class="dropdown-menu" aria-labelledby="resultFilter"> <ul class="dropdown-menu" aria-labelledby="resultFilter">
@@ -23,29 +40,20 @@
<li><a href="/submissions/?result=4">Compile Error</a></li> <li><a href="/submissions/?result=4">Compile Error</a></li>
<li><a href="/submissions/?result=5">Format Error</a></li> <li><a href="/submissions/?result=5">Format Error</a></li>
<li><a href="/submissions/">取消筛选</a></li> <li><a href="/submissions/">取消筛选</a></li>
</ul></div> </ul>
</th> </div>
<th>运行时间</th>
<th><div class="dropdown">
<a href="#" class="dropdown-toggle" id="languageFilter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
语言<span class="caret"></span>
</a>
<ul class="dropdown-menu" aria-labelledby="languageFilter">
<li><a href="/submissions/?language=1">C</a></li>
<li><a href="/submissions/?language=2">C++</a></li>
<li><a href="/submissions/?language=3">Java</a></li>
<li><a href="/submissions/">取消筛选</a></li>
</ul></div>
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for item in submissions %} {% for item in submissions %}
<tr class="{{ item.result|translate_result_class }}"> <tr>
<th scope="row"><a href="/my_submission/{{ item.id }}/" id="id_{{ forloop.counter }}"> <th scope="row"><a href="/my_submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
{{ forloop.counter |add:start_id }}</a></th> {{ forloop.counter |add:start_id }}</a></th>
<td>{{ item.create_time }}</td> <td>{{ item.create_time }}</td>
<td>{{ item.result|translate_result }}</td> <td>
{{ item.language|translate_language }}
</td>
<td> <td>
{% if item.accepted_answer_time %} {% if item.accepted_answer_time %}
{{ item.accepted_answer_time }}ms {{ item.accepted_answer_time }}ms
@@ -53,9 +61,10 @@
-- --
{% endif %} {% endif %}
</td> </td>
<td> <td class="alert-{{ item.result|translate_result_class }}">
{{ item.language|translate_language }} <strong>{{ item.result|translate_result }}</strong>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}