Skip to content

Commit cf839bf

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix citation error when the file size is larger than 1024 bytes (go-gitea#27958) Use flex-container on user dashboard (go-gitea#27956) Document REACTION_MAX_USER_NUM setting option (go-gitea#27954) Add word-break to repo description in home page (go-gitea#27924) Remove go versions from .golangci.yml (go-gitea#27953) Fix the overflow style for "Hide all checks" (go-gitea#27932) Fix rendering assignee changed comments without assignee (go-gitea#27927) Add word break to release title (go-gitea#27942)
2 parents b01e70b + f48a863 commit cf839bf

File tree

12 files changed

+53
-48
lines changed

12 files changed

+53
-48
lines changed

.golangci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ linters:
2929
fast: false
3030

3131
run:
32-
go: "1.21"
3332
timeout: 10m
3433
skip-dirs:
3534
- node_modules
@@ -75,7 +74,6 @@ linters-settings:
7574
- name: modifies-value-receiver
7675
gofumpt:
7776
extra-rules: true
78-
lang-version: "1.21"
7977
depguard:
8078
rules:
8179
main:

custom/conf/app.example.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,9 @@ LEVEL = Info
12211221
;; For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
12221222
;REACTIONS = +1, -1, laugh, hooray, confused, heart, rocket, eyes
12231223
;;
1224+
;; Change the number of users that are displayed in reactions tooltip (triggered by mouse hover).
1225+
;REACTION_MAX_USER_NUM = 10
1226+
;;
12241227
;; Additional Emojis not defined in the utf8 standard
12251228
;; By default we support gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and add it to this config.
12261229
;; Dont mistake it for Reactions.

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
223223
- `REACTIONS`: All available reactions users can choose on issues/prs and comments
224224
Values can be emoji alias (:smile:) or a unicode emoji.
225225
For custom reactions, add a tightly cropped square image to public/assets/img/emoji/reaction_name.png
226+
- `REACTION_MAX_USER_NUM`: **10**: Change the number of users that are displayed in reactions tooltip (triggered by mouse hover).
226227
- `CUSTOM_EMOJIS`: **gitea, codeberg, gitlab, git, github, gogs**: Additional Emojis not defined in the utf8 standard.
227228
By default, we support Gitea (:gitea:), to add more copy them to public/assets/img/emoji/emoji_name.png and
228229
add it to this config.

routers/web/repo/view.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -716,14 +716,11 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
716716
return
717717
}
718718
defer dataRc.Close()
719-
buf := make([]byte, 1024)
720-
n, err := util.ReadAtMost(dataRc, buf)
719+
ctx.PageData["citationFileContent"], err = blob.GetBlobContent(setting.UI.MaxDisplayFileSize)
721720
if err != nil {
722-
ctx.ServerError("ReadAtMost", err)
721+
ctx.ServerError("GetBlobContent", err)
723722
return
724723
}
725-
buf = buf[:n]
726-
ctx.PageData["citationFileContent"] = string(buf)
727724
break
728725
}
729726
}

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{template "base/alert" .}}
66
{{template "repo/code/recently_pushed_new_branches" .}}
77
{{if and (not .HideRepoInfo) (not .IsBlame)}}
8-
<div class="ui repo-description">
8+
<div class="ui repo-description gt-word-break">
99
<div id="repo-desc" class="gt-font-16">
1010
{{$description := .Repository.DescriptionHTML $.Context}}
1111
{{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
{{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
55

66
<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF,
7-
5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING,
7+
5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 8 = MILESTONE_CHANGE,
8+
9 = ASSIGNEES_CHANGE, 10 = TITLE_CHANGE, 11 = DELETE_BRANCH, 12 = START_TRACKING,
89
13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE,
910
18 = REMOVED_DEADLINE, 19 = ADD_DEPENDENCY, 20 = REMOVE_DEPENDENCY, 21 = CODE,
1011
22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED,
@@ -184,31 +185,29 @@
184185
{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}
185186
</span>
186187
</div>
187-
{{else if eq .Type 9}}
188+
{{else if and (eq .Type 9) (gt .AssigneeID 0)}}
188189
<div class="timeline-item event" id="{{.HashTag}}">
189190
<span class="badge">{{svg "octicon-person"}}</span>
190-
{{if gt .AssigneeID 0}}
191-
{{if .RemovedAssignee}}
192-
{{template "shared/user/avatarlink" dict "user" .Assignee}}
193-
<span class="text grey muted-links">
194-
{{template "shared/user/authorlink" .Assignee}}
195-
{{if eq .Poster.ID .Assignee.ID}}
196-
{{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
197-
{{else}}
198-
{{ctx.Locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
199-
{{end}}
200-
</span>
201-
{{else}}
202-
{{template "shared/user/avatarlink" dict "user" .Assignee}}
203-
<span class="text grey muted-links">
204-
{{template "shared/user/authorlink" .Assignee}}
205-
{{if eq .Poster.ID .AssigneeID}}
206-
{{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr | Safe}}
207-
{{else}}
208-
{{ctx.Locale.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
209-
{{end}}
210-
</span>
211-
{{end}}
191+
{{if .RemovedAssignee}}
192+
{{template "shared/user/avatarlink" dict "user" .Assignee}}
193+
<span class="text grey muted-links">
194+
{{template "shared/user/authorlink" .Assignee}}
195+
{{if eq .Poster.ID .Assignee.ID}}
196+
{{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
197+
{{else}}
198+
{{ctx.Locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
199+
{{end}}
200+
</span>
201+
{{else}}
202+
{{template "shared/user/avatarlink" dict "user" .Assignee}}
203+
<span class="text grey muted-links">
204+
{{template "shared/user/authorlink" .Assignee}}
205+
{{if eq .Poster.ID .AssigneeID}}
206+
{{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr | Safe}}
207+
{{else}}
208+
{{ctx.Locale.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
209+
{{end}}
210+
</span>
212211
{{end}}
213212
</div>
214213
{{else if eq .Type 10}}

templates/repo/release/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717
<div class="ui twelve wide column detail">
1818
<div class="gt-df gt-ac gt-sb gt-fw gt-mb-3">
19-
<h4 class="release-list-title">
19+
<h4 class="release-list-title gt-word-break">
2020
<a href="{{$.RepoLink}}/releases/tag/{{.TagName | PathEscapeSegments}}">{{.Title}}</a>
2121
{{if .IsDraft}}
2222
<span class="ui yellow label">{{ctx.Locale.Tr "repo.release.draft"}}</span>

templates/user/dashboard/issues.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content dashboard issues">
33
{{template "user/dashboard/navbar" .}}
44
<div class="ui container">
5-
<div class="ui stackable grid">
6-
<div class="four wide column">
5+
<div class="flex-container">
6+
<div class="flex-container-nav">
77
<div class="ui secondary vertical filter menu gt-bg-transparent">
88
<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}}">
99
{{ctx.Locale.Tr "home.issues.in_your_repos"}}
@@ -59,7 +59,7 @@
5959
{{end}}
6060
</div>
6161
</div>
62-
<div class="twelve wide column content">
62+
<div class="flex-container-main content">
6363
<div class="list-header">
6464
<div class="small-menu-items ui compact tiny menu list-header-toggle">
6565
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">

templates/user/dashboard/milestones.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<div role="main" aria-label="{{.Title}}" class="page-content dashboard issues repository milestones">
33
{{template "user/dashboard/navbar" .}}
44
<div class="ui container">
5-
<div class="ui stackable grid">
6-
<div class="four wide column">
5+
<div class="flex-container">
6+
<div class="flex-container-nav">
77
<div class="ui secondary vertical filter menu gt-bg-transparent">
88
<div class="item">
99
{{ctx.Locale.Tr "home.issues.in_your_repos"}}
@@ -33,7 +33,7 @@
3333
{{end}}
3434
</div>
3535
</div>
36-
<div class="twelve wide column content">
36+
<div class="flex-container-main content">
3737
<div class="list-header">
3838
<div class="small-menu-items ui compact tiny menu list-header-toggle">
3939
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{.Link}}?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">

web_src/css/modules/tippy.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
.tippy-box[data-theme="box-with-header"] .tippy-content {
6262
background: var(--color-box-body);
63+
border-radius: var(--border-radius);
6364
padding: 0;
6465
}
6566

web_src/css/repo.css

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@
211211
display: flex;
212212
justify-content: space-between;
213213
align-items: center;
214+
gap: 5px;
214215
margin-bottom: 5px;
215216
}
216217

217-
@media (max-width: 767.68px) {
218+
@media (max-width: 767.98px) {
218219
.repository.file.list .repo-description {
219220
flex-direction: column;
220-
gap: 8px;
221-
align-items: normal;
221+
align-items: stretch;
222222
}
223223
}
224224

@@ -3075,21 +3075,29 @@ tbody.commit-list {
30753075
}
30763076

30773077
.commit-status-header {
3078-
border: none !important; /* reset the default ".ui.attached.header" styles, to use the outer border */
3079-
margin: 0 !important;
3078+
/* reset the default ".ui.attached.header" styles, to use the outer border */
3079+
border: none !important;
3080+
/* add a bottom border to make sure the there is always a divider between the header and list when the list is scrolling */
3081+
border-bottom: 1px solid var(--color-secondary) !important;
3082+
/* use negative margin to avoid the newly added border conflict with the list's top border */
3083+
margin: 0 0 -1px !important;
30803084
}
30813085

30823086
.commit-status-list {
3083-
max-height: 195px; /* fit exactly 4 items */
3087+
max-height: 240px; /* fit exactly 6 items, commit-status-item.height * 6 */
30843088
overflow-x: hidden;
30853089
transition: max-height .2s;
30863090
}
30873091

30883092
.commit-status-item {
3089-
padding: 14px 10px !important;
3093+
height: 40px;
3094+
padding: 0 10px;
30903095
display: flex;
30913096
gap: 8px;
30923097
align-items: center;
3098+
}
3099+
3100+
.commit-status-item + .commit-status-item {
30933101
border-top: 1px solid var(--color-secondary);
30943102
}
30953103

web_src/js/features/repo-issue-pr-status.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ export function initRepoPullRequestCommitStatus() {
44
const list = panel.querySelector('.commit-status-list');
55
btn.addEventListener('click', () => {
66
list.style.maxHeight = list.style.maxHeight ? '' : '0px'; // toggle
7-
list.style.overflow = 'hidden'; // hide scrollbar when hiding
87
btn.textContent = btn.getAttribute(list.style.maxHeight ? 'data-show-all' : 'data-hide-all');
98
});
10-
list.addEventListener('animationend', () => list.style.overflow = '');
119
}
1210
}

0 commit comments

Comments
 (0)