trestle 0.10.0.pre → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +26 -0
  3. data/.github/workflows/rspec.yml +6 -2
  4. data/Gemfile +14 -5
  5. data/README.md +1 -1
  6. data/app/assets/bundle/trestle/admin.css +9 -9
  7. data/app/assets/bundle/trestle/admin.js +13 -13
  8. data/app/assets/bundle/trestle/fa-brands-400.ttf +0 -0
  9. data/app/assets/bundle/trestle/fa-brands-400.woff2 +0 -0
  10. data/app/assets/bundle/trestle/fa-regular-400.ttf +0 -0
  11. data/app/assets/bundle/trestle/fa-regular-400.woff2 +0 -0
  12. data/app/assets/bundle/trestle/fa-solid-900.ttf +0 -0
  13. data/app/assets/bundle/trestle/fa-solid-900.woff2 +0 -0
  14. data/app/assets/bundle/trestle/photoswipe-063ce7be40e10b3e6848.digested.js +6 -0
  15. data/app/assets/sprockets/trestle/icons/font-awesome.css.erb +1 -1
  16. data/app/controllers/concerns/trestle/controller/modal.rb +3 -1
  17. data/app/controllers/concerns/trestle/controller/turbo_stream.rb +12 -0
  18. data/app/controllers/concerns/trestle/resource/controller/actions.rb +3 -3
  19. data/app/controllers/trestle/application_controller.rb +1 -1
  20. data/app/helpers/trestle/modal_helper.rb +0 -5
  21. data/app/helpers/trestle/turbo/frame_helper.rb +29 -0
  22. data/app/helpers/trestle/turbo/stream_helper.rb +9 -0
  23. data/app/helpers/trestle/turbo/tag_builder.rb +21 -0
  24. data/app/helpers/trestle/url_helper.rb +2 -2
  25. data/app/views/layouts/trestle/admin.html.erb +1 -1
  26. data/app/views/layouts/trestle/admin.turbo_stream.erb +2 -9
  27. data/app/views/trestle/application/_header.html.erb +12 -10
  28. data/app/views/trestle/resource/create.turbo_stream.erb +1 -5
  29. data/app/views/trestle/resource/destroy.turbo_stream.erb +1 -1
  30. data/app/views/trestle/resource/edit.html.erb +2 -0
  31. data/app/views/trestle/resource/index.html.erb +5 -0
  32. data/app/views/trestle/resource/new.html.erb +5 -0
  33. data/app/views/trestle/resource/show.html.erb +2 -0
  34. data/app/views/trestle/resource/update.turbo_stream.erb +1 -5
  35. data/app/views/trestle/shared/_sidebar.html.erb +2 -2
  36. data/frontend/css/components/_alerts.scss +22 -20
  37. data/frontend/css/components/_avatar.scss +12 -12
  38. data/frontend/css/components/_background.scss +1 -1
  39. data/frontend/css/components/_breadcrumbs.scss +8 -29
  40. data/frontend/css/components/_buttons.scss +3 -3
  41. data/frontend/css/components/_datepicker.scss +3 -3
  42. data/frontend/css/components/_dropdown.scss +18 -26
  43. data/frontend/css/components/_forms.scss +4 -4
  44. data/frontend/css/components/_grid.scss +29 -0
  45. data/frontend/css/components/_media-grid.scss +1 -1
  46. data/frontend/css/components/_modal.scss +4 -4
  47. data/frontend/css/components/_pagination.scss +4 -8
  48. data/frontend/css/components/_popover.scss +1 -1
  49. data/frontend/css/components/_scopes.scss +4 -10
  50. data/frontend/css/components/_select.scss +8 -9
  51. data/frontend/css/components/_sort.scss +1 -1
  52. data/frontend/css/components/_table.scss +5 -5
  53. data/frontend/css/components/_tabs.scss +11 -18
  54. data/frontend/css/components/_tags.scss +16 -6
  55. data/frontend/css/components/_toolbars.scss +9 -9
  56. data/frontend/css/core/_functions.scss +0 -8
  57. data/frontend/css/core/_theme.scss +3 -0
  58. data/frontend/css/core/_typography.scss +12 -19
  59. data/frontend/css/index.scss +3 -1
  60. data/frontend/css/layout/_base.scss +4 -2
  61. data/frontend/css/layout/_content-header.scss +71 -0
  62. data/frontend/css/layout/_footer.scss +5 -7
  63. data/frontend/css/layout/_main-content.scss +107 -0
  64. data/frontend/css/layout/_navigation.scss +111 -49
  65. data/frontend/css/layout/_sidebar.scss +60 -34
  66. data/frontend/css/variables/_bootstrap.scss +30 -21
  67. data/frontend/css/variables/_trestle.scss +20 -17
  68. data/frontend/js/controllers/batch_action_controller.js +59 -0
  69. data/frontend/js/controllers/checkbox_select_controller.js +3 -0
  70. data/frontend/js/controllers/confirm_delete_controller.js +4 -4
  71. data/frontend/js/controllers/gallery_controller.js +2 -0
  72. data/frontend/js/controllers/lightbox_controller.js +0 -2
  73. data/lib/trestle/engine.rb +18 -16
  74. data/lib/trestle/form/renderer.rb +1 -1
  75. data/lib/trestle/resource/toolbar.rb +18 -8
  76. data/lib/trestle/sprockets_compressor.rb +16 -0
  77. data/lib/trestle/toolbar/context.rb +7 -4
  78. data/lib/trestle/toolbar/menu.rb +8 -5
  79. data/lib/trestle/version.rb +1 -1
  80. data/package.json +1 -1
  81. data/trestle.gemspec +5 -9
  82. data/yarn.lock +350 -363
  83. metadata +35 -70
  84. data/app/assets/bundle/trestle/photoswipe-7aa1aec9c3c1fd65c382.digested.js +0 -6
  85. data/app/controllers/concerns/trestle/controller/turbo.rb +0 -21
  86. data/app/helpers/trestle/turbo_frame_helper.rb +0 -34
  87. data/frontend/css/layout/_content.scss +0 -173
