Changeset - 7bbe7dfaa48b
[Not reviewed]
default
0 8 0
Mads Kiilerich - 9 years ago 2016-10-27 16:01:57
madski@unity3d.com
style: replace some disabled btn with Bootstrap compatible label markup

Based on work by Dominik Ruf.
8 files changed with 26 insertions and 15 deletions:
0 comments (0 inline, 0 general)
kallithea/public/css/style.css
Show inline comments
 
@@ -3081,12 +3081,13 @@ div.gravatar img {
 
}
 

	
 
#content div.panel div.panel-heading div.search div.input input {
 
    border: 1px solid #576622;
 
}
 

	
 
.label,
 
.btn {
 
    color: #515151;
 
    background-color: #DADADA;
 
    background-repeat: repeat-x;
 
    background-image: linear-gradient(to bottom, #F4F4F4, #DADADA);
 

	
 
@@ -3094,17 +3095,22 @@ div.gravatar img {
 
    border-left: 1px solid #c6c6c6;
 
    border-right: 1px solid #DDD;
 
    border-bottom: 1px solid #c6c6c6;
 
    outline: none;
 
    margin: 0px 3px 3px 0px;
 
    border-radius: 4px 4px 4px 4px !important;
 
    cursor: pointer !important;
 
    padding: 3px 3px 3px 3px;
 
    display: inline-block;
 
    white-space: nowrap;
 
}
 
.btn {
 
    cursor: pointer !important;
 
}
 
.label {
 
    cursor: default !important;
 
}
 

	
 
ul.nav-stacked {
 
    margin: 20px;
 
    color: #393939;
 
    font-weight: 700;
 
}
 
@@ -3136,12 +3142,13 @@ input.btn {
 

	
 
input[disabled].btn,
 
.btn.disabled {
 
    color: #999;
 
}
 

	
 
.label,
 
.btn.btn-sm {
 
    padding: 3px 8px;
 
}
 

	
 
.btn.btn-xs {
 
    padding: 1px 5px;
 
@@ -3162,39 +3169,43 @@ input[disabled].btn,
 
    background-position: 0;
 
    color: #999;
 
    text-decoration: none;
 
    box-shadow: none !important;
 
}
 

	
 
.label.label-danger,
 
.btn.btn-danger {
 
    color: #fff;
 
    background-color: #c43c35;
 
    background-repeat: repeat-x;
 
    background-image: linear-gradient(to bottom, #ee5f5b, #c43c35);
 
    border-color: #c43c35 #c43c35 #882a25;
 
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
 
}
 

	
 
.label.label-primary,
 
.btn.btn-primary {
 
    color: #fff;
 
    background-color: #339bb9;
 
    background-repeat: repeat-x;
 
    background-image: linear-gradient(to bottom, #5bc0de, #339bb9);
 
    border-color: #339bb9 #339bb9 #22697d;
 
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
 
}
 

	
 
.label.label-success,
 
.btn.btn-success {
 
    color: #fff;
 
    background-color: #57a957;
 
    background-repeat: repeat-x;
 
    background-image: linear-gradient(to bottom, #62c462, #57a957);
 
    border-color: #57a957 #57a957 #3d773d;
 
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
 
}
 

	
 
.label.label-warning,
 
.btn.btn-warning {
 
    color: #fff;
 
    background-color: #faa732;
 
    background-repeat: repeat-x;
 
    background-image: linear-gradient(to bottom, #fbb450, #f89406);
 
    border-color: #f89406 #f89406 #ad6704;
 
@@ -4200,13 +4211,13 @@ span.pr-closed-tag {
 
    font-size: 16px;
 
    font-weight: bold;
 
    text-transform: capitalize;
 
}
 

	
 
#perms .perm_tag {
 
    padding: 1px 3px 1px 3px;
 
    padding: 3px 3px 1px 3px;
 
    font-size: 10px;
 
    font-weight: bold;
 
    text-transform: uppercase;
 
    white-space: nowrap;
 
    border-radius: 3px;
 
}
kallithea/templates/admin/gists/show.html
Show inline comments
 
@@ -31,15 +31,15 @@
 
        <div id="files_data">
 
            <div id="body" class="codeblock">
 
                <div class="code-header">
 
                    <div class="stats">
 
                        <div class="left" style="margin: -4px 0px 0px 0px">
 
                          %if c.gist.gist_type == 'public':
 
                            <div class="btn btn-success btn-xs disabled">${_('Public Gist')}</div>
 
                            <div class="label label-success">${_('Public Gist')}</div>
 
                          %else:
 
                            <div class="btn btn-warning btn-xs disabled">${_('Private Gist')}</div>
 
                            <div class="label label-warning">${_('Private Gist')}</div>
 
                          %endif
 
                        </div>
 
                        <div class="left item">
 
                            ${c.gist.gist_description}
 
                        </div>
 
                        <div class="left item last" style="color: #AAA">
kallithea/templates/admin/my_account/my_account_api_keys.html
Show inline comments
 
<div class="apikeys_wrap">
 
  <table class="noborder">
 
    <tr>
 
        <td style="width: 450px"><div class="truncate autoexpand" style="width:120px;font-size:16px;font-family: monospace">${c.user.api_key}</div></td>
 
        <td>
 
            <span class="btn btn-success btn-xs disabled">${_('Built-in')}</span>
 
            <span class="label label-success">${_('Built-in')}</span>
 
        </td>
 
        <td>${_('Expires')}: ${_('Never')}</td>
 
        <td>
 
            ${h.form(url('my_account_api_keys_delete'))}
 
                ${h.hidden('del_api_key',c.user.api_key)}
 
                ${h.hidden('del_api_key_builtin',1)}
kallithea/templates/admin/my_account/my_account_emails.html
Show inline comments
 
@@ -3,13 +3,13 @@
 
    <tr>
 
    %if c.visual.use_gravatar:
 
    <td>${h.gravatar_div(c.user.email, size=16)}</td>
 
    %endif
 
    <td><div class="email">${c.user.email}</div></td>
 
    <td>
 
        <span class="btn btn-success btn-xs disabled">${_('Primary')}</span>
 
        <span class="label label-success">${_('Primary')}</span>
 
    </td>
 
    </tr>
 
    %if c.user_email_map:
 
        %for em in c.user_email_map:
 
          <tr>
 
            %if c.visual.use_gravatar:
kallithea/templates/admin/users/user_edit_api_keys.html
Show inline comments
 
<div class="apikeys_wrap">
 
  <table class="noborder">
 
    <tr>
 
        <td style="width: 450px"><div class="truncate autoexpand" style="width:120px;font-size:16px;font-family: monospace">${c.user.api_key}</div></td>
 
        <td>
 
            <span class="btn btn-success btn-xs disabled">${_('Built-in')}</span>
 
            <span class="label label-success">${_('Built-in')}</span>
 
        </td>
 
        <td>${_('Expires')}: ${_('Never')}</td>
 
        <td>
 
            ${h.form(url('edit_user_api_keys_delete', id=c.user.user_id))}
 
                ${h.hidden('del_api_key',c.user.api_key)}
 
                ${h.hidden('del_api_key_builtin',1)}
kallithea/templates/admin/users/user_edit_emails.html
Show inline comments
 
@@ -3,13 +3,13 @@
 
    <tr>
 
    %if c.visual.use_gravatar:
 
    <td>${h.gravatar_div(c.user.email, size=16)}</td>
 
    %endif
 
    <td><div class="email">${c.user.email}</div></td>
 
    <td>
 
        <span class="btn btn-success btn-xs disabled">${_('Primary')}</span>
 
        <span class="label label-success">${_('Primary')}</span>
 
    </td>
 
    </tr>
 
    %if c.user_email_map:
 
        %for em in c.user_email_map:
 
          <tr>
 
            %if c.visual.use_gravatar:
kallithea/templates/data_table/_dt_elements.html
Show inline comments
 
@@ -133,17 +133,17 @@
 
  </div>
 
</%def>
 

	
 
<%def name="repo_state(repo_state)">
 
  <div>
 
    %if repo_state == u'repo_state_pending':
 
        <div class="btn btn-default btn-xs btn-info disabled">${_('Creating')}</div>
 
        <div class="label label-info">${_('Creating')}</div>
 
    %elif repo_state == u'repo_state_created':
 
        <div class="btn btn-success btn-xs disabled">${_('Created')}</div>
 
        <div class="label label-success">${_('Created')}</div>
 
    %else:
 
        <div class="btn btn-danger btn-xs disabled" title="${repo_state}">invalid</div>
 
        <div class="label label-danger" title="${repo_state}">invalid</div>
 
    %endif
 
  </div>
 
</%def>
 

	
 
<%def name="user_actions(user_id, username)">
 
 <div style="float:left" class="grid_edit">
kallithea/tests/functional/test_admin_gists.py
Show inline comments
 
@@ -70,13 +70,13 @@ class TestGistsController(TestController
 
                                         'public': 'public',
 
                                         '_authentication_token': self.authentication_token()},
 
                                 status=302)
 
        response = response.follow()
 
        response.mustcontain('added file: foo')
 
        response.mustcontain('gist test')
 
        response.mustcontain('<div class="btn btn-success btn-xs disabled">Public Gist</div>')
 
        response.mustcontain('<div class="label label-success">Public Gist</div>')
 

	
 
    def test_create_with_path_with_dirs(self):
 
        self.log_user()
 
        response = self.app.post(url('gists'),
 
                                 params={'lifetime': -1,
 
                                         'content': 'gist test',
 
@@ -103,13 +103,13 @@ class TestGistsController(TestController
 
                                         'private': 'private',
 
                                         '_authentication_token': self.authentication_token()},
 
                                 status=302)
 
        response = response.follow()
 
        response.mustcontain('added file: private-foo<')
 
        response.mustcontain('private gist test')
 
        response.mustcontain('<div class="btn btn-warning btn-xs disabled">Private Gist</div>')
 
        response.mustcontain('<div class="label label-warning">Private Gist</div>')
 

	
 
    def test_create_with_description(self):
 
        self.log_user()
 
        response = self.app.post(url('gists'),
 
                                 params={'lifetime': -1,
 
                                         'content': 'gist test',
 
@@ -119,13 +119,13 @@ class TestGistsController(TestController
 
                                         '_authentication_token': self.authentication_token()},
 
                                 status=302)
 
        response = response.follow()
 
        response.mustcontain('added file: foo-desc')
 
        response.mustcontain('gist test')
 
        response.mustcontain('gist-desc')
 
        response.mustcontain('<div class="btn btn-success btn-xs disabled">Public Gist</div>')
 
        response.mustcontain('<div class="label label-success">Public Gist</div>')
 

	
 
    def test_new(self):
 
        self.log_user()
 
        response = self.app.get(url('new_gist'))
 

	
 
    def test_delete(self):
 
@@ -149,13 +149,13 @@ class TestGistsController(TestController
 
    def test_show(self):
 
        gist = _create_gist('gist-show-me')
 
        response = self.app.get(url('gist', gist_id=gist.gist_access_id))
 
        response.mustcontain('added file: gist-show-me<')
 
        response.mustcontain('%s - created' % TEST_USER_ADMIN_LOGIN)
 
        response.mustcontain('gist-desc')
 
        response.mustcontain('<div class="btn btn-success btn-xs disabled">Public Gist</div>')
 
        response.mustcontain('<div class="label label-success">Public Gist</div>')
 

	
 
    def test_show_as_raw(self):
 
        gist = _create_gist('gist-show-me', content='GIST CONTENT')
 
        response = self.app.get(url('formatted_gist',
 
                                    gist_id=gist.gist_access_id, format='raw'))
 
        assert response.body == 'GIST CONTENT'
0 comments (0 inline, 0 general)