activeadmin 1.0.0.pre5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +27 -0
- data/.travis.yml +21 -23
- data/Appraisals +12 -74
- data/CHANGELOG.md +21 -5
- data/CONTRIBUTING.md +2 -2
- data/Gemfile +8 -9
- data/README.md +19 -56
- data/Rakefile +1 -1
- data/activeadmin.gemspec +4 -4
- data/app/assets/stylesheets/active_admin/_forms.scss +10 -0
- data/config/locales/ca.yml +1 -1
- data/config/locales/da.yml +44 -12
- data/config/locales/el.yml +1 -1
- data/config/locales/en.yml +2 -0
- data/config/locales/fr.yml +16 -2
- data/config/locales/ja.yml +1 -0
- data/config/locales/zh-CN.yml +4 -0
- data/docs/12-arbre-components.md +23 -0
- data/docs/14-gotchas.md +1 -1
- data/docs/2-resource-customization.md +2 -5
- data/docs/5-forms.md +19 -0
- data/docs/6-show-pages.md +0 -28
- data/docs/9-batch-actions.md +0 -1
- data/docs/CNAME +1 -1
- data/docs/_includes/head.html +4 -4
- data/docs/_includes/toc.html +2 -1
- data/docs/documentation.md +2 -2
- data/docs/index.html +1 -6
- data/docs/stylesheets/main.css +172 -219
- data/features/belongs_to.feature +5 -5
- data/features/comments/commenting.feature +0 -13
- data/features/create_another.feature +55 -0
- data/features/development_reloading.feature +2 -4
- data/features/edit_page.feature +6 -7
- data/features/favicon.feature +2 -2
- data/features/i18n.feature +1 -0
- data/features/index/filters.feature +18 -0
- data/features/index/format_as_csv.feature +3 -3
- data/features/index/formats.feature +22 -0
- data/features/index/index_as_table.feature +6 -6
- data/features/index/page_title.feature +1 -2
- data/features/menu.feature +20 -1
- data/features/new_page.feature +6 -8
- data/features/registering_assets.feature +4 -4
- data/features/registering_pages.feature +18 -0
- data/features/renamed_resource.feature +2 -4
- data/features/show/page_title.feature +1 -2
- data/features/step_definitions/attribute_steps.rb +1 -1
- data/features/step_definitions/configuration_steps.rb +2 -2
- data/features/step_definitions/format_steps.rb +4 -0
- data/features/step_definitions/index_scope_steps.rb +1 -1
- data/features/step_definitions/menu_steps.rb +2 -2
- data/features/step_definitions/user_steps.rb +1 -1
- data/features/step_definitions/web_steps.rb +6 -5
- data/features/sti_resource.feature +2 -2
- data/features/strong_parameters.feature +0 -4
- data/features/support/env.rb +5 -19
- data/features/support/paths.rb +6 -9
- data/gemfiles/rails_42.gemfile +15 -23
- data/gemfiles/rails_50.gemfile +15 -16
- data/gemfiles/rails_51.gemfile +45 -0
- data/lib/active_admin/application.rb +4 -0
- data/lib/active_admin/base_controller.rb +2 -7
- data/lib/active_admin/base_controller/menu.rb +1 -5
- data/lib/active_admin/csv_builder.rb +2 -2
- data/lib/active_admin/dependency.rb +4 -8
- data/lib/active_admin/devise.rb +1 -1
- data/lib/active_admin/error.rb +1 -1
- data/lib/active_admin/filters/active.rb +2 -10
- data/lib/active_admin/filters/resource_extension.rb +1 -10
- data/lib/active_admin/inputs/filters/date_range_input.rb +1 -1
- data/lib/active_admin/inputs/filters/select_input.rb +1 -2
- data/lib/active_admin/inputs/filters/text_input.rb +2 -2
- data/lib/active_admin/menu.rb +1 -1
- data/lib/active_admin/namespace.rb +14 -7
- data/lib/active_admin/orm/active_record/comments.rb +2 -7
- data/lib/active_admin/orm/active_record/comments/comment.rb +2 -12
- data/lib/active_admin/page.rb +5 -0
- data/lib/active_admin/page_controller.rb +1 -5
- data/lib/active_admin/resource.rb +28 -5
- data/lib/active_admin/resource/attributes.rb +44 -0
- data/lib/active_admin/resource/menu.rb +4 -1
- data/lib/active_admin/resource/routes.rb +2 -3
- data/lib/active_admin/resource_controller.rb +13 -0
- data/lib/active_admin/resource_controller/data_access.rb +18 -9
- data/lib/active_admin/resource_dsl.rb +21 -18
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_helpers/breadcrumb_helper.rb +1 -1
- data/lib/active_admin/view_helpers/display_helper.rb +10 -12
- data/lib/active_admin/view_helpers/download_format_links_helper.rb +12 -0
- data/lib/active_admin/view_helpers/fields_for.rb +1 -2
- data/lib/active_admin/view_helpers/form_helper.rb +1 -1
- data/lib/active_admin/views/components/active_admin_form.rb +28 -2
- data/lib/active_admin/views/components/paginated_collection.rb +3 -8
- data/lib/active_admin/views/components/table_for.rb +1 -1
- data/lib/active_admin/views/index_as_table.rb +2 -2
- data/lib/active_admin/views/pages/layout.rb +1 -1
- data/lib/active_admin/views/pages/show.rb +1 -1
- data/lib/bug_report_templates/rails_5_master.rb +1 -3
- data/lib/generators/active_admin/devise/devise_generator.rb +1 -1
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +7 -0
- data/lib/generators/active_admin/install/templates/admin_user.rb.erb +0 -2
- data/lib/generators/active_admin/install/templates/migrations/create_active_admin_comments.rb.erb +5 -7
- data/lib/generators/active_admin/resource/resource_generator.rb +1 -1
- data/lib/generators/active_admin/resource/templates/{admin.rb → admin.rb.erb} +0 -2
- data/lib/ransack_ext.rb +2 -2
- data/spec/rails_helper.rb +1 -19
- data/spec/requests/default_namespace_spec.rb +40 -8
- data/spec/support/active_admin_integration_spec_helper.rb +9 -2
- data/spec/support/rails_template.rb +17 -20
- data/spec/support/rails_template_with_data.rb +3 -9
- data/spec/support/templates/admin/stores.rb +1 -3
- data/spec/unit/application_spec.rb +19 -8
- data/spec/unit/belongs_to_spec.rb +6 -2
- data/spec/unit/comments_spec.rb +0 -19
- data/spec/unit/controller_filters_spec.rb +5 -5
- data/spec/unit/csv_builder_spec.rb +7 -4
- data/spec/unit/filters/active_spec.rb +1 -8
- data/spec/unit/filters/filter_form_builder_spec.rb +2 -3
- data/spec/unit/filters/resource_spec.rb +3 -4
- data/spec/unit/form_builder_spec.rb +39 -11
- data/spec/unit/namespace/register_page_spec.rb +1 -1
- data/spec/unit/pretty_format_spec.rb +39 -35
- data/spec/unit/resource/attributes_spec.rb +50 -0
- data/spec/unit/resource/includes_spec.rb +1 -1
- data/spec/unit/resource/ordering_spec.rb +1 -1
- data/spec/unit/resource/routes_spec.rb +2 -2
- data/spec/unit/resource_controller/data_access_spec.rb +51 -10
- data/spec/unit/resource_controller/decorators_spec.rb +2 -2
- data/spec/unit/resource_controller/sidebars_spec.rb +3 -3
- data/spec/unit/resource_controller_spec.rb +16 -5
- data/spec/unit/resource_spec.rb +12 -38
- data/spec/unit/routing_spec.rb +2 -2
- data/spec/unit/view_helpers/breadcrumbs_spec.rb +36 -1
- data/spec/unit/view_helpers/display_helper_spec.rb +17 -2
- data/spec/unit/view_helpers/fields_for_spec.rb +1 -1
- data/spec/unit/view_helpers/form_helper_spec.rb +3 -3
- data/spec/unit/view_helpers/method_or_proc_helper_spec.rb +2 -2
- data/spec/unit/views/components/attributes_table_spec.rb +2 -2
- data/spec/unit/views/components/index_list_spec.rb +1 -1
- data/spec/unit/views/components/paginated_collection_spec.rb +4 -4
- data/spec/unit/views/components/table_for_spec.rb +1 -1
- data/spec/unit/views/components/unsupported_browser_spec.rb +1 -1
- data/spec/unit/views/pages/form_spec.rb +4 -1
- data/spec/unit/views/pages/index_spec.rb +1 -1
- data/spec/unit/views/pages/show_spec.rb +2 -3
- data/tasks/lint.rake +8 -0
- metadata +22 -29
- data/features/step_definitions/symbol_leak_steps.rb +0 -3
- data/features/symbol_leak.feature +0 -35
- data/gemfiles/rails_32.gemfile +0 -54
- data/gemfiles/rails_40.gemfile +0 -53
- data/gemfiles/rails_41.gemfile +0 -53
- data/spec/support/deferred_garbage_collection.rb +0 -19
data/Rakefile
CHANGED
data/activeadmin.gemspec
CHANGED
@@ -16,18 +16,18 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
|
18
18
|
|
19
|
-
s.required_ruby_version = '>= 1
|
19
|
+
s.required_ruby_version = '>= 2.1'
|
20
20
|
|
21
|
-
s.add_dependency 'arbre', '
|
21
|
+
s.add_dependency 'arbre', '>= 1.1.1'
|
22
22
|
s.add_dependency 'bourbon'
|
23
23
|
s.add_dependency 'coffee-rails'
|
24
24
|
s.add_dependency 'formtastic', '~> 3.1'
|
25
25
|
s.add_dependency 'formtastic_i18n'
|
26
|
-
s.add_dependency 'inherited_resources', '~> 1.
|
26
|
+
s.add_dependency 'inherited_resources', '~> 1.7'
|
27
27
|
s.add_dependency 'jquery-rails'
|
28
28
|
s.add_dependency 'jquery-ui-rails'
|
29
29
|
s.add_dependency 'kaminari', '>= 0.15', '< 2.0'
|
30
|
-
s.add_dependency 'railties', '>=
|
30
|
+
s.add_dependency 'railties', '>= 4.2', '< 5.2'
|
31
31
|
s.add_dependency 'ransack', '~> 1.3'
|
32
32
|
s.add_dependency 'sass-rails'
|
33
33
|
s.add_dependency 'sprockets', '< 4.1'
|
@@ -242,6 +242,16 @@ form {
|
|
242
242
|
input[type=submit], input[type=button], button { margin-right: 10px; }
|
243
243
|
}
|
244
244
|
|
245
|
+
.buttons .actions .create_another {
|
246
|
+
float: none;
|
247
|
+
margin-bottom: 10px;
|
248
|
+
|
249
|
+
label {
|
250
|
+
float: none;
|
251
|
+
display: inline;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
245
255
|
fieldset.buttons li, fieldset.actions li {
|
246
256
|
float:left;
|
247
257
|
padding: 0;
|
data/config/locales/ca.yml
CHANGED
@@ -11,7 +11,7 @@ ca:
|
|
11
11
|
delete_confirmation: "Segur que vols eliminar-ho?"
|
12
12
|
new_model: "Crear %{model}"
|
13
13
|
edit_model: "Editar %{model}"
|
14
|
-
delete_model: "
|
14
|
+
delete_model: "Eliminar %{model}"
|
15
15
|
details: "Detalls de %{model}"
|
16
16
|
cancel: "Cancel·lar"
|
17
17
|
empty: "Buit"
|
data/config/locales/da.yml
CHANGED
@@ -7,7 +7,8 @@ da:
|
|
7
7
|
view: "Vis"
|
8
8
|
edit: "Rediger"
|
9
9
|
delete: "Slet"
|
10
|
-
delete_confirmation: "Er du sikker
|
10
|
+
delete_confirmation: "Er du sikker på, at du ønsker at slette?"
|
11
|
+
create_another: "Opret endnu en %{model}"
|
11
12
|
new_model: "Ny(t) %{model}"
|
12
13
|
edit_model: "Rediger %{model}"
|
13
14
|
delete_model: "Slet %{model}"
|
@@ -26,11 +27,16 @@ da:
|
|
26
27
|
clear: "Ryd filtre"
|
27
28
|
predicates:
|
28
29
|
contains: "Indeholder"
|
29
|
-
equals: "
|
30
|
+
equals: "Lig"
|
30
31
|
starts_with: "Begynder med"
|
31
32
|
ends_with: "Slutter med"
|
32
|
-
greater_than: "
|
33
|
-
less_than: "
|
33
|
+
greater_than: "Større end"
|
34
|
+
less_than: "Mindre end"
|
35
|
+
search_status:
|
36
|
+
headline: "Søgestatus:"
|
37
|
+
current_scope: "Perspektiv:"
|
38
|
+
current_filters: "Valgte filtre:"
|
39
|
+
no_current_filters: "Ingen"
|
34
40
|
status_tag:
|
35
41
|
"yes": "Ja"
|
36
42
|
"no": "Nej"
|
@@ -39,12 +45,14 @@ da:
|
|
39
45
|
powered_by: "Powered by %{active_admin} %{version}"
|
40
46
|
sidebars:
|
41
47
|
filters: "Filtre"
|
48
|
+
search_status: "Søgestatus"
|
42
49
|
pagination:
|
43
50
|
empty: "Ingen %{model} fundet"
|
44
51
|
one: "Viser <b>1</b> %{model}"
|
45
52
|
one_page: "Viser <b>alle %{n}</b> %{model}"
|
46
53
|
multiple: "Viser %{model} <b>%{from} - %{to}</b> af <b>%{total}</b> i alt"
|
47
54
|
multiple_without_total: "Viser %{model} <b>%{from} - %{to}</b>"
|
55
|
+
per_page: "Per side: "
|
48
56
|
entry:
|
49
57
|
one: "post"
|
50
58
|
other: "poster"
|
@@ -61,24 +69,39 @@ da:
|
|
61
69
|
succesfully_destroyed:
|
62
70
|
one: "Vellykket ødelagt 1 %{model}"
|
63
71
|
other: "Vellykket ødelagt %{count} %{plural_model}"
|
64
|
-
selection_toggle_explanation: "(Skift
|
72
|
+
selection_toggle_explanation: "(Skift valg)"
|
65
73
|
link: "Opret en"
|
66
74
|
action_label: "%{title} Valgte"
|
67
75
|
labels:
|
68
76
|
destroy: "Slet"
|
69
77
|
comments:
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
78
|
+
created_at: "Oprettet"
|
79
|
+
resource_type: "Resource type"
|
80
|
+
author_type: "Forfatter type"
|
81
|
+
body: "Krop"
|
82
|
+
author: "Forfatter"
|
74
83
|
title: "Kommentar"
|
75
84
|
add: "Tilføj Kommentar"
|
85
|
+
delete: "Slet kommentar"
|
86
|
+
delete_confirmation: "Er du sikker på du vil slette disse kommentarer?"
|
76
87
|
resource: "Resource"
|
77
88
|
no_comments_yet: "Ingen kommentarer endnu."
|
89
|
+
author_missing: "Anonym"
|
78
90
|
title_content: "Kommentarer (%{count})"
|
79
91
|
errors:
|
80
92
|
empty_text: "Kommentar blev ikke gemt, tekst var tom."
|
81
93
|
devise:
|
94
|
+
username:
|
95
|
+
title: "Brugernavn"
|
96
|
+
email:
|
97
|
+
title: "Email"
|
98
|
+
subdomain:
|
99
|
+
title: "Underdomæne"
|
100
|
+
password:
|
101
|
+
title: "Kodeord"
|
102
|
+
sign_up:
|
103
|
+
title: "Opret bruger"
|
104
|
+
submit: "Opret bruger"
|
82
105
|
login:
|
83
106
|
title: "Login"
|
84
107
|
remember_me: "Husk mig"
|
@@ -90,12 +113,22 @@ da:
|
|
90
113
|
title: "Skift din adgangskode"
|
91
114
|
submit: "Skift min adgangskode"
|
92
115
|
unlock:
|
93
|
-
title: "Send
|
94
|
-
submit: "Send
|
116
|
+
title: "Send oplåsningsinstruktioner igen"
|
117
|
+
submit: "Send oplåsningsinstruktioner igen"
|
118
|
+
resend_confirmation_instructions:
|
119
|
+
title: "Send bekræftigelsesinstruktioner igen"
|
120
|
+
submit: "Send bekræftigelsesinstruktioner igen"
|
95
121
|
links:
|
122
|
+
sign_up: "Opret bruger"
|
96
123
|
sign_in: "Log ind"
|
97
124
|
forgot_your_password: "Glemt din adgangskode?"
|
98
125
|
sign_in_with_omniauth_provider: "Log ind med %{provider}"
|
126
|
+
resend_unlock_instructions: "Send oplåsningsinstruktioner igen"
|
127
|
+
resend_confirmation_instructions: "Send oplåsningsinstruktioner igen"
|
128
|
+
unsupported_browser:
|
129
|
+
headline: "Vær venligst opmærksom på, at ActiveAdmin ikke længere understøtter Internet Explorer version 8 eller tidligere."
|
130
|
+
recommendation: "Vi anbefaler at du opgraderer til den nyeste <a href=\"http://windows.microsoft.com/ie\">Internet Explorer</a>, <a href=\"https://chrome.google.com/\">Google Chrome</a>, eller <a href=\"https://mozilla.org/firefox/\">Firefox</a>."
|
131
|
+
turn_off_compatibility_view: "Hvis du bruger IE 9 eller senere, så vær sikker på, at du <a href=\"http://windows.microsoft.com/en-US/windows7/webpages-look-incorrect-in-Internet-Explorer\">slår \"Compatibility View\" fra</a>."
|
99
132
|
access_denied:
|
100
133
|
message: "Du har ikke rettigheder til at udføre denne handling."
|
101
134
|
index_list:
|
@@ -103,4 +136,3 @@ da:
|
|
103
136
|
block: "Liste"
|
104
137
|
grid: "Gitter"
|
105
138
|
blog: "Blog"
|
106
|
-
|
data/config/locales/el.yml
CHANGED
@@ -33,7 +33,7 @@ el:
|
|
33
33
|
less_than: "Μικρότερο από"
|
34
34
|
status_tag:
|
35
35
|
"yes": "Ναι"
|
36
|
-
"no": "
|
36
|
+
"no": "Όχι"
|
37
37
|
main_content: "Παρακαλώ υλοποιήστε την %{model}#main_content για να εμφανίσετε περιεχόμενο."
|
38
38
|
logout: "Αποσύνδεση"
|
39
39
|
powered_by: "Powered by %{active_admin} %{version}"
|
data/config/locales/en.yml
CHANGED
@@ -8,6 +8,7 @@ en:
|
|
8
8
|
edit: "Edit"
|
9
9
|
delete: "Delete"
|
10
10
|
delete_confirmation: "Are you sure you want to delete this?"
|
11
|
+
create_another: "Create another %{model}"
|
11
12
|
new_model: "New %{model}"
|
12
13
|
edit_model: "Edit %{model}"
|
13
14
|
delete_model: "Delete %{model}"
|
@@ -51,6 +52,7 @@ en:
|
|
51
52
|
one_page: "Displaying <b>all %{n}</b> %{model}"
|
52
53
|
multiple: "Displaying %{model} <b>%{from} - %{to}</b> of <b>%{total}</b> in total"
|
53
54
|
multiple_without_total: "Displaying %{model} <b>%{from} - %{to}</b>"
|
55
|
+
per_page: "Per page: "
|
54
56
|
entry:
|
55
57
|
one: "entry"
|
56
58
|
other: "entries"
|
data/config/locales/fr.yml
CHANGED
@@ -51,6 +51,7 @@ fr:
|
|
51
51
|
one_page: "Affichage des <b>%{n}</b> %{model}"
|
52
52
|
multiple: "Affichage de %{model} <b>%{from} - %{to}</b> sur un total de <b>%{total}</b>"
|
53
53
|
multiple_without_total: "Affichage de %{model} <b>%{from} - %{to}</b>"
|
54
|
+
per_page: "Par page: "
|
54
55
|
entry:
|
55
56
|
one: "entrée"
|
56
57
|
other: "entrées"
|
@@ -73,14 +74,18 @@ fr:
|
|
73
74
|
labels:
|
74
75
|
destroy: "Supprimer"
|
75
76
|
comments:
|
77
|
+
created_at: "Créé le"
|
78
|
+
resource_type: "Type de ressource"
|
79
|
+
author_type: "Profil de l'auteur"
|
76
80
|
body: "Corps"
|
77
81
|
author: "Auteur"
|
78
82
|
title: "Commentaire"
|
79
83
|
add: "Ajouter un commentaire"
|
84
|
+
delete: "Supprimer ce commentaire"
|
85
|
+
delete_confirmation: "Êtes-vous sûr de vouloir supprimer ce commentaire ?"
|
80
86
|
resource: "Ressource"
|
81
|
-
resource_type: "Type de ressource"
|
82
|
-
author_type: "Profil de l'auteur"
|
83
87
|
no_comments_yet: "Aucun commentaire actuellement"
|
88
|
+
author_missing: "Anonyme"
|
84
89
|
title_content: "Commentaires (%{count})"
|
85
90
|
errors:
|
86
91
|
empty_text: "Le commentaire n'a pas été enregistré puisque le texte était vide."
|
@@ -93,6 +98,9 @@ fr:
|
|
93
98
|
title: "Sous-domaine"
|
94
99
|
password:
|
95
100
|
title: "Mot de passe"
|
101
|
+
sign_up:
|
102
|
+
title: "S'inscrire"
|
103
|
+
submit: "S'inscrire"
|
96
104
|
login:
|
97
105
|
title: "Connexion"
|
98
106
|
remember_me: "Garder ma session ouverte"
|
@@ -103,13 +111,19 @@ fr:
|
|
103
111
|
change_password:
|
104
112
|
title: "Changez votre mot de passe"
|
105
113
|
submit: "Changer mon mot de passe"
|
114
|
+
unlock:
|
115
|
+
title: "Renvoyer les informations de déverrouillage"
|
116
|
+
submit: "Renvoyer les informations de déverrouillage"
|
106
117
|
resend_confirmation_instructions:
|
107
118
|
title: "Renvoyer les instructions de confirmation"
|
108
119
|
submit: "Renvoyer les instructions de confirmation"
|
109
120
|
links:
|
121
|
+
sign_up: "Inscrivez-vous"
|
110
122
|
sign_in: "Connectez-vous"
|
111
123
|
forgot_your_password: "Vous avez oublié votre mot de passe ?"
|
112
124
|
sign_in_with_omniauth_provider: "Connectez-vous avec %{provider}"
|
125
|
+
resend_unlock_instructions: "Renvoyer les informations de déverrouillage"
|
126
|
+
resend_confirmation_instructions: "Renvoyer les instructions de confirmation"
|
113
127
|
access_denied:
|
114
128
|
message: "Vous n'êtes pas autorisé à exécuter cette action"
|
115
129
|
index_list:
|
data/config/locales/ja.yml
CHANGED
@@ -51,6 +51,7 @@ ja:
|
|
51
51
|
one_page: "<b>全 %{n}</b> 件の %{model} を表示しています"
|
52
52
|
multiple: "全 <b>%{total}</b> 件中 <b>%{from} - %{to}</b> 件の %{model} を表示しています"
|
53
53
|
multiple_without_total: "<b>%{from} - %{to}</b> 件の %{model} を表示しています"
|
54
|
+
per_page: "表示件数: "
|
54
55
|
entry:
|
55
56
|
one: "レコード"
|
56
57
|
other: "レコード"
|
data/config/locales/zh-CN.yml
CHANGED
@@ -108,5 +108,9 @@
|
|
108
108
|
sign_in: "登录"
|
109
109
|
forgot_your_password: "忘记了密码?"
|
110
110
|
sign_in_with_omniauth_provider: "登入%{provider}"
|
111
|
+
unsupported_browser:
|
112
|
+
headline: "很抱歉,ActiveAdmin 已不再支持 Internet Explorer 8 以下版本的浏览器。"
|
113
|
+
recommendation: "建议您升级到最新版本的<a href=\"http://windows.microsoft.com/ie\">Internet Explorer</a>,<a href=\"https://chrome.google.com/\">Google Chrome</a>,或是 <a href=\"https://mozilla.org/firefox/\">Firefox</a>。"
|
114
|
+
turn_off_compatibility_view: "如果您使用的是 IE 9 或更新的版本,请确认<a href=\"https://support.microsoft.com/zh-cn/help/17472/windows-internet-explorer-11-fix-site-display-problems-compatibility-view\">已关闭“兼容性视图”</a>。"
|
111
115
|
access_denied:
|
112
116
|
message: "您无权处理此操作"
|
data/docs/12-arbre-components.md
CHANGED
@@ -151,3 +151,26 @@ status_tag 'active', :ok
|
|
151
151
|
status_tag 'active', :ok, class: 'important', id: 'status_123', label: 'on'
|
152
152
|
# => <span class='status_tag active ok important' id='status_123'>on</span>
|
153
153
|
```
|
154
|
+
|
155
|
+
## Tabs
|
156
|
+
|
157
|
+
The Tabs component is helpful for saving page real estate. The first tab will be
|
158
|
+
the one open when the page initially loads and the rest hidden. You can click
|
159
|
+
each tab to toggle back and forth between them. Arbre supports unlimited number
|
160
|
+
of tabs.
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
tabs do
|
164
|
+
tab :active do
|
165
|
+
table_for orders.active do
|
166
|
+
...
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
tab :inactive do
|
171
|
+
table_for orders.inactive do
|
172
|
+
...
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
```
|
data/docs/14-gotchas.md
CHANGED
@@ -101,7 +101,7 @@ YourModel.solr_search
|
|
101
101
|
|
102
102
|
### Rails 5 scaffold generators
|
103
103
|
|
104
|
-
Active Admin requires the `inherited_resources` gem which may break scaffolding under Rails 5 as it replaces the default scaffold generator. The solution is to configure the default controller in `config/application.rb` as outlined in [
|
104
|
+
Active Admin requires the `inherited_resources` gem which may break scaffolding under Rails 5 as it replaces the default scaffold generator. The solution is to configure the default controller in `config/application.rb` as outlined in [activeadmin/inherited_resources#195](https://github.com/activeadmin/inherited_resources/issues/195)
|
105
105
|
|
106
106
|
```
|
107
107
|
module SampleApp
|
@@ -19,9 +19,6 @@ end
|
|
19
19
|
|
20
20
|
## Setting up Strong Parameters
|
21
21
|
|
22
|
-
Rails 4 replaces `attr_accessible` with [Strong Parameters](https://github.com/rails/strong_parameters),
|
23
|
-
which moves attribute whitelisting from the model to the controller.
|
24
|
-
|
25
22
|
Use the `permit_params` method to define which attributes may be changed:
|
26
23
|
|
27
24
|
```ruby
|
@@ -316,8 +313,8 @@ end
|
|
316
313
|
|
317
314
|
## Customizing resource retrieval
|
318
315
|
|
319
|
-
Our controllers are built on [Inherited Resources](https://github.com/
|
320
|
-
so you can use [all of its features](https://github.com/
|
316
|
+
Our controllers are built on [Inherited Resources](https://github.com/activeadmin/inherited_resources),
|
317
|
+
so you can use [all of its features](https://github.com/activeadmin/inherited_resources#overwriting-defaults).
|
321
318
|
|
322
319
|
If you need to customize the collection properties, you can overwrite the `scoped_collection` method.
|
323
320
|
|
data/docs/5-forms.md
CHANGED
@@ -173,3 +173,22 @@ You can arrange content in tabs as shown below:
|
|
173
173
|
f.actions
|
174
174
|
end
|
175
175
|
```
|
176
|
+
|
177
|
+
## Customize the Create Another checkbox
|
178
|
+
|
179
|
+
In order to simplify creating multiple resources you may enable ActiveAdmin to show nice "Create Another" checkbox alongside of Create Model
|
180
|
+
button. It may be enabled for the whole application:
|
181
|
+
|
182
|
+
```ruby
|
183
|
+
ActiveAdmin.setup do |config|
|
184
|
+
config.create_another = true
|
185
|
+
end
|
186
|
+
```
|
187
|
+
|
188
|
+
or for the particular resource:
|
189
|
+
|
190
|
+
```ruby
|
191
|
+
ActiveAdmin.register Post do
|
192
|
+
config.create_another = true
|
193
|
+
end
|
194
|
+
```
|
data/docs/6-show-pages.md
CHANGED
@@ -78,31 +78,3 @@ ActiveAdmin.register Book do
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
```
|
81
|
-
|
82
|
-
# Tabs
|
83
|
-
|
84
|
-
You can arrange content in tabs as shown below:
|
85
|
-
|
86
|
-
```ruby
|
87
|
-
ActiveAdmin.register Order do
|
88
|
-
show do
|
89
|
-
tabs do
|
90
|
-
tab 'Overview' do
|
91
|
-
attributes_table do
|
92
|
-
row(:status) { status_tag(order.status) }
|
93
|
-
row(:paid) { number_to_currency(order.amount_paid_in_dollars) }
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
tab 'Payments' do
|
98
|
-
table_for order.payments do
|
99
|
-
column('Payment Type') { |p| p.payment_type.titleize }
|
100
|
-
column('Received On', :created_at)
|
101
|
-
column('Payment Details & Notes', :notes)
|
102
|
-
column('Amount') { |p| number_to_currency(p.amount_in_dollars) }
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
```
|
data/docs/9-batch-actions.md
CHANGED
data/docs/CNAME
CHANGED
@@ -1 +1 @@
|
|
1
|
-
activeadmin.info
|
1
|
+
github-docs.activeadmin.info
|
data/docs/_includes/head.html
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<head>
|
2
2
|
<title>Active Admin | The administration framework for Ruby on Rails</title>
|
3
|
-
<link href='
|
4
|
-
<link href='
|
3
|
+
<link href='//fonts.googleapis.com/css?family=Yanone+Kaffeesatz:extralight,light,regular,bold' rel='stylesheet' type='text/css'>
|
4
|
+
<link href='//fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
|
5
5
|
<link href="{{ site.baseurl }}/stylesheets/main.css" media="screen" rel="stylesheet" type="text/css" />
|
6
|
-
<script src="
|
7
|
-
</head>
|
6
|
+
<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
|
7
|
+
</head>
|
data/docs/_includes/toc.html
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
</ol>
|
28
28
|
<li><a href='{{ site.baseurl }}/3-index-pages.html'>Customizing the Index Page</a></li>
|
29
29
|
<ol class='level-2'>
|
30
|
-
<li><a href='{{ site.baseurl }}/3-index-pages/
|
30
|
+
<li><a href='{{ site.baseurl }}/3-index-pages/custom-index.html'>Custom Index</a></li>
|
31
31
|
<li><a href='{{ site.baseurl }}/3-index-pages/index-as-block.html'>Index as a Block</a></li>
|
32
32
|
<li><a href='{{ site.baseurl }}/3-index-pages/index-as-blog.html'>Index as Blog</a></li>
|
33
33
|
<li><a href='{{ site.baseurl }}/3-index-pages/index-as-grid.html'>Index as a Grid</a></li>
|
@@ -78,6 +78,7 @@
|
|
78
78
|
<li><a href='{{ site.baseurl }}/12-arbre-components.html#columns'>Columns</a></li>
|
79
79
|
<li><a href='{{ site.baseurl }}/12-arbre-components.html#table-for'>Table For</a></li>
|
80
80
|
<li><a href='{{ site.baseurl }}/12-arbre-components.html#status-tag'>Status tag</a></li>
|
81
|
+
<li><a href='{{ site.baseurl }}/12-arbre-components.html#tabs'>Tabs</a></li>
|
81
82
|
</ol>
|
82
83
|
<li><a href='{{ site.baseurl }}/13-authorization-adapter.html'>Authorization Adapter</a></li>
|
83
84
|
<ol class='level-2'>
|
data/docs/documentation.md
CHANGED
@@ -14,7 +14,7 @@ little effort.
|
|
14
14
|
### Getting Started
|
15
15
|
|
16
16
|
Active Admin is released as a Ruby Gem. The gem is to be installed within a Ruby on Rails 4 application. To
|
17
|
-
install, simply add the following to your Gemfile
|
17
|
+
install, simply add the following to your Gemfile:
|
18
18
|
|
19
19
|
```ruby
|
20
20
|
# Gemfile
|
@@ -50,7 +50,7 @@ $> rails generate active_admin:resource
|
|
50
50
|
[MyModelName]
|
51
51
|
```
|
52
52
|
|
53
|
-
This creates a file at <tt>app/admin/my_model_names.rb</tt> for configuring the resource. Refresh your web browser to see the interface
|
53
|
+
This creates a file at <tt>app/admin/my_model_names.rb</tt> for configuring the resource. Refresh your web browser to see the interface.
|
54
54
|
|
55
55
|
### Next Steps
|
56
56
|
|