rails_admin 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails_admin might be problematic. Click here for more details.

Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -6
  3. data/README.md +2 -1
  4. data/app/assets/stylesheets/rails_admin/base/font-awesome-4-compability.scss +142 -142
  5. data/app/assets/stylesheets/rails_admin/base/theming.scss +3 -6
  6. data/app/assets/stylesheets/rails_admin/ra.calendar-additions.scss +1 -1
  7. data/app/controllers/rails_admin/application_controller.rb +4 -9
  8. data/app/controllers/rails_admin/main_controller.rb +3 -2
  9. data/app/helpers/rails_admin/application_helper.rb +3 -4
  10. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +2 -2
  11. data/app/views/rails_admin/main/_delete_notice.html.haml +1 -1
  12. data/app/views/rails_admin/main/_form_field.html.haml +1 -1
  13. data/app/views/rails_admin/main/_form_nested_many.html.haml +1 -1
  14. data/app/views/rails_admin/main/_form_text.html.haml +1 -1
  15. data/app/views/rails_admin/main/_submit_buttons.html.haml +16 -14
  16. data/app/views/rails_admin/main/dashboard.html.haml +2 -2
  17. data/app/views/rails_admin/main/export.html.haml +6 -6
  18. data/app/views/rails_admin/main/history.html.haml +6 -4
  19. data/app/views/rails_admin/main/index.html.haml +1 -1
  20. data/lib/rails_admin/adapters/active_record/property.rb +11 -1
  21. data/lib/rails_admin/config.rb +1 -1
  22. data/lib/rails_admin/config/actions/base.rb +11 -8
  23. data/lib/rails_admin/config/fields/base.rb +1 -1
  24. data/lib/rails_admin/config/fields/group.rb +1 -1
  25. data/lib/rails_admin/config/fields/types/boolean.rb +3 -3
  26. data/lib/rails_admin/config/fields/types/enum.rb +1 -1
  27. data/lib/rails_admin/config/fields/types/file_upload.rb +2 -2
  28. data/lib/rails_admin/config/fields/types/json.rb +1 -0
  29. data/lib/rails_admin/engine.rb +3 -0
  30. data/lib/rails_admin/extensions/history/history.rb +4 -6
  31. data/lib/rails_admin/version.rb +1 -1
  32. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22f6b0bf2715b8343ec12147a678f6af4342fd60
4
- data.tar.gz: 06c11b7753f662ea8aee4d5b0c7a41fc4f61902f
3
+ metadata.gz: 6e83f0b5ab7fea00e279ccb63773df754a184035
4
+ data.tar.gz: 03a9fae5679bf0d672d117ffd972e70a78428cb8
5
5
  SHA512:
6
- metadata.gz: 5088678be8b3b6e30e545fbbfcdc9331a725341d8c002eb2067c181b349ad5a2a34e7d45d6b7257310858f0e6b35888759a354e8c4581546cbe822a9f6a96892
7
- data.tar.gz: 28e6549d5c45bae55ad63564ca5ff4ed81dc9bc25df53b253cb64d783f10d43da61f69bea76acb004725f9e7abf6695fdbe405404f207a49a0ffda863478e58d
6
+ metadata.gz: 4a25b6d1b31de086846abc6069af7190770fe71f2a8ce127282267776ace5206462abbfbddd1b12e839d224548fa8c12c6c4a1e2b9d7c1f7b8def9736146e6b3
7
+ data.tar.gz: f01215ec461ec23ea67a46455c610caa40c8c35168b160454a1c33c2534800126533c509bc7bfd8d2c9c2401923a679efa51ab046200b10ca83f41fac93c2608
data/Gemfile CHANGED
@@ -1,16 +1,17 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  case ENV['RAILS_VERSION']
4
- when '4.2'
5
- gem 'rails', '~> 4.2.0.beta1'
6
- gem 'sass-rails', '~> 5.0.0.beta1'
7
- gem 'devise', github: 'plataformatec/devise', branch: 'lm-rails-4-2'
8
4
  when '4.0'
9
5
  gem 'rails', '~> 4.0.0'
10
6
  gem 'devise', '>= 3.2'
11
- else
7
+ gem 'test-unit'
8
+ when '4.1'
12
9
  gem 'rails', '~> 4.1.0'
13
10
  gem 'devise', '>= 3.2'
11
+ else
12
+ gem 'rails', '~> 4.2.0'
13
+ gem 'sass-rails', '~> 5.0'
14
+ gem 'devise', '>= 3.4'
14
15
  end
15
16
 
16
17
  case ENV['CI_ORM']
@@ -57,7 +58,7 @@ group :test do
57
58
  gem 'capybara', '>= 2.1'
58
59
  gem 'carrierwave', '>= 0.8'
59
60
  gem 'coveralls'
60
- gem 'database_cleaner', '>= 1.2'
61
+ gem 'database_cleaner', ['>= 1.2', '!= 1.4.0']
61
62
  gem 'dragonfly', '~> 1.0'
62
63
  gem 'factory_girl', '>= 4.2'
63
64
  gem 'generator_spec', '>= 0.8'
data/README.md CHANGED
@@ -89,7 +89,8 @@ This library aims to support and is [tested against][travis] the following Ruby
89
89
 
90
90
  * Ruby 1.9.3
91
91
  * Ruby 2.0.0
92
- * Ruby 2.1.1
92
+ * Ruby 2.1
93
+ * Ruby 2.2
93
94
  * [Rubinius][]
94
95
  * [JRuby][]
95
96
 
@@ -1,153 +1,153 @@
1
1
  [class^="icon-"],
2
2
  [class*=" icon-"] {
3
- @extend .fa
3
+ @extend .fa !optional;
4
4
  }
5
5
 
