Skip to content

Commit 36b1cfe

Browse files
authored
Merge branch 'main' into bugfix/count_issues
2 parents 809bd2b + bd8a253 commit 36b1cfe

File tree

7 files changed

+119
-124
lines changed

7 files changed

+119
-124
lines changed

templates/devtest/flex-list.tmpl

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{{template "base/head" .}}
2+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/devtest.css?v={{AssetVersion}}">
3+
<div class="page-content devtest ui container">
4+
<div>
5+
<h1>Flex List</h1>
6+
<div class="flex-list">
7+
<div class="flex-item">
8+
<div class="flex-item-leading">
9+
{{svg "octicon-info" 32}}
10+
</div>
11+
<div class="flex-item-main">
12+
<div class="flex-item-title">
13+
Flex Item
14+
<span class="ui basic label">
15+
with label
16+
</span>
17+
</div>
18+
<div class="flex-item-body">
19+
consists of leading/main/trailing part
20+
</div>
21+
<div class="flex-item-body">
22+
main part contains title and (multiple) body lines
23+
</div>
24+
</div>
25+
<div class="flex-item-trailing">
26+
<button class="ui tiny red button">
27+
{{svg "octicon-warning" 14}} CJK文本测试
28+
</button>
29+
<button class="ui tiny green button">
30+
{{svg "octicon-info" 14}} Button
31+
</button>
32+
<button class="ui tiny green button">
33+
Button with long text
34+
</button>
35+
</div>
36+
</div>
37+
38+
<div class="flex-item">
39+
<div class="flex-item-leading">
40+
{{svg "octicon-info" 32}}
41+
</div>
42+
<div class="flex-item-main">
43+
<div class="flex-item-title">
44+
Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong title
45+
</div>
46+
<div class="flex-item-body">
47+
consists of leading/main/trailing part
48+
</div>
49+
<div class="flex-item-body">
50+
Very loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong content
51+
</div>
52+
</div>
53+
<div class="flex-item-trailing">
54+
<button class="ui tiny red button">
55+
{{svg "octicon-warning" 12}} CJK文本测试 <!-- single CJK text test, it shouldn't be horizontal -->
56+
</button>
57+
</div>
58+
</div>
59+
60+
<div class="flex-item">
61+
<div class="flex-item-leading">
62+
{{svg "octicon-repo" 32}}
63+
</div>
64+
<div class="flex-item-main">
65+
<div class="flex-item-header">
66+
<div class="flex-item-title">
67+
<a class="text primary" href="{{$.Link}}">
68+
gitea-org / gitea
69+
</a>
70+
<span data-tooltip-content="{{$.locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
71+
</div>
72+
<div class="flex-item-trailing">
73+
<a class="muted" href="{{$.Link}}">
74+
<span class="flex-text-inline"><i class="color-icon gt-mr-3" style="background-color: aqua"></i>Go</span>
75+
</a>
76+
<a class="text grey flex-text-inline" href="{{$.Link}}">{{svg "octicon-star" 16}}45000</a>
77+
<a class="text grey flex-text-inline" href="{{$.Link}}">{{svg "octicon-git-branch" 16}}1234</a>
78+
</div>
79+
</div>
80+
<div class="flex-item-body">
81+
when inside header, the trailing part will wrap below the title
82+
</div>
83+
</div>
84+
</div>
85+
</div>
86+
</div>
87+
</div>
88+
{{template "base/footer" .}}

templates/devtest/gitea-ui.tmpl

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@
130130
<h2>Text with SVG</h2>
131131
<div class="flex-text-block">{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)</div>
132132
<div><div class="flex-text-inline">{{svg "octicon-alert"}} {{svg "octicon-x"}} text</div> (inline)</div>
133+
134+
<div class="flex-text-block">{{svg "octicon-alert"}} flex item with very very very very very very very very long content</div>
135+
133136
<div class="flex-items-block">
134137
<div class="item">{{svg "octicon-alert"}} flex every line</div>
135138
<div class="item">{{svg "octicon-alert"}} flex every item</div>
139+
<div class="item">{{svg "octicon-alert"}} flex item with very very very very very very very very long content</div>
136140
</div>
137141

138142
<h2>Button with SVG</h2>
@@ -142,6 +146,7 @@
142146
<button class="ui basic button">labeled button</button>
143147
<a class="ui basic label">123</a>
144148
</div>
149+
<button class="ui yellow button">{{svg "octicon-x" 16}} button with very very very very very very very very long text</button>
145150
</div>
146151

