andrewroth_activeadmin 0.3.4 → 0.3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. data/CHANGELOG.md +159 -3
  2. data/CONTRIBUTING.md +113 -0
  3. data/LICENSE +1 -1
  4. data/README.rdoc +19 -20
  5. data/activeadmin.gemspec +3 -1
  6. data/app/assets/javascripts/active_admin/application.js +9 -0
  7. data/app/assets/javascripts/active_admin/base.js +4 -12
  8. data/app/assets/stylesheets/active_admin/_base.css.scss +16 -340
  9. data/app/assets/stylesheets/active_admin/_forms.css.scss +13 -7
  10. data/app/assets/stylesheets/active_admin/_header.css.scss +23 -4
  11. data/app/assets/stylesheets/active_admin/components/_blank_slates.scss +31 -0
  12. data/app/assets/stylesheets/active_admin/components/_breadcrumbs.scss +20 -0
  13. data/app/assets/stylesheets/active_admin/components/_buttons.scss +12 -0
  14. data/app/assets/stylesheets/active_admin/components/_flash_messages.css.scss +2 -0
  15. data/app/assets/stylesheets/active_admin/components/_grid.scss +9 -0
  16. data/app/assets/stylesheets/active_admin/components/_links.scss +5 -0
  17. data/app/assets/stylesheets/active_admin/components/_pagination.scss +34 -0
  18. data/app/assets/stylesheets/active_admin/components/_panels.scss +6 -0
  19. data/app/assets/stylesheets/active_admin/components/_scopes.scss +10 -0
  20. data/app/assets/stylesheets/active_admin/components/_status_tags.scss +12 -0
  21. data/app/assets/stylesheets/active_admin/components/_table_tools.css.scss +101 -0
  22. data/app/assets/stylesheets/active_admin/mixins/_all.css.scss +2 -1
  23. data/app/assets/stylesheets/active_admin/mixins/_buttons.css.scss +50 -13
  24. data/app/assets/stylesheets/active_admin/mixins/_gradients.css.scss +9 -1
  25. data/app/assets/stylesheets/active_admin/mixins/_sections.css.scss +7 -5
  26. data/app/assets/stylesheets/active_admin/mixins/_shadows.css.scss +1 -0
  27. data/app/assets/stylesheets/active_admin/mixins/_typography.scss +3 -0
  28. data/app/assets/stylesheets/active_admin/mixins/_variables.css.scss +1 -0
  29. data/app/assets/stylesheets/active_admin/pages/_dashboard.scss +5 -0
  30. data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +44 -0
  31. data/app/assets/stylesheets/active_admin/structure/_footer.scss +14 -0
  32. data/app/assets/stylesheets/active_admin/structure/_main_structure.scss +26 -0
  33. data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +44 -0
  34. data/app/views/active_admin/devise/passwords/edit.html.erb +1 -1
  35. data/app/views/active_admin/devise/passwords/new.html.erb +1 -1
  36. data/app/views/active_admin/devise/sessions/new.html.erb +1 -1
  37. data/app/views/active_admin/devise/shared/_links.erb +1 -1
  38. data/app/views/active_admin/devise/unlocks/new.html.erb +1 -1
  39. data/app/views/active_admin/page/index.html.arb +1 -0
  40. data/app/views/layouts/active_admin_logged_out.html.erb +2 -2
  41. data/cucumber.yml +3 -2
  42. data/docs/1-general-configuration.md +46 -10
  43. data/docs/6-show-screens.md +7 -0
  44. data/docs/8-custom-actions.md +12 -2
  45. data/docs/9-custom-pages.md +84 -0
  46. data/features/belongs_to.feature +27 -0
  47. data/features/comments/commenting.feature +3 -2
  48. data/features/dashboard.feature +18 -0
  49. data/features/development_reloading.feature +19 -0
  50. data/features/index/filter_with_check_boxes.feature +25 -0
  51. data/features/index/index_as_table.feature +14 -0
  52. data/features/index/index_scopes.feature +42 -0
  53. data/features/index/pagination.feature +19 -1
  54. data/features/menu.feature +22 -2
  55. data/features/registering_assets.feature +2 -2
  56. data/features/registering_pages.feature +66 -0
  57. data/features/specifying_actions.feature +5 -0
  58. data/features/step_definitions/action_item_steps.rb +2 -6
  59. data/features/step_definitions/action_link_steps.rb +7 -0
  60. data/features/step_definitions/additional_web_steps.rb +8 -0
  61. data/features/step_definitions/asset_steps.rb +5 -1
  62. data/features/step_definitions/breadcrumb_steps.rb +5 -0
  63. data/features/step_definitions/configuration_steps.rb +56 -8
  64. data/features/step_definitions/dashboard_steps.rb +5 -1
  65. data/features/step_definitions/factory_steps.rb +9 -2
  66. data/features/step_definitions/flash_steps.rb +9 -1
  67. data/features/step_definitions/index_scope_steps.rb +16 -4
  68. data/features/step_definitions/member_link_steps.rb +7 -0
  69. data/features/step_definitions/site_title_steps.rb +15 -0
  70. data/features/support/paths.rb +6 -0
  71. data/features/users/logging_out.feature +11 -0
  72. data/lib/active_admin.rb +25 -10
  73. data/lib/active_admin/application.rb +63 -20
  74. data/lib/active_admin/arbre/html/element.rb +10 -0
  75. data/lib/active_admin/asset_registration.rb +15 -2
  76. data/lib/active_admin/base_controller.rb +61 -0
  77. data/lib/active_admin/{resource_controller → base_controller}/menu.rb +1 -1
  78. data/lib/active_admin/comments.rb +48 -54
  79. data/lib/active_admin/comments/comment.rb +13 -2
  80. data/lib/active_admin/comments/namespace_helper.rb +1 -1
  81. data/lib/active_admin/comments/views/active_admin_comments.rb +7 -3
  82. data/lib/active_admin/dashboards.rb +4 -0
  83. data/lib/active_admin/dashboards/dashboard_controller.rb +20 -4
  84. data/lib/active_admin/dsl.rb +6 -159
  85. data/lib/active_admin/event.rb +5 -3
  86. data/lib/active_admin/filter_form_builder.rb +53 -0
  87. data/lib/active_admin/form_builder.rb +25 -19
  88. data/lib/active_admin/inputs.rb +14 -0
  89. data/lib/active_admin/inputs/datepicker_input.rb +11 -0
  90. data/lib/active_admin/inputs/filter_base.rb +46 -0
  91. data/lib/active_admin/inputs/filter_check_boxes_input.rb +40 -0
  92. data/lib/active_admin/inputs/filter_date_range_input.rb +34 -0
  93. data/lib/active_admin/inputs/filter_numeric_input.rb +55 -0
  94. data/lib/active_admin/inputs/filter_select_input.rb +23 -0
  95. data/lib/active_admin/inputs/filter_string_input.rb +22 -0
  96. data/lib/active_admin/locales/ca.yml +44 -0
  97. data/lib/active_admin/locales/cs.yml +14 -10
  98. data/lib/active_admin/locales/de.yml +43 -0
  99. data/lib/active_admin/locales/en.yml +5 -0
  100. data/lib/active_admin/locales/hr.yml +40 -0
  101. data/lib/active_admin/locales/ko.yml +40 -0
  102. data/lib/active_admin/locales/lv.yml +43 -0
  103. data/lib/active_admin/locales/nl.yml +40 -0
  104. data/lib/active_admin/locales/no-NB.yml +40 -0
  105. data/lib/active_admin/locales/pl.yml +7 -1
  106. data/lib/active_admin/locales/pt-BR.yml +6 -2
  107. data/lib/active_admin/namespace.rb +48 -33
  108. data/lib/active_admin/page.rb +54 -0
  109. data/lib/active_admin/page_controller.rb +15 -0
  110. data/lib/active_admin/page_dsl.rb +21 -0
  111. data/lib/active_admin/page_presenter.rb +30 -0
  112. data/lib/active_admin/resource.rb +38 -44
  113. data/lib/active_admin/resource/action_items.rb +5 -0
  114. data/lib/active_admin/resource/belongs_to.rb +4 -2
  115. data/lib/active_admin/resource/controllers.rb +35 -0
  116. data/lib/active_admin/resource/menu.rb +1 -2
  117. data/lib/active_admin/resource/naming.rb +43 -31
  118. data/lib/active_admin/resource/page_presenters.rb +28 -0
  119. data/lib/active_admin/resource/scopes.rb +16 -3
  120. data/lib/active_admin/resource/sidebars.rb +4 -0
  121. data/lib/active_admin/resource_collection.rb +88 -0
  122. data/lib/active_admin/resource_controller.rb +18 -54
  123. data/lib/active_admin/resource_controller/action_builder.rb +1 -1
  124. data/lib/active_admin/resource_controller/actions.rb +1 -1
  125. data/lib/active_admin/resource_controller/callbacks.rb +1 -1
  126. data/lib/active_admin/resource_controller/collection.rb +8 -4
  127. data/lib/active_admin/resource_controller/filters.rb +1 -1
  128. data/lib/active_admin/resource_controller/resource_class_methods.rb +24 -0
  129. data/lib/active_admin/resource_controller/scoping.rb +1 -1
  130. data/lib/active_admin/resource_controller/sidebars.rb +1 -1
  131. data/lib/active_admin/resource_dsl.rb +157 -0
  132. data/lib/active_admin/router.rb +21 -14
  133. data/lib/active_admin/scope.rb +15 -3
  134. data/lib/active_admin/version.rb +1 -1
  135. data/lib/active_admin/view_factory.rb +4 -3
  136. data/lib/active_admin/view_helpers/auto_link_helper.rb +1 -10
  137. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +25 -21
  138. data/lib/active_admin/view_helpers/filter_form_helper.rb +0 -150
  139. data/lib/active_admin/views/components/attributes_table.rb +1 -1
  140. data/lib/active_admin/views/components/paginated_collection.rb +42 -13
  141. data/lib/active_admin/views/components/scopes.rb +17 -17
  142. data/lib/active_admin/views/components/status_tag.rb +6 -5
  143. data/lib/active_admin/views/components/table_for.rb +6 -2
  144. data/lib/active_admin/views/header_renderer.rb +31 -12
  145. data/lib/active_admin/views/index_as_block.rb +2 -2
  146. data/lib/active_admin/views/index_as_blog.rb +3 -3
  147. data/lib/active_admin/views/index_as_grid.rb +4 -4
  148. data/lib/active_admin/views/index_as_table.rb +13 -6
  149. data/lib/active_admin/views/pages/base.rb +4 -4
  150. data/lib/active_admin/views/pages/form.rb +49 -0
  151. data/lib/active_admin/views/pages/index.rb +18 -6
  152. data/lib/active_admin/views/pages/page.rb +24 -0
  153. data/lib/active_admin/views/pages/show.rb +1 -1
  154. data/lib/generators/active_admin/assets/assets_generator.rb +19 -1
  155. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +38 -12
  156. data/lib/generators/active_admin/install/templates/dashboards.rb +6 -0
  157. data/spec/spec_helper.rb +4 -0
  158. data/spec/support/rails_template.rb +11 -0
  159. data/spec/support/templates/cucumber_with_reloading.rb +5 -0
  160. data/spec/unit/active_admin_spec.rb +8 -0
  161. data/spec/unit/application_spec.rb +48 -2
  162. data/spec/unit/arbre/html/element_finder_methods_spec.rb +58 -2
  163. data/spec/unit/asset_registration_spec.rb +9 -3
  164. data/spec/unit/auto_link_spec.rb +2 -2
  165. data/spec/unit/base_controller_shared_examples.rb +28 -0
  166. data/spec/unit/base_controller_spec.rb +8 -0
  167. data/spec/unit/belongs_to_spec.rb +30 -33
  168. data/spec/unit/comments_spec.rb +45 -15
  169. data/spec/unit/config_shared_examples.rb +108 -0
  170. data/spec/unit/dashboard_controller_spec.rb +44 -0
  171. data/spec/unit/event_spec.rb +6 -0
  172. data/spec/unit/filter_form_builder_spec.rb +9 -0
  173. data/spec/unit/form_builder_spec.rb +8 -14
  174. data/spec/unit/namespace/register_page_spec.rb +102 -0
  175. data/spec/unit/namespace/register_resource_spec.rb +188 -0
  176. data/spec/unit/namespace_spec.rb +11 -183
  177. data/spec/unit/page_controller_spec.rb +8 -0
  178. data/spec/unit/page_spec.rb +60 -0
  179. data/spec/unit/resource/menu_spec.rb +1 -51
  180. data/spec/unit/resource/naming_spec.rb +24 -19
  181. data/spec/unit/resource/page_presenters_spec.rb +32 -0
  182. data/spec/unit/resource/scopes_spec.rb +13 -0
  183. data/spec/unit/resource_collection_spec.rb +101 -0
  184. data/spec/unit/resource_controller_spec.rb +40 -32
  185. data/spec/unit/{registration_spec.rb → resource_registration_spec.rb} +0 -0
  186. data/spec/unit/resource_spec.rb +8 -24
  187. data/spec/unit/routing_spec.rb +50 -1
  188. data/spec/unit/scope_spec.rb +18 -4
  189. data/spec/unit/views/components/paginated_collection_spec.rb +150 -0
  190. data/spec/unit/views/components/status_tag_spec.rb +9 -0
  191. data/tasks/test.rake +43 -27
  192. metadata +140 -31
  193. data/app/assets/javascripts/active_admin/vendor.js +0 -382
  194. data/lib/active_admin/comments/configuration.rb +0 -18
  195. data/lib/active_admin/page_config.rb +0 -15
  196. data/lib/active_admin/resource_controller/form.rb +0 -42
  197. data/lib/active_admin/resource_controller/page_configurations.rb +0 -53
  198. data/lib/active_admin/views/pages/edit.rb +0 -28
  199. data/lib/active_admin/views/pages/new.rb +0 -28
  200. data/lib/generators/active_admin/assets/templates/3.0/active_admin.js +0 -427
  201. data/spec/integration/belongs_to_spec.rb +0 -42
