Browse Source

Some UI adjustment

pull/6/head
Menci 6 years ago
parent
commit
7fb6994b0f
  1. 36
      static/style.css
  2. 2
      views/admin_config.ejs
  3. 2
      views/admin_info.ejs
  4. 2
      views/admin_links.ejs
  5. 6
      views/admin_other.ejs
  6. 2
      views/admin_privilege.ejs
  7. 2
      views/admin_rating.ejs
  8. 2
      views/admin_raw.ejs
  9. 8
      views/admin_rejudge.ejs
  10. 8
      views/article.ejs
  11. 3
      views/article_edit.ejs
  12. 2
      views/contest_edit.ejs
  13. 9
      views/contest_ranklist.ejs
  14. 30
      views/contests.ejs
  15. 23
      views/discussion.ejs
  16. 6
      views/footer.ejs
  17. 11
      views/header.ejs
  18. 20
      views/index.ejs
  19. 4
      views/login.ejs
  20. 2
      views/page.ejs
  21. 4
      views/problem.ejs
  22. 4
      views/problem_data.ejs
  23. 6
      views/problem_edit.ejs
  24. 6
      views/problem_import.ejs
  25. 8
      views/problem_manage.ejs
  26. 6
      views/problem_tag_edit.ejs
  27. 17
      views/problems.ejs
  28. 4
      views/status_label.ejs
  29. 4
      views/submission.ejs
  30. 64
      views/submissions_item.ejs
  31. 6
      views/user_edit.ejs

36
static/style.css

@ -51,10 +51,6 @@ a.black-link:hover {
font-family: 'Fira Mono', 'Noto Sans CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft Yahei', monospace;
}
.main.container {
margin-top: 5.5em;
}
.padding {
padding-left: 1em;
padding-right: 1em;
@ -272,3 +268,35 @@ code {
animation: spinner-icon-rotate 3s linear infinite;
display: block;
}
::-webkit-scrollbar {
-webkit-appearance: none;
width: 10px;
height: 10px;
}
::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 0px;
}
::-webkit-scrollbar-thumb {
cursor: pointer;
border-radius: 5px;
background: rgba(0, 0, 0, 0.25);
-webkit-transition: color 0.2s ease;
transition: color 0.2s ease;
}
::-webkit-scrollbar-thumb:window-inactive {
background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb:hover {
background: rgba(128, 135, 139, 0.8);
}
.ui.top.attached.block.header i.icon {
font-size: 1em;
vertical-align: initial;
}

2
views/admin_config.ejs

@ -48,7 +48,7 @@ for (let item in items) {
}
%>
<div style="text-align: center; ">
<button class="ui blue button">提交</button>
<button class="ui blue labeled icon button"><i class="ui edit icon"></i>提交</button>
</div>
</form>
<% include admin_footer %>

2
views/admin_info.ejs

@ -17,6 +17,8 @@
}
.statistic .label {
padding-top: 15px;
font-size: 1.4em !important;
font-weight: normal !important;
}
</style>

2
views/admin_links.ejs

@ -54,7 +54,7 @@ this.adminPage = 'links';
<input type="text" id="add_url">
</div>
</div>
<div style="text-align: center; "><div id="add_button" class="ui submit button">添加</a></div>
<div style="text-align: center; "><div id="add_button" class="ui submit blue labeled icon button"><i class="ui add icon"></i>添加</a></div>
</div>
<form method="post" id="submit_form">

6
views/admin_other.ejs

@ -1,8 +1,8 @@
<% this.adminPage = 'other'; %>
<% include admin_header %>
<form method="post" class="ui form">
<p><button class="ui blue button" name="type" value="reset_count" type="submit">重新计算提交及 AC 数</button></p>
<p><button class="ui blue button" name="type" value="reset_discussion" type="submit">重新计算讨论版回复数和回复时间</button></p>
<p><button class="ui blue button" name="type" value="reset_codelen" type="submit">重新计算提交代码长度</button></p>
<p><button class="ui blue labeled icon button" name="type" value="reset_count" type="submit"><i class="ui repeat icon"></i>重新计算提交及 AC 数</button></p>
<p><button class="ui blue labeled icon button" name="type" value="reset_discussion" type="submit"><i class="ui repeat icon"></i>重新计算讨论版回复数和回复时间</button></p>
<p><button class="ui blue labeled icon button" name="type" value="reset_codelen" type="submit"><i class="ui repeat icon"></i>重新计算提交代码长度</button></p>
</form>
<% include admin_footer %>

