trestle 0.8.7 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/app/assets/javascripts/trestle/components/_datepicker.js +18 -3
  4. data/app/assets/javascripts/trestle/components/_dialog.js +5 -1
  5. data/app/assets/javascripts/trestle/components/_form.js +3 -1
  6. data/app/assets/javascripts/trestle/core/_l10n.js +23 -0
  7. data/app/assets/stylesheets/trestle/components/_avatar.scss +23 -0
  8. data/app/assets/stylesheets/trestle/components/_datepicker.scss +28 -0
  9. data/app/assets/stylesheets/trestle/components/_input-group.scss +18 -0
  10. data/app/helpers/trestle/avatar_helper.rb +7 -2
  11. data/app/helpers/trestle/debug_helper.rb +1 -1
  12. data/app/helpers/trestle/form_helper.rb +1 -1
  13. data/app/helpers/trestle/i18n_helper.rb +14 -0
  14. data/app/helpers/trestle/tab_helper.rb +2 -2
  15. data/app/helpers/trestle/url_helper.rb +37 -9
  16. data/app/views/layouts/trestle/admin.html.erb +1 -3
  17. data/app/views/trestle/application/_layout.html.erb +1 -1
  18. data/app/views/trestle/application/_tabs.html.erb +1 -1
  19. data/app/views/trestle/{application → flash}/_alert.html.erb +2 -2
  20. data/app/views/trestle/flash/_debug.html.erb +8 -0
  21. data/app/views/trestle/flash/_flash.html.erb +7 -0
  22. data/app/views/trestle/resource/edit.html.erb +5 -5
  23. data/app/views/trestle/resource/index.html.erb +2 -2
  24. data/app/views/trestle/resource/new.html.erb +4 -4
  25. data/app/views/trestle/resource/show.html.erb +5 -5
  26. data/app/views/trestle/shared/_sidebar.html.erb +2 -2
  27. data/config/locales/cs.rb +18 -0
  28. data/config/locales/cs.yml +95 -0
  29. data/config/locales/en.yml +43 -22
  30. data/config/locales/fr.yml +37 -22
  31. data/config/locales/nl.yml +37 -22
  32. data/config/locales/pl.yml +37 -22
  33. data/config/locales/pt-BR.yml +37 -22
  34. data/config/locales/zh-CN.rb +18 -0
  35. data/config/locales/zh-CN.yml +94 -0
  36. data/gemfiles/rails-5.2.gemfile +14 -0
  37. data/lib/trestle/adapters/adapter.rb +3 -3
  38. data/lib/trestle/admin.rb +30 -2
  39. data/lib/trestle/admin/builder.rb +17 -7
  40. data/lib/trestle/breadcrumb.rb +3 -1
  41. data/lib/trestle/configurable.rb +6 -0
  42. data/lib/trestle/configuration.rb +7 -1
  43. data/lib/trestle/engine.rb +5 -1
  44. data/lib/trestle/form/fields/date_picker.rb +2 -2
  45. data/lib/trestle/form/fields/form_group.rb +1 -1
  46. data/lib/trestle/resource.rb +38 -3
  47. data/lib/trestle/resource/builder.rb +10 -0
  48. data/lib/trestle/resource/controller.rb +36 -22
  49. data/lib/trestle/tab.rb +4 -0
  50. data/lib/trestle/table/column.rb +4 -4
  51. data/lib/trestle/table/row.rb +1 -1
  52. data/lib/trestle/version.rb +1 -1
  53. data/vendor/assets/javascripts/trestle/flatpickr.js.erb +2 -0
  54. metadata +12 -4
  55. data/app/views/trestle/application/_flash.html.erb +0 -25
@@ -1,9 +1,9 @@
1
- <% content_for(:title, t("admin.titles.index", default: "Listing %{pluralized_model_name}", model_name: admin.model_name.titleize, pluralized_model_name: admin.model_name.plural.titleize)) %>
1
+ <% content_for(:title, admin.t("titles.index", default: "Listing %{pluralized_model_name}")) %>
2
2
 
3
3
  <% content_for(:primary_toolbar) do %>
4
4
  <%= admin_link_to action: :new, class: "btn btn-default btn-lg" do %>
5
5
  <%= icon("fa fa-plus") %>
