mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-17 00:01:00 -04:00
Compare commits
10 Commits
815d267c80
...
c35b16a9a4
Author | SHA1 | Date | |
---|---|---|---|
|
c35b16a9a4 | ||
|
19a1e1b20e | ||
|
98f2bf23bc | ||
|
4544b2a9a3 | ||
|
274c16e481 | ||
|
10aab8a385 | ||
|
45976a1bde | ||
|
1bb9b1c4d9 | ||
|
2590707122 | ||
|
5315153059 |
2
.github/workflows/files-changed.yml
vendored
2
.github/workflows/files-changed.yml
vendored
@ -81,4 +81,4 @@ jobs:
|
||||
- "Makefile"
|
||||
- "package.json"
|
||||
- "package-lock.json"
|
||||
- ".spectral.yml"
|
||||
- ".spectral.yaml"
|
||||
|
@ -121,8 +121,6 @@ If you have questions that are not covered by the documentation, you can get in
|
||||
|
||||
We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea).
|
||||
|
||||
The Hugo-based documentation theme is hosted at [gitea/theme](https://gitea.com/gitea/theme).
|
||||
|
||||
The official Gitea CLI is developed at [gitea/tea](https://gitea.com/gitea/tea).
|
||||
|
||||
## Authors
|
||||
|
@ -12,6 +12,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
)
|
||||
|
||||
@ -58,7 +59,7 @@ func main() {
|
||||
|
||||
// use old en-US as the base, and copy the new translations to the old locales
|
||||
enUsOld := inisOld["options/locale/locale_en-US.ini"]
|
||||
brokenWarned := map[string]bool{}
|
||||
brokenWarned := make(container.Set[string])
|
||||
for path, iniOld := range inisOld {
|
||||
if iniOld == enUsOld {
|
||||
continue
|
||||
@ -77,7 +78,7 @@ func main() {
|
||||
broken := oldStr != "" && strings.Count(oldStr, "%") != strings.Count(newStr, "%")
|
||||
broken = broken || strings.Contains(oldStr, "\n") || strings.Contains(oldStr, "\n")
|
||||
if broken {
|
||||
brokenWarned[secOld.Name()+"."+keyEnUs.Name()] = true
|
||||
brokenWarned.Add(secOld.Name() + "." + keyEnUs.Name())
|
||||
fmt.Println("----")
|
||||
fmt.Printf("WARNING: skip broken locale: %s , [%s] %s\n", path, secEnUS.Name(), keyEnUs.Name())
|
||||
fmt.Printf("\told: %s\n", strings.ReplaceAll(oldStr, "\n", "\\n"))
|
||||
@ -103,7 +104,7 @@ func main() {
|
||||
broken = broken || strings.HasPrefix(str, "`\"")
|
||||
broken = broken || strings.Count(str, `"`)%2 == 1
|
||||
broken = broken || strings.Count(str, "`")%2 == 1
|
||||
if broken && !brokenWarned[sec.Name()+"."+key.Name()] {
|
||||
if broken && !brokenWarned.Contains(sec.Name()+"."+key.Name()) {
|
||||
fmt.Printf("WARNING: found broken locale: %s , [%s] %s\n", path, sec.Name(), key.Name())
|
||||
fmt.Printf("\tstr: %s\n", strings.ReplaceAll(str, "\n", "\\n"))
|
||||
fmt.Println("----")
|
||||
|
@ -15,6 +15,8 @@ import (
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
)
|
||||
|
||||
// regexp is based on go-license, excluding README and NOTICE
|
||||
@ -55,20 +57,14 @@ func main() {
|
||||
// yml
|
||||
//
|
||||
// It could be removed once we have a better regex.
|
||||
excludedExt := map[string]bool{
|
||||
".gitignore": true,
|
||||
".go": true,
|
||||
".mod": true,
|
||||
".sum": true,
|
||||
".toml": true,
|
||||
".yml": true,
|
||||
}
|
||||
excludedExt := container.SetOf(".gitignore", ".go", ".mod", ".sum", ".toml", ".yml")
|
||||
|
||||
var paths []string
|
||||
err := filepath.WalkDir(base, func(path string, entry fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if entry.IsDir() || !licenseRe.MatchString(entry.Name()) || excludedExt[filepath.Ext(entry.Name())] {
|
||||
if entry.IsDir() || !licenseRe.MatchString(entry.Name()) || excludedExt.Contains(filepath.Ext(entry.Name())) {
|
||||
return nil
|
||||
}
|
||||
paths = append(paths, path)
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models/perm"
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
)
|
||||
@ -318,14 +319,13 @@ var (
|
||||
|
||||
// FindUnitTypes give the unit key names and return valid unique units and invalid keys
|
||||
func FindUnitTypes(nameKeys ...string) (res []Type, invalidKeys []string) {
|
||||
m := map[Type]struct{}{}
|
||||
m := make(container.Set[Type])
|
||||
for _, key := range nameKeys {
|
||||
t := TypeFromKey(key)
|
||||
if t == TypeInvalid {
|
||||
invalidKeys = append(invalidKeys, key)
|
||||
} else if _, ok := m[t]; !ok {
|
||||
} else if m.Add(t) {
|
||||
res = append(res, t)
|
||||
m[t] = struct{}{}
|
||||
}
|
||||
}
|
||||
return res, invalidKeys
|
||||
|
@ -16,6 +16,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/modules/validation"
|
||||
|
||||
"xorm.io/builder"
|
||||
)
|
||||
@ -161,7 +162,17 @@ func ValidateEmail(email string) error {
|
||||
return ErrEmailInvalid{email}
|
||||
}
|
||||
|
||||
// TODO: add an email allow/block list
|
||||
// if there is no allow list, then check email against block list
|
||||
if len(setting.Service.EmailDomainAllowList) == 0 &&
|
||||
validation.IsEmailDomainListed(setting.Service.EmailDomainBlockList, email) {
|
||||
return ErrEmailInvalid{email}
|
||||
}
|
||||
|
||||
// if there is an allow list, then check email against allow list
|
||||
if len(setting.Service.EmailDomainAllowList) > 0 &&
|
||||
!validation.IsEmailDomainListed(setting.Service.EmailDomainAllowList, email) {
|
||||
return ErrEmailInvalid{email}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/process"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
@ -130,7 +131,7 @@ func readDir(layer *Layer, name string) ([]fs.FileInfo, error) {
|
||||
// * false: only directories will be returned.
|
||||
// The returned files are sorted by name.
|
||||
func (l *LayeredFS) ListFiles(name string, fileMode ...bool) ([]string, error) {
|
||||
fileMap := map[string]bool{}
|
||||
fileSet := make(container.Set[string])
|
||||
for _, layer := range l.layers {
|
||||
infos, err := readDir(layer, name)
|
||||
if err != nil {
|
||||
@ -138,14 +139,11 @@ func (l *LayeredFS) ListFiles(name string, fileMode ...bool) ([]string, error) {
|
||||
}
|
||||
for _, info := range infos {
|
||||
if shouldInclude(info, fileMode...) {
|
||||
fileMap[info.Name()] = true
|
||||
fileSet.Add(info.Name())
|
||||
}
|
||||
}
|
||||
}
|
||||
files := make([]string, 0, len(fileMap))
|
||||
for file := range fileMap {
|
||||
files = append(files, file)
|
||||
}
|
||||
files := fileSet.Values()
|
||||
sort.Strings(files)
|
||||
return files, nil
|
||||
}
|
||||
@ -161,7 +159,7 @@ func (l *LayeredFS) ListAllFiles(name string, fileMode ...bool) ([]string, error
|
||||
}
|
||||
|
||||
func listAllFiles(layers []*Layer, name string, fileMode ...bool) ([]string, error) {
|
||||
fileMap := map[string]bool{}
|
||||
fileSet := make(container.Set[string])
|
||||
var list func(dir string) error
|
||||
list = func(dir string) error {
|
||||
for _, layer := range layers {
|
||||
@ -172,7 +170,7 @@ func listAllFiles(layers []*Layer, name string, fileMode ...bool) ([]string, err
|
||||
for _, info := range infos {
|
||||
path := util.PathJoinRelX(dir, info.Name())
|
||||
if shouldInclude(info, fileMode...) {
|
||||
fileMap[path] = true
|
||||
fileSet.Add(path)
|
||||
}
|
||||
if info.IsDir() {
|
||||
if err = list(path); err != nil {
|
||||
@ -186,10 +184,7 @@ func listAllFiles(layers []*Layer, name string, fileMode ...bool) ([]string, err
|
||||
if err := list(name); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var files []string
|
||||
for file := range fileMap {
|
||||
files = append(files, file)
|
||||
}
|
||||
files := fileSet.Values()
|
||||
sort.Strings(files)
|
||||
return files, nil
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"html/template"
|
||||
"reflect"
|
||||
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
)
|
||||
@ -51,7 +52,7 @@ func dict(args ...any) (map[string]any, error) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func dumpVarMarshalable(v any, dumped map[uintptr]bool) (ret any, ok bool) {
|
||||
func dumpVarMarshalable(v any, dumped container.Set[uintptr]) (ret any, ok bool) {
|
||||
if v == nil {
|
||||
return nil, true
|
||||
}
|
||||
@ -61,11 +62,10 @@ func dumpVarMarshalable(v any, dumped map[uintptr]bool) (ret any, ok bool) {
|
||||
}
|
||||
if e.CanAddr() {
|
||||
addr := e.UnsafeAddr()
|
||||
if dumped[addr] {
|
||||
if !dumped.Add(addr) {
|
||||
return "[dumped]", false
|
||||
}
|
||||
dumped[addr] = true
|
||||
defer delete(dumped, addr)
|
||||
defer dumped.Remove(addr)
|
||||
}
|
||||
switch e.Kind() {
|
||||
case reflect.Bool, reflect.String,
|
||||
@ -107,7 +107,7 @@ func dumpVar(v any) template.HTML {
|
||||
if setting.IsProd {
|
||||
return "<pre>dumpVar: only available in dev mode</pre>"
|
||||
}
|
||||
m, ok := dumpVarMarshalable(v, map[uintptr]bool{})
|
||||
m, ok := dumpVarMarshalable(v, make(container.Set[uintptr]))
|
||||
var dumpStr string
|
||||
jsonBytes, err := json.MarshalIndent(m, "", " ")
|
||||
if err != nil {
|
||||
|
@ -10,6 +10,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
|
||||
"github.com/gobwas/glob"
|
||||
)
|
||||
|
||||
var externalTrackerRegex = regexp.MustCompile(`({?)(?:user|repo|index)+?(}?)`)
|
||||
@ -48,6 +50,29 @@ func IsValidSiteURL(uri string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsEmailDomainListed checks whether the domain of an email address
|
||||
// matches a list of domains
|
||||
func IsEmailDomainListed(globs []glob.Glob, email string) bool {
|
||||
if len(globs) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
n := strings.LastIndex(email, "@")
|
||||
if n <= 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
domain := strings.ToLower(email[n+1:])
|
||||
|
||||
for _, g := range globs {
|
||||
if g.Match(domain) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// IsAPIURL checks if URL is current Gitea instance API URL
|
||||
func IsAPIURL(uri string) bool {
|
||||
return strings.HasPrefix(strings.ToLower(uri), strings.ToLower(setting.AppURL+"api"))
|
||||
|
@ -874,8 +874,10 @@ remove_account_link=連携アカウントの削除
|
||||
remove_account_link_desc=連携アカウントを削除し、Giteaアカウントへのアクセス権を取り消します。 続行しますか?
|
||||
remove_account_link_success=連携アカウントを削除しました。
|
||||
|
||||
hooks.desc=あなたが所有する<strong>すべてのリポジトリ</strong>でトリガーされるWebhookを追加します。
|
||||
|
||||
orgs_none=あなたはどの組織のメンバーでもありません。
|
||||
repos_none=あなたはリポジトリを所有していません。
|
||||
|
||||
delete_account=アカウントを削除
|
||||
delete_prompt=この操作により、あなたのユーザーアカウントは恒久的に抹消されます。 取り消すことは<strong>できません</strong>。
|
||||
@ -892,11 +894,14 @@ email_notifications.andyourown=自分に関する通知も含める
|
||||
|
||||
visibility=ユーザーの公開範囲
|
||||
visibility.public=パブリック
|
||||
visibility.public_tooltip=全員に表示します
|
||||
visibility.public_tooltip=全員に表示されます
|
||||
visibility.limited=限定
|
||||
visibility.limited_tooltip=認証されたユーザーのみに表示されます
|
||||
visibility.private=プライベート
|
||||
visibility.private_tooltip=あなたが参加した組織のメンバーのみに表示されます
|
||||
|
||||
[repo]
|
||||
new_repo_helper=リポジトリには、プロジェクトのすべてのファイルとリビジョン履歴が入ります。 すでにほかの場所でホストしていますか? <a href="%s">リポジトリを移行</a> もどうぞ。
|
||||
owner=オーナー
|
||||
owner_helper=リポジトリ数の上限により、一部の組織はドロップダウンに表示されない場合があります。
|
||||
repo_name=リポジトリ名
|
||||
@ -908,6 +913,7 @@ template_helper=テンプレートリポジトリにする
|
||||
template_description=テンプレートリポジトリは、同じディレクトリ構成、同じファイル、同じオプション設定でユーザーが新しいリポジトリを作成できるようにするものです。
|
||||
visibility=公開/非公開
|
||||
visibility_description=オーナー、または権限を持つ組織のメンバーだけが、リポジトリを見ることができます。
|
||||
visibility_helper=リポジトリをプライベートにする
|
||||
visibility_helper_forced=サイト管理者の設定により、新しいリポジトリは強制的にプライベートになります。
|
||||
visibility_fork_helper=(この変更はすべてのフォークに適用されます)
|
||||
clone_helper=クローンに関してお困りであれば<a target="_blank" rel="noopener noreferrer" href="%s">ヘルプ</a>を参照しましょう。
|
||||
@ -952,6 +958,8 @@ mirror_interval_invalid=ミラー間隔が不正です。
|
||||
mirror_sync_on_commit=コミットがプッシュされたときに同期
|
||||
mirror_address=クローンするURL
|
||||
mirror_address_desc=必要な資格情報は「認証」セクションに設定してください。
|
||||
mirror_address_url_invalid=入力したURLは無効です。 URLの構成要素はすべて正しくエスケープする必要があります。
|
||||
mirror_address_protocol_invalid=入力したURLは無効です。 ミラーできるのは、http(s):// または git:// からだけです。
|
||||
mirror_lfs=Large File Storage (LFS)
|
||||
mirror_lfs_desc=LFS データのミラーリングを有効にする。
|
||||
mirror_lfs_endpoint=LFS エンドポイント
|
||||
@ -979,10 +987,12 @@ delete_preexisting_success=%s の未登録ファイルを削除しました
|
||||
blame_prior=この変更より前のBlameを表示
|
||||
author_search_tooltip=最大30人までのユーザーを表示
|
||||
|
||||
transfer.accept=転送を承認
|
||||
transfer.accept_desc=`"%s" に転送`
|
||||
transfer.reject=転送を拒否
|
||||
transfer.reject_desc=`"%s" への転送をキャンセル`
|
||||
transfer.accept=移転を承認
|
||||
transfer.accept_desc=`"%s" に移転`
|
||||
transfer.reject=移転を拒否
|
||||
transfer.reject_desc=`"%s" への移転をキャンセル`
|
||||
transfer.no_permission_to_accept=この移転を承認する権限がありません。
|
||||
transfer.no_permission_to_reject=この移転を拒否する権限がありません。
|
||||
|
||||
desc.private=プライベート
|
||||
desc.public=公開
|
||||
@ -1003,6 +1013,8 @@ template.issue_labels=イシューラベル
|
||||
template.one_item=最低一つはテンプレート項目を選択する必要があります
|
||||
template.invalid=テンプレートリポジトリを選択する必要があります
|
||||
|
||||
archive.title=このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
|
||||
archive.title_date=このリポジトリは%sにアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
|
||||
archive.issue.nocomment=このリポジトリはアーカイブされています。 イシューにコメントを追加することはできません。
|
||||
archive.pull.nocomment=このリポジトリはアーカイブされています。 プルリクエストにコメントを追加することはできません。
|
||||
|
||||
@ -1019,6 +1031,7 @@ migrate_options_lfs=LFS ファイルのマイグレート
|
||||
migrate_options_lfs_endpoint.label=LFS エンドポイント
|
||||
migrate_options_lfs_endpoint.description=マイグレーションでは、リモート側のGitをもとに<a target="_blank" rel="noopener noreferrer" href="%s">LFSサーバーを決定</a>しようとします。 リポジトリのLFSデータがほかの場所に保存されている場合は、独自のエンドポイントを指定することができます。
|
||||
migrate_options_lfs_endpoint.description.local=ローカルサーバーのパスもサポートされています。
|
||||
migrate_options_lfs_endpoint.placeholder=空にするとエンドポイントはクローン URL から決定されます
|
||||
migrate_items=移行する項目
|
||||
migrate_items_wiki=Wiki
|
||||
migrate_items_milestones=マイルストーン
|
||||
@ -1385,6 +1398,7 @@ issues.filter_sort.moststars=スターが多い順
|
||||
issues.filter_sort.feweststars=スターが少ない順
|
||||
issues.filter_sort.mostforks=フォークが多い順
|
||||
issues.filter_sort.fewestforks=フォークが少ない順
|
||||
issues.keyword_search_unavailable=現在キーワード検索は利用できません。 サイト管理者にお問い合わせください。
|
||||
issues.action_open=オープン
|
||||
issues.action_close=クローズ
|
||||
issues.action_label=ラベル
|
||||
@ -1501,6 +1515,7 @@ issues.tracking_already_started=`<a href="%s">別のイシュー</a>で既にタ
|
||||
issues.stop_tracking=タイマー 終了
|
||||
issues.stop_tracking_history=`が作業を終了 %s`
|
||||
issues.cancel_tracking=中止
|
||||
issues.cancel_tracking_history=`がタイムトラッキングを中止 %s`
|
||||
issues.add_time=手で時間を入力
|
||||
issues.del_time=このタイムログを削除
|
||||
issues.add_time_short=時間入力
|
||||
@ -1524,6 +1539,7 @@ issues.due_date_form=yyyy-mm-dd
|
||||
issues.due_date_form_add=期日の追加
|
||||
issues.due_date_form_edit=変更
|
||||
issues.due_date_form_remove=削除
|
||||
issues.due_date_not_writer=イシューの期日を変更するには、リポジトリへの書き込み権限が必要です。
|
||||
issues.due_date_not_set=期日は未設定です。
|
||||
issues.due_date_added=が期日 %s を追加 %s
|
||||
issues.due_date_modified=が期日を %[2]s から %[1]s に変更 %[3]s
|
||||
@ -1649,6 +1665,12 @@ pulls.is_empty=このブランチの変更は既にターゲットブランチ
|
||||
pulls.required_status_check_failed=いくつかの必要なステータスチェックが成功していません。
|
||||
pulls.required_status_check_missing=必要なステータスチェックが見つかりません。
|
||||
pulls.required_status_check_administrator=管理者であるため、このプルリクエストをマージすることは可能です。
|
||||
pulls.blocked_by_approvals=このプルリクエストはまだ承認数が足りません。 %[1]d/%[2]dの承認を得ています。
|
||||
pulls.blocked_by_rejection=このプルリクエストは公式レビューアにより変更要請されています。
|
||||
pulls.blocked_by_official_review_requests=このプルリクエストには公式レビュー依頼があります。
|
||||
pulls.blocked_by_outdated_branch=このプルリクエストは遅れのためブロックされています。
|
||||
pulls.blocked_by_changed_protected_files_1=このプルリクエストは保護しているファイルを変更するためブロックされています:
|
||||
pulls.blocked_by_changed_protected_files_n=このプルリクエストは保護しているファイルを変更するためブロックされています:
|
||||
pulls.can_auto_merge_desc=このプルリクエストは自動的にマージできます。
|
||||
pulls.cannot_auto_merge_desc=コンフリクトが存在するため、このプルリクエストは自動的にマージできません。
|
||||
pulls.cannot_auto_merge_helper=コンフリクトを解消するため手動でマージしてください。
|
||||
@ -1731,6 +1753,7 @@ milestones.update_ago=%sに更新
|
||||
milestones.no_due_date=期日なし
|
||||
milestones.open=オープン
|
||||
milestones.close=クローズ
|
||||
milestones.new_subheader=マイルストーンを使うとイシューの整理や進捗確認がしやすくなります。
|
||||
milestones.completeness=%d%%消化
|
||||
milestones.create=マイルストーンを作成
|
||||
milestones.title=タイトル
|
||||
@ -1959,13 +1982,13 @@ settings.convert_fork_notices_1=この操作によりフォークから通常の
|
||||
settings.convert_fork_confirm=リポジトリを変換
|
||||
settings.convert_fork_succeed=フォークを通常のリポジトリに変換しました。
|
||||
settings.transfer=オーナー移転
|
||||
settings.transfer.rejected=リポジトリの転送は拒否されました。
|
||||
settings.transfer.success=リポジトリの転送が成功しました。
|
||||
settings.transfer.rejected=リポジトリの移転は拒否されました。
|
||||
settings.transfer.success=リポジトリの移転が成功しました。
|
||||
settings.transfer_abort=転送をキャンセル
|
||||
settings.transfer_abort_invalid=存在しないリポジトリの転送はキャンセルできません。
|
||||
settings.transfer_abort_invalid=存在しないリポジトリの移転はキャンセルできません。
|
||||
settings.transfer_desc=別のユーザーやあなたが管理者権限を持っている組織にリポジトリを移転します。
|
||||
settings.transfer_form_title=確認のためリポジトリ名を入力:
|
||||
settings.transfer_in_progress=現在進行中の転送があります。このリポジトリを別のユーザーに転送したい場合はキャンセルしてください。
|
||||
settings.transfer_in_progress=現在進行中の移転があります。このリポジトリを別のユーザーに移転したい場合はキャンセルしてください。
|
||||
settings.transfer_notices_1=- 個人ユーザーに移転すると、あなたはリポジトリへのアクセス権を失います。
|
||||
settings.transfer_notices_2=- あなたが所有(または共同で所有)している組織に移転すると、リポジトリへのアクセス権は維持されます。
|
||||
settings.transfer_notices_3=- プライベートリポジトリを個人ユーザーに移転した場合は、最低限そのユーザーが読み取り権限を持つよう設定されます (必要に応じて権限が変更されます)。
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
actions_model "code.gitea.io/gitea/models/actions"
|
||||
secret_model "code.gitea.io/gitea/models/secret"
|
||||
actions_module "code.gitea.io/gitea/modules/actions"
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
@ -197,10 +198,7 @@ func findTaskNeeds(ctx context.Context, task *actions_model.ActionTask) (map[str
|
||||
if len(task.Job.Needs) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
needs := map[string]struct{}{}
|
||||
for _, v := range task.Job.Needs {
|
||||
needs[v] = struct{}{}
|
||||
}
|
||||
needs := container.SetOf(task.Job.Needs...)
|
||||
|
||||
jobs, _, err := actions_model.FindRunJobs(ctx, actions_model.FindRunJobOptions{RunID: task.Job.RunID})
|
||||
if err != nil {
|
||||
@ -209,7 +207,7 @@ func findTaskNeeds(ctx context.Context, task *actions_model.ActionTask) (map[str
|
||||
|
||||
ret := make(map[string]*runnerv1.TaskNeed, len(needs))
|
||||
for _, job := range jobs {
|
||||
if _, ok := needs[job.JobID]; !ok {
|
||||
if !needs.Contains(job.JobID) {
|
||||
continue
|
||||
}
|
||||
if job.TaskID == 0 || !job.Status.IsDone() {
|
||||
|
@ -567,12 +567,9 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) {
|
||||
|
||||
// Remove repositories that should not be shown,
|
||||
// which are repositories that have no issues and are not selected by the user.
|
||||
selectedReposMap := make(map[int64]struct{}, len(selectedRepoIDs))
|
||||
for _, repoID := range selectedRepoIDs {
|
||||
selectedReposMap[repoID] = struct{}{}
|
||||
}
|
||||
selectedRepos := container.SetOf(selectedRepoIDs...)
|
||||
for k, v := range issueCountByRepo {
|
||||
if _, ok := selectedReposMap[k]; !ok && v == 0 {
|
||||
if v == 0 && !selectedRepos.Contains(k) {
|
||||
delete(issueCountByRepo, k)
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import (
|
||||
"code.gitea.io/gitea/models/organization"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
auth_module "code.gitea.io/gitea/modules/auth"
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
source_service "code.gitea.io/gitea/services/auth/source"
|
||||
@ -41,7 +42,7 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
|
||||
|
||||
usernameUsers := make(map[string]*user_model.User, len(users))
|
||||
mailUsers := make(map[string]*user_model.User, len(users))
|
||||
keepActiveUsers := make(map[int64]struct{})
|
||||
keepActiveUsers := make(container.Set[int64])
|
||||
|
||||
for _, u := range users {
|
||||
usernameUsers[u.LowerName] = u
|
||||
@ -97,7 +98,7 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
|
||||
}
|
||||
|
||||
if usr != nil {
|
||||
keepActiveUsers[usr.ID] = struct{}{}
|
||||
keepActiveUsers.Add(usr.ID)
|
||||
} else if len(su.Username) == 0 {
|
||||
// we cannot create the user if su.Username is empty
|
||||
continue
|
||||
@ -208,7 +209,7 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
|
||||
// Deactivate users not present in LDAP
|
||||
if updateExisting {
|
||||
for _, usr := range users {
|
||||
if _, ok := keepActiveUsers[usr.ID]; ok {
|
||||
if keepActiveUsers.Contains(usr.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,10 @@ import (
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/validation"
|
||||
"code.gitea.io/gitea/modules/web/middleware"
|
||||
|
||||
"gitea.com/go-chi/binding"
|
||||
"github.com/gobwas/glob"
|
||||
)
|
||||
|
||||
// InstallForm form for installation page
|
||||
@ -103,29 +103,6 @@ func (f *RegisterForm) Validate(req *http.Request, errs binding.Errors) binding.
|
||||
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
|
||||
}
|
||||
|
||||
// IsEmailDomainListed checks whether the domain of an email address
|
||||
// matches a list of domains
|
||||
func IsEmailDomainListed(globs []glob.Glob, email string) bool {
|
||||
if len(globs) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
n := strings.LastIndex(email, "@")
|
||||
if n <= 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
domain := strings.ToLower(email[n+1:])
|
||||
|
||||
for _, g := range globs {
|
||||
if g.Match(domain) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// IsEmailDomainAllowed validates that the email address
|
||||
// provided by the user matches what has been configured .
|
||||
// The email is marked as allowed if it matches any of the
|
||||
@ -133,10 +110,10 @@ func IsEmailDomainListed(globs []glob.Glob, email string) bool {
|
||||
// domains in the blocklist, if any such list is not empty.
|
||||
func (f *RegisterForm) IsEmailDomainAllowed() bool {
|
||||
if len(setting.Service.EmailDomainAllowList) == 0 {
|
||||
return !IsEmailDomainListed(setting.Service.EmailDomainBlockList, f.Email)
|
||||
return !validation.IsEmailDomainListed(setting.Service.EmailDomainBlockList, f.Email)
|
||||
}
|
||||
|
||||
return IsEmailDomainListed(setting.Service.EmailDomainAllowList, f.Email)
|
||||
return validation.IsEmailDomainListed(setting.Service.EmailDomainAllowList, f.Email)
|
||||
}
|
||||
|
||||
// MustChangePasswordForm form for updating your password after account creation
|
||||
|
@ -14,6 +14,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
base "code.gitea.io/gitea/modules/migration"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
@ -673,16 +674,15 @@ func (g *GitlabDownloader) GetReviews(reviewable base.Reviewable) ([]*base.Revie
|
||||
|
||||
func (g *GitlabDownloader) awardsToReactions(awards []*gitlab.AwardEmoji) []*base.Reaction {
|
||||
result := make([]*base.Reaction, 0, len(awards))
|
||||
uniqCheck := make(map[string]struct{})
|
||||
uniqCheck := make(container.Set[string])
|
||||
for _, award := range awards {
|
||||
uid := fmt.Sprintf("%s%d", award.Name, award.User.ID)
|
||||
if _, ok := uniqCheck[uid]; !ok {
|
||||
if uniqCheck.Add(uid) {
|
||||
result = append(result, &base.Reaction{
|
||||
UserID: int64(award.User.ID),
|
||||
UserName: award.User.Username,
|
||||
Content: award.Name,
|
||||
})
|
||||
uniqCheck[uid] = struct{}{}
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
@ -195,6 +195,10 @@ func adoptRepository(ctx context.Context, repoPath string, u *user_model.User, r
|
||||
return fmt.Errorf("updateRepository: %w", err)
|
||||
}
|
||||
|
||||
if err = repo_module.SyncReleasesWithTags(repo, gitRepo); err != nil {
|
||||
return fmt.Errorf("SyncReleasesWithTags: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
<tr>
|
||||
<th></th>
|
||||
<th colspan="5">
|
||||
<form class="ui right" method="post" action="{{AppSubUrl}}/admin/notices/empty">
|
||||
<form class="gt-float-right" method="post" action="{{AppSubUrl}}/admin/notices/empty">
|
||||
{{.CsrfTokenHtml}}
|
||||
<button type="submit" class="ui red small button">{{.locale.Tr "admin.notices.delete_all"}}</button>
|
||||
</form>
|
||||
|
@ -1,15 +1,11 @@
|
||||
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings labels")}}
|
||||
<div class="org-setting-content">
|
||||
<div class="ui grid">
|
||||
<div class="left floated twelve wide column">
|
||||
<div class="gt-df gt-ac">
|
||||
<div class="gt-f1">
|
||||
{{$.locale.Tr "org.settings.labels_desc" | Str2html}}
|
||||
</div>
|
||||
<div class="right floated three wide column">
|
||||
<div class="ui right">
|
||||
<button class="ui small green new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{template "repo/issue/labels/label_new" .}}
|
||||
{{template "repo/issue/labels/label_list" .}}
|
||||
|
@ -41,7 +41,7 @@
|
||||
{{if $canAddRemove}}
|
||||
<form method="post" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/repo/remove">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<button type="submit" class="ui red small button right" name="repoid" value="{{.ID}}">{{$.locale.Tr "remove"}}</button>
|
||||
<button type="submit" class="ui red small button" name="repoid" value="{{.ID}}">{{$.locale.Tr "remove"}}</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
|
@ -87,7 +87,7 @@
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
<strong>{{.locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong>
|
||||
<a class="ui right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{.locale.Tr "packages.versions.view_all"}}</a>
|
||||
<a class="gt-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{.locale.Tr "packages.versions.view_all"}}</a>
|
||||
<div class="ui relaxed list">
|
||||
{{range .LatestVersions}}
|
||||
<div class="item gt-df">
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
{{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}
|
||||
|
||||
<span class="ui float right shabox gt-df gt-ac">
|
||||
<span class="shabox gt-df gt-ac gt-float-right">
|
||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $.root}}
|
||||
{{$class := "ui sha label"}}
|
||||
{{if .Signature}}
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
<div class="field footer gt-mx-3">
|
||||
<span class="markup-info">{{svg "octicon-markup"}} {{$.root.locale.Tr "repo.diff.comment.markdown_info"}}</span>
|
||||
<div class="ui right">
|
||||
<div class="gt-text-right">
|
||||
{{if $.reply}}
|
||||
<button class="ui submit green tiny button btn-reply" type="submit">{{$.root.locale.Tr "repo.diff.comment.reply"}}</button>
|
||||
<input type="hidden" name="reply" value="{{$.reply}}">
|
||||
|
@ -5,9 +5,7 @@
|
||||
<div class="navbar gt-mb-4">
|
||||
{{template "repo/issue/navbar" .}}
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||
<div class="ui right">
|
||||
<button class="ui small green new-label button">{{.locale.Tr "repo.issues.new_label"}}</button>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||
|
@ -5,9 +5,7 @@
|
||||
<div class="navbar gt-mb-4">
|
||||
{{template "repo/issue/navbar" .}}
|
||||
{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}}
|
||||
<div class="ui right">
|
||||
<a class="ui small green button" href="{{$.Link}}/new">{{.locale.Tr "repo.milestones.new"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/alert" .}}
|
||||
|
@ -19,7 +19,7 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="gt-p-3 gt-df gt-ac">
|
||||
<span class="ui text grey right">{{.Size | FileSize}}</span>
|
||||
<span class="ui text grey">{{.Size | FileSize}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{end -}}
|
||||
|
@ -477,7 +477,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{{if or $invalid $resolved}}
|
||||
<button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact right labeled button show-outdated gt-df gt-ac">
|
||||
<button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if not $resolved}}gt-hidden {{end}}ui compact labeled button show-outdated gt-df gt-ac">
|
||||
{{svg "octicon-unfold" 16 "gt-mr-3"}}
|
||||
{{if $resolved}}
|
||||
{{$.locale.Tr "repo.issues.review.show_resolved"}}
|
||||
@ -485,7 +485,7 @@
|
||||
{{$.locale.Tr "repo.issues.review.show_outdated"}}
|
||||
{{end}}
|
||||
</button>
|
||||
<button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact right labeled button hide-outdated gt-df gt-ac">
|
||||
<button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if $resolved}}gt-hidden {{end}}ui compact labeled button hide-outdated gt-df gt-ac">
|
||||
{{svg "octicon-fold" 16 "gt-mr-3"}}
|
||||
{{if $resolved}}
|
||||
{{$.locale.Tr "repo.issues.review.hide_resolved"}}
|
||||
@ -698,7 +698,7 @@
|
||||
{{end}}
|
||||
</span>
|
||||
{{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}}
|
||||
<span class="ui float right comparebox">
|
||||
<span class="gt-float-right comparebox">
|
||||
<a href="{{$.Issue.PullRequest.BaseRepo.Link}}/compare/{{PathEscape .OldCommit}}..{{PathEscape .NewCommit}}" rel="nofollow" class="ui compare label">{{$.locale.Tr "repo.issues.force_push_compare"}}</a>
|
||||
</span>
|
||||
{{end}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{if .comment.Time}} {{/* compatibility with time comments made before v1.14 */}}
|
||||
{{if (not .comment.Time.Deleted)}}
|
||||
{{if (or .ctxData.IsAdmin (and .ctxData.IsSigned (eq .ctxData.SignedUserID .comment.PosterID)))}}
|
||||
<span class="ui float right">
|
||||
<span class="gt-float-right">
|
||||
<div class="ui mini modal issue-delete-time-modal" data-id="{{.comment.Time.ID}}">
|
||||
<form method="post" class="delete-time-form" action="{{.ctxData.RepoLink}}/issues/{{.ctxData.Issue.Index}}/times/{{.comment.TimeID}}/delete">
|
||||
{{.ctxData.CsrfTokenHtml}}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="ui container padded">
|
||||
<div class="gt-df gt-sb gt-ac gt-mb-4">
|
||||
{{template "repo/issue/navbar" .}}
|
||||
<a class="ui right small green button item" href="{{.RepoLink}}/issues/new/choose?project={{.Project.ID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
|
||||
<a class="ui small green button" href="{{.RepoLink}}/issues/new/choose?project={{.Project.ID}}">{{ctx.Locale.Tr "repo.issues.new"}}</a>
|
||||
</div>
|
||||
{{template "projects/view" .}}
|
||||
</div>
|
||||
|
@ -93,7 +93,7 @@
|
||||
{{if .Attachments}}
|
||||
{{range .Attachments}}
|
||||
<li>
|
||||
<span class="ui text middle aligned right">
|
||||
<span class="gt-float-right">
|
||||
<span class="ui text grey">{{.Size | FileSize}}</span>
|
||||
<span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}">
|
||||
{{svg "octicon-info"}}
|
||||
|
@ -61,20 +61,18 @@
|
||||
)}}
|
||||
</div>
|
||||
{{range .attachments}}
|
||||
<div class="field" id="attachment-{{.ID}}">
|
||||
<div class="ui right gt-df gt-ac wrap_remove">
|
||||
<a class="ui mini compact red button remove-rel-attach" data-id="{{.ID}}" data-uuid="{{.UUID}}">
|
||||
{{$.locale.Tr "remove"}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="gt-df gt-ac">
|
||||
<input name="attachment-edit-{{.UUID}}" class="gt-mr-3 attachment_edit" required value="{{.Name}}">
|
||||
<div class="field flex-text-block" id="attachment-{{.ID}}">
|
||||
<div class="flex-text-inline gt-f1">
|
||||
<input name="attachment-edit-{{.UUID}}" class="attachment_edit" required value="{{.Name}}">
|
||||
<input name="attachment-del-{{.UUID}}" type="hidden" value="false">
|
||||
<span class="ui text grey gt-mr-3">{{.Size | FileSize}}</span>
|
||||
<span class="ui text grey gt-whitespace-nowrap">{{.Size | FileSize}}</span>
|
||||
<span data-tooltip-content="{{$.locale.Tr "repo.release.download_count" ($.locale.PrettyNumber .DownloadCount)}}">
|
||||
{{svg "octicon-info"}}
|
||||
</span>
|
||||
</div>
|
||||
<a class="ui mini compact red button remove-rel-attach" data-id="{{.ID}}" data-uuid="{{.UUID}}">
|
||||
{{$.locale.Tr "remove"}}
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .IsAttachmentEnabled}}
|
||||
|
@ -15,7 +15,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
{{if and (not .PageIsTagList) .CanCreateRelease}}
|
||||
<a class="ui right small green button" href="{{$.RepoLink}}/releases/new">
|
||||
<a class="ui small green button" href="{{$.RepoLink}}/releases/new">
|
||||
{{.locale.Tr "repo.release.new_release"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
@ -41,13 +41,9 @@
|
||||
<div class="ui bottom attached segment">
|
||||
<form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="inline field ui left">
|
||||
<div id="search-user-box" class="ui search">
|
||||
<div class="ui input">
|
||||
<div id="search-user-box" class="ui search input gt-vm">
|
||||
<input class="prompt" name="collaborator" placeholder="{{.locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui green button">{{.locale.Tr "repo.settings.add_collaborator"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
@ -93,13 +89,9 @@
|
||||
{{if $allowedToChangeTeams}}
|
||||
<form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="inline field ui left">
|
||||
<div id="search-team-box" class="ui search" data-org="{{.OrgName}}">
|
||||
<div class="ui input">
|
||||
<div id="search-team-box" class="ui search input gt-vm">
|
||||
<input class="prompt" name="team" placeholder="{{$.locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="ui green button">{{$.locale.Tr "repo.settings.add_team"}}</button>
|
||||
</form>
|
||||
{{else}}
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div class="item truncated-item-container">
|
||||
<span class="text {{if .IsActive}}green{{else}}grey{{end}} gt-mr-3">{{svg "octicon-dot-fill" 22}}</span>
|
||||
<span class="text truncate gt-f1 gt-mr-3">{{.Name}}</span>
|
||||
<a class="muted ui right gt-p-3" href="{{$.RepoLink}}/settings/hooks/git/{{.Name|PathEscape}}">
|
||||
<a class="muted gt-float-right gt-p-3" href="{{$.RepoLink}}/settings/hooks/git/{{.Name|PathEscape}}">
|
||||
{{svg "octicon-pencil"}}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -11,19 +11,19 @@
|
||||
<div class="ui list">
|
||||
{{range .History}}
|
||||
<div class="item">
|
||||
<div class="meta">
|
||||
<div class="flex-text-block gt-sb">
|
||||
<div class="flex-text-inline">
|
||||
{{if .IsSucceed}}
|
||||
<span class="text green">{{svg "octicon-check"}}</span>
|
||||
{{else}}
|
||||
<span class="text red">{{svg "octicon-alert"}}</span>
|
||||
{{end}}
|
||||
<a class="ui primary sha label toggle button show-panel" data-panel="#info-{{.ID}}">{{.UUID}}</a>
|
||||
<div class="ui right">
|
||||
<span class="text grey time">
|
||||
</div>
|
||||
<span class="text grey">
|
||||
{{TimeSince .Delivered.AsTime $.locale}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info gt-hidden" id="info-{{.ID}}">
|
||||
<div class="ui top attached tabular menu">
|
||||
<a class="item active" data-tab="request-{{.ID}}">{{$.locale.Tr "repo.settings.webhook.request"}}</a>
|
||||
|
@ -3,12 +3,10 @@
|
||||
{{template "repo/header" .}}
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<div class="ui header">
|
||||
<div class="ui header flex-text-block gt-sb">
|
||||
{{.locale.Tr "repo.wiki.new_page"}}
|
||||
{{if .PageIsWikiEdit}}
|
||||
<div class="ui right gt-mb-3">
|
||||
<a class="ui green tiny button" href="{{.RepoLink}}/wiki?action=_new">{{.locale.Tr "repo.wiki.new_page_button"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}?action={{if .PageIsWikiEdit}}_edit{{else}}_new{{end}}" method="post">
|
||||
|
@ -79,7 +79,7 @@
|
||||
{{if .sidebarPresent}}
|
||||
<div class="markup wiki-content-sidebar">
|
||||
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
||||
<a class="ui right floated muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{.locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
|
||||
<a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{.locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
|
||||
{{end}}
|
||||
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .sidebarEscapeStatus "root" $}}
|
||||
{{.sidebarContent | Safe}}
|
||||
@ -91,7 +91,7 @@
|
||||
{{if .footerPresent}}
|
||||
<div class="markup wiki-content-footer">
|
||||
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
||||
<a class="ui right floated muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{.locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
|
||||
<a class="gt-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{.locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
|
||||
{{end}}
|
||||
{{template "repo/unicode_escape_prompt" dict "footerEscapeStatus" .sidebarEscapeStatus "root" $}}
|
||||
{{.footerContent | Safe}}
|
||||
|
@ -7,29 +7,29 @@
|
||||
<div class="ui secondary vertical filter menu gt-bg-transparent">
|
||||
<a class="{{if eq .ViewType "your_repositories"}}active{{end}} item" href="{{.Link}}?type=your_repositories&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
|
||||
{{.locale.Tr "home.issues.in_your_repos"}}
|
||||
<strong class="ui right">{{CountFmt .IssueStats.YourRepositoriesCount}}</strong>
|
||||
<strong>{{CountFmt .IssueStats.YourRepositoriesCount}}</strong>
|
||||
</a>
|
||||
<a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{.Link}}?type=assigned&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
|
||||
{{.locale.Tr "repo.issues.filter_type.assigned_to_you"}}
|
||||
<strong class="ui right">{{CountFmt .IssueStats.AssignCount}}</strong>
|
||||
<strong>{{CountFmt .IssueStats.AssignCount}}</strong>
|
||||
</a>
|
||||
<a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{.Link}}?type=created_by&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
|
||||
{{.locale.Tr "repo.issues.filter_type.created_by_you"}}
|
||||
<strong class="ui right">{{CountFmt .IssueStats.CreateCount}}</strong>
|
||||
<strong>{{CountFmt .IssueStats.CreateCount}}</strong>
|
||||
</a>
|
||||
{{if .PageIsPulls}}
|
||||
<a class="{{if eq .ViewType "review_requested"}}active{{end}} item" href="{{.Link}}?type=review_requested&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
|
||||
{{.locale.Tr "repo.issues.filter_type.review_requested"}}
|
||||
<strong class="ui right">{{CountFmt .IssueStats.ReviewRequestedCount}}</strong>
|
||||
<strong>{{CountFmt .IssueStats.ReviewRequestedCount}}</strong>
|
||||
</a>
|
||||
<a class="{{if eq .ViewType "reviewed_by"}}active{{end}} item" href="{{.Link}}?type=reviewed_by&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
|
||||
{{.locale.Tr "repo.issues.filter_type.reviewed_by_you"}}
|
||||
<strong class="ui right">{{CountFmt .IssueStats.ReviewedCount}}</strong>
|
||||
<strong>{{CountFmt .IssueStats.ReviewedCount}}</strong>
|
||||
</a>
|
||||
{{end}}
|
||||
<a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{.Link}}?type=mentioned&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}&q={{$.Keyword}}">
|
||||
{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}
|
||||
<strong class="ui right">{{CountFmt .IssueStats.MentionCount}}</strong>
|
||||
<strong>{{CountFmt .IssueStats.MentionCount}}</strong>
|
||||
</a>
|
||||
<div class="divider"></div>
|
||||
<a class="{{if not $.RepoIDs}}active{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}">
|
||||
|
@ -7,7 +7,7 @@
|
||||
<div class="ui secondary vertical filter menu gt-bg-transparent">
|
||||
<div class="item">
|
||||
{{.locale.Tr "home.issues.in_your_repos"}}
|
||||
<strong class="ui right">{{.Total}}</strong>
|
||||
<strong>{{.Total}}</strong>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{range .Repos}}
|
||||
|
@ -32,7 +32,7 @@
|
||||
{{else}}
|
||||
<span class="icon gt-dib gt-pt-3">{{svg "octicon-file-directory-fill"}}</span>
|
||||
<span class="name gt-dib gt-pt-3">{{$.ContextUser.Name}}/{{$dir}}</span>
|
||||
<div class="ui right">
|
||||
<div class="gt-float-right">
|
||||
{{if $.allowAdopt}}
|
||||
<button class="ui button green show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button>
|
||||
<div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
|
||||
|
@ -1175,14 +1175,8 @@ img.ui.avatar,
|
||||
color: var(--color-gold) !important;
|
||||
}
|
||||
|
||||
/* FIXME: this is a serious pollution, do not use this for "float: left" anymore */
|
||||
.ui.left:not(.action) {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* FIXME: this is a serious pollution, do not use this for "float: right" anymore */
|
||||
.ui.right:not(.action) {
|
||||
float: right;
|
||||
.text.small {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
.ui.form .ui.button {
|
||||
@ -1257,10 +1251,6 @@ img.ui.avatar,
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.ui .text.small {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
.ui .text.normal {
|
||||
font-weight: var(--font-weight-normal);
|
||||
}
|
||||
|
@ -1907,24 +1907,6 @@
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.repository.settings.collaboration #repo-collab-form #search-user-box .results {
|
||||
left: 7px;
|
||||
}
|
||||
|
||||
.repository.settings.collaboration #repo-collab-form .ui.button {
|
||||
margin-left: 5px;
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
.repository.settings.collaboration #repo-collab-team-form #search-team-box .results {
|
||||
left: 7px;
|
||||
}
|
||||
|
||||
.repository.settings.collaboration #repo-collab-team-form .ui.button {
|
||||
margin-left: 5px;
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
/* if the element is for a checkbox, then it should have a padding-left to align to the checkbox's text */
|
||||
.repository.settings.branches .branch-protection .ui.checkbox .help,
|
||||
.repository.settings.branches .branch-protection .checkbox-sub-item {
|
||||
|
@ -126,12 +126,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
.repository.new.release .field .wrap_remove {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.repository.new.release .field .attachment_edit {
|
||||
width: 450px !important;
|
||||
max-width: 48em;
|
||||
}
|
||||
|
||||
.repository.new.release .markup {
|
||||
|
135
web_src/fomantic/build/semantic.css
generated
135
web_src/fomantic/build/semantic.css
generated
@ -19372,138 +19372,3 @@ input::selection {
|
||||
/*******************************
|
||||
Site Overrides
|
||||
*******************************/
|
||||
/*!
|
||||
* # Fomantic-UI - Text
|
||||
* http://github.com/fomantic/Fomantic-UI/
|
||||
*
|
||||
*
|
||||
* Released under the MIT license
|
||||
* https://github.com/fomantic/Fomantic-UI/blob/master/LICENSE.md
|
||||
*
|
||||
*/
|
||||
|
||||
/*******************************
|
||||
Text
|
||||
*******************************/
|
||||
|
||||
span.ui.text {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
span.ui.primary.text {
|
||||
color: #2185D0;
|
||||
}
|
||||
|
||||
span.ui.secondary.text {
|
||||
color: #1B1C1D;
|
||||
}
|
||||
|
||||
span.ui.red.text {
|
||||
color: #DB2828;
|
||||
}
|
||||
|
||||
span.ui.orange.text {
|
||||
color: #F2711C;
|
||||
}
|
||||
|
||||
span.ui.yellow.text {
|
||||
color: #FBBD08;
|
||||
}
|
||||
|
||||
span.ui.olive.text {
|
||||
color: #B5CC18;
|
||||
}
|
||||
|
||||
span.ui.green.text {
|
||||
color: #21BA45;
|
||||
}
|
||||
|
||||
span.ui.teal.text {
|
||||
color: #00B5AD;
|
||||
}
|
||||
|
||||
span.ui.blue.text {
|
||||
color: #2185D0;
|
||||
}
|
||||
|
||||
span.ui.violet.text {
|
||||
color: #6435C9;
|
||||
}
|
||||
|
||||
span.ui.purple.text {
|
||||
color: #A333C8;
|
||||
}
|
||||
|
||||
span.ui.pink.text {
|
||||
color: #E03997;
|
||||
}
|
||||
|
||||
span.ui.brown.text {
|
||||
color: #A5673F;
|
||||
}
|
||||
|
||||
span.ui.grey.text {
|
||||
color: #767676;
|
||||
}
|
||||
|
||||
span.ui.black.text {
|
||||
color: #1B1C1D;
|
||||
}
|
||||
|
||||
span.ui.error.text {
|
||||
color: #DB2828;
|
||||
}
|
||||
|
||||
span.ui.info.text {
|
||||
color: #31CCEC;
|
||||
}
|
||||
|
||||
span.ui.success.text {
|
||||
color: #21BA45;
|
||||
}
|
||||
|
||||
span.ui.warning.text {
|
||||
color: #F2C037;
|
||||
}
|
||||
|
||||
span.ui.disabled.text {
|
||||
opacity: var(--opacity-disabled);
|
||||
}
|
||||
|
||||
/* Sizes */
|
||||
|
||||
span.ui.medium.text {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
span.ui.mini.text {
|
||||
font-size: 0.4em;
|
||||
}
|
||||
|
||||
span.ui.tiny.text {
|
||||
font-size: 0.5em;
|
||||
}
|
||||
|
||||
span.ui.small.text {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
span.ui.large.text {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
span.ui.big.text {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
span.ui.huge.text {
|
||||
font-size: 4em;
|
||||
}
|
||||
|
||||
span.ui.massive.text {
|
||||
font-size: 8em;
|
||||
}
|
||||
|
||||
/*******************************
|
||||
Theme Overrides
|
||||
*******************************/
|
@ -40,7 +40,6 @@
|
||||
"segment",
|
||||
"site",
|
||||
"tab",
|
||||
"table",
|
||||
"text"
|
||||
"table"
|
||||
]
|
||||
}
|
||||
|
4
web_src/js/bootstrap.js
vendored
4
web_src/js/bootstrap.js
vendored
@ -1,11 +1,9 @@
|
||||
import {joinPaths} from './utils.js';
|
||||
|
||||
// DO NOT IMPORT window.config HERE!
|
||||
// to make sure the error handler always works, we should never import `window.config`, because some user's custom template breaks it.
|
||||
|
||||
// This sets up the URL prefix used in webpack's chunk loading.
|
||||
// This file must be imported before any lazy-loading is being attempted.
|
||||
__webpack_public_path__ = joinPaths(window?.config?.assetUrlPrefix ?? '/', '/');
|
||||
__webpack_public_path__ = `${window.config?.assetUrlPrefix ?? '/assets'}/`;
|
||||
|
||||
export function showGlobalErrorMessage(msg) {
|
||||
const pageContent = document.querySelector('.page-content');
|
||||
|
@ -15,7 +15,7 @@
|
||||
</a>
|
||||
</h4>
|
||||
<div class="ui attached segment repos-search">
|
||||
<div class="ui fluid right action left icon input" :class="{loading: isLoading}">
|
||||
<div class="ui fluid action left icon input" :class="{loading: isLoading}">
|
||||
<input type="search" spellcheck="false" maxlength="255" @input="changeReposFilter(reposFilter)" v-model="searchQuery" ref="search" @keydown="reposFilterKeyControl" :placeholder="textSearchRepos">
|
||||
<i class="icon"><svg-icon name="octicon-search" :size="16"/></i>
|
||||
<div class="ui dropdown icon button" :title="textFilter">
|
||||
|
@ -33,7 +33,7 @@
|
||||
<div class="ui label" v-if="item.name===defaultBranch && mode === 'branches'">
|
||||
{{ textDefaultBranchLabel }}
|
||||
</div>
|
||||
<a v-show="enableFeed && mode === 'branches'" role="button" class="rss-icon ui compact right" :href="rssURLPrefix + item.url" target="_blank" @click.stop>
|
||||
<a v-show="enableFeed && mode === 'branches'" role="button" class="rss-icon gt-float-right" :href="rssURLPrefix + item.url" target="_blank" @click.stop>
|
||||
<!-- creating a lot of Vue component is pretty slow, so we use a static SVG here -->
|
||||
<svg width="14" height="14" class="svg octicon-rss"><use href="#svg-symbol-octicon-rss"/></svg>
|
||||
</a>
|
||||
|
@ -11,16 +11,6 @@ export function extname(path = '') {
|
||||
return ext || '';
|
||||
}
|
||||
|
||||
// join a list of path segments with slashes, ensuring no double slashes
|
||||
export function joinPaths(...parts) {
|
||||
let str = '';
|
||||
for (const part of parts) {
|
||||
if (!part) continue;
|
||||
str = !str ? part : `${str.replace(/\/$/, '')}/${part.replace(/^\//, '')}`;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// test whether a variable is an object
|
||||
export function isObject(obj) {
|
||||
return Object.prototype.toString.call(obj) === '[object Object]';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {expect, test} from 'vitest';
|
||||
import {
|
||||
basename, extname, isObject, stripTags, joinPaths, parseIssueHref,
|
||||
basename, extname, isObject, stripTags, parseIssueHref,
|
||||
parseUrl, translateMonth, translateDay, blobToDataURI,
|
||||
toAbsoluteUrl, encodeURLEncodedBase64, decodeURLEncodedBase64,
|
||||
} from './utils.js';
|
||||
@ -18,45 +18,6 @@ test('extname', () => {
|
||||
expect(extname('file.js')).toEqual('.js');
|
||||
});
|
||||
|
||||
test('joinPaths', () => {
|
||||
expect(joinPaths('', '')).toEqual('');
|
||||
expect(joinPaths('', 'b')).toEqual('b');
|
||||
expect(joinPaths('', '/b')).toEqual('/b');
|
||||
expect(joinPaths('', '/b/')).toEqual('/b/');
|
||||
expect(joinPaths('a', '')).toEqual('a');
|
||||
expect(joinPaths('/a', '')).toEqual('/a');
|
||||
expect(joinPaths('/a/', '')).toEqual('/a/');
|
||||
expect(joinPaths('a', 'b')).toEqual('a/b');
|
||||
expect(joinPaths('a', '/b')).toEqual('a/b');
|
||||
expect(joinPaths('/a', '/b')).toEqual('/a/b');
|
||||
expect(joinPaths('/a', '/b')).toEqual('/a/b');
|
||||
expect(joinPaths('/a/', '/b')).toEqual('/a/b');
|
||||
expect(joinPaths('/a', '/b/')).toEqual('/a/b/');
|
||||
expect(joinPaths('/a/', '/b/')).toEqual('/a/b/');
|
||||
|
||||
expect(joinPaths('', '', '')).toEqual('');
|
||||
expect(joinPaths('', 'b', '')).toEqual('b');
|
||||
expect(joinPaths('', 'b', 'c')).toEqual('b/c');
|
||||
expect(joinPaths('', '', 'c')).toEqual('c');
|
||||
expect(joinPaths('', '/b', '/c')).toEqual('/b/c');
|
||||
expect(joinPaths('/a', '', '/c')).toEqual('/a/c');
|
||||
expect(joinPaths('/a', '/b', '')).toEqual('/a/b');
|
||||
|
||||
expect(joinPaths('', '/')).toEqual('/');
|
||||
expect(joinPaths('a', '/')).toEqual('a/');
|
||||
expect(joinPaths('', '/', '/')).toEqual('/');
|
||||
expect(joinPaths('/', '/')).toEqual('/');
|
||||
expect(joinPaths('/', '')).toEqual('/');
|
||||
expect(joinPaths('/', 'b')).toEqual('/b');
|
||||
expect(joinPaths('/', 'b/')).toEqual('/b/');
|
||||
expect(joinPaths('/', '', '/')).toEqual('/');
|
||||
expect(joinPaths('/', 'b', '/')).toEqual('/b/');
|
||||
expect(joinPaths('/', 'b/', '/')).toEqual('/b/');
|
||||
expect(joinPaths('a', '/', '/')).toEqual('a/');
|
||||
expect(joinPaths('/', '/', 'c')).toEqual('/c');
|
||||
expect(joinPaths('/', '/', 'c/')).toEqual('/c/');
|
||||
});
|
||||
|
||||
test('isObject', () => {
|
||||
expect(isObject({})).toBeTruthy();
|
||||
expect(isObject([])).toBeFalsy();
|
||||
|
Loading…
x
Reference in New Issue
Block a user