-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompetitionCreate.html
More file actions
168 lines (130 loc) · 5.35 KB
/
Copy pathcompetitionCreate.html
File metadata and controls
168 lines (130 loc) · 5.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!DOCTYPE HTML>
<html>
<head>
<title>创建比赛</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
<link rel="stylesheet" href="assets/css/competitionAll.css">
<link rel="stylesheet" href="assets/css/competitionCreate.css">
<link rel="stylesheet" href="assets/css/search.css">
<link rel="icon" href="images/logo.ico">
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/init.css">
<link rel="stylesheet" href="assets/css/sweetalert.css">
</head>
<body>
<!--<div id="page-wrapper">-->
<!-- Header -->
<header id="header">
<h1><a href="#">Runner</a></h1>
<nav id="nav">
<ul>
<li><a href="home.html">首页</a></li>
<li>
<a href="dataRun.html" >数据</a>
</li>
<li><a href="competitionAll.html">竞赛</a></li>
<li><a href="moments.html">圈子</a></li>
<li><a href="market.html">商城</a></li>
<li>
<a href="#" class="icon fa-angle-down">个人中心</a>
<ul>
<li style="white-space: nowrap"><a href="userInfo.html">修改信息</a></li>
<li style="white-space: nowrap"><a href="index.html" onclick="logout()">登出</a></li>
</ul>
</li>
</ul>
</nav>
</header>
<div class="container" >
<div class="row">
<div class=" col-xs-10 col-sm-10 col-md-6 col-lg-6 col-md-offset-3 col-lg-offset-3 col-xs-offset-1 " >
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" ><a href="competitionAll.html">一试身手</a></li>
<li role="presentation" ><a href="competitionMycom.html">我的比赛</a></li>
<li role="presentation"><a href="competitionHistory.html">对战历史</a></li>
<li role="presentation"><a href="competitionRule.html">比赛规则</a></li>
<li role="presentation"class="active" id="create-com"><a href="competitionCreate.html">发起比赛</a></li>
</ul>
<div class="row">
<div class=" col-xs-12 col-sm-10 col-md-10 col-lg-10 media-list-base " id="point">
<form id="form">
<p>单人PK比赛</p>
<input type="text" name="theme" class="form-control create-base" placeholder="竞赛主题(10个字以内)" id="theme">
<textarea type="text" name="content" class="form-control create-base" placeholder="竞赛介绍(20个字以内)" id="content"></textarea>
<button type="button" class="btn btn-primary btn-block create-base" id="create-btn">创建比赛</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer id="footer">
<ul class="icons">
<li><a href="#" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
<li><a href="#" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
<li><a href="#" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
<li><a href="#" class="icon fa-github"><span class="label">Github</span></a></li>
<li><a href="#" class="icon fa-dribbble"><span class="label">Dribbble</span></a></li>
<li><a href="#" class="icon fa-google-plus"><span class="label">Google+</span></a></li>
</ul>
<ul class="copyright">
<li>© JiayiWu. All rights reserved.</li><li> <a href="http://218.94.159.99/">南京大学软件学院2016[面向Web计算]课程项目</a></li>
</ul>
</footer>
<!--</div>-->
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/echarts.common.min.js"></script>
<script src="assets/js/jquery.dropotron.min.js"></script>
<script src="assets/js/jquery.scrollgress.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/main.js"></script>
<script src="assets/js/sweetalert.min.js"></script>
<script>
$('#create-btn').on('click', function () {
var topic = $('#theme').val();
var content = $('#content').val();
if(topic.length ==0 || topic.length>10||content.length==0||content.length>20){
swal("OMG", "输入不符合要求!请重新输入:)(不要超过字数哟)", "error");
$('#theme').val("");
$('#content').val("");
}
jQuery.ajax({
url: 'race/create',
type: 'post',
data: {
topic:topic,
content: content
},
cache: false,
success: function(data) {
if(data.state == true){
swal("成功", "比赛创建成功(此窗口2后自动消失)", "success");
setTimeout(function () {
top.location ='../competitionAll.html';
}, 2000);
}else {
swal("OMG", "无法创建比赛,请稍后再试!", "error");
}
}
})
});
</script>
<script>
function logout() {
jQuery.ajax({
url: 'user/logout',
cache: false
})
}
</script>
</body>
</html>