@@ -28,13 +28,17 @@ module Trestle
28
28
  end
29
29
 
30
30
  class Builder
31
- delegate :admin_link_to, :content_tag, to: :@template
31
+ delegate :admin_link_to, :content_tag, :tag, to: :@template
32
32
 
33
33
  def initialize(menu, template)
34
34
  @menu, @template = menu, template
35
35
  end
36
36
 
37
37
  def link(content, instance_or_url=nil, options={}, &block)
38
+ if instance_or_url.is_a?(Hash)
39
+ instance_or_url, options = nil, instance_or_url
40
+ end
41
+
38
42
  options[:class] = Array(options[:class])
39
43
  options[:class] << "dropdown-item"
40
44
 
@@ -42,16 +46,15 @@ module Trestle
42
46
  end
43
47
 
44
48
  def header(text)
45
- item(class: "dropdown-header") { text }
49
+ item { content_tag(:h6, text, class: "dropdown-header") }
46
50
  end
47
51
 
48
52
  def divider
49
- item(class: "divider")
53
+ item { tag(:hr, class: "dropdown-divider") }
50
54
  end
51
55
 
52
56
  def item(options={}, &block)
53
- opts = { role: "presentation" }.merge(options)
54
- item = block_given? ? content_tag(:li, opts, &block) : content_tag(:li, "", opts)
57
+ item = block_given? ? content_tag(:li, options, &block) : content_tag(:li, "", options)
55
58
 
56
59
  @menu.items << item
57
60
 
@@ -1,3 +1,3 @@
1
1
  module Trestle
2
- VERSION = "0.10.0.pre"
2
+ VERSION = "0.10.0"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trestle",
3
- "version": "0.10.0.pre",
3
+ "version": "0.10.0",
4
4
  "description": "A modern, responsive admin framework for Ruby on Rails",
5
5
  "homepage": "https://trestle.io",
6
6
  "repository": "https://github.com/TrestleAdmin/trestle.git",
data/trestle.gemspec CHANGED
@@ -18,19 +18,15 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.required_ruby_version = ">= 2.2.2"
21
+ spec.required_ruby_version = ">= 2.6.0"
22
22
 
23
- spec.add_dependency "railties", ">= 5.2.0"
24
- spec.add_dependency "activemodel", ">= 5.2.0"
25
- spec.add_dependency "kaminari", ">= 1.1.0"
23
+ spec.add_dependency "railties", ">= 6.0.0"
24
+ spec.add_dependency "activemodel", ">= 6.0.0"
25
+ spec.add_dependency "turbo-rails", ">= 2.0.6"
26
+ spec.add_dependency "kaminari", ">= 1.1.0"
26
27
 
27
28
  spec.add_development_dependency "rspec-rails", ">= 5.1.2"
28
29
  spec.add_development_dependency "rspec-html-matchers", "~> 0.10.0"
29
30
  spec.add_development_dependency "database_cleaner", "~> 2.0.2"
30
31
  spec.add_development_dependency "ammeter", "~> 1.1.5"
31
- spec.add_development_dependency "i18n-js", "~> 4.2.3"
32
-
33
- spec.add_development_dependency "bundler"
34
- spec.add_development_dependency "rake"
35
- spec.add_development_dependency "sqlite3"
36
32
  end