diff options
author | Otto Richter <git@otto.splvs.net> | 2024-12-30 16:06:18 +0100 |
---|---|---|
committer | Otto Richter <git@otto.splvs.net> | 2024-12-30 16:06:18 +0100 |
commit | c67d63d88a77f81b3f79b75642624b3457d4e8b6 (patch) | |
tree | 1ea90505ff53d4944ba3aa0a3a0b2d29c760ded8 /templates | |
parent | Merge pull request 'fix: use DateUtils for blocked users list' (#6410) from g... (diff) | |
download | forgejo-c67d63d88a77f81b3f79b75642624b3457d4e8b6.tar.xz forgejo-c67d63d88a77f81b3f79b75642624b3457d4e8b6.zip |
Fix issue/comment menus
Closes https://codeberg.org/forgejo/forgejo/issues/1120
- Adds labels to reaction and context menu.
- Fixes taborder in markdown combobox buttons. They are now only one
"tab" stop and can be navigated with arrow buttons and in the right
order (previously, it would skip the table button).
- Generates more verbose output for the reactio selectors to provide
content for users who cannot identify the meaning of these buttons
visually. Explicit aria-labels are now preferred over auto-generated
ones.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/view_content/add_reaction.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content/context_menu.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content/reactions.tmpl | 15 | ||||
-rw-r--r-- | templates/shared/combomarkdowneditor.tmpl | 4 |
4 files changed, 16 insertions, 7 deletions
diff --git a/templates/repo/issue/view_content/add_reaction.tmpl b/templates/repo/issue/view_content/add_reaction.tmpl index 37931f287e..5d4aa2298e 100644 --- a/templates/repo/issue/view_content/add_reaction.tmpl +++ b/templates/repo/issue/view_content/add_reaction.tmpl @@ -1,5 +1,5 @@ {{if .ctxData.IsSigned}} -<div class="item action ui dropdown jump pointing top right select-reaction" data-action-url="{{.ActionURL}}"> +<div class="item action ui dropdown jump pointing top right select-reaction" data-action-url="{{.ActionURL}}" aria-label="{{ctx.Locale.Tr "repo.issues.reaction.add"}}"> <a class="add-reaction muted"> {{svg "octicon-smiley"}} </a> diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl index f020a9ea4b..5fc5af400f 100644 --- a/templates/repo/issue/view_content/context_menu.tmpl +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -1,4 +1,4 @@ -<div class="item action ui dropdown jump pointing top right context-dropdown"> +<div class="item action ui dropdown jump pointing top right context-dropdown" aria-label="{{ctx.Locale.Tr "repo.issues.context.menu"}}"> <a class="context-menu muted"> {{svg "octicon-kebab-horizontal"}} </a> diff --git a/templates/repo/issue/view_content/reactions.tmpl b/templates/repo/issue/view_content/reactions.tmpl index da6319667b..e5cb9a8ed3 100644 --- a/templates/repo/issue/view_content/reactions.tmpl +++ b/templates/repo/issue/view_content/reactions.tmpl @@ -2,9 +2,18 @@ {{range $key, $value := .Reactions}} {{$hasReacted := $value.HasUser $.ctxData.SignedUserID}} <a role="button" class="ui label basic{{if $hasReacted}} primary{{end}}{{if not $.ctxData.IsSigned}} disabled{{end}} comment-reaction-button" - data-tooltip-content - title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}" - aria-label="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}" + title="{{$value.GetFirstUsers}}" + aria-label=" + {{if eq ($value.GetMoreUserCount) 0}} + {{ctx.Locale.Tr "repo.issues.reaction.alt_few" $value.GetFirstUsers $key}} + {{else}} + {{ctx.Locale.Tr "repo.issues.reaction.alt_many" $value.GetFirstUsers $value.GetMoreUserCount $key}} + {{end}} + {{if $hasReacted}} + {{ctx.Locale.Tr "repo.issues.reaction.alt_remove" $key}} + {{else}} + {{ctx.Locale.Tr "repo.issues.reaction.alt_add" $key}} + {{end}}" data-tooltip-placement="bottom-start" data-reaction-content="{{$key}}" data-has-reacted="{{$hasReacted}}"> <span class="reaction">{{ReactionToEmoji $key}}</span> diff --git a/templates/shared/combomarkdowneditor.tmpl b/templates/shared/combomarkdowneditor.tmpl index 9fcab8a9ae..e7bace6962 100644 --- a/templates/shared/combomarkdowneditor.tmpl +++ b/templates/shared/combomarkdowneditor.tmpl @@ -37,14 +37,14 @@ Template Attributes: <md-task-list class="markdown-toolbar-button" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.list.task.tooltip"}}">{{svg "octicon-tasklist"}}</md-task-list> <button type="button" class="markdown-toolbar-button" data-md-button data-md-action="unindent" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.unindent.tooltip"}}">{{svg "octicon-arrow-left"}}</button> <button type="button" class="markdown-toolbar-button" data-md-button data-md-action="indent" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.indent.tooltip"}}">{{svg "octicon-arrow-right"}}</button> - <button type="button" class="markdown-toolbar-button show-modal button" data-md-action="new-table" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.new_table.tooltip"}}">{{svg "octicon-table"}}</button> </div> <div class="markdown-toolbar-group"> + <button type="button" class="markdown-toolbar-button show-modal button" data-md-button data-md-action="new-table" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.new_table.tooltip"}}">{{svg "octicon-table"}}</button> <md-mention class="markdown-toolbar-button" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.mention.tooltip"}}">{{svg "octicon-mention"}}</md-mention> <md-ref class="markdown-toolbar-button" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.ref.tooltip"}}">{{svg "octicon-cross-reference"}}</md-ref> </div> <div class="markdown-toolbar-group"> - <button class="markdown-toolbar-button markdown-switch-monospace" role="switch" data-enable-text="{{ctx.Locale.Tr "editor.buttons.enable_monospace_font"}}" data-disable-text="{{ctx.Locale.Tr "editor.buttons.disable_monospace_font"}}">{{svg "octicon-typography"}}</button> + <button class="markdown-toolbar-button markdown-switch-monospace" data-md-button role="switch" data-enable-text="{{ctx.Locale.Tr "editor.buttons.enable_monospace_font"}}" data-disable-text="{{ctx.Locale.Tr "editor.buttons.disable_monospace_font"}}">{{svg "octicon-typography"}}</button> {{if .EasyMDE}} <button class="markdown-toolbar-button markdown-switch-easymde" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.switch_to_legacy.tooltip"}}">{{svg "octicon-arrow-switch"}}</button> {{end}} |