Merge branch 'dev' into hohoTT-dev
This commit is contained in:
@@ -11,4 +11,4 @@ class AdminTemplateView(APIView):
|
||||
try:
|
||||
return HttpResponse(open(path).read(), content_type="text/html")
|
||||
except IOError:
|
||||
raise Http404
|
||||
return HttpResponse(u"模板不存在", content_type="text/html")
|
||||
|
||||
@@ -1,25 +1,15 @@
|
||||
@import url("global.css");
|
||||
@import url("bootstrap/bootstrap.min.css");
|
||||
@import url("bootstrap/todc-bootstrap.min.css");
|
||||
@import url("codeMirror/codemirror.css");
|
||||
@import url("simditor/simditor.css");
|
||||
@import url("webuploader/webuploader.css");
|
||||
@import url("datetime_picker/bootstrap-datetimepicker.css");
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding-top: 30px;
|
||||
padding-bottom: 30px;
|
||||
float: bottom;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 16px;
|
||||
#loading-gif{
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 0; left: 0; bottom: 0; right: 0;
|
||||
}
|
||||
27
static/src/css/global.css
Normal file
27
static/src/css/global.css
Normal file
@@ -0,0 +1,27 @@
|
||||
html{
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body{
|
||||
height:100%; /*使内容高度和body一样*/
|
||||
margin-bottom:-80px;/*向上缩减80像素,不至于footer超出屏幕可视范围*/
|
||||
}
|
||||
|
||||
.main{
|
||||
padding-bottom: 120px;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 80px
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 16px;
|
||||
}
|
||||
@@ -1,25 +1,8 @@
|
||||
@import url("global.css");
|
||||
@import url("bootstrap/bootstrap.min.css");
|
||||
@import url("bootstrap/todc-bootstrap.min.css");
|
||||
@import url("codeMirror/codemirror.css");
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding-top: 30px;
|
||||
padding-bottom: 30px;
|
||||
float: bottom;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#language-selector {
|
||||
width: 130px;
|
||||
@@ -47,7 +30,6 @@ label {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
/* index css */
|
||||
.jumbotron {
|
||||
text-align: center;
|
||||
background-color: transparent;
|
||||
|
||||
@@ -7,25 +7,36 @@ define("admin", ["jquery", "avalon"], function($, avalon){
|
||||
$(".list-group-item").attr("class", "list-group-item");
|
||||
}
|
||||
|
||||
function show_template(url){
|
||||
$("#loading-gif").show();
|
||||
vm.template_url = url;
|
||||
}
|
||||
|
||||
var vm = avalon.define({
|
||||
$id: "admin",
|
||||
template_url: "template/index/index.html",
|
||||
hide_loading: function(){
|
||||
$("#loading-gif").hide();
|
||||
}
|
||||
});
|
||||
|
||||
var hash = window.location.hash.substring(1);
|
||||
|
||||
if(hash){
|
||||
li_active("#li-" + hash);
|
||||
li_active("#li-" + hash.replace("/", "-"));
|
||||
show_template("template/" + hash + ".html");
|
||||
}else {
|
||||
li_active("#li-index");
|
||||
li_active("#li-index-index");
|
||||
}
|
||||
|
||||
window.onhashchange = function() {
|
||||
var hash = window.location.hash.substring(1);
|
||||
if(hash){
|
||||
li_inactive(".list-group-item");
|
||||
li_active("#li-" + hash);
|
||||
vm.template_url = "template/index/" + hash + ".html";
|
||||
li_active("#li-" + hash.replace("/", "-"));
|
||||
show_template("template/" + hash + ".html");
|
||||
}
|
||||
};
|
||||
|
||||
var vm = avalon.define({
|
||||
$id: "admin",
|
||||
template_url: "template/index/index.html"
|
||||
});
|
||||
|
||||
});
|
||||
154
static/src/js/app/admin/announcement/announcement.js
Normal file
154
static/src/js/app/admin/announcement/announcement.js
Normal file
@@ -0,0 +1,154 @@
|
||||
require(["jquery", "avalon", "csrf", "bs_alert", "editor", "validation"], function ($, avalon, csrfHeader, bs_alert, editor) {
|
||||
announcementEditor = editor("#editor"); //创建新建公告的内容编辑器
|
||||
editAnnouncementEditor = null;
|
||||
|
||||
if (!avalon.vmodels.announcement) // 防止模式重新定义
|
||||
{
|
||||
// avalon:定义模式 announcement
|
||||
vm = avalon.define({
|
||||
$id: "announcement",
|
||||
announcement: [], // 公告列表数据项
|
||||
previous_page: 0, // 之前的页数
|
||||
next_page: 0, // 之后的页数
|
||||
page: 1, // 当前页数
|
||||
isEditing: 0, // 正在编辑的公告的ID, 为零说明未在编辑
|
||||
getState: function (el) { //获取公告当前状态,显示
|
||||
if (el.visible)
|
||||
return "可见";
|
||||
else
|
||||
return "隐藏";
|
||||
},
|
||||
getNext: function (el) {
|
||||
if (!vm.next_page)
|
||||
return;
|
||||
getPageData(++(vm.page));
|
||||
},
|
||||
getPrevious: function (el) {
|
||||
if (!vm.previous_page)
|
||||
return;
|
||||
getPageData(--(vm.page));
|
||||
},
|
||||
getBtnClass: function (btn) {
|
||||
if (btn) {
|
||||
return vm.next_page ? "btn btn-primary" : "btn btn-primary disabled";
|
||||
}
|
||||
else {
|
||||
return vm.previous_page ? "btn btn-primary" : "btn btn-primary disabled";
|
||||
}
|
||||
|
||||
},
|
||||
enEdit: function (el) { //点击编辑按钮的事件,显示/隐藏编辑区
|
||||
$("#newTitle").val(el.title);
|
||||
if (!editAnnouncementEditor) //初始化编辑器
|
||||
editAnnouncementEditor = editor("#editAnnouncementEditor");
|
||||
editAnnouncementEditor.setValue(el.content);
|
||||
if (el.visible == false)
|
||||
$("#hidden").attr("checked", true);
|
||||
if (vm.isEditing == el.id)
|
||||
vm.isEditing = 0;
|
||||
else
|
||||
vm.isEditing = el.id;
|
||||
editAnnouncementEditor.focus();
|
||||
},
|
||||
disEdit: function () { //收起编辑框
|
||||
vm.isEditing = 0;
|
||||
},
|
||||
submitChange: function () { // 处理编辑公告提交事件,顺便验证字段为空
|
||||
var title = $("#newTitle").val(), content = editAnnouncementEditor.getValue(), visible = true;
|
||||
if ($("#hidden").attr("checked") == true)
|
||||
visible = false;
|
||||
if (title != "") {
|
||||
if (content != "") {
|
||||
$.ajax({ //发送修改公告请求
|
||||
beforeSend: csrfHeader,
|
||||
url: "/api/edit_announcements/",
|
||||
dataType: "json",
|
||||
method: "post",
|
||||
data: {id: vm.isEditing, title: title, content: content, visible: visible},
|
||||
success: function (data) {
|
||||
if (!data.code) {
|
||||
bs_alert("修改成功");
|
||||
vm.isEditing = 0;
|
||||
}
|
||||
else {
|
||||
bs_alert(data.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
bs_alert("公告内容不得为空");
|
||||
}
|
||||
else
|
||||
bs_alert("公告标题不能为空");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
avalon.scan();
|
||||
getPageData(1); //公告列表初始化
|
||||
vm.page = 1;
|
||||
vm.isEditing = 0;
|
||||
//Ajax get数据
|
||||
function getPageData(page) {
|
||||
$.ajax({
|
||||
beforeSend: csrfHeader,
|
||||
url: "/api/announcements/?paging=true&page=" + page + "&page_size=10",
|
||||
dataType: "json",
|
||||
method: "get",
|
||||
success: function (data) {
|
||||
if (!data.code) {
|
||||
vm.announcement = data.data.results;
|
||||
vm.previous_page = data.data.previous_page;
|
||||
vm.next_page = data.data.next_page;
|
||||
}
|
||||
else {
|
||||
bs_alert(data.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//新建公告表单验证与数据提交
|
||||
$("#announcement-form")
|
||||
.formValidation({
|
||||
framework: "bootstrap",
|
||||
fields: {
|
||||
title: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: "请填写公告标题"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
).on('success.form.fv', function (e) {
|
||||
e.preventDefault();
|
||||
var title = $("#title").val();
|
||||
var content = announcementEditor.getValue();
|
||||
if (content == "") {
|
||||
bs_alert("请填写公告内容");
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
beforeSend: csrfHeader,
|
||||
url: "/api/admin/announcement/",
|
||||
data: {title: title, content: content},
|
||||
dataType: "json",
|
||||
method: "post",
|
||||
success: function (data) {
|
||||
if (!data.code) {
|
||||
bs_alert("提交成功!");
|
||||
$("#title").val("");
|
||||
announcementEditor.setValue("");
|
||||
getPageData(1, function (data) {
|
||||
});
|
||||
} else {
|
||||
bs_alert(data.data);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
});
|
||||
@@ -2,6 +2,7 @@ require(["jquery", "avalon", "editor", "uploader", "datetimepicker",
|
||||
"validation"
|
||||
],
|
||||
function ($, avalon, editor, uploader) {
|
||||
avalon.vmodels.add_contest = null;
|
||||
$("#add-contest-form")
|
||||
.formValidation({
|
||||
framework: "bootstrap",
|
||||
|
||||
@@ -4,7 +4,6 @@ require(["jquery", "bs_alert", "csrf", "validation"], function ($, bs_alert, csr
|
||||
framework: "bootstrap",
|
||||
fields: {
|
||||
username: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: "请填写用户名"
|
||||
@@ -55,7 +54,6 @@ require(["jquery", "bs_alert", "csrf", "validation"], function ($, bs_alert, csr
|
||||
}
|
||||
},
|
||||
email: {
|
||||
trigger: 'blur',
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: "请填写电子邮箱邮箱地址"
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
method: "post"
|
||||
});
|
||||
xhr.success(function(response) {
|
||||
if (response.code == 1)
|
||||
dfd.resolve($field, 'remote',{valid:true, message:options.msg});
|
||||
dfd.resolve($field, 'remote',{valid:!response.data, message:options.msg});
|
||||
})
|
||||
.error(function(response) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -67,23 +65,46 @@
|
||||
<![endif]-->
|
||||
<!-- browser happy end -->
|
||||
|
||||
<div class="container" ms-controller="admin">
|
||||
<div class="container main" ms-controller="admin">
|
||||
<div class="row">
|
||||
<!-- admin left begin-->
|
||||
<div class="col-md-2">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-header">List header</li>
|
||||
<li class="list-group-item" id="li-index"><a href="#index">主页</a></li>
|
||||
<li class="list-group-item" id="li-announcement"><a href="#announcement">公告</a></li>
|
||||
<li class="list-group-item"><a href="#">Applications</a></li>
|
||||
<li class="list-group-header">Another list header</li>
|
||||
<li class="list-group-item"><a href="#">Help</a></li>
|
||||
<li class="list-group-header">首页</li>
|
||||
<li class="list-group-item" id="li-index-index">
|
||||
<a href="#index/index">主页</a>
|
||||
</li>
|
||||
<li class="list-group-item" id="li-monitor-monitor">
|
||||
<a href="#monitor/monitor">监控</a>
|
||||
</li>
|
||||
<li class="list-group-item" id="li-statistics-statistics">
|
||||
<a href="#statistics/statistics">统计</a>
|
||||
</li>
|
||||
<li class="list-group-item" id="li-announcement-announcement">
|
||||
<a href="#announcement/announcement">公告</a>
|
||||
</li>
|
||||
<li class="list-group-header">题目管理</li>
|
||||
<li class="list-group-item" id="li-problem-problem_list">
|
||||
<a href="#problem/problem_list">题目列表</a>
|
||||
</li>
|
||||
<li class="list-group-item" id="li-problem-add_problem">
|
||||
<a href="#problem/add_problem">创建题目</a>
|
||||
</li>
|
||||
<li class="list-group-header">比赛管理</li>
|
||||
<li class="list-group-item" id="li-contest-contest_list">
|
||||
<a href="#contest/contest_list">比赛列表</a>
|
||||
</li>
|
||||
<li class="list-group-item" id="li-contest-add_contest">
|
||||
<a href="#contest/add_contest">创建比赛</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- admin left end -->
|
||||
|
||||
<img src="/static/img/loading.gif" id="loading-gif">
|
||||
<!-- custom body begin -->
|
||||
<div ms-include-src="template_url"></div>
|
||||
|
||||
<div class='col-md-8' ms-include-src="template_url" data-include-rendered="hide_loading"></div>
|
||||
|
||||
<!-- custom body end -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,185 +1,179 @@
|
||||
{% extends "admin_base.html" %}
|
||||
{% block body %}
|
||||
{% verbatim %}
|
||||
<div ms-controller="add_contest">
|
||||
<div ms-controller="add_contest">
|
||||
|
||||
|
||||
<form id="add-contest-form">
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-12">
|
||||
<label>比赛题目</label>
|
||||
<form id="add-contest-form">
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-12">
|
||||
<label>比赛题目</label>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<input type="text" name="name" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<input type="text" name="name" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>说明</label>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea id="editor" placeholder="这里输入内容" autofocus></textarea>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>说明</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>开始时间</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>结束时间</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="start_time" id="contest_start_time">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea id="editor" placeholder="这里输入内容" autofocus></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>开始时间</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>结束时间</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="start_time" id="contest_start_time">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="end_time" id="contest_end_time">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="end_time" id="contest_end_time">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label>
|
||||
密码保护
|
||||
</label>
|
||||
<div class="col-md-6">
|
||||
<label>
|
||||
密码保护
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>
|
||||
模式
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>
|
||||
结束前是否开放排名
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="password" placeholder="留空就是公开赛">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>
|
||||
模式
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<input type="radio" name="mode">OI
|
||||
<input type="radio" name="mode">ACM
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>
|
||||
结束前是否开放排名
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="password" placeholder="留空就是公开赛">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<input type="radio" name="mode">OI
|
||||
<input type="radio" name="mode">ACM
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<input type="checkbox" value="open_rank">开放排名
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<input type="checkbox" value="open_rank">开放排名
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<label>添加题目</label>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm" ms-click="add_problem()">添加</a>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="problem" ms-repeat-problem="problems">
|
||||
<div class="panel panel-default problem-panel" ms-attr-id="problem-{{ problem.id }}">
|
||||
<div class="panel-heading">
|
||||
<span class="panel-title">题目{{$index + 1}} </span>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm"
|
||||
ms-click="toggle_problem(problem)">
|
||||
{{ problem.toggle_string }}
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="btn btn-danger btn-sm"
|
||||
ms-click="del_problem(problem)">
|
||||
删除
|
||||
</a>
|
||||
<div class="col-md-12">
|
||||
<label>添加题目</label>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm" ms-click="add_problem()">添加</a>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="problem" ms-repeat-problem="problems">
|
||||
<div class="panel panel-default problem-panel" ms-attr-id="problem-{{ problem.id }}">
|
||||
<div class="panel-heading">
|
||||
<span class="panel-title">题目{{$index + 1}} </span>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm"
|
||||
ms-click="toggle_problem(problem)">
|
||||
{{ problem.toggle_string }}
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="btn btn-danger btn-sm"
|
||||
ms-click="del_problem(problem)">
|
||||
删除
|
||||
</a>
|
||||
</div>
|
||||
<div class="panel-body" ms-attr-id="problem-{{ problem.id }}-body">
|
||||
<div class="col-md-12">
|
||||
<label>题目</label>
|
||||
</div>
|
||||
<div class="panel-body" ms-attr-id="problem-{{ problem.id }}-body">
|
||||
<div class="col-md-12">
|
||||
<label>题目</label>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<input type="text" name="problem_name[]" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<input type="text" name="problem_name[]" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>cpu</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>cpu</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>内存</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" name="cpu[]" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label>内存</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" name="memory[]" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" name="cpu[]" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="text" name="memory[]" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<label>样例</label>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm"
|
||||
ms-click="add_sample(problem)">
|
||||
添加
|
||||
</a>
|
||||
<label>样例</label>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm"
|
||||
ms-click="add_sample(problem)">
|
||||
添加
|
||||
</a>
|
||||
|
||||
<div class="sample">
|
||||
<div class="panel panel-default sample-panel"
|
||||
ms-repeat-sample="problem.samples">
|
||||
<div class="panel-heading">
|
||||
<span class="panel-title">样例{{$index + 1}}</span>
|
||||
<div class="sample">
|
||||
<div class="panel panel-default sample-panel"
|
||||
ms-repeat-sample="problem.samples">
|
||||
<div class="panel-heading">
|
||||
<span class="panel-title">样例{{$index + 1}}</span>
|
||||
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm"
|
||||
ms-click="toggle_sample(problem, sample)">
|
||||
{{ sample.toggle_string }}
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="btn btn-danger btn-sm"
|
||||
ms-click="del_sample(problem, sample)">
|
||||
删除
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="btn btn-primary btn-sm"
|
||||
ms-click="toggle_sample(problem, sample)">
|
||||
{{ sample.toggle_string }}
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="btn btn-danger btn-sm"
|
||||
ms-click="del_sample(problem, sample)">
|
||||
删除
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="panel-body"
|
||||
ms-attr-id="problem-{{ problem.id }}-sampleio-{{ sample.id }}-body">
|
||||
<div class="col-md-12">
|
||||
<label>样例输入</label>
|
||||
|
||||
</div>
|
||||
<div class="panel-body"
|
||||
ms-attr-id="problem-{{ problem.id }}-sampleio-{{ sample.id }}-body">
|
||||
<div class="col-md-12">
|
||||
<label>样例输入</label>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="5"></textarea>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="5"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>样例输出</label>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="5"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>样例输出</label>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<textarea class="form-control" rows="5"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>测试数据</label>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<div ms-attr-id="problem-{{ problem.id }}-uploader">选择文件</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label>测试数据</label>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<div ms-attr-id="problem-{{ problem.id }}-uploader">选择文件</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endverbatim %}
|
||||
{% endblock %}
|
||||
{% block js_block %}
|
||||
<script src="/static/js/app/admin/contest/contest.js"></script>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/app/admin/contest/contest.js"></script>
|
||||
65
template/admin/index/announcement.html
Normal file
65
template/admin/index/announcement.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<style> [ms-controller] {
|
||||
display: none
|
||||
}</style>
|
||||
<h1>Announcement</h1>
|
||||
<div ms-controller="announcement">
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<th>标题</th>
|
||||
<th>创建时间</th>
|
||||
<th>更新时间</th>
|
||||
<th>创建者</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
<tr ms-repeat="announcement">
|
||||
<td>{{el.id}}</td>
|
||||
<td>{{el.title}}</td>
|
||||
<td>{{el.create_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
|
||||
<td>{{el.last_update_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
|
||||
<td>{{el.created_by.username}}</td>
|
||||
<td>{{getState(el)}}</td>
|
||||
<td>
|
||||
<button class="btn-sm btn-info" ms-click="enEdit(el)">编辑</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="text-right">
|
||||
页数:{{page}}/{{page+next_page}}
|
||||
<botton ms-attr-class="getBtnClass(0)" ms-click="getPrevious">上一页</botton>
|
||||
<botton ms-attr-class="getBtnClass(1)" ms-click="getNext">下一页</botton>
|
||||
</div>
|
||||
|
||||
<div ms-visible="isEditing">
|
||||
<h3>编辑公告</h3>
|
||||
|
||||
<div class="form-group"><label for="title">标题</label>
|
||||
<input name="title" type="text" class="form-control" id="newTitle" placeholder="公告标题" value=""></div>
|
||||
<div class="form-group">
|
||||
<label>内容</label>
|
||||
<textarea id="editAnnouncementEditor"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>隐藏</label>
|
||||
<input type="checkbox" id="hidden">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button ms-click="submitChange()" class="btn btn-primary">提交</button><button ms-click="disEdit()" class="btn btn-danger">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
<h3>添加公告</h3>
|
||||
|
||||
<form id="announcement-form">
|
||||
<div class="form-group"><label for="title">标题</label>
|
||||
<input name="title" type="text" class="form-control" id="title" placeholder="公告标题"></div>
|
||||
<div class="form-group">
|
||||
<label>内容</label>
|
||||
<textarea id="editor" placeholder="公告内容"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script src="/static/js/app/admin/announcement/announcement.js"></script>
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "oj_base.html" %}
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
<div class="container main">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<h2 class="text-center">修改密码</h2>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "oj_base.html" %}
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
<div class="container main">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<h2 class="text-center">用户登录</h2>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "oj_base.html" %}
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
<div class="container main">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<h2 class="text-center">用户注册</h2>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "oj_base.html" %}
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
<div class="container main">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation" class="active">
|
||||
<a href="problem.html">题目</a></li>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
<div class="container main">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation" class="active">
|
||||
<a href="problem.html">题目</a></li>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "oj_base.html" %}
|
||||
{% block body %}
|
||||
<div class="container" ms-controller="problem_list">
|
||||
<div class="container main" ms-controller="problem_list">
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user