mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: 页面布局优化
This commit is contained in:
1 parent
f820a089c6
commit
14948e97a7
9 files changed
+74
-35
No files matched your search
@@ -38,7 +38,7 @@ export class ProblemHandler extends Handler {
|
||||
page, pcount, ppcount, pdocs, psdict, category,
|
||||
} = this.response.body;
|
||||
this.response.body = {
|
||||
title: this.renderTitle(category),
|
||||
title: this.renderTitle(this.translate('problem_main')),
|
||||
fragments: (await Promise.all([
|
||||
this.renderHTML('partials/problem_list.html', {
|
||||
page, ppcount, pcount, pdocs, psdict,
|
||||
@@ -92,8 +92,10 @@ export class ProblemMainHandler extends ProblemHandler {
|
||||
if (q) {
|
||||
const pdoc = await problem.get(domainId, +q || q, problem.PROJECTION_LIST);
|
||||
if (pdoc) {
|
||||
const count = pdocs.length;
|
||||
pdocs = pdocs.filter((doc) => doc.docId !== pdoc.docId);
|
||||
pdocs.unshift(pdoc);
|
||||
pcount = pcount - count + pdocs.length;
|
||||
}
|
||||
}
|
||||
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
|
||||
|
||||
@@ -683,6 +683,8 @@ async function handle(ctx, HandlerClass, checker) {
|
||||
await bail(`handler/before/${HandlerClass.name.replace(/Handler$/, '')}`, h);
|
||||
await bail('handler/before', h);
|
||||
if (h[method]) await h[method](args);
|
||||
await bail(`handler/before-operation/${HandlerClass.name.replace(/Handler$/, '')}`, h);
|
||||
await bail('handler/before-operation', h);
|
||||
if (operation) await h[`post${operation}`](args);
|
||||
await bail(`handler/after/${HandlerClass.name.replace(/Handler$/, '')}`, h);
|
||||
await bail('handler/after', h);
|
||||
|
||||
Reference in new issue
Block a user