6
- <span class="sr-only"><%= t("admin.buttons.new", default: "New %{model_name}", model_name: admin.model_name) %></span>
6
+ <span class="sr-only"><%= admin.t("buttons.new", default: "New %{model_name}") %></span>
7
7
  <% end if admin.actions.include?(:new) %>
8
8
  <% end %>
9
9
 
@@ -1,12 +1,12 @@
1
- <% title = t("admin.titles.new", default: "New %{model_name}", model_name: admin.model_name.titleize, pluralized_model_name: admin.model_name.plural.titleize) %>
1
+ <% title = admin.t("titles.new", default: "New %{model_name}") %>
2
2
 
3
3
  <% content_for(:title, title) %>
4
- <% breadcrumb title %>
4
+ <% breadcrumb(title) %>
5
5
 
6
6
  <% content_for(:primary_toolbar) do %>
7
- <%= button_tag t("admin.buttons.save", default: "Save %{model_name}", model_name: admin.model_name), class: "btn btn-success btn-lg" if admin.actions.include?(:create) %>
7
+ <%= button_tag admin.t("buttons.save", default: "Save %{model_name}"), class: "btn btn-success btn-lg" if admin.actions.include?(:create) %>
8
8
  <% end %>
9
9
 
10
- <%= trestle_form_for instance, url: admin.path, method: :post do |f| %>
10
+ <%= trestle_form_for instance, url: admin.path(:create), method: :post do |f| %>
11
11
  <%= render partial: "form", layout: dialog_request? ? "dialog" : "layout" %>
12
12
  <% end %>
@@ -1,18 +1,18 @@
1
- <% title = t("admin.titles.edit", default: "Editing %{model_name}", model_name: admin.model_name.titleize, pluralized_model_name: admin.model_name.plural.titleize) %>
1
+ <% title = admin.t("titles.edit", default: "Editing %{model_name}") %>
2
2
 
3
3
  <% content_for(:title, title) %>
4
- <% breadcrumb title %>
4
+ <% breadcrumb(title) unless admin.singular? %>
5
5
 
6
6
  <% content_for(:primary_toolbar) do %>
7
- <%= button_tag t("admin.buttons.save", default: "Save %{model_name}", model_name: admin.model_name), class: "btn btn-success btn-lg" if admin.actions.include?(:update) %>
7
+ <%= button_tag admin.t("buttons.save", default: "Save %{model_name}"), class: "btn btn-success btn-lg" if admin.actions.include?(:update) %>
8
8
  <% end %>
9
9
 
10
10
  <% content_for(:secondary_toolbar) do %>
11
11
  <%= admin_link_to instance, action: :destroy, method: :delete, class: "btn btn-danger", data: { toggle: "confirm-delete", placement: "bottom" } do %>
12
- <%= icon("fa fa-trash") %> <%= t("admin.buttons.delete", default: "Delete %{model_name}", model_name: admin.model_name) %>
12
+ <%= icon("fa fa-trash") %> <%= admin.t("buttons.delete", default: "Delete %{model_name}") %>
13
13
  <% end if admin.actions.include?(:destroy) %>
14
14
  <% end %>
15
15
 
16
- <%= trestle_form_for instance, url: admin.actions.include?(:update) ? admin.path(:update, id: admin.to_param(instance)) : "#", method: :patch do |f| %>
16
+ <%= trestle_form_for instance, url: admin.actions.include?(:update) ? admin.instance_path(instance, action: :update) : "#", method: :patch do |f| %>
17
17
  <%= render partial: "form", layout: dialog_request? ? "dialog" : "layout" %>
18
18
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <aside class="app-sidebar">
2
2
  <header class="app-sidebar-header">
3
3
  <button class="navbar-toggle">
4
- <span class="sr-only"><%= t("admin.ui.toggle_navigation", default: "Toggle navigation") %></span>
4
+ <span class="sr-only"><%= t("trestle.ui.toggle_navigation", default: "Toggle navigation") %></span>
5
5
  <span class="icon-bar"></span>
6
6
  <span class="icon-bar"></span>
7
7
  <span class="icon-bar"></span>
@@ -34,7 +34,7 @@
34
34
  </nav>
35
35
 
36
36
  <button class="toggle-sidebar">
37
- <span class="sr-only"><%= t("admin.ui.toggle_sidebar", default: "Toggle sidebar") %></span>
37
+ <span class="sr-only"><%= t("trestle.ui.toggle_sidebar", default: "Toggle sidebar") %></span>
38
38
  </button>
