Skip to content

Commit 8767434

Browse files
committed
🎨 Simplify template manager context and source labels #19167
1 parent b0bb5f9 commit 8767434

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

app/src/assets/scss/business/_template-manager.scss

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,14 @@
122122
}
123123

124124
&__context {
125-
summary {
126-
cursor: pointer;
127-
overflow-wrap: anywhere;
128-
}
125+
display: flex;
126+
flex-direction: column;
127+
gap: 8px;
128+
overflow-wrap: anywhere;
129129

130130
&-name {
131131
margin-inline-start: 8px;
132132
}
133-
134-
> div {
135-
margin-top: 8px;
136-
}
137133
}
138134

139135
&__context-fields {

app/src/template/manager.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ ${button("rename", lang.rename)}${button("move", lang.move)}${button("remove", l
5050
<div class="template-manager__path ft__breakword"></div>
5151
<textarea class="b3-text-field template-manager__source" spellcheck="false" aria-label="${lang.templateSource}" disabled></textarea>
5252
<div class="template-manager__actions">${button("save", lang.save)}${button("preview", lang.templatePreview)}</div>
53-
<details class="template-manager__context">
54-
<summary>${lang.templateContext}<span class="template-manager__context-name"></span></summary>
53+
<div class="template-manager__context">
54+
<div>${lang.templateContext}<span class="template-manager__context-name"></span></div>
5555
<div class="ft__on-surface">${lang.templateContextTip}</div>
5656
<div class="template-manager__context-fields">
5757
<input class="b3-text-field" type="search" placeholder="${lang.templateContextSearch}" aria-label="${lang.templateContextSearch}">
58-
<select class="b3-select" aria-label="${lang.templateContext}"></select></div></details>
58+
<select class="b3-select" aria-label="${lang.templateContext}"></select></div></div>
5959
<div class="template-manager__preview"></div>
6060
</div></div>
6161
</div>`,
@@ -104,7 +104,8 @@ ${button("rename", lang.rename)}${button("move", lang.move)}${button("remove", l
104104
destroy();
105105
});
106106
const update = () => {
107-
pathLabel.textContent = (selected?.path || lang.templateSource) + (dirty() ? " *" : "");
107+
pathLabel.textContent = (selected?.path || "") + (dirty() ? " *" : "");
108+
pathLabel.classList.toggle("fn__none", !selected);
108109
source.disabled = !selected || selected.isDir;
109110
source.readOnly = busy;
110111
list.setAttribute("aria-busy", String(busy));

docs/TEMPLATE-MANAGER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## 预览
1414

15-
点击「预览模板」执行当前文本框中的内容,无须先保存或插入文档。默认使用打开窗口时的文档或块作为上下文;「预览上下文」默认收起并显示当前选择的名称,展开后可以搜索并选择其他文档。此处搜索的是上下文文档,不是左侧模板列表。预览使用所选文档的标题、ID 等信息运行模板,不会修改该文档;标题、ID、路径和 SQL 查询等结果取决于所选上下文及当前数据。
15+
点击「预览模板」执行当前文本框中的内容,无须先保存或插入文档。默认使用打开窗口时的文档或块作为上下文;「预览上下文」直接显示当前选择的名称、用途说明和文档选择控件,可以搜索并选择其他文档。此处搜索的是上下文文档,不是左侧模板列表。预览使用所选文档的标题、ID 等信息运行模板,不会修改该文档;标题、ID、路径和 SQL 查询等结果取决于所选上下文及当前数据。
1616

1717
预览使用现有只读渲染模式,不保存当前源码,也不提交文档树创建计划。数据库预览仍使用表格展示,不能等同于实际插入后的全部交互效果。
1818

0 commit comments

Comments
 (0)