Merge branch 'dev' into virusdefender-dev
* dev: 由于修改了返回的时间的格式,原来的api是返回utc时间,现在直接返回北京时间了,于是测试还过不了,先注释掉了,明天改好 重新修改后台比赛编辑前后端时间不一致问题,修改了后端serializers,通过继承原来的serializer.DateTimeField类替换contestSerilazer中的DateTime.这会影响到contestAdminApi的return,并不影响其他页面.而且通过timezone.local()方法转换时区 添加前台小组申请和申请列表,的一系列页面,带测试,这个结构类似与题目和题目提交列表的样式和结构(页面的关系),写了简略的测试 [后端]这次commit跟上一次紧密相关,添加了接受和拒绝请求时对models里新加字段的操作 [后端]修改group.models里joinGroupRequest.添加了accept字段,用于标识此次请求是否被接受,用于前台展示 修改typo,修改旧的test的url,因为上午修改join_group的api的url [前端]修改我的提交页面错误的url[CI SKIP] 添加group详细页面url 修改原来申请加入小组的apiurl,原来是admin普通用户没法用 [修复]去掉urls中重复的匹配项
This commit is contained in:
40
template/src/oj/group/group.html
Normal file
40
template/src/oj/group/group.html
Normal file
@@ -0,0 +1,40 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container main">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation" class="active">
|
||||
<a href="/group/{{ group.id }}/">详细信息</a></li>
|
||||
<li role="presentation"><a href="/group/{{ group.id }}/applications/">我的申请</a></li>
|
||||
</ul>
|
||||
<h2 class="text-center">{{ group.name }}</h2>
|
||||
|
||||
<p class="text-muted text-center">发布时间 : {{ group.create_time }}
|
||||
创建者 : {{ group.admin }}
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<div class="group-section">
|
||||
<label class="group-label">描述</label>
|
||||
|
||||
<p class="group-detail">{{ group.description|safe }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
{% if group.join_group_setting %}
|
||||
<div class="form-group">
|
||||
<input id="groupId" value="{{ group.id }" type="hidden">
|
||||
<label>申请信息</label>
|
||||
<textarea class="form-control" id="applyMessage" rows="10"></textarea>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary" id="sendApplication">申请加入</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js_block %}
|
||||
<script src="/static/js/app/oj/group/group.js"></script>
|
||||
{% endblock %}
|
||||
26
template/src/oj/group/my_application.html
Normal file
26
template/src/oj/group/my_application.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div class="container main">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation">
|
||||
<a href="/group/{{ application.group.id }}/">详细信息</a></li>
|
||||
<li role="presentation" class="active">
|
||||
<a href="/group/{{ application.group.id }}/applications/">我的申请</a>
|
||||
</li>
|
||||
</ul>
|
||||
<label>内容</label>
|
||||
<p>{{ application.message|safe }}</p>
|
||||
<label>结果</label>
|
||||
{% if application.status %}
|
||||
{% if application.accepted %}
|
||||
<p>管理员接受了你的请求</p>
|
||||
{% else %}
|
||||
<p>管理员拒绝了你的请求</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>待审核</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
44
template/src/oj/group/my_application_list.html
Normal file
44
template/src/oj/group/my_application_list.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div class="container main">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation">
|
||||
<a href="/group/{{ group.id }}/">详细信息</a></li>
|
||||
<li role="presentation" class="active">
|
||||
<a href="/group/{{ group.id }}/applications/">我的申请</a></li>
|
||||
</ul>
|
||||
{% if applications %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>提交时间</th>
|
||||
<th>结果</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in applications %}
|
||||
<tr>
|
||||
<th scope="row"><a href="/group/application/{{ item.id }}/">{{ forloop.counter }}</a></th>
|
||||
<td>{{ item.create_time }}</td>
|
||||
{% if item.status %}
|
||||
{% if item.accepted %}
|
||||
<td class="alert-success">通过</td>
|
||||
{% else %}
|
||||
<td class="alert-danger">拒绝</td>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<td class="alert-warning">未处理</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>你还没有申请该小组</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -48,7 +48,7 @@
|
||||
<tbody>
|
||||
{% for item in submissions %}
|
||||
<tr>
|
||||
<th scope="row"><a href="/my_submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
|
||||
<th scope="row"><a href="/submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
|
||||
{{ forloop.counter |add:start_id }}</a></th>
|
||||
<td>{{ item.create_time }}</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user