39
39
  </div>
40
40
  </aside>
@@ -0,0 +1,18 @@
1
+ {
2
+ cs: {
3
+ date: {
4
+ formats: {
5
+ trestle_date: proc { |date| "%d/%m/%Y" },
6
+ trestle_calendar: "%d/%m/%Y"
7
+ }
8
+ },
9
+
10
+ time: {
11
+ formats: {
12
+ trestle_date: proc { |time| "%d/%m/%Y" },
13
+ trestle_time: "%H:%M",
14
+ trestle_time_with_seconds: "%H:%M:%S"
15
+ }
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,95 @@
1
+ cs:
2
+ trestle:
3
+ title: "Administrace Trestle"
4
+ footer: "Poháněno systémem Trestle"
5
+ version: "Verze"
6
+
7
+ helpers:
8
+ page_entries_info:
9
+ one_page:
10
+ display_entries:
11
+ zero: "Nezobrazeny žádné položky"
12
+ one: "Zobrazena <strong>1</strong> položka"
13
+ other: "Zobrazeno <strong>%{count}</strong> položek"
14
+ few: "Zobrazeny <strong>%{count}</strong> položky"
15
+
16
+ more_pages:
17
+ display_entries: "Zobrazeny položky <strong>%{first}</strong> až <strong>%{last}</strong> z celkem <b>%{total}</b>"
18
+
19
+ onboarding:
20
+ welcome: "Vítejte v administraci Trestle"
21
+ no_admins: "Začněte přidáním souboru do <code>app/admin</code>."
22
+ no_template: "Pro přizpůsobení šablony vytvořte <code>%{path}</code>."
23
+ no_form: "Pro přidání formuláře nadefinujte form blok, nebo vytvořte soubor <code>_form.html</code>."
24
+
25
+ ui:
26
+ toggle_navigation: "Přepnout navigaci"
27
+ toggle_sidebar: "Přepnout boční panel"
28
+
29
+ dialog:
30
+ error: "Požadavek nemohl být dokončen."
31
+
32
+ confirmation:
33
+ title: "Jste si jisti?"
34
+ delete: "Ano"
35
+ cancel: "Nemazat"
36
+
37
+ admin:
38
+ titles:
39
+ index: Přehled
40
+ edit: Upravit položku
41
+ new: Nová položka
42
+
43
+ buttons:
44
+ new: "Přidat"
45
+ save: Uložit
46
+ delete: Smazat
47
+ ok: "OK"
48
+
49
+ breadcrumbs:
50
+ home: "Úvod"
51
+
52
+ flash:
53
+ create:
54
+ success:
55
+ title: "Akce úspěšně dokončena!"
56
+ message: "Položka byla vytvořena."
57
+
58
+ failure:
59
+ title: "Nastala chyba!"
60
+ message: "Prosím opravte chyby zvýrazněné níže."
61
+
62
+ update:
63
+ success:
64
+ title: "Akce úspěšně dokončena!"
65
+ message: "Položka byla aktualizováná."
66
+
67
+ failure:
68
+ title: "Nastala chyba!"
69
+ message: "Prosím opravte chyby zvýrazněné níže."
70
+
71
+ destroy:
72
+ success:
73
+ title: "Akce úspěšně dokončena!"
74
+ message: "Položka byla smazána."
75
+
76
+ failure:
77
+ title: "Nastala chyba!"
78
+ message: "Položku nebylo možné smazat."
79
+
80
+ table:
81
+ headers:
82
+ id: "ID"
83
+
84
+ form:
85
+ select:
86
+ prompt: "- Prosím vyberte -"
87
+
88
+ format:
89
+ blank: "-"
90
+
91
+ datepicker:
92
+ formats:
93
+ date: "d/m/Y"
94
+ datetime: "d/m/Y H:i"
95
+ time: "H:i"
@@ -4,19 +4,6 @@ en:
4
4
  footer: "Powered by Trestle"
5
5
  version: "Version"
6
6
 
7
- flash:
8
- success:
9
- title: "Success!"
10
- create: "The %{lowercase_model_name} was successfully created."
11
- update: "The %{lowercase_model_name} was successfully updated."
12
- destroy: "The %{lowercase_model_name} was successfully deleted."
13
-
14
- failure:
15
- title: "Warning!"
16
- create: "Please correct the errors below."
17
- update: "Please correct the errors below."
18
- destroy: "Could not delete %{lowercase_model_name}."
19
-
20
7
  helpers:
21
8
  page_entries_info:
22
9
  one_page:
@@ -34,9 +21,18 @@ en:
34
21
  no_template: "To customize this template, please create <code>%{path}</code>."
35
22
  no_form: "Please define a form block or create a <code>_form.html</code> partial."
36
23
 
24
+ ui:
25
+ toggle_navigation: "Toggle navigation"
26
+ toggle_sidebar: "Toggle sidebar"
27
+
37
28
  dialog:
38
29
  error: "The request could not be completed."
39
30
 
31
+ confirmation:
32
+ title: "Are you sure?"
33
+ delete: "Delete"
34
+ cancel: "Cancel"
35
+
40
36
  admin:
41
37
  titles:
42
38
  index: "Listing %{pluralized_model_name}"
@@ -52,6 +48,34 @@ en:
52
48
  breadcrumbs:
53
49
  home: "Home"
54
50
 
51
+ flash:
52
+ create:
53
+ success:
54
+ title: "Success!"
55
+ message: "The %{lowercase_model_name} was successfully created."
56
+
57
+ failure:
58
+ title: "Warning!"
59
+ message: "Please correct the errors below."
60
+
61
+ update:
62
+ success:
63
+ title: "Success!"
64
+ message: "The %{lowercase_model_name} was successfully updated."
65
+
66
+ failure:
67
+ title: "Warning!"
68
+ message: "Please correct the errors below."
69
+
70
+ destroy:
71
+ success:
72
+ title: "Success!"
73
+ message: "The %{lowercase_model_name} was successfully deleted."
74
+
75
+ failure:
76
+ title: "Warning!"
77
+ message: "Could not delete %{lowercase_model_name}."
78
+
55
79
  table:
56
80
  headers:
57
81
  id: "ID"
@@ -60,14 +84,11 @@ en:
60
84
  select:
61
85
  prompt: "- Select %{attribute_name} -"
62
86
 
63
- confirmation:
64
- title: "Are you sure?"
65
- delete: "Delete"
66
- cancel: "Cancel"
67
-
68
- ui:
69
- toggle_navigation: "Toggle navigation"
70
- toggle_sidebar: "Toggle sidebar"
71
-
72
87
  format:
73
88
  blank: "None"
89
+
90
+ datepicker:
91
+ formats:
92
+ date: "m/d/Y"
93
+ datetime: "m/d/Y h:i K"
94
+ time: "h:i K"
@@ -4,19 +4,6 @@ fr:
4
4
  footer: "Fourni par Trestle"
5
5
  version: "Version"
6
6
 
7
- flash:
8
- success:
9
- title: "Opération réussie"
10
- create: "%{model_name} créé(e)."
11
- update: "%{model_name} mis(e) à jour."
12
- destroy: "%{model_name} supprimé(e)."
13
-
14
- failure:
15
- title: "Attention!"
16
- create: "Veuillez corriger les erreurs ci-après."
17
- update: "Veuillez corriger les erreurs ci-après."
18
- destroy: "Suppression impossible."
19
-
20
7
  helpers:
21
8
  page_entries_info:
22
9
  one_page:
@@ -34,6 +21,15 @@ fr:
34
21
  no_template: "Pour personnaliser ce modèle, veuillez créer <code>%{path}</code>."
35
22
  no_form: "Veuillez déclarer un block 'form' ou créer un modèle partiel <code>_form.html</code>."
36
23
 
24
+ ui:
25
+ toggle_navigation: "Basculer navigation"
26
+ toggle_sidebar: "Basculer vue latérale"
27
+
28
+ confirmation:
29
+ title: "Voulez-vous supprimer?"
30
+ delete: "Oui"
31
+ cancel: "Non"
32
+
37
33
  admin:
38
34
  titles:
39
35
  index: "Liste des %{pluralized_model_name}"
@@ -48,6 +44,34 @@ fr:
48
44
  breadcrumbs:
49
45
  home: "Acceuil"
50
46
 
47
+ flash:
48
+ create:
49
+ success:
50
+ title: "Opération réussie"
51
+ message: "%{model_name} créé(e)."
52
+
53
+ failure:
54
+ title: "Attention!"
55
+ message: "Veuillez corriger les erreurs ci-après."
56
+
57
+ update:
58
+ success:
59
+ title: "Opération réussie"
60
+ message: "%{model_name} mis(e) à jour."
61
+
62
+ failure:
63
+ title: "Attention!"
64
+ message: "Veuillez corriger les erreurs ci-après."
65
+
66
+ destroy:
67
+ success:
68
+ title: "Opération réussie"
69
+ message: "%{model_name} supprimé(e)."
70
+
71
+ failure:
72
+ title: "Attention!"
73
+ message: "Suppression impossible."
74
+
51
75
  table:
52
76
  headers:
53
77
  id: "ID"
@@ -56,14 +80,5 @@ fr:
56
80
  select:
57
81
  prompt: "- Choisir le/la %{attribute_name} -"
58
82
 
59
- confirmation:
60
- title: "Voulez-vous supprimer?"
61
- delete: "Oui"
62
- cancel: "Non"
63
-
64
- ui:
65
- toggle_navigation: "Basculer navigation"
66
- toggle_sidebar: "Basculer vue latérale"
67
-
68
83
  format:
69
84
  blank: "Aucun"
@@ -4,19 +4,6 @@ nl:
4
4
  footer: "Powered by Trestle"
5
5
  version: "Versie"
6
6
 
7
- flash:
8
- success:
9
- title: "Gelukt!"
10
- create: "De %{model_name} succesvol toegevoegd."
11
- update: "De %{model_name} is succesvol gewijzigd."
12
- destroy: "De %{model_name} is succesvol verwijderd."
13
-
14
- failure:
15
- title: "Waarschuwing!"
16
- create: "Kon niet toevoegen om de volgende redenen."
17
- update: "Kon niet aanpassen om de volgende redenen."
18
- destroy: "Kon %{model_name} niet verwijderen."
19
-
20
7
  helpers:
21
8
  page_entries_info:
22
9
  one_page:
@@ -34,6 +21,15 @@ nl:
34
21
  no_template: "Maak <code>%{path}</code> aan om dit template aan te passen."
35
22
  no_form: "Definieer een form block of maak een <code>_form.html</code> partial."
36
23
 
24
+ ui:
25
+ toggle_navigation: "Navigation tonen/verbergen"
26
+ toggle_sidebar: "Sidebar tonen/verbergen"
27
+
28
+ confirmation:
29
+ title: "Weer je het zeker?"
30
+ delete: "Verwijderen"
31
+ cancel: "Annuleren"
32
+
37
33
  admin:
38
34
  titles:
39
35
  index: "Lijst van %{pluralized_model_name}"
@@ -46,6 +42,34 @@ nl:
46
42
  breadcrumbs:
47
43
  home: "Home"
48
44
 
45
+ flash:
46
+ create:
47
+ success:
48
+ title: "Gelukt!"
49
+ message: "De %{model_name} succesvol toegevoegd."
50
+
51
+ failure:
52
+ title: "Waarschuwing!"
53
+ message: "Kon niet toevoegen om de volgende redenen."
54
+
55
+ update:
56
+ success:
57
+ title: "Gelukt!"
58
+ message: "De %{model_name} is succesvol gewijzigd."
59
+
60
+ failure:
61
+ title: "Waarschuwing!"
62
+ message: "Kon niet aanpassen om de volgende redenen."
63
+
64
+ destroy:
65
+ success:
66
+ title: "Gelukt!"
67
+ message: "De %{model_name} is succesvol verwijderd."
68
+
69
+ failure:
70
+ title: "Waarschuwing!"
71
+ message: "Kon %{model_name} niet verwijderen."
72
+
49
73
  table:
50
74
  headers:
51
75
  id: "ID"
@@ -54,14 +78,5 @@ nl:
54
78
  select:
55
79
  prompt: "- Selecteer %{attribute_name} -"
56
80
 
57
- confirmation:
58
- title: "Weer je het zeker?"
59
- delete: "Verwijderen"
60
- cancel: "Annuleren"
61
-
62
- ui:
63
- toggle_navigation: "Navigation tonen/verbergen"
64
- toggle_sidebar: "Sidebar tonen/verbergen"
65
-
66
81
  format:
67
82
  blank: "Geen"