mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-21 05:54:38 +02:00
Merge branch 'go-gitea:main' into main
This commit is contained in:
commit
7f72fe9ef9
2
go.mod
2
go.mod
@ -1,6 +1,6 @@
|
|||||||
module code.gitea.io/gitea
|
module code.gitea.io/gitea
|
||||||
|
|
||||||
go 1.24
|
go 1.24.2
|
||||||
|
|
||||||
// rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
|
// rfc5280 said: "The serial number is an integer assigned by the CA to each certificate."
|
||||||
// But some CAs use negative serial number, just relax the check. related:
|
// But some CAs use negative serial number, just relax the check. related:
|
||||||
|
@ -11,8 +11,8 @@ type Tag struct {
|
|||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Commit *CommitMeta `json:"commit"`
|
Commit *CommitMeta `json:"commit"`
|
||||||
ZipballURL string `json:"zipball_url"`
|
ZipballURL string `json:"zipball_url,omitempty"`
|
||||||
TarballURL string `json:"tarball_url"`
|
TarballURL string `json:"tarball_url,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnnotatedTag represents an annotated tag
|
// AnnotatedTag represents an annotated tag
|
||||||
|
@ -11,11 +11,13 @@ import (
|
|||||||
// AccessToken represents an API access token.
|
// AccessToken represents an API access token.
|
||||||
// swagger:response AccessToken
|
// swagger:response AccessToken
|
||||||
type AccessToken struct {
|
type AccessToken struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Token string `json:"sha1"`
|
Token string `json:"sha1"`
|
||||||
TokenLastEight string `json:"token_last_eight"`
|
TokenLastEight string `json:"token_last_eight"`
|
||||||
Scopes []string `json:"scopes"`
|
Scopes []string `json:"scopes"`
|
||||||
|
Created time.Time `json:"created_at"`
|
||||||
|
Updated time.Time `json:"last_used_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AccessTokenList represents a list of API access token.
|
// AccessTokenList represents a list of API access token.
|
||||||
|
@ -16,6 +16,7 @@ type PublicKey struct {
|
|||||||
Fingerprint string `json:"fingerprint,omitempty"`
|
Fingerprint string `json:"fingerprint,omitempty"`
|
||||||
// swagger:strfmt date-time
|
// swagger:strfmt date-time
|
||||||
Created time.Time `json:"created_at,omitempty"`
|
Created time.Time `json:"created_at,omitempty"`
|
||||||
|
Updated time.Time `json:"last_used_at,omitempty"`
|
||||||
Owner *User `json:"user,omitempty"`
|
Owner *User `json:"user,omitempty"`
|
||||||
ReadOnly bool `json:"read_only,omitempty"`
|
ReadOnly bool `json:"read_only,omitempty"`
|
||||||
KeyType string `json:"key_type,omitempty"`
|
KeyType string `json:"key_type,omitempty"`
|
||||||
|
@ -450,6 +450,7 @@ use_scratch_code=Úsáid cód scratch
|
|||||||
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.
|
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.
|
||||||
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.
|
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.
|
||||||
twofa_scratch_token_incorrect=Tá do chód scratch mícheart.
|
twofa_scratch_token_incorrect=Tá do chód scratch mícheart.
|
||||||
|
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.
|
||||||
login_userpass=Sínigh isteach
|
login_userpass=Sínigh isteach
|
||||||
login_openid=OpenID
|
login_openid=OpenID
|
||||||
oauth_signup_tab=Cláraigh Cuntas Nua
|
oauth_signup_tab=Cláraigh Cuntas Nua
|
||||||
|
@ -450,6 +450,7 @@ use_scratch_code=Usar um código de recuperação
|
|||||||
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.
|
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.
|
||||||
twofa_passcode_incorrect=A senha está errada. Se perdeu o seu dispositivo, use o código de recuperação para iniciar a sessão.
|
twofa_passcode_incorrect=A senha está errada. Se perdeu o seu dispositivo, use o código de recuperação para iniciar a sessão.
|
||||||
twofa_scratch_token_incorrect=O código de recuperação está errado.
|
twofa_scratch_token_incorrect=O código de recuperação está errado.
|
||||||
|
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.
|
||||||
login_userpass=Iniciar sessão
|
login_userpass=Iniciar sessão
|
||||||
login_openid=OpenID
|
login_openid=OpenID
|
||||||
oauth_signup_tab=Fazer inscrição
|
oauth_signup_tab=Fazer inscrição
|
||||||
|
@ -62,6 +62,8 @@ func ListAccessTokens(ctx *context.APIContext) {
|
|||||||
Name: tokens[i].Name,
|
Name: tokens[i].Name,
|
||||||
TokenLastEight: tokens[i].TokenLastEight,
|
TokenLastEight: tokens[i].TokenLastEight,
|
||||||
Scopes: tokens[i].Scope.StringSlice(),
|
Scopes: tokens[i].Scope.StringSlice(),
|
||||||
|
Created: tokens[i].CreatedUnix.AsTime(),
|
||||||
|
Updated: tokens[i].UpdatedUnix.AsTime(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,13 +197,22 @@ func ToBranchProtection(ctx context.Context, bp *git_model.ProtectedBranch, repo
|
|||||||
|
|
||||||
// ToTag convert a git.Tag to an api.Tag
|
// ToTag convert a git.Tag to an api.Tag
|
||||||
func ToTag(repo *repo_model.Repository, t *git.Tag) *api.Tag {
|
func ToTag(repo *repo_model.Repository, t *git.Tag) *api.Tag {
|
||||||
|
tarballURL := util.URLJoin(repo.HTMLURL(), "archive", t.Name+".tar.gz")
|
||||||
|
zipballURL := util.URLJoin(repo.HTMLURL(), "archive", t.Name+".zip")
|
||||||
|
|
||||||
|
// Archive URLs are "" if the download feature is disabled
|
||||||
|
if setting.Repository.DisableDownloadSourceArchives {
|
||||||
|
tarballURL = ""
|
||||||
|
zipballURL = ""
|
||||||
|
}
|
||||||
|
|
||||||
return &api.Tag{
|
return &api.Tag{
|
||||||
Name: t.Name,
|
Name: t.Name,
|
||||||
Message: strings.TrimSpace(t.Message),
|
Message: strings.TrimSpace(t.Message),
|
||||||
ID: t.ID.String(),
|
ID: t.ID.String(),
|
||||||
Commit: ToCommitMeta(repo, t),
|
Commit: ToCommitMeta(repo, t),
|
||||||
ZipballURL: util.URLJoin(repo.HTMLURL(), "archive", t.Name+".zip"),
|
ZipballURL: zipballURL,
|
||||||
TarballURL: util.URLJoin(repo.HTMLURL(), "archive", t.Name+".tar.gz"),
|
TarballURL: tarballURL,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,6 +316,7 @@ func ToPublicKey(apiLink string, key *asymkey_model.PublicKey) *api.PublicKey {
|
|||||||
Title: key.Name,
|
Title: key.Name,
|
||||||
Fingerprint: key.Fingerprint,
|
Fingerprint: key.Fingerprint,
|
||||||
Created: key.CreatedUnix.AsTime(),
|
Created: key.CreatedUnix.AsTime(),
|
||||||
|
Updated: key.UpdatedUnix.AsTime(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/assignee?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/assignee?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||||
>
|
>
|
||||||
<input class="combo-value" name="assignee_ids" type="hidden" value="{{$data.SelectedAssigneeIDs}}">
|
<input class="combo-value" name="assignee_ids" type="hidden" value="{{$data.SelectedAssigneeIDs}}">
|
||||||
<div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||||
<a class="text muted">
|
<a class="fixed-text muted">
|
||||||
<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
<strong>{{ctx.Locale.Tr "repo.issues.new.assignees"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||||
</a>
|
</a>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
|
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
|
||||||
</div>
|
</div>
|
||||||
<div class="scrolling menu flex-items-block">
|
<div class="scrolling menu flex-items-block">
|
||||||
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
|
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
{{range $data.CandidateAssignees}}
|
{{range $data.CandidateAssignees}}
|
||||||
<a class="item" href="#" data-value="{{.ID}}">
|
<a class="item" href="#" data-value="{{.ID}}">
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/labels?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/labels?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||||
>
|
>
|
||||||
<input class="combo-value" name="label_ids" type="hidden" value="{{$data.SelectedLabelIDs}}">
|
<input class="combo-value" name="label_ids" type="hidden" value="{{$data.SelectedLabelIDs}}">
|
||||||
<div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||||
<a class="text muted">
|
<a class="fixed-text muted">
|
||||||
<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
<strong>{{ctx.Locale.Tr "repo.issues.new.labels"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||||
</a>
|
</a>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}">
|
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}">
|
||||||
</div>
|
</div>
|
||||||
<div class="scrolling menu">
|
<div class="scrolling menu">
|
||||||
<a class="item clear-selection" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
|
<a class="item clear-selection" data-text="" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
{{$previousExclusiveScope := "_no_scope"}}
|
{{$previousExclusiveScope := "_no_scope"}}
|
||||||
{{range $data.RepoLabels}}
|
{{range $data.RepoLabels}}
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/milestone?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/milestone?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||||
>
|
>
|
||||||
<input class="combo-value" name="milestone_id" type="hidden" value="{{$data.SelectedMilestoneID}}">
|
<input class="combo-value" name="milestone_id" type="hidden" value="{{$data.SelectedMilestoneID}}">
|
||||||
<div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||||
<a class="text muted">
|
<a class="fixed-text muted">
|
||||||
<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
<strong>{{ctx.Locale.Tr "repo.issues.new.milestone"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||||
</a>
|
</a>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
@ -19,7 +19,7 @@
|
|||||||
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}">
|
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}">
|
||||||
</div>
|
</div>
|
||||||
<div class="scrolling menu">
|
<div class="scrolling menu">
|
||||||
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
|
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
{{if $data.OpenMilestones}}
|
{{if $data.OpenMilestones}}
|
||||||
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
|
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/projects?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/projects?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||||
>
|
>
|
||||||
<input class="combo-value" name="project_id" type="hidden" value="{{$data.SelectedProjectID}}">
|
<input class="combo-value" name="project_id" type="hidden" value="{{$data.SelectedProjectID}}">
|
||||||
<div class="ui dropdown text-flex-grow {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
<div class="ui dropdown full-width {{if not $pageMeta.CanModifyIssueOrPull}}disabled{{end}}">
|
||||||
<a class="text muted">
|
<a class="fixed-text muted">
|
||||||
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
<strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> {{if $pageMeta.CanModifyIssueOrPull}}{{svg "octicon-gear"}}{{end}}
|
||||||
</a>
|
</a>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="scrolling menu">
|
<div class="scrolling menu">
|
||||||
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
|
<div class="item clear-selection" data-text="">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
{{if $data.OpenProjects}}
|
{{if $data.OpenProjects}}
|
||||||
<div class="header">{{ctx.Locale.Tr "repo.issues.new.open_projects"}}</div>
|
<div class="header">{{ctx.Locale.Tr "repo.issues.new.open_projects"}}</div>
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/request_review?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
{{if $pageMeta.Issue}}data-update-url="{{$pageMeta.RepoLink}}/issues/request_review?issue_ids={{$pageMeta.Issue.ID}}"{{end}}
|
||||||
>
|
>
|
||||||
<input type="hidden" class="combo-value" name="reviewer_ids">{{/* match CreateIssueForm */}}
|
<input type="hidden" class="combo-value" name="reviewer_ids">{{/* match CreateIssueForm */}}
|
||||||
<div class="ui dropdown text-flex-grow {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
|
<div class="ui dropdown full-width {{if or (not $hasCandidates) (not $data.CanChooseReviewer)}}disabled{{end}}">
|
||||||
<a class="text muted">
|
<a class="fixed-text muted">
|
||||||
<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if $data.CanChooseReviewer}}{{svg "octicon-gear"}}{{end}}
|
<strong>{{ctx.Locale.Tr "repo.issues.review.reviewers"}}</strong> {{if $data.CanChooseReviewer}}{{svg "octicon-gear"}}{{end}}
|
||||||
</a>
|
</a>
|
||||||
<div class="menu flex-items-menu">
|
<div class="menu flex-items-menu">
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
|
{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<div>
|
<div>
|
||||||
<div class="ui dropdown text-flex-grow jump">
|
<div class="ui dropdown full-width jump">
|
||||||
<a class="text muted">
|
<a class="fixed-text muted">
|
||||||
<div>
|
<div>
|
||||||
<strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong> {{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}}
|
<strong>{{ctx.Locale.Tr "repo.issues.tracker"}}</strong>
|
||||||
|
{{if $.IsStopwatchRunning}}{{svg "octicon-stopwatch"}}{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{svg "octicon-gear"}}
|
{{svg "octicon-gear"}}
|
||||||
</a>
|
</a>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<h2>{{ctx.Locale.Tr "repo.wiki.welcome"}}</h2>
|
<h2>{{ctx.Locale.Tr "repo.wiki.welcome"}}</h2>
|
||||||
<p>{{ctx.Locale.Tr "repo.wiki.welcome_desc"}}</p>
|
<p>{{ctx.Locale.Tr "repo.wiki.welcome_desc"}}</p>
|
||||||
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
|
||||||
<a class="ui primary button" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a>
|
<a class="ui primary button tw-mr-0" href="{{.RepoLink}}/wiki?action=_new">{{ctx.Locale.Tr "repo.wiki.create_first_page"}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="ui small secondary filter menu">
|
<div class="ui small secondary filter menu">
|
||||||
<form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-gap-x-2">
|
<form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-items-center tw-gap-x-2">
|
||||||
{{if .Language}}<input type="hidden" name="language" value="{{.Language}}">{{end}}
|
{{if .Language}}<input type="hidden" name="language" value="{{.Language}}">{{end}}
|
||||||
{{if .PageIsExploreRepositories}}<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">{{end}}
|
{{if .PageIsExploreRepositories}}<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">{{end}}
|
||||||
{{if .TabName}}<input type="hidden" name="tab" value="{{.TabName}}">{{end}}
|
{{if .TabName}}<input type="hidden" name="tab" value="{{.TabName}}">{{end}}
|
||||||
|
15
templates/swagger/v1_json.tmpl
generated
15
templates/swagger/v1_json.tmpl
generated
@ -19978,11 +19978,21 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "AccessToken represents an API access token.",
|
"title": "AccessToken represents an API access token.",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"created_at": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
|
"x-go-name": "Created"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"x-go-name": "ID"
|
"x-go-name": "ID"
|
||||||
},
|
},
|
||||||
|
"last_used_at": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
|
"x-go-name": "Updated"
|
||||||
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"x-go-name": "Name"
|
"x-go-name": "Name"
|
||||||
@ -25477,6 +25487,11 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"x-go-name": "KeyType"
|
"x-go-name": "KeyType"
|
||||||
},
|
},
|
||||||
|
"last_used_at": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time",
|
||||||
|
"x-go-name": "Updated"
|
||||||
|
},
|
||||||
"read_only": {
|
"read_only": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"x-go-name": "ReadOnly"
|
"x-go-name": "ReadOnly"
|
||||||
|
@ -1188,16 +1188,6 @@ the "!important" is necessary to override Fomantic UI menu item styles, meanwhil
|
|||||||
text-overflow: ellipsis !important;
|
text-overflow: ellipsis !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui.dropdown.text-flex-grow {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui.dropdown.text-flex-grow > .text {
|
|
||||||
display: flex;
|
|
||||||
flex-grow: 1;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.svg.octicon-file-directory-fill,
|
.svg.octicon-file-directory-fill,
|
||||||
.svg.octicon-file-directory-open-fill,
|
.svg.octicon-file-directory-open-fill,
|
||||||
.svg.octicon-file-submodule {
|
.svg.octicon-file-submodule {
|
||||||
|
@ -50,23 +50,33 @@
|
|||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.issue-sidebar-combo .ui.dropdown .item:not(.checked) .item-check-mark {
|
.issue-content-right .ui.dropdown.full-width {
|
||||||
visibility: hidden;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.issue-content-right .dropdown > .menu {
|
.issue-content-right .ui.dropdown.full-width > .fixed-text {
|
||||||
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.issue-content-right .ui.dropdown > .menu {
|
||||||
max-width: 270px;
|
max-width: 270px;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.issue-content-right .dropdown > .menu .item-secondary-info small {
|
.issue-content-right .ui.dropdown > .menu .item-secondary-info small {
|
||||||
display: block;
|
display: block;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.issue-sidebar-combo > .ui.dropdown .item:not(.checked) .item-check-mark {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 767.98px) {
|
@media (max-width: 767.98px) {
|
||||||
.issue-content-left,
|
.issue-content-left,
|
||||||
.issue-content-right {
|
.issue-content-right {
|
||||||
|
@ -4080,7 +4080,7 @@ $.fn.dropdown.settings = {
|
|||||||
search : 'input.search, .menu > .search > input, .menu input.search',
|
search : 'input.search, .menu > .search > input, .menu input.search',
|
||||||
sizer : '> span.sizer',
|
sizer : '> span.sizer',
|
||||||
text : '> .text:not(.icon)',
|
text : '> .text:not(.icon)',
|
||||||
unselectable : '.disabled, .filtered',
|
unselectable : '.disabled, .filtered, .tw-hidden', // GITEA-PATCH: tw-hidden hides the item so it is also unselectable
|
||||||
clearIcon : '> .remove.icon'
|
clearIcon : '> .remove.icon'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {fomanticQuery} from '../modules/fomantic/base.ts';
|
import {fomanticQuery} from '../modules/fomantic/base.ts';
|
||||||
import {POST} from '../modules/fetch.ts';
|
import {POST} from '../modules/fetch.ts';
|
||||||
import {queryElemChildren, queryElems, toggleElem} from '../utils/dom.ts';
|
import {addDelegatedEventListener, queryElemChildren, queryElems, toggleElem} from '../utils/dom.ts';
|
||||||
|
|
||||||
// if there are draft comments, confirm before reloading, to avoid losing comments
|
// if there are draft comments, confirm before reloading, to avoid losing comments
|
||||||
function issueSidebarReloadConfirmDraftComment() {
|
function issueSidebarReloadConfirmDraftComment() {
|
||||||
@ -22,7 +22,7 @@ function issueSidebarReloadConfirmDraftComment() {
|
|||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
class IssueSidebarComboList {
|
export class IssueSidebarComboList {
|
||||||
updateUrl: string;
|
updateUrl: string;
|
||||||
updateAlgo: string;
|
updateAlgo: string;
|
||||||
selectionMode: string;
|
selectionMode: string;
|
||||||
@ -95,9 +95,7 @@ class IssueSidebarComboList {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async onItemClick(e: Event) {
|
async onItemClick(elItem: HTMLElement, e: Event) {
|
||||||
const elItem = (e.target as HTMLElement).closest('.item');
|
|
||||||
if (!elItem) return;
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (elItem.hasAttribute('data-can-change') && elItem.getAttribute('data-can-change') !== 'true') return;
|
if (elItem.hasAttribute('data-can-change') && elItem.getAttribute('data-can-change') !== 'true') return;
|
||||||
|
|
||||||
@ -146,16 +144,13 @@ class IssueSidebarComboList {
|
|||||||
}
|
}
|
||||||
this.initialValues = this.collectCheckedValues();
|
this.initialValues = this.collectCheckedValues();
|
||||||
|
|
||||||
this.elDropdown.addEventListener('click', (e) => this.onItemClick(e));
|
addDelegatedEventListener(this.elDropdown, 'click', '.item', (el, e) => this.onItemClick(el, e));
|
||||||
|
|
||||||
fomanticQuery(this.elDropdown).dropdown('setting', {
|
fomanticQuery(this.elDropdown).dropdown('setting', {
|
||||||
action: 'nothing', // do not hide the menu if user presses Enter
|
action: 'nothing', // do not hide the menu if user presses Enter
|
||||||
fullTextSearch: 'exact',
|
fullTextSearch: 'exact',
|
||||||
|
hideDividers: 'empty',
|
||||||
onHide: () => this.onHide(),
|
onHide: () => this.onHide(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initIssueSidebarComboList(container: HTMLElement) {
|
|
||||||
new IssueSidebarComboList(container).init();
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {POST} from '../modules/fetch.ts';
|
import {POST} from '../modules/fetch.ts';
|
||||||
import {queryElems, toggleElem} from '../utils/dom.ts';
|
import {queryElems, toggleElem} from '../utils/dom.ts';
|
||||||
import {initIssueSidebarComboList} from './repo-issue-sidebar-combolist.ts';
|
import {IssueSidebarComboList} from './repo-issue-sidebar-combolist.ts';
|
||||||
|
|
||||||
function initBranchSelector() {
|
function initBranchSelector() {
|
||||||
// TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl"
|
// TODO: RemoveIssueRef: see "repo/issue/branch_selector_field.tmpl"
|
||||||
@ -48,5 +48,5 @@ export function initRepoIssueSidebar() {
|
|||||||
initRepoIssueDue();
|
initRepoIssueDue();
|
||||||
|
|
||||||
// init the combo list: a dropdown for selecting items, and a list for showing selected items and related actions
|
// init the combo list: a dropdown for selecting items, and a list for showing selected items and related actions
|
||||||
queryElems<HTMLElement>(document, '.issue-sidebar-combo', (el) => initIssueSidebarComboList(el));
|
queryElems<HTMLElement>(document, '.issue-sidebar-combo', (el) => new IssueSidebarComboList(el).init());
|
||||||
}
|
}
|
||||||
|
@ -228,12 +228,13 @@ function attachDomEvents(dropdown: HTMLElement, focusable: HTMLElement, menu: HT
|
|||||||
dropdown.addEventListener('keydown', (e: KeyboardEvent) => {
|
dropdown.addEventListener('keydown', (e: KeyboardEvent) => {
|
||||||
// here it must use keydown event before dropdown's keyup handler, otherwise there is no Enter event in our keyup handler
|
// here it must use keydown event before dropdown's keyup handler, otherwise there is no Enter event in our keyup handler
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
const dropdownCall = fomanticDropdownFn.bind($(dropdown));
|
const elItem = menu.querySelector<HTMLElement>(':scope > .item.selected, .menu > .item.selected');
|
||||||
let $item = dropdownCall('get item', dropdownCall('get value'));
|
|
||||||
if (!$item) $item = $(menu).find('> .item.selected'); // when dropdown filters items by input, there is no "value", so query the "selected" item
|
|
||||||
// if the selected item is clickable, then trigger the click event.
|
// if the selected item is clickable, then trigger the click event.
|
||||||
// we can not click any item without check, because Fomantic code might also handle the Enter event. that would result in double click.
|
// we can not click any item without check, because Fomantic code might also handle the Enter event. that would result in double click.
|
||||||
if ($item?.[0]?.matches('a, .js-aria-clickable')) $item[0].click();
|
if (elItem?.matches('a, .js-aria-clickable') && !elItem.matches('.tw-hidden, .filtered')) {
|
||||||
|
e.preventDefault();
|
||||||
|
elItem.click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user