Changeset - e2fb29be0681
[Not reviewed]
default
0 1 0
Andrew Shadura - 9 years ago 2016-05-28 15:11:48
andrew@shadura.me
templates: use a better class name for an enabled toggle button

"btn-success" is rather a poor choice for a class applied when the
button is active, "active" is better for that.
A side effect of the change is that "Enabled" is now shown in bold.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/admin/auth/auth_settings.html
Show inline comments
 
@@ -36,7 +36,7 @@
 
               %for plugin_path in c.available_plugins:
 
                    <li>
 
                      <div style="padding:3px 0px 3px 0px">
 
                          <span style="margin: 0px 10px 0px 0px" plugin_id="${plugin_path}" class="toggle-plugin btn btn-mini ${'btn-success' if plugin_path in c.enabled_plugins else ''}">
 
                          <span style="margin: 0px 10px 0px 0px" plugin_id="${plugin_path}" class="toggle-plugin btn btn-mini ${'active' if plugin_path in c.enabled_plugins else ''}">
 
                          ${_('Enabled') if plugin_path in c.enabled_plugins else _('Disabled')}</span>${plugin_path}
 
                      </div>
 
                    </li>
 
@@ -115,10 +115,10 @@
 
        var $cur_button = $(e.currentTarget);
 
        var plugin_id = $cur_button.attr('plugin_id');
 

	
 
        if($cur_button.hasClass('btn-success')){
 
        if($cur_button.hasClass('active')){
 
            elems.splice(elems.indexOf(plugin_id), 1);
 
            $auth_plugins_input.val(elems.join(','));
 
            $cur_button.removeClass('btn-success');
 
            $cur_button.removeClass('active');
 
            $cur_button.html(_TM['Disabled']);
 
        }
 
        else{
 
@@ -126,7 +126,7 @@
 
                elems.push(plugin_id);
 
            }
 
            $auth_plugins_input.val(elems.join(','));
 
            $cur_button.addClass('btn-success');
 
            $cur_button.addClass('active');
 
            $cur_button.html(_TM['Enabled']);
 
        }
 
    });
0 comments (0 inline, 0 general)