headmin 0.2.3 → 0.2.7

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/.nvmrc +1 -1
  3. data/Gemfile.lock +3 -3
  4. data/README.md +10 -7
  5. data/app/helpers/headmin/admin_helper.rb +3 -59
  6. data/app/helpers/headmin/bootstrap_helper.rb +9 -0
  7. data/app/helpers/headmin/filter_helper.rb +7 -3
  8. data/app/helpers/headmin/form_helper.rb +36 -0
  9. data/app/helpers/headmin/request_helper.rb +39 -0
  10. data/app/models/concerns/headmin/fieldable.rb +53 -23
  11. data/app/services/block_service.rb +8 -4
  12. data/app/views/headmin/_blocks.html.erb +1 -1
  13. data/app/views/headmin/_filters.html.erb +1 -1
  14. data/app/views/headmin/_pagination.html.erb +4 -1
  15. data/app/views/headmin/dropdown/_devise.html.erb +20 -10
  16. data/app/views/headmin/dropdown/_list.html.erb +17 -7
  17. data/app/views/headmin/filters/_select.html.erb +3 -2
  18. data/app/views/headmin/filters/filter/_button.html.erb +0 -1
  19. data/app/views/headmin/forms/_blocks.html.erb +11 -4
  20. data/app/views/headmin/forms/_date.html.erb +1 -1
  21. data/app/views/headmin/forms/_label.html.erb +2 -2
  22. data/app/views/headmin/forms/_repeater.html.erb +6 -10
  23. data/app/views/headmin/table/_actions.html.erb +37 -11
  24. data/app/views/headmin/views/devise/confirmations/_new.html.erb +1 -1
  25. data/app/views/headmin/views/devise/passwords/_edit.html.erb +2 -2
  26. data/app/views/headmin/views/devise/passwords/_new.html.erb +1 -1
  27. data/app/views/headmin/views/devise/registrations/_edit.html.erb +4 -4
  28. data/app/views/headmin/views/devise/registrations/_new.html.erb +3 -3
  29. data/app/views/headmin/views/devise/shared/_links.html.erb +7 -7
  30. data/app/views/headmin/views/devise/unlocks/_new.html.erb +1 -1
  31. data/config/locales/activerecord/en.yml +9 -0
  32. data/config/locales/activerecord/nl.yml +9 -0
  33. data/config/locales/headmin/table/en.yml +5 -1
  34. data/config/locales/headmin/table/nl.yml +5 -1
  35. data/config/locales/headmin/views/en.yml +1 -1
  36. data/config/locales/headmin/views/nl.yml +14 -14
  37. data/dist/css/headmin.css +54 -13
  38. data/dist/js/headmin.js +45 -513
  39. data/docs/blocks-and-fields.md +54 -0
  40. data/docs/blocks.md +1 -54
  41. data/docs/devise.md +40 -2
  42. data/docs/fields.md +31 -9
  43. data/headmin.gemspec +1 -1
  44. data/lib/generators/headmin/blocks_generator.rb +4 -1
  45. data/lib/generators/headmin/devise_generator.rb +16 -0
  46. data/lib/generators/headmin/fields_generator.rb +5 -1
  47. data/lib/generators/templates/controllers/auth/confirmations_controller.rb +31 -0
  48. data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +31 -0
  49. data/lib/generators/templates/controllers/auth/passwords_controller.rb +35 -0
  50. data/lib/generators/templates/controllers/auth/registrations_controller.rb +63 -0
  51. data/lib/generators/templates/controllers/auth/sessions_controller.rb +28 -0
  52. data/lib/generators/templates/controllers/auth/unlocks_controller.rb +31 -0
  53. data/lib/generators/templates/migrations/create_field_hierarchies.rb +16 -0
  54. data/lib/generators/templates/views/auth/confirmations/new.html.erb +1 -0
  55. data/lib/generators/templates/views/auth/mailer/confirmation_instructions.html.erb +1 -0
  56. data/lib/generators/templates/views/auth/mailer/email_changed.html.erb +1 -0
  57. data/lib/generators/templates/views/auth/mailer/password_change.html.erb +1 -0
  58. data/lib/generators/templates/views/auth/mailer/reset_password_instructions.html.erb +1 -0
  59. data/lib/generators/templates/views/auth/mailer/unlock_instructions.html.erb +1 -0
  60. data/lib/generators/templates/views/auth/passwords/edit.html.erb +1 -0
  61. data/lib/generators/templates/views/auth/passwords/new.html.erb +1 -0
  62. data/lib/generators/templates/views/auth/registrations/edit.html.erb +1 -0
  63. data/lib/generators/templates/views/auth/registrations/new.html.erb +1 -0
  64. data/lib/generators/templates/views/auth/sessions/new.html.erb +1 -0
  65. data/lib/generators/templates/views/auth/unlocks/new.html.erb +1 -0
  66. data/lib/generators/templates/views/layouts/auth.html.erb +20 -0
  67. data/lib/headmin/version.rb +1 -1
  68. data/package.json +4 -3
  69. data/src/js/headmin/controllers/blocks_controller.js +1 -1
  70. data/src/js/headmin/controllers/filter_controller.js +1 -1
  71. data/src/js/headmin/controllers/filters_controller.js +1 -1
  72. data/src/js/headmin/controllers/popup_controller.js +1 -1
  73. data/src/js/headmin/controllers/repeater_controller.js +9 -10
  74. data/src/js/headmin/controllers/table_actions_controller.js +104 -9
  75. data/src/js/headmin/controllers/table_controller.js +28 -57
  76. data/src/js/headmin/headmin.js +2 -2
  77. data/src/scss/headmin/table.scss +1 -0
  78. data/yarn.lock +1159 -1237
  79. metadata +33 -7
  80. data/docs/README.md +0 -5
