thorin / redmine_ldap_sync

[UNMAINTAINED] A redmine plugin to synchronize both users and groups with an ldap server
http://www.redmine.org/plugins/redmine_ldap_sync
GNU General Public License v3.0
140 stars 129 forks source link

Icon admin menu link missing background-repeat: no-repeat property #217

Closed tgoeg closed 5 years ago

tgoeg commented 6 years ago

I updated from redmine core 3.3.3 to 3.4.3 and in the admin menu in http://mydomain.com/admin the icon of ldap_sync is repeated over the whole link. That's because the CSS property "background-repeat: no-repeat" is missing. It is normally applied by using the "icon" CSS class.

This patch fixes it:

--- init.rb.org 2018-06-27 13:23:53.188552500 +0200
+++ init.rb 2018-06-27 13:25:17.292552500 +0200
@@ -10,7 +10,8 @@
   requires_redmine :version_or_higher => '2.1.0'

   settings :default => HashWithIndifferentAccess.new()
-  menu :admin_menu, :ldap_sync, { :controller => 'ldap_settings', :action => 'index' }, :caption => :label_ldap_synchronization
+  menu :admin_menu, :ldap_sync, { :controller => 'ldap_settings', :action => 'index' }, :caption => :label_ldap_synchronization,
+       :html => {:class => 'icon'}
 end

 RedmineApp::Application.config.after_initialize do

However, I am not sure whether this is totally correct. Looking at all the other admin links, there seems to be another class that gets set: icon-name, e.g.

<a class="icon icon-projects projects" href="/admin/projects">Projects</a>

Also, https://www.redmine.org/issues/24313 seems to enforce this as a coding standard.

So this should probably also be solved by adding "icon icon-ldap_sync" and defining that class in the CSS instead of directly using the "ldap-sync" CSS class.

This should look like this, then:

--- assets/stylesheets/ldap_sync.css.org    2018-06-27 13:36:23.284552500 +0200
+++ assets/stylesheets/ldap_sync.css    2018-06-27 13:48:03.956552500 +0200
@@ -18,7 +18,7 @@
  */
 fieldset.box legend { padding-left: 2px; background-image: none; cursor: default; }

-#admin-menu a.ldap-sync { background-image:url('../images/server_key.png'); }
+.icon-ldap_sync { background-image:url('../images/server_key.png'); }

 tr.ldap_setting.disabled { color: #AAAAAA; }
--- init.rb.org 2018-06-27 13:23:53.188552500 +0200
+++ init.rb 2018-06-27 13:47:04.832552500 +0200
@@ -10,7 +10,8 @@
   requires_redmine :version_or_higher => '2.1.0'

   settings :default => HashWithIndifferentAccess.new()
-  menu :admin_menu, :ldap_sync, { :controller => 'ldap_settings', :action => 'index' }, :caption => :label_ldap_synchronization
+  menu :admin_menu, :ldap_sync, { :controller => 'ldap_settings', :action => 'index' }, :caption => :label_ldap_synchronization,
+       :html => {:class => 'icon icon-ldap_sync'}
 end

 RedmineApp::Application.config.after_initialize do

This also works as expected.