2
views/admin_privilege.ejs

@ -37,7 +37,7 @@ let privileges = {
</table>
<div style="text-align: center; ">
<button class="ui button" onclick="submit()">提交</button>
<button class="ui blue labeled icon button" onclick="submit()"><i class="ui edit icon"></i>提交</button>
</div>
<form method="post" id="submit_form">

2
views/admin_rating.ejs

@ -14,7 +14,7 @@
</div>
</div>
</div>
<button class="ui blue button" name="type" value="doit" type="submit">计算此比赛的积分</button>
<button class="ui blue labeled icon button" name="type" value="doit" type="submit"><i class="ui calculator icon"></i>计算此比赛的积分</button>
</form>
注意:如果删除一个比赛的积分,则该比赛之上的所有比赛也将被删除,积分将还原至该比赛之前的状态!

2
views/admin_raw.ejs

@ -28,7 +28,7 @@ editor.getSession().on("change", function () {
<div style="text-align: center; ">
<button class="ui blue button">提交</button>
<button class="ui blue labeled icon button"><i class="ui edit icon"></i>提交</button>
</div>
</form>
<% include admin_footer %>

8
views/admin_rejudge.ejs

@ -71,15 +71,15 @@
</div>
<div style="text-align: center; ">
<button class="ui button" name="type" value="query">查询</button>
<button class="ui labeled icon button" name="type" value="query"><i class="ui search icon"></i>查询</button>
<% if (form.type === 'rejudge') { %>
<button class="ui blue disabled button" name="type" value="rejudge">已重测 <%= count %> 条记录</button>
<button class="ui blue disabled labeled icon button" name="type" value="rejudge"><i class="ui checkmark icon"></i>已重测 <%= count %> 条记录</button>
<% } else if (count !== null) { %>
<a onclick="$('#modal-rejudge').modal('show');" class="ui blue<% if (count === 0) { %> disabled<% } %> button"><% if (count === 0) { %>没有符合条件的记录<% } else { %>重测 <%= count %> 条记录<% } %></a>
<a onclick="$('#modal-rejudge').modal('show');" class="ui blue<% if (count === 0) { %> disabled<% } %> labeled icon button"><i class="ui repeat icon"></i><% if (count === 0) { %>没有符合条件的记录<% } else { %>重测 <%= count %> 条记录<% } %></a>
<button id="submit_rejudge" name="type" value="rejudge" style="display: none; "></button>
<div class="ui basic modal" id="modal-rejudge">
<div class="ui icon header">
<i class="refresh icon"></i>
<i class="retweet icon"></i>
<p style="margin-top: 15px; ">重新评测</p>
</div>
<div class="content" style="text-align: center; ">

8
views/article.ejs

@ -20,12 +20,12 @@
<h1><%= article.title %></h1>
<p style="margin-bottom: -5px; ">
<img style="vertical-align: middle; margin-bottom: 2px; margin-right: 2px; " src="<%= syzoj.utils.gravatar(article.user.email, 34) %>" width="17" height="17">
<b style="margin-right: 30px; "><!--i class="user icon"></i--><a class="black-link" href="<%= syzoj.utils.makeUrl(['user', article.user_id]) %>"><%= article.user.username %></a><% if (article.user.nameplate) { %><%- article.user.nameplate %><% } %></b>
<b style="margin-right: 30px; "><a class="black-link" href="<%= syzoj.utils.makeUrl(['user', article.user_id]) %>"><%= article.user.username %></a><% if (article.user.nameplate) { %><%- article.user.nameplate %><% } %></b>
<b style="margin-right: 30px; "><i class="calendar icon"></i> <%= syzoj.utils.formatDate(article.public_time) %></b>
<% if (article.public_time !== article.update_time) { %><b style="margin-right: 30px; "><i class="edit icon"></i> <%= syzoj.utils.formatDate(article.update_time) %></b><% } %>
<% if (article.allowedEdit) { %>
<a style="margin-top: -4px; " class="ui mini right floated button" href="<%= syzoj.utils.makeUrl(['article', article.id, 'edit']) %>">编辑文章</a>
<a style="margin-top: -4px; " class="ui mini red right floated button" onclick="$('#modal-delete').modal('show')">删除文章</a>
<a style="margin-top: -4px; " class="ui mini right floated labeled icon button" href="<%= syzoj.utils.makeUrl(['article', article.id, 'edit']) %>"><i class="ui edit icon"></i>编辑</a>
<a style="margin-top: -4px; margin-right: 3px; " class="ui mini red right floated labeled icon button" onclick="$('#modal-delete').modal('show')"><i class="ui trash icon"></i>删除</a>
<div class="ui basic modal right floated" id="modal-delete">
<div class="ui icon header">
<i class="trash icon"></i>
@ -99,9 +99,11 @@
<div class="field">
<textarea name="comment"></textarea>
</div>
<div style="text-align: center; ">
<button type="submit" class="ui labeled submit icon button">
<i class="icon edit"></i> 回复
</button>
</div>
</form>
<% } %>
</div>

3
views/article_edit.ejs

@ -15,6 +15,7 @@
<div class="field">
<label for="title">标题</label>
<input type="text" id="title" name="title" value="<%= article.title %>">
<div style="margin-top: 15px; "></div>
<label for="content">内容</label>
<textarea rows="15" id="content" name="content" class="markdown-edit"><%= article.content %></textarea>
<% if (user && user.is_admin) { %>
@ -30,9 +31,11 @@
<div class="ui header" id="pv-title"></div>
<div id="pv-content" class="font-content"></div>
</div>
<div style="text-align: center; ">
<button type="submit" class="ui labeled submit icon button">
<i class="icon edit"></i> 提交
</button>
</div>
</form>
</div>

2
views/contest_edit.ejs

@ -77,7 +77,7 @@
<label><span style="visibility: hidden; "> </span></label>
</div>
</div>
<button type="submit" class="ui button">提交</button>
<div style="text-align: center; "><button type="submit" class="ui labeled icon blue button"><i class="ui edit icon"></i>提交</button></div>
</form>
<script>
$(function () {

9
views/contest_ranklist.ejs

@ -154,5 +154,14 @@
<% } %>
</tbody>
</table>
<% if (!ranklist.length) { %>
<div style="background-color: #fff; height: 18px; margin-top: -18px; "></div>
<div class="ui placeholder segment" style="margin-top: 0px; ">
<div class="ui icon header">
<i class="ui file icon" style="margin-bottom: 20px; "></i>
暂无选手提交
</div>
</div>
<% } %>
</div>
<% include footer %>

30
views/contests.ejs

@ -1,14 +1,16 @@
<% this.title = '比赛' %>
<% include header %>
<div class="padding">
<% if (contests.length) { %>
<% if (user && user.is_admin) { %>
<div class="ui grid">
<div class="row">
<div class="column">
<a href="<%= syzoj.utils.makeUrl(['contest', 0, 'edit']) %>" class="ui mini right floated button">添加比赛</a>
</div>
</div>
</div>
<form class="ui mini form">
<div class="inline fields" style="margin-bottom: 25px; white-space: nowrap; ">
<a href="<%= syzoj.utils.makeUrl(['contest', 0, 'edit']) %>" class="ui mini labeled icon right floated button" style="margin-left: auto; ">
<i class="ui icon write"></i>
添加比赛
</a>
</div>
</form>
<% } %>
<table class="ui very basic center aligned table">
<thead>
@ -42,6 +44,20 @@
<% } %>
</tbody>
</table>
<% } else { %>
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="calendar icon" style="margin-bottom: 20px; "></i>
暂无比赛
</div>
<% if (user && user.is_admin) { %>
<a href="<%= syzoj.utils.makeUrl(['contest', 0, 'edit']) %>" class="ui primary labeled icon button">
<i class="ui icon write"></i>
添加第一场比赛
</a>
<% } %>
</div>
<% } %>
<br>
<% include page %>
</div>

23
views/discussion.ejs

@ -18,8 +18,8 @@
<% } %>
</div>
</div>
<div class="six wide right aligned column" style="margin-bottom: 15px; ">
<% if(in_problems) { %>
<div class="six wide right aligned column" style="margin-bottom: 10px; ">
<% if (in_problems) { %>
<a style="margin-left: 10px; " href="<%= syzoj.utils.makeUrl(['discussion', 'global']) %>" class="ui labeled icon mini blue button">
<i class="world icon"></i>
全局板块
@ -36,14 +36,17 @@
题目板块
</a>
<% } %>
<% if (articles.length && user) { %>
<a style="margin-left: 10px; " href="<%= syzoj.utils.makeUrl(['article', 0, 'edit'], problem ? { problem_id: problem.id } : null) %>" class="ui labeled icon mini button">
<i class="write icon"></i>
发帖
</a>
<% } %>
<% } %>
</div>
</div>
</div>
<% if (articles.length) { %>
<table class="ui very basic center aligned table">
<thead>
<tr>
@ -71,6 +74,20 @@
</tbody>
</table>
<br>
<% include page %>
<% include page %>
<% } else { %>
<div class="ui placeholder segment">
<div class="ui icon header">
<i class="chat icon" style="margin-bottom: 20px; "></i>
暂无讨论
</div>
<% if (!in_problems && user) { %>
<a href="<%= syzoj.utils.makeUrl(['article', 0, 'edit'], problem ? { problem_id: problem.id } : null) %>" class="ui primary labeled icon button">
<i class="write icon"></i>
发帖
</a>
<% } %>
</div>
<% } %>
</div>
<% include footer %>

6
views/footer.ejs

@ -1,11 +1,11 @@
</div>
<div class="ui vertical footer segment">
<div class="ui vertical footer segment" style="margin-top: 10px; ">
<div class="ui center aligned container">
<span style="color: #999;"><%= syzoj.config.title %> Powered by <a href="https://github.com/syzoj/syzoj" target="_blank">SYZOJ</a>.</span>
</div>
</div>
<script src="https://cdnjs.loli.net/ajax/libs/semantic-ui/2.3.3/semantic.min.js"></script>
</div>
<script src="https://cdnjs.loli.net/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="https://cdnjs.loli.net/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js"></script>
<script src="/script.js?20170710"></script>
</body>

11
views/header.ejs

@ -1,17 +1,17 @@
<% include util %>
<!DOCTYPE html>
<html lang="zh-CN">
<html lang="zh-CN" style="position: fixed; width: 100%; overflow: hidden; ">
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=1200">
<title><%= title %> - <%= syzoj.config.title %></title>
<link href="https://cdnjs.loli.net/ajax/libs/semantic-ui/2.3.3/semantic.min.css" rel="stylesheet">
<link href="https://cdnjs.loli.net/ajax/libs/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet">
<link href="/tomorrow.css" rel="stylesheet">
<link href="/mathjax.css?20181105" rel="stylesheet">
<link href="https://cdnjs.loli.net/ajax/libs/KaTeX/0.10.0/katex.min.css" rel="stylesheet">
<link href="https://cdnjs.loli.net/ajax/libs/morris.js/0.5.1/morris.css" rel="stylesheet">
<link href="/style.css?20181105" rel="stylesheet">
<link href="/style.css?20181108" rel="stylesheet">
<link href="https://fonts.loli.net/css?family=Fira+Mono" rel="stylesheet">
<link href="https://fonts.loli.net/css?family=Lato:400,700,400italic,700italic&subset=latin" rel="stylesheet">
<link href="https://fonts.loli.net/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&amp;subset=latin-ext" rel="stylesheet">
@ -30,8 +30,8 @@
</script>
<% } %>
</head>
<body>
<div class="ui fixed borderless menu" style="position: fixed; ">
<body style="position: relative; margin-top: 49px; height: calc(100% - 49px); overflow-y: overlay; ">
<div class="ui fixed borderless menu" style="position: fixed; height: 49px; ">
<div class="ui container">
<%
if (syzoj.config.logo.url) {
@ -79,4 +79,5 @@
</div>
</div>
</div>
<div style="margin-top: 28px; ">
<div class="ui main container">

20
views/index.ejs

@ -3,7 +3,7 @@
<div class="padding">
<div class="ui three column grid">
<div class="eleven wide column">
<h4 class="ui top attached block header">公告</h4>
<h4 class="ui top attached block header"><i class="ui info icon"></i>公告</h4>
<div class="ui bottom attached segment">
<table class="ui very basic table">
<thead>
@ -22,7 +22,7 @@
</tbody>
</table>
</div>
<h4 class="ui top attached block header">排名</h4>
<h4 class="ui top attached block header"><i class="ui signal icon"></i>排名</h4>
<div class="ui bottom attached segment">
<table class="ui very basic center aligned table" style="table-layout: fixed; ">
<thead>
@ -76,7 +76,7 @@
</div>
</div>
<div class="right floated five wide column">
<h4 class="ui top attached block header">一言(ヒトコト)</h4>
<h4 class="ui top attached block header"><i class="ui quote left icon"></i>一言(ヒトコト)</h4>
<div class="ui bottom attached center aligned segment">
<div class="ui active centered inline loader" id="hitokoto-loader"></div>
<script>
@ -92,13 +92,13 @@
<div style="font-size: 1em; line-height: 1.5em; display: none; " id="hitokoto-content"></div>
<div style="text-align: right; margin-top: 15px; font-size: 0.9em; color: #666; display: none; " id="hitokoto-from"></div>
</div>
<h4 class="ui top attached block header">最近更新</h4>
<h4 class="ui top attached block header"><i class="ui rss icon"></i>最近更新</h4>
<div class="ui bottom attached segment">
<table class="ui very basic center aligned table">
<thead>
<tr>
<th>题目</th>
<th>更新时间</th>
<th width="70%">题目</th>
<th width="30%">更新时间</th>
</tr>
</thead>
<tbody>
@ -120,7 +120,7 @@
else if (fortune.fortune.indexOf('凶') != -1) color = '#f25e65';
else color = '#444';
%>
<h4 class="ui top attached block header">今日运势</h4>
<h4 class="ui top attached block header"><i class="ui magic icon"></i>今日运势</h4>
<div class="ui bottom attached segment">
<div style="height: 15px; "></div>
<div class="ui two column center aligned padded grid">
@ -166,7 +166,7 @@
</div>
</div>
<% } %>
<h4 class="ui top attached block header">搜索题目</h4>
<h4 class="ui top attached block header"><i class="ui search icon"></i>搜索题目</h4>
<div class="ui bottom attached segment">
<form action="<%= syzoj.utils.makeUrl(['problems', 'search']) %>" method="get">
<div class="ui search" style="width: 100%; ">
@ -178,7 +178,7 @@
</div>
</form>
</div>
<h4 class="ui top attached block header">近期比赛</h4>
<h4 class="ui top attached block header"><i class="ui calendar icon"></i>近期比赛</h4>
<div class="ui bottom attached <% if (!contests || !contests.length) { %>center aligned <% } %>segment">
<% if (!contests || !contests.length) { %>
还没有举行过任何比赛
@ -213,7 +213,7 @@
<% } %>
</div>
<% if (typeof links !== 'undefined' && links && links.length) { %>
<h4 class="ui top attached block header font-content">友情链接</h4>
<h4 class="ui top attached block header font-content"><i class="ui linkify icon"></i>友情链接</h4>
<div class="ui bottom attached segment">
<ul style="margin: 0; padding-left: 20px; ">
<% for (let link of links) { %>

4
views/login.ejs

@ -6,7 +6,7 @@
<div class="row">
<div class="column" style="max-width: 450px">
<h2 class="ui image header">
<div class="content">
<div class="content" style="margin-bottom: 10px; ">
登录
</div>
</h2>
@ -32,7 +32,7 @@
</form>
<div class="ui message">
<a href="/sign_up">注册</a>
<a href="/sign_up">注册账号</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<%= syzoj.utils.makeUrl(['forget']) %>">忘记密码</a>
</div>
</div>

2
views/page.ejs

@ -1,4 +1,4 @@
<% if (paginate.pageCnt) { %>
<% if (paginate.pageCnt > 1) { %>
<div style="text-align: center; ">
<div class="ui pagination menu" style="box-shadow: none; ">
<a class="<% if (paginate.currPage === 1) { %> disabled<% } %> icon item" <% if (paginate.currPage !== 1) { %>href="<%= syzoj.utils.makeUrl(req, Object.assign({}, req.query, { page: paginate.currPage - 1 })) %>" <% } %>id="page_prev">

4
views/problem.ejs

@ -302,7 +302,7 @@ div[class*=ace_br] {
</div>
</div>
</div>
<div class="ui center aligned vertical segment" style="padding-bottom: 0; "><button type="submit" class="ui button">提交</button></div>
<div class="ui center aligned vertical segment" style="padding-bottom: 0; "><button type="submit" class="ui labeled icon button"><i class="ui edit icon"></i>提交</button></div>
<% } else { %>
<input name="language" type="hidden" id="form">
<input name="code" type="hidden">
@ -334,7 +334,7 @@ div[class*=ace_br] {
</div>
</div>
<div class="ui center aligned vertical segment" style="padding-bottom: 0; ">
<button type="submit" class="ui button">提交</button>
<button type="submit" class="ui labeled icon button"><i class="ui edit icon"></i>提交</button>
<!--div onclick="show_custom_test()" class="ui positive button">自定义测试</div-->
</div>
<% } %>

4
views/problem_data.ejs

@ -117,8 +117,8 @@ function getIcon(filename) {
<label for="answer">上传文件(可一次性上传多个)</label>
<input type="file" name="file" multiple id="upload_file">
<div class="ui center aligned vertical segment" style="padding-bottom: 0; ">
<div class="ui button" onclick="check_replace()">提交</div>
<a href="<%= syzoj.utils.makeUrl(['problem', problem.id]) %>" class="ui blue button">返回题目</a>
<div class="ui labeled icon blue button" onclick="check_replace()"><i class="ui edit icon"></i>提交</div>
<a href="<%= syzoj.utils.makeUrl(['problem', problem.id]) %>" class="ui labeled icon button"><i class="ui angle left icon"></i>返回</a>
</div>
</div>
</div>

6
views/problem_edit.ejs

@ -64,7 +64,11 @@
<div class="font-content" id="pv-hint"></div>
</div>
<% if (problem.allowedEdit) { %>
<button type="submit" class="ui button">提交</button>
<div style="text-align: center; ">
<button type="submit" class="ui labeled submit icon button">
<i class="icon edit"></i> 提交
</button>
</div>
<% } %>
</form>
</div>

6
views/problem_import.ejs

@ -17,6 +17,10 @@
<label>题目链接</label>
<input type="text" name="url" placeholder="如:http://example.com/problem/1">
</div>
<button type="submit" class="ui button">提交</button>
<div style="text-align: center; ">
<button type="submit" class="ui labeled submit icon button">
<i class="icon edit"></i> 提交
</button>
</div>
</form>
<% include footer %>

8
views/problem_manage.ejs

@ -95,8 +95,8 @@
<label for="additional_file">上传附加文件(请使用 ZIP 格式)</label>
<input type="file" id="additional_file" name="additional_file">
</div>
<button type="submit" class="ui button">提交</button>
<a href="<%= syzoj.utils.makeUrl(['problem', problem.id]) %>" class="ui blue button">返回题目</a>
<button type="submit" class="ui labeled icon blue button"><i class="ui edit icon"></i>提交</button>
<a href="<%= syzoj.utils.makeUrl(['problem', problem.id]) %>" class="ui labeled icon button"><i class="ui angle left icon"></i>返回</a>
</form>
</div>
</div>
@ -145,7 +145,9 @@ $(function () {
});
function checkSubmit() {
;
if (!$('#file-io-output-name').val()) {
$('#file-io-output-name').val($('#file-io-output-name').attr('placeholder'));
}
}
</script>
<% include footer %>

6
views/problem_tag_edit.ejs

@ -60,7 +60,11 @@
</div>
</div>
</div>
<button type="submit" class="ui button">提交</button>
<div style="text-align: center; ">
<button type="submit" class="ui labeled submit icon button">
<i class="icon edit"></i> 提交
</button>
</div>
</form>
<script>
$(function () {

17
views/problems.ejs

@ -25,7 +25,7 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id);
<form action="<%= syzoj.utils.makeUrl(['problems', 'search']) %>" method="get">
<div class="ui search" style="width: 280px; height: 28px; margin-top: -5.3px; ">
<div class="ui left icon input" style="width: 100%; ">
<input class="prompt" style="width: 100%; " type="text" placeholder="ID / 题目名 …" name="keyword">
<input class="prompt" style="width: 100%; " type="text" value="<%= req.query.keyword %>" placeholder="ID / 题目名 …" name="keyword">
<i class="search icon"></i>
</div>
<div class="results" style="width: 100%; "></div>
@ -81,10 +81,10 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id);
</div>
</div>
<% if (problems.length) { %>
<div style="margin-bottom: 30px; ">
<% include page %>
</div>
<table class="ui very basic center aligned table">
<thead>
<tr>
@ -149,6 +149,19 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id);
</tbody>
</table><br>
<% include page %>
<% } else { %>
<div class="ui placeholder segment">
<div class="ui icon header">
<% if (typeof req.query.keyword !== 'undefined') { %>
<i class="search icon" style="margin-bottom: 20px; "></i>
找不到符合条件的题目
<% } else { %>
<i class="list icon" style="margin-bottom: 20px; "></i>
暂无题目
<% } %>
</div>
</div>
<% } %>
<script>
document.addEventListener('keydown', function (event) {
if (event.keyCode === 39) document.getElementById('page_next').click();

4
views/status_label.ejs

@ -20,7 +20,7 @@ const iconList = {
};
Vue.component('status-label', {
template: '#statusIconTemplate',
props: ['status'],
props: ['status', 'indetail'],
computed: {
icon() {
if (this.status in iconList) {
@ -30,7 +30,7 @@ Vue.component('status-label', {
}
},
colorClass() {
return this.status.toLowerCase().split(' ').join('_');
return (this.indetail ? 'status_detail ' : '') + this.status.toLowerCase().split(' ').join('_');
}
}
})

4
views/submission.ejs

@ -64,7 +64,7 @@
子任务 #{{ $index + 1 }}
</div>
<div class="four wide column">
<status-label :status="getSubtaskResult(subtask)"></status-label>
<status-label :status="getSubtaskResult(subtask)" :indetail="true"></status-label>
</div>
<div class="three wide column" v-if="subtask.score != null">
得分:<span style="font-weight: normal; ">{{ Math.trunc(subtask.score) }}</span>
@ -81,7 +81,7 @@
测试点 #{{ $caseIndex + 1 }}
</div>
<div class="four wide column">
<status-label :status="getTestcaseStatus(curCase)"></status-label>
<status-label :status="getTestcaseStatus(curCase)" :indetail="true"></status-label>
</div>
<template v-if="checkTestcaseOK(curCase)">
<div class="three wide column">

64
views/submissions_item.ejs

@ -50,28 +50,76 @@ Vue.component('submission-item', {
<script id="submissionItemTemplate" type="text/x-template">
<tr>
<% if (active === 'submissions') { %>
<td><a :href="submissionLink"><b>#{{ data.info.submissionId }}</b></a></td>
<td ref="problemLabel"><a ref="problemLabelTextFit" style="width: 230px; height: 22px; display: block; margin: 0 auto; line-height: 22px;" :href="problemLink">#{{ config.inContest ? alpha(data.info.problemId) : data.info.problemId }}. {{ data.info.problemName }}</a></td>
<% } else { %>
<td><b>#{{ data.info.submissionId }}</b></td>
<% } %>
<td ref="problemLabel"><a ref="problemLabelTextFit" style="width: 230px; height: 22px; display: block; margin: 0 auto; line-height: 22px;" :href="problemLink"><b>#{{ config.inContest ? alpha(data.info.problemId) : data.info.problemId }}.</b> {{ data.info.problemName }}</a></td>
<% if (active === 'submissions') { %>
<td><a :href="submissionLink"><b><status-label :status="statusString"></status-label></b></a></td>
<% } else { %>
<td><b><status-label :status="statusString"></status-label></b></td>
<% } %>
<template v-if="data.result">
<td v-if="config.showScore"><a :href="submissionLink"><span class="score" :class="scoreClass">{{ (data.result.score != null && data.result.score !== NaN) ? Math.floor(data.result.score) : '' }}</span></a></td>
<td v-if="config.showUsage">{{ (data.result.time != null && data.result.time !== NaN) ? data.result.time.toString() + ' ms' : '' }}</td>
<td v-if="config.showUsage">{{ (data.result.memory != null && data.result.memory !== NaN) ? data.result.memory.toString() + ' KiB' : '' }}</td>
<% if (active === 'submissions') { %>
<td v-if="config.showScore"><a :href="submissionLink"><span class="score" :class="scoreClass">{{ Math.floor(data.result.score || 0) }}</span></a></td>
<% } else { %>
<td v-if="config.showScore"><span class="score" :class="scoreClass">{{ Math.floor(data.result.score || 0) }}</span></td>
<% } %>
<td v-if="config.showUsage">{{ (data.result.time || 0).toString() + ' ms' }}</td>
<td v-if="config.showUsage">{{ (data.result.memory || 0).toString() + ' KiB' }}</td>
</template> <template v-else>
<td v-if="config.showScore"/> <td v-if="config.showUsage"/> <td v-if="config.showUsage"/>
</template>
<td v-if="config.showCode">
<span v-if="data.info.language"><a :href="submissionLink">{{ data.info.language }}</a> / </span>
<% if (active === 'submissions') { %>
<span v-if="data.info.language"><a :href="submissionLink"><b>{{ data.info.language }}</b></a> / </span>
<% } else { %>
<span v-if="data.info.language"><b>{{ data.info.language }}</b> / </span>
<% } %>
{{ data.info.codeSize }}
</td>
<td><a :href="userLink">{{ data.info.user }}</a></td>
<td>{{ data.info.submitTime }}</td>
<td v-if="showRejudge">
<form :action="submissionLink + '/rejudge'" method="POST">
<button type="submit" style="color: #000; padding: 0; border: none; background: none;" value="rejudge"><i class="repeat icon"></i></button>
</form>
<a id="rejudge-button" :onclick="'check_rejudge(' + (statusString === 'Waiting' || statusString.startsWith('Running')).toString() + ')'" style="color: #000; " href="#"><i class="repeat icon"></i></a>
<% if (active === 'submission') { %>
<div class="ui basic modal" id="modal-rejudge">
<div class="ui icon header">
<i class="retweet icon"></i>
<p style="margin-top: 15px; ">重新评测</p>
</div>
<div class="content" style="text-align: center; ">
<p>确认重新评测该提交记录吗?</p>
<p id="warning_pending"><strong>警告:只有管理员可以重新评测一个未评测完成的记录,<br>这种情况一般发生在评测服务中断后,如果一个提交正在被评测,<br>则将其重新评测会导致系统错乱!</strong></p>
</div>
<div class="actions">
<div class="ui red basic cancel inverted button">
<i class="remove icon"></i>
</div>
<a class="ui green ok inverted button" :href-post="submissionLink + '/rejudge'">
<i class="checkmark icon"></i>
</a>
</div>
</div>
<% } %>
</td>
</tr>
</script>
<% if (active === 'submission') { %>
<script>
function check_rejudge(pending) {
if (pending) {
$('#warning_pending').css('display', '');
} else {
$('#warning_pending').css('display', 'none');
}
$('#modal-rejudge').modal('show');
}
</script>
<% } %>

6
views/user_edit.ejs

@ -70,9 +70,9 @@
<label>管理用户</label>
</div>
</div>
<div style="text-align: center; ">
<button type="submit" class="ui button">修改</button>
<a href="<%= syzoj.utils.makeUrl(['user', edited_user.id]) %>" class="ui blue button">返回个人资料</a>
<div style="text-align: center; margin-top: 30px; ">
<button type="submit" class="ui blue labeled icon button"><i class="ui icon edit"></i>修改</button>
<a href="<%= syzoj.utils.makeUrl(['user', edited_user.id]) %>" class="ui labeled icon button"><i class="ui icon angle left"></i>返回</a>
</div>
</form>
</div>

Loading…
Cancel
Save