Skip to content

Commit 1f3ed03

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: docs: template variables (go-gitea#26547) [skip ci] Updated translations via Crowdin Rewrite the DiffFileTreeItem and fix misalignment (go-gitea#26565) Allow text selection in actions step header (go-gitea#26588) Bump xgo to go-1.21.x and node to 20 in release-version (go-gitea#26589) Add minimum polyfill to support "relative-time-element" in PaleMoon (go-gitea#26575)
2 parents 557ecc5 + 8f93648 commit 1f3ed03

File tree

8 files changed

+106
-117
lines changed

8 files changed

+106
-117
lines changed

.drone.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ steps:
4141
path: /go
4242

4343
- name: static
44-
image: techknowlogick/xgo:go-1.20.x
44+
image: techknowlogick/xgo:go-1.21.x
4545
pull: always
4646
commands:
47-
# Upgrade to node 20 once https://github.com/techknowlogick/xgo/issues/163 is resolved
48-
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
47+
- curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get -qqy install nodejs
4948
- export PATH=$PATH:$GOPATH/bin
5049
- make release
5150
environment:

docs/content/administration/customizing-gitea.en-us.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,17 @@ Apart from `extra_links.tmpl` and `extra_tabs.tmpl`, there are other useful temp
126126
- `body_outer_post.tmpl`, before the bottom `<footer>` element.
127127
- `footer.tmpl`, right before the end of the `<body>` tag, a good place for additional JavaScript.
128128

129-
#### Example: PlantUML
129+
### Using Gitea variables
130+
131+
It's possible to use various Gitea variables in your custom templates.
132+
133+
First, _temporarily_ enable development mode: in your `app.ini` change from `RUN_MODE = prod` to `RUN_MODE = dev`. Then add `{{ $ | DumpVar }}` to any of your templates, restart Gitea and refresh that page; that will dump all available variables.
134+
135+
Find the data that you need, and use the corresponding variable; for example, if you need the name of the repository then you'd use `{{.Repository.Name}}`.
136+
137+
If you need to transform that data somehow, and aren't familiar with Go, an easy workaround is to add the data to the DOM and add a small JavaScript script block to manipulate the data.
138+
139+
### Example: PlantUML
130140

131141
You can add [PlantUML](https://plantuml.com/) support to Gitea's markdown by using a PlantUML server.
132142
The data is encoded and sent to the PlantUML server which generates the picture. There is an online
@@ -162,7 +172,7 @@ Alice <-- Bob: Another authentication Response
162172

163173
The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`.
164174

165-
#### Example: STL Preview
175+
### Example: STL Preview
166176

167177
You can display STL file directly in Gitea by adding:
168178

options/locale/locale_zh-TW.ini

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ milestones=里程碑
7979

8080
ok=確認
8181
cancel=取消
82+
retry=重試
8283
save=儲存
8384
add=增加
8485
add_all=全部增加
@@ -113,6 +114,8 @@ unknown=未知
113114

114115
rss_feed=RSS 摘要
115116

117+
pin=固定
118+
unpin=取消固定
116119

117120

118121
concept_code_repository=儲存庫
@@ -461,6 +464,7 @@ team_invite.text_3=備註: 這是寄給 %[1]s 的邀請。若您未預期收到
461464
[modal]
462465
yes=是
463466
no=否
467+
confirm=確定
464468
cancel=取消
465469
modify=更新
466470

@@ -644,6 +648,7 @@ update_user_avatar_success=已更新使用者的大頭貼。
644648
change_password=更新密碼
645649
old_password=目前的密碼
646650
new_password=新的密碼
651+
retype_new_password=確認新密碼
647652
password_incorrect=輸入的密碼不正確!
648653
change_password_success=您的密碼已更新。 從現在起使用您的新密碼登入。
649654
password_change_disabled=非本地帳戶無法透過 Gitea 的網頁介面更改密碼。
@@ -767,7 +772,7 @@ access_token_deletion_confirm_action=刪除
767772
access_token_deletion_desc=刪除 Token 後,使用此 Token 的應用程式將無法再存取您的帳戶,此動作不可還原。是否繼續?
768773
delete_token_success=已刪除 Token。使用此 Token 的應用程式無法再存取您的帳戶。
769774
permission_no_access=沒有權限
770-
permission_read=已讀
775+
permission_read=讀取
771776

772777
manage_oauth2_applications=管理 OAuth2 應用程式
773778
edit_oauth2_application=編輯 OAuth2 應用程式
@@ -1289,6 +1294,7 @@ issues.delete_branch_at=`刪除分支 <b>%s</b> %s`
12891294
issues.filter_label=標籤
12901295
issues.filter_label_exclude=`使用 <code>alt</code> + <code>click/enter</code> 來排除標籤`
12911296
issues.filter_label_no_select=所有標籤
1297+
issues.filter_label_select_no_label=沒有標籤
12921298
issues.filter_milestone=里程碑
12931299
issues.filter_project=專案
12941300
issues.filter_project_all=所有專案
@@ -1397,6 +1403,10 @@ issues.attachment.open_tab=`在新分頁中查看「%s」`
13971403
issues.attachment.download=`點擊下載「%s」`
13981404
issues.subscribe=訂閱
13991405
issues.unsubscribe=取消訂閱
1406+
issues.unpin_issue=取消固定問題
1407+
issues.max_pinned=您不能固定更多問題
1408+
issues.pin_comment=固定於 %s
1409+
issues.unpin_comment=取消固定於 %s
14001410
issues.lock=鎖定對話
14011411
issues.unlock=解鎖對話
14021412
issues.lock.unknown_reason=由於未知的原因而無法鎖定問題。
@@ -1954,10 +1964,10 @@ settings.http_method=HTTP 請求方法
19541964
settings.content_type=POST Content Type
19551965
settings.secret=Secret
19561966
settings.slack_username=服務名稱
1957-
settings.slack_icon_url=圖標 URL
1967+
settings.slack_icon_url=圖示 URL
19581968
settings.slack_color=顏色
19591969
settings.discord_username=使用者名稱
1960-
settings.discord_icon_url=Icon URL
1970+
settings.discord_icon_url=圖示 URL
19611971
settings.event_desc=觸發條件:
19621972
settings.event_push_only=推送事件
19631973
settings.event_send_everything=所有事件
@@ -2065,6 +2075,8 @@ settings.protect_disable_push=停用推送
20652075
settings.protect_disable_push_desc=不允許推送到此分支。
20662076
settings.protect_enable_push=啟用推送
20672077
settings.protect_enable_push_desc=任何擁有寫入權限的使用者將可推送至該分支(但不可使用force push)。
2078+
settings.protect_enable_merge=啟用合併
2079+
settings.protect_enable_merge_desc=任何有寫入權限的人都可將合併請求合併到此分支
20682080
settings.protect_whitelist_committers=使用白名單控管推送
20692081
settings.protect_whitelist_committers_desc=僅允許白名單內的使用者或團隊推送至該分支(但不可使用force push)。
20702082
settings.protect_whitelist_deploy_keys=將擁有寫入權限的部署金鑰加入白名單。
@@ -3058,9 +3070,14 @@ versions=版本
30583070
versions.view_all=檢視全部
30593071
dependency.id=ID
30603072
dependency.version=版本
3073+
alpine.registry=在您的 <code>/etc/apk/repositories</code> 檔加入下列 URL 以設定此註冊中心:
3074+
alpine.registry.key=下載註冊中心的公開 RSA 金鑰到 <code>/etc/apk/keys/</code> 資料夾來驗證索引簽署:
3075+
alpine.registry.info=從下列清單選擇 $branch 和 $repository
30613076
alpine.install=執行下列命令安裝此套件:
3077+
alpine.repository=儲存庫資訊
30623078
alpine.repository.branches=分支
30633079
alpine.repository.repositories=儲存庫
3080+
alpine.repository.architectures=架構
30643081
cargo.registry=在 Cargo 組態檔設定此註冊中心 (例如: <code>~/.cargo/config.toml</code>):
30653082
cargo.install=執行下列命令以使用 Cargo 安裝此套件:
30663083
cargo.details.repository_site=儲存庫網站
@@ -3090,6 +3107,8 @@ container.labels.value=值
30903107
cran.install=執行下列命令安裝此套件:
30913108
debian.registry=透過下列命令設定此註冊中心:
30923109
debian.install=執行下列命令安裝此套件:
3110+
debian.repository=儲存庫資訊
3111+
debian.repository.architectures=架構
30933112
generic.download=透過下列命令下載套件:
30943113
helm.registry=透過下列命令設定此註冊中心:
30953114
helm.install=執行下列命令安裝此套件:
@@ -3230,7 +3249,12 @@ runs.commit=提交
32303249
runs.invalid_workflow_helper=工作流程設定檔無效。請檢查您的設定檔: %s
32313250
runs.no_matching_runner_helper=找不到符合的 Runner: %s
32323251
runs.status=狀態
3252+
runs.no_runs=工作流程沒有執行過。
32333253

3254+
workflow.disable=停用工作流程
3255+
workflow.disable_success=已成功停用工作流程「%s」。
3256+
workflow.enable=啟用工作流程
3257+
workflow.enable_success=已成功啟用工作流程「%s」。
32343258

32353259
need_approval_desc=來自 Frok 儲存庫的合併請求需要核可才能執行工作流程。
32363260

web_src/js/components/DiffFileTree.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<template>
22
<div v-if="store.fileTreeIsVisible" class="gt-mr-3 gt-mt-3 diff-detail-box">
33
<!-- only render the tree if we're visible. in many cases this is something that doesn't change very often -->
4-
<div class="ui list">
5-
<DiffFileTreeItem v-for="item in fileTree" :key="item.name" :item="item"/>
6-
</div>
4+
<DiffFileTreeItem v-for="item in fileTree" :key="item.name" :item="item"/>
75
<div v-if="store.isIncomplete" class="gt-pt-2">
86
<a :class="['ui', 'basic', 'tiny', 'button', store.isLoadingNewData ? 'disabled' : '']" @click.stop="loadMoreData">{{ store.showMoreMessage }}</a>
97
</div>
Lines changed: 45 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,24 @@
11
<template>
2-
<div v-show="show" :title="item.name">
3-
<!--title instead of tooltip above as the tooltip needs too much work with the current methods, i.e. not being loaded or staying open for "too long"-->
4-
<div class="item" :class="[item.isFile ? 'filewrapper gt-p-1 gt-ac' : '', store.selectedItem === '#diff-' + item.file?.NameHash ? 'selected' : '']">
5-
<!-- Files -->
6-
<SvgIcon
7-
v-if="item.isFile"
8-
name="octicon-file"
9-
class="svg-icon file"
10-
/>
11-
<a
12-
v-if="item.isFile"
13-
:class="['file gt-ellipsis', {'viewed': item.file.IsViewed}]"
14-
:href="item.isFile ? '#diff-' + item.file.NameHash : ''"
15-
>{{ item.name }}</a>
16-
<SvgIcon
17-
v-if="item.isFile"
18-
:name="getIconForDiffType(item.file.Type)"
19-
:class="['svg-icon', getIconForDiffType(item.file.Type), 'status']"
20-
/>
2+
<!--title instead of tooltip above as the tooltip needs too much work with the current methods, i.e. not being loaded or staying open for "too long"-->
3+
<a
4+
v-if="item.isFile" class="item-file"
5+
:class="{'selected': store.selectedItem === '#diff-' + item.file.NameHash, 'viewed': item.file.IsViewed}"
6+
:title="item.name" :href="'#diff-' + item.file.NameHash"
7+
>
8+
<!-- file -->
9+
<SvgIcon name="octicon-file"/>
10+
<span class="gt-ellipsis gt-f1">{{ item.name }}</span>
11+
<SvgIcon :name="getIconForDiffType(item.file.Type).name" :class="getIconForDiffType(item.file.Type).classes"/>
12+
</a>
13+
<div v-else class="item-directory" :title="item.name" @click.stop="collapsed = !collapsed">
14+
<!-- directory -->
15+
<SvgIcon :name="collapsed ? 'octicon-chevron-right' : 'octicon-chevron-down'"/>
16+
<SvgIcon class="text primary" name="octicon-file-directory-fill"/>
17+
<span class="gt-ellipsis">{{ item.name }}</span>
18+
</div>
2119

22-
<!-- Directories -->
23-
<div v-if="!item.isFile" class="directory gt-p-1 gt-ac" @click.stop="handleClick(item.isFile)">
24-
<SvgIcon
25-
class="svg-icon"
26-
:name="collapsed ? 'octicon-chevron-right' : 'octicon-chevron-down'"
27-
/>
28-
<SvgIcon
29-
class="svg-icon directory"
30-
name="octicon-file-directory-fill"
31-
/>
32-
<span class="gt-ellipsis">{{ item.name }}</span>
33-
</div>
34-
<div v-show="!collapsed">
35-
<DiffFileTreeItem v-for="childItem in item.children" :key="childItem.name" :item="childItem" class="list"/>
36-
</div>
37-
</div>
20+
<div v-if="item.children?.length" v-show="!collapsed" class="sub-items">
21+
<DiffFileTreeItem v-for="childItem in item.children" :key="childItem.name" :item="childItem"/>
3822
</div>
3923
</template>
4024

@@ -49,30 +33,19 @@ export default {
4933
type: Object,
5034
required: true
5135
},
52-
show: {
53-
type: Boolean,
54-
required: false,
55-
default: true
56-
},
5736
},
5837
data: () => ({
5938
store: diffTreeStore(),
6039
collapsed: false,
6140
}),
6241
methods: {
63-
handleClick(itemIsFile) {
64-
if (itemIsFile) {
65-
return;
66-
}
67-
this.collapsed = !this.collapsed;
68-
},
6942
getIconForDiffType(pType) {
7043
const diffTypes = {
71-
1: 'octicon-diff-added',
72-
2: 'octicon-diff-modified',
73-
3: 'octicon-diff-removed',
74-
4: 'octicon-diff-renamed',
75-
5: 'octicon-diff-modified', // there is no octicon for copied, so modified should be ok
44+
1: {name: 'octicon-diff-added', classes: ['text', 'green']},
45+
2: {name: 'octicon-diff-modified', classes: ['text', 'yellow']},
46+
3: {name: 'octicon-diff-removed', classes: ['text', 'red']},
47+
4: {name: 'octicon-diff-renamed', classes: ['text', 'teal']},
48+
5: {name: 'octicon-diff-renamed', classes: ['text', 'green']}, // there is no octicon for copied, so renamed should be ok
7649
};
7750
return diffTypes[pType];
7851
},
@@ -81,75 +54,42 @@ export default {
8154
</script>
8255

8356
<style scoped>
84-
.svg-icon.status {
85-
float: right;
86-
}
87-
88-
.svg-icon.file {
89-
color: var(--color-secondary-dark-7);
90-
}
91-
92-
.svg-icon.directory {
93-
color: var(--color-primary);
94-
}
95-
96-
.svg-icon.octicon-diff-modified {
97-
color: var(--color-yellow);
98-
}
99-
100-
.svg-icon.octicon-diff-added {
101-
color: var(--color-green);
102-
}
103-
104-
.svg-icon.octicon-diff-removed {
105-
color: var(--color-red);
57+
a, a:hover {
58+
text-decoration: none;
59+
color: var(--color-text);
10660
}
10761
108-
.svg-icon.octicon-diff-renamed {
109-
color: var(--color-teal);
62+
.sub-items {
63+
padding-left: 9px;
11064
}
11165
112-
.item.filewrapper {
113-
display: grid !important;
114-
grid-template-columns: 20px 7fr 1fr;
115-
padding-left: 18px !important;
66+
.item-file {
67+
margin-left: 20px;
11668
}
11769
118-
.item.filewrapper:hover, div.directory:hover {
119-
color: var(--color-text);
120-
background: var(--color-hover);
121-
border-radius: 4px;
122-
}
123-
124-
.item.filewrapper.selected {
70+
.item-file.selected {
12571
color: var(--color-text);
12672
background: var(--color-active);
12773
border-radius: 4px;
12874
}
12975
130-
div.directory {
131-
display: grid;
132-
grid-template-columns: 18px 20px auto;
133-
user-select: none;
134-
cursor: pointer;
135-
}
136-
137-
div.list {
138-
padding-bottom: 0 !important;
139-
padding-top: inherit !important;
76+
.item-file.viewed {
77+
color: var(--color-text-light-3);
14078
}
14179
142-
a {
143-
text-decoration: none;
144-
color: var(--color-text);
80+
.item-file,
81+
.item-directory {
82+
display: flex;
83+
align-items: center;
84+
gap: 0.25em;
85+
padding: 2px;
14586
}
14687
147-
a:hover {
148-
text-decoration: none;
88+
.item-file:hover,
89+
.item-directory:hover {
14990
color: var(--color-text);
150-
}
151-
152-
a.file.viewed {
153-
color: var(--color-text-light-3);
91+
background: var(--color-hover);
92+
border-radius: 4px;
93+
cursor: pointer;
15494
}
15595
</style>

web_src/js/components/RepoActionView.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ export function initRepositoryActionView() {
740740
padding: 5px 10px;
741741
display: flex;
742742
align-items: center;
743-
user-select: none;
744743
border-radius: var(--border-radius);
745744
}
746745

web_src/js/webcomponents/polyfill.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
try {
2+
// some browsers like PaleMoon don't have full support for Intl.NumberFormat, so do the minimum polyfill to support "relative-time-element"
3+
// https://repo.palemoon.org/MoonchildProductions/UXP/issues/2289
4+
new Intl.NumberFormat('en', {style: 'unit', unit: 'minute'}).format(1);
5+
} catch {
6+
const intlNumberFormat = Intl.NumberFormat;
7+
Intl.NumberFormat = function(locales, options) {
8+
if (options.style === 'unit') {
9+
return {
10+
format(value) {
11+
return ` ${value} ${options.unit}`;
12+
}
13+
};
14+
}
15+
return intlNumberFormat(locales, options);
16+
};
17+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import '@webcomponents/custom-elements'; // polyfill for some browsers like Pale Moon
2+
import './polyfill.js';
3+
24
import '@github/relative-time-element';
35
import './GiteaOriginUrl.js';

0 commit comments

Comments
 (0)