Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(proposal) group sorting #1

Open
albrechtd opened this issue Feb 17, 2021 · 0 comments
Open

(proposal) group sorting #1

albrechtd opened this issue Feb 17, 2021 · 0 comments

Comments

@albrechtd
Copy link

A really very nice plugin!

However, as we have a plethora of groups (from LDAP) in our organisation, the combo box for selecting the banner admin group is confusing as it is unsorted. The following trivial patch solves the issue for me, but as I'm no Ruby expert, I'm not sure if it is actually the proper solution:

--- redmine_banner/app/views/global_banner/show.html.erb.orig   2021-02-17 14:29:06.408044166 +0000
+++ redmine_banner/app/views/global_banner/show.html.erb        2021-02-17 14:29:38.424475083 +0000
@@ -95,7 +95,7 @@
       <%= content_tag(:label, l(:banner_admin_group, default: 'Banner Admin Group')) %>
       <% if User.current.admin? %>
         <%= select_tag('setting[banner_admin]',
-          options_for_select( Group.givable.pluck(:lastname) << GlobalBanner::GLOBAL_BANNER_ADMIN_GROUP,
+          options_for_select( Group.givable.pluck(:lastname).sort << GlobalBanner::GLOBAL_BANNER_ADMIN_GROUP,
           selected: setting['banner_admin'] || GlobalBanner::GLOBAL_BANNER_ADMIN_GROUP )) %>
         <br/><%= l(:description_for_banner_admin_group, default: "Specify a group that can manage the global banner without admin rights.") %>
       <% else %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant