From 8d103251e58ff21b9f58268083ff07665dad9331 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Wed, 10 Jul 2019 09:17:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E9=A1=B5=E9=9D=A2=E5=89=8D=E7=AB=AF=E5=88=9D?= =?UTF-8?q?=E6=AD=A5=E5=AE=8C=E6=88=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/admin.js | 16 ++++++++++++ views/admin_classify.ejs | 55 ++++++++++++++++++++++++++++++++++++++++ views/admin_header.ejs | 1 + views/header.ejs | 2 ++ 4 files changed, 74 insertions(+) create mode 100644 views/admin_classify.ejs diff --git a/modules/admin.js b/modules/admin.js index 1e930cb..24eebad 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -291,6 +291,22 @@ app.get('/admin/rejudge', async (req, res) => { } }); +app.get('/admin/classify', async (req, res) => { + try { + if (!res.locals.user || !res.locals.user.is_admin) throw new ErrorMessage('您没有权限进行此操作。'); + + res.render('admin_classify', { + form: {}, + count: null + }); + } catch (e) { + syzoj.log(e); + res.render('error', { + err: e + }) + } +}); + app.post('/admin/other', async (req, res) => { try { if (!res.locals.user || !res.locals.user.is_admin) throw new ErrorMessage('您没有权限进行此操作。'); diff --git a/views/admin_classify.ejs b/views/admin_classify.ejs new file mode 100644 index 0000000..bfa6f94 --- /dev/null +++ b/views/admin_classify.ejs @@ -0,0 +1,55 @@ +<% this.adminPage = 'classify'; %> +<% include admin_header %> + +
+
+ 暂无分类 +
+
+
+

目前分类

+
+
+
+
{{item.title}}
+
+ {{item.description}} +
+
+
+ + 编辑分类信息 +
+
+
+
+
+
+
+ 新增分类 +
+
+
+ +<% include admin_footer %> diff --git a/views/admin_header.ejs b/views/admin_header.ejs index cbfe523..332be0d 100644 --- a/views/admin_header.ejs +++ b/views/admin_header.ejs @@ -2,6 +2,7 @@ let items = { info: '统计信息', config: '系统配置', + classify: '分类管理', privilege: '权限管理', rejudge: '一键重测', links: '友链管理', diff --git a/views/header.ejs b/views/header.ejs index aee00e3..fa0bb46 100644 --- a/views/header.ejs +++ b/views/header.ejs @@ -33,6 +33,7 @@ <% } %> + <% if (syzoj.config.google_analytics && syzoj.config.google_analytics !== 'UA-XXXXXXXX-X') { %>