看板UI更新,主要是弹窗的大BUG
This commit is contained in:
@@ -0,0 +1,152 @@
|
|||||||
|
# 前端 UI 开发规范(给 Gemini)
|
||||||
|
|
||||||
|
> 你(Gemini)**只负责前端 UI**。这份文档是你动手前的唯一须知,请**先完整读一遍再改任何代码**。
|
||||||
|
> 本项目是 **Kanboard 1.2.52**(开源 PHP 看板)的二次开发,分支 `fix-newUI`。
|
||||||
|
> 代码根目录:`W:\kanban\kanboard-1.2.52\`(下文所有相对路径都以此为基准)。
|
||||||
|
> 文档里说的"屎山"指:同一样式散落多处互相打架、死代码、内联样式乱塞、写死颜色/宽度。**本规范的全部目的就是不让它再变成屎山。**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 0. 三条铁律(违反任何一条 = 制造屎山)
|
||||||
|
|
||||||
|
1. **所有 CSS 只写在 `assets/css/custom_dashboard.css`,并放进正确的编号区块。** 严禁在 `.php` 模板里内联 `<style>`,严禁新建别的 css 文件。
|
||||||
|
2. **同一个东西只允许有一处样式来源。** 改样式先去对应区块找现成的改,别另起一段重复定义(重复 = 下次没人知道哪段生效)。
|
||||||
|
3. **改颜色一律用变量,不准写死色值。** 主题色变量在 `assets/css/custom_login.css` 的 `:root` 里(如 `--login-bg`、`--login-card-bg`、`--color-primary`)。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 怎么运行 / 怎么看到你的改动
|
||||||
|
|
||||||
|
- 应用跑在 **`http://127.0.0.1:8000`**,由本地 PHP 实时读磁盘文件提供服务(双击 `W:\kanban\start-kanban.bat` 启动;那个黑窗口要一直开着)。
|
||||||
|
- 改完文件**不需要清缓存**:框架会给 css/js 的 URL 自动加 `?文件修改时间` 戳,存盘即换新。
|
||||||
|
- ⚠️ **弹窗(modal)内容是 AJAX 加载的,不是随页面一起来的。** 所以看弹窗的改动要:
|
||||||
|
1. 先 **F5 刷新整个页面**(让 `<head>` 里的新 CSS 重新加载)
|
||||||
|
2. **再重新打开那个弹窗**(光 F5 不重开弹窗,看到的还是旧弹窗 DOM)
|
||||||
|
|
||||||
|
### 「改了看不见」自查清单(按顺序排查,别瞎猜缓存)
|
||||||
|
1. 改的是不是 `custom_dashboard.css` 的**正确区块**?(不是某个模板里的内联样式 / 不是 `.min.css`)
|
||||||
|
2. 有没有 **F5 + 重新打开弹窗**?
|
||||||
|
3. 服务器还在跑吗?(浏览器 `ERR_CONNECTION_REFUSED` = 8000 端口的服务进程被关了,重开 `start-kanban.bat`,**这跟你的代码无关**)
|
||||||
|
4. 是不是被**核心写死的样式用更高特异性盖住了**?见第 5 节。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 你能碰 / 绝对不能碰的文件
|
||||||
|
|
||||||
|
### ✅ 允许修改(前端 UI 全在这几处)
|
||||||
|
| 文件 | 作用 |
|
||||||
|
|---|---|
|
||||||
|
| `assets/css/custom_dashboard.css` | **全站自定义样式总入口**(登录页除外)。你 95% 的工作在这里 |
|
||||||
|
| `assets/css/custom_login.css` | 登录页样式 + **全站主题色变量 `:root`** |
|
||||||
|
| `assets/js/custom_dashboard.js` | UI 行为脚本(label 转 placeholder、定位"指派给我"等) |
|
||||||
|
| `app/Template/` 下的自定义模板(见第 4 节) | 弹窗/页面的 HTML 结构 |
|
||||||
|
|
||||||
|
### ⛔ 绝对不要改(改了要么白改,要么炸)
|
||||||
|
- `assets/js/app.min.js`、`assets/js/vendor.min.js` —— **压缩文件,没有源码,无法维护**。Kanboard 弹窗的结构和行为就藏在 `app.min.js` 里,**别手改它**;要调 UI 行为就写在 `custom_dashboard.js`。
|
||||||
|
- `assets/css/*.min.css`(`vendor` / `light` / `dark` / `auto` / `print`)—— 核心主题,只读。
|
||||||
|
- `vendor/`、`app/Model/`、`app/Controller/`、`app/Core/`、`data/db.sqlite` —— 后端/数据,不归你管。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. `custom_dashboard.css` 的结构(必须维护好目录)
|
||||||
|
|
||||||
|
文件**顶部有一个编号目录(TOC)**,正文按编号分区块。**新增样式时:放进对应编号区块;如果开了新主题,更新顶部 TOC。**
|
||||||
|
|
||||||
|
```
|
||||||
|
1. 全局背景
|
||||||
|
2. 顶栏 Header(logo / 标题 / 项目切换器)
|
||||||
|
3. 侧边栏 Sidebar
|
||||||
|
4. 页面头部标签 Page header
|
||||||
|
5. 列表 / 卡片 / 提示 / 搜索框
|
||||||
|
6. 顶栏注入组件(视图切换 / 过滤)
|
||||||
|
7. 项目概览仪表盘(KPI + 标签页)
|
||||||
|
8. 看板 Kanban board
|
||||||
|
9. 任务【编辑】弹窗表单布局 (.task-form-*)
|
||||||
|
10. 任务【新建】弹窗表单布局 (.custom-task-form-*)
|
||||||
|
11. 弹窗通用外观(所有 #modal-box)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 「改什么 → 改哪里」速查
|
||||||
|
| 你想改 | 去这里 |
|
||||||
|
|---|---|
|
||||||
|
| 任意弹窗的外壳(宽度/圆角/遮罩/关闭按钮/通用按钮) | `custom_dashboard.css` **§11** |
|
||||||
|
| **新建任务**弹窗的表单布局 | `custom_dashboard.css` **§10** |
|
||||||
|
| **编辑任务**弹窗的表单布局 | `custom_dashboard.css` **§9** |
|
||||||
|
| 主题色 | `custom_login.css` 的 `:root`(亮色)和 `@media (prefers-color-scheme: dark)`(暗色) |
|
||||||
|
| 弹窗内字段的行为(隐藏 label、占位符等) | `custom_dashboard.js` |
|
||||||
|
| 弹窗的 HTML 结构(加/删字段、换列) | 对应模板(第 4 节),**样式仍写回 css** |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 关键模板 & 一个必须知道的"两套表单"陷阱
|
||||||
|
|
||||||
|
| 模板 | 是什么 |
|
||||||
|
|---|---|
|
||||||
|
| `app/Template/layout.php` | 全站骨架,负责加载 css/js(一般别动) |
|
||||||
|
| `app/Template/header/title.php` | 顶栏标题区 |
|
||||||
|
| `app/Template/header/custom_board_selector.php` | 项目切换下拉 |
|
||||||
|
| `app/Template/project_overview/show.php` | 项目概览(KPI 卡 + 纯 CSS 标签页) |
|
||||||
|
| `app/Template/task_creation/show.php` | **新建任务**弹窗(已去内联样式,只剩 HTML) |
|
||||||
|
| `app/Template/task_modification/show.php` | **编辑任务**弹窗 |
|
||||||
|
|
||||||
|
### ⚠️ 陷阱:新建 和 编辑 是两套不同的类名,别搞混!
|
||||||
|
- **新建任务**(`task_creation/show.php`)用 `.custom-task-form-container` / `.custom-task-form-main` / `.custom-task-form-secondary` / `.custom-task-form-tertiary`,样式在 **§10**。
|
||||||
|
- **编辑任务**(`task_modification/show.php`)用 `.task-form-container` / `.task-form-main-column` / `.task-form-secondary-column` / `.task-form-bottom`,样式在 **§9**。
|
||||||
|
- 改其中一个弹窗,**只动它对应那套类名**;想两个一起改,两节都要改。**别把 `.task-form-*` 的规则套到新建弹窗上(反之亦然),那是无效的死代码。**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Kanboard 核心避坑大全(不知道这些 = 改半天找不到原因)
|
||||||
|
|
||||||
|
### 5.1 核心给很多控件写死了像素宽度 —— 放进网格/弹窗会撑爆或太窄
|
||||||
|
在三列网格里,这些写死宽度会把整张表撑出**横向滚动条**。已知清单:
|
||||||
|
|
||||||
|
| 选择器 | 核心写死的宽度 | 出现在 |
|
||||||
|
|---|---|---|
|
||||||
|
| `.text-editor textarea` / `.text-editor .text-editor-preview-area` | **700px** | 描述(markdown 编辑器) |
|
||||||
|
| `input[type="text"]:not(.input-addon-field)` | 300px | 普通文本框 |
|
||||||
|
| `.form-date` / `.form-datetime` | 150px | 到期/开始时间 |
|
||||||
|
| `.form-input-small` | 150px | 参考 |
|
||||||
|
| `.form-input-large` / `.tag-autocomplete` | 400px | 标签等 |
|
||||||
|
| `.color-picker` | 220px | 颜色下拉 |
|
||||||
|
| `.task-form-main-column input[type="text"]` | 700px | 编辑弹窗标题 |
|
||||||
|
|
||||||
|
**处理原则:在表单容器里把它们强制改成 `width:100% !important; max-width:100% !important`,让它随所在列自适应。** §10 已经对编辑器和这些字段做了覆盖,照着那个写法加即可,**不要去改核心 `.min.css`**。
|
||||||
|
|
||||||
|
### 5.2 弹窗的"滚动层"是 `#modal-box`,不是 `#modal-content`
|
||||||
|
核心:`#modal-box { overflow:auto }`。所以想处理弹窗的横向溢出,要针对 `#modal-box`,针对 `#modal-content` **没用**(这是上次踩了很久的坑)。
|
||||||
|
- 已有一条**精准收口**:`#modal-box:has(.custom-task-form-container)`(用 `:has()` 只作用于任务表单弹窗,不影响其它可能需要横向滚动的弹窗)。**收溢出前要先确认右侧没有真内容被藏起来**,否则就是"裁掉内容糊弄",不允许。
|
||||||
|
|
||||||
|
### 5.3 CSS 特异性:你的规则可能被核心更高特异性的规则盖住
|
||||||
|
例:核心 `input[type="text"]:not(.input-addon-field).form-date{width:150px}` 的特异性是 (0,3,1),会**压过**你写的 `.custom-task-form-container input[type="text"]{...}`(0,2,1)。
|
||||||
|
- 现象就是"我明明写了 width 却不生效"。
|
||||||
|
- 解决:把选择器写得更具体(带上具体类名,如 `.custom-task-form-container input.form-date`)或在该属性上加 `!important`。**`!important` 只在确实被核心盖住时用,不要全文乱撒。**
|
||||||
|
|
||||||
|
### 5.4 样式加载顺序(`layout.php`)
|
||||||
|
`vendor/theme.min.css` → `custom_login.css` → **`custom_dashboard.css`** → DB 自定义 CSS(目前为空)。
|
||||||
|
你的 `custom_dashboard.css` 在主题之后加载,同特异性下能赢核心。变量来自 `custom_login.css`(在它之前加载,所以变量可用)。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. 标准改动流程(每次都这样做)
|
||||||
|
|
||||||
|
1. **定位**:先按第 3 节速查表找到该改的区块/文件,去看现有规则,**在原处改**。
|
||||||
|
2. **不破坏现状**:尽量不动其它区块;删任何东西前,先确认它没被别的模板/页面引用(两套表单类名见 4 节)。
|
||||||
|
3. **用变量**:颜色用 `:root` 变量,不写死。
|
||||||
|
4. **验证**:F5 + 重新打开弹窗,亲眼确认效果;顺手看一眼别的页面/弹窗没被你连累。
|
||||||
|
5. **保持整洁**:新增区块要在 TOC 登记;写一句注释说明"这段管什么"。
|
||||||
|
6. **括号配平**:CSS 大括号要成对,别留半截规则。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. 当前已知待办(都是 JS 行为,CSS 改不动它们)
|
||||||
|
这些在新建任务弹窗里,属于 `custom_dashboard.js` / 核心 JS 的行为问题,**别试图用 CSS 硬怼**:
|
||||||
|
- 游离的"我"(指派给我链接)定位错乱 → `custom_dashboard.js` 第 58–79 行
|
||||||
|
- 标题下红色 `*` 没被隐藏 → `custom_dashboard.js` 第 46–47 行
|
||||||
|
- 部分字段 label→占位符转换不干净 → `custom_dashboard.js` 第 6–44 行
|
||||||
|
- 颜色选择器弹层定位 → 核心 `app.min.js`(最难,建议最后碰)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. 一句话总结
|
||||||
|
**CSS 全进 `custom_dashboard.css` 的对应编号区块;颜色用变量;别碰 `.min.js`/`.min.css`;新建和编辑是两套类名别混;核心写死的宽度要在表单里覆盖成 100%;改完 F5+重开弹窗验证。** 守住这些,就不会再变屎山,也不会再出"改了看不见"的怪事。
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
<?= $this->asset->js('assets/js/vendor.min.js') ?>
|
<?= $this->asset->js('assets/js/vendor.min.js') ?>
|
||||||
<?= $this->asset->js('assets/js/app.min.js') ?>
|
<?= $this->asset->js('assets/js/app.min.js') ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
<?= $this->asset->js('assets/js/custom_dashboard.js') ?>
|
||||||
|
|
||||||
<?= $this->hook->asset('css', 'template:layout:css') ?>
|
<?= $this->hook->asset('css', 'template:layout:css') ?>
|
||||||
<?= $this->hook->asset('js', 'template:layout:js') ?>
|
<?= $this->hook->asset('js', 'template:layout:js') ?>
|
||||||
|
|||||||
@@ -1,79 +1,8 @@
|
|||||||
<style>
|
<?php /*
|
||||||
/* =========================================================
|
新建任务弹窗表单。
|
||||||
New Task / Form Modal Redesign (Injected Directly)
|
样式统一在 assets/css/custom_dashboard.css 第 10 节「任务【新建】弹窗 — 表单布局」维护。
|
||||||
========================================================= */
|
本模板不再内联 <style>。弹窗通用外观见同文件第 11 节。
|
||||||
|
*/ ?>
|
||||||
/* 1. 优化遮罩层背景:降低纯黑透明度,加入现代化毛玻璃模糊效果 */
|
|
||||||
#modal-overlay {
|
|
||||||
background: rgba(0, 0, 0, 0.45) !important;
|
|
||||||
backdrop-filter: blur(4px);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 2. 优化弹窗本身:适当增加宽度,增加现代阴影和圆角 */
|
|
||||||
#modal-box {
|
|
||||||
width: 950px !important;
|
|
||||||
max-width: 95% !important;
|
|
||||||
border-radius: 12px !important;
|
|
||||||
box-shadow: 0 12px 36px rgba(0,0,0,0.25) !important;
|
|
||||||
border: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-task-form-container {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 30px;
|
|
||||||
}
|
|
||||||
.custom-task-form-main {
|
|
||||||
flex: 2 1 400px;
|
|
||||||
}
|
|
||||||
.custom-task-form-secondary {
|
|
||||||
flex: 1 1 250px;
|
|
||||||
}
|
|
||||||
.custom-task-form-bottom {
|
|
||||||
flex: 1 1 100%;
|
|
||||||
margin-top: 15px;
|
|
||||||
padding-top: 20px;
|
|
||||||
border-top: 1px solid #f0f0f0;
|
|
||||||
}
|
|
||||||
.custom-task-form-container label {
|
|
||||||
display: block;
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #444;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
margin-top: 12px;
|
|
||||||
}
|
|
||||||
.custom-task-form-container input[type="text"],
|
|
||||||
.custom-task-form-container input[type="number"],
|
|
||||||
.custom-task-form-container input[type="password"],
|
|
||||||
.custom-task-form-container select,
|
|
||||||
.custom-task-form-container textarea {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
padding: 10px 12px;
|
|
||||||
border: 1px solid #d1d5db;
|
|
||||||
border-radius: 6px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
.custom-task-form-container input[type="text"]:focus,
|
|
||||||
.custom-task-form-container input[type="number"]:focus,
|
|
||||||
.custom-task-form-container input[type="password"]:focus,
|
|
||||||
.custom-task-form-container select:focus,
|
|
||||||
.custom-task-form-container textarea:focus {
|
|
||||||
border-color: #3468C0;
|
|
||||||
box-shadow: 0 0 0 3px rgba(52, 104, 192, 0.1);
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
.custom-task-form-bottom label { display: inline-block; margin-top: 0; margin-right: 15px; font-weight: 500; }
|
|
||||||
.custom-task-form-bottom .btn-blue { padding: 10px 24px; font-size: 15px; font-weight: 600; border-radius: 6px; margin-right: 10px; }
|
|
||||||
.text-editor-toolbar { background-color: #f9f9f9; border: 1px solid #d1d5db; border-bottom: none; border-radius: 6px 6px 0 0; padding: 6px 10px; }
|
|
||||||
.text-editor-write-mode { margin-top: 0 !important; }
|
|
||||||
.text-editor-write-mode textarea { border-radius: 0 0 6px 6px !important; border-top: none !important; }
|
|
||||||
</style>
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2><?= $this->text->e($project['name']) ?> > <?= t('New task') ?></h2>
|
<h2><?= $this->text->e($project['name']) ?> > <?= t('New task') ?></h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -82,51 +11,67 @@
|
|||||||
|
|
||||||
<div class="custom-task-form-container">
|
<div class="custom-task-form-container">
|
||||||
<div class="custom-task-form-main">
|
<div class="custom-task-form-main">
|
||||||
|
<div class="form-row form-row-top joined-input-group">
|
||||||
|
<div class="form-col"><?= $this->task->renderColorField($values) ?></div>
|
||||||
|
<div class="form-col"><?= $this->task->renderPriorityField($project, $values) ?></div>
|
||||||
|
</div>
|
||||||
<?= $this->task->renderTitleField($values, $errors) ?>
|
<?= $this->task->renderTitleField($values, $errors) ?>
|
||||||
|
<?= $this->task->renderTagField($project) ?>
|
||||||
<?= $this->task->renderDescriptionField($values, $errors) ?>
|
<?= $this->task->renderDescriptionField($values, $errors) ?>
|
||||||
<?= $this->task->renderDescriptionTemplateDropdown($project['id']) ?>
|
<?= $this->task->renderDescriptionTemplateDropdown($project['id']) ?>
|
||||||
<?= $this->task->renderTagField($project) ?>
|
|
||||||
|
|
||||||
<?= $this->hook->render('template:task:form:first-column', array('values' => $values, 'errors' => $errors)) ?>
|
<?= $this->hook->render('template:task:form:first-column', array('values' => $values, 'errors' => $errors)) ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="custom-task-form-secondary">
|
<div class="custom-task-form-secondary">
|
||||||
<?= $this->task->renderColorField($values) ?>
|
<div class="form-row form-row-top form-row-gap">
|
||||||
<?= $this->task->renderAssigneeField($users_list, $values, $errors) ?>
|
<div class="form-col form-col-selectors">
|
||||||
<?= $this->task->renderCategoryField($categories_list, $values, $errors) ?>
|
<?= $this->task->renderCategoryField($categories_list, $values, $errors) ?>
|
||||||
<?= $this->task->renderSwimlaneField($swimlanes_list, $values, $errors) ?>
|
<?= $this->task->renderSwimlaneField($swimlanes_list, $values, $errors) ?>
|
||||||
<?= $this->task->renderColumnField($columns_list, $values, $errors) ?>
|
<?= $this->task->renderColumnField($columns_list, $values, $errors) ?>
|
||||||
<?= $this->task->renderPriorityField($project, $values) ?>
|
</div>
|
||||||
|
<div class="form-col form-col-assignee">
|
||||||
|
<?= $this->task->renderAssigneeField($users_list, $values, $errors) ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?= $this->hook->render('template:task:form:second-column', array('values' => $values, 'errors' => $errors)) ?>
|
<?= $this->hook->render('template:task:form:second-column', array('values' => $values, 'errors' => $errors)) ?>
|
||||||
|
|
||||||
<?= $this->task->renderDueDateField($values, $errors) ?>
|
<div class="attachment-area-wrapper">
|
||||||
|
<div class="attachment-area-title"><?= t('Add attachments') ?></div>
|
||||||
|
<details class="accordion-section" open style="margin-bottom:0;">
|
||||||
|
<summary class="accordion-title" style="display:none;"><?= t('Add attachments') ?></summary>
|
||||||
|
<div class="accordion-content custom-attachments-content" style="margin-top:0;">
|
||||||
|
<?= $this->task->renderFileUpload($screenshot, $files) ?>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?= $this->hook->render('template:task:form:bottom-before-buttons', array('values' => $values, 'errors' => $errors)) ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-task-form-tertiary">
|
||||||
<?= $this->task->renderStartDateField($values, $errors) ?>
|
<?= $this->task->renderStartDateField($values, $errors) ?>
|
||||||
|
<?= $this->task->renderDueDateField($values, $errors) ?>
|
||||||
<?= $this->task->renderTimeEstimatedField($values, $errors) ?>
|
<?= $this->task->renderTimeEstimatedField($values, $errors) ?>
|
||||||
<?= $this->task->renderTimeSpentField($values, $errors) ?>
|
<?= $this->task->renderTimeSpentField($values, $errors) ?>
|
||||||
<?= $this->task->renderScoreField($values, $errors) ?>
|
<?= $this->task->renderScoreField($values, $errors) ?>
|
||||||
<?= $this->task->renderReferenceField($values, $errors) ?>
|
<?= $this->task->renderReferenceField($values, $errors) ?>
|
||||||
|
|
||||||
<?= $this->hook->render('template:task:form:third-column', array('values' => $values, 'errors' => $errors)) ?>
|
<?= $this->hook->render('template:task:form:third-column', array('values' => $values, 'errors' => $errors)) ?>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="custom-task-form-bottom">
|
|
||||||
|
|
||||||
<details class="accordion-section">
|
|
||||||
<summary class="accordion-title"><?= t('Add attachments') ?></summary>
|
|
||||||
<div class="accordion-content">
|
|
||||||
<?= $this->task->renderFileUpload($screenshot, $files) ?>
|
|
||||||
</div>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<?= $this->hook->render('template:task:form:bottom-before-buttons', array('values' => $values, 'errors' => $errors)) ?>
|
|
||||||
|
|
||||||
|
<div class="form-actions-wrapper">
|
||||||
<?php if (! isset($duplicate)): ?>
|
<?php if (! isset($duplicate)): ?>
|
||||||
|
<div class="checkbox-group">
|
||||||
<?= $this->form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1, '', array("tabindex" => "16")) ?>
|
<?= $this->form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1, '', array("tabindex" => "16")) ?>
|
||||||
<?= $this->form->checkbox('duplicate_multiple_projects', t('Duplicate to multiple projects'), 1, false, '', array("tabindex" => "17")) ?>
|
<?= $this->form->checkbox('duplicate_multiple_projects', t('Duplicate to multiple projects'), 1, false, '', array("tabindex" => "17")) ?>
|
||||||
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
<div class="submit-buttons-wrapper">
|
||||||
<?= $this->modal->submitButtons() ?>
|
<a href="#" class="js-modal-close btn btn-cancel">取消</a>
|
||||||
|
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,3 +1,25 @@
|
|||||||
|
/* =========================================================
|
||||||
|
custom_dashboard.css — 全站自定义样式(登录页除外)
|
||||||
|
---------------------------------------------------------
|
||||||
|
主题色变量 (--login-* / --color-*) 定义在 custom_login.css,
|
||||||
|
本文件直接引用它们(layout.php 先加载 login 再加载本文件)。
|
||||||
|
|
||||||
|
章节顺序:
|
||||||
|
1. 全局背景
|
||||||
|
2. 顶栏 Header(logo / 标题 / 项目切换器)
|
||||||
|
3. 侧边栏 Sidebar
|
||||||
|
4. 页面头部标签 Page header
|
||||||
|
5. 列表 / 卡片 / 提示 / 搜索框
|
||||||
|
6. 顶栏注入组件(视图切换 / 过滤)
|
||||||
|
7. 项目概览仪表盘(KPI + 标签页)
|
||||||
|
8. 看板 Kanban board
|
||||||
|
9. 任务【编辑】弹窗表单布局 (.task-form-*)
|
||||||
|
10. 任务【新建】弹窗表单布局 (.custom-task-form-*)
|
||||||
|
11. 弹窗通用外观(所有 #modal-box)
|
||||||
|
|
||||||
|
约定:弹窗样式只在本文件里改;task_creation/show.php 不再内联 <style>。
|
||||||
|
========================================================= */
|
||||||
|
|
||||||
/* custom_dashboard.css */
|
/* custom_dashboard.css */
|
||||||
|
|
||||||
/* Global Dashboard Background */
|
/* Global Dashboard Background */
|
||||||
@@ -735,7 +757,9 @@ header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* =========================================================
|
/* =========================================================
|
||||||
New Task / Form Modal Redesign
|
9. 任务【编辑】弹窗 — 表单布局 (.task-form-*)
|
||||||
|
对应模板:app/Template/task_modification/show.php
|
||||||
|
(结构与第 10 节的新建任务弹窗相似,但类名不同;将来可考虑合并成一套)
|
||||||
========================================================= */
|
========================================================= */
|
||||||
|
|
||||||
/* Use CSS Grid for the form container */
|
/* Use CSS Grid for the form container */
|
||||||
@@ -832,3 +856,665 @@ header {
|
|||||||
border-radius: 0 0 6px 6px !important;
|
border-radius: 0 0 6px 6px !important;
|
||||||
border-top: none !important;
|
border-top: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* =========================================================
|
||||||
|
10. 任务【新建】弹窗 — 表单布局 (.custom-task-form-*)
|
||||||
|
对应模板:app/Template/task_creation/show.php
|
||||||
|
(以前这段是内联在 show.php 里的,现统一搬到这里维护)
|
||||||
|
========================================================= */
|
||||||
|
|
||||||
|
.custom-task-form-container {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: stretch;
|
||||||
|
max-width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.custom-task-form-main { flex: 34; min-width: 0; }
|
||||||
|
.custom-task-form-secondary { flex: 42; min-width: 0; }
|
||||||
|
.custom-task-form-tertiary { flex: 24; min-width: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
font-size: 0; /* 消除子元素之间的 inline 空白间隙 */
|
||||||
|
}
|
||||||
|
.custom-task-form-secondary > *,
|
||||||
|
.custom-task-form-tertiary > * { font-size: 14px; }
|
||||||
|
|
||||||
|
/* 并排布局 & 拼接组件 */
|
||||||
|
.form-row-top {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.form-row-gap {
|
||||||
|
gap: 15px;
|
||||||
|
}
|
||||||
|
.form-col {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.joined-input-group {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #fff;
|
||||||
|
align-items: stretch;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.joined-input-group .form-col {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.joined-input-group .form-col:first-child {
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
/* 剥除原生边框,使其融合为一个整体组件 (增加权重以覆盖 #modal-box 样式) */
|
||||||
|
#modal-box .joined-input-group select,
|
||||||
|
#modal-box .joined-input-group input,
|
||||||
|
#modal-box .joined-input-group .color-picker-select,
|
||||||
|
#modal-box .joined-input-group .select2-container--default .select2-selection--single,
|
||||||
|
#modal-box .joined-input-group .select2-selection {
|
||||||
|
border: none !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
background: transparent !important;
|
||||||
|
height: 38px !important;
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding-left: 10px !important;
|
||||||
|
padding-right: 10px !important;
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
#modal-box .joined-input-group .color-picker-select {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-left: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 附件区域对齐与编辑器高度 */
|
||||||
|
.text-editor textarea {
|
||||||
|
height: 380px !important;
|
||||||
|
resize: none !important;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.text-editor textarea::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
}
|
||||||
|
.text-editor textarea::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.text-editor textarea::-webkit-scrollbar-track {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachment-area-wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-top: 84px; /* 精确下移以对齐标签栏顶部 */
|
||||||
|
flex-grow: 1; /* 自动撑满剩余高度,让底部严丝合缝地对齐 */
|
||||||
|
height: auto !important; /* 放弃硬编码高度,改用弹性盒子自动对齐 */
|
||||||
|
border: 1px dashed #ccc;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fafafa;
|
||||||
|
}
|
||||||
|
.form-col-selectors {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.form-col-assignee {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 附件区域占据剩余高度 */
|
||||||
|
.attachment-area-wrapper {
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin-top: 15px;
|
||||||
|
border: 1px dashed #ccc;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fafafa;
|
||||||
|
min-height: 250px;
|
||||||
|
}
|
||||||
|
.attachment-area-title {
|
||||||
|
padding: 10px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #444;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
.custom-attachments-content {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
/* 覆盖默认的内联样式和 49% 宽度,让附件框纵向铺满 */
|
||||||
|
.custom-task-form-secondary .task-form-bottom-column {
|
||||||
|
width: 100% !important;
|
||||||
|
display: block !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
flex-grow: 1;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.custom-task-form-secondary .task-form-bottom-column:first-child {
|
||||||
|
border-bottom: 1px dashed #ccc;
|
||||||
|
}
|
||||||
|
.custom-task-form-secondary .dropzone {
|
||||||
|
height: 100%;
|
||||||
|
min-height: 120px;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
#screenshot-zone {
|
||||||
|
height: 100%;
|
||||||
|
min-height: 120px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-actions-wrapper { margin-top: auto; padding-top: 15px; display: flex; flex-direction: column; gap: 15px; }
|
||||||
|
|
||||||
|
/* 复选框样式按钮化 */
|
||||||
|
.checkbox-group label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
font-size: 14px !important;
|
||||||
|
font-weight: normal;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.checkbox-group input[type="checkbox"] {
|
||||||
|
margin: 0 10px 0 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submit-buttons-wrapper { margin-top: auto; display: flex; justify-content: flex-end; gap: 10px; align-items: center; flex-wrap: wrap; }
|
||||||
|
.submit-buttons-wrapper .btn {
|
||||||
|
padding: 8px 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
border-radius: 4px;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
#modal-box .submit-buttons-wrapper .btn-cancel {
|
||||||
|
border: 1px solid #ccc !important;
|
||||||
|
background: #fff !important;
|
||||||
|
color: #333 !important;
|
||||||
|
}
|
||||||
|
#modal-box .submit-buttons-wrapper .btn-cancel:hover {
|
||||||
|
background: #f5f5f5 !important;
|
||||||
|
}
|
||||||
|
.submit-buttons-wrapper .btn-blue {
|
||||||
|
background: #007bff;
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid #007bff;
|
||||||
|
}
|
||||||
|
.submit-buttons-wrapper .btn-blue:hover {
|
||||||
|
background: #0056b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-task-form-container label {
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #444;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
.custom-task-form-container input[type="text"],
|
||||||
|
.custom-task-form-container input[type="number"],
|
||||||
|
.custom-task-form-container input[type="password"],
|
||||||
|
.custom-task-form-container select,
|
||||||
|
.custom-task-form-container textarea {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.custom-task-form-container input[type="text"]:focus,
|
||||||
|
.custom-task-form-container input[type="number"]:focus,
|
||||||
|
.custom-task-form-container input[type="password"]:focus,
|
||||||
|
.custom-task-form-container select:focus,
|
||||||
|
.custom-task-form-container textarea:focus {
|
||||||
|
border-color: var(--color-primary, #3468C0);
|
||||||
|
box-shadow: 0 0 0 3px rgba(52, 104, 192, 0.1);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
/* 横向滚动条根因修复(标注图问题①):
|
||||||
|
Kanboard 核心给 markdown 编辑器写死了 .text-editor textarea{width:700px},
|
||||||
|
放进三列网格后这 700px 会把整张表撑到约 1440px,于是 #modal-box(核心设了
|
||||||
|
overflow:auto)冒出横向滚动条。这里把编辑器/预览区强制改成 100%,让它随所在列
|
||||||
|
自适应——从根上消除溢出,而不是把内容裁掉。 */
|
||||||
|
.custom-task-form-container .text-editor,
|
||||||
|
.custom-task-form-container .text-editor textarea,
|
||||||
|
.custom-task-form-container .text-editor .text-editor-preview-area,
|
||||||
|
.task-form-container .text-editor,
|
||||||
|
.task-form-container .text-editor textarea,
|
||||||
|
.task-form-container .text-editor .text-editor-preview-area {
|
||||||
|
width: 100% !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
box-sizing: border-box !important;
|
||||||
|
}
|
||||||
|
/* 把网格锁死在父容器宽度内,配合各列 min-width:0,fr 轨道只在可用宽度里分配 */
|
||||||
|
.custom-task-form-container,
|
||||||
|
.task-form-container { width: 100%; min-width: 0; box-sizing: border-box; }
|
||||||
|
.custom-task-form-container *,
|
||||||
|
.task-form-container * { box-sizing: border-box; }
|
||||||
|
|
||||||
|
/* 核心给日期/数字/参考等字段写死了 150px 等小宽度,让它们填满所在列,列更整齐 */
|
||||||
|
.custom-task-form-container input.form-datetime,
|
||||||
|
.custom-task-form-container input.form-date,
|
||||||
|
.custom-task-form-container input.form-numeric,
|
||||||
|
.custom-task-form-container input.form-input-small,
|
||||||
|
.custom-task-form-container input.form-input-large,
|
||||||
|
.task-form-container input.form-datetime,
|
||||||
|
.task-form-container input.form-date,
|
||||||
|
.task-form-container input.form-numeric,
|
||||||
|
.task-form-container input.form-input-small,
|
||||||
|
.task-form-container input.form-input-large {
|
||||||
|
width: 100% !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
box-sizing: border-box !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 收掉那条“幽灵”横向滚动条:强制无视子元素溢出 */
|
||||||
|
#modal-box { overflow-x: hidden !important; overflow-y: auto !important; }
|
||||||
|
|
||||||
|
/* =========================================================
|
||||||
|
11. 弹窗通用外观(所有 #modal-box:新建 / 编辑 / 其它弹窗共用)
|
||||||
|
========================================================= */
|
||||||
|
|
||||||
|
/* Overlay: Glassmorphism effect & Positioning */
|
||||||
|
#modal-overlay {
|
||||||
|
background: rgba(0, 0, 0, 0.45) !important;
|
||||||
|
backdrop-filter: blur(5px) !important;
|
||||||
|
-webkit-backdrop-filter: blur(5px) !important;
|
||||||
|
transition: opacity 0.3s ease;
|
||||||
|
display: flex !important;
|
||||||
|
flex-direction: column !important;
|
||||||
|
align-items: center !important;
|
||||||
|
justify-content: flex-start !important;
|
||||||
|
padding-top: 20vh !important; /* 整体位置偏下 */
|
||||||
|
padding-bottom: 5vh !important; /* 保证底部不会贴死,留出滚动空间 */
|
||||||
|
overflow-y: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modal Container */
|
||||||
|
#modal-box {
|
||||||
|
margin: 0 !important; /* 移除 Kanboard 默认的上边距 */
|
||||||
|
flex-shrink: 0 !important; /* 防止在小屏幕下被挤压变形 */
|
||||||
|
box-sizing: border-box !important;
|
||||||
|
width: 950px !important;
|
||||||
|
max-width: 95vw !important;
|
||||||
|
border-radius: 12px !important;
|
||||||
|
box-shadow: 0 12px 36px rgba(0,0,0,0.15) !important;
|
||||||
|
border: none !important;
|
||||||
|
background: #ffffff !important;
|
||||||
|
padding: 20px 25px !important;
|
||||||
|
animation: modalSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes modalSlideUp {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translate(-50%, 20px) scale(0.98);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translate(-50%, 0) scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Modal Header */
|
||||||
|
#modal-box .page-header {
|
||||||
|
border-bottom: 1px solid #eaeaea !important;
|
||||||
|
padding-bottom: 10px !important;
|
||||||
|
margin-bottom: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-box .page-header h2 {
|
||||||
|
font-size: 22px !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
color: #2c3e50 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Generic Form Elements inside Modal (catching everything) */
|
||||||
|
#modal-box input[type="text"],
|
||||||
|
#modal-box input[type="password"],
|
||||||
|
#modal-box input[type="email"],
|
||||||
|
#modal-box input[type="number"],
|
||||||
|
#modal-box select,
|
||||||
|
#modal-box textarea {
|
||||||
|
width: 100% !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
padding: 6px 10px !important;
|
||||||
|
border: 1px solid #d1d5db !important;
|
||||||
|
border-radius: 6px !important;
|
||||||
|
box-sizing: border-box !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
color: #333 !important;
|
||||||
|
transition: all 0.2s ease !important;
|
||||||
|
background-color: #fff !important;
|
||||||
|
margin-top: 2px !important;
|
||||||
|
margin-bottom: 6px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-box input:focus,
|
||||||
|
#modal-box select:focus,
|
||||||
|
#modal-box textarea:focus {
|
||||||
|
border-color: var(--color-primary, #3468C0) !important;
|
||||||
|
box-shadow: 0 0 0 3px rgba(52, 104, 192, 0.15) !important;
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Labels */
|
||||||
|
#modal-box label {
|
||||||
|
display: block; /* 移除 !important,允许 JS 隐藏 label */
|
||||||
|
font-size: 13px !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
color: #555 !important;
|
||||||
|
margin-bottom: 2px !important;
|
||||||
|
margin-top: 6px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 特殊的类,用于 JS 隐藏 label 强行覆盖 */
|
||||||
|
#modal-box label.hide-placeholder-label {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Buttons inside Modal */
|
||||||
|
#modal-box .btn {
|
||||||
|
padding: 10px 20px !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
border-radius: 6px !important;
|
||||||
|
transition: all 0.2s ease !important;
|
||||||
|
border: none !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-box .btn:hover {
|
||||||
|
transform: translateY(-1px) !important;
|
||||||
|
box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-box .btn-blue {
|
||||||
|
background: var(--color-primary, #3468C0) !important;
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-box .btn-blue:hover {
|
||||||
|
background: #2a56a0 !important; /* Slightly darker on hover */
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-box .btn-red {
|
||||||
|
background: #e74c3c !important;
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-box .btn-red:hover {
|
||||||
|
background: #c0392b !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Cancel Links */
|
||||||
|
#modal-box .form-actions a {
|
||||||
|
color: #888 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
margin-left: 15px !important;
|
||||||
|
font-size: 14px !important;
|
||||||
|
font-weight: 500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-box .form-actions a:hover {
|
||||||
|
color: #333 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fix close button at top right */
|
||||||
|
#modal-close-button {
|
||||||
|
color: #999 !important;
|
||||||
|
font-size: 24px !important;
|
||||||
|
line-height: 1 !important;
|
||||||
|
transition: color 0.2s !important;
|
||||||
|
top: 18px !important;
|
||||||
|
right: 25px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#modal-close-button:hover {
|
||||||
|
color: #333 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fix color picker dropdown menu positioning & transparency */
|
||||||
|
#select-dropdown-menu {
|
||||||
|
background: #fff !important;
|
||||||
|
border-radius: 6px !important;
|
||||||
|
box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
|
||||||
|
border: 1px solid #e2e8f0 !important;
|
||||||
|
z-index: 99999 !important;
|
||||||
|
margin-top: 4px !important;
|
||||||
|
}
|
||||||
|
.select-dropdown-input-container #select-dropdown-menu {
|
||||||
|
top: 100% !important;
|
||||||
|
left: 0 !important;
|
||||||
|
min-width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =========================================================
|
||||||
|
12. 任务详情页 UI 优化 (Task View)
|
||||||
|
========================================================= */
|
||||||
|
|
||||||
|
/* 1. 左侧侧边栏 (Sidebar) 现代化 */
|
||||||
|
#task-view .sidebar {
|
||||||
|
background-color: #f8fafc !important;
|
||||||
|
border-right: 1px solid #e2e8f0 !important;
|
||||||
|
padding: 20px 15px !important;
|
||||||
|
border-radius: 12px 0 0 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar > ul > li {
|
||||||
|
margin-bottom: 4px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar > ul > li > a {
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
padding: 10px 14px !important;
|
||||||
|
color: #475569 !important;
|
||||||
|
font-weight: 500 !important;
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar > ul > li > a i {
|
||||||
|
position: static !important;
|
||||||
|
transform: none !important;
|
||||||
|
margin-right: 10px !important;
|
||||||
|
color: #64748b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar > ul > li > a .sidebar-text {
|
||||||
|
width: auto !important;
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar > ul > li:hover,
|
||||||
|
#task-view .sidebar > ul > li.active {
|
||||||
|
background: transparent !important; /* Remove old yellow hover */
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar > ul > li > a:hover {
|
||||||
|
background-color: #f1f5f9 !important;
|
||||||
|
color: #1e293b !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar > ul > li.active > a {
|
||||||
|
background-color: #e0f2fe !important;
|
||||||
|
color: #0284c7 !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar > ul > li.active > a i {
|
||||||
|
color: #0284c7 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-view .sidebar-title h2 {
|
||||||
|
font-size: 12px !important;
|
||||||
|
text-transform: uppercase !important;
|
||||||
|
color: #94a3b8 !important;
|
||||||
|
letter-spacing: 0.05em !important;
|
||||||
|
margin-top: 20px !important;
|
||||||
|
margin-bottom: 8px !important;
|
||||||
|
padding-left: 14px !important;
|
||||||
|
border-bottom: none !important;
|
||||||
|
font-weight: 700 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 2. 顶部元数据框 (黄框重构) */
|
||||||
|
#task-summary .task-summary-container {
|
||||||
|
background: #ffffff !important;
|
||||||
|
border: 1px solid #e2e8f0 !important;
|
||||||
|
border-radius: 10px !important;
|
||||||
|
padding: 20px 25px !important;
|
||||||
|
box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 25px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 左侧彩色提示线 - 缩小颜色面积 */
|
||||||
|
#task-summary .task-summary-container[class*="color-"] {
|
||||||
|
border-left-width: 5px !important;
|
||||||
|
}
|
||||||
|
#task-summary .task-summary-container.color-yellow { border-left-color: #f59e0b !important; }
|
||||||
|
#task-summary .task-summary-container.color-blue { border-left-color: #3b82f6 !important; }
|
||||||
|
#task-summary .task-summary-container.color-green { border-left-color: #10b981 !important; }
|
||||||
|
#task-summary .task-summary-container.color-purple { border-left-color: #8b5cf6 !important; }
|
||||||
|
#task-summary .task-summary-container.color-red { border-left-color: #ef4444 !important; }
|
||||||
|
#task-summary .task-summary-container.color-orange { border-left-color: #f97316 !important; }
|
||||||
|
#task-summary .task-summary-container.color-grey { border-left-color: #64748b !important; }
|
||||||
|
#task-summary .task-summary-container.color-brown { border-left-color: #78350f !important; }
|
||||||
|
#task-summary .task-summary-container.color-deep_orange { border-left-color: #ea580c !important; }
|
||||||
|
#task-summary .task-summary-container.color-dark_grey { border-left-color: #334155 !important; }
|
||||||
|
#task-summary .task-summary-container.color-pink { border-left-color: #ec4899 !important; }
|
||||||
|
#task-summary .task-summary-container.color-teal { border-left-color: #14b8a6 !important; }
|
||||||
|
#task-summary .task-summary-container.color-cyan { border-left-color: #06b6d4 !important; }
|
||||||
|
#task-summary .task-summary-container.color-lime { border-left-color: #84cc16 !important; }
|
||||||
|
#task-summary .task-summary-container.color-light_green { border-left-color: #22c55e !important; }
|
||||||
|
#task-summary .task-summary-container.color-light_blue { border-left-color: #0ea5e9 !important; }
|
||||||
|
|
||||||
|
#task-summary h2 {
|
||||||
|
font-size: 22px !important;
|
||||||
|
font-weight: 700 !important;
|
||||||
|
color: #1e293b !important;
|
||||||
|
margin-bottom: 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 元数据排版重塑: 改为上下结构 */
|
||||||
|
#task-summary .task-summary-columns {
|
||||||
|
display: flex !important;
|
||||||
|
flex-wrap: nowrap !important;
|
||||||
|
gap: 30px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-summary .task-summary-column {
|
||||||
|
flex: 1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-summary .task-summary-column ul.no-bullet {
|
||||||
|
padding-left: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-summary .task-summary-column ul.no-bullet li {
|
||||||
|
display: flex !important;
|
||||||
|
flex-direction: column !important;
|
||||||
|
margin-bottom: 16px !important;
|
||||||
|
line-height: 1.4 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-summary .task-summary-column ul.no-bullet li strong {
|
||||||
|
font-size: 12px !important;
|
||||||
|
color: #64748b !important;
|
||||||
|
font-weight: 500 !important;
|
||||||
|
margin-bottom: 4px !important;
|
||||||
|
text-transform: capitalize !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-summary .task-summary-column ul.no-bullet li span {
|
||||||
|
font-size: 14px !important;
|
||||||
|
color: #0f172a !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#task-summary .task-summary-column ul.no-bullet li small {
|
||||||
|
margin-top: 8px !important;
|
||||||
|
}
|
||||||
|
#task-summary .task-summary-column ul.no-bullet li small a {
|
||||||
|
color: #3b82f6 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
font-size: 13px !important;
|
||||||
|
font-weight: 500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 3. 折叠面板 (Accordions) 视觉升级 */
|
||||||
|
.accordion-section {
|
||||||
|
margin-top: 25px !important;
|
||||||
|
background: #ffffff !important;
|
||||||
|
border-radius: 10px !important;
|
||||||
|
border: 1px solid #e2e8f0 !important;
|
||||||
|
box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion-title {
|
||||||
|
font-size: 16px !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
color: #1e293b !important;
|
||||||
|
padding: 16px 20px !important;
|
||||||
|
background: #f8fafc !important;
|
||||||
|
border-bottom: 1px solid #e2e8f0 !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
list-style: none !important; /* 隐藏浏览器原生三角 */
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 隐藏 Safari 原生三角 */
|
||||||
|
.accordion-title::-webkit-details-marker {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 自定义右侧箭头 */
|
||||||
|
.accordion-title::before {
|
||||||
|
content: "\f105" !important; /* FontAwesome fa-angle-right */
|
||||||
|
font-family: FontAwesome !important;
|
||||||
|
display: inline-block !important;
|
||||||
|
width: 24px !important;
|
||||||
|
transition: transform 0.2s ease !important;
|
||||||
|
color: #94a3b8 !important;
|
||||||
|
font-size: 18px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
details[open] > .accordion-title::before {
|
||||||
|
transform: rotate(90deg) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion-content {
|
||||||
|
padding: 20px !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
/* =========================================================
|
||||||
|
custom_dashboard.css — 全站自定义样式(登录页除外)
|
||||||
|
---------------------------------------------------------
|
||||||
|
主题色变量 (--login-* / --color-*) 定义在 custom_login.css,
|
||||||
|
本文件直接引用它们(layout.php 先加载 login 再加载本文件)。
|
||||||
|
|
||||||
|
章节顺序:
|
||||||
|
1. 全局背景
|
||||||
|
2. 顶栏 Header(logo / 标题 / 项目切换器)
|
||||||
|
3. 侧边栏 Sidebar
|
||||||
|
4. 页面头部标签 Page header
|
||||||
|
5. 列表 / 卡片 / 提示 / 搜索框
|
||||||
|
6. 顶栏注入组件(视图切换 / 过滤)
|
||||||
|
7. 项目概览仪表盘(KPI + 标签页)
|
||||||
|
8. 看板 Kanban board
|
||||||
|
9. 任务【编辑】弹窗表单布局 (.task-form-*)
|
||||||
|
10. 任务【新建】弹窗表单布局 (.custom-task-form-*)
|
||||||
|
11. 弹窗通用外观(所有 #modal-box)
|
||||||
|
|
||||||
|
约定:弹窗样式只在本文件里改;task_creation/show.php 不再内联 <style>。
|
||||||
|
========================================================= */
|
||||||
|
|
||||||
|
/* custom_dashboard.css */
|
||||||
|
|
||||||
|
/* Global Dashboard Background */
|
||||||
|
body {
|
||||||
|
background: var(--login-bg) !important;
|
||||||
|
color: var(--login-text-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Header & Title Stack Restructuring */
|
||||||
|
.header-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-left .logo {
|
||||||
|
font-size: 32px;
|
||||||
|
margin-right: 15px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-titles-stack {
|
||||||
|
display
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-board-title a {
|
||||||
|
color: #222 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.task-board-title a:hover {
|
||||||
|
color: var(--color-primary) !important;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Clean up add button */
|
||||||
|
.board-add-icon {
|
||||||
|
color: var(--color-primary) !important;
|
||||||
|
font-size: 16px;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.board-add-icon:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =========================================================
|
||||||
|
9. 任务【编辑】弹窗 — 表单布局 (.task-form-*)
|
||||||
|
对应模板:app/Template/task_modification/show.php
|
||||||
|
(结构与第 10 节的新建任务弹窗相似,但类名不同;将来可考虑合并成一套)
|
||||||
|
========================================================= */
|
||||||
|
|
||||||
|
/* Use CSS Grid for the form container */
|
||||||
|
.task-form-container {
|
||||||
|
display: grid !important;
|
||||||
|
grid-template-columns: 2fr 1fr 1fr;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make columns fill their grid cells */
|
||||||
|
.task-form-main-column,
|
||||||
|
.task-form-secondary-column {
|
||||||
|
width: 100% !important;
|
||||||
|
float: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bottom area spans across all columns */
|
||||||
|
.task-form-bottom {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
margin-top: 15px;
|
||||||
|
padding-top: 20px;
|
||||||
|
border-top: 1px solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Labels */
|
||||||
|
.task-form-container label {
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #444;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inputs, Selects, Textareas */
|
||||||
|
.task-form-container input[type="text"],
|
||||||
|
.task-form-container input[type="number"],
|
||||||
|
.task-form-container input[type="password"],
|
||||||
@@ -1,3 +1,11 @@
|
|||||||
|
/* =========================================================
|
||||||
|
custom_login.css — 登录页样式 +【全站主题色变量】
|
||||||
|
下面 :root 里的 --login-* 是全站通用的主题令牌,
|
||||||
|
custom_dashboard.css 等文件都直接引用它们。
|
||||||
|
layout.php 在 custom_dashboard.css 之前加载本文件,
|
||||||
|
所以这些变量对后者可见。改主题色就改这里。
|
||||||
|
========================================================= */
|
||||||
|
|
||||||
/* custom_login.css */
|
/* custom_login.css */
|
||||||
|
|
||||||
/* Define variables for Light Theme */
|
/* Define variables for Light Theme */
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var processForm = function(container) {
|
||||||
|
if (container.dataset.processed === 'true') return;
|
||||||
|
container.dataset.processed = 'true';
|
||||||
|
|
||||||
|
// 1. Hide red stars aggressively
|
||||||
|
container.querySelectorAll('.form-required').forEach(function(ast) {
|
||||||
|
ast.remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 2. Convert Labels to Placeholders
|
||||||
|
var labels = container.querySelectorAll('label');
|
||||||
|
labels.forEach(function(label) {
|
||||||
|
if (label.closest('.accordion-section') || label.closest('details') || label.closest('.checkbox-group')) return;
|
||||||
|
|
||||||
|
var id = label.getAttribute('for');
|
||||||
|
var input = id ? document.getElementById(id) : null;
|
||||||
|
if (!input) {
|
||||||
|
input = label.nextElementSibling;
|
||||||
|
if (input && input.tagName === 'DIV') input = input.querySelector('input, select, textarea');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input) {
|
||||||
|
var cleanText = label.innerText.replace(/\*/g, '').replace(/:/g, '').trim();
|
||||||
|
var placeholderText = cleanText;
|
||||||
|
|
||||||
|
if (input.tagName === 'INPUT' || input.tagName === 'TEXTAREA') {
|
||||||
|
if (!(input.type === 'hidden' && input.classList.contains('tag-autocomplete'))) {
|
||||||
|
input.placeholder = placeholderText;
|
||||||
|
} else {
|
||||||
|
input.setAttribute('data-placeholder', placeholderText);
|
||||||
|
}
|
||||||
|
} else if (input.tagName === 'SELECT') {
|
||||||
|
if (input.multiple) {
|
||||||
|
input.setAttribute('data-placeholder', placeholderText);
|
||||||
|
} else {
|
||||||
|
var firstOption = input.options[0];
|
||||||
|
if (firstOption && firstOption.value === "") {
|
||||||
|
firstOption.text = placeholderText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide the label after setting placeholder
|
||||||
|
label.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 3. Move "Assign to me" (游离的我) inside the Assignee selector
|
||||||
|
var assignMe = container.querySelector('.assign-me');
|
||||||
|
if (assignMe) {
|
||||||
|
var ownerSelect = document.getElementById('form-owner_id');
|
||||||
|
if (ownerSelect && ownerSelect.parentElement) {
|
||||||
|
var wrapper = document.createElement('div');
|
||||||
|
wrapper.className = 'assign-me-wrapper';
|
||||||
|
wrapper.style.position = 'relative';
|
||||||
|
wrapper.style.display = 'block';
|
||||||
|
wrapper.style.width = '100%';
|
||||||
|
|
||||||
|
ownerSelect.parentNode.insertBefore(wrapper, ownerSelect);
|
||||||
|
wrapper.appendChild(ownerSelect);
|
||||||
|
|
||||||
|
// Style the 'me' button
|
||||||
|
assignMe.innerText = 'me';
|
||||||
|
assignMe.style.position = 'absolute';
|
||||||
|
assignMe.style.right = '32px'; // Position it inside the select box, before the dropdown arrow
|
||||||
|
assignMe.style.top = '50%';
|
||||||
|
assignMe.style.transform = 'translateY(-50%)';
|
||||||
|
assignMe.style.zIndex = '10';
|
||||||
|
assignMe.style.margin = '0';
|
||||||
|
assignMe.style.background = '#e6f4ea';
|
||||||
|
assignMe.style.color = '#1e8e3e';
|
||||||
|
assignMe.style.padding = '2px 6px';
|
||||||
|
assignMe.style.borderRadius = '4px';
|
||||||
|
assignMe.style.fontSize = '12px';
|
||||||
|
assignMe.style.fontWeight = 'bold';
|
||||||
|
assignMe.style.textDecoration = 'none';
|
||||||
|
|
||||||
|
wrapper.appendChild(assignMe);
|
||||||
|
|
||||||
|
// Hide the extra "Assign to me" text node if any
|
||||||
|
var small = assignMe.closest('small');
|
||||||
|
if (small && small !== wrapper) {
|
||||||
|
small.childNodes.forEach(function(node) {
|
||||||
|
if (node.nodeType === 3) node.textContent = ''; // Clear text nodes
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Initialize already present containers
|
||||||
|
document.querySelectorAll('.custom-task-form-container').forEach(processForm);
|
||||||
|
|
||||||
|
// Watch for newly added containers (e.g. AJAX modals)
|
||||||
|
var observer = new MutationObserver(function(mutations) {
|
||||||
|
document.querySelectorAll('.custom-task-form-container').forEach(processForm);
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(document.body, { childList: true, subtree: true });
|
||||||
|
});
|
||||||
Binary file not shown.
Reference in New Issue
Block a user