@@ -1,7 +1,7 @@
1
1
  <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: {method: :post}) do |f| %>
2
2
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
3
 
4
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
5
 
6
6
  <%= f.submit t('.resend'), class: 'btn btn-lg btn-primary w-100' %>
7
7
 
@@ -3,8 +3,8 @@
3
3
 
4
4
  <%= f.hidden_field :reset_password_token %>
5
5
 
6
- <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, label: :float %>
7
- <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, label: :float %>
6
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
7
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
8
8
 
9
9
  <%= f.submit t('.change_password'), class: 'btn btn-lg btn-primary w-100' %>
10
10
 
@@ -1,7 +1,7 @@
1
1
  <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: {method: :post}) do |f| %>
2
2
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
3
 
4
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
5
 
6
6
  <%= f.submit t('.send_instructions'), class: 'btn btn-lg btn-primary w-100' %>
7
7
 
@@ -2,15 +2,15 @@
2
2
  <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put}) do |f| %>
3
3
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
4
4
 
5
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
5
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
6
6
 
7
7
  <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
8
8
  <div><%= t('.waiting_confirmation', email: resource.unconfirmed_email) %></div>
9
9
  <% end %>
10
10
 
11
- <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, label: :float %>
12
- <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, label: :float %>
13
- <%= render 'headmin/forms/password', form: f, attribute: :current_password, required: true, label: :float %>
11
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
12
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
13
+ <%= render 'headmin/forms/password', form: f, attribute: :current_password, required: true, float: true %>
14
14
 
15
15
  <%= f.submit t('.change'), class: 'btn btn-lg btn-primary w-100' %>
16
16
  <% end %>
@@ -1,9 +1,9 @@
1
1
  <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
2
2
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
3
 
4
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
5
- <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, label: :float %>
6
- <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, label: :float %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
+ <%= render 'headmin/forms/password', form: f, attribute: :password, required: true, float: true %>
6
+ <%= render 'headmin/forms/password', form: f, attribute: :password_confirmation, required: true, float: true %>
7
7
 
8
8
  <%= f.submit t('.sign_up'), class: 'btn btn-lg btn-primary w-100' %>
9
9
 
@@ -1,27 +1,27 @@
1
- <div class="bg-light mt-5 text-end">
1
+ <div class="bg-light mt-5 text-center">
2
2
  <%- if controller_name != 'sessions' %>
3
- <%= link_to "Log in", new_session_path(resource_name) %><br />
3
+ <%= link_to t('.sign_in'), new_session_path(resource_name) %><br />
4
4
  <% end %>
5
5
 
6
6
  <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
7
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
+ <%= link_to t('.sign_up'), new_registration_path(resource_name) %><br />
8
8
  <% end %>
9
9
 
10
10
  <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
11
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
+ <%= link_to t('.forgot_password'), new_password_path(resource_name) %><br />
12
12
  <% end %>
13
13
 
14
14
  <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
15
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
+ <%= link_to t('.confirmation'), new_confirmation_path(resource_name) %><br />
16
16
  <% end %>
17
17
 
18
18
  <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
19
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
+ <%= link_to t('.unlock'), new_unlock_path(resource_name) %><br />
20
20
  <% end %>
21
21
 
22
22
  <%- if devise_mapping.omniauthable? %>
23
23
  <%- resource_class.omniauth_providers.each do |provider| %>
24
- <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %><br />
24
+ <%= link_to t('.omniauth', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), method: :post %><br />
25
25
  <% end %>
26
26
  <% end %>
27
27
  </div>
@@ -1,7 +1,7 @@
1
1
  <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: {method: :post}) do |f| %>
2
2
  <%= render "headmin/views/devise/shared/error_messages", resource: resource %>
3
3
 
4
- <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, label: :float %>
4
+ <%= render 'headmin/forms/email', form: f, attribute: :email, required: true, float: true %>
5
5
 
6
6
  <%= f.submit t('.resend'), class: 'btn btn-lg btn-primary w-100' %>
7
7
 
