Browse Source

Make index page's ranklist's count configurable

pull/6/head
Menci 6 years ago
parent
commit
7d66ad6bf6
  1. 1
      config-example.json
  2. 2
      modules/index.js

1
config-example.json

@ -52,6 +52,7 @@
"problem": 50,
"problem_statistics": 10,
"judge_state": 10,
"ranklist_index": 20,
"ranklist": 20,
"discussion": 10,
"article_comment": 10,

2
modules/index.js

@ -31,7 +31,7 @@ const timeAgo = new TimeAgo('zh-CN');
app.get('/', async (req, res) => {
try {
let ranklist = await User.query([1, 10], { is_show: true }, [[syzoj.config.sorting.ranklist.field, syzoj.config.sorting.ranklist.order]]);
let ranklist = await User.query([1, syzoj.config.page.ranklist_index || 3], { is_show: true }, [[syzoj.config.sorting.ranklist.field, syzoj.config.sorting.ranklist.order]]);
await ranklist.forEachAsync(async x => x.renderInformation());
let notices = (await Article.query(null, { is_notice: true }, [['public_time', 'desc']])).map(article => ({

Loading…
Cancel
Save