activeadmin 4.0.0.beta7 → 4.0.0.beta9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dd5eb1427288ca28b3a68786a8a828646fc7a6a1c310c5a6b126c907c32b5a8
4
- data.tar.gz: 0e40eff7a1e3e06153fbb3f147911696bd19ce27be2f29d4bc5dbba7ef0175ab
3
+ metadata.gz: 2f3c2998aa1c2b5375196a1f9ee0284c699e72a7637f9feab724c46ba0701cee
4
+ data.tar.gz: 670befa4df9c7d9634320c2735254a420adf7062789ec47ca4bdaa46c8915328
5
5
  SHA512:
6
- metadata.gz: 5c879abbd3cb1e8d617d34be6dd96236f545f15ffdfc3d3866da9f8f7af8d120d13862a395b091ff1cda652c9b48200aaa22f813b0f688cdec9765c06d44f941
7
- data.tar.gz: 1ebbee7ae56c8297b16761fae24d8ccb83bf4d54fb7095f012c3813fe5df2446cd9b2295c077b2c693801b1ff8a79f656b3862e468595aa46558c177107cf575
6
+ metadata.gz: bc6cab08a78331723344a4307ac5259f30e090e69d6438433697fbf96d43df7a11ca5f5e88d19a3e0c7cf83f833a99d663e74df4f37122b8c1d71375c8c08bea
7
+ data.tar.gz: 927876e56533e12df325ab50e86058dce84cb47133924fc92559ce7329b376ef6d7f574ee35517ac4115f43cd49469a5ddc308716c51621fe726ff219895950f
data/README.md CHANGED
@@ -75,8 +75,8 @@ Thanks to [Tidelift][tidelift] and all our Tidelift subscribers.
75
75
  Thanks to [Open Collective][opencollective contributors] and all our Open Collective contributors.
76
76
 
77
77
  [Arbre]: https://github.com/activeadmin/arbre
78
- [Devise]: https://github.com/plataformatec/devise
79
- [Formtastic]: https://github.com/justinfrench/formtastic
78
+ [Devise]: https://github.com/heartcombo/devise
79
+ [Formtastic]: https://github.com/formtastic/formtastic
80
80
  [Inherited Resources]: https://github.com/activeadmin/inherited_resources
81
81
  [Kaminari]: https://github.com/kaminari/kaminari
82
82
  [Ransack]: https://github.com/activerecord-hackery/ransack
