fix typo error
This commit is contained in:
@@ -333,3 +333,51 @@ RAM 子账号授予 `AliyunYundunGreenWebFullAccess`;②CHANGELOG 条目仍未
|
||||
- 沙箱内若要用 overlay,注意 **overlay.json 的 Replace 键盘符必须小写**(`c:/...`),
|
||||
大写 `C:/...` 会被 Go 规范化成 `c:\` 后匹配不上、报 `deleted in overlay`;stub 在
|
||||
`dev/s3stub/s3_stub.go`。本次用 `C:/Users/Tamakyi Gekka/AppData/Local/Temp/tb-overlay2.json` 跑通。
|
||||
|
||||
---
|
||||
|
||||
## 第六轮:设置面板聚合(新增「防护设置」tab)+ 审核严格度排版修复
|
||||
|
||||
用户诉求:① 把防骚扰、屏蔽词、审核严格度、提问密码聚合到 `/user/profile` 下一个独立 tab;
|
||||
② 审核严格度档位处「一个字就换行」很难看。
|
||||
|
||||
### 决策(AskUserQuestion 已确认)
|
||||
|
||||
- 新 tab 名称:**防护设置**(i18n 键 `admin.tabSecurity`,tab id `security`)。
|
||||
- **「页面访问密码」一并迁入**(原先在「用户设置」面板)。
|
||||
- 旧位置**完全移除,不留跳转提示**。
|
||||
|
||||
### 改动
|
||||
|
||||
**后端**
|
||||
- `route/user/features.go`:新增 `ProfileTabSecurity = "security"`,并纳入 `ProfileTab()` 白名单
|
||||
(不加入的话回跳会落到 account 面板)。
|
||||
- `route/user/password.go`:`UpdateAskPassword` / `UpdatePagePassword` 的硬编码回跳
|
||||
(`profileURLWithTab(ProfileTabQuestion)`、`"/user/profile"`)全部改为 `returnTab(ctx)`,
|
||||
跟随表单携带的 `?tab=`。
|
||||
|
||||
**模板**
|
||||
- `templates/user/profile.html`:tab 栏新增「防护设置」按钮;新增
|
||||
`<div class="profile-panel" data-profile-panel="security">`,内含 防骚扰 / 屏蔽词 /
|
||||
审核严格度 / 页面访问密码 / 提问密码 五个表单(action 均带 `?tab=security`)。
|
||||
提问/私聊/投票面板中这些表单全部删除(**原先屏蔽词与审核严格度被重复渲染 3 份**)。
|
||||
account 面板移除「页面访问密码」卡(原编号 7 让位,账号操作改为 7)。
|
||||
JS 面板切换是全泛型(`[data-profile-tab]` / `[data-profile-panel]`),无需改动。
|
||||
- `templates/user/moderation-strictness.html`(**只用 shell/脚本改,禁用 Write/Edit**):
|
||||
1. 档位表格:档位列 `uk-table-shrink` + `white-space:nowrap`、范围列 `uk-table-expand`
|
||||
—— 修掉右侧长文案把 4 字档位名(畅所欲言/正常水平/不听坏话)挤成逐字折行。
|
||||
2. 选择区改三行:标题(显式 `display:block`)→ 下拉(独立 div)→
|
||||
「未设置时跟随站点默认档位。」(独立 div)。
|
||||
|
||||
**i18n**:四语字典新增 `admin.tabSecurity`(防护设置 / 防護設置 / Protection / 防護設定),
|
||||
插在「功能管理」组之后的**独立组**,未切开任何既有对齐组(避免 gofmt 重排污染 diff)。
|
||||
|
||||
### 验证
|
||||
|
||||
- `go test ./templates/`(含 profile 渲染、严格度回显断言 `selectedStrictnessOptions`)ok;
|
||||
`./internal/i18n/` ok(四语键一致)。
|
||||
- `go build` + `go vet` `./route/user/` 均 0。
|
||||
- ⚠️ **gofmt 提醒(重要,易误判)**:`gofmt -l` 会列出**所有 CRLF 文件**(含本次完全没碰的
|
||||
`route/user/moderation.go`、`vote.go`),因为 gofmt 把 CRLF 规范成 LF。
|
||||
剥离 CR 后比对,本次改动**零格式差异** → 格式是对的。
|
||||
**切勿跑 `gofmt -w`**,那会把文件转成 LF、造成全量 diff 污染。
|
||||
|
||||
Reference in New Issue
Block a user