6
- .icon-glass { @extend .fa-glass; }
7
- .icon-music { @extend .fa-music; }
8
- .icon-search { @extend .fa-search; }
9
- .icon-envelope { @extend .fa-envelope; }
10
- .icon-heart { @extend .fa-heart; }
11
- .icon-star { @extend .fa-star; }
12
- .icon-star-empty { @extend .fa-star-o; }
13
- .icon-user { @extend .fa-user; }
14
- .icon-film { @extend .fa-film; }
15
- .icon-th-large { @extend .fa-th-large; }
16
- .icon-th { @extend .fa-th; }
17
- .icon-th-list { @extend .fa-th-list; }
18
- .icon-ok { @extend .fa-check; }
19
- .icon-remove { @extend .fa-times; }
20
- .icon-zoom-in { @extend .fa-search-plus; }
21
- .icon-zoom-out { @extend .fa-search-minus; }
22
- .icon-off { @extend .fa-power-off; }
23
- .icon-signal { @extend .fa-signal; }
24
- .icon-cog { @extend .fa-cog; }
25
- .icon-trash { @extend .fa-trash-o; }
6
+ .icon-glass { @extend .fa-glass !optional; }
7
+ .icon-music { @extend .fa-music !optional; }
8
+ .icon-search { @extend .fa-search !optional; }
9
+ .icon-envelope { @extend .fa-envelope !optional; }
10
+ .icon-heart { @extend .fa-heart !optional; }
11
+ .icon-star { @extend .fa-star !optional; }
12
+ .icon-star-empty { @extend .fa-star-o !optional; }
13
+ .icon-user { @extend .fa-user !optional; }
14
+ .icon-film { @extend .fa-film !optional; }
15
+ .icon-th-large { @extend .fa-th-large !optional; }
16
+ .icon-th { @extend .fa-th !optional; }
17
+ .icon-th-list { @extend .fa-th-list !optional; }
18
+ .icon-ok { @extend .fa-check !optional; }
19
+ .icon-remove { @extend .fa-times !optional; }
20
+ .icon-zoom-in { @extend .fa-search-plus !optional; }
21
+ .icon-zoom-out { @extend .fa-search-minus !optional; }
22
+ .icon-off { @extend .fa-power-off !optional; }
23
+ .icon-signal { @extend .fa-signal !optional; }
24
+ .icon-cog { @extend .fa-cog !optional; }
25
+ .icon-trash { @extend .fa-trash-o !optional; }
26
26
 
27
- .icon-home { @extend .fa-home; }
28
- .icon-file { @extend .fa-file; }
29
- .icon-time { @extend .fa-clock-o; }
30
- .icon-road { @extend .fa-road; }
31
- .icon-download-alt { @extend .fa-download; }
32
- .icon-download { @extend .fa-download; }
33
- .icon-upload { @extend .fa-upload; }
34
- .icon-inbox { @extend .fa-inbox; }
35
- .icon-play-circle { @extend .fa-play-circle; }
36
- .icon-repeat { @extend .fa-repeat; }
37
- .icon-refresh { @extend .fa-refresh; }
38
- .icon-list-alt { @extend .fa-list-alt; }
39
- .icon-lock { @extend .fa-lock; }
40
- .icon-flag { @extend .fa-flag; }
41
- .icon-headphones { @extend .fa-headphones; }
42
- .icon-volume-off { @extend .fa-volume-off; }
43
- .icon-volume-down { @extend .fa-volume-down; }
44
- .icon-volume-up { @extend .fa-volume-up; }
45
- .icon-qrcode { @extend .fa-qrcode; }
46
- .icon-barcode { @extend .fa-barcode; }
27
+ .icon-home { @extend .fa-home !optional; }
28
+ .icon-file { @extend .fa-file !optional; }
29
+ .icon-time { @extend .fa-clock-o !optional; }
30
+ .icon-road { @extend .fa-road !optional; }
31
+ .icon-download-alt { @extend .fa-download !optional; }
32
+ .icon-download { @extend .fa-download !optional; }
33
+ .icon-upload { @extend .fa-upload !optional; }
34
+ .icon-inbox { @extend .fa-inbox !optional; }
35
+ .icon-play-circle { @extend .fa-play-circle !optional; }
36
+ .icon-repeat { @extend .fa-repeat !optional; }
37
+ .icon-refresh { @extend .fa-refresh !optional; }
38
+ .icon-list-alt { @extend .fa-list-alt !optional; }
39
+ .icon-lock { @extend .fa-lock !optional; }
40
+ .icon-flag { @extend .fa-flag !optional; }
41
+ .icon-headphones { @extend .fa-headphones !optional; }
42
+ .icon-volume-off { @extend .fa-volume-off !optional; }
43
+ .icon-volume-down { @extend .fa-volume-down !optional; }
44
+ .icon-volume-up { @extend .fa-volume-up !optional; }
45
+ .icon-qrcode { @extend .fa-qrcode !optional; }
46
+ .icon-barcode { @extend .fa-barcode !optional; }
47
47
 
48
- .icon-tag { @extend .fa-tag; }
49
- .icon-tags { @extend .fa-tags; }
50
- .icon-book { @extend .fa-book; }
51
- .icon-bookmark { @extend .fa-bookmark; }
52
- .icon-print { @extend .fa-print; }
53
- .icon-camera { @extend .fa-camera; }
54
- .icon-font { @extend .fa-font; }
55
- .icon-bold { @extend .fa-bold; }
56
- .icon-italic { @extend .fa-italic; }
57
- .icon-text-height { @extend .fa-text-height; }
58
- .icon-text-width { @extend .fa-text-width; }
59
- .icon-align-left { @extend .fa-align-left; }
60
- .icon-align-center { @extend .fa-align-center; }
61
- .icon-align-right { @extend .fa-align-right; }
62
- .icon-align-justify { @extend .fa-align-justify; }
63
- .icon-list { @extend .fa-list; }
64
- .icon-indent-left { @extend .fa-indent; }
65
- .icon-indent-right { @extend .fa-dedent; }
66
- .icon-facetime-video { @extend .fa-video-camera; }
67
- .icon-picture { @extend .fa-picture-o; }
48
+ .icon-tag { @extend .fa-tag !optional; }
49
+ .icon-tags { @extend .fa-tags !optional; }
50
+ .icon-book { @extend .fa-book !optional; }
51
+ .icon-bookmark { @extend .fa-bookmark !optional; }
52
+ .icon-print { @extend .fa-print !optional; }
53
+ .icon-camera { @extend .fa-camera !optional; }
54
+ .icon-font { @extend .fa-font !optional; }
55
+ .icon-bold { @extend .fa-bold !optional; }
56
+ .icon-italic { @extend .fa-italic !optional; }
57
+ .icon-text-height { @extend .fa-text-height !optional; }
58
+ .icon-text-width { @extend .fa-text-width !optional; }
59
+ .icon-align-left { @extend .fa-align-left !optional; }
60
+ .icon-align-center { @extend .fa-align-center !optional; }
61
+ .icon-align-right { @extend .fa-align-right !optional; }
62
+ .icon-align-justify { @extend .fa-align-justify !optional; }
63
+ .icon-list { @extend .fa-list !optional; }
64
+ .icon-indent-left { @extend .fa-indent !optional; }
65
+ .icon-indent-right { @extend .fa-dedent !optional; }
66
+ .icon-facetime-video { @extend .fa-video-camera !optional; }
67
+ .icon-picture { @extend .fa-picture-o !optional; }
68
68
 
69
- .icon-pencil { @extend .fa-pencil; }
70
- .icon-map-marker { @extend .fa-map-marker; }
71
- .icon-adjust { @extend .fa-adjust; }
72
- .icon-tint { @extend .fa-tint; }
73
- .icon-edit { @extend .fa-edit; }
74
- .icon-share { @extend .fa-share-square-o; }
75
- .icon-check { @extend .fa-check; }
76
- .icon-move { @extend .fa-arrows; }
77
- .icon-step-backward { @extend .fa-step-backward; }
78
- .icon-fast-backward { @extend .fa-fast-backward; }
79
- .icon-backward { @extend .fa-backward; }
80
- .icon-play { @extend .fa-play; }
81
- .icon-pause { @extend .fa-pause; }
82
- .icon-stop { @extend .fa-stop; }
83
- .icon-forward { @extend .fa-forward; }
84
- .icon-fast-forward { @extend .fa-fast-forward; }
85
- .icon-step-forward { @extend .fa-step-forward; }
86
- .icon-eject { @extend .fa-eject; }
87
- .icon-chevron-left { @extend .fa-chevron-left; }
88
- .icon-chevron-right { @extend .fa-chevron-right; }
69
+ .icon-pencil { @extend .fa-pencil !optional; }
70
+ .icon-map-marker { @extend .fa-map-marker !optional; }
71
+ .icon-adjust { @extend .fa-adjust !optional; }
72
+ .icon-tint { @extend .fa-tint !optional; }
73
+ .icon-edit { @extend .fa-edit !optional; }
74
+ .icon-share { @extend .fa-share-square-o !optional; }
75
+ .icon-check { @extend .fa-check !optional; }
76
+ .icon-move { @extend .fa-arrows !optional; }
77
+ .icon-step-backward { @extend .fa-step-backward !optional; }
78
+ .icon-fast-backward { @extend .fa-fast-backward !optional; }
79
+ .icon-backward { @extend .fa-backward !optional; }
80
+ .icon-play { @extend .fa-play !optional; }
81
+ .icon-pause { @extend .fa-pause !optional; }
82
+ .icon-stop { @extend .fa-stop !optional; }
83
+ .icon-forward { @extend .fa-forward !optional; }
84
+ .icon-fast-forward { @extend .fa-fast-forward !optional; }
85
+ .icon-step-forward { @extend .fa-step-forward !optional; }
86
+ .icon-eject { @extend .fa-eject !optional; }
87
+ .icon-chevron-left { @extend .fa-chevron-left !optional; }
88
+ .icon-chevron-right { @extend .fa-chevron-right !optional; }
89
89
 
90
- .icon-plus-sign { @extend .fa-plus-circle; }
91
- .icon-minus-sign { @extend .fa-minus-circle; }
92
- .icon-remove-sign { @extend .fa-times-circle; }
93
- .icon-ok-sign { @extend .fa-check-circle; }
94
- .icon-question-sign { @extend .fa-question-circle; }
95
- .icon-info-sign { @extend .fa-info-circle; }
96
- .icon-screenshot { @extend .fa-crosshairs; }
97
- .icon-remove-circle { @extend .fa-times-circle-o; }
98
- .icon-ok-circle { @extend .fa-check-circle-o; }
99
- .icon-ban-circle { @extend .fa-ban; }
100
- .icon-arrow-left { @extend .fa-arrow-left; }
101
- .icon-arrow-right { @extend .fa-arrow-right; }
102
- .icon-arrow-up { @extend .fa-arrow-up; }
103
- .icon-arrow-down { @extend .fa-arrow-down; }
104
- .icon-share-alt { @extend .fa-share; }
105
- .icon-resize-full { @extend .fa-expand; }
106
- .icon-resize-small { @extend .fa-compress; }
107
- .icon-plus { @extend .fa-plus; }
108
- .icon-minus { @extend .fa-minus; }
109
- .icon-asterisk { @extend .fa-asterisk; }
90
+ .icon-plus-sign { @extend .fa-plus-circle !optional; }
91
+ .icon-minus-sign { @extend .fa-minus-circle !optional; }
92
+ .icon-remove-sign { @extend .fa-times-circle !optional; }
93
+ .icon-ok-sign { @extend .fa-check-circle !optional; }
94
+ .icon-question-sign { @extend .fa-question-circle !optional; }
95
+ .icon-info-sign { @extend .fa-info-circle !optional; }
96
+ .icon-screenshot { @extend .fa-crosshairs !optional; }
97
+ .icon-remove-circle { @extend .fa-times-circle-o !optional; }
98
+ .icon-ok-circle { @extend .fa-check-circle-o !optional; }
99
+ .icon-ban-circle { @extend .fa-ban !optional; }
100
+ .icon-arrow-left { @extend .fa-arrow-left !optional; }
101
+ .icon-arrow-right { @extend .fa-arrow-right !optional; }
102
+ .icon-arrow-up { @extend .fa-arrow-up !optional; }
103
+ .icon-arrow-down { @extend .fa-arrow-down !optional; }
104
+ .icon-share-alt { @extend .fa-share !optional; }
105
+ .icon-resize-full { @extend .fa-expand !optional; }
106
+ .icon-resize-small { @extend .fa-compress !optional; }
107
+ .icon-plus { @extend .fa-plus !optional; }
108
+ .icon-minus { @extend .fa-minus !optional; }
109
+ .icon-asterisk { @extend .fa-asterisk !optional; }
110
110
 
