Skip to content

Commit 7f72fe9

Browse files
authored
Merge branch 'go-gitea:main' into main
2 parents 4e2434b + cbb2e52 commit 7f72fe9

File tree

23 files changed

+89
-60
lines changed

23 files changed

+89
-60
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module code.gitea.io/gitea
22

3-
go 1.24
3+
go 1.24.2
44

55
// rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
66
// But some CAs use negative serial number, just relax the check. related:

modules/structs/repo_tag.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ type Tag struct {
1111
Message string `json:"message"`
1212
ID string `json:"id"`
1313
Commit *CommitMeta `json:"commit"`
14-
ZipballURL string `json:"zipball_url"`
15-
TarballURL string `json:"tarball_url"`
14+
ZipballURL string `json:"zipball_url,omitempty"`
15+
TarballURL string `json:"tarball_url,omitempty"`
1616
}
1717

1818
// AnnotatedTag represents an annotated tag

modules/structs/user_app.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ import (
1111
// AccessToken represents an API access token.
1212
// swagger:response AccessToken
1313
type AccessToken struct {
14-
ID int64 `json:"id"`
15-
Name string `json:"name"`
16-
Token string `json:"sha1"`
17-
TokenLastEight string `json:"token_last_eight"`
18-
Scopes []string `json:"scopes"`
14+
ID int64 `json:"id"`
15+
Name string `json:"name"`
16+
Token string `json:"sha1"`
17+
TokenLastEight string `json:"token_last_eight"`
18+
Scopes []string `json:"scopes"`
19+
Created time.Time `json:"created_at"`
20+
Updated time.Time `json:"last_used_at"`
1921
}
2022

2123
// AccessTokenList represents a list of API access token.

modules/structs/user_key.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type PublicKey struct {
1616
Fingerprint string `json:"fingerprint,omitempty"`
1717
// swagger:strfmt date-time
1818
Created time.Time `json:"created_at,omitempty"`
19+
Updated time.Time `json:"last_used_at,omitempty"`
1920
Owner *User `json:"user,omitempty"`
2021
ReadOnly bool `json:"read_only,omitempty"`
2122
KeyType string `json:"key_type,omitempty"`

options/locale/locale_ga-IE.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ use_scratch_code=Úsáid cód scratch
450450
twofa_scratch_used=D'úsáid tú do chód scratch. Tá tú atreoraithe chuig an leathanach socruithe dhá fhachtóir ionas gur féidir leat clárú do ghléas a bhaint nó cód scratch nua a ghiniúint.
451451
twofa_passcode_incorrect=Tá do phaschód mícheart. Má chuir tú do ghléas míchuir tú, bain úsáid as do chód scratch chun síniú isteach.
452452
twofa_scratch_token_incorrect=Tá do chód scratch mícheart.
453+
twofa_required=Ní mór duit Fíordheimhniú Dhá Fhachtóir a shocrú chun rochtain a fháil ar stórtha, nó iarracht a dhéanamh logáil isteach arís.
453454
login_userpass=Sínigh isteach
454455
login_openid=OpenID
455456
oauth_signup_tab=Cláraigh Cuntas Nua

options/locale/locale_pt-PT.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ use_scratch_code=Usar um código de recuperação
450450
twofa_scratch_used=Você usou o seu código de recuperação. Foi reencaminhado para a página de configurações da autenticação em dois passos para poder remover o registo do seu dispositivo ou gerar um novo código de recuperação.
451451
twofa_passcode_incorrect=A senha está errada. Se perdeu o seu dispositivo, use o código de recuperação para iniciar a sessão.
452452
twofa_scratch_token_incorrect=O código de recuperação está errado.
453+
twofa_required=Tem de configurar a autenticação em dois passos para obter acesso aos repositórios ou então tentar iniciar a sessão novamente.
453454
login_userpass=Iniciar sessão
454455
login_openid=OpenID
455456
oauth_signup_tab=Fazer inscrição

routers/api/v1/user/app.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ func ListAccessTokens(ctx *context.APIContext) {
6262
Name: tokens[i].Name,
6363
TokenLastEight: tokens[i].TokenLastEight,
6464
Scopes: tokens[i].Scope.StringSlice(),
65+
Created: tokens[i].CreatedUnix.AsTime(),
66+
Updated: tokens[i].UpdatedUnix.AsTime(),
6567
}
6668
}
6769

services/convert/convert.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,22 @@ func ToBranchProtection(ctx context.Context, bp *git_model.ProtectedBranch, repo
197197

198198
// ToTag convert a git.Tag to an api.Tag
199199
func ToTag(repo *repo_model.Repository, t *git.Tag) *api.Tag {
200+
tarballURL := util.URLJoin(repo.HTMLURL(), "archive", t.Name+".tar.gz")
201+
zipballURL := util.URLJoin(repo.HTMLURL(), "archive", t.Name+".zip")
202+
203+
// Archive URLs are "" if the download feature is disabled
204+
if setting.Repository.DisableDownloadSourceArchives {
205+
tarballURL = ""
206+
zipballURL = ""
207+
}
208+
200209
return &api.Tag{
201210
Name: t.Name,
202211
Message: strings.TrimSpace(t.Message),
203212
ID: t.ID.String(),
204213
Commit: ToCommitMeta(repo, t),
205-
ZipballURL: util.URLJoin(repo.HTMLURL(), "archive", t.Name+".zip"),
206-
TarballURL: util.URLJoin(repo.HTMLURL(), "archive", t.Name+".tar.gz"),
214+
ZipballURL: zipballURL,
215+
TarballURL: tarballURL,
207216
}
208217
}
209218

@@ -307,6 +316,7 @@ func ToPublicKey(apiLink string, key *asymkey_model.PublicKey) *api.PublicKey {
307316
Title: key.Name,
308317
Fingerprint: key.Fingerprint,
309318
Created: key.CreatedUnix.AsTime(),
319+
Updated: key.UpdatedUnix.AsTime(),
310320
}
311321
}
312322

templates/repo/issue/sidebar/assignee_list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/assignee?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
77
>
88
<input class="combo-value" name="assignee_ids" type="hidden" value="{{$data.SelectedAssigneeIDs}}">
9-
<div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
10-
<a class="text muted">
9+
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
10+
<a class="fixed-text muted">
1111
<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
1212
</a>
1313
<div class="menu">
@@ -16,7 +16,7 @@
1616
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
1717
</div>
1818
<div class="scrolling menu flex-items-block">
19-
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
19+
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
2020
<div class="divider"></div>
2121
{{range $data.CandidateAssignees}}
2222
<a class="item" href="#" data-value="{{.ID}}">

templates/repo/issue/sidebar/label_list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/labels?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
55
>
66
<input class="combo-value" name="label_ids" type="hidden" value="{{$data.SelectedLabelIDs}}">
7-
<div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
8-
<a class="text muted">
7+
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
8+
<a class="fixed-text muted">
99
<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
1010
</a>
1111
<div class="menu">
@@ -17,7 +17,7 @@
1717
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}">
1818
</div>
1919
<div class="scrolling menu">
20-
<a class="item clear-selection" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
20+
<a class="item clear-selection" data-text="" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
2121
<div class="divider"></div>
2222
{{$previousExclusiveScope := "_no_scope"}}
2323
{{range $data.RepoLabels}}

templates/repo/issue/sidebar/milestone_list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/milestone?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
77
>
88
<input class="combo-value" name="milestone_id" type="hidden" value="{{$data.SelectedMilestoneID}}">
9-
<div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
10-
<a class="text muted">
9+
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
10+
<a class="fixed-text muted">
1111
<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
1212
</a>
1313
<div class="menu">
@@ -19,7 +19,7 @@
1919
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}">
2020
</div>
2121
<div class="scrolling menu">
22-
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
22+
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
2323
<div class="divider"></div>
2424
{{if $data.OpenMilestones}}
2525
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>

templates/repo/issue/sidebar/project_list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/projects?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
77
>
88
<input class="combo-value" name="project_id" type="hidden" value="{{$data.SelectedProjectID}}">
9-
<div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
10-
<a class="text muted">
9+
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
10+
<a class="fixed-text muted">
1111
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
1212
</a>
1313
<div class="menu">
@@ -18,7 +18,7 @@
1818
</div>
1919
{{end}}
2020
<div class="scrolling menu">
21-
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
21+
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
2222
<div class="divider"></div>
2323
{{if $data.OpenProjects}}
2424
<div class="header">{{ctx.Locale.Tr "repo.issues.new.open_projects"}}</div>

templates/repo/issue/sidebar/reviewer_list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/request_review?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
77
>
88
<input type="hidden" class="combo-value" name="reviewer_ids">{{/* match CreateIssueForm */}}
9-
<div class="ui dropdown text-flex-grow {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
10-
<a class="text muted">
9+
<div class="ui dropdown full-width {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
10+
<a class="fixed-text muted">
1111
<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if $data.CanChooseReviewer}}{{svg "octicon-gear"}}{{end}}
1212
</a>
1313
<div class="menu flex-items-menu">