@@ -0,0 +1,9 @@
1
+ en:
2
+ attributes:
3
+ created_at: Created at
4
+ email: Email
5
+ password: Password
6
+ password_confirmation: Password confirmation
7
+ remember_me: Stay logged in
8
+ updated_at: Updated at
9
+ value: Value
@@ -0,0 +1,9 @@
1
+ nl:
2
+ attributes:
3
+ created_at: Aangemaakt
4
+ email: E-mailadres
5
+ password: Wachtwoord
6
+ password_confirmation: Wachtwoord bevestiging
7
+ remember_me: Aangemeld blijven
8
+ updated_at: Aangepast
9
+ value: Waarde
@@ -3,7 +3,11 @@ en:
3
3
  table:
4
4
  actions:
5
5
  apply: Apply
6
- selection: With selection
6
+ items_html:
7
+ zero: '<b>Without</b> items'
8
+ one: 'With <b>1</b> item'
9
+ other: 'With <b>%{count}</b> items'
10
+ selection: Choose an action
7
11
  export:
8
12
  button: Export
9
13
  delete:
@@ -3,7 +3,11 @@ nl:
3
3
  table:
4
4
  actions:
5
5
  apply: Toepassen
6
- selection: Met selectie
6
+ items_html:
7
+ zero: '<b>Zonder</b> items'
8
+ one: 'Met <b>1</b> item'
9
+ other: 'Met <b>%{count}</b> items'
10
+ selection: Selecteer een actie
7
11
  export:
8
12
  button: Exporteren
9
13
  delete:
@@ -53,6 +53,6 @@ en:
53
53
  sign_in: Sign in
54
54
  sign_up: Sign up
55
55
  unlock: Didn't receive unlock instructions?
56
- unlock:
56
+ unlocks:
57
57
  new:
58
58
  resend: Resend unlock instructions
@@ -7,26 +7,26 @@ nl:
7
7
  resend: Opnieuw verzenden
8
8
  mailers:
9
9
  confirmation_instructions:
10
- welcome: Welkom %{email}!
10
+ welcome: 'Welkom %{email}!'
11
11
  confirm: Account bevestigen
12
- confirm_email: Je kan uw account bevestigen door op de onderstaande link te klikken":"
12
+ confirm_email: 'Je kan uw account bevestigen door op de onderstaande link te klikken:'
13
13
  email_changed:
14
- greeting: Hallo %{email}!
15
- email_is_changing_to: We contacteren u om uw te verwittigen dat uw email zal wijzigen naar %{email}.
16
- email_has_changed_to: We contacteren u om uw te verwittigen dat uw email gewijzigd is naar %{email}.
14
+ greeting: 'Hallo %{email}!'
15
+ email_is_changing_to: 'We contacteren u om uw te verwittigen dat uw email zal wijzigen naar %{email}.'
16
+ email_has_changed_to: 'We contacteren u om uw te verwittigen dat uw email gewijzigd is naar %{email}.'
17
17
  password_change:
18
- greeting: Hallo %{email}!
18
+ greeting: 'Hallo %{email}!'
19
19
  password_has_changed: We contacteren u om uw te verwittigen dat uw wachtwoord gewijzigd is.
20
20
  reset_password_instructions:
21
- greeting: Hallo %{email}!
21
+ greeting: 'Hallo %{email}!'
22
22
  change: Wachtwoord wijzigen
23
23
  someone_requested: Iemand heeft een link gevraagd om uw wachtwoord te veranderen. Je kan dit doen via onderstaande link.
24
24
  not_requested: Als je dit niet zelf gevraagd heeft, mag u deze email negeren.
25
25
  password_not_changed_until: Je wachtwoord verandert niet totdat je op de link klikt en uw wachtwoord wijzigt.
26
26
  unlock_instructions:
27
- greeting: Hallo %{email}!
27
+ greeting: 'Hallo %{email}!'
28
28
  account_locked: Uw account is vergrendeld door het hoge aantal van mislukte login pogingen.
29
- click_link: Klik op de onderstaande link om uw account te ontgrendelen":"
29
+ click_link: 'Klik op de onderstaande link om uw account te ontgrendelen:'
30
30
  unlock_account: Ontgrendel mijn account
31
31
  passwords:
32
32
  edit:
@@ -35,7 +35,7 @@ nl:
35
35
  send_instructions: Verzend reset instructies
36
36
  registrations:
37
37
  edit:
38
- waiting_confirmation: Wachten op bevestiging voor":" %{email}
38
+ waiting_confirmation: 'Wachten op bevestiging voor: %{email}'
39
39
  change: Wijzig mijn profiel
40
40
  unhappy: Niet tevreden?
41
41
  cancel: Verwijder mijn account
@@ -49,10 +49,10 @@ nl:
49
49
  links:
50
50
  confirmation: Geen bevestigingsmail ontvangen?
51
51
  forgot_password: Wachtwoord vergeten?
52
- omniauth: "Registreer met %{provider}"
52
+ omniauth: 'Registreer met %{provider}'
53
53
  sign_in: Aanmelden
54
54
  sign_up: Registeren
55
- unlock: Geen deblokkeermail ontvangen?
56
- unlock:
55
+ unlock: Geen ontgrendelinstructies ontvangen?
56
+ unlocks:
57
57
  new:
58
- resend: Verstuur ontgrendel instructies
58
+ resend: Verstuur ontgrendelinstructies