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') { %>