templates/repo/issue/sidebar/stopwatch_timetracker.tmpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
33
<div class="divider"></div>
44
<div>
5-
<div class="ui dropdown text-flex-grow jump">
6-
<a class="text muted">
5+
<div class="ui dropdown full-width jump">
6+
<a class="fixed-text muted">
77
<div>
8-
<strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong> {{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}}
8+
<strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong>
9+
{{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}}
910
</div>
1011
{{svg "octicon-gear"}}
1112
</a>

templates/repo/wiki/start.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h2>{{ctx.Locale.Tr "repo.wiki.welcome"}}</h2>
88
<p>{{ctx.Locale.Tr "repo.wiki.welcome_desc"}}</p>
99
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
10-
<a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a>
10+
<a class="ui primary button tw-mr-0" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a>
1111
{{end}}
1212
</div>
1313
</div>

templates/shared/repo_search.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="ui small secondary filter menu">
2-
<form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-gap-x-2">
2+
<form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-items-center tw-gap-x-2">
33
{{if .Language}}<input type="hidden" name="language" value="{{.Language}}">{{end}}
44
{{if .PageIsExploreRepositories}}<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">{{end}}
55
{{if .TabName}}<input type="hidden" name="tab" value="{{.TabName}}">{{end}}

templates/swagger/v1_json.tmpl

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_src/css/base.css

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,16 +1188,6 @@ the "!important" is necessary to override Fomantic UI menu item styles, meanwhil
11881188
text-overflow: ellipsis !important;
11891189
}
11901190

1191-
.ui.dropdown.text-flex-grow {
1192-
display: flex;
1193-
}
1194-
1195-
.ui.dropdown.text-flex-grow > .text {
1196-
display: flex;
1197-
flex-grow: 1;
1198-
justify-content: space-between;
1199-
}
1200-
12011191
.svg.octicon-file-directory-fill,
12021192
.svg.octicon-file-directory-open-fill,
12031193
.svg.octicon-file-submodule {

web_src/css/repo.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,33 @@
5050
width: 300px;
5151
}
5252

53-
.issue-sidebar-combo .ui.dropdown .item:not(.checked) .item-check-mark {
54-
visibility: hidden;
53+
.issue-content-right .ui.dropdown.full-width {
54+
width: 100%;
55+
}
56+
57+
.issue-content-right .ui.dropdown.full-width > .fixed-text {
58+
display: flex;
59+
flex-grow: 1;
60+
justify-content: space-between;
5561
}
5662

57-
.issue-content-right .dropdown > .menu {
63+
.issue-content-right .ui.dropdown > .menu {
5864
max-width: 270px;
5965
min-width: 0;
6066
max-height: 500px;
6167
overflow-x: auto;
6268
}
6369

64-
.issue-content-right .dropdown > .menu .item-secondary-info small {
70+
.issue-content-right .ui.dropdown > .menu .item-secondary-info small {
6571
display: block;
6672
text-overflow: ellipsis;
6773
overflow: hidden;
6874
}
6975

76+
.issue-sidebar-combo > .ui.dropdown .item:not(.checked) .item-check-mark {
77+
visibility: hidden;
78+
}
79+
7080
@media (max-width: 767.98px) {
7181
.issue-content-left,
7282
.issue-content-right {

web_src/fomantic/build/components/dropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4080,7 +4080,7 @@ $.fn.dropdown.settings = {
40804080
search : 'input.search, .menu > .search > input, .menu input.search',
40814081
sizer : '> span.sizer',
40824082
text : '> .text:not(.icon)',
4083-
unselectable : '.disabled, .filtered',
4083+
unselectable : '.disabled, .filtered, .tw-hidden', // GITEA-PATCH: tw-hidden hides the item so it is also unselectable
40844084
clearIcon : '> .remove.icon'
40854085
},
40864086

web_src/js/features/repo-issue-sidebar-combolist.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {fomanticQuery} from '../modules/fomantic/base.ts';
22
import {POST} from '../modules/fetch.ts';
3-
import {queryElemChildren, queryElems, toggleElem} from '../utils/dom.ts';
3+
import {addDelegatedEventListener, queryElemChildren, queryElems, toggleElem} from '../utils/dom.ts';
44

55
// if there are draft comments, confirm before reloading, to avoid losing comments
66
function issueSidebarReloadConfirmDraftComment() {
@@ -22,7 +22,7 @@ function issueSidebarReloadConfirmDraftComment() {
2222
window.location.reload();
2323
}
2424

25-
class IssueSidebarComboList {
25+
export class IssueSidebarComboList {
2626
updateUrl: string;
2727
updateAlgo: string;
2828
selectionMode: string;
@@ -95,9 +95,7 @@ class IssueSidebarComboList {
9595
}
9696
}
9797

98-
async onItemClick(e: Event) {
99-
const elItem = (e.target as HTMLElement).closest('.item');
100-
if (!elItem) return;
98+
async onItemClick(elItem: HTMLElement, e: Event) {
10199
e.preventDefault();
102100
if (elItem.hasAttribute('data-can-change') && elItem.getAttribute('data-can-change') !== 'true') return;
103101

@@ -146,16 +144,13 @@ class IssueSidebarComboList {
146144
}
147145
this.initialValues = this.collectCheckedValues();
148146

149-
this.elDropdown.addEventListener('click', (e) => this.onItemClick(e));
147+
addDelegatedEventListener(this.elDropdown, 'click', '.item', (el, e) => this.onItemClick(el, e));
150148

151149
fomanticQuery(this.elDropdown).dropdown('setting', {
152150
action: 'nothing', // do not hide the menu if user presses Enter
153151
fullTextSearch: 'exact',
152+
hideDividers: 'empty',
154153
onHide: () => this.onHide(),
155154
});
156155
}
157156
}
158-
159-
export function initIssueSidebarComboList(container: HTMLElement) {
160-
new IssueSidebarComboList(container).init();
161-
}

web_src/js/features/repo-issue-sidebar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {POST} from '../modules/fetch.ts';
22
import {queryElems, toggleElem} from '../utils/dom.ts';
3-
import {initIssueSidebarComboList} from './repo-issue-sidebar-combolist.ts';
3+
import {IssueSidebarComboList} from './repo-issue-sidebar-combolist.ts';
44

55
function initBranchSelector() {
66
// TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl"
@@ -48,5 +48,5 @@ export function initRepoIssueSidebar() {
4848
initRepoIssueDue();
4949

5050
// init the combo list: a dropdown for selecting items, and a list for showing selected items and related actions
51-
queryElems<HTMLElement>(document, '.issue-sidebar-combo', (el) => initIssueSidebarComboList(el));
51+
queryElems<HTMLElement>(document, '.issue-sidebar-combo', (el) => new IssueSidebarComboList(el).init());
5252
}

0 commit comments

Comments
 (0)