mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2025-12-24 23:48:01 +00:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f91d295b42 | ||
|
|
6e3f207c6c | ||
|
|
5c36998d5e | ||
|
|
a83fe43cbb | ||
|
|
678beb2c0d | ||
|
|
fd12236144 | ||
|
|
f33a0ae81c | ||
|
|
a1d531ba36 | ||
|
|
32d0274b56 | ||
|
|
74c98fbd5d | ||
|
|
d6567618d9 | ||
|
|
0cc4f61984 | ||
|
|
fd20862833 | ||
|
|
ea49cf94dd | ||
|
|
4fd01c50b0 | ||
|
|
f500f2aae3 | ||
|
|
b220a17829 | ||
|
|
0a0cd77b3f | ||
|
|
aa36f52d83 | ||
|
|
a841636737 | ||
|
|
fb1ebd6f18 | ||
|
|
4ae9a2754f | ||
|
|
914d5228e3 | ||
|
|
efec911021 | ||
|
|
5e3f2ec2c2 | ||
|
|
ce1ebf0c53 | ||
|
|
63e05b09b1 | ||
|
|
2d0da89248 | ||
|
|
687c7711ae | ||
|
|
1cf6252847 | ||
|
|
3851dc2449 | ||
|
|
adfa315484 | ||
|
|
d91e6223dd |
@@ -5,4 +5,6 @@ SSH_SERVER=localhost
|
|||||||
# 上传到服务器的用户名称, 不支持密码, 请确保有 SSH 免密登录权限
|
# 上传到服务器的用户名称, 不支持密码, 请确保有 SSH 免密登录权限
|
||||||
SSH_USER=root
|
SSH_USER=root
|
||||||
# 上传到服务器的主题路径, 请使用绝对路径
|
# 上传到服务器的主题路径, 请使用绝对路径
|
||||||
GITEA_THEME_PATH=/data/gitea/public/assets/css/
|
GITEA_THEME_PATH=/data/gitea/public/assets/css/
|
||||||
|
# Gitea 数据路径, 用于上传到服务器的模板路径, 请使用绝对路径
|
||||||
|
GITEA_PATH=/data/gitea/
|
||||||
8
.github/CHANGELOG.md
vendored
8
.github/CHANGELOG.md
vendored
@@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
### 🌈 Style
|
### 🌈 Style
|
||||||
|
|
||||||
##### 更符合 GitHub 风格
|
#### 更符合 GitHub 风格
|
||||||
|
|
||||||
|
##### 模板文件
|
||||||
|
|
||||||
### 🐞 Fix
|
### 🐞 Fix
|
||||||
|
|
||||||
@@ -14,7 +16,9 @@
|
|||||||
|
|
||||||
#### CSS Variable
|
#### CSS Variable
|
||||||
|
|
||||||
##### More GitHub-like style
|
#### More GitHub-like style
|
||||||
|
|
||||||
|
##### Template File
|
||||||
|
|
||||||
```text
|
```text
|
||||||
在 English 下方补充上面 Feature 以下部分的内容的中译英
|
在 English 下方补充上面 Feature 以下部分的内容的中译英
|
||||||
|
|||||||
66
.github/ISSUE_TEMPLATE/1-style-bug-report.yml
vendored
66
.github/ISSUE_TEMPLATE/1-style-bug-report.yml
vendored
@@ -1,91 +1,91 @@
|
|||||||
name: 样式错误报告 ( Style bug report )
|
name: Style bug report
|
||||||
description: 安装主题后出现颜色/位置错误等 ( Color/position errors occur after installing the theme )
|
description: Color/position errors occur after installing the theme.
|
||||||
labels: ["style bug"]
|
labels: ["style bug"]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
1. 请使用最新的主题, 并使用 Ctrl+F5 刷新页面查看 Bug 是否消失 ( Please use the latest theme and refresh the page with Ctrl+F5 to see if the Bug has disappeared )
|
!!! Please read the readme and ensure that the theme is used correctly before submitting !!!
|
||||||
2. 请查看项目根目录下的 CHANGELOG.md 文件, 查看是否有修复该 Bug 的相关描述 ( Please check the CHANGELOG.md file in the project root directory for descriptions of fixes related to this Bug )
|
1. Please use the latest theme and refresh the page with Ctrl+F5 to see if the Bug has disappeared.
|
||||||
3. 如果有相关描述, 可以查看 README.md 自己编译开发版本是否修复了该 Bug ( If there are related descriptions, you can check if the Bug has been fixed by compiling the development version yourself in the README.md )
|
2. Please check the CHANGELOG.md file in the project root directory for descriptions of fixes related to this Bug.
|
||||||
4. 请查看 Gitea 默认主题下是否有同样的错误, 确认非主题问题 ( Please check if there is the same error in the default Gitea theme, confirming that it is not a theme problem )
|
3. If there are related descriptions, you can check if the Bug has been fixed by compiling the development version yourself in the README.md.
|
||||||
|
4. Please check if there is the same error in the default Gitea theme, confirming that it is not a theme problem.
|
||||||
- type: input
|
- type: input
|
||||||
id: theme-version
|
id: theme-version
|
||||||
attributes:
|
attributes:
|
||||||
label: 主题版本 ( Theme Version )
|
label: Theme Version
|
||||||
description:
|
description:
|
||||||
主题的版本, 如果是开发版本可以查看 CSS 文件中 `--theme-version` 的值, 或者查看项目根目录下的 `package.json` 文件
|
The version of the theme, if it is a development version, you can check the value of `--theme-version` in the
|
||||||
( The version of the theme, if it is a development version, you can check the value of `--theme-version` in the
|
CSS file, or check the `package.json` file in the project root directory.
|
||||||
CSS file, or check the `package.json` file in the project root directory )
|
|
||||||
placeholder: ex. 1.24.5
|
placeholder: ex. 1.24.5
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
id: gitea-version
|
id: gitea-version
|
||||||
attributes:
|
attributes:
|
||||||
label: Gitea 版本 ( Gitea Version )
|
label: Gitea Version
|
||||||
description: 应用主题的 Gitea 版本 ( What version of Gitea are you using? )
|
description: What version of Gitea are you using?
|
||||||
placeholder: ex. 1.24.5
|
placeholder: ex. 1.24.5
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- type: input
|
||||||
id: page
|
id: page
|
||||||
attributes:
|
attributes:
|
||||||
label: 页面 ( Page )
|
label: Page
|
||||||
description: 错误出现的页面 ( The page where the error occurred )
|
description: The page where the error occurred.
|
||||||
placeholder: 工单列表页 ( Issue list page )
|
placeholder: Issue list page
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: actual-behavior
|
id: actual-behavior
|
||||||
attributes:
|
attributes:
|
||||||
label: 实际表现 ( Actual Behavior )
|
label: Actual Behavior
|
||||||
description: 请描述实际的错误表现 ( Please describe the actual error presentation )
|
description: Please describe the actual error presentation.
|
||||||
placeholder: 页面底部的颜色错误 ( The color of the bottom of the page is incorrect )
|
placeholder: The color of the bottom of the page is incorrect
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: expected-behavior
|
id: expected-behavior
|
||||||
attributes:
|
attributes:
|
||||||
label: 期望表现 ( Expected Behavior )
|
label: Expected Behavior
|
||||||
description: 请描述期望的正确表现 ( Please describe the expected correct presentation )
|
description: Please describe the expected correct presentation.
|
||||||
placeholder: 页面底部的颜色应该是白色 ( The color of the bottom of the page should be white )
|
placeholder: The color of the bottom of the page should be white
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: theme-screenshot
|
id: theme-screenshot
|
||||||
attributes:
|
attributes:
|
||||||
label: 应用主题后的截图 ( Screenshot of the theme applied )
|
label: Screenshot of the theme applied
|
||||||
description: 请上传应用主题后的截图 ( Please upload a screenshot of the theme applied )
|
description: Please upload a screenshot of the theme applied.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: steps-to-reproduce
|
id: steps-to-reproduce
|
||||||
attributes:
|
attributes:
|
||||||
label: 复现步骤 ( Steps to reproduce )
|
label: Steps to reproduce
|
||||||
description: 请描述如何复现错误 ( Please describe how to reproduce the error )
|
description: Please describe how to reproduce the error.
|
||||||
placeholder: 1. 安装主题 2. 刷新页面 3. 查看错误 ( 1. Install the theme 2. Refresh the page 3. View the error )
|
placeholder: 1. Install the theme 2. Refresh the page 3. View the error
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: bug-description
|
id: bug-description
|
||||||
attributes:
|
attributes:
|
||||||
label: 错误描述 ( Bug Description )
|
label: Bug Description
|
||||||
description: 请描述错误的具体表现 ( Please describe the specific presentation of the error )
|
description: Please describe the specific presentation of the error.
|
||||||
placeholder: 页面底部的颜色错误 ( The color of the bottom of the page is incorrect )
|
placeholder: The color of the bottom of the page is incorrect
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: gitea-screenshot
|
id: gitea-screenshot
|
||||||
attributes:
|
attributes:
|
||||||
label: Gitea 默认主题下的截图 ( Screenshot of the default Gitea theme )
|
label: Screenshot of the default Gitea theme
|
||||||
description: 请上传 Gitea 默认主题下的截图 ( Please upload a screenshot of the default Gitea theme )
|
description: Please upload a screenshot of the default Gitea theme.
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: github-screenshot
|
id: github-screenshot
|
||||||
attributes:
|
attributes:
|
||||||
label: 可供参考的 GitHub 页面对应的截图 ( Screenshot of the corresponding GitHub page )
|
label: Screenshot of the corresponding GitHub page
|
||||||
description: 请上传 GitHub 页面对应的截图 ( Please upload a screenshot of the corresponding GitHub page )
|
description: Please upload a screenshot of the corresponding GitHub page.
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
39
.github/ISSUE_TEMPLATE/2-feature-request.yml
vendored
39
.github/ISSUE_TEMPLATE/2-feature-request.yml
vendored
@@ -1,39 +0,0 @@
|
|||||||
name: 功能请求 ( Feature request )
|
|
||||||
description: 提出新的功能建议 ( Suggest new features )
|
|
||||||
labels: ["enhancement"]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
1. 不接受非 Gitea 和 GitHub 的样式需求 ( We do not accept style requests that are not Gitea or GitHub )
|
|
||||||
2. 颜色需求最好自己实现 ( Color requests are best implemented by yourself )
|
|
||||||
- type: input
|
|
||||||
id: page
|
|
||||||
attributes:
|
|
||||||
label: 页面 ( Page )
|
|
||||||
description: 功能涉及的页面 ( The page the feature involves )
|
|
||||||
placeholder: 首页 ( Home page )
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
id: feature-description
|
|
||||||
attributes:
|
|
||||||
label: 功能描述 ( Feature Description )
|
|
||||||
description: 请描述你想要的功能 ( Please describe the feature you want )
|
|
||||||
placeholder: 菜单样式修改 ( Menu style modification )
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: screenshot
|
|
||||||
attributes:
|
|
||||||
label: 截图 ( Screenshot )
|
|
||||||
description: 预期的主题效果 ( Expected theme effect )
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
id: github-screenshot
|
|
||||||
attributes:
|
|
||||||
label: 可供参考的 GitHub 页面对应的截图 ( Screenshot of the corresponding GitHub page )
|
|
||||||
description: 请上传 GitHub 页面对应的截图 ( Please upload a screenshot of the corresponding GitHub page )
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
33
.github/ISSUE_TEMPLATE/3-core-bug-report.yml
vendored
33
.github/ISSUE_TEMPLATE/3-core-bug-report.yml
vendored
@@ -1,44 +1,43 @@
|
|||||||
name: 框架错误报告 ( Core bug report )
|
name: Core bug report
|
||||||
description: 报告框架的错误 ( Report errors in the theme framework )
|
description: Report errors in the theme framework.
|
||||||
labels: ["core bug"]
|
labels: ["core bug"]
|
||||||
body:
|
body:
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: actual-behavior
|
id: actual-behavior
|
||||||
attributes:
|
attributes:
|
||||||
label: 实际表现 ( Actual Behavior )
|
label: Actual Behavior
|
||||||
description: 请描述实际的错误表现 ( Please describe the actual error presentation )
|
description: Please describe the actual error presentation.
|
||||||
placeholder: 未生成自动颜色主题 ( No automatic color theme generated )
|
placeholder: No automatic color theme generated
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: expected-behavior
|
id: expected-behavior
|
||||||
attributes:
|
attributes:
|
||||||
label: 期望表现 ( Expected Behavior )
|
label: Expected Behavior
|
||||||
description: 请描述期望的正确表现 ( Please describe the expected correct presentation )
|
description: Please describe the expected correct presentation.
|
||||||
placeholder: 生成自动颜色主题 ( Generate automatic color theme )
|
placeholder: Generate automatic color theme
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: steps-to-reproduce
|
id: steps-to-reproduce
|
||||||
attributes:
|
attributes:
|
||||||
label: 复现步骤 ( Steps to reproduce )
|
label: Steps to reproduce
|
||||||
description: 请描述如何复现错误 ( Please describe how to reproduce the error )
|
description: Please describe how to reproduce the error.
|
||||||
placeholder:
|
placeholder: 1. Create a color theme 2. Compile the theme 3. View the error
|
||||||
1. 新建颜色主题 2. 编译主题 3. 查看错误 ( 1. Create a color theme 2. Compile the theme 3. View the error )
|
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: bug-description
|
id: bug-description
|
||||||
attributes:
|
attributes:
|
||||||
label: 错误描述 ( Bug Description )
|
label: Bug Description
|
||||||
description: 请描述错误的具体表现 ( Please describe the specific presentation of the error )
|
description: Please describe the specific presentation of the error.
|
||||||
placeholder: 未生成自动颜色主题 ( No automatic color theme generated )
|
placeholder: No automatic color theme generated
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: screenshot
|
id: screenshot
|
||||||
attributes:
|
attributes:
|
||||||
label: 截图 ( Screenshot )
|
label: Screenshot
|
||||||
description: 请上传错误的截图 ( Please upload the screenshot of the error )
|
description: Please upload the screenshot of the error.
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
12
.github/ISSUE_TEMPLATE/3-doc-report.yml
vendored
Normal file
12
.github/ISSUE_TEMPLATE/3-doc-report.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
name: Document report
|
||||||
|
description: Improve or supplement the document.
|
||||||
|
labels: ["documentation"]
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
id: doc-description
|
||||||
|
attributes:
|
||||||
|
label: Document Description
|
||||||
|
description: Please describe the specific content of the document.
|
||||||
|
placeholder: The document content is incorrect
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
12
.github/ISSUE_TEMPLATE/4-doc-report.yml
vendored
12
.github/ISSUE_TEMPLATE/4-doc-report.yml
vendored
@@ -1,12 +0,0 @@
|
|||||||
name: 文档报告 ( Document report )
|
|
||||||
description: 改进或补充文档 ( Improve or supplement the document )
|
|
||||||
labels: ["documentation"]
|
|
||||||
body:
|
|
||||||
- type: textarea
|
|
||||||
id: doc-description
|
|
||||||
attributes:
|
|
||||||
label: 文档描述 ( Document Description )
|
|
||||||
description: 请描述文档的具体内容 ( Please describe the specific content of the document )
|
|
||||||
placeholder: 文档内容有误 ( The document content is incorrect )
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
39
.github/ISSUE_TEMPLATE/4-feature-request.yml
vendored
Normal file
39
.github/ISSUE_TEMPLATE/4-feature-request.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: Feature request
|
||||||
|
description: Suggest new features.
|
||||||
|
labels: ["enhancement"]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
1. We do not accept style requests that are not Gitea or GitHub.
|
||||||
|
2. Color requests are best implemented by yourself.
|
||||||
|
- type: input
|
||||||
|
id: page
|
||||||
|
attributes:
|
||||||
|
label: Page
|
||||||
|
description: The page the feature involves.
|
||||||
|
placeholder: Home page
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: feature-description
|
||||||
|
attributes:
|
||||||
|
label: Feature Description
|
||||||
|
description: Please describe the feature you want.
|
||||||
|
placeholder: Menu style modification
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: screenshot
|
||||||
|
attributes:
|
||||||
|
label: Screenshot
|
||||||
|
description: Expected theme effect.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: github-screenshot
|
||||||
|
attributes:
|
||||||
|
label: Screenshot of the corresponding GitHub page
|
||||||
|
description: Please upload a screenshot of the corresponding GitHub page.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@@ -29,6 +29,7 @@ jobs:
|
|||||||
tar -zcf dist/theme-github-extra-pink.tar.gz --remove-files \
|
tar -zcf dist/theme-github-extra-pink.tar.gz --remove-files \
|
||||||
dist/theme-github-pink-auto.css dist/theme-github-pink-light.css dist/theme-github-pink-dark.css dist/theme-github-pink-soft-dark.css
|
dist/theme-github-pink-auto.css dist/theme-github-pink-light.css dist/theme-github-pink-dark.css dist/theme-github-pink-soft-dark.css
|
||||||
|
|
||||||
|
tar -zcf dist/theme-github-templates.tar.gz templates
|
||||||
TAG="v$(npm run -s version)"
|
TAG="v$(npm run -s version)"
|
||||||
gh release create "$TAG" dist/* --notes-file CHANGELOG.md --draft -t $TAG
|
gh release create "$TAG" dist/* --notes-file CHANGELOG.md --draft -t $TAG
|
||||||
env:
|
env:
|
||||||
|
|||||||
44
CHANGELOG.md
44
CHANGELOG.md
@@ -1,33 +1,27 @@
|
|||||||
### 🌈 Style
|
### ✨ Feature
|
||||||
|
|
||||||
##### 更符合 GitHub 风格
|
- Added template files to make Gitea's layout more similar to GitHub. (This is optional, you can choose whether to use
|
||||||
|
template files based on your needs)
|
||||||
- 优化差异对比代码块的样式
|
|
||||||
- 优化用户头像样式
|
|
||||||
- 优化 Issue/PR/Diff/Actions 的三点菜单按钮样式
|
|
||||||
- 优化用户动态样式
|
|
||||||
- 优化仓库发布页面样式
|
|
||||||
- 优化字符提示的提示框动画
|
|
||||||
|
|
||||||
### 🐞 Fix
|
|
||||||
|
|
||||||
- 修复 Issue/PR 详细页面中的部分文字颜色, 时间线上的标签样式和侧边栏的时间追踪样式
|
|
||||||
- 修复一些选择输入框的排列问题
|
|
||||||
|
|
||||||
## 📃 English
|
|
||||||
|
|
||||||
### 🌈 Style
|
### 🌈 Style
|
||||||
|
|
||||||
##### More aligned with GitHub style
|
#### More aligned with GitHub style
|
||||||
|
|
||||||
- Optimized diff comparison code block styles
|
- Optimize global line height.
|
||||||
- Optimized user avatar styles
|
- Optimize the workflow log page style.
|
||||||
- Optimized three-dot menu button styles for Issue/PR/Diff/Actions
|
- Optimize repository header name style.
|
||||||
- Optimized user activity feed styles
|
- Optimize organization detail page style.
|
||||||
- Optimized repository release page styles
|
- Optimize top navbar style on mobile.
|
||||||
- Optimized tooltip animation for character hints
|
|
||||||
|
##### Template File
|
||||||
|
|
||||||
|
- Navigation bar Issue & PR moved to the right side.
|
||||||
|
|
||||||
### 🐞 Fix
|
### 🐞 Fix
|
||||||
|
|
||||||
- Fixed text color issues in Issue/PR detail pages, timeline label styles, and sidebar time tracking styles
|
- Fix the problem of missing background color and width when there is a unicode character in the diff.
|
||||||
- Fixed alignment issues with some select input fields
|
- Fix the disabled operation button interval in the code preview interface.
|
||||||
|
- Fix fixed height when scrolling through step titles on workflow detail pages.
|
||||||
|
- Fix packages details page style.
|
||||||
|
- Fix the color of missing icons and text on the homepage when not logged in.
|
||||||
|
- Fix the spacing of Issue WIP prompts.
|
||||||
|
|||||||
151
README.md
151
README.md
@@ -6,67 +6,81 @@
|
|||||||
<img src="https://img.shields.io/github/downloads/lutinglt/gitea-github-theme/latest/total?style=for-the-badge&labelColor=25292e&color=238636">
|
<img src="https://img.shields.io/github/downloads/lutinglt/gitea-github-theme/latest/total?style=for-the-badge&labelColor=25292e&color=238636">
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div align="center">
|
<h4 align="center">
|
||||||
|
|
||||||
中文 • [English](README_EN.md)
|
A Gitea theme that pursues GitHub style not only in colors but also in styling details.
|
||||||
|
|
||||||
不仅仅是在颜色上, 在样式细节上也追求 GitHub 风格的 Gitea 主题.
|
</h4>
|
||||||
|
|
||||||
</div>
|

|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
>
|
>
|
||||||
> 推荐搭配 Catppuccin 文件图标浏览器插件一起使用更佳
|
> Recommend using Catppuccin file icon browser plugin together for better performance.
|
||||||
> [web-file-explorer-icons](https://github.com/catppuccin/web-file-explorer-icons)
|
> [web-file-explorer-icons](https://github.com/catppuccin/web-file-explorer-icons)
|
||||||
|
|
||||||
## 版本号说明
|
## Version Number Explanation
|
||||||
|
|
||||||
主题版本号与 Gitea 版本号保持一致
|
The theme version number is kept consistent with the Gitea version number
|
||||||
|
|
||||||
Gitea 版本号格式: `1.大版本号.小版本号`
|
Gitea version number format: `1.major.minor`
|
||||||
|
|
||||||
Gitea 理论上小版本号变更不会修改前端布局, 所以主题的小版本号适用于所有 Gitea 大版本号相同的 Gitea 版本.
|
Theoretically, minor version changes in Gitea do not modify the frontend layout, so the minor version of the theme is
|
||||||
|
applicable to all Gitea versions with the same major version number.
|
||||||
|
|
||||||
比如: 主题版本 `1.24.5` 适用于 Gitea 版本 `>=1.24.0` `<1.25.0`
|
For example: Theme version `1.24.5` is applicable to Gitea versions `>=1.24.0` `<1.25.0`
|
||||||
|
|
||||||
仅维护项目发布中的最新的 Gitea 版本, 其他旧版本主题不接受 Issue 和 PR.
|
Only the latest released Gitea version is maintained. Issues and PRs for other older theme versions will not be
|
||||||
|
accepted.
|
||||||
|
|
||||||
> 开发阶段的主题版本号格式: `1.大版本号.小版本号.时间戳`
|
> Development stage theme version number format: `1.major.minor.timestamp`
|
||||||
|
|
||||||
### 主题版本发布规则
|
### Theme Version Release Rules
|
||||||
|
|
||||||
- 当 Gitea 发布小版本时, 主题中间如有变更, 则发布新的和 Gitea 小版本相同的主题版本
|
- When Gitea releases a minor version, if there are changes in the theme, a new theme version with the same minor
|
||||||
- 当 Gitea 发布大版本时, 主题中间如有变更, 会发布 `1.旧大版本号.latest` 的主题版本并不再维护旧版本
|
version as Gitea will be released
|
||||||
- 适配大版本的预发布版本为 `1.大版本号.rc`, 当无明显 BUG 时发布与 Gitea 大版本相同的主题版本
|
- When Gitea releases a major version, if there are changes in the theme, a theme version `1.old_major_version.latest`
|
||||||
|
will be released and the old version will no longer be maintained
|
||||||
|
- The pre-release version for major version adaptation is `1.major_version.rc`, and when there are no obvious bugs, a
|
||||||
|
theme version with the same major version as Gitea will be released
|
||||||
|
|
||||||
## 安装
|
## Installation
|
||||||
|
|
||||||
1. 在发布页下载最新的 CSS 主题文件放入 `gitea/public/assets/css` 目录下
|
1. Download the latest CSS theme file from the release page and place it in the `gitea/public/assets/css` directory
|
||||||
2. 修改 `gitea/conf/app.ini`,并将 CSS 文件名去掉 `theme-` 的名称附加到 `[ui]` 下的 `THEMES` 末尾
|
2. Modify `gitea/conf/app.ini` and append the CSS filename without the `theme-` prefix to the end of `THEMES` under the
|
||||||
3. 重启 Gitea
|
`[ui]` section
|
||||||
4. 在设置中查看主题
|
3. Restart Gitea
|
||||||
|
4. Check the theme in the settings
|
||||||
|
|
||||||
例: 主题文件名为 `theme-github-dark.css`,则添加 `github-dark` 到 `THEMES` 末尾
|
Example: If the theme filename is `theme-github-dark.css`, add `github-dark` to the end of `THEMES`
|
||||||
|
|
||||||
`gitea/conf/app.ini` 例:
|
Example `gitea/conf/app.ini`:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[ui]
|
[ui]
|
||||||
THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-dark, github-soft-dark
|
THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-dark, github-soft-dark
|
||||||
```
|
```
|
||||||
|
|
||||||
详细请查看 Gitea 文档
|
For details, please refer to the Gitea documentation
|
||||||
[Gitea docs](https://docs.gitea.com/next/administration/customizing-gitea#customizing-the-look-of-gitea)
|
[Gitea docs](https://docs.gitea.com/next/administration/customizing-gitea#customizing-the-look-of-gitea)
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
>
|
>
|
||||||
> 自动颜色主题需要亮色和暗色的主题文件
|
> Automatic color theme requires both light and dark theme files.
|
||||||
|
|
||||||
## 截图
|
### Template File Installation (Optional)
|
||||||
|
|
||||||
### 基本主题
|
1. Download the latest template files from the release page and place them in the `gitea/templates` directory
|
||||||
|
2. Restart Gitea
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
>
|
||||||
|
> The template modifies Gitea's layout to make it closer to GitHub's layout. Do not use template files across versions,
|
||||||
|
> as this may lead to missing functionality and other issues.
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|
### Basic Themes
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
THEMES = github-auto, github-light, github-dark, github-soft-dark
|
THEMES = github-auto, github-light, github-dark, github-soft-dark
|
||||||
@@ -75,14 +89,14 @@ THEMES = github-auto, github-light, github-dark, github-soft-dark
|
|||||||
<details>
|
<details>
|
||||||
<summary>Base</summary>
|
<summary>Base</summary>
|
||||||
<h4>theme-github-light.css</h4>
|
<h4>theme-github-light.css</h4>
|
||||||
<img src="screenshots/light.png"/>
|
<img src="screenshots/en/light.png"/>
|
||||||
<h4>theme-github-dark.css</h4>
|
<h4>theme-github-dark.css</h4>
|
||||||
<img src="screenshots/dark.png"/>
|
<img src="screenshots/en/dark.png"/>
|
||||||
<h4>theme-github-soft-dark.css</h4>
|
<h4>theme-github-soft-dark.css</h4>
|
||||||
<img src="screenshots/soft-dark.png"/>
|
<img src="screenshots/en/soft-dark.png"/>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 色盲主题 ( Beta )
|
### Colorblind Themes (Beta)
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
THEMES = github-colorblind-auto, github-colorblind-light, github-colorblind-dark
|
THEMES = github-colorblind-auto, github-colorblind-light, github-colorblind-dark
|
||||||
@@ -90,14 +104,14 @@ THEMES = github-tritanopia-auto, github-tritanopia-light, github-tritanopia-dark
|
|||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Colorblind & Tritanopia (红绿色盲 & 蓝色盲)</summary>
|
<summary>Colorblind & Tritanopia</summary>
|
||||||
<h4>theme-github-colorblind-light.css & theme-github-tritanopia-light.css</h4>
|
<h4>theme-github-colorblind-light.css & theme-github-tritanopia-light.css</h4>
|
||||||
<img src="screenshots/colorblind-light.png"/>
|
<img src="screenshots/en/colorblind-light.png"/>
|
||||||
<h4>theme-github-colorblind-dark.css & theme-github-tritanopia-dark.css</h4>
|
<h4>theme-github-colorblind-dark.css & theme-github-tritanopia-dark.css</h4>
|
||||||
<img src="screenshots/colorblind-dark.png"/>
|
<img src="screenshots/en/colorblind-dark.png"/>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 粉色主题
|
### Pink Themes
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
THEMES = github-pink-auto, github-pink-light, github-pink-dark, github-pink-soft-dark
|
THEMES = github-pink-auto, github-pink-light, github-pink-dark, github-pink-soft-dark
|
||||||
@@ -106,20 +120,20 @@ THEMES = github-pink-auto, github-pink-light, github-pink-dark, github-pink-soft
|
|||||||
<details>
|
<details>
|
||||||
<summary>Pink</summary>
|
<summary>Pink</summary>
|
||||||
<h4>theme-github-pink-light.css</h4>
|
<h4>theme-github-pink-light.css</h4>
|
||||||
<img src="screenshots/pink/pink-light.png"/>
|
<img src="screenshots/pink/en/pink-light-en.png"/>
|
||||||
<h4>theme-github-pink-dark.css</h4>
|
<h4>theme-github-pink-dark.css</h4>
|
||||||
<img src="screenshots/pink/pink-dark.png"/>
|
<img src="screenshots/pink/en/pink-dark-en.png"/>
|
||||||
<h4>theme-github-pink-soft-dark.css</h4>
|
<h4>theme-github-pink-soft-dark.css</h4>
|
||||||
<img src="screenshots/pink/pink-soft-dark.png"/>
|
<img src="screenshots/pink/en/pink-soft-dark-en.png"/>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## 自定义 CSS 变量
|
## Custom CSS Variables
|
||||||
|
|
||||||
可以根据自己的偏好自定义主题的一部分样式
|
You can customize parts of the theme style according to your preferences
|
||||||
|
|
||||||
### 使用方法
|
### Usage Method
|
||||||
|
|
||||||
在主题的 CSS 文件的头部或尾部添加以下代码
|
Add the following code at the beginning or end of the theme's CSS file
|
||||||
|
|
||||||
```css
|
```css
|
||||||
:root {
|
:root {
|
||||||
@@ -130,30 +144,31 @@ THEMES = github-pink-auto, github-pink-light, github-pink-dark, github-pink-soft
|
|||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
>
|
>
|
||||||
> 请确保在 `:root` 选择器中添加自定义变量,否则无法生效
|
> Please ensure to add custom variables in the `:root` selector, otherwise they will not take effect
|
||||||
>
|
>
|
||||||
> 变量之间用 `;` 分隔
|
> Variables are separated by `;`
|
||||||
>
|
>
|
||||||
> 建议自定义变量放在单独的文件中, 通过 shell 命令等方式追加到主题文件中
|
> It is recommended to place custom variables in a separate file and append them to the theme file using shell commands
|
||||||
|
> or other methods
|
||||||
|
|
||||||
### CSS 变量
|
### CSS Variables
|
||||||
|
|
||||||
| 变量名 | 描述 | 默认 | Github | 推荐 | 最小 | 最大 |
|
| Variable Name | Description | Default | Github | Recommend | Min | Max |
|
||||||
| :-------------------------------- | :-------------------------- | :---- | :----- | :---- | :---- | :---- |
|
| :-------------------------------- | :------------------------------------------------------- | :------ | :----- | :-------- | :---- | :---- |
|
||||||
| --custom-branch-menu-width | 分支菜单的宽度 | 320px | 320px | 320px | Gitea | 640px |
|
| --custom-branch-menu-width | Branch menu width | 320px | 320px | 320px | Gitea | 640px |
|
||||||
| --custom-clone-menu-width | 克隆按钮的菜单宽度 | Gitea | 332px | 200px | 150px | 400px |
|
| --custom-clone-menu-width | Clone button menu width | Gitea | 332px | 200px | 150px | 400px |
|
||||||
| --custom-user-menu-width | 用户菜单的宽度 | 192px | 256px | | Gitea | 320px |
|
| --custom-user-menu-width | User menu width | 192px | 200px | | Gitea | 320px |
|
||||||
| --custom-explore-repolist-columns | 探索页面的仓库列表列数 | 2 | 2 | 2 | | |
|
| --custom-explore-repolist-columns | Number of repository list columns on explore page | 2 | 2 | 2 | | |
|
||||||
| --custom-explore-userlist-columns | 探索页面的用户/组织列表列数 | 3 | 1 | 2/3 | | |
|
| --custom-explore-userlist-columns | Number of user/organization list columns on explore page | 3 | 1 | 2/3 | | |
|
||||||
| --custom-user-repolist-columns | 用户页面的仓库列表列数 | 2 | 2 | 1/2 | | |
|
| --custom-user-repolist-columns | Number of repository list columns on user page | 2 | 2 | 1/2 | | |
|
||||||
| --custom-org-repolist-columns | 组织页面的仓库列表列数 | 1 | 1 | 1/2 | | |
|
| --custom-org-repolist-columns | Number of repository list columns on organization page | 1 | 1 | 1/2 | | |
|
||||||
| --custom-org-userlist-columns | 组织页面的用户列表列数 | 2 | 1 | 1/2 | | |
|
| --custom-org-userlist-columns | Number of user list columns on organization page | 2 | 1 | 1/2 | | |
|
||||||
|
|
||||||
## 使用开发中的主题
|
## Using Development Version of the Theme
|
||||||
|
|
||||||
也许你会想使用开发中的主题, 而不是发布的主题
|
You might want to use the development version of the theme instead of the released version
|
||||||
|
|
||||||
请确保你已经安装了 Node.js 环境, 推荐使用 Node.js 20 或以上版本
|
Please ensure you have Node.js environment installed, Node.js 20 or above is recommended
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/lutinglt/gitea-github-theme.git
|
git clone https://github.com/lutinglt/gitea-github-theme.git
|
||||||
@@ -162,5 +177,15 @@ npm install
|
|||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
编译完成后, 会在 `dist` 目录下生成主题文件, 你可以将主题文件放入 `gitea/public/assets/css` 目录下, 然后在
|
After compilation, theme files will be generated in the `dist` directory. You can place the theme files into the
|
||||||
`gitea/conf/app.ini` 中添加主题名称到 `THEMES` 末尾
|
`gitea/public/assets/css` directory, then add the theme name to the end of `THEMES` in `gitea/conf/app.ini`
|
||||||
|
|
||||||
|
## Star History
|
||||||
|
|
||||||
|
<a href="https://www.star-history.com/#lutinglt/gitea-github-theme&type=date&legend=top-left">
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=lutinglt/gitea-github-theme&type=date&theme=dark&legend=top-left" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=lutinglt/gitea-github-theme&type=date&legend=top-left" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=lutinglt/gitea-github-theme&type=date&legend=top-left" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
|||||||
173
README_CN.md
Normal file
173
README_CN.md
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
<h1 align="center">
|
||||||
|
<p>Gitea GitHub Theme</p>
|
||||||
|
<img src="https://img.shields.io/github/issues-raw/lutinglt/gitea-github-theme?style=for-the-badge&labelColor=25292e&color=1a7f37">
|
||||||
|
<img src="https://img.shields.io/github/issues-closed-raw/lutinglt/gitea-github-theme?style=for-the-badge&labelColor=25292e&color=8250df">
|
||||||
|
<img src="https://img.shields.io/github/downloads/lutinglt/gitea-github-theme/total?style=for-the-badge&labelColor=25292e&color=1f6feb">
|
||||||
|
<img src="https://img.shields.io/github/downloads/lutinglt/gitea-github-theme/latest/total?style=for-the-badge&labelColor=25292e&color=238636">
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<h4 align="center">
|
||||||
|
|
||||||
|
不仅仅是在颜色上, 在样式细节上也追求 GitHub 风格的 Gitea 主题
|
||||||
|
|
||||||
|
</h4>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
>
|
||||||
|
> 推荐搭配 Catppuccin 文件图标浏览器插件一起使用更佳
|
||||||
|
> [web-file-explorer-icons](https://github.com/catppuccin/web-file-explorer-icons)
|
||||||
|
|
||||||
|
## 版本号说明
|
||||||
|
|
||||||
|
主题版本号与 Gitea 版本号保持一致
|
||||||
|
|
||||||
|
Gitea 版本号格式: `1.大版本号.小版本号`
|
||||||
|
|
||||||
|
Gitea 理论上小版本号变更不会修改前端布局, 所以主题的小版本号适用于所有 Gitea 大版本号相同的 Gitea 版本.
|
||||||
|
|
||||||
|
比如: 主题版本 `1.24.5` 适用于 Gitea 版本 `>=1.24.0` `<1.25.0`
|
||||||
|
|
||||||
|
仅维护项目发布中的最新的 Gitea 版本, 其他旧版本主题不接受 Issue 和 PR.
|
||||||
|
|
||||||
|
> 开发阶段的主题版本号格式: `1.大版本号.小版本号.时间戳`
|
||||||
|
|
||||||
|
### 主题版本发布规则
|
||||||
|
|
||||||
|
- 当 Gitea 发布小版本时, 主题中间如有变更, 则发布新的和 Gitea 小版本相同的主题版本
|
||||||
|
- 当 Gitea 发布大版本时, 主题中间如有变更, 会发布 `1.旧大版本号.latest` 的主题版本并不再维护旧版本
|
||||||
|
- 适配大版本的预发布版本为 `1.大版本号.rc`, 当无明显 BUG 时发布与 Gitea 大版本相同的主题版本
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
1. 在发布页下载最新的 CSS 主题文件放入 `gitea/public/assets/css` 目录下
|
||||||
|
2. 修改 `gitea/conf/app.ini`,并将 CSS 文件名去掉 `theme-` 的名称附加到 `[ui]` 下的 `THEMES` 末尾
|
||||||
|
3. 重启 Gitea
|
||||||
|
4. 在设置中查看主题
|
||||||
|
|
||||||
|
例: 主题文件名为 `theme-github-dark.css`,则添加 `github-dark` 到 `THEMES` 末尾
|
||||||
|
|
||||||
|
`gitea/conf/app.ini` 例:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[ui]
|
||||||
|
THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-dark, github-soft-dark
|
||||||
|
```
|
||||||
|
|
||||||
|
详细请查看 Gitea 文档
|
||||||
|
[Gitea docs](https://docs.gitea.com/next/administration/customizing-gitea#customizing-the-look-of-gitea)
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
>
|
||||||
|
> 自动颜色主题需要亮色和暗色的主题文件
|
||||||
|
|
||||||
|
### 模板文件安装 (可选)
|
||||||
|
|
||||||
|
1. 在发布页下载最新的模板文件放入 `gitea/templates` 目录下
|
||||||
|
2. 重启 Gitea
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
>
|
||||||
|
> 模板修改了 Gitea 的布局, 使其更接近 GitHub 的布局, 请勿跨版本使用模板文件, 可能会导致功能缺失等问题
|
||||||
|
|
||||||
|
## 截图
|
||||||
|
|
||||||
|
### 基本主题
|
||||||
|
|
||||||
|
```ini
|
||||||
|
THEMES = github-auto, github-light, github-dark, github-soft-dark
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Base</summary>
|
||||||
|
<h4>theme-github-light.css</h4>
|
||||||
|
<img src="screenshots/light.png"/>
|
||||||
|
<h4>theme-github-dark.css</h4>
|
||||||
|
<img src="screenshots/dark.png"/>
|
||||||
|
<h4>theme-github-soft-dark.css</h4>
|
||||||
|
<img src="screenshots/soft-dark.png"/>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 色盲主题 ( Beta )
|
||||||
|
|
||||||
|
```ini
|
||||||
|
THEMES = github-colorblind-auto, github-colorblind-light, github-colorblind-dark
|
||||||
|
THEMES = github-tritanopia-auto, github-tritanopia-light, github-tritanopia-dark
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Colorblind & Tritanopia (红绿色盲 & 蓝色盲)</summary>
|
||||||
|
<h4>theme-github-colorblind-light.css & theme-github-tritanopia-light.css</h4>
|
||||||
|
<img src="screenshots/colorblind-light.png"/>
|
||||||
|
<h4>theme-github-colorblind-dark.css & theme-github-tritanopia-dark.css</h4>
|
||||||
|
<img src="screenshots/colorblind-dark.png"/>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 粉色主题
|
||||||
|
|
||||||
|
```ini
|
||||||
|
THEMES = github-pink-auto, github-pink-light, github-pink-dark, github-pink-soft-dark
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Pink</summary>
|
||||||
|
<h4>theme-github-pink-light.css</h4>
|
||||||
|
<img src="screenshots/pink/pink-light.png"/>
|
||||||
|
<h4>theme-github-pink-dark.css</h4>
|
||||||
|
<img src="screenshots/pink/pink-dark.png"/>
|
||||||
|
<h4>theme-github-pink-soft-dark.css</h4>
|
||||||
|
<img src="screenshots/pink/pink-soft-dark.png"/>
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## 自定义 CSS 变量
|
||||||
|
|
||||||
|
可以根据自己的偏好自定义主题的一部分样式
|
||||||
|
|
||||||
|
### 使用方法
|
||||||
|
|
||||||
|
在主题的 CSS 文件的头部或尾部添加以下代码
|
||||||
|
|
||||||
|
```css
|
||||||
|
:root {
|
||||||
|
--custom-clone-menu-width: 150px;
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
>
|
||||||
|
> 请确保在 `:root` 选择器中添加自定义变量,否则无法生效
|
||||||
|
>
|
||||||
|
> 变量之间用 `;` 分隔
|
||||||
|
>
|
||||||
|
> 建议自定义变量放在单独的文件中, 通过 shell 命令等方式追加到主题文件中
|
||||||
|
|
||||||
|
### CSS 变量
|
||||||
|
|
||||||
|
| 变量名 | 描述 | 默认 | Github | 推荐 | 最小 | 最大 |
|
||||||
|
| :-------------------------------- | :-------------------------- | :---- | :----- | :---- | :---- | :---- |
|
||||||
|
| --custom-branch-menu-width | 分支菜单的宽度 | 320px | 320px | 320px | Gitea | 640px |
|
||||||
|
| --custom-clone-menu-width | 克隆按钮的菜单宽度 | Gitea | 332px | 200px | 150px | 400px |
|
||||||
|
| --custom-user-menu-width | 用户菜单的宽度 | 192px | 256px | | Gitea | 320px |
|
||||||
|
| --custom-explore-repolist-columns | 探索页面的仓库列表列数 | 2 | 2 | 2 | | |
|
||||||
|
| --custom-explore-userlist-columns | 探索页面的用户/组织列表列数 | 3 | 1 | 2/3 | | |
|
||||||
|
| --custom-user-repolist-columns | 用户页面的仓库列表列数 | 2 | 2 | 1/2 | | |
|
||||||
|
| --custom-org-repolist-columns | 组织页面的仓库列表列数 | 1 | 1 | 1/2 | | |
|
||||||
|
| --custom-org-userlist-columns | 组织页面的用户列表列数 | 2 | 1 | 1/2 | | |
|
||||||
|
|
||||||
|
## 使用开发中的主题
|
||||||
|
|
||||||
|
也许你会想使用开发中的主题, 而不是发布的主题
|
||||||
|
|
||||||
|
请确保你已经安装了 Node.js 环境, 推荐使用 Node.js 20 或以上版本
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/lutinglt/gitea-github-theme.git
|
||||||
|
cd gitea-github-theme
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
编译完成后, 会在 `dist` 目录下生成主题文件, 你可以将主题文件放入 `gitea/public/assets/css` 目录下, 然后在
|
||||||
|
`gitea/conf/app.ini` 中添加主题名称到 `THEMES` 末尾
|
||||||
173
README_EN.md
173
README_EN.md
@@ -1,173 +0,0 @@
|
|||||||
<h1 align="center">
|
|
||||||
<p>Gitea GitHub Theme</p>
|
|
||||||
<img src="https://img.shields.io/github/issues-raw/lutinglt/gitea-github-theme?style=for-the-badge&labelColor=25292e&color=1a7f37">
|
|
||||||
<img src="https://img.shields.io/github/issues-closed-raw/lutinglt/gitea-github-theme?style=for-the-badge&labelColor=25292e&color=8250df">
|
|
||||||
<img src="https://img.shields.io/github/downloads/lutinglt/gitea-github-theme/total?style=for-the-badge&labelColor=25292e&color=1f6feb">
|
|
||||||
<img src="https://img.shields.io/github/downloads/lutinglt/gitea-github-theme/latest/total?style=for-the-badge&labelColor=25292e&color=238636">
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
English • [中文](README.md)
|
|
||||||
|
|
||||||
A Gitea theme that pursues GitHub style not only in colors but also in styling details.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
> [!TIP]
|
|
||||||
>
|
|
||||||
> Recommend using Catppuccin file icon browser plugin together for better performance.
|
|
||||||
> [web-file-explorer-icons](https://github.com/catppuccin/web-file-explorer-icons)
|
|
||||||
|
|
||||||
## Version Number Explanation
|
|
||||||
|
|
||||||
The theme version number is kept consistent with the Gitea version number
|
|
||||||
|
|
||||||
Gitea version number format: `1.major.minor`
|
|
||||||
|
|
||||||
Theoretically, minor version changes in Gitea do not modify the frontend layout, so the minor version of the theme is
|
|
||||||
applicable to all Gitea versions with the same major version number.
|
|
||||||
|
|
||||||
For example: Theme version `1.24.5` is applicable to Gitea versions `>=1.24.0` `<1.25.0`
|
|
||||||
|
|
||||||
Only the latest released Gitea version is maintained. Issues and PRs for other older theme versions will not be
|
|
||||||
accepted.
|
|
||||||
|
|
||||||
> Development stage theme version number format: `1.major.minor.timestamp`
|
|
||||||
|
|
||||||
### Theme Version Release Rules
|
|
||||||
|
|
||||||
- When Gitea releases a minor version, if there are changes in the theme, a new theme version with the same minor
|
|
||||||
version as Gitea will be released
|
|
||||||
- When Gitea releases a major version, if there are changes in the theme, a theme version `1.old_major_version.latest`
|
|
||||||
will be released and the old version will no longer be maintained
|
|
||||||
- The pre-release version for major version adaptation is `1.major_version.rc`, and when there are no obvious bugs, a
|
|
||||||
theme version with the same major version as Gitea will be released
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
1. Download the latest CSS theme file from the release page and place it in the `gitea/public/assets/css` directory
|
|
||||||
2. Modify `gitea/conf/app.ini` and append the CSS filename without the `theme-` prefix to the end of `THEMES` under the
|
|
||||||
`[ui]` section
|
|
||||||
3. Restart Gitea
|
|
||||||
4. Check the theme in the settings
|
|
||||||
|
|
||||||
Example: If the theme filename is `theme-github-dark.css`, add `github-dark` to the end of `THEMES`
|
|
||||||
|
|
||||||
Example `gitea/conf/app.ini`:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[ui]
|
|
||||||
THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-dark, github-soft-dark
|
|
||||||
```
|
|
||||||
|
|
||||||
For details, please refer to the Gitea documentation
|
|
||||||
[Gitea docs](https://docs.gitea.com/next/administration/customizing-gitea#customizing-the-look-of-gitea)
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
>
|
|
||||||
> Automatic color theme requires both light and dark theme files.
|
|
||||||
|
|
||||||
## Screenshots
|
|
||||||
|
|
||||||
### Basic Themes
|
|
||||||
|
|
||||||
```ini
|
|
||||||
THEMES = github-auto, github-light, github-dark, github-soft-dark
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Base</summary>
|
|
||||||
<h4>theme-github-light.css</h4>
|
|
||||||
<img src="screenshots/en/light.png"/>
|
|
||||||
<h4>theme-github-dark.css</h4>
|
|
||||||
<img src="screenshots/en/dark.png"/>
|
|
||||||
<h4>theme-github-soft-dark.css</h4>
|
|
||||||
<img src="screenshots/en/soft-dark.png"/>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### Colorblind Themes (Beta)
|
|
||||||
|
|
||||||
```ini
|
|
||||||
THEMES = github-colorblind-auto, github-colorblind-light, github-colorblind-dark
|
|
||||||
THEMES = github-tritanopia-auto, github-tritanopia-light, github-tritanopia-dark
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Colorblind & Tritanopia</summary>
|
|
||||||
<h4>theme-github-colorblind-light.css & theme-github-tritanopia-light.css</h4>
|
|
||||||
<img src="screenshots/en/colorblind-light.png"/>
|
|
||||||
<h4>theme-github-colorblind-dark.css & theme-github-tritanopia-dark.css</h4>
|
|
||||||
<img src="screenshots/en/colorblind-dark.png"/>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### Pink Themes
|
|
||||||
|
|
||||||
```ini
|
|
||||||
THEMES = github-pink-auto, github-pink-light, github-pink-dark, github-pink-soft-dark
|
|
||||||
```
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Pink</summary>
|
|
||||||
<h4>theme-github-pink-light.css</h4>
|
|
||||||
<img src="screenshots/pink/en/pink-light-en.png"/>
|
|
||||||
<h4>theme-github-pink-dark.css</h4>
|
|
||||||
<img src="screenshots/pink/en/pink-dark-en.png"/>
|
|
||||||
<h4>theme-github-pink-soft-dark.css</h4>
|
|
||||||
<img src="screenshots/pink/en/pink-soft-dark-en.png"/>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## Custom CSS Variables
|
|
||||||
|
|
||||||
You can customize parts of the theme style according to your preferences
|
|
||||||
|
|
||||||
### Usage Method
|
|
||||||
|
|
||||||
Add the following code at the beginning or end of the theme's CSS file
|
|
||||||
|
|
||||||
```css
|
|
||||||
:root {
|
|
||||||
--custom-clone-menu-width: 150px;
|
|
||||||
...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
>
|
|
||||||
> Please ensure to add custom variables in the `:root` selector, otherwise they will not take effect
|
|
||||||
>
|
|
||||||
> Variables are separated by `;`
|
|
||||||
>
|
|
||||||
> It is recommended to place custom variables in a separate file and append them to the theme file using shell commands
|
|
||||||
> or other methods
|
|
||||||
|
|
||||||
### CSS Variables
|
|
||||||
|
|
||||||
| Variable Name | Description | Default | Github | Recommend | Min | Max |
|
|
||||||
| :-------------------------------- | :------------------------------------------------------- | :------ | :----- | :-------- | :---- | :---- |
|
|
||||||
| --custom-branch-menu-width | Branch menu width | 320px | 320px | 320px | Gitea | 640px |
|
|
||||||
| --custom-clone-menu-width | Clone button menu width | Gitea | 332px | 200px | 150px | 400px |
|
|
||||||
| --custom-user-menu-width | User menu width | 192px | 200px | | Gitea | 320px |
|
|
||||||
| --custom-explore-repolist-columns | Number of repository list columns on explore page | 2 | 2 | 2 | | |
|
|
||||||
| --custom-explore-userlist-columns | Number of user/organization list columns on explore page | 3 | 1 | 2/3 | | |
|
|
||||||
| --custom-user-repolist-columns | Number of repository list columns on user page | 2 | 2 | 1/2 | | |
|
|
||||||
| --custom-org-repolist-columns | Number of repository list columns on organization page | 1 | 1 | 1/2 | | |
|
|
||||||
| --custom-org-userlist-columns | Number of user list columns on organization page | 2 | 1 | 1/2 | | |
|
|
||||||
|
|
||||||
## Using Development Version of the Theme
|
|
||||||
|
|
||||||
You might want to use the development version of the theme instead of the released version
|
|
||||||
|
|
||||||
Please ensure you have Node.js environment installed, Node.js 20 or above is recommended
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/lutinglt/gitea-github-theme.git
|
|
||||||
cd gitea-github-theme
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
After compilation, theme files will be generated in the `dist` directory. You can place the theme files into the
|
|
||||||
`gitea/public/assets/css` directory, then add the theme name to the end of `THEMES` in `gitea/conf/app.ini`
|
|
||||||
1
gitea/README.md
Normal file
1
gitea/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
模板的原始文件
|
||||||
173
gitea/templates/base/head_navbar.tmpl
Normal file
173
gitea/templates/base/head_navbar.tmpl
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
|
||||||
|
<div class="navbar-left">
|
||||||
|
<!-- the logo -->
|
||||||
|
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
|
||||||
|
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
|
||||||
|
<div class="ui secondary menu navbar-mobile-right only-mobile">
|
||||||
|
{{template "base/head_navbar_icons" dict "PageGlobalData" .PageGlobalData}}
|
||||||
|
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- navbar links non-mobile -->
|
||||||
|
{{if and .IsSigned .MustChangePassword}}
|
||||||
|
{{/* No links */}}
|
||||||
|
{{else if .IsSigned}}
|
||||||
|
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
|
||||||
|
<a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{ctx.Locale.Tr "issues"}}</a>
|
||||||
|
{{end}}
|
||||||
|
{{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
|
||||||
|
<a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{ctx.Locale.Tr "pull_requests"}}</a>
|
||||||
|
{{end}}
|
||||||
|
{{if not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled)}}
|
||||||
|
{{if .ShowMilestonesDashboardPage}}
|
||||||
|
<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
|
||||||
|
{{else if .IsLandingPageOrganizations}}
|
||||||
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{ctx.Locale.Tr "explore"}}</a>
|
||||||
|
{{else}}
|
||||||
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{template "custom/extra_links" .}}
|
||||||
|
|
||||||
|
{{if not .IsSigned}}
|
||||||
|
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">{{ctx.Locale.Tr "help"}}</a>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- the full dropdown menus -->
|
||||||
|
<div class="navbar-right">
|
||||||
|
{{if and .IsSigned .MustChangePassword}}
|
||||||
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
||||||
|
<span class="text">
|
||||||
|
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
|
||||||
|
<span class="only-mobile">{{.SignedUser.Name}}</span>
|
||||||
|
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
|
||||||
|
</span>
|
||||||
|
<div class="menu user-menu">
|
||||||
|
<div class="header">
|
||||||
|
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
||||||
|
{{svg "octicon-sign-out"}}
|
||||||
|
{{ctx.Locale.Tr "sign_out"}}
|
||||||
|
</a>
|
||||||
|
</div><!-- end content avatar menu -->
|
||||||
|
</div><!-- end dropdown avatar menu -->
|
||||||
|
{{else if .IsSigned}}
|
||||||
|
{{template "base/head_navbar_icons" dict "ItemExtraClass" "not-mobile" "PageGlobalData" .PageGlobalData}}
|
||||||
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
|
||||||
|
<span class="text">
|
||||||
|
{{svg "octicon-plus"}}
|
||||||
|
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
|
||||||
|
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
|
||||||
|
</span>
|
||||||
|
<div class="menu">
|
||||||
|
<a class="item" href="{{AppSubUrl}}/repo/create">
|
||||||
|
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
|
||||||
|
</a>
|
||||||
|
{{if not .DisableMigrations}}
|
||||||
|
<a class="item" href="{{AppSubUrl}}/repo/migrate">
|
||||||
|
{{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{if .SignedUser.CanCreateOrganization}}
|
||||||
|
<a class="item" href="{{AppSubUrl}}/org/create">
|
||||||
|
{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div><!-- end content create new menu -->
|
||||||
|
</div><!-- end dropdown menu create new -->
|
||||||
|
|
||||||
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
||||||
|
<span class="text">
|
||||||
|
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
|
||||||
|
<span class="only-mobile">{{.SignedUser.Name}}</span>
|
||||||
|
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
|
||||||
|
</span>
|
||||||
|
<div class="menu user-menu">
|
||||||
|
<div class="header">
|
||||||
|
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
<a class="item" href="{{.SignedUser.HomeLink}}">
|
||||||
|
{{svg "octicon-person"}}
|
||||||
|
{{ctx.Locale.Tr "your_profile"}}
|
||||||
|
</a>
|
||||||
|
{{if not .DisableStars}}
|
||||||
|
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
|
||||||
|
{{svg "octicon-star"}}
|
||||||
|
{{ctx.Locale.Tr "your_starred"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
<a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
|
||||||
|
{{svg "octicon-bell"}}
|
||||||
|
{{ctx.Locale.Tr "notification.subscriptions"}}
|
||||||
|
</a>
|
||||||
|
<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
||||||
|
{{svg "octicon-tools"}}
|
||||||
|
{{ctx.Locale.Tr "your_settings"}}
|
||||||
|
</a>
|
||||||
|
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">
|
||||||
|
{{svg "octicon-question"}}
|
||||||
|
{{ctx.Locale.Tr "help"}}
|
||||||
|
</a>
|
||||||
|
<div class="divider"></div>
|
||||||
|
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
||||||
|
{{svg "octicon-sign-out"}}
|
||||||
|
{{ctx.Locale.Tr "sign_out"}}
|
||||||
|
</a>
|
||||||
|
</div><!-- end content avatar menu -->
|
||||||
|
</div><!-- end dropdown avatar menu -->
|
||||||
|
{{else}}
|
||||||
|
{{if .ShowRegistrationButton}}
|
||||||
|
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
|
||||||
|
{{svg "octicon-person"}}
|
||||||
|
<span class="tw-ml-1">{{ctx.Locale.Tr "register"}}</span>
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
|
||||||
|
{{svg "octicon-sign-in"}}
|
||||||
|
<span class="tw-ml-1">{{ctx.Locale.Tr "sign_in"}}</span>
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div><!-- end full right menu -->
|
||||||
|
|
||||||
|
{{$activeStopwatch := and .PageGlobalData (call .PageGlobalData.GetActiveStopwatch)}}
|
||||||
|
{{if $activeStopwatch}}
|
||||||
|
<div class="active-stopwatch-popup tippy-target">
|
||||||
|
<div class="tw-flex tw-items-center tw-gap-2 tw-p-3">
|
||||||
|
<a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{$activeStopwatch.IssueLink}}">
|
||||||
|
{{svg "octicon-issue-opened" 16}}
|
||||||
|
<span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
|
||||||
|
</a>
|
||||||
|
<div class="tw-flex tw-gap-1">
|
||||||
|
<form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
|
||||||
|
{{.CsrfTokenHtml}}
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="ui button mini compact basic icon tw-mr-0"
|
||||||
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
|
||||||
|
>{{svg "octicon-square-fill"}}</button>
|
||||||
|
</form>
|
||||||
|
<form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel">
|
||||||
|
{{.CsrfTokenHtml}}
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="ui button mini compact basic icon tw-mr-0"
|
||||||
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
|
||||||
|
>{{svg "octicon-trash"}}</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</nav>
|
||||||
25
gitea/templates/base/head_navbar_icons.tmpl
Normal file
25
gitea/templates/base/head_navbar_icons.tmpl
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{{- $itemExtraClass := .ItemExtraClass -}}
|
||||||
|
{{- $data := .PageGlobalData -}}
|
||||||
|
{{if and $data $data.IsSigned}}{{/* data may not exist, for example: rendering 503 page before the PageGlobalData middleware */}}
|
||||||
|
{{- $activeStopwatch := call $data.GetActiveStopwatch -}}
|
||||||
|
{{- $notificationUnreadCount := call $data.GetNotificationUnreadCount -}}
|
||||||
|
{{if $activeStopwatch}}
|
||||||
|
<a class="item active-stopwatch {{$itemExtraClass}}" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
|
||||||
|
<div class="tw-relative">
|
||||||
|
{{svg "octicon-stopwatch"}}
|
||||||
|
<span class="header-stopwatch-dot"></span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}">
|
||||||
|
<div class="tw-relative">
|
||||||
|
{{svg "octicon-bell"}}
|
||||||
|
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{{if $data.IsSiteAdmin}}
|
||||||
|
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/-/admin" data-tooltip-content="{{ctx.Locale.Tr "admin_panel"}}">
|
||||||
|
{{svg "octicon-server"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gitea-github-theme",
|
"name": "gitea-github-theme",
|
||||||
"version": "1.25.1",
|
"version": "1.25.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite build --mode dev",
|
"dev": "vite build --mode dev",
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ export function github2ThemeColor(githubColor: GithubColor): ThemeColor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const other: Other = {
|
const other: Other = {
|
||||||
|
logo: themeVars.color.primary.self,
|
||||||
body: githubColor.bgColor.default,
|
body: githubColor.bgColor.default,
|
||||||
box: {
|
box: {
|
||||||
header: githubColor.bgColor.muted,
|
header: githubColor.bgColor.muted,
|
||||||
|
|||||||
@@ -121,17 +121,28 @@ export function themePlugin(): Plugin {
|
|||||||
const server = process.env.SSH_SERVER;
|
const server = process.env.SSH_SERVER;
|
||||||
const user = process.env.SSH_USER || "root";
|
const user = process.env.SSH_USER || "root";
|
||||||
const theme_path = process.env.GITEA_THEME_PATH;
|
const theme_path = process.env.GITEA_THEME_PATH;
|
||||||
if (server && theme_path) {
|
const gitea_path = process.env.GITEA_PATH;
|
||||||
const cmd = `scp dist/${prefix}*.css ${user}@${server}:${theme_path}`;
|
if (server) {
|
||||||
console.log("[themePlugin] exec:", cmd);
|
|
||||||
try {
|
try {
|
||||||
execSync(cmd, { stdio: "inherit" });
|
if (theme_path) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const cmd = `scp dist/${prefix}*.css ${user}@${server}:${theme_path}`;
|
||||||
|
console.log("[themePlugin] exec:", cmd);
|
||||||
|
execSync(cmd, { stdio: "inherit" });
|
||||||
|
} else {
|
||||||
|
console.log("[themePlugin] no GITEA_THEME_PATH, skip upload");
|
||||||
|
}
|
||||||
|
if (gitea_path) {
|
||||||
|
const cmd = `scp -r templates ${user}@${server}:${gitea_path}`;
|
||||||
|
console.log("[themePlugin] exec:", cmd);
|
||||||
|
execSync(cmd, { stdio: "inherit" });
|
||||||
|
} else {
|
||||||
|
console.log("[themePlugin] no GITEA_TMPL_PATH, skip upload");
|
||||||
|
}
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// continue regardless of error
|
// continue regardless of error
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("[themePlugin] no SSH_SERVER or GITEA_THEME_PATH, skip upload");
|
console.log("[themePlugin] no SSH_SERVER, skip upload");
|
||||||
}
|
}
|
||||||
console.log("[themePlugin] exec end.");
|
console.log("[themePlugin] exec end.");
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export const otherAuto = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const other = {
|
export const other = {
|
||||||
|
/** 未登录时的介绍首页的 SVG 和链接文字颜色 */
|
||||||
|
logo: null,
|
||||||
/** 主要背景色 */
|
/** 主要背景色 */
|
||||||
body: null,
|
body: null,
|
||||||
/** 页面底部状态栏背景色 */
|
/** 页面底部状态栏背景色 */
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export const actions = css`
|
|||||||
color: ${themeVars.github.fgColor.accent};
|
color: ${themeVars.github.fgColor.accent};
|
||||||
font-family: var(--fonts-monospace);
|
font-family: var(--fonts-monospace);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
padding: 0px 6px;
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||||
color: ${themeVars.github.fgColor.accent};
|
color: ${themeVars.github.fgColor.accent};
|
||||||
@@ -76,6 +77,7 @@ export const actions = css`
|
|||||||
|
|
||||||
.flex-item {
|
.flex-item {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
|
line-height: 18px;
|
||||||
.flex-item-leading {
|
.flex-item-leading {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
@@ -156,7 +158,6 @@ export const actionViewLeft = css`
|
|||||||
.action-view-left {
|
.action-view-left {
|
||||||
margin-right: 28px;
|
margin-right: 28px;
|
||||||
border-top: 1px solid ${themeVars.color.console.border};
|
border-top: 1px solid ${themeVars.color.console.border};
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: "Jobs";
|
content: "Jobs";
|
||||||
color: ${themeVars.color.console.fg.subtle};
|
color: ${themeVars.color.console.fg.subtle};
|
||||||
@@ -168,52 +169,53 @@ export const actionViewLeft = css`
|
|||||||
top: -8px;
|
top: -8px;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.job-group-section {
|
.job-group-section {
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
border-bottom: 1px solid ${themeVars.color.console.border};
|
border-bottom: 1px solid ${themeVars.color.console.border};
|
||||||
|
.job-brief-list {
|
||||||
.job-brief-item {
|
gap: 4px;
|
||||||
border-radius: ${otherThemeVars.border.radius} !important;
|
// 双重确保覆盖原始样式
|
||||||
padding: 8px;
|
.job-brief-item.job-brief-item {
|
||||||
position: relative;
|
border-radius: ${otherThemeVars.border.radius} !important;
|
||||||
margin-left: 0.5rem;
|
padding: 8px;
|
||||||
|
position: relative;
|
||||||
&.selected {
|
margin-left: 0.5rem;
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: ${themeVars.color.console.hoverBg};
|
background-color: ${themeVars.color.console.hoverBg};
|
||||||
}
|
}
|
||||||
|
&.selected {
|
||||||
&:after {
|
&:after {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
background: ${themeVars.github.borderColor.accent.emphasis};
|
background: ${themeVars.github.borderColor.accent.emphasis};
|
||||||
border-radius: ${otherThemeVars.border.radius};
|
border-radius: ${otherThemeVars.border.radius};
|
||||||
content: "";
|
content: "";
|
||||||
height: 24px;
|
height: 24px;
|
||||||
left: calc(0.5rem * -1);
|
left: calc(0.5rem * -1);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: calc(50% - 12px);
|
top: calc(50% - 12px);
|
||||||
width: 4px;
|
width: 4px;
|
||||||
}
|
|
||||||
}
|
|
||||||
.job-brief-item-right {
|
|
||||||
svg.job-brief-rerun {
|
|
||||||
display: none;
|
|
||||||
color: ${themeVars.color.console.fg.subtle};
|
|
||||||
&:hover {
|
|
||||||
color: ${themeVars.color.text.self};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.step-summary-duration {
|
|
||||||
color: ${themeVars.color.console.fg.subtle};
|
|
||||||
font-family: var(--fonts-monospace);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:hover {
|
|
||||||
.job-brief-item-right {
|
.job-brief-item-right {
|
||||||
svg.job-brief-rerun {
|
svg.job-brief-rerun {
|
||||||
display: inline-block;
|
display: none;
|
||||||
|
color: ${themeVars.color.console.fg.subtle};
|
||||||
|
&:hover {
|
||||||
|
color: ${themeVars.color.text.self};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.step-summary-duration {
|
||||||
|
color: ${themeVars.color.console.fg.subtle};
|
||||||
|
font-family: var(--fonts-monospace);
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
.job-brief-item-right {
|
||||||
|
svg.job-brief-rerun {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,52 +255,57 @@ export const actionViewRight = css`
|
|||||||
}
|
}
|
||||||
|
|
||||||
.job-step-container {
|
.job-step-container {
|
||||||
// 步骤标题
|
padding: 8px;
|
||||||
.job-step-summary {
|
.job-step-section {
|
||||||
color: ${themeVars.color.console.fg.subtle};
|
margin: 0 4px 4px;
|
||||||
padding: 8px 10px !important;
|
// 步骤标题, 双重确保覆盖原始样式
|
||||||
|
.job-step-summary.job-step-summary {
|
||||||
&.selected {
|
|
||||||
// 滚动时固定在顶部的高度与 job-info-header 高度相同
|
|
||||||
top: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.step-expandable:hover {
|
|
||||||
color: ${themeVars.color.console.fg.subtle};
|
color: ${themeVars.color.console.fg.subtle};
|
||||||
}
|
padding: 8px !important;
|
||||||
|
height: 36px;
|
||||||
|
|
||||||
.tw-mr-2:not(.svg) svg.svg {
|
&.selected {
|
||||||
margin: 1.5px 6px 0px 2px;
|
// 滚动时固定在顶部的高度与 job-info-header 高度相同
|
||||||
}
|
top: 80px;
|
||||||
/* 绿色步骤状态改为白色 */
|
}
|
||||||
svg.svg.text.green {
|
|
||||||
color: ${themeVars.color.console.fg.subtle} !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.selected {
|
&.step-expandable:hover {
|
||||||
/* 不被 hover 效果影响 */
|
color: ${themeVars.color.console.fg.subtle};
|
||||||
color: ${themeVars.color.console.fg.self} !important;
|
}
|
||||||
background-color: ${themeVars.color.console.activeBg} !important;
|
|
||||||
|
|
||||||
|
.tw-mr-2:not(.svg) svg.svg {
|
||||||
|
margin: 1.5px 6px 0px 2px;
|
||||||
|
}
|
||||||
|
/* 绿色步骤状态改为白色 */
|
||||||
svg.svg.text.green {
|
svg.svg.text.green {
|
||||||
|
color: ${themeVars.color.console.fg.subtle} !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.selected {
|
||||||
|
/* 不被 hover 效果影响 */
|
||||||
color: ${themeVars.color.console.fg.self} !important;
|
color: ${themeVars.color.console.fg.self} !important;
|
||||||
|
background-color: ${themeVars.color.console.activeBg} !important;
|
||||||
|
|
||||||
|
svg.svg.text.green {
|
||||||
|
color: ${themeVars.color.console.fg.self} !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 步骤耗时
|
||||||
|
.step-summary-duration {
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: var(--fonts-monospace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 步骤耗时
|
// 步骤日志
|
||||||
.step-summary-duration {
|
.job-step-logs {
|
||||||
font-size: 12px;
|
animation: ${animationDown};
|
||||||
font-family: var(--fonts-monospace);
|
/* 日志字体颜色白色 */
|
||||||
}
|
.job-log-line {
|
||||||
}
|
color: ${themeVars.color.console.fg.self};
|
||||||
// 步骤日志
|
/* 被 hover 时覆盖 ANSI 颜色 */
|
||||||
.job-step-logs {
|
.log-msg:hover * {
|
||||||
animation: ${animationDown};
|
color: ${themeVars.color.console.fg.self} !important;
|
||||||
/* 日志字体颜色白色 */
|
}
|
||||||
.job-log-line {
|
|
||||||
color: ${themeVars.color.console.fg.self};
|
|
||||||
/* 被 hover 时覆盖 ANSI 颜色 */
|
|
||||||
.log-msg:hover * {
|
|
||||||
color: ${themeVars.color.console.fg.self} !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||||
|
import { labelStyle } from "styles/public/label";
|
||||||
|
|
||||||
export const dashboard = css`
|
export const dashboard = css`
|
||||||
// 首页仪表板, 避免选中管理员后台的维护管理面板
|
// 首页仪表板, 避免选中管理员后台的维护管理面板
|
||||||
@@ -38,6 +39,9 @@ export const dashboard = css`
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
background-color: unset !important;
|
background-color: unset !important;
|
||||||
margin-bottom: 0.25rem;
|
margin-bottom: 0.25rem;
|
||||||
|
.ui.label {
|
||||||
|
border-color: #00000000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 仓库/组织列表
|
// 仓库/组织列表
|
||||||
.ui.attached.segment {
|
.ui.attached.segment {
|
||||||
@@ -47,6 +51,13 @@ export const dashboard = css`
|
|||||||
&.repos-search {
|
&.repos-search {
|
||||||
border-top-left-radius: 12px;
|
border-top-left-radius: 12px;
|
||||||
border-top-right-radius: 12px;
|
border-top-right-radius: 12px;
|
||||||
|
> .menu.repos-filter {
|
||||||
|
.ui.circular.label {
|
||||||
|
border-color: #00000000;
|
||||||
|
min-height: fit-content;
|
||||||
|
padding: ${labelStyle.padding} !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.table {
|
&.table {
|
||||||
&:last-child {
|
&:last-child {
|
||||||
@@ -58,6 +69,7 @@ export const dashboard = css`
|
|||||||
li {
|
li {
|
||||||
border-radius: ${otherThemeVars.border.radius};
|
border-radius: ${otherThemeVars.border.radius};
|
||||||
padding: 6px 8px !important;
|
padding: 6px 8px !important;
|
||||||
|
height: 32px;
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,8 +107,19 @@ export const diff = css`
|
|||||||
&.code-diff-split colgroup col:nth-child(2),
|
&.code-diff-split colgroup col:nth-child(2),
|
||||||
&.code-diff-split colgroup col:nth-child(6),
|
&.code-diff-split colgroup col:nth-child(6),
|
||||||
td.lines-escape {
|
td.lines-escape {
|
||||||
width: 0; // 不要使用 display: none; 否则会影响布局
|
width: 0; // 不要使用 display: none; 否则会影响布局, 无内容时为 0, 有内容时为 20(猜测可能是根据内容宽度自动调整)
|
||||||
visibility: hidden;
|
/* visibility: hidden; */ // 不要使用 visibility: hidden; 当 escape 有内容时会导致背景颜色丢失, escape 目前用于显示检测 unicode 编码错误的内容
|
||||||
|
}
|
||||||
|
// 修复当 escape 有内容时, 宽度不够的问题
|
||||||
|
&:has(td.lines-escape:not(:empty)) {
|
||||||
|
// 合并视图的第三列
|
||||||
|
&.code-diff-unified colgroup col:nth-child(3),
|
||||||
|
// 拆分视图的第二列和第六列
|
||||||
|
&.code-diff-split colgroup col:nth-child(2),
|
||||||
|
&.code-diff-split colgroup col:nth-child(6),
|
||||||
|
td.lines-escape {
|
||||||
|
width: 20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Gitea 分列视图下默认 100% 宽度的目的是如果单文件只增加或只删除的情况下, 保持无内容的列的宽度一致, 始终保持左右两边的列宽度一致
|
// Gitea 分列视图下默认 100% 宽度的目的是如果单文件只增加或只删除的情况下, 保持无内容的列的宽度一致, 始终保持左右两边的列宽度一致
|
||||||
// 保持 Gitea 的默认设置, 不对行号宽度做处理
|
// 保持 Gitea 的默认设置, 不对行号宽度做处理
|
||||||
|
|||||||
@@ -316,6 +316,10 @@ export const repoFileView = css`
|
|||||||
&:last-of-type {
|
&:last-of-type {
|
||||||
border-top-right-radius: ${otherThemeVars.border.radius};
|
border-top-right-radius: ${otherThemeVars.border.radius};
|
||||||
border-bottom-right-radius: ${otherThemeVars.border.radius};
|
border-bottom-right-radius: ${otherThemeVars.border.radius};
|
||||||
|
// 与无权限按钮之间的间距
|
||||||
|
+ .btn-octicon.disabled {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
background: ${themeVars.color.hover.self};
|
background: ${themeVars.color.hover.self};
|
||||||
@@ -395,18 +399,19 @@ export const repoSidebarTop = css`
|
|||||||
padding: 10px 0 0 0;
|
padding: 10px 0 0 0;
|
||||||
// 仓库描述本身
|
// 仓库描述本身
|
||||||
.flex-item-title {
|
.flex-item-title {
|
||||||
margin-top: 12px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
// 仓库描述内容
|
// 仓库描述内容
|
||||||
.flex-item-body {
|
.flex-item-body {
|
||||||
> .tw-flex:first-child {
|
> .tw-flex:first-child {
|
||||||
margin-top: 21px !important;
|
margin-top: 16px !important;
|
||||||
|
gap: 8px !important;
|
||||||
}
|
}
|
||||||
.repo-description {
|
.repo-description {
|
||||||
color: ${themeVars.color.text.self};
|
color: ${themeVars.color.text.self};
|
||||||
}
|
}
|
||||||
#repo-topics {
|
#repo-topics {
|
||||||
margin: 10px 0px !important;
|
margin: 8px 0px !important;
|
||||||
}
|
}
|
||||||
.flex-text-block {
|
.flex-text-block {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -444,7 +449,6 @@ export const repoSidebarBottom = css`
|
|||||||
.flex-item-leading {
|
.flex-item-leading {
|
||||||
svg.svg.octicon-tag {
|
svg.svg.octicon-tag {
|
||||||
color: ${themeVars.color.green.self};
|
color: ${themeVars.color.green.self};
|
||||||
margin-top: 2px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.flex-item-header .flex-item-title {
|
.flex-item-header .flex-item-title {
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ export const prBranch = css`
|
|||||||
font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace);
|
font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
line-height: 20px;
|
line-height: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.repository.view.issue .pull-desc code {
|
.repository.view.issue .pull-desc code {
|
||||||
@@ -592,6 +592,8 @@ export const issueSidebar = css`
|
|||||||
color: ${themeVars.color.text.light.num1};
|
color: ${themeVars.color.text.light.num1};
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
// WIP 前缀提示
|
||||||
|
> a,
|
||||||
.ui.dropdown.select-branch,
|
.ui.dropdown.select-branch,
|
||||||
.ui.form,
|
.ui.form,
|
||||||
a.fixed-text.muted,
|
a.fixed-text.muted,
|
||||||
|
|||||||
@@ -4,8 +4,12 @@ import { css, customThemeVars, otherThemeVars, themeVars } from "src/types/vars"
|
|||||||
export const navbarRight = css`
|
export const navbarRight = css`
|
||||||
#navbar {
|
#navbar {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
padding: 0px 16px;
|
padding: 8px 16px; // 上下内边距 + .navbar-left & .navbar-right 的 min-height = 64px
|
||||||
min-height: 64px;
|
min-height: 64px;
|
||||||
|
.navbar-left,
|
||||||
|
.navbar-right {
|
||||||
|
min-height: 48px;
|
||||||
|
}
|
||||||
.navbar-left {
|
.navbar-left {
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
> .item {
|
> .item {
|
||||||
@@ -32,15 +36,12 @@ export const navbarRight = css`
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
// 右侧按钮, 但不包括头像
|
// 右侧按钮, 但不包括头像
|
||||||
> .item:not(:last-child) {
|
> .item:not(:last-child) {
|
||||||
display: grid;
|
|
||||||
gap: 4px;
|
|
||||||
grid-auto-columns: max-content;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-content: center;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
gap: 4px;
|
||||||
border: 1px solid ${themeVars.color.light.border};
|
border: 1px solid ${themeVars.color.light.border};
|
||||||
border-radius: ${otherThemeVars.border.radius};
|
border-radius: ${otherThemeVars.border.radius};
|
||||||
padding: unset;
|
padding: 0;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
min-width: 32px;
|
min-width: 32px;
|
||||||
min-height: 32px;
|
min-height: 32px;
|
||||||
@@ -127,13 +128,33 @@ export const navbarRight = css`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 手机下的创建菜单按钮
|
// 手机下的导航栏
|
||||||
@media (max-width: 767.98px) {
|
@media (max-width: 767.98px) {
|
||||||
#navbar .navbar-right:has(.user-menu) > .item:not(:last-child) {
|
#navbar {
|
||||||
display: none;
|
&.navbar-menu-open {
|
||||||
}
|
gap: 8px;
|
||||||
#navbar.navbar-menu-open .navbar-right:has(.user-menu) > .item:not(:last-child) {
|
}
|
||||||
display: grid;
|
.navbar-mobile-right {
|
||||||
|
gap: 8px;
|
||||||
|
> .item {
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 1px solid ${themeVars.color.light.border};
|
||||||
|
border-radius: ${otherThemeVars.border.radius};
|
||||||
|
padding: 0;
|
||||||
|
height: 32px;
|
||||||
|
min-width: 32px;
|
||||||
|
min-height: 32px;
|
||||||
|
// 纠正内容保证居中
|
||||||
|
.tw-relative {
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
}
|
||||||
|
.svg {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export const notification = css`
|
|||||||
box-shadow: 2px 0 0 ${themeVars.github.borderColor.accent.emphasis} inset;
|
box-shadow: 2px 0 0 ${themeVars.github.borderColor.accent.emphasis} inset;
|
||||||
color: ${themeVars.color.text.self};
|
color: ${themeVars.color.text.self};
|
||||||
}
|
}
|
||||||
> .notifications-link > div{
|
> .notifications-link > div {
|
||||||
&:first-child {
|
&:first-child {
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,24 @@ import { css, themeVars } from "src/types/vars";
|
|||||||
|
|
||||||
export const org = css`
|
export const org = css`
|
||||||
.page-content.organization {
|
.page-content.organization {
|
||||||
|
// 组织成员头像
|
||||||
|
.members .ui.avatar {
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
// 组织头像
|
||||||
|
.org-avatar {
|
||||||
|
margin: 8px 24px 16px 0px;
|
||||||
|
}
|
||||||
|
// 组织信息
|
||||||
#org-info {
|
#org-info {
|
||||||
.ui.header {
|
margin-top: 8px; // 与头像对齐
|
||||||
|
gap: 8px;
|
||||||
|
// 组织名称
|
||||||
|
> .ui.header {
|
||||||
|
font-size: 24px;
|
||||||
|
> .org-visibility {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
// 组织页面的 RSS 订阅按钮
|
// 组织页面的 RSS 订阅按钮
|
||||||
.ui.label.button {
|
.ui.label.button {
|
||||||
padding: 4px 16px;
|
padding: 4px 16px;
|
||||||
@@ -16,6 +32,17 @@ export const org = css`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 组织描述
|
||||||
|
> .markup {
|
||||||
|
color: ${themeVars.color.text.light.num1};
|
||||||
|
}
|
||||||
|
// 组织信息
|
||||||
|
> .meta {
|
||||||
|
font-size: 12px;
|
||||||
|
svg {
|
||||||
|
color: ${themeVars.color.text.light.num1};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -50,8 +50,9 @@ export const packagesDetail = css`
|
|||||||
.issue-title-header > div {
|
.issue-title-header > div {
|
||||||
color: ${themeVars.color.text.light.num1};
|
color: ${themeVars.color.text.light.num1};
|
||||||
}
|
}
|
||||||
.issue-content {
|
.packages-content {
|
||||||
.issue-content-left {
|
.packages-content-left {
|
||||||
|
width: calc(100% - 304px - 16px);
|
||||||
.ui.top.attached.header {
|
.ui.top.attached.header {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -79,9 +80,10 @@ export const packagesDetail = css`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.issue-content-right {
|
.packages-content-right {
|
||||||
border: 0;
|
border: 0;
|
||||||
padding: 0px 16px;
|
padding: 0px 16px;
|
||||||
|
width: 304px;
|
||||||
> strong {
|
> strong {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ export const repoHeader = css`
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: ${themeVars.color.text.self};
|
color: ${themeVars.color.text.self};
|
||||||
font-size: 16px;
|
font-size: 18px;
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
min-width: 3ch;
|
min-width: 3ch;
|
||||||
padding: 4px 6px;
|
padding: 0px 6px;
|
||||||
border-radius: ${otherThemeVars.border.radius};
|
border-radius: ${otherThemeVars.border.radius};
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
@@ -74,7 +74,8 @@ export const repoTopic = css`
|
|||||||
border-radius: 9999px;
|
border-radius: 9999px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
padding: 2.5px 10px;
|
padding: 0px 10px;
|
||||||
|
line-height: 22px;
|
||||||
background-color: ${themeVars.github.bgColor.accent.muted};
|
background-color: ${themeVars.github.bgColor.accent.muted};
|
||||||
color: ${themeVars.github.fgColor.accent};
|
color: ${themeVars.github.fgColor.accent};
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
@@ -83,3 +83,12 @@ export const label = css`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
// 修复组织设置界面的组织设置中多余的边框
|
||||||
|
export const fixOrgSetting = css`
|
||||||
|
.page-content.organization.settings {
|
||||||
|
.org-setting-content {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { css } from "src/types/vars";
|
|||||||
|
|
||||||
export const body = css`
|
export const body = css`
|
||||||
body {
|
body {
|
||||||
line-height: 18px;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
text-underline-offset: 0.2rem; // 0.2rem 可以始终保持下划线不受 overflow: hidden 的影响
|
text-underline-offset: 0.2rem; // 0.2rem 可以始终保持下划线不受 overflow: hidden 的影响
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import "./base"; // 基础样式, 确保在其他样式之前导入
|
|||||||
import "./radius"; // 圆角, 此样式为基础样式, 确保在其他样式之前导入
|
import "./radius"; // 圆角, 此样式为基础样式, 确保在其他样式之前导入
|
||||||
import "./animation"; // 动画效果
|
import "./animation"; // 动画效果
|
||||||
import "./transition"; // 过渡效果
|
import "./transition"; // 过渡效果
|
||||||
|
import "./table"; // 表格
|
||||||
import "./text"; // 文本或 SVG 的基本颜色
|
import "./text"; // 文本或 SVG 的基本颜色
|
||||||
import "./button"; // 按钮
|
import "./button"; // 按钮
|
||||||
import "./dropdown"; // 下拉框
|
import "./dropdown"; // 下拉框
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export const input = css`
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
// 下拉菜单的输入框
|
// 下拉菜单的输入框
|
||||||
.ui.dropdown.dropdown .menu>.input {
|
.ui.dropdown.dropdown .menu > .input {
|
||||||
margin: 12px 10px;
|
margin: 12px 10px;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
import { css, themeVars } from "src/types/vars";
|
import { css, themeVars } from "src/types/vars";
|
||||||
|
|
||||||
|
export const labelStyle = {
|
||||||
|
padding: "0px 6px",
|
||||||
|
};
|
||||||
|
|
||||||
export const label = css`
|
export const label = css`
|
||||||
|
.ui.label {
|
||||||
|
border: 1px solid #00000000;
|
||||||
|
}
|
||||||
/* 所有标签, 但不包括 a 标签 */
|
/* 所有标签, 但不包括 a 标签 */
|
||||||
/* a 标签比如仓库点星等按钮旁边的数字标签按钮,提交图中的 tag 标签 */
|
/* a 标签比如仓库点星等按钮旁边的数字标签按钮,提交图中的 tag 标签 */
|
||||||
div.label,
|
div.label,
|
||||||
@@ -9,7 +16,11 @@ export const label = css`
|
|||||||
span.labels-list a.label {
|
span.labels-list a.label {
|
||||||
&.ui.ui.ui {
|
&.ui.ui.ui {
|
||||||
border-radius: 9999px;
|
border-radius: 9999px;
|
||||||
padding: 1.5px 6px;
|
${labelStyle}
|
||||||
|
line-height: 18px;
|
||||||
|
&.mini {
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
// 多个标签的组合标签的圆角修复
|
// 多个标签的组合标签的圆角修复
|
||||||
&.scope-parent {
|
&.scope-parent {
|
||||||
.scope-left {
|
.scope-left {
|
||||||
@@ -103,7 +114,6 @@ export const shaLabel = css`
|
|||||||
background-color: ${themeVars.color.label.hoverBg} !important;
|
background-color: ${themeVars.color.label.hoverBg} !important;
|
||||||
}
|
}
|
||||||
span.ui.label.commit-is-signed {
|
span.ui.label.commit-is-signed {
|
||||||
padding: 3px 5px;
|
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
}
|
}
|
||||||
@@ -118,6 +128,7 @@ export const shaLabel = css`
|
|||||||
}
|
}
|
||||||
// 验证提交附带的图标
|
// 验证提交附带的图标
|
||||||
span.ui.label.commit-is-signed {
|
span.ui.label.commit-is-signed {
|
||||||
|
height: 25px;
|
||||||
// 验证信任
|
// 验证信任
|
||||||
&.sign-trusted {
|
&.sign-trusted {
|
||||||
border: 1.5px solid ${themeVars.color.green.badge.self} !important;
|
border: 1.5px solid ${themeVars.color.green.badge.self} !important;
|
||||||
@@ -151,6 +162,11 @@ export const shaLabel = css`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
span.ui.label.commit-is-signed,
|
||||||
|
.ui.label.commit-id-short,
|
||||||
|
.ui.label.commit-sign-badge {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// 任务状态标签, 目前仅在管理员页面 Runner 状态中看到
|
// 任务状态标签, 目前仅在管理员页面 Runner 状态中看到
|
||||||
@@ -194,10 +210,6 @@ export const repoLabel = css`
|
|||||||
color: ${themeVars.color.text.light.num1};
|
color: ${themeVars.color.text.light.num1};
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
padding: 1.5px 6px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.org-visibility span.ui.basic.label {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
import { css, otherThemeVars, themeVars } from "src/types/vars";
|
||||||
|
import { labelStyle } from "./label";
|
||||||
|
|
||||||
export const activeItemAfterStyle = {
|
export const activeItemAfterStyle = {
|
||||||
backgroundColor: themeVars.github.borderColor.accent.emphasis,
|
backgroundColor: themeVars.github.borderColor.accent.emphasis,
|
||||||
@@ -140,8 +141,8 @@ export const menu = css`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 菜单标签样式
|
// 菜单标签样式
|
||||||
.ui.menu .item>.label:not(.floating) {
|
.ui.menu .item > .label:not(.floating) {
|
||||||
padding: 1.5px 6px;
|
${labelStyle}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
8
styles/public/table.ts
Normal file
8
styles/public/table.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { css, themeVars } from "src/types/vars";
|
||||||
|
|
||||||
|
export const table = css`
|
||||||
|
.ui.table > tr > td,
|
||||||
|
.ui.table > tbody > tr > td {
|
||||||
|
border-top: 1px solid ${themeVars.color.secondary.alpha.num70};
|
||||||
|
}
|
||||||
|
`;
|
||||||
167
templates/base/head_navbar.tmpl
Normal file
167
templates/base/head_navbar.tmpl
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
|
||||||
|
<div class="navbar-left">
|
||||||
|
<!-- the logo -->
|
||||||
|
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
|
||||||
|
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
|
||||||
|
<div class="ui secondary menu navbar-mobile-right only-mobile">
|
||||||
|
{{template "base/head_navbar_icons" dict "PageGlobalData" .PageGlobalData}}
|
||||||
|
<button class="item ui icon mini button tw-m-0" id="navbar-expand-toggle" aria-label="{{ctx.Locale.Tr "home.nav_menu"}}">{{svg "octicon-three-bars"}}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- navbar links non-mobile -->
|
||||||
|
{{if and .IsSigned .MustChangePassword}}
|
||||||
|
{{/* No links */}}
|
||||||
|
{{else if .IsSigned}}
|
||||||
|
{{if not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled)}}
|
||||||
|
{{if .ShowMilestonesDashboardPage}}
|
||||||
|
<a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{ctx.Locale.Tr "milestones"}}</a>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
|
||||||
|
{{else if .IsLandingPageOrganizations}}
|
||||||
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{ctx.Locale.Tr "explore"}}</a>
|
||||||
|
{{else}}
|
||||||
|
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore"}}</a>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{template "custom/extra_links" .}}
|
||||||
|
|
||||||
|
{{if not .IsSigned}}
|
||||||
|
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">{{ctx.Locale.Tr "help"}}</a>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- the full dropdown menus -->
|
||||||
|
<div class="navbar-right">
|
||||||
|
{{if and .IsSigned .MustChangePassword}}
|
||||||
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
||||||
|
<span class="text">
|
||||||
|
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
|
||||||
|
<span class="only-mobile">{{.SignedUser.Name}}</span>
|
||||||
|
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
|
||||||
|
</span>
|
||||||
|
<div class="menu user-menu">
|
||||||
|
<div class="header">
|
||||||
|
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
||||||
|
{{svg "octicon-sign-out"}}
|
||||||
|
{{ctx.Locale.Tr "sign_out"}}
|
||||||
|
</a>
|
||||||
|
</div><!-- end content avatar menu -->
|
||||||
|
</div><!-- end dropdown avatar menu -->
|
||||||
|
{{else if .IsSigned}}
|
||||||
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "create_new"}}">
|
||||||
|
<span class="text">
|
||||||
|
{{svg "octicon-plus"}}
|
||||||
|
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
|
||||||
|
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
|
||||||
|
</span>
|
||||||
|
<div class="menu">
|
||||||
|
<a class="item" href="{{AppSubUrl}}/repo/create">
|
||||||
|
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
|
||||||
|
</a>
|
||||||
|
{{if not .DisableMigrations}}
|
||||||
|
<a class="item" href="{{AppSubUrl}}/repo/migrate">
|
||||||
|
{{svg "octicon-repo-push"}} {{ctx.Locale.Tr "new_migrate"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{if .SignedUser.CanCreateOrganization}}
|
||||||
|
<a class="item" href="{{AppSubUrl}}/org/create">
|
||||||
|
{{svg "octicon-organization"}} {{ctx.Locale.Tr "new_org"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div><!-- end content create new menu -->
|
||||||
|
</div><!-- end dropdown menu create new -->
|
||||||
|
{{template "base/head_navbar_icons" dict "ItemExtraClass" "not-mobile" "PageGlobalData" .PageGlobalData}}
|
||||||
|
|
||||||
|
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
|
||||||
|
<span class="text">
|
||||||
|
{{ctx.AvatarUtils.Avatar .SignedUser 24 "tw-mr-1"}}
|
||||||
|
<span class="only-mobile">{{.SignedUser.Name}}</span>
|
||||||
|
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
|
||||||
|
</span>
|
||||||
|
<div class="menu user-menu">
|
||||||
|
<div class="header">
|
||||||
|
{{ctx.Locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
<a class="item" href="{{.SignedUser.HomeLink}}">
|
||||||
|
{{svg "octicon-person"}}
|
||||||
|
{{ctx.Locale.Tr "your_profile"}}
|
||||||
|
</a>
|
||||||
|
{{if not .DisableStars}}
|
||||||
|
<a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
|
||||||
|
{{svg "octicon-star"}}
|
||||||
|
{{ctx.Locale.Tr "your_starred"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
<a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
|
||||||
|
{{svg "octicon-bell"}}
|
||||||
|
{{ctx.Locale.Tr "notification.subscriptions"}}
|
||||||
|
</a>
|
||||||
|
<a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
||||||
|
{{svg "octicon-tools"}}
|
||||||
|
{{ctx.Locale.Tr "your_settings"}}
|
||||||
|
</a>
|
||||||
|
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.com">
|
||||||
|
{{svg "octicon-question"}}
|
||||||
|
{{ctx.Locale.Tr "help"}}
|
||||||
|
</a>
|
||||||
|
<div class="divider"></div>
|
||||||
|
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
||||||
|
{{svg "octicon-sign-out"}}
|
||||||
|
{{ctx.Locale.Tr "sign_out"}}
|
||||||
|
</a>
|
||||||
|
</div><!-- end content avatar menu -->
|
||||||
|
</div><!-- end dropdown avatar menu -->
|
||||||
|
{{else}}
|
||||||
|
{{if .ShowRegistrationButton}}
|
||||||
|
<a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
|
||||||
|
{{svg "octicon-person"}}
|
||||||
|
<span class="tw-ml-1">{{ctx.Locale.Tr "register"}}</span>
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
|
||||||
|
{{svg "octicon-sign-in"}}
|
||||||
|
<span class="tw-ml-1">{{ctx.Locale.Tr "sign_in"}}</span>
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
</div><!-- end full right menu -->
|
||||||
|
|
||||||
|
{{$activeStopwatch := and .PageGlobalData (call .PageGlobalData.GetActiveStopwatch)}}
|
||||||
|
{{if $activeStopwatch}}
|
||||||
|
<div class="active-stopwatch-popup tippy-target">
|
||||||
|
<div class="tw-flex tw-items-center tw-gap-2 tw-p-3">
|
||||||
|
<a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{$activeStopwatch.IssueLink}}">
|
||||||
|
{{svg "octicon-issue-opened" 16}}
|
||||||
|
<span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
|
||||||
|
</a>
|
||||||
|
<div class="tw-flex tw-gap-1">
|
||||||
|
<form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
|
||||||
|
{{.CsrfTokenHtml}}
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="ui button mini compact basic icon tw-mr-0"
|
||||||
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
|
||||||
|
>{{svg "octicon-square-fill"}}</button>
|
||||||
|
</form>
|
||||||
|
<form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel">
|
||||||
|
{{.CsrfTokenHtml}}
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="ui button mini compact basic icon tw-mr-0"
|
||||||
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
|
||||||
|
>{{svg "octicon-trash"}}</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</nav>
|
||||||
35
templates/base/head_navbar_icons.tmpl
Normal file
35
templates/base/head_navbar_icons.tmpl
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{{- $itemExtraClass := .ItemExtraClass -}}
|
||||||
|
{{- $data := .PageGlobalData -}}
|
||||||
|
{{if and $data $data.IsSigned}}{{/* data may not exist, for example: rendering 503 page before the PageGlobalData middleware */}}
|
||||||
|
{{- $activeStopwatch := call $data.GetActiveStopwatch -}}
|
||||||
|
{{- $notificationUnreadCount := call $data.GetNotificationUnreadCount -}}
|
||||||
|
{{if $activeStopwatch}}
|
||||||
|
<a class="item active-stopwatch {{$itemExtraClass}}" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
|
||||||
|
<div class="tw-relative">
|
||||||
|
{{svg "octicon-stopwatch"}}
|
||||||
|
<span class="header-stopwatch-dot"></span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
|
||||||
|
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/issues" data-tooltip-content="{{ctx.Locale.Tr "issues"}}">
|
||||||
|
{{svg "octicon-issue-opened"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
|
||||||
|
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/pulls" data-tooltip-content="{{ctx.Locale.Tr "pull_requests"}}">
|
||||||
|
{{svg "octicon-git-pull-request"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}">
|
||||||
|
<div class="tw-relative tw-h-[16px]">
|
||||||
|
{{svg "octicon-inbox"}}
|
||||||
|
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{{if $data.IsSiteAdmin}}
|
||||||
|
<a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/-/admin" data-tooltip-content="{{ctx.Locale.Tr "admin_panel"}}">
|
||||||
|
{{svg "octicon-server"}}
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
Reference in New Issue
Block a user