Compare commits

...

5 Commits

Author SHA1 Message Date
Giteabot
95db95ef91
Fix incorrect "tab" parameter for repo search sub-template (#27755) (#27764)
Backport #27755 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-10-24 11:01:26 +08:00
Denys Konovalov
ffab2b7e4f
fix issues in translation file (#27699) (#27737)
Backport #27699 

- use correct comment sign for INI (`;`)
- remove duplicated `repo.branch.search` key
- remove duplicated spaces & similar
2023-10-24 01:53:01 +00:00
Giteabot
cb9e10f971
Fix label render containing invalid HTML (#27752) (#27762)
Backport #27752 by @earl-warren

- The label HTML contained a quote that wasn't being closed.

Refs: https://codeberg.org/forgejo/forgejo/pulls/1651

(cherry picked from commit e2bc2c9a1fff482c49dbeb3a51e4e1c698bf506c)

Co-authored-by: Earl Warren <109468362+earl-warren@users.noreply.github.com>
Co-authored-by: Gusted <postmaster@gusted.xyz>
2023-10-24 09:39:13 +08:00
Giteabot
5087de1a5c
Fix link-action redirect network error (#27734) (#27749)
Backport #27734 by @lng2020

<img width="823" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/99da3d5a-c28a-4fd0-8ae0-88461a9142e2">

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2023-10-23 13:52:30 +00:00
Giteabot
f2bac791db
Fix duplicate project board when hitting enter key (#27746) (#27751)
Backport #27746 by @lng2020

When hitting the `enter` key to create a new project column, the request
is sent twice because the `submit` event and `key up` event are both
triggered.
Probably a better solution is to rewrite these parts of the code to
avoid using native jQuery but reuse the `form-fetch-action` class. But
it's beyond my ability.

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
2023-10-23 13:04:53 +00:00
6 changed files with 20 additions and 34 deletions

View File

@ -179,7 +179,7 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) template.HTML {
s := fmt.Sprintf("<span class='ui label scope-parent' title='%s'>"+ s := fmt.Sprintf("<span class='ui label scope-parent' title='%s'>"+
"<div class='ui label scope-left' style='color: %s !important; background-color: %s !important'>%s</div>"+ "<div class='ui label scope-left' style='color: %s !important; background-color: %s !important'>%s</div>"+
"<div class='ui label scope-right' style='color: %s !important; background-color: %s !important''>%s</div>"+ "<div class='ui label scope-right' style='color: %s !important; background-color: %s !important'>%s</div>"+
"</span>", "</span>",
description, description,
textColor, scopeColor, scopeText, textColor, scopeColor, scopeText,

View File

@ -353,7 +353,6 @@ code_last_indexed_at = Last indexed %s
relevant_repositories_tooltip = Repositories that are forks or that have no topic, no icon, and no description are hidden. relevant_repositories_tooltip = Repositories that are forks or that have no topic, no icon, and no description are hidden.
relevant_repositories = Only relevant repositories are being shown, <a href="%s">show unfiltered results</a>. relevant_repositories = Only relevant repositories are being shown, <a href="%s">show unfiltered results</a>.
[auth] [auth]
create_new_account = Register Account create_new_account = Register Account
register_helper_msg = Already have an account? Sign in now! register_helper_msg = Already have an account? Sign in now!
@ -855,7 +854,7 @@ oauth2_client_secret_hint = The secret will not be shown again after you leave o
oauth2_application_edit = Edit oauth2_application_edit = Edit
oauth2_application_create_description = OAuth2 applications gives your third-party application access to user accounts on this instance. oauth2_application_create_description = OAuth2 applications gives your third-party application access to user accounts on this instance.
oauth2_application_remove_description = Removing an OAuth2 application will prevent it from accessing authorized user accounts on this instance. Continue? oauth2_application_remove_description = Removing an OAuth2 application will prevent it from accessing authorized user accounts on this instance. Continue?
oauth2_application_locked = Gitea pre-registers some OAuth2 applications on startup if enabled in config. To prevent unexpected bahavior, these can neither be edited nor removed. Please refer to the OAuth2 documentation for more information. oauth2_application_locked = Gitea pre-registers some OAuth2 applications on startup if enabled in config. To prevent unexpected behavior, these can neither be edited nor removed. Please refer to the OAuth2 documentation for more information.
authorized_oauth2_applications = Authorized OAuth2 Applications authorized_oauth2_applications = Authorized OAuth2 Applications
authorized_oauth2_applications_description = You have granted access to your personal Gitea account to these third party applications. Please revoke access for applications you no longer need. authorized_oauth2_applications_description = You have granted access to your personal Gitea account to these third party applications. Please revoke access for applications you no longer need.
@ -923,7 +922,7 @@ visibility.private = Private
visibility.private_tooltip = Visible only to members of organizations you have joined visibility.private_tooltip = Visible only to members of organizations you have joined
[repo] [repo]
new_repo_helper = A repository contains all project files, including revision history. Already hosting one elsewhere? <a href="%s">Migrate repository.</a> new_repo_helper = A repository contains all project files, including revision history. Already hosting one elsewhere? <a href="%s">Migrate repository.</a>
owner = Owner owner = Owner
owner_helper = Some organizations may not show up in the dropdown due to a maximum repository count limit. owner_helper = Some organizations may not show up in the dropdown due to a maximum repository count limit.
repo_name = Repository Name repo_name = Repository Name
@ -1018,9 +1017,9 @@ tree_path_not_found_branch = Path %[1]s doesn't exist in branch %[2]s
tree_path_not_found_tag = Path %[1]s doesn't exist in tag %[2]s tree_path_not_found_tag = Path %[1]s doesn't exist in tag %[2]s
transfer.accept = Accept Transfer transfer.accept = Accept Transfer
transfer.accept_desc = Transfer to "%s" transfer.accept_desc = Transfer to "%s"
transfer.reject = Reject Transfer transfer.reject = Reject Transfer
transfer.reject_desc = Cancel transfer to "%s" transfer.reject_desc = Cancel transfer to "%s"
transfer.no_permission_to_accept = You do not have permission to accept this transfer. transfer.no_permission_to_accept = You do not have permission to accept this transfer.
transfer.no_permission_to_reject = You do not have permission to reject this transfer. transfer.no_permission_to_reject = You do not have permission to reject this transfer.
@ -1154,7 +1153,7 @@ releases = Releases
tag = Tag tag = Tag
released_this = released this released_this = released this
tagged_this = tagged this tagged_this = tagged this
file.title = %s at %s file.title = %s at %s
file_raw = Raw file_raw = Raw
file_history = History file_history = History
file_view_source = View Source file_view_source = View Source
@ -2500,7 +2499,6 @@ release.releases_for = Releases for %s
release.tags_for = Tags for %s release.tags_for = Tags for %s
branch.name = Branch Name branch.name = Branch Name
branch.search = Search branches
branch.already_exists = A branch named "%s" already exists. branch.already_exists = A branch named "%s" already exists.
branch.delete_head = Delete branch.delete_head = Delete
branch.delete = Delete Branch "%s" branch.delete = Delete Branch "%s"
@ -3169,8 +3167,8 @@ monitor.start = Start Time
monitor.execute_time = Execution Time monitor.execute_time = Execution Time
monitor.last_execution_result = Result monitor.last_execution_result = Result
monitor.process.cancel = Cancel process monitor.process.cancel = Cancel process
monitor.process.cancel_desc = Cancelling a process may cause data loss monitor.process.cancel_desc = Cancelling a process may cause data loss
monitor.process.cancel_notices = Cancel: <strong>%s</strong>? monitor.process.cancel_notices = Cancel: <strong>%s</strong>?
monitor.process.children = Children monitor.process.children = Children
monitor.queues = Queues monitor.queues = Queues
@ -3234,7 +3232,7 @@ mirror_sync_create = synced new reference <a href="%[2]s">%[3]s</a> to <a href="
mirror_sync_delete = synced and deleted reference <code>%[2]s</code> at <a href="%[1]s">%[3]s</a> from mirror mirror_sync_delete = synced and deleted reference <code>%[2]s</code> at <a href="%[1]s">%[3]s</a> from mirror
approve_pull_request = `approved <a href="%[1]s">%[3]s#%[2]s</a>` approve_pull_request = `approved <a href="%[1]s">%[3]s#%[2]s</a>`
reject_pull_request = `suggested changes for <a href="%[1]s">%[3]s#%[2]s</a>` reject_pull_request = `suggested changes for <a href="%[1]s">%[3]s#%[2]s</a>`
publish_release = `released <a href="%[2]s"> "%[4]s" </a> at <a href="%[1]s">%[3]s</a>` publish_release = `released <a href="%[2]s"> "%[4]s" </a> at <a href="%[1]s">%[3]s</a>`
review_dismissed = `dismissed review from <b>%[4]s</b> for <a href="%[1]s">%[3]s#%[2]s</a>` review_dismissed = `dismissed review from <b>%[4]s</b> for <a href="%[1]s">%[3]s#%[2]s</a>`
review_dismissed_reason = Reason: review_dismissed_reason = Reason:
create_branch = created branch <a href="%[2]s">%[3]s</a> in <a href="%[1]s">%[4]s</a> create_branch = created branch <a href="%[2]s">%[3]s</a> in <a href="%[1]s">%[4]s</a>
@ -3560,7 +3558,7 @@ type-3.display_name = Organization Project
[git.filemode] [git.filemode]
changed_filemode = %[1]s → %[2]s changed_filemode = %[1]s → %[2]s
# Ordered by git filemode value, ascending. E.g. directory has "040000", normal file has "100644", … ; Ordered by git filemode value, ascending. E.g. directory has "040000", normal file has "100644", …
directory = Directory directory = Directory
normal_file = Normal file normal_file = Normal file
executable_file = Executable file executable_file = Executable file

View File

@ -225,14 +225,15 @@ func EditMilestonePost(ctx *context.Context) {
// ChangeMilestoneStatus response for change a milestone's status // ChangeMilestoneStatus response for change a milestone's status
func ChangeMilestoneStatus(ctx *context.Context) { func ChangeMilestoneStatus(ctx *context.Context) {
toClose := false var toClose bool
switch ctx.Params(":action") { switch ctx.Params(":action") {
case "open": case "open":
toClose = false toClose = false
case "close": case "close":
toClose = true toClose = true
default: default:
ctx.Redirect(ctx.Repo.RepoLink + "/milestones") ctx.JSONRedirect(ctx.Repo.RepoLink + "/milestones")
return
} }
id := ctx.ParamsInt64(":id") id := ctx.ParamsInt64(":id")
@ -244,7 +245,7 @@ func ChangeMilestoneStatus(ctx *context.Context) {
} }
return return
} }
ctx.Redirect(ctx.Repo.RepoLink + "/milestones?state=" + url.QueryEscape(ctx.Params(":action"))) ctx.JSONRedirect(ctx.Repo.RepoLink + "/milestones?state=" + url.QueryEscape(ctx.Params(":action")))
} }
// DeleteMilestone delete a milestone // DeleteMilestone delete a milestone

View File

@ -161,14 +161,15 @@ func NewProjectPost(ctx *context.Context) {
// ChangeProjectStatus updates the status of a project between "open" and "close" // ChangeProjectStatus updates the status of a project between "open" and "close"
func ChangeProjectStatus(ctx *context.Context) { func ChangeProjectStatus(ctx *context.Context) {
toClose := false var toClose bool
switch ctx.Params(":action") { switch ctx.Params(":action") {
case "open": case "open":
toClose = false toClose = false
case "close": case "close":
toClose = true toClose = true
default: default:
ctx.Redirect(ctx.Repo.RepoLink + "/projects") ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects")
return
} }
id := ctx.ParamsInt64(":id") id := ctx.ParamsInt64(":id")
@ -180,7 +181,7 @@ func ChangeProjectStatus(ctx *context.Context) {
} }
return return
} }
ctx.Redirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action"))) ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action")))
} }
// DeleteProject delete a project // DeleteProject delete a project

View File

@ -6,8 +6,8 @@
{{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}} {{template "shared/searchinput" dict "Value" .Keyword "AutoFocus" true}}
{{if .PageIsExploreRepositories}} {{if .PageIsExploreRepositories}}
<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}"> <input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">
{{else}} {{else if .TabName}}
<input type="hidden" name="tab" value="repositories"> <input type="hidden" name="tab" value="{{.TabName}}">
{{end}} {{end}}
<button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button>
</div> </div>

View File

@ -193,20 +193,6 @@ export function initRepoProject() {
const url = $(this).data('url'); const url = $(this).data('url');
createNewColumn(url, columnTitle, projectColorInput); createNewColumn(url, columnTitle, projectColorInput);
}); });
$('.new-project-column').on('input keyup', (e) => {
const columnTitle = $('#new_project_column');
const projectColorInput = $('#new_project_column_color_picker');
if (!columnTitle.val()) {
$('#new_project_column_submit').addClass('disabled');
return;
}
$('#new_project_column_submit').removeClass('disabled');
if (e.key === 'Enter') {
const url = $(this).data('url');
createNewColumn(url, columnTitle, projectColorInput);
}
});
} }
function setLabelColor(label, color) { function setLabelColor(label, color) {