Skip to content

Commit 85efaf6

Browse files
authored
Merge branch 'main' into add-fullname-arg
2 parents 2f1dd3d + c9aa906 commit 85efaf6

File tree

25 files changed

+170
-105
lines changed

25 files changed

+170
-105
lines changed

modules/markup/markdown/markdown.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,15 @@ func (r *GlodmarkRender) highlightingRenderer(w util.BufWriter, c highlighting.C
8686
preClasses += " is-loading"
8787
}
8888

89-
err := r.ctx.RenderInternal.FormatWithSafeAttrs(w, `<pre class="%s">`, preClasses)
90-
if err != nil {
91-
return
92-
}
93-
9489
// include language-x class as part of commonmark spec, "chroma" class is used to highlight the code
9590
// the "display" class is used by "js/markup/math.ts" to render the code element as a block
9691
// the "math.ts" strictly depends on the structure: <pre class="code-block is-loading"><code class="language-math display">...</code></pre>
97-
err = r.ctx.RenderInternal.FormatWithSafeAttrs(w, `<code class="chroma language-%s display">`, languageStr)
92+
err := r.ctx.RenderInternal.FormatWithSafeAttrs(w, `<div class="code-block-container code-overflow-scroll"><pre class="%s"><code class="chroma language-%s display">`, preClasses, languageStr)
9893
if err != nil {
9994
return
10095
}
10196
} else {
102-
_, err := w.WriteString("</code></pre>")
97+
_, err := w.WriteString("</code></pre></div>")
10398
if err != nil {
10499
return
105100
}

options/locale/locale_ja-JP.ini

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ files=ファイル
117117

118118
error=エラー
119119
error404=アクセスしようとしたページは<strong>存在しない</strong>か、閲覧が<strong>許可されていません</strong>。
120+
error503=サーバーはリクエストを完了できませんでした。 後でもう一度お試しください。
120121
go_back=戻る
121122
invalid_data=無効なデータ: %v
122123

@@ -730,6 +731,8 @@ public_profile=公開プロフィール
730731
biography_placeholder=自己紹介してください!(Markdownを使うことができます)
731732
location_placeholder=おおよその場所を他の人と共有
732733
profile_desc=あなたのプロフィールが他のユーザーにどのように表示されるかを制御します。あなたのプライマリメールアドレスは、通知、パスワードの回復、WebベースのGit操作に使用されます。
734+
password_username_disabled=ユーザー名の変更は許可されていません。詳細はサイト管理者にお問い合わせください。
735+
password_full_name_disabled=フルネームの変更は許可されていません。詳細はサイト管理者にお問い合わせください。
733736
full_name=フルネーム
734737
website=Webサイト
735738
location=場所
@@ -924,6 +927,9 @@ permission_not_set=設定なし
924927
permission_no_access=アクセス不可
925928
permission_read=読み取り
926929
permission_write=読み取りと書き込み
930+
permission_anonymous_read=匿名の読み込み
931+
permission_everyone_read=全員の読み込み
932+
permission_everyone_write=全員の書き込み
927933
access_token_desc=選択したトークン権限に応じて、関連する<a %s>API</a>ルートのみに許可が制限されます。 詳細は<a %s>ドキュメント</a>を参照してください。
928934
at_least_one_permission=トークンを作成するには、少なくともひとつの許可を選択する必要があります
929935
permissions_list=許可:
@@ -1136,6 +1142,7 @@ transfer.no_permission_to_reject=この移転を拒否する権限がありま
11361142

11371143
desc.private=プライベート
11381144
desc.public=公開
1145+
desc.public_access=公開アクセス
11391146
desc.template=テンプレート
11401147
desc.internal=内部
11411148
desc.archived=アーカイブ
@@ -1544,6 +1551,7 @@ issues.filter_project=プロジェクト
15441551
issues.filter_project_all=すべてのプロジェクト
15451552
issues.filter_project_none=プロジェクトなし
15461553
issues.filter_assignee=担当者
1554+
issues.filter_assignee_no_assignee=担当者なし
15471555
issues.filter_assignee_any_assignee=担当者あり
15481556
issues.filter_poster=作成者
15491557
issues.filter_user_placeholder=ユーザーを検索
@@ -1647,6 +1655,8 @@ issues.label_archived_filter=アーカイブされたラベルを表示
16471655
issues.label_archive_tooltip=アーカイブされたラベルは、ラベルによる検索時のサジェストからデフォルトで除外されます。
16481656
issues.label_exclusive_desc=ラベル名を <code>スコープ/アイテム</code> の形にすることで、他の <code>スコープ/</code> ラベルと排他的になります。
16491657
issues.label_exclusive_warning=イシューやプルリクエストのラベル編集では、競合するスコープ付きラベルは解除されます。
1658+
issues.label_exclusive_order=ソート順
1659+
issues.label_exclusive_order_tooltip=同じスコープ内の排他的なラベルは、この数値順にソートされます。
16501660
issues.label_count=ラベル %d件
16511661
issues.label_open_issues=オープン中のイシュー %d件
16521662
issues.label_edit=編集
@@ -2129,6 +2139,12 @@ contributors.contribution_type.deletions=削除
21292139
settings=設定
21302140
settings.desc=設定では、リポジトリの設定を管理することができます。
21312141
settings.options=リポジトリ
2142+
settings.public_access=公開アクセス
2143+
settings.public_access_desc=外部からの訪問者のアクセス権限について、このリポジトリのデフォルト設定を上書きします。
2144+
settings.public_access.docs.not_set=設定なし: 公開アクセス権限はありません。訪問者の権限は、リポジトリの公開範囲とメンバーの権限に従います。
2145+
settings.public_access.docs.anonymous_read=匿名の読み込み: ログインしていないユーザーは読み取り権限でユニットにアクセスできます。
2146+
settings.public_access.docs.everyone_read=全員の読み込み: すべてのログインユーザーは読み取り権限でユニットにアクセスできます。イシュー/プルリクエストユニットの読み取り権限は、ユーザーが新しいイシュー/プルリクエストを作成できることを意味します。
2147+
settings.public_access.docs.everyone_write=全員の書き込み: すべてのログインユーザーに書き込み権限があります。Wikiユニットのみがこの権限をサポートします。
21322148
settings.collaboration=共同作業者
21332149
settings.collaboration.admin=管理者
21342150
settings.collaboration.write=書き込み
@@ -2719,6 +2735,7 @@ branch.restore_success=ブランチ "%s" を復元しました。
27192735
branch.restore_failed=ブランチ "%s" の復元に失敗しました。
27202736
branch.protected_deletion_failed=ブランチ "%s" は保護されています。 削除できません。
27212737
branch.default_deletion_failed=ブランチ "%s" はデフォルトブランチです。 削除できません。
2738+
branch.default_branch_not_exist=デフォルトブランチ "%s" がありません。
27222739
branch.restore=ブランチ "%s" の復元
27232740
branch.download=ブランチ "%s" をダウンロード
27242741
branch.rename=ブランチ名 "%s" を変更

routers/api/v1/repo/wiki.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func getWikiPage(ctx *context.APIContext, wikiName wiki_service.WebPath) *api.Wi
193193
}
194194

