diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-06-04 05:38:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-03 17:38:26 -0400 |
commit | 694441fec5036bf2e5ee6a261b40ada2bfc76d61 (patch) | |
tree | cb5fb1ac21618e43e9fe2ead548302e917736e80 /templates/repo | |
parent | 1d04e8641d4abab6ce978bc2dc5523c2ddb2f628 (diff) | |
download | gitea-694441fec5036bf2e5ee6a261b40ada2bfc76d61.tar.gz gitea-694441fec5036bf2e5ee6a261b40ada2bfc76d61.zip |
Remove customized (unmaintained) dropdown, improve aria a11y for dropdown (#19861)
* Remove customized (unmaintained) dropdown, improve aria a11y for dropdown
* fix repo permission
* use action instead of onChange
* re-order the CSS selector
* fix dropdown behavior for repo permissions, make elements inside menu item non-focusable
* use menu/menuitem instead of combobox/option. use tooltip(data-content) for aria-label, prevent from repeated attaching
* click menu item when pressing Enter
* code format
* fix repo permission
* repo setting: prevent from misleading users when error occurs
* fine tune the repo collaboration access mode dropdown (in case the access mode is undefined in the template)
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/settings/collaboration.tmpl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index 0a56b5b6ba..13972cd917 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -19,13 +19,13 @@ </div> <div class="ui eight wide column"> {{svg "octicon-shield-lock"}} - <div class="ui inline dropdown"> + <div class="ui inline dropdown access-mode" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}" data-last-value="{{printf "%d" .Collaboration.Mode}}"> <div class="text">{{if eq .Collaboration.Mode 1}}{{$.i18n.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{$.i18n.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{$.i18n.Tr "repo.settings.collaboration.admin"}}{{else}}{{$.i18n.Tr "repo.settings.collaboration.undefined"}}{{end}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} - <div class="access-mode menu" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}"> - <div class="item" data-text="{{$.i18n.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{$.i18n.Tr "repo.settings.collaboration.admin"}}</div> - <div class="item" data-text="{{$.i18n.Tr "repo.settings.collaboration.write"}}" data-value="2">{{$.i18n.Tr "repo.settings.collaboration.write"}}</div> - <div class="item" data-text="{{$.i18n.Tr "repo.settings.collaboration.read"}}" data-value="1">{{$.i18n.Tr "repo.settings.collaboration.read"}}</div> + <div class="menu"> + <div class="item" data-text="{{$.i18n.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{$.i18n.Tr "repo.settings.collaboration.admin"}}</div> + <div class="item" data-text="{{$.i18n.Tr "repo.settings.collaboration.write"}}" data-value="2">{{$.i18n.Tr "repo.settings.collaboration.write"}}</div> + <div class="item" data-text="{{$.i18n.Tr "repo.settings.collaboration.read"}}" data-value="1">{{$.i18n.Tr "repo.settings.collaboration.read"}}</div> </div> </div> </div> |