111
- .icon-exclamation-sign { @extend .fa-exclamation-circle; }
112
- .icon-gift { @extend .fa-gift; }
113
- .icon-leaf { @extend .fa-leaf; }
114
- .icon-fire { @extend .fa-fire; }
115
- .icon-eye-open { @extend .fa-eye; }
116
- .icon-eye-close { @extend .fa-eye-slash; }
117
- .icon-warning-sign { @extend .fa-warning; }
118
- .icon-plane { @extend .fa-plane; }
119
- .icon-calendar { @extend .fa-calendar; }
120
- .icon-random { @extend .fa-random; }
121
- .icon-comment { @extend .fa-comment; }
122
- .icon-magnet { @extend .fa-magnet; }
123
- .icon-chevron-up { @extend .fa-chevron-up; }
124
- .icon-chevron-down { @extend .fa-chevron-down; }
125
- .icon-retweet { @extend .fa-retweet; }
126
- .icon-shopping-cart { @extend .fa-shopping-cart; }
127
- .icon-folder-close { @extend .fa-folder; }
128
- .icon-folder-open { @extend .fa-folder-open; }
129
- .icon-resize-vertical { @extend .fa-arrows-v; }
130
- .icon-resize-horizontal { @extend .fa-arrows-h; }
111
+ .icon-exclamation-sign { @extend .fa-exclamation-circle !optional; }
112
+ .icon-gift { @extend .fa-gift !optional; }
113
+ .icon-leaf { @extend .fa-leaf !optional; }
114
+ .icon-fire { @extend .fa-fire !optional; }
115
+ .icon-eye-open { @extend .fa-eye !optional; }
116
+ .icon-eye-close { @extend .fa-eye-slash !optional; }
117
+ .icon-warning-sign { @extend .fa-warning !optional; }
118
+ .icon-plane { @extend .fa-plane !optional; }
119
+ .icon-calendar { @extend .fa-calendar !optional; }
120
+ .icon-random { @extend .fa-random !optional; }
121
+ .icon-comment { @extend .fa-comment !optional; }
122
+ .icon-magnet { @extend .fa-magnet !optional; }
123
+ .icon-chevron-up { @extend .fa-chevron-up !optional; }
124
+ .icon-chevron-down { @extend .fa-chevron-down !optional; }
125
+ .icon-retweet { @extend .fa-retweet !optional; }
126
+ .icon-shopping-cart { @extend .fa-shopping-cart !optional; }
127
+ .icon-folder-close { @extend .fa-folder !optional; }
128
+ .icon-folder-open { @extend .fa-folder-open !optional; }
129
+ .icon-resize-vertical { @extend .fa-arrows-v !optional; }
130
+ .icon-resize-horizontal { @extend .fa-arrows-h !optional; }
131
131
 
132
- .icon-hdd { @extend .fa-hdd-o; }
133
- .icon-bullhorn { @extend .fa-bullhorn; }
134
- .icon-bell { @extend .fa-bell; }
135
- .icon-certificate { @extend .fa-certificate; }
136
- .icon-thumbs-up { @extend .fa-thumbs-up; }
137
- .icon-thumbs-down { @extend .fa-thumbs-down; }
138
- .icon-hand-right { @extend .fa-hand-o-right; }
139
- .icon-hand-left { @extend .fa-hand-o-left; }
140
- .icon-hand-up { @extend .fa-hand-o-up; }
141
- .icon-hand-down { @extend .fa-hand-o-down; }
142
- .icon-circle-arrow-right { @extend .fa-arrow-circle-right; }
143
- .icon-circle-arrow-left { @extend .fa-arrow-circle-left; }
144
- .icon-circle-arrow-up { @extend .fa-arrow-circle-up; }
145
- .icon-circle-arrow-down { @extend .fa-arrow-circle-down; }
146
- .icon-globe { @extend .fa-globe; }
147
- .icon-wrench { @extend .fa-wrench; }
148
- .icon-tasks { @extend .fa-tasks; }
149
- .icon-filter { @extend .fa-filter; }
150
- .icon-briefcase { @extend .fa-briefcase; }
151
- .icon-fullscreen { @extend .fa-arrows-alt; }
132
+ .icon-hdd { @extend .fa-hdd-o !optional; }
133
+ .icon-bullhorn { @extend .fa-bullhorn !optional; }
134
+ .icon-bell { @extend .fa-bell !optional; }
135
+ .icon-certificate { @extend .fa-certificate !optional; }
136
+ .icon-thumbs-up { @extend .fa-thumbs-up !optional; }
137
+ .icon-thumbs-down { @extend .fa-thumbs-down !optional; }
138
+ .icon-hand-right { @extend .fa-hand-o-right !optional; }
139
+ .icon-hand-left { @extend .fa-hand-o-left !optional; }
140
+ .icon-hand-up { @extend .fa-hand-o-up !optional; }
141
+ .icon-hand-down { @extend .fa-hand-o-down !optional; }
142
+ .icon-circle-arrow-right { @extend .fa-arrow-circle-right !optional; }
143
+ .icon-circle-arrow-left { @extend .fa-arrow-circle-left !optional; }
144
+ .icon-circle-arrow-up { @extend .fa-arrow-circle-up !optional; }
145
+ .icon-circle-arrow-down { @extend .fa-arrow-circle-down !optional; }
146
+ .icon-globe { @extend .fa-globe !optional; }
147
+ .icon-wrench { @extend .fa-wrench !optional; }
148
+ .icon-tasks { @extend .fa-tasks !optional; }
149
+ .icon-filter { @extend .fa-filter !optional; }
150
+ .icon-briefcase { @extend .fa-briefcase !optional; }
151
+ .icon-fullscreen { @extend .fa-arrows-alt !optional; }
152
152
 