195195
// get commit count - wiki revisions
196-
commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
196+
commitsCount, _ := wikiRepo.FileCommitsCount(ctx.Repo.Repository.DefaultWikiBranch, pageFilename)
197197

198198
// Get last change information.
199199
lastCommit, err := wikiRepo.GetCommitByPath(pageFilename)
@@ -432,7 +432,7 @@ func ListPageRevisions(ctx *context.APIContext) {
432432
}
433433

434434
// get commit count - wiki revisions
435-
commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
435+
commitsCount, _ := wikiRepo.FileCommitsCount(ctx.Repo.Repository.DefaultWikiBranch, pageFilename)
436436

437437
page := ctx.FormInt("page")
438438
if page <= 1 {
@@ -442,7 +442,7 @@ func ListPageRevisions(ctx *context.APIContext) {
442442
// get Commit Count
443443
commitsHistory, err := wikiRepo.CommitsByFileAndRange(
444444
git.CommitsByFileAndRangeOptions{
445-
Revision: "master",
445+
Revision: ctx.Repo.Repository.DefaultWikiBranch,
446446
File: pageFilename,
447447
Page: page,
448448
})
@@ -486,7 +486,7 @@ func findWikiRepoCommit(ctx *context.APIContext) (*git.Repository, *git.Commit)
486486
return nil, nil
487487
}
488488

489-
commit, err := wikiRepo.GetBranchCommit("master")
489+
commit, err := wikiRepo.GetBranchCommit(ctx.Repo.Repository.DefaultWikiBranch)
490490
if err != nil {
491491
if git.IsErrNotExist(err) {
492492
ctx.APIErrorNotFound(err)

templates/devtest/markup-render.tmpl

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{{template "devtest/devtest-header"}}
2+
<div class="page-content devtest ui container">
3+
{{$longCode := "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"}}
4+
<div class="tw-flex">
5+
<div class="tw-w-[50%] tw-p-4">
6+
<div class="markup render-content">
7+
Inline <code>code</code> content
8+
</div>
9+
10+
<div class="divider"></div>
11+
12+
<div class="markup render-content">
13+
<p>content before</p>
14+
<pre><code>Very long line with no code block or container: {{$longCode}}</code></pre>
15+
<p>content after</p>
16+
</div>
17+
18+
<div class="divider"></div>
19+
20+
<div class="markup render-content">
21+
<p>content before</p>
22+
<div class="code-block-container code-overflow-wrap">
23+
<pre class="code-block"><code>Very long line with wrap: {{$longCode}}</code></pre>
24+
</div>
25+
<p>content after</p>
26+
</div>
27+
28+
<div class="divider"></div>
29+
30+
<div class="markup render-content">
31+
<p>content before</p>
32+
<div class="code-block-container code-overflow-scroll">
33+
<pre class="code-block"><code>Short line in scroll container</code></pre>
34+
</div>
35+
<div class="code-block-container code-overflow-scroll">
36+
<pre class="code-block"><code>Very long line with scroll: {{$longCode}}</code></pre>
37+
</div>
38+
<p>content after</p>
39+
</div>
40+
</div>
41+
42+
<div class="tw-w-[50%] tw-p-4">
43+
<div class="markup render-content">
44+
<p>content before</p>
45+
<div class="code-block-container">
46+
<pre class="code-block"><code class="language-math">
47+
\lim\limits_{n\rightarrow\infty}{\left(1+\frac{1}{n}\right)^n}
48+
</code></pre>
49+
</div>
50+
<p>content after</p>
51+
</div>
52+
53+
<div class="divider"></div>
54+
55+
<div class="markup render-content">
56+
<p>content before</p>
57+
<div class="code-block-container">
58+
<pre class="code-block"><code class="language-mermaid is-loading">
59+
graph LR
60+
A[Square Rect] -- Link text --> B((Circle))
61+
A --> C(Round Rect)
62+
B --> D{Rhombus}
63+
C --> D
64+
</code></pre>
65+
</div>
66+
<p>content after</p>
67+
</div>
68+
</div>
69+
</div>
70+
</div>
71+
{{template "devtest/devtest-footer"}}

templates/repo/diff/conversation.tmpl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
{{$referenceUrl := printf "%s#%s" $.Issue.Link $comment.HashTag}}
99
<div class="conversation-holder" data-path="{{$comment.TreePath}}" data-side="{{if lt $comment.Line 0}}left{{else}}right{{end}}" data-idx="{{$comment.UnsignedLine}}">
1010
{{if $resolved}}
11-
<div class="ui attached header resolved-placeholder tw-flex tw-items-center tw-justify-between">
12-
<div class="ui grey text tw-flex tw-items-center tw-flex-wrap tw-gap-1">
13-
{{svg "octicon-check" 16 "icon tw-mr-1"}}
11+
<div class="resolved-placeholder">
12+
<div class="flex-text-block tw-flex-wrap grey text">
13+
{{svg "octicon-check"}}
1414
<b>{{$resolveDoer.Name}}</b> {{ctx.Locale.Tr "repo.issues.review.resolved_by"}}
1515
{{if $invalid}}
1616
<!--
@@ -22,14 +22,12 @@
2222
</a>
2323
{{end}}
2424
</div>
25-
<div class="tw-flex tw-items-center tw-gap-2">
26-
<button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="ui tiny labeled button show-outdated tw-flex tw-items-center">
27-
{{svg "octicon-unfold" 16 "tw-mr-2"}}
28-
{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
25+
<div class="flex-text-block">
26+
<button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="btn tiny show-outdated">
27+
{{svg "octicon-unfold" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
2928
</button>
30-
<button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="ui tiny labeled button hide-outdated tw-flex tw-items-center tw-hidden">
31-
{{svg "octicon-fold" 16 "tw-mr-2"}}
32-
{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
29+
<button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="btn tiny hide-outdated tw-hidden">
30+
{{svg "octicon-fold" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}
3331
</button>
3432
</div>
3533
</div>

templates/repo/issue/view_content/conversation.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
</div>
1818
<div>
1919
{{if or $invalid $resolved}}
20-
<button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if not $resolved}}tw-hidden {{end}}ui compact labeled button show-outdated tw-flex tw-items-center">
20+
<button id="show-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if not $resolved}}tw-hidden{{end}} btn tiny show-outdated">
2121
{{svg "octicon-unfold" 16 "tw-mr-2"}}
2222
{{if $resolved}}
2323
{{ctx.Locale.Tr "repo.issues.review.show_resolved"}}
2424
{{else}}
2525
{{ctx.Locale.Tr "repo.issues.review.show_outdated"}}
2626
{{end}}
2727
</button>
28-
<button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if $resolved}}tw-hidden {{end}}ui compact labeled button hide-outdated tw-flex tw-items-center">
28+
<button id="hide-outdated-{{$comment.ID}}" data-comment="{{$comment.ID}}" class="{{if $resolved}}tw-hidden {{end}} btn tiny hide-outdated">
2929
{{svg "octicon-fold" 16 "tw-mr-2"}}
3030
{{if $resolved}}
3131
{{ctx.Locale.Tr "repo.issues.review.hide_resolved"}}

templates/repo/wiki/revision.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
{{template "repo/header" .}}
44
{{$title := .title}}
55
<div class="ui container">
6-
<div class="ui stackable grid">
7-
<div class="ui eight wide column">
8-
<div class="ui header">
9-
<a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}">{{if .revision}}<span>{{.revision}}</span> {{end}}{{svg "octicon-home"}}</a>
6+
<div class="ui dividing header flex-text-block tw-flex-wrap tw-justify-between">
7+
<div class="flex-text-block">
8+
<a class="ui basic button tw-px-3" title="{{ctx.Locale.Tr "repo.wiki.back_to_wiki"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}">{{svg "octicon-home"}}</a>
9+
<div class="tw-flex-1 gt-ellipsis">
1010
{{$title}}
11-
<div class="ui sub header tw-break-anywhere">
11+
<div class="ui sub header gt-ellipsis">
1212
{{$timeSince := DateUtils.TimeSince .Author.When}}
1313
{{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}}
1414
</div>
1515
</div>
1616
</div>
17-
<div class="ui eight wide column tw-text-right">
17+
<div>
1818
{{template "repo/clone_panel" .}}
1919
</div>
2020
</div>

templates/repo/wiki/view.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div class="ui dividing header">
3434
<div class="flex-text-block tw-flex-wrap tw-justify-end">
3535
<div class="flex-text-block tw-flex-1 tw-min-w-[300px]">
36-
<a class="file-revisions-btn ui basic button" title="{{ctx.Locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" >{{if .CommitCount}}<span>{{.CommitCount}}</span> {{end}}{{svg "octicon-history"}}</a>
36+
<a class="ui basic button tw-px-3 tw-gap-3" title="{{ctx.Locale.Tr "repo.wiki.file_revision"}}" href="{{.RepoLink}}/wiki/{{.PageURL}}?action=_revision" >{{if .CommitCount}}<span>{{.CommitCount}}</span> {{end}}{{svg "octicon-history"}}</a>
3737
<div class="tw-flex-1 gt-ellipsis">
3838
{{$title}}
3939
<div class="ui sub header gt-ellipsis">

templates/shared/avatar_upload_crop.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- /* we do not need to set for/id here, global aria init code will add them automatically */ -}}
22
<label>{{.LabelText}}</label>
3-
<input class="avatar-file-with-cropper" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
3+
<input class="avatar-file-with-cropper" name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp" data-global-init="initAvatarUploader">
44
{{- /* the cropper-panel must be next sibling of the input "avatar" */ -}}
55
<div class="cropper-panel tw-hidden">
66
<div class="tw-my-2">{{ctx.Locale.Tr "settings.cropper_prompt"}}</div>

web_src/css/base.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ progress::-moz-progress-bar {
224224
}
225225

226226
.unselectable,
227+
.btn,
227228
.button,
228229
.lines-num,
229230
.lines-commit,

web_src/css/markup/codecopy.css

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
.markup .code-block,
2-
.markup .mermaid-block {
3-
position: relative;
4-
}
5-
61
.markup .code-copy {
72
position: absolute;
83
top: 8px;
@@ -28,8 +23,8 @@
2823
background: var(--color-secondary-dark-1) !important;
2924
}
3025

31-
.markup .code-block:hover .code-copy,
32-
.markup .mermaid-block:hover .code-copy {
26+
.markup .code-block-container:hover .code-copy,
27+
.markup .code-block:hover .code-copy {
3328
visibility: visible;
3429
animation: fadein 0.2s both;
3530
}

web_src/css/markup/content.css

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -443,13 +443,25 @@
443443
}
444444

445445
.markup pre > code {
446-
padding: 0;
447-
margin: 0;
448446
font-size: 100%;
447+
}
448+
449+
.markup .code-block,
450+
.markup .code-block-container {
451+
position: relative;
452+
}
453+
454+
.markup .code-block-container.code-overflow-wrap pre > code {
449455
white-space: pre-wrap;
450-
overflow-wrap: anywhere;
451-
background: transparent;
452-
border: 0;
456+
}
457+
458+
.markup .code-block-container.code-overflow-scroll pre {
459+
overflow-x: auto;
460+
}
461+
462+
.markup .code-block-container.code-overflow-scroll pre > code {
463+
white-space: pre;
464+
overflow-wrap: normal;
453465
}
454466

455467
.markup .highlight {
@@ -470,16 +482,11 @@
470482
word-break: normal;
471483
}
472484

473-
.markup pre {
474-
word-wrap: normal;
475-
}
476-
477485
.markup pre code,
478486
.markup pre tt {
479487
display: inline;
480488
padding: 0;
481489
line-height: inherit;
482-
word-wrap: normal;
483490
background-color: transparent;
484491
border: 0;
485492
}
@@ -522,20 +529,6 @@
522529
margin: 0 0.25em;
523530
}
524531

525-
.file-revisions-btn {
526-
display: block;
527-
float: left;
528-
margin-bottom: 2px !important;
529-
padding: 11px !important;
530-
margin-right: 10px !important;
531-
}
532-
533-
.file-revisions-btn i {
534-
-webkit-touch-callout: none;
535-
-webkit-user-select: none;
536-
user-select: none;
537-
}
538-
539532
.markup-content-iframe {
540533
display: block;
541534
border: none;

0 commit comments

Comments
 (0)