first commit
This commit is contained in:
42
web/templates/analysis/index.html
Normal file
42
web/templates/analysis/index.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}前途分析{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div id="anaQuizz" class="col-md-4 btn" style="text-align: left">
|
||||
<div class="thumbnail">
|
||||
<img src="../../static/img/quizzme.jpg" alt="">
|
||||
<div class="caption">
|
||||
<h3>先做一个小测试</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="anaSkill" class="col-md-4 btn" style="text-align: left">
|
||||
<div class="thumbnail">
|
||||
<img src="../../static/img/skill2.jpg" alt="">
|
||||
<div class="caption">
|
||||
<h3>技能连连看</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="anaResult" class="col-md-4 btn" style="text-align: left">
|
||||
<div class="thumbnail">
|
||||
<img src="../../static/img/analysis2.jpg" alt="">
|
||||
<div class="caption">
|
||||
<h3>我们得到的结果</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#anaQuizz').click(function () {
|
||||
alert('功能暂未开发,请联系管理员');
|
||||
//window.location.href = '/ana/quizz{% if request.session.uid %}?uid={{ request.session.uid|safe }}{% else %}{% endif %}';
|
||||
});
|
||||
$('#anaSkill').click(function () {
|
||||
alert('功能暂未开发,请联系管理员');
|
||||
});
|
||||
$('#anaResult').click(function () {
|
||||
alert('功能暂未开放,请联系管理员');
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
15
web/templates/analysis/quizz.html
Normal file
15
web/templates/analysis/quizz.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}前途分析{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="list-group">
|
||||
<div class="list-group-item">通用职业能力测试</div>
|
||||
<div class="list-group-item">心理测试</div>
|
||||
<div class="list-group-item">职业技能测试</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
463
web/templates/base.html
Normal file
463
web/templates/base.html
Normal file
@@ -0,0 +1,463 @@
|
||||
{% load staticfiles %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}">
|
||||
<script src="{% static 'js/jquery.min.js' %}"></script>
|
||||
<!--bootstrap核心js-->
|
||||
<script src="{% static 'js/bootstrap.min.js' %}"></script>
|
||||
<style>
|
||||
.cate {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.modal-dialog {
|
||||
padding-top : 200px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main-container">
|
||||
<div class="top-container" >
|
||||
<div class="newIndex-header container" style="background-image: url('/static/images/logo.png');">
|
||||
<!--nav_menu-->
|
||||
|
||||
<ul id="nav_menu" class="nav_menu clearfix">
|
||||
<li class="nLi no">
|
||||
<h3>
|
||||
<a href="/index{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}">首页</a>
|
||||
</h3>
|
||||
</li>
|
||||
<li class="nLi">
|
||||
<h3>
|
||||
<a href="/bs/set{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}">快速出题</a>
|
||||
</h3>
|
||||
</li>
|
||||
<li class="nLi">
|
||||
<h3>
|
||||
<a href="/biz{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}">成为机构</a>
|
||||
</h3>
|
||||
</li>
|
||||
<li class="nLi login" >
|
||||
<h3 style="min-width: 100px;">
|
||||
<a href="javascript:void(0);">
|
||||
{% if request.session.uid %}{{ request.session.username }}{% else %}登 录{% endif %}
|
||||
</a>
|
||||
</h3>
|
||||
<ul class="sub" style="overflow: hidden; display: none;">
|
||||
{% if request.session.uid %}
|
||||
<li><a href="/logout">注销</a></li>
|
||||
<li id="resetPassword"><a href="#">修改密码</a></li>
|
||||
{% else %}
|
||||
<li><a id="signInNormal" href="#">密码登录</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!--end nav_menu -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal" id="signInModalNormal" tabindex="-1" role="dialog" aria-labelledby="signInModalNormalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="signInModalNormalLabel">登录</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="signInId" >邮箱</label>
|
||||
<input type="text" class="form-control" id="signInId" placeholder="hugo.zhang@example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signInPassword" >密码</label>
|
||||
<input type="password" class="form-control" id="signInPassword" placeholder="#p@ssw0d123">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signInVcode" >验证码</label>
|
||||
<input type="text" class="form-control" id="signInVcode" placeholder="">
|
||||
<img id="signInVcodeImg" src="" style="height: 50px;width: 150px;" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" id="resetPassword" style="margin-right: 10px;" >忘记密码?</a>
|
||||
<a href="#" id="signUp" style="margin-right: 30px;" >注册</a>
|
||||
<button type="button" class="btn btn-primary" id="signInPost">登录</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="signUpModal" tabindex="-1" role="dialog" aria-labelledby="signUpModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="signUpModalLabel">注册</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="signUpId" >邮箱</label>
|
||||
<input type="text" class="form-control" id="signUpId" placeholder="hugo.zhang@example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signUpPassword" >密码</label>
|
||||
<input type="password" class="form-control" id="signUpPassword" placeholder="#p@ssw0d123">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signUpPasswordAgain" >确认密码</label>
|
||||
<input type="password" class="form-control" id="signUpPasswordAgain" placeholder="#p@ssw0d123">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signUpVcode" >验证码</label>
|
||||
<input type="text" class="form-control" id="signUpVcode" placeholder="">
|
||||
<img id="signUpVcodeImg" src="" style="height: 50px;width: 150px;" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" id="signIn" style="margin-right: 30px;" >已有账户,去登录</a>
|
||||
<button type="button" class="btn btn-primary" id="signUpPost">注册</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="resetPasswordModal" tabindex="-1" role="dialog" aria-labelledby="resetPasswordModal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="resetPasswordLabel">重置密码</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="resetId" >邮箱</label>
|
||||
<input type="text" class="form-control" id="resetId" placeholder="hugo.zhang@example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="resetNewPassword" >新密码</label>
|
||||
<input type="password" class="form-control" id="resetNewPassword" placeholder="p@ssw0rd123">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="resetNewPasswordAgain">再次输入密码</label>
|
||||
<input type="password" class="form-control" id="resetNewPasswordAgain" placeholder="p@ssw0rd123">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<p style="color: red">邮件发送后,请在三十分钟之内登录邮箱确认!</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="resetPost">发送邮件</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- loading -->
|
||||
<div class="modal fade" id="resetPasswordLoading" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop='static'>
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">提示</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h1>正在发送邮件中...</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block content %} {% endblock %}
|
||||
<div class="footer">
|
||||
<div class="footer-nav">
|
||||
<a href="/index">首页</a>|
|
||||
<a href="http://www.mingrisoft.com">明日学院官网</a>|
|
||||
<a href="https://mall.jd.com/index-1000117165.html">明日科技京东自营店</a>|
|
||||
<a href="https://shop573124214.taobao.com">明日科技官方淘宝店铺</a>
|
||||
</div>
|
||||
<div id="j_footer" class="copy">吉林省明日科技有限公司
|
||||
<br>吉ICP备10002740号-2 增值电信业务经营许可证 吉B2-20150068
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(".login").mouseover(function(){
|
||||
$(".sub").show();
|
||||
}).mouseout(function(){
|
||||
$(".sub").hide();
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<script>
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' }
|
||||
});
|
||||
var loginSign;
|
||||
{% if not has_login %}
|
||||
// 点击登录
|
||||
$('#signInNormal').click(function () {
|
||||
refreshVcode('signin');
|
||||
$('#signInModalNormal').modal('show');
|
||||
$('#signInVcodeImg').click(function () {
|
||||
refreshVcode('signin');
|
||||
});
|
||||
$('#signInPost').click(function () {
|
||||
var email = $('#signInId').val();
|
||||
var password = $('#signInPassword').val();
|
||||
var vcode = $('#signInVcode').val();
|
||||
if(!checkEmail(email)){
|
||||
$('#signInId').val('');
|
||||
$('#signInId').attr('placeholder', '邮件格式错误');
|
||||
$('#signInId').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#signInId').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
if(!password){
|
||||
$('#signInPassword').attr('placeholder', '请填写密码');
|
||||
$('#signInPassword').css('border', '1px solid red');
|
||||
}else{
|
||||
$('#signInPassword').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
$.ajax({
|
||||
url: '/api/login_normal',
|
||||
data: {
|
||||
'email': email,
|
||||
'password': password,
|
||||
'sign': loginSign,
|
||||
'vcode': vcode
|
||||
},
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
success: function(res){
|
||||
if (res.status === 200){
|
||||
$('#signInModalNormal').modal('hide');
|
||||
window.location.href = '/index';
|
||||
}
|
||||
else if(res.status === 300001) {
|
||||
alert('用户名错误');
|
||||
}
|
||||
else if(res.status === 300002) {
|
||||
alert('密码错误');
|
||||
}
|
||||
else if(res.status === 300003) {
|
||||
alert('验证码错误');
|
||||
}
|
||||
else {
|
||||
alert('登录错误');
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
$('#signUp').click(function () {
|
||||
refreshVcode('signup');
|
||||
$('#signInModalNormal').modal('hide');
|
||||
$('#signUpModal').modal('show');
|
||||
$('#signInVcodeImg').click(function () {
|
||||
refreshVcode('signup');
|
||||
});
|
||||
});
|
||||
$('#signIn').click(function () {
|
||||
refreshVcode('signin');
|
||||
$('#signUpModal').modal('hide');
|
||||
$('#signInModalNormal').modal('show');
|
||||
$('#signInVcodeImg').click(function () {
|
||||
refreshVcode('signup');
|
||||
});
|
||||
});
|
||||
$('#signUpPost').click(function () {
|
||||
var email = $('#signUpId').val();
|
||||
var password = $('#signUpPassword').val();
|
||||
var passwordAgain = $('#signUpPasswordAgain').val();
|
||||
var vcode = $('#signUpVcode').val();
|
||||
if(!checkEmail(email)) {
|
||||
$('#signUpId').val('');
|
||||
$('#signUpId').attr('placeholder', '邮箱格式错误');
|
||||
$('#signUpId').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#signUpId').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
if(!(password === passwordAgain)) {
|
||||
$('#signUpPasswordAgain').val('');
|
||||
$('#signUpPasswordAgain').attr('placeholder', '两次密码输入不一致');
|
||||
$('#signUpPassword').css('border', '1px solid red');
|
||||
$('#signUpPasswordAgain').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#signUpPassword').css('border', '1px solid #C1FFC1');
|
||||
$('#signUpPasswordAgain').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
$.ajax({
|
||||
url: '/api/signup',
|
||||
type: 'post',
|
||||
data: {
|
||||
'email': email,
|
||||
'password': password,
|
||||
'password_again': passwordAgain,
|
||||
'sign': loginSign,
|
||||
'vcode': vcode
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
sign = res.data.sign;
|
||||
email = res.data.email;
|
||||
window.location.href = '/auth/signup_redirect?email=' + email + '&sign=' + sign;
|
||||
}
|
||||
else if(res.status === 300002) {
|
||||
alert('两次输入密码不一致');
|
||||
}
|
||||
else if(res.status === 300003) {
|
||||
alert('验证码错误');
|
||||
}
|
||||
else if(res.status === 300004) {
|
||||
alert('用户名已存在');
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
$('#resetPassword').click(function () {
|
||||
resetPassword();
|
||||
})
|
||||
});
|
||||
{% else %}
|
||||
var userId = {% if request.session.uid %}'{{ request.session.username|safe }}'{% else %}"登录"{% endif %}
|
||||
$('#signInButton').html(userId);
|
||||
strHTML = "<li><a href=\"/logout\">注销</a></li><li id=\"resetPassword\"><a href=\"#\">修改密码</a></li>";
|
||||
$('#signInDropdownMenu').html(strHTML);
|
||||
{% endif %}
|
||||
|
||||
$('#resetPassword').click(function () {
|
||||
resetPassword()
|
||||
});
|
||||
|
||||
$('#searchCom').click(function () {
|
||||
window.location.href = '/bs/search?uid={% if request.session.uid %}{{ request.session.uid.uid }}{% endif %}&keyword=' + $('#searchKeyWord').val();
|
||||
return false;
|
||||
});
|
||||
|
||||
var refreshVcode = function (label) {
|
||||
$.ajax({
|
||||
url: '/api/login_vcode',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
type: 'get',
|
||||
success: function (res) {
|
||||
if (res.status === 200) {
|
||||
loginSign = res.data.sign;
|
||||
if(label === 'signin') {
|
||||
$('#signInVcodeImg').attr('src', "data:image/png;base64," + res.data.vcode);
|
||||
}
|
||||
if(label === 'signup') {
|
||||
$('#signUpVcodeImg').attr('src', "data:image/png;base64," + res.data.vcode);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function getCookie(c_name)
|
||||
{
|
||||
if (document.cookie.length>0)
|
||||
{
|
||||
c_start=document.cookie.indexOf(c_name + "=");
|
||||
if (c_start!==-1)
|
||||
{
|
||||
c_start=c_start + c_name.length+1;
|
||||
c_end=document.cookie.indexOf(";",c_start);
|
||||
if (c_end===-1) c_end=document.cookie.length;
|
||||
return unescape(document.cookie.substring(c_start,c_end))
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
function setCookie(c_name,value,expiredays)
|
||||
{
|
||||
var exdate=new Date();
|
||||
exdate.setDate(exdate.getDate()+expiredays);
|
||||
document.cookie=c_name+ "=" +escape(value)+
|
||||
((expiredays==null) ? "" : "; expires="+exdate.toGMTString())
|
||||
}
|
||||
|
||||
function checkEmail(email) {
|
||||
return email.match('^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$')
|
||||
}
|
||||
|
||||
function checkPassword(password) {
|
||||
return password.match('^\\w{6,18}$');
|
||||
}
|
||||
|
||||
function resetPassword() {
|
||||
$('#signInModalNormal').modal('hide');
|
||||
$('#resetPasswordModal').modal('show');
|
||||
$('#resetPost').click(function () {
|
||||
var email = $('#resetId').val();
|
||||
var newPassword = $('#resetNewPassword').val();
|
||||
var newPasswordAgain = $('#resetNewPasswordAgain').val();
|
||||
if(!checkEmail(email)) {
|
||||
$('#resetId').val('');
|
||||
$('#resetId').attr('placeholder', '邮件格式错误');
|
||||
$('#resetId').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#resetId').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
if(!(newPassword === newPasswordAgain)){
|
||||
$('#resetNewPasswordAgain').val('');
|
||||
$('#resetNewPasswordAgain').attr('placeholder', '两次输入密码不一致');
|
||||
$('#resetNewPassword').css('border', '1px solid red');
|
||||
$('#resetNewPasswordAgain').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#resetNewPassword').css('border', '1px solid #C1FFC1');
|
||||
$('#resetNewPasswordAgain').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
$('#resetPasswordLoading').modal('show');
|
||||
$.ajax({
|
||||
url: '/api/resetpasswd',
|
||||
type: 'post',
|
||||
data: {
|
||||
'email': email,
|
||||
'new_password': newPassword,
|
||||
'new_password_again': newPasswordAgain
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
alert('发送成功!');
|
||||
window.location.href = '/index' + {% if request.session.uid %} '?uid={{ request.session.uid|safe }}'{% else %} '' {% endif %}
|
||||
}
|
||||
else if(res.status === 300005) {
|
||||
$('#sendMailLoading').modal('hide');
|
||||
alert('您已发送过邮件,请稍后再试');
|
||||
window.location.href = '/index' + {% if request.session.uid %} '?uid={{ request.session.uid|safe }}'{% else %} '' {% endif %}
|
||||
}
|
||||
else if(res.status === 300006) {
|
||||
alert('邮件发送失败');
|
||||
window.location.href = '/index' + {% if request.session.uid %} '?uid={{ request.session.uid|safe }}'{% else %} '' {% endif %}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
};
|
||||
$('#home').click(function () {
|
||||
window.location.href = '/index{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}';
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
133
web/templates/bussiness/index.html
Normal file
133
web/templates/bussiness/index.html
Normal file
@@ -0,0 +1,133 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}成为机构{% endblock %}
|
||||
{% block content %}
|
||||
<div class="main-content container" style="background: url(../static/images/form-bg.jpg) no-repeat center top;" >
|
||||
<div class="inner-content">
|
||||
{% if is_company_user %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<div class="alert alert-success">
|
||||
<strong>您当前登录的用户已经是机构成员了,无需再注册</strong><a href="/bs/set{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}"><b>点此</b></a>出题
|
||||
<a onclick="history.back(-1)" style="float:right"> <span class="glyphicon glyphicon-menu-left"></span><strong>返回上一页</strong></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row" style="margin-top: 10%;" >
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-5" style="font-size:16px">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading"><h3 class="panel-title">注册成为机构</h3></div>
|
||||
<div class="panel-body">
|
||||
<form id="bizRegistry" class="form-group">
|
||||
<label for="bizEmail">邮箱</label>
|
||||
<input type="text" class="form-control" id="bizEmail" placeholder="填写机构邮箱" />
|
||||
<label for="bizCompanyName">名称</label>
|
||||
<input type="text" class="form-control" id="bizCompanyName" placeholder="填写机构名称" />
|
||||
<label for="bizCompanyType">类型</label>
|
||||
<select id="bizCompanyType" class="form-control">
|
||||
{% for k, v in types.items %}
|
||||
<option value="{{ k }}">{{ v }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<label for="bizUsername">联系人</label>
|
||||
<input type="text" class="form-control" id="bizUsername" placeholder="填写机构联系人" />
|
||||
<label for="bizPhone">手机号</label>
|
||||
<input type="text" class="form-control" id="bizPhone" placeholder="填写联系人手机" />
|
||||
<input type="submit" id="bizSubmit" class="btn btn-primary" value="注册机构" style="float: right;margin-top: 20px" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('#bizSubmit').click(function () {
|
||||
var email = $('#bizEmail').val();
|
||||
var name = $('#bizCompanyName').val();
|
||||
var type = $('#bizCompanyType').val();
|
||||
var username = $('#bizUsername').val();
|
||||
var phone = $('#bizPhone').val();
|
||||
if(!email.match('^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$')) {
|
||||
$('#bizEmail').val('');
|
||||
$('#bizEmail').attr('placeholder', '邮箱格式错误');
|
||||
$('#bizEmail').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#bizEmail').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
if(!(name.match('^[a-zA-Z0-9_\\u4e00-\\u9fa5]{4,20}$'))) {
|
||||
$('#bizCompanyName').val('');
|
||||
$('#bizCompanyName').attr('placeholder', '请填写4-20中文字母数字或者下划线机构名称');
|
||||
$('#bizCompanyName').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#bizCompanyName').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
if(!(username.match('^[\u4E00-\u9FA5A-Za-z]+$'))){
|
||||
$('#bizUsername').val('');
|
||||
$('#bizUsername').attr('placeholder', '联系人姓名应该为汉字或大小写字母');
|
||||
$('#bizUsername').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#bizUsername').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
if(!(phone.match('^1[3|4|5|8][0-9]\\d{4,8}$'))){
|
||||
$('#bizPhone').val('');
|
||||
$('#bizPhone').attr('placeholder', '手机号不符合规则');
|
||||
$('#bizPhone').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#bizPhone').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
$.ajax({
|
||||
url: '/api/checkbiz',
|
||||
type: 'get',
|
||||
data: {
|
||||
'email': email
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
if(res.data.bizaccountexists) {
|
||||
alert('您的账户已存在,请直接登录');
|
||||
window.location.href = '/index';
|
||||
}
|
||||
else if(res.data.userexists && !res.data.bizaccountexists) {
|
||||
if(confirm('您的邮箱已被注册为普通用户,我们将会为您绑定该用户。')){
|
||||
bizPost(email, name, type, username, phone, 1);
|
||||
window.location.href = '/biz/notify?email=' + email + '&bind=1';
|
||||
}else {
|
||||
window.location.href = '/index{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}';
|
||||
}
|
||||
}
|
||||
else{
|
||||
bizPost(email, name, type, username, phone, 2);
|
||||
window.location.href = '/biz/notify?email=' + email;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
function bizPost(email, name, type, username, phone, flag) {
|
||||
$.ajax({
|
||||
url: '/api/regbiz',
|
||||
data: {
|
||||
'email': email,
|
||||
'name': name,
|
||||
'type': type,
|
||||
'username': username,
|
||||
'phone': phone,
|
||||
'flag': flag
|
||||
},
|
||||
type: 'post',
|
||||
dataType: 'json'
|
||||
})
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
103
web/templates/bussiness/result.html
Normal file
103
web/templates/bussiness/result.html
Normal file
@@ -0,0 +1,103 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}注册结果{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
{% if is_registered %}
|
||||
{% if bind %}
|
||||
<div class="row" style="min-height: 800px">
|
||||
<div class="span4">
|
||||
<div class="alert alert-success">
|
||||
<strong>注册成功!</strong><br /><a href="/">点此</a>返回首页登录
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row" style="min-height: 800px">
|
||||
<div class="span4">
|
||||
<div class="alert alert-success">
|
||||
<strong>注册成功!</strong>还差一步,您需要创建一个密码
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="bizResetId" class="control-label">邮箱</label>
|
||||
<input type="text" class="form-control" id="bizResetId" placeholder="hugo.zhang@example.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bizResetNewPassword" class="control-label">新密码</label>
|
||||
<input type="password" class="form-control" id="bizResetNewPassword" placeholder="p@ssw0rd123">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bizResetNewPasswordAgain" class="control-label">再次输入密码</label>
|
||||
<input type="password" class="form-control" id="bizResetNewPasswordAgain" placeholder="p@ssw0rd123">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<p style="color: red;float: left">邮件发送后,请在三十分钟之内登录邮箱确认!</p>
|
||||
<button type="button" class="btn btn-primary" style="float: right" id="bizResetPost">发送邮件</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<div class="alert alert-danger">
|
||||
<strong>机构注册失败!</strong>注册过程貌似出现了问题,请您联系<a href="/bs/contact{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}">管理员</a>以便找到解决办法。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<script>
|
||||
$('#bizResetPost').click(function () {
|
||||
var email = $('#bizResetId').val();
|
||||
var newPassword = $('#bizResetNewPassword').val();
|
||||
var newPasswordAgain = $('#bizResetNewPasswordAgain').val();
|
||||
if(!checkEmail(email)) {
|
||||
$('#bizResetId').val('');
|
||||
$('#bizResetId').attr('placeholder', '邮件格式错误');
|
||||
$('#bizResetId').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#bizResetId').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
if(!(newPassword === newPasswordAgain)){
|
||||
$('#bizResetNewPasswordAgain').val('');
|
||||
$('#bizResetNewPasswordAgain').attr('placeholder', '两次输入密码不一致');
|
||||
$('#bizResetNewPassword').css('border', '1px solid red');
|
||||
$('#bizResetNewPasswordAgain').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#bizResetNewPassword').css('border', '1px solid #C1FFC1');
|
||||
$('#bizResetNewPasswordAgain').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
$.ajax({
|
||||
url: '/api/resetpasswd',
|
||||
type: 'post',
|
||||
data: {
|
||||
'email': email,
|
||||
'new_password': newPassword,
|
||||
'new_password_again': newPasswordAgain,
|
||||
'is_biz': 1
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
alert('发送成功!请您登录邮箱验证一下您的账户');
|
||||
window.location.href = '/index'
|
||||
}
|
||||
if(res.status === 300005) {
|
||||
alert('邮件正在发送中,请稍等...');
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
343
web/templates/competition/game.html
Normal file
343
web/templates/competition/game.html
Normal file
@@ -0,0 +1,343 @@
|
||||
{% extends '../base.html' %}
|
||||
{% block title %}开始答题{% endblock %}
|
||||
{% block content %}
|
||||
<div class="main-content container">
|
||||
<div class="position toInWhere">
|
||||
<b>当前位置:</b><span>
|
||||
<a onclick="history.back(-1)">比赛信息</a>
|
||||
</span> > <span>{{ kind_name }}</span>
|
||||
</div>
|
||||
<div class="inner-content">
|
||||
<div class="border teston mb-15 zycs_ceshi" style="display: block;">
|
||||
<div class="teston-top">
|
||||
<img src="/static/images/teston-top.jpg">
|
||||
<h1>{{ kind_name }}</h1>
|
||||
<div class="process">
|
||||
<span class="n2">倒计时:</span>
|
||||
<span class="n2" style="color:#e4653d" id="timetext">{% if period_time %}{{ period_time }}分00秒{% else %}无限制{% endif %}</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="lead" style="color: #337ab7;">
|
||||
Q: <label id="question"></label>
|
||||
</p>
|
||||
<div id="choiceBox" class="checkbox" style="border: #31b0d5;padding-left:40%;font-size:18px;">
|
||||
<div class="radio">
|
||||
<label id="item1Answer">
|
||||
<input type="radio" name="itemRadios" id="itemRadio1" value="item1">
|
||||
<label id="item1" for="itemRadio1"></label>
|
||||
</label>
|
||||
</div>
|
||||
<br />
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="itemRadios" id="itemRadio2" value="item2">
|
||||
<label id="item2" for="itemRadio2"></label>
|
||||
</label>
|
||||
</div>
|
||||
<br />
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="itemRadios" id="itemRadio3" value="item3">
|
||||
<label id="item3" for="itemRadio3"></label>
|
||||
</label>
|
||||
</div>
|
||||
<br />
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="itemRadios" id="itemRadio4" value="item4">
|
||||
<label id="item4" for="itemRadio4"></label>
|
||||
</label>
|
||||
</div>
|
||||
<div class="hidden">
|
||||
<label>
|
||||
<input type="radio" name="itemRadios" id="itemRadioPk" value="pk">
|
||||
<label id="itemPk"></label>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fullinBox" class="form-inline" style="text-align:center">
|
||||
<input type="text" class="form-control" id="answerF" placeholder="请输入答案" style="width:400px" />
|
||||
<input type="hidden" id="answerPk" />
|
||||
</div>
|
||||
<div style="margin-top: 80px;text-align:center">
|
||||
<div id="preQuestion" class="btn btn-primary">后退</div>
|
||||
<div id="nextQuestion" class="btn btn-primary" style="margin-left: 110px;">前进</div>
|
||||
<input class="btn btn-danger" type="submit" style="margin-left: 110px;" id="answerSubmit" value="交卷" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- loading -->
|
||||
<div class="modal fade" id="loadingModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop='static'>
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">提示</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h1>正在准备题库...</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
|
||||
});
|
||||
var currentPage = 1;
|
||||
var hasPrevious = false;
|
||||
var hasNext = false;
|
||||
var questionNum = 0;
|
||||
var response;
|
||||
var answerDict;
|
||||
$(document).ready(function () {
|
||||
if({{ period_time|safe }}) {
|
||||
startTimer1();
|
||||
}
|
||||
$('#loadingModal').modal('show');
|
||||
uid = '{{ user_info.uid|safe }}';
|
||||
kind_id = '{{ kind_id|safe }}';
|
||||
$.ajax({
|
||||
url: '/api/questions',
|
||||
type: 'get',
|
||||
data: {
|
||||
'uid': uid,
|
||||
'kind_id': kind_id
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
response = res;
|
||||
questionNum = res.data.kind_info.question_num;
|
||||
answerDict = new Array(questionNum);
|
||||
for(var i=0; i < questionNum; i++){
|
||||
if(response.data.questions[i].qtype === 'choice') {
|
||||
answerDict['c_' + response.data.questions[i].pk] = '';
|
||||
}else{
|
||||
answerDict['f_' + response.data.questions[i].pk] = '';
|
||||
}
|
||||
}
|
||||
// 取答案中的第一个值
|
||||
if(res.data.questions[0].qtype === 'choice') { // 选择题的情况
|
||||
$('#question').html(res.data.questions[0].question); // currentPage - 1
|
||||
$('#item1').html(res.data.questions[0].items[0]);
|
||||
$('#item2').html(res.data.questions[0].items[1]);
|
||||
$('#item3').html(res.data.questions[0].items[2]);
|
||||
$('#item4').html(res.data.questions[0].items[3]);
|
||||
$('#itemPk').html('c_' + res.data.questions[0].pk);
|
||||
hasNext = (currentPage < questionNum);
|
||||
$('#fullinBox').hide();
|
||||
} else{ // 填空题的情况
|
||||
$('#question').html(res.data.questions[0].question.replace('##', '______'));
|
||||
$('#answerPk').val('f_' + res.data.questions[0].pk);
|
||||
hasNext = (currentPage < questionNum);
|
||||
$('#choiceBox').hide();
|
||||
}
|
||||
$('#loadingModal').modal('hide');
|
||||
}
|
||||
});
|
||||
// 点击前进的情况
|
||||
$('#preQuestion').click(function () {
|
||||
if(hasPrevious){
|
||||
removeChecked();
|
||||
clearInputData();
|
||||
currentPage = currentPage - 1;
|
||||
if(response.data.questions[currentPage - 1].qtype === 'choice') {
|
||||
$('#choiceBox').show();
|
||||
var pk = response.data.questions[currentPage - 1].pk;
|
||||
$('#question').html(response.data.questions[currentPage - 1].question);
|
||||
$('#item1').html(response.data.questions[currentPage - 1].items[0]);
|
||||
$('#item2').html(response.data.questions[currentPage - 1].items[1]);
|
||||
$('#item3').html(response.data.questions[currentPage - 1].items[2]);
|
||||
$('#item4').html(response.data.questions[currentPage - 1].items[3]);
|
||||
$('#itemPk').html('c_' + response.data.questions[currentPage - 1].pk);
|
||||
// 记住之前的选项
|
||||
if (answerDict['c_' + pk]) {
|
||||
if (answerDict['c_' + pk] === "A") {
|
||||
$('#itemRadio1').prop('checked', true);
|
||||
}
|
||||
if (answerDict['c_' + pk] === "B") {
|
||||
$('#itemRadio2').prop('checked', true);
|
||||
}
|
||||
if (answerDict['c_' + pk] === "C") {
|
||||
$('#itemRadio3').prop('checked', true);
|
||||
}
|
||||
if (answerDict['c_' + pk] === "D") {
|
||||
$('#itemRadio4').prop('checked', true);
|
||||
}
|
||||
}
|
||||
$('#fullinBox').hide();
|
||||
hasPrevious = currentPage > 1;
|
||||
hasNext = currentPage < questionNum
|
||||
}else{
|
||||
var pk2 = response.data.questions[currentPage - 1].pk;
|
||||
$('#fullinBox').show();
|
||||
$('#question').html(response.data.questions[currentPage - 1].question.replace('##', '______'));
|
||||
$('#answerPk').val(response.data.questions[currentPage - 1].pk);
|
||||
if(answerDict['f_' + pk2]) {
|
||||
$('#answerF').val(answerDict['f_' + pk2]);
|
||||
}
|
||||
$('#choiceBox').hide();
|
||||
hasPrevious = currentPage > 1;
|
||||
hasNext = currentPage < questionNum
|
||||
}
|
||||
}else{
|
||||
alert('没有题目了');
|
||||
}
|
||||
});
|
||||
// 点击后退的情况
|
||||
$('#nextQuestion').click(function () {
|
||||
if(hasNext){
|
||||
removeChecked();
|
||||
clearInputData();
|
||||
currentPage = currentPage + 1;
|
||||
if(response.data.questions[currentPage - 1].qtype === 'choice') {
|
||||
$('#choiceBox').show();
|
||||
var pk = response.data.questions[currentPage - 1].pk;
|
||||
$('#question').html(response.data.questions[currentPage - 1].question);
|
||||
$('#item1').html(response.data.questions[currentPage - 1].items[0]);
|
||||
$('#item2').html(response.data.questions[currentPage - 1].items[1]);
|
||||
$('#item3').html(response.data.questions[currentPage - 1].items[2]);
|
||||
$('#item4').html(response.data.questions[currentPage - 1].items[3]);
|
||||
$('#itemPk').html('c_' + response.data.questions[currentPage - 1].pk);
|
||||
if (answerDict['c_' + pk]) {
|
||||
if (answerDict['c_' + pk] === "A") {
|
||||
$('#itemRadio1').prop('checked', true);
|
||||
}
|
||||
if (answerDict['c_' + pk] === "B") {
|
||||
$('#itemRadio2').prop('checked', true);
|
||||
}
|
||||
if (answerDict['c_' + pk] === "C") {
|
||||
$('#itemRadio3').prop('checked', true);
|
||||
}
|
||||
if (answerDict['c_' + pk] === "D") {
|
||||
$('#itemRadio4').prop('checked', true);
|
||||
}
|
||||
}
|
||||
$('#fullinBox').hide();
|
||||
hasPrevious = currentPage > 1;
|
||||
hasNext = currentPage < questionNum
|
||||
}else{
|
||||
var pk1 = response.data.questions[currentPage - 1].pk;
|
||||
$('#fullinBox').show();
|
||||
$('#question').html(response.data.questions[currentPage - 1].question.replace('##', '______'));
|
||||
$('#answerPk').val(response.data.questions[currentPage - 1].pk);
|
||||
if(answerDict['f_' + pk1]) {
|
||||
$('#answerF').val(answerDict['f_' + pk1]);
|
||||
}
|
||||
$('#choiceBox').hide();
|
||||
hasPrevious = currentPage > 1;
|
||||
hasNext = currentPage < questionNum
|
||||
}
|
||||
}else{
|
||||
alert('没有题目了');
|
||||
}
|
||||
});
|
||||
$('#itemRadio1').click(function () {
|
||||
var pk = $('#itemPk').html();
|
||||
answerDict[pk] = "A";
|
||||
});
|
||||
$('#itemRadio2').click(function () {
|
||||
var pk = $('#itemPk').html();
|
||||
answerDict[pk] = "B";
|
||||
});
|
||||
$('#itemRadio3').click(function () {
|
||||
var pk = $('#itemPk').html();
|
||||
answerDict[pk] = "C";
|
||||
});
|
||||
$('#itemRadio4').click(function () {
|
||||
var pk = $('#itemPk').html();
|
||||
answerDict[pk] = "D";
|
||||
});
|
||||
$('#answerF').on('change', function () {
|
||||
var pk = response.data.questions[currentPage - 1].pk;
|
||||
var vl = $('#answerF').val().trim();
|
||||
if(vl !== ''){
|
||||
answerDict['f_' + pk] = vl;
|
||||
}
|
||||
});
|
||||
// 提交答案
|
||||
$('#answerSubmit').click(function () {
|
||||
if(window.confirm("确认提交答案吗?")) {
|
||||
if({{ period_time|safe }}) {
|
||||
stopTimer1();
|
||||
}
|
||||
var answer = "";
|
||||
for (var key in answerDict) {
|
||||
if (!answer) {
|
||||
answer = String(key) + "," + answerDict[key] + "#";
|
||||
}else{
|
||||
answer += String(key) + "," + answerDict[key] + "#";
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
url: '/api/answer',
|
||||
type: 'post',
|
||||
data: {
|
||||
'qa_id': response.data.qa_id,
|
||||
'uid': response.data.user_info.uid,
|
||||
'kind_id': kind_id,
|
||||
'answer': answer
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
window.location.href = "/bs/result?uid=" + res.data.user_info.uid + "&kind_id=" + res.data.kind_id + "&qa_id=" + res.data.qa_id;
|
||||
}else{
|
||||
alert('提交失败');
|
||||
}
|
||||
}
|
||||
})
|
||||
}else {}
|
||||
})
|
||||
});
|
||||
|
||||
function clearInputData() {
|
||||
$('#answerF').val('');
|
||||
}
|
||||
|
||||
function removeChecked() {
|
||||
$('#itemRadio1').prop('checked', false);
|
||||
$('#itemRadio2').prop('checked', false);
|
||||
$('#itemRadio3').prop('checked', false);
|
||||
$('#itemRadio4').prop('checked', false);
|
||||
}
|
||||
|
||||
/// 初始化: 248分钟 = 4 小时 7 分钟 59 秒 1000 毫秒
|
||||
var hour,minute,second;//时 分 秒
|
||||
var periodTime = {{ period_time|safe }}; // 后台配置时间(单位:min)
|
||||
hour = parseInt(periodTime / 60);
|
||||
minute = periodTime - (hour * 60) - 1;
|
||||
second = 60;
|
||||
var int;
|
||||
var notice = false;
|
||||
|
||||
totalSeconds = periodTime * 60; // 总秒数
|
||||
|
||||
function startTimer1() {
|
||||
int = setInterval(timer1, 100);
|
||||
}
|
||||
|
||||
function timer1() {
|
||||
totalSeconds -= 0.1;
|
||||
if(totalSeconds<=0){
|
||||
stopTimer1();
|
||||
}else {
|
||||
hour = parseInt(totalSeconds / 3600);
|
||||
minute = parseInt((totalSeconds - hour * 3600) / 60);
|
||||
second = totalSeconds - hour * 3600 - minute * 60;
|
||||
}
|
||||
if(totalSeconds<=300 && !notice){
|
||||
notice = confirm("您只剩下不到五分钟的答题时间,超时将不计入排行榜。");
|
||||
}
|
||||
if(totalSeconds < 0){
|
||||
notice = confirm("您已超时,考试成绩不计入排行榜。");
|
||||
window.history.back(-1);
|
||||
}
|
||||
$("#timetext").text(hour+'时'+minute+'分'+Math.ceil(second)+'秒');
|
||||
}
|
||||
|
||||
function stopTimer1() {
|
||||
window.clearInterval(int);
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
43
web/templates/competition/games.html
Normal file
43
web/templates/competition/games.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{% extends '../base.html' %}
|
||||
{% block title %}比赛列表{% endblock %}
|
||||
{% block content %}
|
||||
<div class="main-content container">
|
||||
<div class="position toInWhere">
|
||||
<b>当前位置:</b><span>
|
||||
<a onclick="history.back(-1)">比赛列表</a>
|
||||
</span> > <span>比赛详情</span>
|
||||
</div>
|
||||
<div class="inner-content">
|
||||
<div class="xxzxBox">
|
||||
<div class="tab-content bd">
|
||||
<div role="tabpanel" class="active tab-pane">
|
||||
<ul class="ul_zxlist" id="column_ul">
|
||||
{% if not kinds %}
|
||||
<div style="text-align:center">
|
||||
<img src="/static/images/no-bs.png">
|
||||
</div>
|
||||
{% else %}
|
||||
{% for kind in kinds%}
|
||||
<li style="border: 1px solid #ccc;border-radius: 10px;margin:10px;">
|
||||
<a href="{% url 'bs:index' %}?uid={{ request.session.uid }}&kind_id={{kind.kind_id}}">
|
||||
<span class="start_time"><b>{{ kind.created_at|date:"Y-m" }}</b><i>{{ kind.created_at|date:"d" }}</i></span>
|
||||
<h1 title="{{ kind.kind_name }}">
|
||||
{{ kind.kind_name }}
|
||||
</h1>
|
||||
<p>赞助商:{{ kind.sponsor_name }}</p>
|
||||
<p style="padding:5px 0">结束时间:{{ kind.cop_finishat|date:"Y-m-d" }}</p>
|
||||
<div class="badge" style="float:right;margin-top: -40px;">
|
||||
<small style="color:yellow;">热度:</small>
|
||||
<small style="color:yellow"> {{ kind.total_partin_num }}</small>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
169
web/templates/competition/index.html
Normal file
169
web/templates/competition/index.html
Normal file
@@ -0,0 +1,169 @@
|
||||
{% extends '../base.html' %}
|
||||
{% block title %}比赛首页{% endblock %}
|
||||
{% block content %}
|
||||
<div class="main-content container">
|
||||
<div class="position toInWhere">
|
||||
<b>当前位置:</b><span>
|
||||
<a href="/">首页</a>
|
||||
</span> > <span>比赛列表</span>
|
||||
</div>
|
||||
<div class="inner-content">
|
||||
<div class="xxdj-report border zycs_text">
|
||||
<div class="course-report">
|
||||
<h1>{{kind_info.kind_name}}</h1>
|
||||
<div class="wid775 div-course">
|
||||
<h2 class="test-mb40">
|
||||
<span id="username">{{ request.session.username }}</span>
|
||||
同学:你好!
|
||||
</h2>
|
||||
<ul class="ul-report" style="padding-left:0">
|
||||
<li class="list-group-item">出题机构:{{ kind_info.sponsor_name }}</li>
|
||||
<li class="list-group-item">题目总分:{{ kind_info.total_score }}</li>
|
||||
<li class="list-group-item">题目数量:{{ kind_info.question_num }}</li>
|
||||
<li class="list-group-item">题库大小:{{ bank_info.total_question_num }}道题</li>
|
||||
<li class="list-group-item">开始时间:{{ kind_info.cop_startat }}</li>
|
||||
<li class="list-group-item">结束时间:{{ kind_info.cop_finishat }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="center-p">
|
||||
<a id="startAnswer" href="#" class="btn btn-primary" >开始挑战</a>
|
||||
<a href="/bs/rank?uid={{ user_info.uid }}&kind_id={{ kind_info.kind_id }}" class="btn btn-success" >查看排行榜</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="formModal" class="modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<button class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-title">
|
||||
<h2 class="text-center">请先填写一些答题必要的信息</h2>
|
||||
</div>
|
||||
<div id="frmBody" class="modal-body">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' }
|
||||
});
|
||||
var isShowUserinfo = {{ is_show_userinfo|safe }};
|
||||
var userinfoHasEntered = {{ userinfo_has_enterd|safe }};
|
||||
var fields = {{ userinfo_fields|safe }};
|
||||
var optionFields = {{ option_fields|safe }};
|
||||
var fieldRegexes = {{ field_regexes|safe }};
|
||||
var optionFieldNameList = [];
|
||||
if (optionFields){
|
||||
for(var i in optionFields.split('#')){
|
||||
optionFieldNameList[i]=optionFields.split('#')[i].split(':')[0]
|
||||
}
|
||||
}
|
||||
$('#startAnswer').click(function () {
|
||||
if(isShowUserinfo && !userinfoHasEntered){
|
||||
var strHTML = "<form id=\"formBody\" class=\"form-group\">";
|
||||
for(var i in fields){
|
||||
if(!checkInList(i, optionFieldNameList)){
|
||||
strHTML += "<div class=\"form-group\">";
|
||||
strHTML += "<label for=\"frmId" + i + "\">" + fields[i] + "</label>";
|
||||
strHTML += "<input id=\"frmId" + i + "\" class=\"form-control\" type=\"text\" placeholder=\"\">";
|
||||
strHTML += "</div>";
|
||||
}else if(checkInList(i, optionFieldNameList)){
|
||||
opl = optionFields.split('#');
|
||||
for(var j in opl) {
|
||||
if(opl[j].startsWith(i)) {
|
||||
strHTML += "<label for=\"frmId" + i + "\">" + fields[i] + "</label>";
|
||||
strHTML += "<select id=\"frmId" + i + "\" class=\"form-control\">\n";
|
||||
var t = opl[j].split(':')[1].split(',');
|
||||
for(var k in t) {
|
||||
strHTML += "<option>" + t[k] + "</option>\n";
|
||||
}
|
||||
strHTML += "</select>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
}
|
||||
}
|
||||
|
||||
strHTML += "<br />";
|
||||
strHTML += "<div class=\"text-right\">\n" +
|
||||
"<button id=\"frmSubmit\" class=\"btn btn-primary\" type=\"submit\">提交</button>\n" +
|
||||
"<button id=\"frmCancel\" class=\"btn btn-danger\" data-dismiss=\"modal\">取消</button>\n" +
|
||||
"</div>";
|
||||
strHTML += "</form>";
|
||||
|
||||
document.getElementById('frmBody').innerHTML = strHTML;
|
||||
|
||||
$('#formModal').modal('show');
|
||||
$('#frmSubmit').click(function () {
|
||||
var result = '';
|
||||
for(var i in fields){
|
||||
if(!$('#frmId' + i).val().match(getRegex(fieldRegexes, i))) {
|
||||
$('#frmId' + i).attr('placeholder', getRegexDesc(fieldRegexes, i));
|
||||
$('#frmId' + i).css('border', '1px solid red');
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$('#frmId' + i).css('border', '1px solid #C1FFC1');
|
||||
result += i + ',' + $('#frmId' + i).val() + '#';
|
||||
}
|
||||
}
|
||||
if(result) {
|
||||
$.ajax({
|
||||
url: "/api/entry",
|
||||
data: {
|
||||
'kind_id': '{{ kind_info.kind_id|safe }}',
|
||||
'uid': '{{ user_info.uid|safe }}',
|
||||
'result': result,
|
||||
},
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.status === 200) {
|
||||
window.location.href = '/bs/game?uid=' + res.data.user_info.uid + '&kind_id=' + res.data.kind_info.kind_id;
|
||||
} else {
|
||||
alert('提交失败');
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
}else
|
||||
{
|
||||
window.location.href = '{% url 'bs:game' %}?uid={{ user_info.uid }}&kind_id={{ kind_info.kind_id }}';
|
||||
}
|
||||
});
|
||||
|
||||
function checkInList(s, l) {
|
||||
for(var i in l){
|
||||
if(s === l[i]){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getRegex(l, field) {
|
||||
for(var i in l){
|
||||
if(l[i].field_name === field) {
|
||||
return l[i].regex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getRegexDesc(l, field) {
|
||||
for(var i in l){
|
||||
if(l[i].field_name === field) {
|
||||
return l[i].description;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
81
web/templates/competition/rank.html
Normal file
81
web/templates/competition/rank.html
Normal file
@@ -0,0 +1,81 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}排行榜{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<div class="main-content container">
|
||||
<div class="position toInWhere">
|
||||
<b>当前位置:</b><span>
|
||||
<a onclick="canNav(2,0);">比赛结果</a>
|
||||
</span> > <span>排行榜</span>
|
||||
</div>
|
||||
<div class="inner-content">
|
||||
<div class="xxdj-report border zycs_text" style="min-height: 1000px;">
|
||||
<div class="course-report">
|
||||
<h1 style="background: url(../static/images/course-h1.jpg) no-repeat center top;">排行榜</h1>
|
||||
<div class="col-md-9">
|
||||
<div class="course-report">
|
||||
<table style="margin-top: 15px;" class="table table-hover">
|
||||
<tr>
|
||||
<th>排名</th>
|
||||
<th>昵称</th>
|
||||
<th>得分</th>
|
||||
<th>用时</th>
|
||||
</tr>
|
||||
{% for r in rank %}
|
||||
<tr>
|
||||
<td>{% if r.rank %}<b style="color:red">{{ r.rank }}</b>{% else %}暂无{% endif %}</td>
|
||||
<td>{% if r.nickname %}{{ r.nickname }}{% else %}暂无{% endif %}</td>
|
||||
<td>{% if r.score %}{{ r.score }}{% else %}0{% endif %}</td>
|
||||
<td>{% if r.time %}{{ r.time }}{% else %}暂无{% endif %}s</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="margin-top: 20px;padding-left: 20px;">
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading panel-danger" style="text-align:center">历史最佳排名</div>
|
||||
<div class="panel-body" id="myRank">
|
||||
<div id="myResult">
|
||||
|
||||
</div>
|
||||
<div style="padding: 10px 0">
|
||||
<a class="btn btn-info" href="/index{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}">回首页</a>
|
||||
<a class="btn btn-info" href="/bs{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}&kind_id={{ kind_info.kind_id }}" style="margin-left: 20px;">去答题</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer panel-success"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$.ajax({
|
||||
url: '/api/myrank',
|
||||
data: {
|
||||
uid: '{{ request.session.uid|safe }}',
|
||||
kind_id: '{{ kind_info.kind_id|safe }}'
|
||||
},
|
||||
dataType: 'json',
|
||||
type: 'get',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
var rank = res.data.rank;
|
||||
var timer = res.data.time / 1000 ;
|
||||
if (rank){
|
||||
var myResult = '<label><h4><b>我的排名:</b> 第<span class="rank" style="color:red">'+ rank + '</span>名</h4></label>'
|
||||
+ '<label><h4><b>我的用时:</b> <span class="timer" style="color:red">' + timer + '</span>秒</h4></label>'
|
||||
}else {
|
||||
var myResult = '<label><h4>您还没有参加比赛哦!<label><h4>'
|
||||
}
|
||||
$('#myResult').html(myResult)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
65
web/templates/competition/result.html
Normal file
65
web/templates/competition/result.html
Normal file
@@ -0,0 +1,65 @@
|
||||
{% extends '../base.html' %}
|
||||
{% load static %}
|
||||
{% block title %}答题结果{% endblock %}
|
||||
{% block content %}
|
||||
<div class="main-content container">
|
||||
<div class="position toInWhere">
|
||||
<b>当前位置:</b><span>
|
||||
<a onclick="canNav(2,0);">比赛结果</a>
|
||||
</span> > <span>成绩单</span>
|
||||
</div>
|
||||
<div class="inner-content">
|
||||
<div class="xxdj-report border zycs_text">
|
||||
<div class="course-report">
|
||||
<h1>{{kind_info.kind_name}}</h1>
|
||||
<div class="wid775 div-course">
|
||||
<h2 class="test-mb40">
|
||||
<span id="username">{{ request.session.username }}</span>
|
||||
同学的成绩单
|
||||
</h2>
|
||||
<ul class="list-group">
|
||||
{% if rank <= 3 %}
|
||||
<li class="list-group-item list-group-item-success">得分: <b>{{ qa_info.score }}</b> 分</li>
|
||||
<li class="list-group-item list-group-item-success">耗时: <b>{{ qa_info.time }}</b> s</li>
|
||||
<li class="list-group-item list-group-item-success">答对题数: <b>{{ qa_info.correct_num }}</b></li>
|
||||
<li class="list-group-item list-group-item-success">答错题数: <b>{{ qa_info.incorrect_num }}</b></li>
|
||||
<li class="list-group-item list-group-item-success">
|
||||
当前排名: 第 <b style="color: red;font-size: 20px;">{{ rank }}</b> 名
|
||||
<h4 style="color:gray;font-size: 20px;text-align: center;">成绩不错,继续努力哦~</h4>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="list-group-item list-group-item-danger">得分: <b>{{ qa_info.score }}</b> 分</li>
|
||||
<li class="list-group-item list-group-item-danger">耗时: <b>{{ qa_info.time }}</b> s</li>
|
||||
<li class="list-group-item list-group-item-danger">答对题数: <b>{{ qa_info.correct_num }}</b></li>
|
||||
<li class="list-group-item list-group-item-danger">答错题数: <b>{{ qa_info.incorrect_num }}</b></li>
|
||||
<li id="currentRank" class="list-group-item list-group-item-danger">
|
||||
当前排名: 第 <b style="color: red;font-size: 20px;">{{ rank }}</b> 名
|
||||
<h4 style="color:gray;font-size: 20px;text-align: center;">成绩不理想,再试试吧~</h4>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="center-p">
|
||||
<li id="goBack" class="btn btn-primary" style="margin-top: 36px;">回首页</li>
|
||||
<li id="tryAgain" class="btn btn-primary" style="margin: 36px 30px 0 30px">再试试</li>
|
||||
<li id="goRank" class="btn btn-success" style="margin-top: 36px; ">查看排行榜</li>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('#goRank').click(function () {
|
||||
window.location.href = '/bs/rank?uid={{ request.session.uid }}&kind_id={{ kind_info.kind_id }}';
|
||||
});
|
||||
$('#tryAgain').click(function () {
|
||||
window.location.href = '/bs?uid={{ request.session.uid }}&kind_id={{ kind_info.kind_id }}';
|
||||
});
|
||||
$('#goHome').click(function () {
|
||||
window.location.href = '/index{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}';
|
||||
});
|
||||
$('#goBack').click(function () {
|
||||
window.location.href = '/index{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}';
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
10
web/templates/competition/search.html
Normal file
10
web/templates/competition/search.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}查询结果{% endblock %}
|
||||
{% block content %}
|
||||
<div class="list-group ">
|
||||
<h2 class="text-center">查询结果</h2><br />
|
||||
{% for r in result %}
|
||||
<a href="{% url 'bs:index' %}?uid={{ request.session.uid }}&kind_id={{ r.kind_id }}" class="list-group-item">{{ r.kind_name }}<p style="float: right">举办机构: {% if r.sponsor_name == None %} 无 {% else %} {{ r.sponsor_name }} {% endif %}</p></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
19
web/templates/err.html
Normal file
19
web/templates/err.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% block title %}{{ errtitle }}{% endblock %}\
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row" style="min-height: 800px;">
|
||||
<div class="span4" style="text-align: center;">
|
||||
<div class="alert alert-danger">
|
||||
<strong>出错了/(ㄒoㄒ)/~~</strong> {{ errmsg }}
|
||||
<a href="#" onclick="history.back(-1);" style="float:right">
|
||||
<span class="glyphicon glyphicon-menu-left"></span>
|
||||
<strong>返回上一页</strong>
|
||||
</a>
|
||||
</div>
|
||||
<img src="{% static 'img/404.png' %}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
90
web/templates/setgames/bank.html
Normal file
90
web/templates/setgames/bank.html
Normal file
@@ -0,0 +1,90 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}我要出题{% endblock %}
|
||||
{% block content %}
|
||||
<style>
|
||||
input { width:90%; }
|
||||
</style>
|
||||
<div class="main-content container">
|
||||
<div class="union-col5 pr">
|
||||
<div class="container">
|
||||
<div class="union-title-black">创建题库流程</div>
|
||||
<ul>
|
||||
<li class="img01"><p>下载题库</p>
|
||||
</li>
|
||||
<li class="noImg"> </li>
|
||||
<li class="img02"><p>题库名称</p>
|
||||
</li>
|
||||
<li class="noImg"> </li>
|
||||
<li class="img03"><p>题库类型</p>
|
||||
</li>
|
||||
<li class="noImg"> </li>
|
||||
<li class="img04"><p>上传文件</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% if not created %}
|
||||
<form id="uploadFileForm" method="post" action="/bs/set/bank/upbank" enctype="multipart/form-data">{% csrf_token %}
|
||||
<div id="uploadMainRow" class="row" style="margin-top: 120px;">
|
||||
<div class="col-md-3">
|
||||
<label>① 下载题库</label>
|
||||
<p style="color: gray;margin-top: 5px;"><a id="tDownload" href="/bs/set/bank/tdownload?uid={{ user_info.uid }}" class="btn btn-success btn-sm">下载</a> 简易模板,按照模板中的要求修改题库。</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="bankName">② 题库名称</label>
|
||||
<input id="bankName" name="bank_name" type="text" class="form-control" placeholder="请输入题库名称" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="choicedValue">③ 题库类型</label>
|
||||
<div class="dropdown" style="margin: 0 10px">
|
||||
<input type="text" readonly id="choicedValue" class="btn btn-primary dropdown-toggle form-control" data-toggle="dropdown"
|
||||
style="color:white;background-color:#3c97e6" name="bank_type" value="选择一个题库类型" />
|
||||
<div class="dropdown-menu">
|
||||
{% for t in bank_types %}
|
||||
<div class="btn btn-primary form-control" onclick="choiceBankType(this)">{{ t.name }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="row" style="margin-left:-1px;">
|
||||
<label for="uploadFile">④ 上传文件</label>
|
||||
<input class="form-control" name="template" type="file" style="text-align: inherit" id="uploadFile">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="uid" value="{{ user_info.uid }}" />
|
||||
</div>
|
||||
<div class="row" style="margin-top:35px;">
|
||||
<input type="submit" id="startUpload" class="btn-union-col5" style="float: right" value="开始录制">
|
||||
</div>
|
||||
</form>
|
||||
<script src="../../static/js/csrf.js"></script>
|
||||
<script type="text/javascript">
|
||||
var choicedBankType;
|
||||
var responseTypes = {{ bank_types|safe }};
|
||||
var choiceBankType = function (t) {
|
||||
var cbt = $(t).html();
|
||||
for(var i in responseTypes){
|
||||
if(responseTypes[i].name === cbt){
|
||||
choicedBankType = responseTypes[i].id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$('#choicedValue').val(cbt);
|
||||
}
|
||||
|
||||
</script>
|
||||
{% else %}
|
||||
<div class="span4">
|
||||
<div class="alert alert-success">
|
||||
<strong>创建成功!</strong><br />
|
||||
<p>本次创建{{ created.choice_num }}道选择题和{{ created.fillinblank_num }}道填空题</p><br />
|
||||
<a href="/bs/set{% if request.session.uid %}?uid={{ request.session.uid }}{% else %}{% endif %}"><strong>点我</strong></a>继续创建
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
455
web/templates/setgames/game.html
Normal file
455
web/templates/setgames/game.html
Normal file
@@ -0,0 +1,455 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load staticfiles %}
|
||||
{% block title %}配置比赛{% endblock %}
|
||||
{% block content %}
|
||||
<style>
|
||||
.save-button {
|
||||
margin-top: 25px;
|
||||
width: 239px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
background: #d9534f;
|
||||
color: #fff;
|
||||
font-size: 24px;
|
||||
border-radius: 3px;
|
||||
border: 0;
|
||||
margin-left: -150px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="main-content container" style="background: url(/static/images/form-bg.jpg) no-repeat center top;">
|
||||
<div class="inner-content" style="padding-top:50px;color: white;">
|
||||
<div class="union-title-black" style="color:white">配置比赛</div>
|
||||
<div class="col-md-2" style="margin-left: 60px">
|
||||
<div class="row">
|
||||
<h3>选择题库</h3>
|
||||
<label for="bankType">题库类型</label>
|
||||
<div id="bankType" class="dropdown">
|
||||
<input type="button" style="height: 40px;width: 80px" id="choicedValue" class="btn btn-info dropdown-toggle" data-toggle="dropdown" name="bank_type" value="热门题库" />
|
||||
<ul class="dropdown-menu">
|
||||
{% for t in bank_types %}
|
||||
<li class="btn btn-info" style="height: 40px;width: 80px" onclick="choiceBankType(this)">{{ t.name }}</li>
|
||||
{% endfor %}
|
||||
<li class="btn btn-info" style="height: 40px;width: 80px" onclick="choiceBankType(this)">热门题库</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 14px">
|
||||
<label for="bankListGroup">选择题库</label>
|
||||
<div id="bankListGroup" class="list-group">
|
||||
{% for b in banks %}
|
||||
<div id="{{ b.bank_id }}" class="list-group-item btn btn-info" style="background-color: rgb(70, 184, 218);"
|
||||
onclick="getBankModal('{{ b.bank_id }}')">
|
||||
<span>{{ b.bank_name|truncatechars:15 }} ({{ b.total_question_num }}题)</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4" style="margin-left: 60px">
|
||||
<h3>配置比赛</h3>
|
||||
<form class="form-group">
|
||||
<label for="competetionName">比赛名称</label>
|
||||
<input id="competetionName" type="text" class="form-control" placeholder="填写比赛名称" />
|
||||
<label for="sponsorName">机构名称</label>
|
||||
<input id="sponsorName" type="text" class="form-control" placeholder="填写机构名称" />
|
||||
<label for="questionNum">出题数量</label>
|
||||
<input id="questionNum" type="number" class="form-control" value="10" />
|
||||
<label for="totalScore">总分数</label>
|
||||
<input id="totalScore" type="number" class="form-control" value="100" />
|
||||
<label for="copStartAt">开始时间</label>
|
||||
<input id="copStartAt" type="datetime-local" class="form-control" />
|
||||
<label for="copFinishAt">结束时间</label>
|
||||
<input id="copFinishAt" type="datetime-local" class="form-control">
|
||||
<label for="period">答题时间限制</label>
|
||||
<input id="period" type="text" class="form-control" placeholder="填写答题时常限制单位为分钟(min)" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-4" style="margin-left: 60px">
|
||||
<h3>配置页面数据(可选)</h3>
|
||||
<form class="form-group">
|
||||
<label for="ruleText">比赛规则</label>
|
||||
<textarea id="ruleText" class="form-control" placeholder="请输入比赛规则的内容,让答题者快速了解比赛内容"></textarea>
|
||||
<label for="isShowUserForm" style="margin-top: 30px">开启录入信息功能</label>
|
||||
<span id="userFormTips" style="margin-left: 5px" class="btn badge" title="" data-toggle="tooltip" data-placement="left">?</span>
|
||||
<input id="isShowUserForm" type="checkbox" class="form-control" style="width: 15px;height: 15px" />
|
||||
<label for="cxTable" style="margin-top: 30px;">您想要录入的字段</label>
|
||||
<span id="formFieldsTips" style="margin-left: 5px" class="btn badge" title="">?</span>
|
||||
<table id="cxTable" class="table table-bordered">
|
||||
<tr>
|
||||
{% for f in form_fields %}
|
||||
<td>
|
||||
<label for="cx{{ f.field_name }}">{{ f.label }}</label>
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
<tr>
|
||||
{% for f in form_fields %}
|
||||
<td>
|
||||
<input id="cx{{ f.field_name }}" type="checkbox" value="{{ f.field_name }}" name="checks" onchange='checkField("{{ f.field_name }}")'>
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% for f in form_fields %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</table>
|
||||
<label for="optionFields" style="margin-top: 10px">作为下拉框的字段</label>
|
||||
<span id="optionFieldsTips" style="margin-left: 5px" class="btn badge" title="">?</span><br />
|
||||
<table id="optionResult" class="table table-hover">
|
||||
</table>
|
||||
<div id="addOptionFields" class="glyphicon glyphicon-plus" style="font-size: 32px;cursor: pointer"></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="submitAll" class="save-button">保存到数据库</div>
|
||||
|
||||
<div id="optionFieldsModal" class="modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<button class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-title">
|
||||
<div class="form-group" id="optionFieldsForm">
|
||||
<label for="optionFieldName" style="margin-left: 100px;width: 400px;">选择一个字段名</label>
|
||||
<select id="optionFieldName" class="form-control" style="margin-left: 100px;width: 400px">
|
||||
{% for f in form_fields %}
|
||||
<option class="form-control" style="margin-left: 100px;width: 400px;" name="{{ f.field_name }}">{{ f.label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<label for="optionFieldValue" style="margin-left: 100px;">输入一个可选值</label>
|
||||
<input type="text" id="optionFieldValue" class="form-control" style="margin-left: 100px;width: 400px;" placeholder="字段可选值,每一个值用#隔开,如: 吃饭#看电影#逛街">
|
||||
<input type="submit" id="submitOptionField" class="btn btn-success" value="设置为下拉框" style="margin-left: 100px;margin-top: 20px;width: 400px" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="bankModal" class="modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<button class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-title">
|
||||
<h2 class="text-center">题库信息</h2>
|
||||
<div id="bankModalContent">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{% static 'js/currentTime.js' %}"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
var curTime = CurentTime();
|
||||
var userFormTips = "开启录入信息功能将在答题前展示一个表单,\n" +
|
||||
"这个表单用来录入一些您想要的用户信息,\n" +
|
||||
"您可以通过下面的复选框指定录入哪些信息。";
|
||||
var formFieldsTips = "如果您启用了表单信息录入功能,\n" +
|
||||
"选定你想要的展示的字段即可。\n";
|
||||
var optionFieldsTips = "如果普通的输入框不能满足需求,\n" +
|
||||
"点击下面的加号将上面的字段变成下拉框的形式。\n" +
|
||||
"必须事上面勾选过的字段才能设置为下拉框形式。";
|
||||
|
||||
|
||||
$('#copStartAt').val(curTime);
|
||||
$('#copFinishAt').val(curTime);
|
||||
$('#userFormTips').attr('title', userFormTips);
|
||||
$('#formFieldsTips').attr('title', formFieldsTips);
|
||||
$('#optionFieldsTips').attr('title', optionFieldsTips);
|
||||
});
|
||||
|
||||
var choicedBankType; // 存放选择的题库类型
|
||||
var choicedBankId; //存放选择的题库ID
|
||||
var optionFieldList = []; //存放配置的下拉框字段和值
|
||||
var formFields = []; //存放表单展示的字段和顺序
|
||||
var optionFields = {{ form_fields|safe }};
|
||||
for(var i in optionFields){optionFieldList[optionFields[i].field_name]=''}
|
||||
var responseTypes = {{ bank_types|safe }};
|
||||
|
||||
var choiceBankType = function (t) {
|
||||
var cbt = $(t).html();
|
||||
if(cbt === '热门题库') {
|
||||
choicedBankType = 999;
|
||||
}
|
||||
for(var i in responseTypes){
|
||||
if(responseTypes[i].name === cbt){
|
||||
choicedBankType = responseTypes[i].id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$('#choicedValue').val(cbt);
|
||||
$.ajax({
|
||||
url: '/api/banks/s/' + choicedBankType,
|
||||
type: 'get',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
var banks = res.data.banks;
|
||||
var bankHTML = '';
|
||||
if(banks) {
|
||||
for(var i in banks){
|
||||
bankHTML += '<div id=\"' + banks[i].bank_id + '\"class=\"list-group-item btn btn-info\" style=\"background-color: rgb(70, 184, 218)\" onclick=\"getBankModal(\'' + banks[i].bank_id + '\')\">\n';
|
||||
bankHTML += '<span>' + banks[i].bank_name + ' (' + banks[i].total_question_num + '题)</span>\n';
|
||||
bankHTML += '</div>';
|
||||
}
|
||||
document.getElementById('bankListGroup').innerHTML = bankHTML;
|
||||
$('#' + choicedBankId).css('background-color', '#BFEFFF');
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
var getBankModal = function(bank_id){
|
||||
$('#bankModal').modal('show');
|
||||
$.ajax({
|
||||
url: '/api/banks/detail/' + bank_id,
|
||||
type: 'get',
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
var strHTML = '<div>\n<h>';
|
||||
if(res.status === 200) {
|
||||
var data = res.data.bank_info;
|
||||
strHTML += '<ul text-align: center\" class=\"list-group\">\n';
|
||||
strHTML += '<li class=\"list-group-item\"><b style=\"float: left\">题库名称</b><b style=\"margin-left: 200px\">' + data.bank_name + '</b></li>\n';
|
||||
strHTML += '<li class=\"list-group-item\"><b style=\"float: left\">题库类型</b><b style="margin-left: 200px">' + data.bank_type + '</b></li>\n';
|
||||
strHTML += '<li class=\"list-group-item\"><b style=\"float: left\">题库大小</b><b style="margin-left: 200px">' + data.total_question_num + '</b></li>\n';
|
||||
strHTML += '<li class=\"list-group-item\"><b style=\"float: left\">选择题数</b><b style="margin-left: 200px">' + data.choice_num + '</b></li>\n';
|
||||
strHTML += '<li class=\"list-group-item\"><b style=\"float: left\">填空题数</b><b style="margin-left: 200px">' + data.fillinblank_num + '</b></li>\n';
|
||||
strHTML += '<li class=\"list-group-item\"><b style=\"float: left\">参与人次</b><b style="margin-left: 200px">' + data.partin_num + '</b></li>\n';
|
||||
strHTML += '<li class=\"list-group-item\"><b style=\"float: left\">已出比赛</b><b style="margin-left: 200px">' + data.kind_num + '</b></li>\n';
|
||||
strHTML += '</ul>\n';
|
||||
strHTML += '<button style=\"margin-left: 500px;margin-bottom: 10px;\" id=\"useThisBank\" class=\"btn btn-primary\" onclick=\"useThisBank(\''+ data.bank_id +'\')\">使用题库</button><br />';
|
||||
document.getElementById('bankModalContent').innerHTML = strHTML;
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
$('#addOptionFields').click(function () {
|
||||
$('#optionFieldsModal').modal('show');
|
||||
$('#optionFieldValue').val('');
|
||||
$('#submitOptionField').click(function () {
|
||||
var choicedField = $('#optionFieldName').val();
|
||||
var fieldValue = $('#optionFieldValue').val();
|
||||
if(!checkFormFieldName(getFieldName(choicedField))) {
|
||||
$('#optionFieldValue').val('');
|
||||
$('#optionFieldName').css('border', '1px solid red');
|
||||
$('#optionFieldValue').css('border', '1px solid red');
|
||||
$('#optionFieldValue').attr('placeholder', '该字段没有在\"您想要录入的字段\"中勾选,不能设置下拉框!');
|
||||
return false;
|
||||
}else{
|
||||
$('#optionFieldName').css('border', '1px solid #C1FFC1');
|
||||
$('#optionFieldValue').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
if(!fieldValue) {
|
||||
$('#optionFieldValue').attr('placeholder', '必须至少一个可选项,每个选项之间用#隔开!');
|
||||
$('#optionFieldValue').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#optionFieldValue').css('border', '1px solid #C1FFC1');
|
||||
}
|
||||
var choicedfieldName;
|
||||
for(var i in optionFields) {
|
||||
if(optionFields[i].label === choicedField) {
|
||||
choicedfieldName = optionFields[i].field_name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
optionFieldList[choicedfieldName] = fieldValue;
|
||||
$('#optionFieldsModal').modal('hide');
|
||||
var strHTML = '';
|
||||
for(var i in optionFieldList) {
|
||||
if((i !== choicedfieldName) && optionFieldList[i]) {
|
||||
var label = getFieldLabel(i);
|
||||
strHTML += '<tr id=\"tr' + i + '\"><td>' + label + '</td><td>' + optionFieldList[i] + '</td><td><a id=\"del' + i + '\" href=\"#\" onclick=\'delOptions(\"' + i + '\")\'>删除</a></td></tr>';
|
||||
}
|
||||
}
|
||||
strHTML += '<tr id=\"tr' + getFieldName(choicedField) + '\"><td>' + choicedField + '</td><td>' + fieldValue + '</td><td><a id=\"del' + getFieldName(choicedField) + '\" href=\"#\" onclick=\'delOptions(\"' + getFieldName(choicedField) + '\")\'>删除</a></td></tr>';
|
||||
strHTML += '</table>';
|
||||
$('#optionResult').html(strHTML);
|
||||
})
|
||||
});
|
||||
|
||||
$('#submitAll').click(function () {
|
||||
var choicedBank = choicedBankId;
|
||||
if(!choicedBank) {
|
||||
alert('请选择一个题库');
|
||||
$('#bankListGroup').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#bankListGroup').css('border', '');
|
||||
}
|
||||
var competitionName = $('#competetionName').val();
|
||||
if(!competitionName) {
|
||||
alert('请输入比赛名称');
|
||||
$('#competetionName').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#competetionName').css('border', '');
|
||||
}
|
||||
var companyName = $('#sponsorName').val();
|
||||
if(!companyName){
|
||||
alert('请输入机构名称');
|
||||
$('#sponsorName').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#sponsorName').css('border', '');
|
||||
}
|
||||
var questionNum = $('#questionNum').val();
|
||||
if(!questionNum){
|
||||
alert('至少出一道题');
|
||||
$('#questionNum').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#questionNum').css('border', '')
|
||||
}
|
||||
var totalScore = $('#totalScore').val();
|
||||
if(!totalScore) {
|
||||
alert('请输入比赛总分数');
|
||||
$('#totalScore').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#totalScore').css('border', '');
|
||||
}
|
||||
var startedAt = $('#copStartAt').val();
|
||||
if(!startedAt){
|
||||
alert('请输入比赛开始时间');
|
||||
$('#copStartAt').css('border', '1px solid red');
|
||||
return false;
|
||||
}else {
|
||||
$('#copStartAt').css('border', '');
|
||||
}
|
||||
var finishedAt = $('#copFinishAt').val();
|
||||
if(!finishedAt || finishedAt <= startedAt) {
|
||||
alert('比赛结束时间必须大于开始时间');
|
||||
$('#copFinishAt').css('border', '1px solid red');
|
||||
return false;
|
||||
}else{
|
||||
$('#copFinishAt').css('border', '');
|
||||
}
|
||||
var period = $('#period').val();
|
||||
var ruleText = $('#ruleText').val();
|
||||
var isShowUserInfo = $('#isShowUserForm').prop('checked');
|
||||
var formFieldList = '';
|
||||
var fieldNameList = '';
|
||||
for(var i in formFields){
|
||||
formFieldList+=(formFields[i] + '#');
|
||||
fieldNameList+=(getFieldLabel(formFields[i]) + '#')
|
||||
}
|
||||
var optionList = '';
|
||||
for(var i in optionFieldList){
|
||||
if(checkFormFieldName(i) && optionFieldList[i]) {
|
||||
optionList += (i + ':' + optionFieldList[i].replace('#', ',') + '#')
|
||||
}
|
||||
}
|
||||
var accountId = '{{ account_id|safe }}';
|
||||
var uid = '{{ request.session.uid }}';
|
||||
|
||||
$.ajax({
|
||||
url: '/api/banks/set',
|
||||
type: 'post',
|
||||
data: {
|
||||
'uid': uid,
|
||||
'account_id': accountId,
|
||||
'bank_id': choicedBank,
|
||||
'kind_name': competitionName,
|
||||
'sponsor_name': companyName,
|
||||
'question_num': questionNum,
|
||||
'total_score': totalScore,
|
||||
'cop_startat': startedAt,
|
||||
'cop_finishat': finishedAt,
|
||||
'period': period,
|
||||
'rule_text': ruleText,
|
||||
'is_show_userinfo': isShowUserInfo,
|
||||
'form_data': formFieldList,
|
||||
'field_name_data': fieldNameList,
|
||||
'option_data': optionList
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
window.location.href = '/bs?uid={{ request.session.uid }}&kind_id=' + res.data.kind_info.kind_id + '&created=1';
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var delOptions = function (field_name) {
|
||||
$('#tr' + field_name).remove();
|
||||
optionFieldList[field_name] = '';
|
||||
};
|
||||
|
||||
var checkField = function(field_name) {
|
||||
if(checkFieldName(field_name)) {
|
||||
if($('#cx' + field_name).prop('checked')) {
|
||||
formFields.push(field_name);
|
||||
}else{
|
||||
formFieldsTmp = [];
|
||||
for(var i in formFields) {
|
||||
if(formFields[i] !== field_name) {
|
||||
formFieldsTmp.push(formFields[i])
|
||||
}
|
||||
}
|
||||
formFields = formFieldsTmp;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var useThisBank = function(bank_id) {
|
||||
if(choicedBankId) {
|
||||
$('#' + choicedBankId).css('background-color', '');
|
||||
}
|
||||
choicedBankId = bank_id;
|
||||
$('#bankModal').modal('hide');
|
||||
$('#' + bank_id).css('background-color', '#BFEFFF');
|
||||
};
|
||||
|
||||
var getFieldLabel = function(field_name) {
|
||||
for(var i in optionFields) {
|
||||
if(optionFields[i].field_name === field_name) {
|
||||
return optionFields[i].label;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var getFieldName = function (label) {
|
||||
for(var i in optionFields) {
|
||||
if(optionFields[i].label === label) {
|
||||
return optionFields[i].field_name
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var checkFieldName = function (field_name) {
|
||||
for (var i in optionFields) {
|
||||
if (optionFields[i].field_name === field_name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
var checkFormFieldName = function (field_name) {
|
||||
for(var i in formFields) {
|
||||
if(formFields[i] === field_name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
19
web/templates/setgames/index.html
Normal file
19
web/templates/setgames/index.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load staticfiles %}
|
||||
{% block title %}我要出题{% endblock %}
|
||||
{% block content %}
|
||||
<div class="main-content container">
|
||||
<div class="inner-content">
|
||||
<div class="jumbotron" >
|
||||
<h1 style="color: orange; font-size: 40px; margin-left: 20px;">录制题库</h1><br />
|
||||
<p style="font-size: 18px; margin-left: 20px;">您可以通过下载我们的电子模板,对其进行简单的编辑,然后再将您的模板上传到我们的服务器,就可以录制一套您自己的题库啦~</p><br />
|
||||
<p><a class="btn btn-primary btn-lg" href="/bs/set/bank?uid={{ request.session.uid }}" role="button" style="margin-left: 20px;">开始录制</a></p>
|
||||
</div>
|
||||
<div class="jumbotron">
|
||||
<h1 style="color: orange; font-size: 40px; margin-left: 20px;">配置比赛</h1><br />
|
||||
<p style="font-size: 18px; margin-left: 20px;">您可以使用自己上传的或者他人上传的题库来创建您自己的比赛或者面试。只需要简单的几步,让别人也来参与您创建的活动~</p><br />
|
||||
<p><a id="configGame" class="btn btn-primary btn-lg" href="/bs/set/game?uid={{ request.session.uid }}" role="button" style="margin-left: 20px;">开始配置</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
17
web/templates/web/contact_us.html
Normal file
17
web/templates/web/contact_us.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends '../base.html' %}
|
||||
{% block title %}联系我们{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row" style="margin-top: 40px;">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
<ul class="list-group" style="text-align: center">
|
||||
<li class="list-group-item">管理员: 张先生</li>
|
||||
<li class="list-group-item">联系电话: 18243088680 </li>
|
||||
<li class="list-group-item">微信号码: 18243088680 </li>
|
||||
<li class="list-group-item">QQ号码: 369266324</li>
|
||||
<li class="list-group-item">联系邮箱: zhang8680@outlook.com</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
17
web/templates/web/donate.html
Normal file
17
web/templates/web/donate.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}赞助我们{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<p style="text-align: center;font-size: 20px">站点由Django1.11.2开发,旨在做学习交流。代码在<a href="https://github.com/john8680/examination.git" target="_blank">github</a>上使用Apache协议开源,您的支持是我进步的最大动力~</p>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 24px;">
|
||||
<div class="col-md-6" style="text-align: center">
|
||||
<label style="color: red">您可以选择微信红包打赏我</label><br /><br />
|
||||
<img src="../../static/img/wxqrpay1.png" style="height: 240px;width: 240px" />
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align: center">
|
||||
<label style="color: red">或者选择支付宝转账打赏我</label><br /><br />
|
||||
<img src="../../static/img/aliqrpay1.png" style="height: 240px;width: 240px" />
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
110
web/templates/web/index.html
Normal file
110
web/templates/web/index.html
Normal file
@@ -0,0 +1,110 @@
|
||||
{% extends '../base.html' %}
|
||||
{% block title %}首页{% endblock %}
|
||||
{% block content %}
|
||||
<!--banner-->
|
||||
<div id="myCarousel" class="carousel slide" style="width:100%;margin-top: -37px;">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="1"></li>
|
||||
<li data-target="#myCarousel" data-slide-to="2"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
<div class="item active">
|
||||
<img src="/static/images/banner2.png" alt="First slide">
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/static/images/banner3.png" alt="Second slide">
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/static/images/banner4.png" alt="Third slide">
|
||||
</div>
|
||||
</div>
|
||||
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
|
||||
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
|
||||
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
<!--end banner-->
|
||||
|
||||
<!--main-->
|
||||
<div class="container admin-4">
|
||||
<h2 class="titleh2 clearfix" style="padding-top: 10px">
|
||||
<img src="/static/images/icon4.png">
|
||||
<span style="cursor: pointer;">比赛分类</span>
|
||||
</h2>
|
||||
<div class="row" style="padding: 20px ">
|
||||
<div class="col-md-3 cate" >
|
||||
<li class="layout-gray student" style="cursor: default;">
|
||||
<a href="/bs/games/s/hot">
|
||||
<img src="/static/images/layout-icon3.png" class="bc">
|
||||
<p>了解自己 科学规划 激发潜能</p>
|
||||
<div class="button-div">
|
||||
热门比赛
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div class="col-md-3 cate">
|
||||
<li class="layout-red admin" style="cursor: default;">
|
||||
<a href="/bs/games/s/tech">
|
||||
<img src="/static/images/layout-icon1.png" class="bc">
|
||||
<p>优化理念 紧跟技术发展趋势</p>
|
||||
<div class="button-div">技术类</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div class="col-md-3 cate">
|
||||
<li class="layout-green teacher" style="cursor: default;">
|
||||
<a href="/bs/games/s/edu">
|
||||
<img src="/static/images/layout-icon2.png" class="bc">
|
||||
<p>提升生涯引领水平 掌握实操技能</p>
|
||||
<div class="button-div" >教育类</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div class="col-md-3 cate">
|
||||
<li class="layout-blue parent" style="margin-right: 26px;cursor: default;">
|
||||
<a href="/bs/games/s/culture">
|
||||
<img src="/static/images/layout-icon4.png" class="bc">
|
||||
<p>掌握动态 增长知识 助力规划未来</p>
|
||||
<div class="button-div" >文化类</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div class="col-md-3 cate">
|
||||
<li class="layout-red admin" style="margin-right: 0;cursor: default;">
|
||||
<a href="/bs/games/s/sport">
|
||||
<img src="/static/images/layout-icon1.png" class="bc">
|
||||
<p>优化理念 大数据预测发展趋势</p>
|
||||
<div class="button-div">体育类</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div class="col-md-3 cate">
|
||||
<li class="layout-blue parent" style="margin-right: 26px;cursor: default;">
|
||||
<a href="/bs/games/s/general">
|
||||
<img src="/static/images/layout-icon4.png" class="bc">
|
||||
<p>掌握动态 增长知识 助力规划未来</p>
|
||||
<div class="button-div">常识类</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div class="col-md-3 cate" >
|
||||
<li class="layout-gray student" style="cursor: default;">
|
||||
<a href="/bs/games/s/interview">
|
||||
<img src="/static/images/layout-icon3.png" class="bc">
|
||||
<p>了解自己 科学规划 激发潜能</p>
|
||||
<div class="button-div">
|
||||
面试题
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end main-->
|
||||
{% endblock %}
|
||||
54
web/templates/web/sign_email.html
Normal file
54
web/templates/web/sign_email.html
Normal file
@@ -0,0 +1,54 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}注册成功{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row" style="height:800px">
|
||||
<div class="span4">
|
||||
<div class="alert alert-success"><b style="font-size: 15px">恭喜您注册成功</b>,还差一步验证您的邮箱 <b style="color: red">{{ email }}</b> 就成功了!点击
|
||||
<span class="btn btn-info" id="sendMail">发送邮件</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- loading -->
|
||||
<div class="modal fade" id="sendMailLoading" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop='static'>
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="myModalLabel">提示</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h1>正在发送邮件中...</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#sendMail').click(function () {
|
||||
$('#sendMailLoading').modal('show');
|
||||
$.ajax({
|
||||
url: '/api/sendmail',
|
||||
type: 'get',
|
||||
data: {
|
||||
'email': '{{ email|safe }}',
|
||||
'sign': '{{ sign|safe }}'
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if(res.status === 200) {
|
||||
$('#sendMailLoading').modal('hide');
|
||||
alert('发送成功,快去登录邮箱激活账户吧');
|
||||
}
|
||||
else if(res.status === 300005) {
|
||||
$('#sendMailLoading').modal('hide');
|
||||
alert('您已经发送过邮件,请稍等再试');
|
||||
}
|
||||
else if(res.status === 300006) {
|
||||
$('#sendMailLoading').modal('hide');
|
||||
alert('验证邮件发送失败!');
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user