Compare commits

...

5 Commits

Author SHA1 Message Date
wxiaoguang
f3956fcb28
Fix incorrect ctx usage in defer function (#27740) 2023-10-22 14:12:27 +00:00
silverwind
d8c09c25d1
Enable followCursor for language stats bar (#27713)
Fixes: https://github.com/go-gitea/gitea/issues/27600


![](https://github.com/go-gitea/gitea/assets/115237/96743d90-0712-4f13-84ec-66f84e6ed2d7)

Also tested together with https://github.com/go-gitea/gitea/pull/27704,
works well.
2023-10-22 13:06:04 +00:00
tomholford
e3afe4a248
teams: new View button (#27685)
Per the discussion on #22054, the flow for adding a new team member to
an org is not intuitive for new Gitea users.

The ideal solution would be to add a new button on the Org > Members
index view (see the screenshot mockup in the issue description).
However, this would require a refactor of the UX for the flow. The
current flow has an implicit context of which team within the org the
new member is being added to ('Owners' by default). From the Members
index, there is no implicit context; the flow would have to add a picker
for which team the new member should be added to.

So, as a stopgap, this change simply adds a button to the Teams index
page that performs the same action as clicking on the title of the team
(a behavior that is currently too obscure as indicated in the comments
on the issue). This should reduce support burden and serve as a decent
temporary measure until the Add Member flow is refactored.

---------

Co-authored-by: tomholford <tomholford@users.noreply.github.com>
2023-10-22 12:34:16 +00:00
Denys Konovalov
16cfa17844
fix issues in translation file (#27699)
- use correct comment sign for INI (`;`)
- remove duplicated `repo.branch.search` key
- remove duplicated spaces & similar
2023-10-22 11:59:31 +00:00
HoshinoRei
9b991f2947
Fix an indentation in the Chinese documentation of Act Runner (#27730)
In the [English
document](https://docs.gitea.com/1.21/usage/actions/act-runner#configuring-cache-when-starting-a-runner-using-docker-image),
there is indentation here, but there is no indentation in the Chinese
document.
2023-10-22 19:37:56 +08:00
6 changed files with 23 additions and 23 deletions

View File

@ -208,12 +208,12 @@ services:
```yaml ```yaml
cache: cache:
enabled: true enabled: true
dir: "" dir: ""
# 使用步骤 1. 获取的 LAN IP # 使用步骤 1. 获取的 LAN IP
host: "192.168.8.17" host: "192.168.8.17"
# 使用步骤 2. 获取的端口号 # 使用步骤 2. 获取的端口号
port: 8088 port: 8088
``` ```
- 4.启动容器时, 将 Cache 端口映射至主机。 - 4.启动容器时, 将 Cache 端口映射至主机。

View File

@ -91,6 +91,7 @@ remove = Remove
remove_all = Remove All remove_all = Remove All
remove_label_str = Remove item "%s" remove_label_str = Remove item "%s"
edit = Edit edit = Edit
view = View
enabled = Enabled enabled = Enabled
disabled = Disabled disabled = Disabled
@ -355,7 +356,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!
@ -858,7 +858,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.
@ -926,7 +926,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
@ -1023,9 +1023,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.
@ -1159,7 +1159,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
@ -2507,7 +2507,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"
@ -3174,8 +3173,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
@ -3239,7 +3238,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>
@ -3565,7 +3564,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

@ -42,13 +42,11 @@ func handleCreateError(owner *user_model.User, err error) error {
} }
func runMigrateTask(ctx context.Context, t *admin_model.Task) (err error) { func runMigrateTask(ctx context.Context, t *admin_model.Task) (err error) {
defer func() { defer func(ctx context.Context) {
if e := recover(); e != nil { if e := recover(); e != nil {
err = fmt.Errorf("PANIC whilst trying to do migrate task: %v", e) err = fmt.Errorf("PANIC whilst trying to do migrate task: %v", e)
log.Critical("PANIC during runMigrateTask[%d] by DoerID[%d] to RepoID[%d] for OwnerID[%d]: %v\nStacktrace: %v", t.ID, t.DoerID, t.RepoID, t.OwnerID, e, log.Stack(2)) log.Critical("PANIC during runMigrateTask[%d] by DoerID[%d] to RepoID[%d] for OwnerID[%d]: %v\nStacktrace: %v", t.ID, t.DoerID, t.RepoID, t.OwnerID, e, log.Stack(2))
} }
// fixme: Because ctx is canceled here, so the db.DefaultContext is needed.
ctx := db.DefaultContext
if err == nil { if err == nil {
err = admin_model.FinishMigrateTask(ctx, t) err = admin_model.FinishMigrateTask(ctx, t)
if err == nil { if err == nil {
@ -69,7 +67,7 @@ func runMigrateTask(ctx context.Context, t *admin_model.Task) (err error) {
} }
// then, do not delete the repository, otherwise the users won't be able to see the last error // then, do not delete the repository, otherwise the users won't be able to see the last error
}() }(graceful.GetManager().ShutdownContext()) // even if the parent ctx is canceled, this defer-function still needs to update the task record in database
if err = t.LoadRepo(ctx); err != nil { if err = t.LoadRepo(ctx); err != nil {
return err return err

View File

@ -16,6 +16,7 @@
<div class="ui top attached header"> <div class="ui top attached header">
<a class="text black" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.Name}}</strong></a> <a class="text black" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}"><strong>{{.Name}}</strong></a>
<div class="ui right"> <div class="ui right">
<a class="ui primary tiny button" href="{{$.OrgLink}}/teams/{{.LowerName | PathEscape}}">{{ctx.Locale.Tr "view"}}</a>
{{if .IsMember ctx $.SignedUser.ID}} {{if .IsMember ctx $.SignedUser.ID}}
<form> <form>
<button class="ui red tiny button delete-button" data-modal-id="leave-team" <button class="ui red tiny button delete-button" data-modal-id="leave-team"

View File

@ -38,7 +38,7 @@
</div> </div>
<a class="ui segment language-stats show-panel toggle" data-panel=".repository-summary > .sub-menu"> <a class="ui segment language-stats show-panel toggle" data-panel=".repository-summary > .sub-menu">
{{range .LanguageStats}} {{range .LanguageStats}}
<div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-tooltip-placement="top" data-tooltip-content={{.Language}}></div> <div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-tooltip-placement="top" data-tooltip-content={{.Language}} data-tooltip-follow-cursor="horizontal"></div>
{{end}} {{end}}
</a> </a>
{{end}} {{end}}

View File

@ -1,4 +1,4 @@
import tippy from 'tippy.js'; import tippy, {followCursor} from 'tippy.js';
const visibleInstances = new Set(); const visibleInstances = new Set();
@ -35,6 +35,7 @@ export function createTippy(target, opts = {}) {
arrow: `<svg width="16" height="7"><path d="m0 7 8-7 8 7Z" class="tippy-svg-arrow-outer"/><path d="m0 8 8-7 8 7Z" class="tippy-svg-arrow-inner"/></svg>`, arrow: `<svg width="16" height="7"><path d="m0 7 8-7 8 7Z" class="tippy-svg-arrow-outer"/><path d="m0 8 8-7 8 7Z" class="tippy-svg-arrow-inner"/></svg>`,
role: 'menu', // HTML role attribute, only tooltips should use "tooltip" role: 'menu', // HTML role attribute, only tooltips should use "tooltip"
theme: other.role || 'menu', // CSS theme, we support either "tooltip" or "menu" theme: other.role || 'menu', // CSS theme, we support either "tooltip" or "menu"
plugins: [followCursor],
...other, ...other,
}); });
@ -78,6 +79,7 @@ function attachTooltip(target, content = null) {
theme: 'tooltip', theme: 'tooltip',
hideOnClick, hideOnClick,
placement: target.getAttribute('data-tooltip-placement') || 'top-start', placement: target.getAttribute('data-tooltip-placement') || 'top-start',
followCursor: target.getAttribute('data-tooltip-follow-cursor') || false,
...(target.getAttribute('data-tooltip-interactive') === 'true' ? {interactive: true, aria: {content: 'describedby', expanded: false}} : {}), ...(target.getAttribute('data-tooltip-interactive') === 'true' ? {interactive: true, aria: {content: 'describedby', expanded: false}} : {}),
}; };