Skip to content

Commit 5a99802

Browse files
author
Tony Guntharp
committedMar 14, 2013
adds proper css badging to admins. Fixes #198
1 parent f086bac commit 5a99802

File tree

2 files changed

+110
-3
lines changed

2 files changed

+110
-3
lines changed
 

‎app/assets/javascripts/backbone/plugins/user_list.js.coffee

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ class Kandan.Plugins.UserList
55
@pluginNamespace: "Kandan.Plugins.UserList"
66

77
@template: _.template '''
8-
<div class="user clearfix">
8+
<div class="user clearfix">
99
<img class="avatar" src="<%= avatarUrl %>"/>
1010
<span class="name"><%= name %></span>
11-
<span class="name">&nbsp;<%= admins %></span>
11+
<% if(admin){ %>
12+
&nbsp;<span class="badge badge-important">Admin</span>
13+
<% } %>
1214
</div>
1315
'''
1416

@@ -24,7 +26,7 @@ class Kandan.Plugins.UserList
2426

2527
$users.append @template({
2628
name: displayName,
27-
admins: isAdmin,
29+
admin: isAdmin,
2830
avatarUrl: Kandan.Helpers.Avatars.urlFor(user, {size: 25})
2931
})
3032
$el.html($users)

‎app/assets/stylesheets/lib/font-awesome.css

+105
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,108 @@
1+
.label,
2+
.badge {
3+
display: inline-block;
4+
margin-top: 2.5px;
5+
margin-left: 5px;
6+
padding: 2px 4px;
7+
font-size: 12px;
8+
font-weight: bold;
9+
line-height: 12px;
10+
color: #ffffff;
11+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
12+
white-space: nowrap;
13+
vertical-align: baseline;
14+
background-color: #999999;
15+
}
16+
17+
.label {
18+
-webkit-border-radius: 3px;
19+
-moz-border-radius: 3px;
20+
border-radius: 3px;
21+
}
22+
23+
.badge {
24+
padding-right: 9px;
25+
padding-left: 9px;
26+
-webkit-border-radius: 9px;
27+
-moz-border-radius: 9px;
28+
border-radius: 9px;
29+
}
30+
31+
.label:empty,
32+
.badge:empty {
33+
display: none;
34+
}
35+
36+
a.label:hover,
37+
a.label:focus,
38+
a.badge:hover,
39+
a.badge:focus {
40+
color: #ffffff;
41+
text-decoration: none;
42+
cursor: pointer;
43+
}
44+
45+
.label-important,
46+
.badge-important {
47+
background-color: #b94a48;
48+
}
49+
50+
.label-important[href],
51+
.badge-important[href] {
52+
background-color: #953b39;
53+
}
54+
55+
.label-warning,
56+
.badge-warning {
57+
background-color: #f89406;
58+
}
59+
60+
.label-warning[href],
61+
.badge-warning[href] {
62+
background-color: #c67605;
63+
}
64+
65+
.label-success,
66+
.badge-success {
67+
background-color: #468847;
68+
}
69+
70+
.label-success[href],
71+
.badge-success[href] {
72+
background-color: #356635;
73+
}
74+
75+
.label-info,
76+
.badge-info {
77+
background-color: #3a87ad;
78+
}
79+
80+
.label-info[href],
81+
.badge-info[href] {
82+
background-color: #2d6987;
83+
}
84+
85+
.label-inverse,
86+
.badge-inverse {
87+
background-color: #333333;
88+
}
89+
90+
.label-inverse[href],
91+
.badge-inverse[href] {
92+
background-color: #1a1a1a;
93+
}
94+
95+
.btn .label,
96+
.btn .badge {
97+
position: relative;
98+
top: -1px;
99+
}
100+
101+
.btn-mini .label,
102+
.btn-mini .badge {
103+
top: 0;
104+
}
105+
1106
/*!
2107
* Font Awesome 3.0.2
3108
* the iconic font designed for use with Twitter Bootstrap

0 commit comments

Comments
 (0)
Please sign in to comment.