@@ -1,24 +1,25 @@
1
1
  cs:
2
2
  active_admin:
3
+ dashboard: Úvod
3
4
  dashboard_welcome: "Vítejte v Active Admin. Toto je nástěnka. Pro přidání sekcí nástěnky se podívejte do 'app/admin/dashboards.rb'"
4
5
  view: "Zobrazit"
5
6
  edit: "Upravit"
6
7
  delete: "Smazat"
7
8
  delete_confirmation: "Jste si jistí, že chcete tuto položku smazat?"
8
- new_model: "Nový %{model}"
9
- edit_model: "Upravit %{model}"
10
- delete_model: "Smazat %{model}"
11
- details: "Detaily %{model}"
9
+ new_model: "Nový"
10
+ edit_model: "Upravit"
11
+ delete_model: "Smazat"
12
+ details: "Detaily"
12
13
  cancel: "Zrušit"
13
14
  empty: "Prázdné"
14
15
  previous: "Předešlé"
15
16
  next: "Následující"
16
17
  download: "Stáhnout:"
17
- has_many_new: "Přidat nový %{model}"
18
+ has_many_new: "Přidat nový"
18
19
  has_many_delete: "Odstranit"
19
20
  filter: "Filtr"
20
21
  clear_filters: "Vyčistit filtry"
21
- search_field: "Hledat podle %{field}"
22
+ search_field: "%{field}"
22
23
  equal_to: "Přesně"
23
24
  greater_than: "Větší než"
24
25
  less_than: "Menší než"
@@ -27,8 +28,11 @@ cs:
27
28
  sidebars:
28
29
  filters: "Filtr"
29
30
  pagination:
30
- empty: "Žádný %{model} nenalezen."
31
- one: "Zobrazen <b>1</b> %{model}"
32
- one_page: "Zobrazeny <b>všechny %{n}</b> %{model}"
33
- multiple: "Zobrazen %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> z <b>%{total}</b>"
31
+ empty: "Nenalezen."
32
+ one: "Zobrazena <b>1</b> položka"
33
+ one_page: "Počet zobrazených položek %{n}"
34
+ multiple: "<b>%{from}&nbsp;-&nbsp;%{to}</b> z <b>%{total}</b>"
34
35
  any: "Kterákoliv"
36
+ blank_slate:
37
+ content: "Zatím zde není žádný obsah."
38
+ link: "Vytvořit"
@@ -0,0 +1,43 @@
1
+ de:
2
+ active_admin:
3
+ dashboard: Übersicht
4
+ dashboard_welcome:
5
+ welcome: "Willkommen in Active Admin. Dies ist die Standard-Übersichtsseite."
6
+ call_to_action: "Siehe 'app/admin/dashboards.rb', um Übersichts-Bereiche hinzuzufügen."
7
+ view: "Anzeigen"
8
+ edit: "Bearbeiten"
9
+ delete: "Löschen"
10
+ delete_confirmation: "Wollen Sie dieses Element wirklich löschen?"
11
+ new_model: "%{model} erstellen"
12
+ edit_model: "%{model} bearbeiten"
13
+ delete_model: "%{model} löschen"
14
+ details: "%{model} Details"
15
+ cancel: "Abbrechen"
16
+ empty: "Leer"
17
+ previous: "Zurück"
18
+ next: "Weiter"
19
+ download: "Herunterladen:"
20
+ has_many_new: "%{model} hinzufügen"
21
+ has_many_delete: "Löschen"
22
+ filter: "Filtern"
23
+ clear_filters: "Filter entfernen"
24
+ search_field: "Durchsuche %{field}"
25
+ equal_to: "Gleich"
26
+ greater_than: "Größer als"
27
+ less_than: "Kleiner als"
28
+ main_content: "Bitte implementieren Sie %{model}#main_content, um Inhalte anzuzeigen."
29
+ logout: "Abmelden"
30
+ sidebars:
31
+ filters: "Filter"
32
+ pagination:
33
+ empty: "Keine %{model} gefunden"
34
+ one: "Zeige <b>1</b> %{model}"
35
+ one_page: "Zeige <b>alle %{n}</b> %{model}"
36
+ multiple: "Zeige %{model} <b>%{from}&nbsp;–&nbsp;%{to}</b> von <b>%{total}</b>"
37
+ entry:
38
+ one: "Eintrag"
39
+ other: "Einträge"
40
+ any: "Alle"
41
+ blank_slate:
42
+ content: "Es gibt noch keine %{resource_name}."
43
+ link: "Erstellen"
@@ -9,7 +9,9 @@ en:
9
9
  delete: "Delete"