153
- .icon-white { color:white; }
153
+ .icon-white { color:white; }
@@ -33,6 +33,7 @@ body.rails_admin {
33
33
  top: 50px;
34
34
  bottom: 0;
35
35
  background: #eaf0f1;
36
+ z-index: 100;
36
37
  }
37
38
 
38
39
  /* fat labels in forms */
@@ -116,8 +117,6 @@ body.rails_admin {
116
117
  fieldset {
117
118
  margin-left:-10px;
118
119
  .control-group > label {
119
- padding-left:10px;
120
- width:135px;
121
120
  }
122
121
  legend {
123
122
  float:left;
@@ -133,8 +132,6 @@ body.rails_admin {
133
132
  fieldset {
134
133
  margin-left:-20px;
135
134
  .control-group > label {
136
- padding-left:20px;
137
- width:125px;
138
135
  }
139
136
  legend {
140
137
  margin-left:20px;
@@ -181,7 +178,7 @@ body.rails_admin {
181
178
  // }
182
179
 
183
180
  /* nested nav */
184
- .nav.nav-list {
181
+ .nav {
185
182
  .nav-level-1 {
186
183
  padding-left:30px;
187
184
  }
@@ -269,7 +266,7 @@ body.rails_admin {
269
266
  /* icons */
270
267
  td.links {
271
268
  max-width: none;
272
- .inline {
269
+ .list-inline {
273
270
  margin:0px;
274
271
  li { display:inline-block; }
275
272
  }
@@ -6,7 +6,7 @@
6
6
  .ui-datepicker {
7
7
  /* fix glitches */
8
8
  border-width:0px;
9
- z-index: 3!important;
9
+ z-index: 1051!important;
10
10
  table{
11
11
  margin:0px;
12
12
  }
@@ -7,6 +7,9 @@ module RailsAdmin
7
7
  class ObjectNotFound < ::StandardError
8
8
  end
9
9
 
10
+ class ActionNotAllowed < ::StandardError
11
+ end
12
+
10
13
  class ApplicationController < ::ApplicationController
11
14
  newrelic_ignore if defined?(NewRelic)
12
15
 
@@ -16,7 +19,7 @@ module RailsAdmin
16
19
 
17
20
  helper_method :_current_user, :_get_plugin_name
18
21
 
19
- attr_reader :object, :model_config, :abstract_model
22
+ attr_reader :object, :model_config, :abstract_model, :authorization_adapter
20
23
 
21
24
  def get_model
22
25
  @model_name = to_model_name(params[:model_name])
@@ -68,13 +71,5 @@ module RailsAdmin
68
71
  params[:action] = 'dashboard'
69
72
  dashboard
70
73
  end
71
-
72
- def not_found
73
- render file: Rails.root.join('public', '404.html'), layout: false, status: :not_found
74
- end
75
-
76
- def rails_admin_controller?
77
- true
78
- end
79
74
  end
80
75
  end
@@ -11,16 +11,17 @@ module RailsAdmin
11
11
  before_filter :check_for_cancel
12
12
 
13
13
  RailsAdmin::Config::Actions.all.each do |action|
14
- class_eval %{
14
+ class_eval <<-EOS, __FILE__, __LINE__ + 1
15
15
  def #{action.action_name}
16
16
  action = RailsAdmin::Config::Actions.find('#{action.action_name}'.to_sym)
17
17
  @authorization_adapter.try(:authorize, action.authorization_key, @abstract_model, @object)
18
18
  @action = action.with({controller: self, abstract_model: @abstract_model, object: @object})
19
+ fail(ActionNotAllowed) unless @action.enabled?
19
20
  @page_name = wording_for(:title)
20
21
 
21
22
  instance_eval &@action.controller
22
23
  end
23
- }
24
+ EOS
24
25
  end
25
26
 
26
27
  def bulk_action
@@ -12,9 +12,9 @@ module RailsAdmin
12
12
  wording
13
13
  end
14
14
 
15
- def authorized?(action, abstract_model = nil, object = nil)
15
+ def authorized?(action_name, abstract_model = nil, object = nil)
16
16
  object = nil if object.try :new_record?
17
- @authorization_adapter.nil? || @authorization_adapter.authorized?(action, abstract_model, object)
17
+ action(action_name, abstract_model, object).try(:authorized?)
18
18
  end
19
19
 
20
20
  def current_action?(action, abstract_model = @abstract_model, object = @object)
@@ -32,9 +32,8 @@ module RailsAdmin
32
32
  end
33
33
 
34
34
  def edit_user_link
35
- return nil unless authorized?(:edit, _current_user.class, _current_user) && _current_user.respond_to?(:email)
36
35
  return nil unless abstract_model = RailsAdmin.config(_current_user.class).abstract_model
37
- return nil unless edit_action = RailsAdmin::Config::Actions.find(:edit, controller: controller, abstract_model: abstract_model, object: _current_user)
36
+ return nil unless (edit_action = RailsAdmin::Config::Actions.find(:edit, controller: controller, abstract_model: abstract_model, object: _current_user)).try(:authorized?)
38
37
  link_to _current_user.email, url_for(action: edit_action.action_name, model_name: abstract_model.to_param, id: _current_user.id, controller: 'rails_admin/main')
39
38
  end
40
39
 
@@ -2,11 +2,11 @@
2
2
  - actions(:root).each do |action|
3
3
  %li{class: "#{action.action_name}_root_link"}= link_to wording_for(:menu, action), { action: action.action_name, controller: 'rails_admin/main' }, class: "pjax"
4
4
  - if main_app_root_path = (main_app.root_path rescue false)
5
- %li= link_to t('admin.home.name').capitalize, main_app_root_path
5
+ %li= link_to t('admin.home.name'), main_app_root_path
6
6
  - if _current_user
7
7
  - if user_link = edit_user_link
8
8
  %li= user_link
9
9
  - if logout_path.present?
10
- %li= link_to content_tag('span', t('admin.misc.log_out'), class: 'label label-important'), logout_path, method: logout_method
10
+ %li= link_to content_tag('span', t('admin.misc.log_out'), class: 'label label-danger'), logout_path, method: logout_method
11
11
  - if _current_user.respond_to?(:email) && _current_user.email.present?
12
12
  %li= image_tag "#{(request.ssl? ? 'https://secure' : 'http://www')}.gravatar.com/avatar/#{Digest::MD5.hexdigest _current_user.email}?s=30", style: 'padding-top:5px'
@@ -1,7 +1,7 @@
1
1
  - object = delete_notice
2
2
 
3
3
  %li{style: 'display:block; margin-top:10px'}
4
- %span.label= @abstract_model.pretty_name
4
+ %span.label.label-default= @abstract_model.pretty_name
5
5
  - wording = object.send(@model_config.object_label_method)
6
6
  - if show_action = action(:show, @abstract_model, object)
7
7
  = link_to(wording, url_for(action: show_action.action_name, model_name: @abstract_model.to_param, id: object.id), class: 'pjax')
@@ -1 +1 @@
1
- = form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge({ value: field.form_value, checked: field.form_value.in?([true, '1']), class: 'form-control'})
1
+ = form.send field.view_helper, field.method_name, field.html_attributes.reverse_merge({ value: field.form_value, checked: field.form_value.in?([true, '1']), class: 'form-control', required: field.required})
@@ -1,4 +1,4 @@
1
- .controls{data: { nestedmany: true }}
1
+ .controls.col-md-offset-2{data: { nestedmany: true }}
2
2
  .btn-group
3
3
  %a.btn.btn-info.toggler{:'data-toggle' => "button", :'data-target' => "#{form.jquery_namespace(field)} > .tab-content, #{form.jquery_namespace(field)} > .controls > .nav", class: (field.active? ? 'active' : '')}
4
4
  %i.icon-white
@@ -1 +1 @@
1
- = form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: false, options: {}.to_json }).reverse_merge({ value: field.form_value, class: 'form-control' })
1
+ = form.text_area field.method_name, field.html_attributes.reverse_merge(data: { richtext: false, options: {}.to_json }).reverse_merge({ value: field.form_value, class: 'form-control', required: field.required })
@@ -1,16 +1,18 @@
1
1
  %input{type: :hidden, name: 'return_to', value: (params[:return_to].presence || request.referer)}
2
2
  %br
3
- .form-actions
4
- %button.btn.btn-primary{type: "submit", name: "_save", :'data-disable-with' => t("admin.form.save")}
5
- %i.icon-white.icon-ok
6
- = t("admin.form.save")
7
- %span.extra_buttons
8
- - if authorized? :new, @abstract_model
9
- %button.btn.btn-info{type: "submit", name: "_add_another", :'data-disable-with' => t("admin.form.save_and_add_another")}
10
- = t("admin.form.save_and_add_another")
11
- - if authorized? :edit, @abstract_model
12
- %button.btn.btn-info{type: "submit", name: "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
13
- = t("admin.form.save_and_edit")
14
- %button.btn{type: "submit", name: "_continue", :'data-disable-with' => t("admin.form.cancel")}
15
- %i.icon-remove
16
- = t("admin.form.cancel")
3
+
4
+ .form-group.form-actions
5
+ .col-sm-offset-2.col-sm-10
6
+ %button.btn.btn-primary{type: "submit", name: "_save", :'data-disable-with' => t("admin.form.save")}
7
+ %i.icon-white.icon-ok
8
+ = t("admin.form.save")
9
+ %span.extra_buttons
10
+ - if authorized? :new, @abstract_model
11
+ %button.btn.btn-info{type: "submit", name: "_add_another", :'data-disable-with' => t("admin.form.save_and_add_another")}
12
+ = t("admin.form.save_and_add_another")
13
+ - if authorized? :edit, @abstract_model
14
+ %button.btn.btn-info{type: "submit", name: "_add_edit", :'data-disable-with' => t("admin.form.save_and_edit")}
15
+ = t("admin.form.save_and_edit")
16
+ %button.btn{type: "submit", name: "_continue", :'data-disable-with' => t("admin.form.cancel")}
17
+ %i.icon-remove
18
+ = t("admin.form.cancel")
@@ -27,8 +27,8 @@
27
27
  .progress-bar.animate-width-to{:class => "progress-bar-#{get_indicator(percent)}", :'data-animate-length' => ([1.0, percent].max.to_i * 20), :'data-animate-width-to' => "#{[2.0, percent].max.to_i}%", style: "width:2%"}
28
28
  = @count[abstract_model.pretty_name]
29
29
  %td.links
30
- %ul.inline= menu_for :collection, abstract_model, nil, true
31
- - if @auditing_adapter && authorized?(:history)
30
+ %ul.inline.list-inline= menu_for :collection, abstract_model, nil, true
31
+ - if @auditing_adapter && authorized?(:history_index)
32
32
  #block-tables.block
33
33
  .content
34
34
  %h2= t("admin.actions.history_index.menu")
@@ -8,13 +8,13 @@
8
8
  %legend
9
9
  %i.icon-chevron-down
10
10
  = t('admin.export.select')
11
- .control-group
11
+ .form-group.control-group
12
12
  .controls
13
13
  .col-sm-2
14
14
  %label.col-sm-10.checkbox{for: 'check_all'}
15
15
  = check_box_tag 'all', 'all', true, { id: 'check_all' }
16
16
  = t('admin.export.select_all_fields')
17
- .control-group
17
+ .form-group.control-group
18
18
  %label.col-sm-2.control-label{rel: 'tooltip', :'data-original-title' => t('admin.export.click_to_reverse_selection'), onclick: 'jQuery(this).siblings(".controls").find("input").click()'}= t('admin.export.fields_from', name: @model_config.label_plural.downcase)
19
19
  .col-sm-10.controls
20
20
  - visible_fields.select{ |f| !f.association? || f.association.polymorphic? }.each do |field|
@@ -34,7 +34,7 @@
34
34
 
35
35
  - visible_fields.select{ |f| f.association? && !f.association.polymorphic? }.each do |field|
36
36
  - fields = field.associated_model_config.export.with(controller: self.controller, view: self, object: (associated_model = field.associated_model_config.abstract_model.model).new).visible_fields.select{ |f| !f.association? }
37
- .control-group
37
+ .form-group.control-group
38
38
  %label.col-sm-2.control-label{rel: 'tooltip', :'data-original-title' => t('admin.export.click_to_reverse_selection'), onclick: 'jQuery(this).siblings(".controls").find("input").click()'}= t('admin.export.fields_from_associated', name: field.label.downcase)
39
39
  .col-sm-10.controls
40
40
  - fields.each do |associated_model_field|
@@ -47,7 +47,7 @@
47
47
  %legend
48
48
  %i.icon-chevron-down
49
49
  = t('admin.export.options_for', name: 'csv')
50
- .control-group
50
+ .form-group.control-group
51
51
  - guessed_encoding = @abstract_model.encoding
52
52
  %label.col-sm-2.control-label{for: "csv_options_encoding_to"}= t('admin.export.csv.encoding_to')
53
53
  .col-sm-10.controls
@@ -55,14 +55,14 @@
55
55
  = select_tag 'csv_options[encoding_to]', options_for_select(RailsAdmin::CSVConverter::TARGET_ENCODINGS), include_blank: true
56
56
  %p.help-block= t('admin.export.csv.encoding_to_help', name: guessed_encoding)
57
57
 
58
- .control-group
58
+ .form-group.control-group
59
59
  %label.col-sm-2.control-label{for: "csv_options_skip_header"}= t('admin.export.csv.skip_header')
60
60
  .col-sm-10.controls
61
61
  %label.checkbox
62
62
  = check_box_tag 'csv_options[skip_header]', 'true'
63
63
  %p.help-block= t('admin.export.csv.skip_header_help')
64
64
 
65
- .control-group
65
+ .form-group.control-group
66
66
  %label.col-sm-2.control-label{for: "csv_options_generator_col_sep"}= t('admin.export.csv.col_sep')
67
67
  .col-sm-10.controls
68
68
  = select_tag 'csv_options[generator][col_sep]', options_for_select({ '' => t('admin.export.csv.default_col_sep'), "<comma> ','" => ',', "<semicolon> ';'" => ';', '<tabs>' => "'\t'" })
@@ -7,10 +7,12 @@
7
7
 
8
8
  = form_tag("", method: "get", class: "search pjax-form form-inline") do
9
9
  .well
10
- %input{name: "query", type: "search", value: query, placeholder: "#{t("admin.misc.filter")}", class: 'input-small'}
11
- %button.btn.btn-primary{type: "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
12
- %i.icon-white.icon-refresh
13
- = t("admin.misc.refresh")
10
+ .input-group
11
+ %input.form-control.input-small{name: "query", type: "search", value: query, placeholder: "#{t("admin.misc.filter")}", class: 'input-small'}
12
+ %span.input-group-btn
13
+ %button.btn.btn-primary{type: "submit", :'data-disable-with' => "<i class='icon-white icon-refresh'></i> ".html_safe + t("admin.misc.refresh")}
14
+ %i.icon-white.icon-refresh
15
+ = t("admin.misc.refresh")
14
16
  %table#history.table.table-striped.table-condensed
15
17
  %thead
16
18
  %tr
@@ -145,7 +145,7 @@
145
145
  - if @other_right_link ||= other_right && index_path(params.merge(set: (params[:set].to_i + 1)))
146
146
  %td.other.right= link_to "...", @other_right_link, class: 'pjax'
147
147
  %td.last.links
148
- %ul.inline= menu_for :member, @abstract_model, object, true
148
+ %ul.inline.list-inline= menu_for :member, @abstract_model, object, true
149
149
  - if @objects.respond_to?(:total_count)
150
150
  - total_count = @objects.total_count.to_i
151
151
  .row
@@ -18,7 +18,7 @@ module RailsAdmin
18
18
  end
19
19
 
20
20
  def type
21
- if model.serialized_attributes[property.name.to_s]
21
+ if serialized?
22
22
  :serialized
23
23
  else
24
24
  property.type
@@ -44,6 +44,16 @@ module RailsAdmin
44
44
  def read_only?
45
45
  false
46
46
  end
47
+
48
+ private
49
+
50
+ def serialized?
51
+ if Rails.version < '4.2'
52
+ model.serialized_attributes[property.name.to_s]
53
+ else
54
+ model.type_for_attribute(property.name).class == ::ActiveRecord::Type::Serialized
55
+ end
56
+ end
47
57
  end
48
58
  end
49
59
  end
@@ -320,7 +320,7 @@ module RailsAdmin
320
320
  def visible_models_with_bindings(bindings)
321
321
  models.collect { |m| m.with(bindings) }.select do |m|
322
322
  m.visible? &&
323
- bindings[:controller].authorized?(:index, m.abstract_model) &&
323
+ RailsAdmin::Config::Actions.find(:index, bindings.merge(abstract_model: m.abstract_model)).try(:authorized?) &&
324
324
  (!m.abstract_model.embedded? || m.abstract_model.cyclic?)
325
325
  end
326
326
  end
@@ -28,15 +28,18 @@ module RailsAdmin
28
28
  authorized?
29
29
  end
30
30
 
31
+ register_instance_option :enabled? do
32
+ bindings[:abstract_model].nil? || (
33
+ (only.nil? || [only].flatten.collect(&:to_s).include?(bindings[:abstract_model].to_s)) &&
34
+ ![except].flatten.collect(&:to_s).include?(bindings[:abstract_model].to_s) &&
35
+ bindings[:abstract_model].config.with(bindings).visible?
36
+ )
37
+ end
38
+
31
39
  register_instance_option :authorized? do
32
- (
33
- bindings[:controller].nil? || bindings[:controller].authorized?(authorization_key, bindings[:abstract_model], bindings[:object])
34
- ) && (
35
- bindings[:abstract_model].nil? || (
36
- (only.nil? || [only].flatten.collect(&:to_s).include?(bindings[:abstract_model].to_s)) &&
37
- ![except].flatten.collect(&:to_s).include?(bindings[:abstract_model].to_s) &&
38
- bindings[:abstract_model].config.with(bindings).visible?
39
- ))
40
+ enabled? && (
41
+ bindings[:controller].try(:authorization_adapter).nil? || bindings[:controller].authorization_adapter.authorized?(authorization_key, bindings[:abstract_model], bindings[:object])
42
+ )
40
43
  end
41
44
 
42
45
  # Is the action acting on the root level (Example: /admin/contact)
@@ -172,7 +172,7 @@ module RailsAdmin
172
172
  end
173
173
  (@required ||= {})[context] ||= !!([name] + children_fields).uniq.detect do |column_name| # rubocop:disable DoubleNegation
174
174
  abstract_model.model.validators_on(column_name).detect do |v|
175
- !v.options[:allow_nil] &&
175
+ !(v.options[:allow_nil] || v.options[:allow_blank]) &&
176
176
  [:presence, :numericality, :attachment_presence].include?(v.kind) &&
177
177
  (v.options[:on] == context || v.options[:on].blank?)
178
178
  end
@@ -63,7 +63,7 @@ module RailsAdmin
63
63
 
64
64
  # Configurable group label which by default is group's name humanized.
65
65
  register_instance_option :label do
66
- (@label ||= {})[::I18n.locale] ||= (parent.fields.detect { |f|f.name == name }.try(:label) || name.to_s.humanize)
66
+ (@label ||= {})[::I18n.locale] ||= (parent.fields.detect { |f| f.name == name }.try(:label) || name.to_s.humanize)
67
67
  end
68
68
 
69
69
  # Configurable help text
@@ -13,11 +13,11 @@ module RailsAdmin
13
13
  register_instance_option :pretty_value do
14
14
  case value
15
15
  when nil
16
- %(<span class='badge'>-</span>)
16
+ %(<span class='label label-default'>&#x2012;</span>)
17
17
  when false
18
- %(<span class='badge badge-important'>&#x2718;</span>)
18
+ %(<span class='label label-danger'>&#x2718;</span>)
19
19
  when true
20
- %(<span class='badge badge-success'>&#x2713;</span>)
20
+ %(<span class='label label-success'>&#x2713;</span>)
21
21
  end.html_safe
22
22
  end
23
23
 
@@ -23,7 +23,7 @@ module RailsAdmin
23
23
  if enum.is_a?(::Hash)
24
24
  enum.reject { |_k, v| v.to_s != value.to_s }.keys.first.to_s.presence || value.presence || ' - '
25
25
  elsif enum.is_a?(::Array) && enum.first.is_a?(::Array)
26
- enum.detect { |e|e[1].to_s == value.to_s }.try(:first).to_s.presence || value.presence || ' - '
26
+ enum.detect { |e| e[1].to_s == value.to_s }.try(:first).to_s.presence || value.presence || ' - '
27
27
  else
28
28
  value.presence || ' - '
29
29
  end
@@ -33,9 +33,9 @@ module RailsAdmin
33
33
  url = resource_url
34
34
  if image
35
35
  thumb_url = resource_url(thumb_method)
36
- url != thumb_url ? v.link_to(v.image_tag(thumb_url, class: 'img-polaroid'), url, target: 'blank') : v.image_tag(thumb_url)
36
+ url != thumb_url ? v.link_to(v.image_tag(thumb_url, class: 'img-polaroid'), url, target: '_blank') : v.image_tag(thumb_url)
37
37
  else
38
- v.link_to(nil, url, target: 'blank')
38
+ v.link_to(nil, url, target: '_blank')
39
39
  end
40
40
  end
41
41
  end
@@ -7,6 +7,7 @@ module RailsAdmin
7
7
  class Json < RailsAdmin::Config::Fields::Types::Text
8
8
  # Register field type for the type loader
9
9
  RailsAdmin::Config::Fields::Types.register(self)
10
+ RailsAdmin::Config::Fields::Types.register(:jsonb, self)
10
11
 
11
12
  register_instance_option :formatted_value do
12
13
  value.present? ? JSON.pretty_generate(value) : nil
@@ -15,6 +15,9 @@ SafeYAML::OPTIONS[:default_mode] = :unsafe
15
15
  module RailsAdmin
16
16
  class Engine < Rails::Engine
17
17
  isolate_namespace RailsAdmin
18
+
19
+ config.action_dispatch.rescue_responses.merge!('RailsAdmin::ActionNotAllowed' => :forbidden)
20
+
18
21
  initializer 'RailsAdmin precompile hook', group: :all do |app|
19
22
  app.config.assets.precompile += %w(
20
23
  rails_admin/rails_admin.js
@@ -16,12 +16,10 @@ module RailsAdmin
16
16
  end
17
17
 
18
18
  def create_history_item(message, object, abstract_model, user)
19
- create(
20
- message: [message].flatten.join(', '),
21
- item: object.id,
22
- table: abstract_model.to_s,
23
- username: user.try(:email),
24
- )
19
+ create(message: [message].flatten.join(', '),
20
+ item: object.id,
21
+ table: abstract_model.to_s,
22
+ username: user.try(:email))
25
23
  end
26
24
 
27
25
  def history_for_model(abstract_model, query, sort, sort_reverse, all, page, per_page = (RailsAdmin::Config.default_items_per_page || 20))
@@ -2,7 +2,7 @@ module RailsAdmin
2
2
  class Version
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
- PATCH = 6
5
+ PATCH = 7
6
6
  PRE = nil
7
7
 
8
8
  class << self
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Michaels-Ober
8
8
  - Bogdan Gaza
9
9
  - Petteri Kaapa
10
10
  - Benoit Benezech
11
+ - Mitsuhiro Shibuya
11
12
  autorequire:
12
13
  bindir: bin
13
14
  cert_chain: []
14
- date: 2014-12-22 00:00:00.000000000 Z
15
+ date: 2015-03-16 00:00:00.000000000 Z
15
16
  dependencies:
16
17
  - !ruby/object:Gem::Dependency
17
18
  name: builder
@@ -587,7 +588,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
587
588
  version: 1.8.11
588
589
  requirements: []
589
590
  rubyforge_project:
590
- rubygems_version: 2.4.4
591
+ rubygems_version: 2.4.6
591
592
  signing_key:
592
593
  specification_version: 4
593
594
  summary: Admin for Rails