data/UPGRADING.md CHANGED
@@ -224,3 +224,4 @@ This release includes several locale changes. Please [reivew the en.yml locale](
224
224
  - The `comments.title_content` text has been updated with an "All " prefix.
225
225
  - The `comments.delete_confirmation` text has been fixed to use singular form.
226
226
  - Inconsistent use of login/sign-in related terms so text now uses "Sign in", Sign out", and "Sign up" throughout.
227
+ - The `toggle_dark_mode`, `toggle_main_navigation_menu`, `toggle_section`, and `toggle_user_menu` keys have been added.
@@ -1,11 +1,20 @@
1
1
  import Rails from '@rails/ujs';
2
2
 
3
+ const submitForm = function() {
4
+ let form = document.getElementById("collection_selection")
5
+ if (form) {
6
+ form.submit()
7
+ }
8
+ }
9
+
3
10
  const batchActionClick = function(event) {
4
11
  event.preventDefault()
5
12
  let batchAction = document.getElementById("batch_action")
6
13
  if (batchAction) {
7
14
  batchAction.value = this.dataset.action
8
15
  }
16
+
17
+ if (!event.target.dataset.confirm) { submitForm() }
9
18
  }
10
19
 
11
20
  const batchActionConfirmComplete = function(event) {
@@ -15,10 +24,7 @@ const batchActionConfirmComplete = function(event) {
15
24
  if (batchAction) {
16
25
  batchAction.value = this.dataset.action
17
26
  }
18
- let form = document.getElementById("collection_selection")
19
- if (form) {
20
- form.submit()
21
- }
27
+ submitForm()
22
28
  }
23
29
  }
24
30
 
@@ -1,10 +1,10 @@
1
- <div id="main-menu" class="fixed top-0 xl:top-16 bottom-0 start-0 z-40 w-72 xl:w-60 p-4 overflow-y-auto transition-transform duration-200 -translate-x-full xl:translate-x-0 bg-white dark:bg-gray-950 xl:border-e xl:border-gray-200 xl:dark:border-white/10" tabindex="-1" aria-labelledby="drawer-navigation-label">
1
+ <div id="main-menu" class="fixed top-0 xl:top-16 bottom-0 start-0 z-40 w-72 xl:w-60 p-4 overflow-y-auto transition-transform duration-200 -translate-x-full xl:translate-x-0 bg-white dark:bg-gray-950 xl:border-e xl:border-gray-200 xl:dark:border-white/10" tabindex="-1">
2
2
  <ul role="list" class="flex flex-1 flex-col space-y-1.5">
3
3
  <% current_menu.items(self).each do |item| %>
4
4
  <% children = item.items(self).presence %>
5
5
  <li <%= current_menu_item?(item) && "data-open" %> class="group" data-item-id="<%= item.id %>">
6
6
  <% if children %>
7
- <button data-menu-button class="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white flex items-center w-full rounded-md p-2 gap-x-2 text-sm">
7
+ <button data-menu-button class="text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white flex items-center w-full rounded-md p-2 gap-x-2 text-sm" aria-label="<%= t('active_admin.toggle_section') %>">
8
8
  <%= item.label(self) %>
9
9
  <svg class="group-data-[open]:rotate-90 group-data-[open]:rtl:-rotate-90 ms-auto h-5 w-5 shrink-0 rtl:-scale-x-100" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
10
10
  <path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
@@ -1,5 +1,5 @@
1
1
  <div class="border-b border-gray-200 dark:border-white/10 dark:bg-gray-950/75 px-4 py-2 flex items-center sticky top-0 z-20 h-16 w-full backdrop-blur-md">
2
- <button class="xl:hidden pe-3 inline-flex items-center w-8 h-8 justify-center text-sm text-gray-500 dark:text-gray-400 focus-visible:outline-none focus-visible:ring-ring focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0" data-drawer-target="main-menu" data-drawer-show="main-menu" aria-controls="drawer-navigation">
2
+ <button class="xl:hidden pe-3 inline-flex items-center w-8 h-8 justify-center text-sm text-gray-500 dark:text-gray-400 focus-visible:outline-none focus-visible:ring-ring focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0" data-drawer-target="main-menu" data-drawer-show="main-menu" aria-controls="main-menu" aria-label="<%= t('active_admin.toggle_main_navigation_menu') %>">
3
3
  <svg class="w-5 h-5 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"/></svg>
4
4
  </button>
5
5
 
@@ -9,12 +9,12 @@
9
9
  </h1>
10
10
  </div>
11
11
 
12
- <button type="button" class="dark-mode-toggle flex items-center w-9 h-9 justify-center me-1 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400 focus:outline-none text-sm">
12
+ <button type="button" class="dark-mode-toggle flex items-center w-9 h-9 justify-center me-1 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400 focus:outline-none text-sm" aria-label="<%= t('active_admin.toggle_dark_mode') %>">
13
13
  <svg class="hidden dark:block w-5 h-5 rtl:-scale-x-100" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.509 5.75c0-1.493.394-2.96 1.144-4.25h-.081a8.5 8.5 0 1 0 7.356 12.746A8.5 8.5 0 0 1 8.509 5.75Z"/></svg>
14
14
  <svg class="dark:hidden w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 3V1m0 18v-2M5.05 5.05 3.636 3.636m12.728 12.728L14.95 14.95M3 10H1m18 0h-2M5.05 14.95l-1.414 1.414M16.364 3.636 14.95 5.05M14 10a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"/></svg>
15
15
  </button>
16
16
 
17
- <button id="user-menu-button" class="flex items-center w-9 h-9 justify-center text-sm text-gray-500 focus:outline-none dark:text-gray-200" data-dropdown-toggle="user-menu" data-dropdown-offset-distance="3" data-dropdown-placement="bottom-end">
17
+ <button id="user-menu-button" class="flex items-center w-9 h-9 justify-center text-sm text-gray-500 focus:outline-none dark:text-gray-200" data-dropdown-toggle="user-menu" data-dropdown-offset-distance="3" data-dropdown-placement="bottom-end" aria-label="<%= t('active_admin.toggle_user_menu') %>">
18
18
  <svg class="w-7 h-7" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"><path d="M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"/></svg>
19
19
  </button>
20
20
 
@@ -1,10 +1,27 @@
1
1
  ca:
2
+ activerecord:
3
+ models:
4
+ comment:
5
+ one: "Comentari"
6
+ other: "Comentaris"
7
+ active_admin/comment:
8
+ one: "Comentari"
9
+ other: "Comentaris"
10
+ attributes:
11
+ active_admin/comment:
12
+ author_type: "Tipus d'autor"
13
+ body: "Missatge"
14
+ created_at: "Creat el"
15
+ namespace: "Espai de noms"
16
+ resource_type: "Tipus de recurs"
17
+ updated_at: "Actualitzat el"
2
18
  active_admin:
3
- dashboard: Tauler
19
+ dashboard: "Tauler d'activitat"
4
20
  view: "Mostra"
5
21
  edit: "Edita"
6
22
  delete: "Elimina"
7
- delete_confirmation: "Segur que vols eliminar-ho?"
23
+ delete_confirmation: "Segur que voleu eliminar-ho?"
24
+ create_another: "Crear un altre %{model}"
8
25
  new_model: "Crear %{model}"
9
26
  edit_model: "Editar %{model}"
10
27
  delete_model: "Eliminar %{model}"
@@ -14,27 +31,41 @@ ca:
14
31
  previous: "Anterior"
15
32
  next: "Següent"
16
33
  download: "Descarregar:"
17
- has_many_new: "Afegir %{model}"
34
+ has_many_new: "Afegir un altre %{model}"
18
35
  has_many_delete: "Eliminar"
19
36
  has_many_remove: "Treure"
37
+ move: "Moure"
20
38
  filters:
21
39
  buttons:
22
- filter: "Filtrar"
23
- clear: "Treure filtres"
40
+ filter: "Filtra"
41
+ clear: "Elimina els filtres"
42
+ predicates:
43
+ from: "Des de"
44
+ to: "Fins"
45
+ scopes:
46
+ all: "Tots"
47
+ search_status:
48
+ title: "Cerca activa"
49
+ title_with_scope: "Cerca activa per %{name}"
50
+ no_current_filters: "Sense filtres actius"
24
51
  status_tag:
25
52
  "yes": "Sí"
26
53
  "no": "No"
27
- "unset": "No"
28
- logout: "Desconnecta't"
54
+ "unset": "Desconegut"
55
+ logout: "Tanca la sessió"
29
56
  powered_by: "Powered by %{active_admin} %{version}"
30
57
  sidebars:
31
58
  filters: "Filtres"
59
+ search_status: "Estat de la cerca"
32
60
  pagination:
33
- empty: "No hi ha %{model}"
34
- one: "S'està mostrant <b>1</b> %{model}"
35
- one_page: "S'estan mostrant <b>tots %{n}</b> %{model}"
36
- multiple: "S'estan mostrant %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b> de <b>%{total}</b> en total"
37
- multiple_without_total: "S'estan mostrant %{model} <b>%{from}&nbsp;-&nbsp;%{to}</b>"
61
+ empty: "No s'ha trobat cap %{model}"
62
+ one: "S'està mostrant <b>1</b> de <b>1</b>"
63
+ one_page: "S'estan mostrant <b>tots %{n}</b>"
64
+ multiple: "Se n'estan mostrant <b>%{from}-%{to}</b> d'un total de <b>%{total}</b>"
65
+ multiple_without_total: "Se n'estan mostrant <b>%{from}-%{to}</b>"
66
+ per_page: "Per pàgina"
67
+ previous: "Anterior"
68
+ next: "Següent"
38
69
  entry:
39
70
  one: "entrada"
40
71
  other: "entrades"
@@ -43,36 +74,55 @@ ca:
43
74
  content: "Encara no hi ha cap %{resource_name}."
44
75
  link: "Crea'n un/a"
45
76
  batch_actions:
46
- button_label: "les accions per lots"
47
- default_confirmation: "¿Esteu segur que voleu fer-ho?"
48
- delete_confirmation: "¿Està segur que desitja eliminar aquests %{plural_model}?"
77
+ button_label: "Accions per lots"
78
+ default_confirmation: "Segur que voleu fer-ho?"
79
+ delete_confirmation: "Segurs que voleu eliminar aquests %{plural_model}?"
49
80
  succesfully_destroyed:
50
- one: "Va destruir amb èxit 1 %{model}"
51
- other: "Va destruir amb èxit %{count} %{plural_model}"
52
- selection_toggle_explanation: "(Selecció de Canviar)"
81
+ one: "1 %{model} eliminat"
82
+ other: "%{count} %{plural_model} eliminats"
83
+ selection_toggle_explanation: "(Invertir la selecció)"
53
84
  action_label: "%{title} seleccionat"
54
85
  labels:
55
- destroy: "esborrar"
86
+ destroy: "Esborrar"
56
87
  comments:
57
- body: "Cos"
58
- author: "autor"
88
+ created_at: "Creat el"
89
+ resource_type: "Tipus de recurs"
90
+ author_type: "Tipus d'author"
91
+ body: "Missatge"
92
+ author: "Autor"
59
93
  add: "Afegeix comentari"
94
+ delete: "Elimina comentari"
95
+ delete_confirmation: "Esteu segurs que voleu eliminar aquest comentari?"
60
96
  resource: "Recurs"
61
- no_comments_yet: "No hi ha comentaris"
62
- title_content: "comentaris (%{count})"
97
+ no_comments_yet: "Sense comentaris"
98
+ author_missing: "Anònim"
99
+ title_content: "Tots els comentaris (%{count})"
63
100
  errors:
64
- empty_text: "El comentari no es va salvar, el text estava buida."
101
+ empty_text: "El comentari no s'ha desat, no hi havia text."
65
102
  devise:
103
+ username:
104
+ title: "Usuari"
105
+ email:
106
+ title: "Email"
107
+ subdomain:
108
+ title: "Subdomini"
109
+ password:
110
+ title: "Contrasenya"
111
+ password_confirmation:
112
+ title: "Confirmeu la contrasenya"
113
+ sign_up:
114
+ title: "Doneu-vos d'alta"
115
+ submit: "Doneu-vos d'alta"
66
116
  login:
67
- title: "iniciar sessió"
68
- remember_me: "Recordar"
69
- submit: "iniciar sessió"
117
+ title: "Identifiqueu-vos"
118
+ remember_me: "Recorda'm"
119
+ submit: "Identifiqueu-vos"
70
120
  reset_password:
71
- title: "Heu perdut la contrasenya?"
121
+ title: "Heu oblidat la contrasenya?"
72
122
  submit: "Restablir la contrasenya"
73
123
  change_password:
74
124
  title: "Canvieu la contrasenya"
75
- submit: "Canviar la contrasenya"
125
+ submit: "Canvia'm la contrasenya"
76
126
  unlock:
77
127
  title: "Reenvia instruccions per a desbloquejar"
78
128
  submit: "Reenvia instruccions per a desbloquejar"
@@ -80,10 +130,13 @@ ca:
80
130
  title: "Reenviar instruccions de confirmació"
81
131
  submit: "Reenviar instruccions de confirmació"
82
132
  links:
83
- sign_in: "Registrar"
133
+ sign_up: "Sign up"
134
+ sign_in: "Sign in"
84
135
  forgot_your_password: "Heu perdut la contrasenya?"
85
- sign_in_with_omniauth_provider: "Connecta't amb %{provider}"
136
+ sign_in_with_omniauth_provider: "Identificació via %{provider}"
137
+ resend_unlock_instructions: "Reenviar les instruccions de desbloqueig"
138
+ resend_confirmation_instructions: "Reenviar les instruccions de confirmació"
86
139
  access_denied:
87
- message: "No esta autoritzat a realitzar aquesta acció."
140
+ message: "No esteu autoritzats a realitzar aquesta acció"
88
141
  index_list:
89
142
  table: "Taula"
@@ -52,6 +52,10 @@ en:
52
52
  "yes": "Yes"
53
53
  "no": "No"
54
54
  "unset": "Unknown"
55
+ toggle_dark_mode: Toggle dark mode
56
+ toggle_main_navigation_menu: Toggle main navigation menu
57
+ toggle_section: Toggle section
58
+ toggle_user_menu: Toggle user menu
55
59
  logout: "Sign out"
56
60
  powered_by: "Powered by %{active_admin} %{version}"
57
61
  sidebars:
@@ -52,6 +52,10 @@ it:
52
52
  "yes": "Sì"
53
53
  "no": "No"
54
54
  "unset": "Vuoto"
55
+ toggle_dark_mode: Attiva/Disattiva tema scuro
56
+ toggle_main_navigation_menu: Espandi/Riduci menu di navigazione principale
57
+ toggle_section: Espandi/Riduci sezione
58
+ toggle_user_menu: Espandi/Riduci menu utente
55
59
  logout: "Esci"
56
60
  powered_by: "Powered by %{active_admin} %{version}"
57
61
  sidebars:
@@ -42,7 +42,7 @@ module ActiveAdmin
42
42
  end
43
43
 
44
44
  def format_action(action, subject)
45
- # https://github.com/varvet/pundit/blob/master/lib/generators/pundit/install/templates/application_policy.rb
45
+ # https://github.com/varvet/pundit/blob/main/lib/generators/pundit/install/templates/application_policy.rb
46
46
  case action
47
47
  when Auth::READ then subject.is_a?(Class) ? :index? : :show?
48
48
  when Auth::DESTROY then subject.is_a?(Class) ? :destroy_all? : :destroy?
@@ -37,7 +37,14 @@ module ActiveAdmin
37
37
  end
38
38
 
39
39
  def counter_cache_col?(c)
40
- c.name.end_with?("_count")
40
+ # This helper is called inside a loop. Let's memoize the result.
41
+ @counter_cache_columns ||= begin
42
+ resource_class.reflect_on_all_associations(:has_many)
43
+ .select(&:has_cached_counter?)
44
+ .map(&:counter_cache_column)
45
+ end
46
+
47
+ @counter_cache_columns.include?(c.name)
41
48
  end
42
49
 
43
50
  def filtered_col?(c)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
- VERSION = "4.0.0.beta7"
3
+ VERSION = "4.0.0.beta9"
4
4
  end
data/plugin.js CHANGED
@@ -44,7 +44,6 @@ module.exports = plugin(
44
44
  "[type='tel']",
45
45
  "[type='time']",
46
46
  "[type='week']",
47
- '[multiple]',
48
47
  'textarea',
49
48
  'select',
50
49
  ]]: {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.beta7
4
+ version: 4.0.0.beta9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Maresh
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2024-05-31 00:00:00.000000000 Z
18
+ date: 2024-08-04 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: arbre
@@ -401,11 +401,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
401
401
  version: '3.0'
402
402
  required_rubygems_version: !ruby/object:Gem::Requirement
403
403
  requirements:
404
- - - ">"
404
+ - - ">="
405
405
  - !ruby/object:Gem::Version
406
- version: 1.3.1
406
+ version: '0'
407
407
  requirements: []
408
- rubygems_version: 3.4.6
408
+ rubygems_version: 3.5.15
409
409
  signing_key:
410
410
  specification_version: 4
411
411
  summary: Active Admin is a Ruby on Rails plugin for generating administration style