10
10
  delete_confirmation: "Are you sure you want to delete this?"
11
11
  new_model: "New %{model}"
12
+ create_model: "New %{model}"
12
13
  edit_model: "Edit %{model}"
14
+ update_model: "Edit %{model}"
13
15
  delete_model: "Delete %{model}"
14
16
  details: "%{model} Details"
15
17
  cancel: "Cancel"
@@ -34,6 +36,9 @@ en:
34
36
  one: "Displaying <b>1</b> %{model}"
35
37
  one_page: "Displaying <b>all %{n}</b> %{model}"
36
38
  multiple: "Displaying %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> of <b>%{total}</b> in total"
39
+ entry:
40
+ one: "entry"
41
+ other: "entries"
37
42
  any: "Any"
38
43
  blank_slate:
39
44
  content: "There are no %{resource_name} yet."
@@ -0,0 +1,40 @@
1
+ hr:
2
+ active_admin:
3
+ dashboard: "Upravljačka ploča"
4
+ dashboard_welcome:
5
+ welcome: "Dobrodošli u Active Admin. Ovo je početna upravljačka ploča."
6
+ call_to_action: "Da bi ste dodali nove odjeljke na upravljačku ploču, pogledajte 'app/admin/dashboards.rb'"
7
+ view: "Pregledaj"
8
+ edit: "Uredi"
9
+ delete: "Obriši"
10
+ delete_confirmation: "Jeste li sigurni da želite ovo obrisati?"
11
+ new_model: "Novi %{model}"
12
+ edit_model: "Uredi %{model}"
13
+ delete_model: "Obriši %{model}"
14
+ details: "%{model} detalji"
15
+ cancel: "Odustani"
16
+ empty: "Prazno"
17
+ previous: "Prijašnji"
18
+ next: "Sljedeći"
19
+ download: "Spremi na računalo:"
20
+ has_many_new: "Dodaj novi %{model}"
21
+ has_many_delete: "Obriši"
22
+ filter: "Filter"
23
+ clear_filters: "Očisti Filtere"
24
+ search_field: "Pretraži po %{field}"
25
+ equal_to: "Jednako"
26
+ greater_than: "Veće Od"
27
+ less_than: "Manje Od"
28
+ main_content: "Molim Vas, implementirajte %{model}#main_content da bi ste prikazali sadržaj."
29
+ logout: "Odjavi se"
30
+ sidebars:
31
+ filters: "Filteri"
32
+ pagination:
33
+ empty: "Nije pronađen niti jedan %{model}."
34
+ one: "Prikazan <b>1</b> %{model}"
35
+ one_page: "Prikazano <b>svih %{n}</b> %{model}"
36
+ multiple: "Prikazani %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> od ukupno <b>%{total}</b>"
37
+ any: "Bilo koji"
38
+ blank_slate:
39
+ content: "Još uvijek ne postoji niti jedan zapis tipa %{resource_name}."
40
+ link: "Kreiraj jedan"
@@ -0,0 +1,40 @@
1
+ ko:
2
+ active_admin:
3
+ dashboard: "대시보드"
4
+ dashboard_welcome:
5
+ welcome: "Active Admin 에 오신 것을 환영합니다. 이것은 디폴트 대시보드 페이지 입니다."
6
+ call_to_action: "대시보드에 섹션을 추가하시려면 'app/admin/dashboards.rb' 소스를 확인해 주세요."
7
+ view: "보기"
8
+ edit: "수정"
9
+ delete: "삭제"
10
+ delete_confirmation: "정말로 삭제 하시겠습니까?"
11
+ new_model: "새 %{model}"
12
+ edit_model: "%{model} 수정"
13
+ delete_model: "%{model} 삭제"
14
+ details: "%{model} 상세보기"
15
+ cancel: "취소"
16
+ empty: "비었음"
17
+ previous: "이전"
18
+ next: "다음"
19
+ download: "다운로드:"
20
+ has_many_new: "%{model} 추가"
21
+ has_many_delete: "삭제"
22
+ filter: "필터"
23
+ clear_filters: "필터 초기화"
24
+ search_field: "%{field} 검색"
25
+ equal_to: "같다"
26
+ greater_than: "크다"
27
+ less_than: "작다"
28
+ main_content: "내용을 보시려면 %{model}#main_content 를 구현해 주시기 바랍니다."
29
+ logout: "로그아웃"
30
+ sidebars:
31
+ filters: "필터 목록"
32
+ pagination:
33
+ empty: "%{model} 이/가 없습니다."
34
+ one: "<b>1</b> %{model} 표시중"
35
+ one_page: "<b>전체 %{n}</b> %{model} 표시중"
36
+ multiple: "전체 <b>%{total}</b> 중 <b>%{from}&nbsp;-&nbsp;%{to}</b> %{model} 표시중"
37
+ any: "어떤"
38
+ blank_slate:
39
+ content: "아직 %{resource_name} 이/가 없습니다."
40
+ link: "만들기"
@@ -0,0 +1,43 @@
1
+ lv:
2
+ active_admin:
3
+ dashboard: Panelis
4
+ dashboard_welcome:
5
+ welcome: "Laipni lūgti Active Admin."
6
+ call_to_action: "Izmantojiet 'app/admin/dashboards.rb', lai pievienotu sadaļas panelim."
7
+ view: "Apskatīt"
8
+ edit: "Labot"
9
+ delete: "Dzēst"
10
+ delete_confirmation: "Vai Tu tiešām vēlies dzēst?"
11
+ new_model: "Pievienot '%{model}' ierasktu"
12
+ edit_model: "Labot '%{model}' ierakstu"
13
+ delete_model: "Dzēst '%{model}' ierakstu"
14
+ details: "Apraksts"
15
+ cancel: "Atcelt"
16
+ empty: "Tukšs"
17
+ previous: "Iepriekšējā"
18
+ next: "Nākošā"
19
+ download: "Lejuplādēt:"
20
+ has_many_new: "Pievienot jaunu '%{model}' ierakstu"
21
+ has_many_delete: "Dzēst"
22
+ filter: "Filtrēt"
23
+ clear_filters: "Novākt filtrus"
24
+ search_field: "Meklēt '%{field}' laukā"
25
+ equal_to: "Vienāds ar"
26
+ greater_than: "Lielāks par"
27
+ less_than: "Mazāks par"
28
+ main_content: "Lūdzu implementēt %{model}#main_content, lai rādītos saturs."
29
+ logout: "Iziet"
30
+ sidebars:
31
+ filters: "Filtri"
32
+ pagination:
33
+ empty: "Nav ierakstu"
34
+ one: "<b>1</b> ieraksts"
35
+ one_page: "<b>%{n}</b> ieraksti"
36
+ multiple: "<b>%{from}&nbsp;-&nbsp;%{to}</b> ieraksti no <b>%{total}</b> kopā"
37
+ entry:
38
+ one: "ieraksts"
39
+ other: "ieraksti"
40
+ any: "Jebkurš"
41
+ blank_slate:
42
+ content: "Sadaļā '%{resource_name}' nav neviena ieraksta."
43
+ link: "Izveidot jaunu"
@@ -0,0 +1,40 @@
1
+ nl:
2
+ active_admin:
3
+ dashboard: Dashboard
4
+ dashboard_welcome:
5
+ welcome: "Welkom bij Active Admin. Dit is de standaard dashboard pagina"
6
+ call_to_action: "Maak je dashboard op maat in het bestand 'app/admin/dashboards.rb'"
7
+ view: "Bekijk"
8
+ edit: "Wijzig"
9
+ delete: "Verwijder"
10
+ delete_confirmation: "Weet je zeker dat je dit wilt verwijderen?"
11
+ new_model: "Nieuwe %{model}"
12
+ edit_model: "Wijzig %{model}"
13
+ delete_model: "Verwijder %{model}"
14
+ details: "%{model} details"
15
+ cancel: "Annuleren"
16
+ empty: "Leeg"
17
+ previous: "Vorige"
18
+ next: "Volgende"
19
+ download: "Download:"
20
+ has_many_new: "Voeg nieuwe %{model} toe"
21
+ has_many_delete: "Verwijderen"
22
+ filter: "Filter"
23
+ clear_filters: "Maak Filters Ongedaan"
24
+ search_field: "Zoek %{field}"
25
+ equal_to: "Gelijk aan"
26
+ greater_than: "Groter dan"
27
+ less_than: "Kleiner dan"
28
+ main_content: "Implementeer %{model}#main_content om de content weer te geven."
29
+ logout: "Uitloggen"
30
+ sidebars:
31
+ filters: "Filters"
32
+ pagination:
33
+ empty: "Geen %{model} gevonden"
34
+ one: "Geeft <b>1</b> %{model} weer"
35
+ one_page: "Geeft <b>%{n}</b> %{model} weer"
36
+ multiple: "Geeft %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> van de <b>%{total}</b> weer"
37
+ any: "Alle"
38
+ blank_slate:
39
+ content: "Er zijn geen %{resource_name} gevonden."
40
+ link: "Maak aan"
@@ -0,0 +1,40 @@
1
+ "no-NB":
2
+ active_admin:
3
+ dashboard: Oversikt
4
+ dashboard_welcome:
5
+ welcome: "Velkommen til Active Admin. Dette er standardoversiktssiden."
6
+ call_to_action: "Rediger 'app/admin/dashboards.rb' for at legge til elementer i oversikten."
7
+ view: "Vis"
8
+ edit: "Rediger"
9
+ delete: "Slett"
10
+ delete_confirmation: "Er du sikker på at du vil slette denne?"
11
+ new_model: "Ny %{model}"
12
+ edit_model: "Rediger %{model}"
13
+ delete_model: "Slett %{model}"
14
+ details: "%{model} Detaljer"
15
+ cancel: "Avbryt"
16
+ empty: "Tom"
17
+ previous: "Forrige"
18
+ next: "Neste"
19
+ download: "Last ned:"
20
+ has_many_new: "Legg til ny %{model}"
21
+ has_many_delete: "Slett"
22
+ filter: "Filter"
23
+ clear_filters: "Fjern filter"
24
+ search_field: "Søk %{field}"
25
+ equal_to: "Er lik"
26
+ greater_than: "Større enn"
27
+ less_than: "Mindre enn"
28
+ main_content: "Please implement %{model}#main_content to display content."
29
+ logout: "Logg ut"
30
+ sidebars:
31
+ filters: "Filtere"
32
+ pagination:
33
+ empty: "Fannt ingen %{model}"
34
+ one: "Viser <b>1</b> %{model}"
35
+ one_page: "Viser <b>alle %{n}</b> %{model}"
36
+ multiple: "Viser %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> av <b>%{total}</b> totalt"
37
+ any: "Noen"
38
+ blank_slate:
39
+ content: "Her er det ingen %{resource_name} enda."
40
+ link: "Opprett en"
@@ -1,6 +1,9 @@
1
1
  pl:
2
2
  active_admin:
3
- dashboard_welcome: "Witaj w Active Adminie. Znajdujesz się na domyślnym dashboardzie. Aby dodać sekcje do dashboarda sprawdź 'app/admin/dashboards.rb'"
3
+ dashboard: Pulpit
4
+ dashboard_welcome:
5
+ welcome: "Witaj w Active Adminie. To jest domyślny pulpit."
6
+ call_to_action: "Aby dodać sekcje do pulpitu, sprawdź 'app/admin/dashboards.rb'"
4
7
  view: "Podgląd"
5
8
  edit: "Edytuj"
6
9
  delete: "Usuń"
@@ -32,3 +35,6 @@ pl:
32
35
  one_page: "Wyświetlanie <b>wszystkich %{n}</b> %{model}"
33
36
  multiple: "Wyświetlanie %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> z <b>%{total}</b>"
34
37
  any: "Jakikolwiek"
38
+ blank_slate:
39
+ content: "Nie ma jeszcze zasobu %{resource_name}."
40
+ link: "Utwórz go"
@@ -9,7 +9,9 @@
9
9
  delete: "Remover"
10
10
  delete_confirmation: "Você tem certeza que deseja remover este item?"
11
11
  new_model: "Novo(a) %{model}"
12
+ create_model: "Novo(a) %{model}"
12
13
  edit_model: "Editar %{model}"