147152
<h2>Input with SVG</h2>
@@ -253,63 +258,5 @@
253258
{{template "shared/combomarkdowneditor" .}}
254259
</div>
255260
<script src="{{AssetUrlPrefix}}/js/devtest.js?v={{AssetVersion}}"></script>
256-
257-
<div>
258-
<h1>Flex List</h1>
259-
<div class="flex-list">
260-
<div class="flex-item">
261-
<div class="flex-item-leading">
262-
{{svg "octicon-info" 32}}
263-
</div>
264-
<div class="flex-item-main">
265-
<div class="flex-item-title">
266-
Flex Item
267-
<span class="ui basic label">
268-
with label
269-
</span>
270-
</div>
271-
<div class="flex-item-body">
272-
consists of leading/main/trailing part
273-
</div>
274-
<div class="flex-item-body">
275-
main part contains title and (multiple) body lines
276-
</div>
277-
</div>
278-
<div class="flex-item-trailing">
279-
<button class="ui tiny red button">
280-
{{svg "octicon-warning" 12}} Button
281-
</button>
282-
<button class="ui tiny green button">
283-
{{svg "octicon-info" 12}} Button
284-
</button>
285-
</div>
286-
</div>
287-
<div class="flex-item">
288-
<div class="flex-item-leading">
289-
{{svg "octicon-repo" 32}}
290-
</div>
291-
<div class="flex-item-main">
292-
<div class="flex-item-header">
293-
<div class="flex-item-title">
294-
<a class="text primary" href="{{$.Link}}">
295-
gitea-org / gitea
296-
</a>
297-
<span data-tooltip-content="{{$.locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
298-
</div>
299-
<div class="flex-item-trailing">
300-
<a class="muted" href="{{$.Link}}">
301-
<span class="flex-text-inline"><i class="color-icon gt-mr-3" style="background-color: aqua"></i>Go</span>
302-
</a>
303-
<a class="text grey flex-text-inline" href="{{$.Link}}">{{svg "octicon-star" 16}}45000</a>
304-
<a class="text grey flex-text-inline" href="{{$.Link}}">{{svg "octicon-git-branch" 16}}1234</a>
305-
</div>
306-
</div>
307-
<div class="flex-item-body">
308-
when inside header, the trailing part will wrap below the title
309-
</div>
310-
</div>
311-
</div>
312-
</div>
313-
</div>
314261
</div>
315262
{{template "base/footer" .}}

