dashboard: move expressions (e-*) from 词条 page to 语法 page
This commit is contained in:
@@ -214,7 +214,10 @@ BODY_ITEMS = """
|
||||
"""
|
||||
|
||||
BODY_GRAMMAR = """
|
||||
<h1>语法修正 <span class="muted" style="font-size:14px">按问题登记、去重</span></h1>
|
||||
<h1>语法</h1>
|
||||
<h2>表达 / 功能语</h2>
|
||||
<div class="wrapx"><table id="expr"></table></div>
|
||||
<h2>语法修正 <span class="muted" style="font-size:14px">按问题登记、去重</span></h2>
|
||||
<div class="wrapx"><table id="grammar"></table></div>
|
||||
"""
|
||||
|
||||
@@ -252,6 +255,7 @@ let currentFilter = "all";
|
||||
function renderItems() {
|
||||
const f = currentFilter, q = document.getElementById("q").value.trim().toLowerCase();
|
||||
const rows = DATA.items.filter(i =>
|
||||
(i.kind === "word" || i.kind === "phrase") &&
|
||||
(f === "all" || i.status === f) &&
|
||||
(!q || (i.item + i.meaning + i.context + i.tags).toLowerCase().includes(q)));
|
||||
document.getElementById("items").innerHTML =
|
||||
@@ -274,6 +278,15 @@ renderItems();
|
||||
"""
|
||||
|
||||
SCRIPT_GRAMMAR = r"""
|
||||
const EXPR = DATA.items.filter(i => i.kind === "expression");
|
||||
document.getElementById("expr").innerHTML =
|
||||
`<thead><tr><th>id</th><th>条目</th><th>等级</th><th>释义</th><th>功能</th>
|
||||
<th>上下文</th><th>状态</th><th>first</th><th>修正</th></tr></thead><tbody>` +
|
||||
(EXPR.map(i => `<tr>
|
||||
<td class="mono">${esc(i.id)}</td><td><b>${esc(i.item)}</b></td><td>${esc(i.level)}</td>
|
||||
<td>${esc(i.meaning)}</td><td class="muted">${esc(i.function)}</td>
|
||||
<td class="muted">${esc(i.context)}</td><td>${badge(i.status)}</td>
|
||||
<td class="mono">${esc(i.first)}</td><td>${fx(i.fix)}</td></tr>`).join("") || "") + `</tbody>`;
|
||||
document.getElementById("grammar").innerHTML =
|
||||
`<thead><tr><th>id</th><th>类别</th><th>问题</th><th>正确规则</th><th>例子</th>
|
||||
<th>状态</th><th>次数</th><th>最近</th><th>下次复习</th></tr></thead><tbody>` +
|
||||
|
||||
Reference in New Issue
Block a user