14
+ update_model: "Atualizar %{model}"
13
15
  delete_model: "Remover %{model}"
14
16
  details: "Detalhes do(a) %{model}"
15
17
  cancel: "Cancelar"
@@ -34,8 +36,10 @@
34
36
  one: "Exibindo <b>1</b> %{model}"
35
37
  one_page: "Exibindo <b>todos(as) os(as) %{n}</b> %{model}"
36
38
  multiple: "Exibindo %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> de um total de <b>%{total}</b>"
39
+ entry:
40
+ one: "registro"
41
+ other: "registros"
37
42
  any: "Qualquer"
38
43
  blank_slate:
39
44
  content: "Não existem %{resource_name} ainda."
40
- link: "Crie uma"
41
-
45
+ link: "Crie uma"
@@ -1,3 +1,6 @@
1
+ require 'active_admin/helpers/settings'
2
+ require 'active_admin/resource_collection'
3
+
1
4
  module ActiveAdmin
2
5
 
3
6
  class ResourceMismatchError < StandardError; end
@@ -25,6 +28,7 @@ module ActiveAdmin
25
28
  # resource will be accessible from "/posts" and the controller will be PostsController.
26
29
  #
27
30
  class Namespace
31
+ include Settings
28
32
 
29
33
  RegisterEvent = 'active_admin.namespace.register'.freeze
30
34
 
@@ -33,7 +37,7 @@ module ActiveAdmin
33
37
  def initialize(application, name)
34
38
  @application = application
35
39
  @name = name.to_s.underscore.to_sym
36
- @resources = {}
40
+ @resources = ResourceCollection.new
37
41
  @menu = Menu.new
38
42
  register_module unless root?
39
43
  generate_dashboard_controller
@@ -42,8 +46,8 @@ module ActiveAdmin
42
46
  # Register a resource into this namespace. The preffered method to access this is to
43
47
  # use the global registration ActiveAdmin.register which delegates to the proper
44
48
  # namespace instance.
45
- def register(resource, options = {}, &block)
46
- config = find_or_build_resource(resource, options)
49
+ def register(resource_class, options = {}, &block)
50
+ config = find_or_build_resource(resource_class, options)
47
51
 
48
52
  # Register the resource
49
53
  register_resource_controller(config)
@@ -60,6 +64,17 @@ module ActiveAdmin
60
64
  config
61
65
  end
62
66
 
67
+ def register_page(name, options = {}, &block)
68
+ config = build_page(name, options)
69
+
70
+ # Register the resource
71
+ register_page_controller(config)
72
+ parse_page_registration_block(config, &block) if block_given?
73
+ register_with_menu(config) if config.include_in_menu?
74
+
75
+ config
76
+ end
77
+
63
78
  def root?
64
79
  name == :root
65
80
  end
@@ -92,22 +107,20 @@ module ActiveAdmin
92
107
  # loaded. This method gets called to register each resource with the menu system.
93
108
  def load_menu!
94
109
  register_dashboard
95
- resources.values.each do |config|
96
- register_with_menu(config) if config.include_in_menu?
110
+ resources.each do |resource|
111
+ register_with_menu(resource) if resource.include_in_menu?
97
112
  end
98
113
  end
99
114
 
100
115
  # Returns the first registered ActiveAdmin::Resource instance for a given class
101
116
  def resource_for(klass)
102
- actual = resources.values.find{|config| config.resource == klass }
103
- return actual if actual
117
+ resources.find_by_resource_class(klass)
118
+ end
104
119
 
105
- if klass.respond_to?(:base_class)
106
- base_class = klass.base_class
107
- resources.values.find{|config| config.resource == base_class }
108
- else
109
- nil
110
- end
120
+ # Override from ActiveAdmin::Settings to inherit default attributes
121
+ # from the application
122
+ def read_default_setting(name)
123
+ application.send(name)
111
124
  end
112
125
 
113
126
  protected
@@ -115,33 +128,27 @@ module ActiveAdmin
115
128
  # Either returns an existing Resource instance or builds a new
116
129
  # one for the resource and options
117
130
  def find_or_build_resource(resource_class, options)
118
- resource = Resource.new(self, resource_class, options)
119
-
120
- # If we've already registered this resource, use the existing
121
- if @resources.has_key? resource.camelized_resource_name
122
- existing_resource = @resources[resource.camelized_resource_name]
131
+ resources.add Resource.new(self, resource_class, options)
132
+ end
123
133
 
124
- if existing_resource.resource != resource_class
125
- raise ActiveAdmin::ResourceMismatchError,
126
- "Tried to register #{resource_class} as #{resource.camelized_resource_name} but already registered to #{resource.resource}"
127
- end
134
+ def build_page(name, options)
135
+ resources.add Page.new(self, name, options)
136
+ end
128
137
 
129
- resource = existing_resource
130
- else
131
- @resources[resource.camelized_resource_name] = resource
132
- end
133
138
 
134
- resource
139
+ def register_page_controller(config)
140
+ eval "class ::#{config.controller_name} < ActiveAdmin::PageController; end"
141
+ config.controller.active_admin_config = config
135
142
  end
136
143
 
137
144
  def unload_resources!
138
- resources.each do |name, config|
145
+ resources.each do |resource|
139
146
  parent = (module_name || 'Object').constantize
140
- const_name = config.controller_name.split('::').last
147
+ const_name = resource.controller_name.split('::').last
141
148
  # Remove the const if its been defined
142
149
  parent.send(:remove_const, const_name) if parent.const_defined?(const_name)
143
150
  end
144
- @resources = {}
151
+ @resources = ResourceCollection.new
145
152
  end
146
153
 
147
154
  def unload_dashboard!
@@ -163,12 +170,20 @@ module ActiveAdmin
163
170
  config.controller.active_admin_config = config
164
171
  end
165
172
 
166
- def dsl
167
- @dsl ||= DSL.new
173
+ def resource_dsl
174
+ @resource_dsl ||= ResourceDSL.new
168
175
  end
169
176
 
170
177
  def parse_registration_block(config, &block)
171
- dsl.run_registration_block(config, &block)
178
+ resource_dsl.run_registration_block(config, &block)
179
+ end
180
+
181
+ def page_dsl
182
+ @page_dsl ||= PageDSL.new
183
+ end
184
+
185
+ def parse_page_registration_block(config, &block)
186
+ page_dsl.run_registration_block(config, &block)
172
187
  end
173
188
 
174
189
  # Creates a dashboard controller for this config