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
 
@@ -33,13 +33,13 @@
 
           <span class="help-block">${_('Comma-separated list of plugins; Kallithea will try user authentication in plugin order')}</span>
 
               <div style="padding:10px 0px 10px 0px;font-weight: bold">${_('Available built-in plugins')}</div>
 
               <ul>
 
               %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>
 
               %endfor
 
               </ul>
 
           </div>
 
@@ -112,23 +112,23 @@
 
            return (element != "");
 
        }
 
        var elems = $auth_plugins_input.val().split(',').filter(notEmpty);
 
        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{
 
            if(elems.indexOf(plugin_id) == -1){
 
                elems.push(plugin_id);
 
            }
 
            $auth_plugins_input.val(elems.join(','));
 
            $cur_button.addClass('btn-success');
 
            $cur_button.addClass('active');
 
            $cur_button.html(_TM['Enabled']);
 
        }
 
    });
 
</script>
 
</%def>
0 comments (0 inline, 0 general)