@ -84,6 +84,7 @@ app.get('/problem/:id/edit', async (req, res) => {
let problem = await Problem.fromID(id);
if (!problem) {
if (!res.locals.user) throw 'Permission denied.';
problem = await Problem.create();
problem.id = id;
problem.allowedEdit = true;
@ -1,13 +1,15 @@
<% this.title = '题库' %>
<% include header %>
<div class="padding">
<div class="ui grid">
<div class="row">
<div class="column">
<a href="<%= syzoj.utils.makeUrl(['problem', 0, 'edit']) %>" class="ui mini right floated button">添加题目</a>
<% if (user) { %>
</div>
<% } %>
<table class="ui very basic center aligned table">
<thead>
<tr>