forked from svn2github/hustoj
-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #742 from renbaoshuo/master
Add theme: mdui
- Loading branch information
Showing
627 changed files
with
75,704 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# HUSTOJ Theme MDUI | ||
|
||
## Author | ||
|
||
**HUSTOJ Theme MDUI** © [Baoshuo](https://github.com/renbaoshuo), Released under the [GPL-2.0](https://github.com/zhblue/hustoj/blob/master/trunk/web/gpl-2.0.txt) License.<br> | ||
|
||
> [Personal Website](https://baoshuo.ren) · [Blog](https://blog.baoshuo.ren) · GitHub [@renbaoshuo](https://github.com/renbaoshuo) · Twitter [@renbaoshuo](https://twitter.com/renbaoshuo) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="author" content="Ren Baoshuo"> | ||
<meta name="generator" content="HUSTOJ"> | ||
<link rel="icon" href="/favicon.ico"> | ||
|
||
<!-- Title --> | ||
<title><?php echo ($page_title?$page_title.' - ':'').$OJ_NAME; ?></title> | ||
|
||
<!-- MDUI --> | ||
<?php if($MDUI_OFFLINE) { ?> | ||
<link rel="stylesheet" href="<?php echo $OJ_CDN_URL.$path_fix."template/$OJ_TEMPLATE"; ?>/assets/css/mdui.min.css"> | ||
<script src="<?php echo $OJ_CDN_URL.$path_fix."template/$OJ_TEMPLATE"; ?>/assets/js/mdui.min.js"></script> | ||
<?php } else { ?> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/mdui.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/mdui.min.js"></script> | ||
<?php } ?> | ||
<script> | ||
var $ = mdui.$; | ||
</script> | ||
<style> | ||
@media (min-width: 840px) { | ||
.mdui-container { | ||
padding-top: 80px; | ||
} | ||
} | ||
|
||
@media (min-width: 480px) { | ||
.mdui-container { | ||
padding-top: 60px; | ||
} | ||
} | ||
|
||
.mdui-container { | ||
padding-top: 40px; | ||
padding-bottom: 60px; | ||
position: relative; | ||
} | ||
|
||
.mdui-select-menu { | ||
min-height: 300px !important; | ||
} | ||
</style> | ||
|
||
<!-- Fonts --> | ||
<?php if(isset($MDUI_OFFLINE) && $MDUI_OFFLINE) { ?> | ||
<link rel="stylesheet" href="<?php echo $OJ_CDN_URL.$path_fix."template/$OJ_TEMPLATE"; ?>/assets/css/fonts.css"> | ||
<?php } else { ?> | ||
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital@0;1&family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap" | ||
as="style" onload="this.onload=null, this.rel='stylesheet'"> | ||
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital@0;1&family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap"></noscript> | ||
<?php } ?> | ||
|
||
<!-- Styles --> | ||
<style> | ||
code { | ||
font-family: 'Roboto Mono', 'Consolas', monospace !important; | ||
} | ||
body { | ||
font-family: 'Open Sans', 'Roboto', 'Noto', 'Helvetica', 'Arial', sans-serif !important; | ||
} | ||
</style> | ||
|
||
<!-- Scripts --> | ||
<script> | ||
console.log('\n %c HUSTOJ %c https://github.com/zhblue/hustoj %c\n', 'color: #fadfa3; background: #000000; padding:5px 0;', 'background: #fadfa3; padding:5px 0;', ''); | ||
console.log('\n %c Theme Author %c Baoshuo (@renbaoshuo) %c https://baoshuo.ren %c\n', 'color: #fadfa3; background: #000000; padding:5px 0;', 'background: #fadfa3; padding:5px 0;', 'background: #ffbf33; padding:5px 0;', ''); | ||
console.log('\n %c MDUI v1.0.1 %c https://mdui.org %c\n', 'color: #ffffff; background: #030307; padding:5px 0;', 'background: #673ab7; padding:5px 0;', ''); | ||
console.log('\n GitHub Homepage: https://github.com/zhblue/hustoj \n Document: https://zhblue.github.io/hustoj \n Bug report URL: https://github.com/zhblue/hustoj/issues \n \n%c ★ Please give us a star on GitHub! ★ %c \n', 'color: red;', '') | ||
</script> | ||
|
||
<?php | ||
if(stripos($_SERVER['REQUEST_URI'],"template")!==false) exit(); | ||
|
||
$url = basename($_SERVER['REQUEST_URI']); | ||
$dir = basename(getcwd()); | ||
|
||
if($dir == "discuss3") $path_fix="../"; | ||
else $path_fix=""; | ||
|
||
if(isset($OJ_NEED_LOGIN) && $OJ_NEED_LOGIN | ||
&& ($url!='loginpage.php' && $url!='lostpassword.php' | ||
&& $url!='lostpassword2.php' && $url!='registerpage.php') | ||
&& !isset($_SESSION[$OJ_NAME.'_'.'user_id'])) { | ||
header("location:".$path_fix."loginpage.php"); | ||
exit(); | ||
} | ||
|
||
$_SESSION[$OJ_NAME.'_'.'profile_csrf'] = rand(); | ||
|
||
if($OJ_ONLINE){ | ||
require_once($path_fix.'include/online.php'); | ||
$on = new online(); | ||
} | ||
?> | ||
|
||
<!-- KaTeX --> | ||
<script> var katex_options = { delimiters: [ {left: '$$', right: '$$', display: true}, {left: '$', right: '$', display: false}, {left: '\\(', right: '\\)', display: false}, {left: '\\[', right: '\\]', display: true} ] }; </script> | ||
<?php if(isset($MDUI_OFFLINE) && $MDUI_OFFLINE) { ?> | ||
<link rel="stylesheet" href="<?php echo $OJ_CDN_URL.$path_fix."template/$OJ_TEMPLATE"; ?>/assets/css/katex.min.css" | ||
as="style" onload="this.onload=null, this.rel='stylesheet'"> | ||
<script defer src="<?php echo $OJ_CDN_URL.$path_fix."template/$OJ_TEMPLATE"; ?>/assets/js/katex.min.js"></script> | ||
<script defer src="<?php echo $OJ_CDN_URL.$path_fix."template/$OJ_TEMPLATE"; ?>/assets/js/auto-render.min.js" | ||
onload="renderMathInElement(document.body, katex_options);"></script> | ||
<?php } else { ?> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" | ||
as="style" onload="this.onload=null, this.rel='stylesheet'"> | ||
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" | ||
onload="renderMathInElement(document.body, katex_options);"></script> | ||
<?php } ?> | ||
|
||
<!-- Highlight.js --> | ||
<?php if(isset($MDUI_OFFLINE) && $MDUI_OFFLINE) { ?> | ||
<link rel="stylesheet" href="<?php echo $OJ_CDN_URL.$path_fix."template/$OJ_TEMPLATE"; ?>/assets/css/atom-one-light.min.css"> | ||
<script src="<?php echo $OJ_CDN_URL.$path_fix."template/$OJ_TEMPLATE"; ?>/assets/js/highlight.pack.js" | ||
onload="hljs.initHighlightingOnLoad();"></script> | ||
<?php } else { ?> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/styles/atom-one-light.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/highlight.min.js" | ||
onload="hljs.initHighlightingOnLoad();"></script> | ||
<!-- Pascal --><script src="https://cdn.jsdelivr.net/npm/@highlightjs/[email protected]/languages/delphi.min.js"></script> | ||
<?php } ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<header class="mdui-appbar mdui-appbar-fixed" style="z-index: 999;"> | ||
<div class="mdui-toolbar mdui-color-theme"> | ||
<a href="javascript:;" class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '菜单'}" mdui-drawer="{target: '#main-drawer', swipe: true}"> | ||
<i class="mdui-icon material-icons">menu</i> | ||
</a> | ||
<a class="mdui-typo-title" href="<?php echo $OJ_HOME; ?>"><?php echo $OJ_NAME ?></a> | ||
<div class="mdui-toolbar-spacer"></div> | ||
<div class="mdui-btn" mdui-tooltip="{content: '账户'}" mdui-menu="{target: '#account-menu', position: 'bottom', fixed: true}"> | ||
<i class="mdui-icon material-icons">account_circle</i> | ||
<?php if(isset($_SESSION[$OJ_NAME.'_'.'user_id'])) { ?> | ||
<?php echo $_SESSION[$OJ_NAME.'_'.'user_id']; ?> | ||
<?php } else { ?> | ||
请登录 | ||
<?php } ?> | ||
</div> | ||
<ul class="mdui-menu mdui-menu-cascade" id="account-menu"> | ||
<?php | ||
if(isset($_SESSION[$OJ_NAME.'_'.'user_id'])){ | ||
$sid = $_SESSION[$OJ_NAME.'_'.'user_id']; ?> | ||
<li class="mdui-menu-item"> | ||
<a href="<?php echo $path_fix; ?>userinfo.php?user=<?php echo $sid; ?>" | ||
class="mdui-ripple">我的信息</a> | ||
</li> | ||
<li class="mdui-menu-item"> | ||
<a href="<?php echo $path_fix; ?>modifypage.php" class="mdui-ripple">修改信息</a> | ||
</li> | ||
<li class="mdui-menu-item"> | ||
<a href="<?php echo $path_fix; ?>logout.php" class="mdui-ripple">退出登录</a> | ||
</li> | ||
<?php } else { ?> | ||
<li class="mdui-menu-item"> | ||
<a href="<?php echo $path_fix; ?>loginpage.php" class="mdui-ripple">登录</a> | ||
</li> | ||
<?php if(isset($OJ_REGISTER) && $OJ_REGISTER){ ?> | ||
<li class="mdui-menu-item"> | ||
<a href="<?php echo $path_fix; ?>registerpage.php" class="mdui-ripple">注册</a> | ||
</li> | ||
<?php } ?> | ||
<?php } ?> | ||
</ul> | ||
</div> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<div class="mdui-drawer" id="main-drawer"> | ||
<div class="mdui-list mdui-m-t-1 mdui-color-white"> | ||
<!-- Menu --> | ||
<a class="mdui-list-item mdui-ripple <?php if (!$url || strpos($url, "index.php") !== false) echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>index.php"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">home</i> | ||
<div class="mdui-list-item-content">首页</div> | ||
</a> | ||
<a class="mdui-list-item mdui-ripple <?php if (strpos($url, "problemset.php") !== false || strpos($url, "problem.php") !== false) echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>problemset.php"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">book</i> | ||
<div class="mdui-list-item-content">题目</div> | ||
</a> | ||
<a class="mdui-list-item mdui-ripple <?php if (strpos($url, "category.php") !== false) echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>category.php"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">apps</i> | ||
<div class="mdui-list-item-content">分类</div> | ||
</a> | ||
<a class="mdui-list-item mdui-ripple <?php if (strpos($url, "status.php") !== false && strpos($url, "status.php?user_id=$sid") === false) echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>status.php"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">play_circle_outline</i> | ||
<div class="mdui-list-item-content">状态</div> | ||
</a> | ||
<a class="mdui-list-item mdui-ripple <?php if (strpos($url, "contest.php") !== false && $url !== "contest.php?my") echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>contest.php"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">layers</i> | ||
<div class="mdui-list-item-content">竞赛/作业</div> | ||
</a> | ||
<a class="mdui-list-item mdui-ripple <?php if (strpos($url, "ranklist.php") !== false) echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>ranklist.php"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">equalizer</i> | ||
<div class="mdui-list-item-content">排名</div> | ||
</a> | ||
<div class="mdui-divider"></div> | ||
|
||
<!-- User --> | ||
<?php | ||
if(isset($_SESSION[$OJ_NAME.'_'.'user_id'])){ | ||
$sid = $_SESSION[$OJ_NAME.'_'.'user_id']; ?> | ||
<a class="mdui-list-item mdui-ripple <?php if (strpos($url, "status.php?user_id=$sid") !== false) echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>status.php?user_id=<?php echo $sid; ?>"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">play_circle_outline</i> | ||
<div class="mdui-list-item-content">我的提交</div> | ||
</a> | ||
<a class="mdui-list-item mdui-ripple <?php if ($url === "contest.php?my") echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>contest.php?my"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">apps</i> | ||
<div class="mdui-list-item-content">我参加的竞赛/作业</div> | ||
</a> | ||
<?php if(isset($_SESSION[$OJ_NAME.'_'.'administrator']) | ||
|| isset($_SESSION[$OJ_NAME.'_'.'contest_creator']) | ||
|| isset($_SESSION[$OJ_NAME.'_'.'problem_editor']) | ||
|| isset($_SESSION[$OJ_NAME.'_'.'password_setter'])) { ?> | ||
<div class="mdui-divider"></div> | ||
|
||
<!-- Admin --> | ||
<a class="mdui-list-item mdui-ripple" href="<?php echo $path_fix; ?>admin/"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">settings</i> | ||
<div class="mdui-list-item-content">后台管理</div> | ||
</a> | ||
<?php } ?> | ||
<?php } else { ?> | ||
<a class="mdui-list-item mdui-ripple <?php if ($url == "loginpage.php") echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>loginpage.php"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">assignment_ind</i> | ||
<div class="mdui-list-item-content">登录</div> | ||
</a> | ||
<?php if(isset($OJ_REGISTER) && $OJ_REGISTER){ ?> | ||
<a class="mdui-list-item mdui-ripple <?php if ($url == "registerpage.php") echo "mdui-list-item-active"; ?>" | ||
href="<?php echo $path_fix; ?>registerpage.php"> | ||
<i class="mdui-list-item-icon mdui-icon material-icons">person_add</i> | ||
<div class="mdui-list-item-content">注册</div> | ||
</a> | ||
<?php } ?> | ||
<?php } ?> | ||
|
||
</div> | ||
</div> |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.