templates/repo/issue/view_content.tmpl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,7 @@
4444
{{end}}
4545
</div>
4646
<div class="comment-header-right actions gt-df gt-ac">
47-
{{if gt .Issue.ShowRole 0}}
48-
{{if (.Issue.ShowRole.HasRole "Writer")}}
49-
<div class="ui basic label role-label">
50-
{{$.locale.Tr "repo.issues.collaborator"}}
51-
</div>
52-
{{end}}
53-
{{if (.Issue.ShowRole.HasRole "Owner")}}
54-
<div class="ui basic label role-label">
55-
{{$.locale.Tr "repo.issues.owner"}}
56-
</div>
57-
{{end}}
58-
{{end}}
47+
{{template "repo/issue/view_content/show_role" dict "ShowRole" .Issue.ShowRole "IgnorePoster" true}}
5948
{{if not $.Repository.IsArchived}}
6049
{{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}}
6150
{{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,7 @@
5050
{{end}}
5151
</div>
5252
<div class="comment-header-right actions gt-df gt-ac">
53-
{{if (.ShowRole.HasRole "Poster")}}
54-
<div class="ui basic label">
55-
{{$.locale.Tr "repo.issues.poster"}}
56-
</div>
57-
{{end}}
58-
{{if (.ShowRole.HasRole "Writer")}}
59-
<div class="ui basic label">
60-
{{$.locale.Tr "repo.issues.collaborator"}}
61-
</div>
62-
{{end}}
63-
{{if (.ShowRole.HasRole "Owner")}}
64-
<div class="ui basic label">
65-
{{$.locale.Tr "repo.issues.owner"}}
66-
</div>
67-
{{end}}
53+
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
6854
{{if not $.Repository.IsArchived}}
6955
{{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
7056
{{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
@@ -442,25 +428,11 @@
442428
</span>
443429
</div>
444430
<div class="comment-header-right actions gt-df gt-ac">
445-
{{if (.ShowRole.HasRole "Poster")}}
446-
<div class="ui basic label">
447-
{{$.locale.Tr "repo.issues.poster"}}
448-
</div>
449-
{{end}}
450-
{{if (.ShowRole.HasRole "Writer")}}
451-
<div class="ui basic label">
452-
{{$.locale.Tr "repo.issues.collaborator"}}
453-
</div>
454-
{{end}}
455-
{{if (.ShowRole.HasRole "Owner")}}
456-
<div class="ui basic label">
457-
{{$.locale.Tr "repo.issues.owner"}}
458-
</div>
459-
{{end}}
460-
{{if not $.Repository.IsArchived}}
461-
{{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
462-
{{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" false "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
463-
{{end}}
431+
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
432+
{{if not $.Repository.IsArchived}}
433+
{{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
434+
{{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" false "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
435+
{{end}}
464436
</div>
465437
</div>
466438
<div class="ui attached segment comment-body">
@@ -567,21 +539,7 @@
567539
</span>
568540
</div>
569541
<div class="comment-header-right actions gt-df gt-ac">
570-
{{if (.ShowRole.HasRole "Poster")}}
571-
<div class="ui basic label">
572-
{{$.locale.Tr "repo.issues.poster"}}
573-
</div>
574-
{{end}}
575-
{{if (.ShowRole.HasRole "Writer")}}
576-
<div class="ui basic label">
577-
{{$.locale.Tr "repo.issues.collaborator"}}
578-
</div>
579-
{{end}}
580-
{{if (.ShowRole.HasRole "Owner")}}
581-
<div class="ui basic label">
582-
{{$.locale.Tr "repo.issues.owner"}}
583-
</div>
584-
{{end}}
542+
{{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole}}
585543
{{if not $.Repository.IsArchived}}
586544
{{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
587545
{{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{if and (.ShowRole.HasRole "Poster") (not .IgnorePoster)}}
2+
<div class="ui basic label role-label">
3+
{{ctx.Locale.Tr "repo.issues.poster"}}
4+
</div>
5+
{{end}}
6+
{{if (.ShowRole.HasRole "Writer")}}
7+
<div class="ui basic label role-label">
8+
{{ctx.Locale.Tr "repo.issues.collaborator"}}
9+
</div>
10+
{{end}}
11+
{{if (.ShowRole.HasRole "Owner")}}
12+
<div class="ui basic label role-label">
13+
{{ctx.Locale.Tr "repo.issues.owner"}}
14+
</div>
15+
{{end}}

web_src/css/base.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,7 +2311,6 @@ table th[data-sortt-desc] .svg {
23112311
.flex-text-inline {
23122312
display: inline-flex;
23132313
align-items: center;
2314-
flex-wrap: wrap;
23152314
gap: .25rem;
23162315
vertical-align: middle;
23172316
}
@@ -2339,6 +2338,5 @@ table th[data-sortt-desc] .svg {
23392338
.flex-text-block {
23402339
display: flex;
23412340
align-items: center;
2342-
flex-wrap: wrap;
23432341
gap: .25rem;
23442342
}

web_src/css/shared/flex-list.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
display: flex;
3030
flex-direction: column;
3131
flex-grow: 1;
32-
min-width: 0;
32+
flex-basis: 60%;
3333
}
3434

3535
.flex-item-header {
@@ -54,7 +54,6 @@
5454
flex-grow: 0;
5555
flex-wrap: wrap;
5656
justify-content: end;
57-
flex-shrink: 2;
5857
}
5958

6059
.flex-item .flex-item-title {
@@ -65,8 +64,8 @@
6564
max-width: 100%;
6665
color: var(--color-text);
6766
font-size: 16px;
68-
min-width: 0;
6967
font-weight: var(--font-weight-semibold);
68+
word-break: break-word;
7069
}
7170

7271
.flex-item .flex-item-title a {
@@ -81,6 +80,7 @@
8180
flex-wrap: wrap;
8281
gap: .25rem;
8382
color: var(--color-text-light-2);
83+
word-break: break-word;
8484
}
8585

8686
.flex-item .flex-item-body a {

0 commit comments

Comments
 (0)