Skip to content

Commit a961b21

Browse files
committed
Merge pull request #2352 from fmh/patch-3
Migrating cerulean theme from v2 to v3 and add button to reset all filters on list page
2 parents fd62c54 + 4c6ba03 commit a961b21

4 files changed

Lines changed: 914 additions & 179 deletions

File tree

app/assets/javascripts/rails_admin/ui.coffee

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,11 @@ $(document).on 'pjax:popstate', () ->
9292
return
9393
return
9494
return
95+
96+
#Remove all filter and then refresh
97+
$(document).on 'click', "#remove_filter",(event) ->
98+
event.preventDefault()
99+
$("#filters_box").html("")
100+
$("hr.filters_box").hide()
101+
$(this).parent().siblings("input[type='search']").val("")
102+
$(this).parents("form").submit()
Lines changed: 95 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,133 @@
1-
// Bootswatch.less
2-
// Swatch: Cerulean
3-
// Version: 2.0.2
4-
// -----------------------------------------------------
5-
6-
// TYPOGRAPHY
7-
// -----------------------------------------------------
1+
// Cerulean 3.3.1
2+
// Bootswatch
3+
// .rails_admin .sidebar-nav added to prevent same link color
4+
// ------------------------------------------------------------------
5+
6+
@mixin btn-shadow($color){
7+
@include gradient-vertical-three-colors(lighten($color, 8%), $color, 60%, darken($color, 4%));
8+
filter: none;
9+
border-bottom: 1px solid darken($color, 10%);
10+
}
811

9-
@import url(https://fonts.googleapis.com/css?family=Telex);
12+
// Navbar =====================================================================
1013

11-
.navbar, .subnav {
12-
font-family: $headingsFontFamily;
14+
.navbar {
15+
@include btn-shadow($navbar-default-bg);
16+
filter: none;
17+
@include box-shadow(0 1px 10px rgba(0, 0, 0, 0.1));
1318
}
1419

15-
// NAVBAR
16-
// -----------------------------------------------------
20+
.navbar.navbar-default .badge {
21+
background-color: #fff;
22+
color: $navbar-default-bg;
23+
}
1724

18-
.navbar-inner {
19-
@include gradient-vertical-three-colors($navbarBackground, $navbarBackground, 0.9, $navbarBackgroundHighlight);
20-
}
25+
.navbar.navbar-inverse , .rails_admin .sidebar-nav {
26+
@include gradient-vertical-three-colors(lighten($navbar-inverse-bg, 8%), lighten($navbar-inverse-bg, 4%), 60%, darken($navbar-inverse-bg, 2%));
27+
filter: none;
28+
border-bottom: 1px solid darken($navbar-inverse-bg, 10%);
29+
}
2130

22-
.navbar .nav .active > a,
23-
.navbar .nav .active > a:hover {
24-
background-color: $navbarBackground;
25-
background-color: rgba(0,0,0,.2);
26-
}
2731

28-
.navbar .search-query {
29-
border: 1px solid darken($linkColor, 10%);
32+
.navbar.navbar-inverse .badge {
33+
background-color: #fff;
34+
color: $navbar-inverse-bg;
3035
}
3136

32-
// responsive menu colors
37+
.navbar .navbar-nav > li > a,
38+
.navbar .navbar-brand {
39+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
40+
}
3341

34-
.navbar .nav-collapse.in > .nav > li .dropdown-menu a {
35-
color: $white;
3642

37-
&:hover {
38-
color: $white;
39-
}
40-
}
43+
@media (max-width: $grid-float-breakpoint-max) {
4144

42-
.navbar .nav-collapse.in .nav li > a {
43-
color: $white;
45+
.navbar {
4446

45-
&:hover {
46-
background-color: #2B7CAC;
47-
}
47+
.dropdown-header {
48+
color: #fff;
49+
}
50+
}
4851
}
4952

50-
.btn-navbar:hover {
51-
background-color: darken($white, 20%);
53+
// Buttons ====================================================================
54+
55+
.btn {
56+
57+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
58+
59+
.caret {
60+
border-top-color: #fff;
61+
}
5262
}
5363

54-
// BUTTONS
55-
// -----------------------------------------------------
64+
.btn-default {
65+
66+
@include btn-shadow($btn-default-bg);
5667

57-
.btn {
58-
@include gradient-vertical-three-colors($white, $white, 0.05, darken($white, 0%));
59-
$shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
60-
@include box-shadow($shadow);
61-
6268
&:hover {
63-
background-position: 0 0;
69+
color: $btn-default-color;
70+
}
71+
72+
.caret {
73+
border-top-color: $text-color;
6474
}
6575
}
6676

67-
.btn-primary {
68-
@include buttonBackground(lighten($btnPrimaryBackground, 5%), $btnPrimaryBackground);
77+
.btn-default {
78+
@include btn-shadow($btn-default-bg);
6979
}
7080

71-
.btn-info {
72-
@include buttonBackground(lighten($btnInfoBackground, 5%), $btnInfoBackground);
81+
.btn-primary {
82+
@include btn-shadow($btn-primary-bg);
7383
}
7484

7585
.btn-success {
76-
@include buttonBackground(lighten($btnSuccessBackground, 5%), $btnSuccessBackground);
86+
@include btn-shadow($btn-success-bg);
87+
}
88+
89+
.btn-info {
90+
@include btn-shadow($btn-info-bg);
7791
}
7892

7993
.btn-warning {
80-
@include buttonBackground(lighten($btnWarningBackground, 5%), $btnWarningBackground);
94+
@include btn-shadow($btn-warning-bg);
8195
}
8296

8397
.btn-danger {
84-
@include buttonBackground(lighten($btnDangerBackground, 5%), $btnDangerBackground);
98+
@include btn-shadow($btn-danger-bg);
8599
}
86100

87-
.btn-inverse {
88-
@include buttonBackground(lighten($btnInverseBackground, 5%), $btnInverseBackground);
101+
// Typography =================================================================
102+
103+
// Tables =====================================================================
104+
table,
105+
.table {
106+
> thead > tr > th {
107+
108+
color: $headings-color;
109+
}
110+
89111
}
90112

91-
// ICONS
92-
// -----------------------------------------------------
113+
// Forms ======================================================================
114+
115+
// Navs =======================================================================
116+
117+
// Indicators =================================================================
118+
119+
// Progress bars ==============================================================
93120

94-
// Make icons gray
95-
i[class^="icon-"]{
96-
opacity: 0.8;
97-
}
121+
// Containers =================================================================
122+
123+
.panel-primary,
124+
.panel-success,
125+
.panel-warning,
126+
.panel-danger,
127+
.panel-info {
128+
129+
.panel-heading,
130+
.panel-title {
131+
color: #fff;
132+
}
133+
}

0 commit comments

Comments
 (0)