satis 2.1.48 → 2.1.49

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20a33d2da55a21ccf04e5ecca7b4669423b15b0377e60db69c4cced1a38ac939
4
- data.tar.gz: fccc17ce2b1766f862d357ed3ca3abb40b546bee869f42ddbcdb717ecb7b29e7
3
+ metadata.gz: 1ad2f7b4c5a019c16cbd6d7a87a119d3db6db6582b514f3d79bc1bb9c6b217ac
4
+ data.tar.gz: 7cc90112489b1b41672e7d3319de43a9c8525b9d1a5c1c7a3255d3eafda2f97c
5
5
  SHA512:
6
- metadata.gz: 5ca900e48520ae3bb301cea1f72f36d11c3fb5636a044c0b5c0f45c165fe5844e6c5e7a36eaaa21db36986cb2e0ced79669af6bccd2bdf3a33f76ef22b9677bd
7
- data.tar.gz: d4bdcb0054e81ee06a922b3f20bae18d940edfe0ad92e9d6e45bb1234268b5a7c29425b6da4812cdf3b1b3470ecda5056f6518daa25bc973e2551dd0d2ada323
6
+ metadata.gz: bbaf6180578a757ee3878c711055b51f91af0083fade4eece870e8ab4f8b14a289f91718572e260a8a1b01fb14bc1e2ec4b8d3e745e248d3c36f35196994e70b
7
+ data.tar.gz: 472ebef37cbb6d5beceffd4ab8aaedbaf40aa3d1192d61c347a3ed4d5c1231e169d0f39d5d3e5c534d2860f0885c17cc3d9044f1d3e672078e63e821d04155a6
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  .attachments__attachment:hover .attachments__button {
29
- @apply block;
29
+ @apply block w-8 h-8 text-center;
30
30
  }
31
31
 
32
32
  .attachments__attachment .attachments__filename {
@@ -74,21 +74,18 @@
74
74
  }
75
75
 
76
76
  .upload-btn {
77
- @apply dark:bg-gray-900 dark:text-white;
77
+ @apply dark:bg-gray-900 dark:text-white bg-white;
78
78
  align-items: center;
79
79
  padding: 10px 15px;
80
- background-color: #f0f0f0;
81
80
  border: 2px dashed #ccc;
82
81
  border-radius: 5px;
83
82
  cursor: pointer;
84
83
  transition: all 0.3s ease;
85
- font-family: Arial, sans-serif;
86
84
  color: #333;
87
85
  }
88
86
 
89
87
  .upload-btn:hover {
90
- @apply dark:bg-gray-900 dark:text-white dark:border-gray-700;
91
- background-color: #e0e0e0;
88
+ @apply dark:bg-gray-900 dark:text-white dark:border-gray-700 bg-white;
92
89
  border-color: #999;
93
90
  }
94
91
 
@@ -103,12 +100,12 @@
103
100
  }
104
101
 
105
102
  .upload-btn .icon.upload {
106
- color: #4a90e2;
103
+ @apply text-primary-600;
107
104
  }
108
105
 
109
106
  .upload-btn .icon.uploading {
110
107
  display: none;
111
- color: #f39c12;
108
+ @apply text-primary-600;
112
109
  }
113
110
 
114
111
  .uploading .upload-btn .icon.upload {
@@ -8,8 +8,7 @@ div.attachment-upload.upload-btn data-controller="attachment-upload" data-attach
8
8
 
9
9
 
10
10
  div.attachments__group
11
- - attachments = model_has_images ? model.images : model.attachments
12
- - attachments.each do |attachment|
11
+ - model.send(attribute).each do |attachment|
13
12
  div.attachments__attachment(style= attachment_style(attachment))
14
13
  - unless attachment.representable?
15
14
  div.preview-text
@@ -1,8 +1,6 @@
1
1
  module Satis
2
2
  module Attachments
3
3
  class Component < Satis::ApplicationComponent
4
- include Rails.application.routes.url_helpers
5
-
6
4
  attr_reader :model, :attribute, :attachments_options
7
5
 
8
6
  def initialize(model, attribute, **options)
@@ -12,10 +10,6 @@ module Satis
12
10
  @attachments_options = options
13
11
  end
14
12
 
15
- def model_has_images
16
- model.respond_to?(:images)
17
- end
18
-
19
13
  def attachment_style(attachment)
20
14
  if attachment.representable?
21
15
  url = attachment.representation(resize_to_limit: [200, 200]).processed.url
@@ -25,9 +19,8 @@ module Satis
25
19
  end
26
20
  end
27
21
 
28
-
29
22
  def model_sgid
30
- @model.to_sgid(expires_in: nil, for: 'satis_attachments')
23
+ @model.to_sgid(expires_in: nil, for: "satis_attachments")
31
24
  end
32
25
  end
33
26
  end
@@ -3,5 +3,13 @@ module Satis
3
3
  def sts
4
4
  @_satis_helpers_container ||= Satis::Helpers::Container.new(self)
5
5
  end
6
+
7
+ def method_missing(method, *args, **kwargs, &block)
8
+ if method.to_s.ends_with?("_url") || method.to_s.ends_with?("_path") && main_app.respond_to?(method)
9
+ main_app.send(method, *args, **kwargs, &block)
10
+ else
11
+ super
12
+ end
13
+ end
6
14
  end
7
15
  end
data/lib/satis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Satis
2
- VERSION = "2.1.48"
2
+ VERSION = "2.1.49"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.48
4
+ version: 2.1.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-21 00:00:00.000000000 Z
11
+ date: 2025-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser