activeadmin 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. data/.travis.yml +8 -5
  2. data/CHANGELOG.md +151 -0
  3. data/Gemfile +16 -16
  4. data/LICENSE +1 -1
  5. data/activeadmin.gemspec +1 -0
  6. data/app/assets/images/active_admin/index_list_icons/block_icon.svg +10 -0
  7. data/app/assets/images/active_admin/index_list_icons/blog_icon.svg +4 -0
  8. data/app/assets/images/active_admin/index_list_icons/grid_icon.svg +13 -0
  9. data/app/assets/images/active_admin/index_list_icons/table_icon.svg +3 -0
  10. data/app/assets/javascripts/active_admin/components/jquery.aa.checkbox-toggler.js.coffee +17 -44
  11. data/app/assets/javascripts/active_admin/components/jquery.aa.dropdown-menu.js.coffee +2 -4
  12. data/app/assets/javascripts/active_admin/components/jquery.aa.popover.js.coffee +0 -3
  13. data/app/assets/javascripts/active_admin/components/jquery.aa.table-checkbox-toggler.js.coffee +10 -12
  14. data/app/assets/javascripts/active_admin/pages/application.js.coffee +13 -10
  15. data/app/assets/javascripts/active_admin/pages/batch_actions.js.coffee +3 -3
  16. data/app/assets/stylesheets/active_admin/_base.css.scss +1 -0
  17. data/app/assets/stylesheets/active_admin/_header.css.scss +5 -2
  18. data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +2 -2
  19. data/app/assets/stylesheets/active_admin/components/_index_list.scss +12 -0
  20. data/app/assets/stylesheets/active_admin/components/_popovers.css.scss +2 -2
  21. data/app/assets/stylesheets/active_admin/components/_table_tools.css.scss +2 -2
  22. data/app/assets/stylesheets/active_admin/mixins/_buttons.css.scss +4 -4
  23. data/app/assets/stylesheets/active_admin/mixins/_gradients.css.scss +5 -4
  24. data/app/assets/stylesheets/active_admin/mixins/_sections.css.scss +1 -1
  25. data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +1 -1
  26. data/app/assets/stylesheets/active_admin/print.css.scss +2 -2
  27. data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +1 -1
  28. data/app/views/active_admin/devise/unlocks/new.html.erb +14 -12
  29. data/docs/1-general-configuration.md +13 -0
  30. data/docs/10-custom-pages.md +40 -28
  31. data/docs/11-decorators.md +6 -4
  32. data/docs/12-arbre-components.md +1 -1
  33. data/docs/13-authorization-adapter.md +206 -0
  34. data/docs/2-resource-customization.md +129 -14
  35. data/docs/3-index-pages.md +65 -0
  36. data/docs/3-index-pages/create-an-index.md +29 -0
  37. data/docs/3-index-pages/index-as-table.md +35 -11
  38. data/docs/5-forms.md +2 -2
  39. data/features/authorization.feature +64 -0
  40. data/features/authorization_cancan.feature +52 -0
  41. data/features/belongs_to.feature +41 -5
  42. data/features/index/batch_actions.feature +27 -3
  43. data/features/index/formats.feature +27 -0
  44. data/features/index/index_as_table.feature +74 -2
  45. data/features/index/index_parameters.feature +69 -0
  46. data/features/index/index_scopes.feature +7 -11
  47. data/features/index/page_title.feature +18 -0
  48. data/features/index/switch_index_view.feature +73 -0
  49. data/features/menu.feature +27 -0
  50. data/features/registering_pages.feature +21 -0
  51. data/features/step_definitions/additional_web_steps.rb +4 -0
  52. data/features/step_definitions/batch_action_steps.rb +16 -6
  53. data/features/step_definitions/index_scope_steps.rb +3 -3
  54. data/features/step_definitions/index_views_steps.rb +3 -0
  55. data/features/step_definitions/menu_steps.rb +4 -0
  56. data/features/support/env.rb +4 -0
  57. data/features/support/paths.rb +3 -0
  58. data/lib/active_admin.rb +4 -0
  59. data/lib/active_admin/application.rb +43 -76
  60. data/lib/active_admin/authorization_adapter.rb +128 -0
  61. data/lib/active_admin/base_controller.rb +18 -1
  62. data/lib/active_admin/base_controller/authorization.rb +153 -0
  63. data/lib/active_admin/base_controller/menu.rb +8 -3
  64. data/lib/active_admin/batch_actions/resource_extension.rb +8 -7
  65. data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
  66. data/lib/active_admin/cancan_adapter.rb +40 -0
  67. data/lib/active_admin/dashboards.rb +4 -5
  68. data/lib/active_admin/dashboards/dashboard_controller.rb +1 -1
  69. data/lib/active_admin/devise.rb +22 -7
  70. data/lib/active_admin/dsl.rb +18 -5
  71. data/lib/active_admin/engine.rb +1 -1
  72. data/lib/active_admin/filters/dsl.rb +1 -1
  73. data/lib/active_admin/filters/forms.rb +9 -7
  74. data/lib/active_admin/filters/resource_extension.rb +20 -15
  75. data/lib/active_admin/form_builder.rb +44 -49
  76. data/lib/active_admin/helpers/optional_display.rb +4 -8
  77. data/lib/active_admin/inputs/filter_boolean_input.rb +1 -1
  78. data/lib/active_admin/inputs/filter_string_input.rb +5 -1
  79. data/lib/active_admin/locales/bg.yml +1 -1
  80. data/lib/active_admin/locales/ca.yml +1 -1
  81. data/lib/active_admin/locales/cs.yml +26 -25
  82. data/lib/active_admin/locales/da.yml +1 -1
  83. data/lib/active_admin/locales/de.yml +1 -1
  84. data/lib/active_admin/locales/en.yml +11 -1
  85. data/lib/active_admin/locales/es.yml +16 -16
  86. data/lib/active_admin/locales/fr.yml +1 -1
  87. data/lib/active_admin/locales/he.yml +1 -1
  88. data/lib/active_admin/locales/hr.yml +1 -1
  89. data/lib/active_admin/locales/hu.yml +1 -1
  90. data/lib/active_admin/locales/it.yml +1 -1
  91. data/lib/active_admin/locales/ja.yml +4 -1
  92. data/lib/active_admin/locales/ko.yml +1 -1
  93. data/lib/active_admin/locales/lt.yml +1 -1
  94. data/lib/active_admin/locales/lv.yml +12 -1
  95. data/lib/active_admin/locales/nl.yml +2 -2
  96. data/lib/active_admin/locales/no-NB.yml +22 -1
  97. data/lib/active_admin/locales/pl.yml +1 -1
  98. data/lib/active_admin/locales/pt-BR.yml +1 -1
  99. data/lib/active_admin/locales/pt-PT.yml +81 -0
  100. data/lib/active_admin/locales/ro.yml +1 -1
  101. data/lib/active_admin/locales/ru.yml +1 -1
  102. data/lib/active_admin/locales/sv-SE.yml +1 -1
  103. data/lib/active_admin/locales/tr.yml +1 -1
  104. data/lib/active_admin/locales/vi.yml +1 -1
  105. data/lib/active_admin/locales/zh-CN.yml +1 -1
  106. data/lib/active_admin/locales/zh-TW.yml +1 -1
  107. data/lib/active_admin/menu.rb +76 -38
  108. data/lib/active_admin/menu_collection.rb +96 -0
  109. data/lib/active_admin/menu_item.rb +61 -71
  110. data/lib/active_admin/namespace.rb +67 -5
  111. data/lib/active_admin/page.rb +6 -0
  112. data/lib/active_admin/page_controller.rb +13 -3
  113. data/lib/active_admin/resource.rb +11 -20
  114. data/lib/active_admin/resource/action_items.rb +3 -3
  115. data/lib/active_admin/resource/controllers.rb +0 -17
  116. data/lib/active_admin/resource/menu.rb +52 -24
  117. data/lib/active_admin/resource/naming.rb +6 -10
  118. data/lib/active_admin/resource/page_presenters.rb +57 -3
  119. data/lib/active_admin/resource/routes.rb +46 -0
  120. data/lib/active_admin/resource_controller.rb +2 -17
  121. data/lib/active_admin/resource_controller/data_access.rb +299 -0
  122. data/lib/active_admin/resource_controller/decorators.rb +2 -1
  123. data/lib/active_admin/resource_dsl.rb +12 -14
  124. data/lib/active_admin/router.rb +61 -56
  125. data/lib/active_admin/scope.rb +28 -18
  126. data/lib/active_admin/version.rb +1 -1
  127. data/lib/active_admin/view_factory.rb +0 -1
  128. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +13 -19
  129. data/lib/active_admin/view_helpers/fields_for.rb +2 -0
  130. data/lib/active_admin/view_helpers/form_helper.rb +1 -1
  131. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +66 -11
  132. data/lib/active_admin/views/components/attributes_table.rb +7 -4
  133. data/lib/active_admin/views/components/index_list.rb +68 -0
  134. data/lib/active_admin/views/components/paginated_collection.rb +13 -9
  135. data/lib/active_admin/views/components/scopes.rb +2 -8
  136. data/lib/active_admin/views/components/table_for.rb +1 -1
  137. data/lib/active_admin/views/footer.rb +1 -1
  138. data/lib/active_admin/views/header.rb +3 -2
  139. data/lib/active_admin/views/index_as_block.rb +4 -0
  140. data/lib/active_admin/views/index_as_blog.rb +4 -0
  141. data/lib/active_admin/views/index_as_grid.rb +4 -0
  142. data/lib/active_admin/views/index_as_table.rb +49 -7
  143. data/lib/active_admin/views/pages/index.rb +19 -4
  144. data/lib/active_admin/views/tabbed_navigation.rb +10 -54
  145. data/lib/generators/active_admin/install/install_generator.rb +5 -1
  146. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +58 -0
  147. data/spec/integration/{default_namespace.rb → default_namespace_spec.rb} +0 -16
  148. data/spec/spec_helper.rb +3 -0
  149. data/spec/support/detect_rails_version.rb +10 -3
  150. data/spec/support/rails_template.rb +1 -1
  151. data/spec/support/templates/post_decorator.rb +6 -6
  152. data/spec/unit/application_spec.rb +5 -5
  153. data/spec/unit/authorization/authorization_adapter_spec.rb +61 -0
  154. data/spec/unit/authorization/controller_authorization_spec.rb +47 -0
  155. data/spec/unit/base_controller_spec.rb +0 -2
  156. data/spec/unit/batch_actions/resource_spec.rb +1 -1
  157. data/spec/unit/breadcrumbs_spec.rb +3 -3
  158. data/spec/unit/cancan_adapter_spec.rb +35 -0
  159. data/spec/unit/config_shared_examples.rb +9 -30
  160. data/spec/unit/devise_spec.rb +29 -0
  161. data/spec/unit/dsl_spec.rb +61 -0
  162. data/spec/unit/filters/filter_form_builder_spec.rb +58 -4
  163. data/spec/unit/filters/resource_spec.rb +17 -5
  164. data/spec/unit/form_builder_spec.rb +15 -0
  165. data/spec/unit/menu_collection_spec.rb +62 -0
  166. data/spec/unit/menu_item_spec.rb +51 -37
  167. data/spec/unit/menu_spec.rb +33 -29
  168. data/spec/unit/namespace/authorization_spec.rb +31 -0
  169. data/spec/unit/namespace/register_page_spec.rb +6 -28
  170. data/spec/unit/namespace/register_resource_spec.rb +11 -34
  171. data/spec/unit/namespace_spec.rb +63 -2
  172. data/spec/unit/page_controller_spec.rb +0 -3
  173. data/spec/unit/reloader_spec.rb +5 -5
  174. data/spec/unit/resource/menu_spec.rb +1 -13
  175. data/spec/unit/resource/naming_spec.rb +20 -2
  176. data/spec/unit/resource/page_presenters_spec.rb +14 -2
  177. data/spec/unit/resource_controller/{collection_spec.rb → data_access_spec.rb} +31 -13
  178. data/spec/unit/resource_controller_spec.rb +4 -5
  179. data/spec/unit/resource_spec.rb +33 -11
  180. data/spec/unit/routing_spec.rb +43 -0
  181. data/spec/unit/scope_spec.rb +13 -0
  182. data/spec/unit/view_factory_spec.rb +0 -1
  183. data/spec/unit/view_helpers/fields_for_spec.rb +4 -0
  184. data/spec/unit/view_helpers/form_helper_spec.rb +6 -2
  185. data/spec/unit/view_helpers/method_or_proc_helper_spec.rb +97 -0
  186. data/spec/unit/views/components/attributes_table_spec.rb +11 -0
  187. data/spec/unit/views/components/index_list_spec.rb +32 -0
  188. data/spec/unit/views/tabbed_navigation_spec.rb +42 -40
  189. data/tasks/test.rake +1 -1
  190. metadata +127 -40
  191. data/lib/active_admin/menu_builder.rb +0 -65
  192. data/lib/active_admin/resource_controller/callbacks.rb +0 -59
  193. data/lib/active_admin/resource_controller/collection.rb +0 -158
  194. data/lib/active_admin/views/utility_nav.rb +0 -41
  195. data/spec/unit/base_controller_shared_examples.rb +0 -25
  196. data/spec/unit/dsl_include_spec.rb +0 -20
@@ -27,9 +27,6 @@ window.AA.Popover = class AA.Popover
27
27
  @_buildPopover()
28
28
  @_bind()
29
29
 
30
- return @
31
-
32
-
33
30
  open: ->
34
31
  @isOpen = true
35
32
  @$popover.fadeIn @options.fadeInDuration
@@ -5,23 +5,21 @@ window.AA.TableCheckboxToggler = class AA.TableCheckboxToggler extends AA.Checkb
5
5
  _bind: ->
6
6
  super
7
7
 
8
- @$container.find("tbody").find("td").bind "click", (e) =>
9
- if e.target.type != 'checkbox'
10
- @_didClickCell(e.target)
11
-
8
+ @$container.find('tbody td').click (e)=>
9
+ @_didClickCell(e.target) if e.target.type isnt 'checkbox'
10
+
12
11
  _didChangeCheckbox: (checkbox) ->
13
12
  super
14
-
15
- $row = $(checkbox).parents("tr")
13
+
14
+ $row = $(checkbox).parents 'tr'
16
15
 
17
16
  if checkbox.checked
18
- $row.addClass("selected")
17
+ $row.addClass 'selected'
19
18
  else
20
- $row.removeClass("selected")
19
+ $row.removeClass 'selected'
21
20
 
22
21
  _didClickCell: (cell) ->
23
- $(cell).parent("tr").find(':checkbox').click()
24
-
25
- ( ( $ ) ->
22
+ $(cell).parent('tr').find(':checkbox').click()
23
+
24
+ jQuery ($)->
26
25
  $.widget.bridge 'tableCheckboxToggler', AA.TableCheckboxToggler
27
- )( jQuery )
@@ -1,13 +1,16 @@
1
- #
2
- # Active Admin JS
3
- #
1
+ # Initializers
2
+ $ ->
3
+ # jQuery datepickers (also evaluates dynamically added HTML)
4
+ $(document).on 'focus', '.datepicker:not(.hasDatepicker)', ->
5
+ $(@).datepicker dateFormat: 'yy-mm-dd'
4
6
 
7
+ # Clear Filters button
8
+ $('.clear_filters_btn').click ->
9
+ window.location.search = ''
5
10
 
6
- $ ->
7
- # Date picker
8
- $(".datepicker").datepicker dateFormat: "yy-mm-dd"
9
- $(".clear_filters_btn").click ->
10
- window.location.search = ""
11
- false
11
+ # Batch Actions dropdown
12
+ $('.dropdown_button').popover()
12
13
 
13
- $(".dropdown_button").popover()
14
+ # Filter form: don't send any inputs that are empty
15
+ $('#q_search').submit ->
16
+ $(@).find(':input').filter(-> @value is '').prop 'disabled', true
@@ -5,7 +5,7 @@ jQuery ($) ->
5
5
  #
6
6
 
7
7
  $(document).delegate "#batch_actions_selector li a", "click.rails", ->
8
- $("#batch_action").val $(this).attr("data-action")
8
+ $("#batch_action").val $(@).attr("data-action")
9
9
  $("#collection_selection").submit()
10
10
 
11
11
  #
@@ -14,8 +14,8 @@ jQuery ($) ->
14
14
 
15
15
  if $("#batch_actions_selector").length && $(":checkbox.toggle_all").length
16
16
 
17
- if $(".paginated_collection").find("table.index_table").length
18
- $(".paginated_collection table").tableCheckboxToggler()
17
+ if $(".paginated_collection table.index_table").length
18
+ $(".paginated_collection table.index_table").tableCheckboxToggler()
19
19
  else
20
20
  $(".paginated_collection").checkboxToggler()
21
21
 
@@ -27,6 +27,7 @@ body.active_admin {
27
27
  @import "active_admin/components/scopes";
28
28
  @import "active_admin/components/status_tags";
29
29
  @import "active_admin/components/table_tools";
30
+ @import "active_admin/components/index_list";
30
31
  @import "active_admin/pages/dashboard";
31
32
  @import "active_admin/pages/logged_out";
32
33
  @import "active_admin/structure/footer";
@@ -42,7 +42,7 @@
42
42
  height: 20px
43
43
  }
44
44
 
45
- ul#tabs {
45
+ ul.tabs {
46
46
  display: inline-block;
47
47
  height: 100%;
48
48
  margin: 0;
@@ -128,10 +128,13 @@
128
128
  display: inline-block;
129
129
  margin: 0;
130
130
  padding: 0;
131
- span, a { margin-left: 10px; }
132
131
 
133
132
  a { text-decoration: none; }
134
133
  a:hover { color: #fff; }
134
+
135
+ li {
136
+ display:inline;
137
+ }
135
138
  }
136
139
 
137
140
  }
@@ -80,7 +80,7 @@
80
80
  position: absolute;
81
81
  background-color: white;
82
82
  padding: 2px;
83
- @include box-shadow(rgba(0,0,0,0.4) 0 1px 3px, lighten($primary-color, 15%) 0px 1px 0px 0px inset);
83
+ box-shadow: rgba(0,0,0,0.4) 0 1px 3px, lighten($primary-color, 15%) 0px 1px 0px 0px inset;
84
84
  background-color: $primary-color;
85
85
  @include gradient(lighten($primary-color, 4%), darken($primary-color, 5%));
86
86
  border: solid 1px darken($primary-color, 10%);
@@ -93,7 +93,7 @@
93
93
  display: block;
94
94
  background-color: #FFF;
95
95
  border: solid 1px darken($primary-color, 10%);
96
- @include box-shadow(lighten($primary-color, 5%) 0px 1px 0px 0px);
96
+ box-shadow: lighten($primary-color, 5%) 0px 1px 0px 0px;
97
97
  border-radius: 3px;
98
98
  margin: 0;
99
99
  overflow: hidden;
@@ -0,0 +1,12 @@
1
+ .indexes {
2
+ float: right;
3
+
4
+ li {
5
+ .count {
6
+ color: #8e979e;
7
+ font-weight: normal;
8
+ font-size: 0.9em;
9
+ line-height: 10px;
10
+ }
11
+ }
12
+ }
@@ -3,7 +3,7 @@
3
3
  position: absolute;
4
4
  background-color: white;
5
5
  padding: 2px;
6
- @include box-shadow(rgba(0,0,0,0.4) 0 1px 3px, lighten($primary-color, 15%) 0px 1px 0px 0px inset);
6
+ box-shadow: rgba(0,0,0,0.4) 0 1px 3px, lighten($primary-color, 15%) 0px 1px 0px 0px inset;
7
7
  background-color: $primary-color;
8
8
  @include gradient(lighten($primary-color, 4%), darken($primary-color, 5%));
9
9
  border: solid 1px darken($primary-color, 10%);
@@ -59,7 +59,7 @@
59
59
  display: block;
60
60
  background-color: #FFF;
61
61
  border: solid 1px darken($primary-color, 10%);
62
- @include box-shadow(lighten($primary-color, 5%) 0px 1px 0px 0px);
62
+ box-shadow: lighten($primary-color, 5%) 0px 1px 0px 0px;
63
63
  border-radius: 3px;
64
64
  margin: 0;
65
65
  overflow: hidden;
@@ -38,7 +38,7 @@ a.table_tools_button, .table_tools .dropdown_menu_button {
38
38
 
39
39
  &:active {
40
40
  @include border-colors(#d7d7d7, #c8c8c8, #c3c3c3);
41
- @include box-shadow(0 1px 1px 0 rgba(0,0,0,0.17) inset );
41
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,0.17) inset;
42
42
  @include gradient(#FFFFFF, #E8E8E8);
43
43
  }
44
44
  }
@@ -81,7 +81,7 @@ a.table_tools_button, .table_tools .dropdown_menu_button {
81
81
 
82
82
  a {
83
83
  @include gradient(#F0F0F0, #FDFDFD);
84
- @include box-shadow(0 1px 1px 0 rgba(0,0,0,0.1) inset);
84
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1) inset;
85
85
  cursor: default;
86
86
 
87
87
  &:hover {
@@ -21,7 +21,7 @@
21
21
  @include basic-button;
22
22
  @include gradient(lighten($primary-color, 15%), darken($primary-color, 12%));
23
23
  @include text-shadow(#000);
24
- @include box-shadow(0 1px 1px rgba(0,0,0,0.10), 0 1px 0 0px rgba(255,255,255, 0.2) inset);
24
+ box-shadow: 0 1px 1px rgba(0,0,0,0.10), 0 1px 0 0px rgba(255,255,255, 0.2) inset;
25
25
  border: solid 1px #484e53;
26
26
  @include border-colors(#616a71, #484e53, #363b3f);
27
27
  color: #efefef;
@@ -32,7 +32,7 @@
32
32
  }
33
33
 
34
34
  &:active {
35
- @include box-shadow(0 1px 3px rgba(0,0,0,0.40) inset, 0 1px 0 0px #FFF);
35
+ box-shadow: 0 1px 3px rgba(0,0,0,0.40) inset, 0 1px 0 0px #FFF;
36
36
  @include gradient(lighten($primary-color, 8%), darken($primary-color, 17%));
37
37
  }
38
38
  }
@@ -41,7 +41,7 @@
41
41
  @mixin light-button {
42
42
  @include basic-button;
43
43
  @include gradient(#FFFFFF, #E7E7E7);
44
- @include box-shadow(0 1px 1px rgba(0,0,0,0.10), 0 1px 0 0 rgba(255,255,255, 0.8) inset);
44
+ box-shadow: 0 1px 1px rgba(0,0,0,0.10), 0 1px 0 0 rgba(255,255,255, 0.8) inset;
45
45
  border: solid 1px #c7c7c7;
46
46
  @include border-colors(#d3d3d3, #c7c7c7, #c2c2c2);
47
47
  @include text-shadow;
@@ -53,7 +53,7 @@
53
53
  }
54
54
 
55
55
  &:active {
56
- @include box-shadow(0 1px 2px rgba(0,0,0,0.22) inset, 0 1px 0 0px #EEE);
56
+ box-shadow: 0 1px 2px rgba(0,0,0,0.22) inset, 0 1px 0 0px #EEE;
57
57
  @include border-colors(#c2c2c2, #b9b9b9, #b7b7b7);
58
58
  @include gradient(#F3F3F3, #D8D8D8);
59
59
  }
@@ -3,12 +3,13 @@ $secondary-gradient-stop: #dfe1e2 !default;
3
3
 
4
4
  @mixin gradient($start, $end){
5
5
  background: $start;
6
- background: -webkit-gradient(linear, left top, left bottom, from($start), to($end));
7
- background: -moz-linear-gradient(-90deg, $start, $end);
6
+ background: -webkit-linear-gradient(-90deg, $start, $end);
7
+ background: -moz-linear-gradient(-90deg, $start, $end);
8
+ background: linear-gradient(-90deg, $start, $end);
8
9
  // IE 6 & 7
9
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$start}', endColorstr='#{$end}');
10
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start)}', endColorstr='#{ie-hex-str($end)}');
10
11
  // IE 8
11
- -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$start}', endColorstr='#{$end}');
12
+ -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start)}', endColorstr='#{ie-hex-str($end)}');
12
13
  }
13
14
 
14
15
  @mixin primary-gradient {
@@ -3,7 +3,7 @@
3
3
  @include text-shadow;
4
4
  border: solid 1px #cdcdcd;
5
5
  @include border-colors(#e6e6e6, #d4d4d4, #cdcdcd);
6
- @include box-shadow(0 1px 3px rgba(0,0,0,0.12), 0 0 1px #FFF inset);
6
+ box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 0 1px #FFF inset;
7
7
 
8
8
  font-size: 1.0em;
9
9
  font-weight: bold;
@@ -15,7 +15,7 @@
15
15
  @include section-header;
16
16
  @include primary-gradient;
17
17
  @include text-shadow(#000);
18
- @include box-shadow(0 1px 3px rgba(0,0,0,0.3));
18
+ box-shadow: 0 1px 3px rgba(0,0,0,0.3);
19
19
  border: none;
20
20
  color: #fff;
21
21
  margin: -13px -30px 20px -30px;
@@ -40,7 +40,7 @@ h3 {
40
40
  #header {
41
41
  float: left;
42
42
 
43
- #tabs, #utility_nav {
43
+ #tabs, .tabs, #utility_nav {
44
44
  display: none;
45
45
  }
46
46
 
@@ -91,7 +91,7 @@ h3 {
91
91
  padding: 0;
92
92
  margin-bottom: 1em;
93
93
 
94
- &.scope.selected {
94
+ &.scope.selected, &.index.selected {
95
95
  display: block;
96
96
 
97
97
  &:before {
@@ -2,7 +2,7 @@
2
2
  @include section-header;
3
3
  @include clearfix;
4
4
  @include box-sizing(border-box);
5
- @include box-shadow(0 1px 2px rgba(0, 0, 0, 0.37));
5
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37);
6
6
  display: table;
7
7
  border-bottom-color: #EEE;
8
8
  width: 100%;
@@ -1,12 +1,14 @@
1
- <h2>Resend unlock instructions</h2>
2
-
3
- <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
4
- <%= devise_error_messages! %>
5
-
6
- <p><%= f.label :email %><br />
7
- <%= f.text_field :email %></p>
8
-
9
- <p><%= f.submit "Resend unlock instructions" %></p>
10
- <% end %>
11
-
12
- <%= render :partial => "active_admin/devise/shared/links" %>
1
+ <div id="login">
2
+ <h2><%= title "#{render_or_call_method_or_proc_on(self, active_admin_application.site_title)} #{t('active_admin.devise.unlock.title')}" %></h2>
3
+
4
+ <%= active_admin_form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f|
5
+ f.inputs do
6
+ f.input :email
7
+ end
8
+ f.actions do
9
+ f.action :submit, :label => t('active_admin.devise.unlock.submit'), :button_html => { :value => t('active_admin.devise.unlock.submit') }
10
+ end
11
+ end %>
12
+
13
+ <%= render :partial => "active_admin/devise/shared/links" %>
14
+ </div>
@@ -114,3 +114,16 @@ You can also disable comments for a specific resource:
114
114
  ActiveAdmin.register Post do
115
115
  config.comments = false
116
116
  end
117
+
118
+ ## Utility Navigation
119
+
120
+ The "utility navigation" shown at the top right when logged in by default shows the current user email address and a link to "Log Out". However, the utility navigation is just like any other menu in the system, so you can provide your own menu to be rendered in place if you like.
121
+
122
+ ActiveAdmin.setup do |config|
123
+ config.namespace :admin do |admin|
124
+ admin.build_menu :utility_navigation do |menu|
125
+ menu.add label: "ActiveAdmin.info", url: "http://www.activeadmin.info", html_options: { target: :blank }
126
+ admin.add_logout_button_to_menu menu # can also pass priority & html_options for link_to to use
127
+ end
128
+ end
129
+ end
@@ -1,8 +1,13 @@
1
1
  # Custom Pages
2
2
 
3
- Although it's nice to be able to register resources, sometimes you need a non
4
- resourceful page in your application. Active Admin supports the generation of
5
- custom pages using the same familiar syntax available for resources.
3
+ When you need a standalone page on your site, Custom Pages will be there with a familiar syntax to resource registration.
4
+
5
+ ## Available Features
6
+ * main page content
7
+ * menu item
8
+ * sidebars
9
+ * action_items
10
+ * page_actions
6
11
 
7
12
  ## Create a new Page
8
13
 
@@ -15,8 +20,8 @@ Creating a page is a simple as calling the `register_page` method:
15
20
  end
16
21
 
17
22
  In the above example, a new page will be created at `/admin/my_page` with the
18
- title "My Page" and the content of "Hello World". Anything rendered within the
19
- `#content` block will be set in the main content area of the page.
23
+ title "My Page" and the content of "Hello World". Anything rendered within
24
+ `content` will be the main content on the page.
20
25
 
21
26
  ## Page Title & I18n
22
27
 
@@ -24,22 +29,8 @@ Coming soon...
24
29
 
25
30
  ## Customize the Menu
26
31
 
27
- The menu item is available to customize just like in any other resource in
28
- Active Admin:
29
-
30
- ActiveAdmin.register_page "My Page" do
31
- menu :label => "My Menu Item Label", :parent => "Dashboard"
32
-
33
- content do
34
- para "Hello World"
35
- end
36
- end
37
-
38
- This configuration will add the page to the menu with the label "My Menu Item
39
- Label" and will nest it underneath the "Dashboard" link.
40
-
41
- To view the full list of available menu options visit ([Resource
42
- Customization](2-resource-customization.md))
32
+ The menu item is available to customize just like
33
+ [any other resource](2-resource-customization.md#customize-the-menu) in Active Admin.
43
34
 
44
35
  ## Add a Sidebar Section
45
36
 
@@ -59,11 +50,8 @@ in Active Admin:
59
50
  end
60
51
  end
61
52
 
62
- This configuration creates a sidebar section named "Help" with an unordered list
63
- in it.
64
-
65
- To view the full list of available sidebar section options visit
66
- ([Sidebars](7-sidebars.md))
53
+ This creates a sidebar section named "Help" containing an unordered list.
54
+ To view the full customization options, visit [Sidebars](7-sidebars.md).
67
55
 
68
56
  ## Add an Action Item
69
57
 
@@ -80,5 +68,29 @@ Just like other resources, you can add Action Item's to pages:
80
68
  end
81
69
  end
82
70
 
83
- This configuration adds an action item that links to the root URL of the
84
- application.
71
+ This adds an action item that links to the root URL of the application.
72
+
73
+ ## Add a Page Action
74
+
75
+ `page_action` allows you to define controller actions specific to this page,
76
+ and is the functional equivalent of `collection_action`.
77
+
78
+ ActiveAdmin.register_page "My Page" do
79
+
80
+ page_action :ex, :method => :post do
81
+ # do stuff here
82
+ redirect_to admin_my_page_path, :notice => "You did stuff!"
83
+ end
84
+
85
+ action_item do
86
+ link_to "Do Stuff", admin_my_page_ex_path, :method => :post
87
+ end
88
+
89
+ content do
90
+ para "Hello World"
91
+ end
92
+ end
93
+
94
+ This defines the route `/admin/my_page/ex` which can handle HTTP POST requests.
95
+
96
+ Clicking on the `action_item` will reload page with the message "You did stuff!"
@@ -1,8 +1,10 @@
1
1
  # Decorators
2
2
 
3
3
  Active Admin supports the use of decorators for resources. Resources will be
4
- be decorated for the index and show blocks. The [draper](http://github.com/jcasimir/draper)
5
- gem is recommended but not required (more on requirements below).
4
+ be decorated for the index and show blocks. The
5
+ [draper](https://github.com/drapergem/draper) gem is recommended but not required
6
+ (more on requirements below). Note, that Active Admin works out of the box with
7
+ Draper `>= 1.0.0`.
6
8
 
7
9
  ## Configuration
8
10
 
@@ -12,10 +14,10 @@ gem is recommended but not required (more on requirements below).
12
14
 
13
15
  ## Example Usage
14
16
 
15
- This example uses [draper](http://github.com/jcasimir/draper).
17
+ This example uses [draper](https://github.com/drapergem/draper).
16
18
 
17
19
  # Gemfile
18
- gem 'draper'
20
+ gem 'draper', '>= 1.0.0'
19
21
 
20
22
  Assuming a post and a post decorator
21
23