-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add preferences to configure product and taxon images style #4062
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpfergus1 thanks for this PR, I like the new configurations for image styles 🖼️
I added a comment for a small optimization, let me know what you think!
b01c925
to
162d433
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can we just remove formatting changes like indentations? I know the style is not consistent but I think a clean git history is more important here.
This commit adds Spree configuration options for styles which will make it easier to customize product and taxon image styles. Currently, the user would have to create and override file or supercede the current modules ActiveStorageAttachment for either class. This will make editing styles clean and a single step process by allowing users to edit their spree.rb configuration to modify these settings. Included allowed mime types configuration for taxons
162d433
to
b1fa1b8
Compare
url: '/spree/taxons/:id/:style/:basename.:extension', | ||
path: ':rails_root/public/spree/taxons/:id/:style/:basename.:extension', | ||
default_url: '/assets/default_taxon.png' | ||
|
||
validates_attachment :icon, | ||
content_type: { content_type: %w[image/jpg image/jpeg image/png image/gif] } | ||
content_type: { content_type: Spree::Config.allowed_image_mime_types } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/AlignArguments: Align the arguments of a method call if they span more than one line.
@@ -5,14 +5,14 @@ module Spree::Taxon::PaperclipAttachment | |||
|
|||
included do | |||
has_attached_file :icon, | |||
styles: { mini: '32x32>', normal: '128x128>' }, | |||
default_style: :mini, | |||
styles: Spree::Config.taxon_image_styles, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/AlignArguments: Align the arguments of a method call if they span more than one line.
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Connor!
This change to the docs applies to all versions of Solidus since version 3.1 when the preferences for customizing image sizes were added solidusio/solidus#4062.
This change to the docs applies to all versions of Solidus since version 3.1 when the preferences for customizing image sizes were added solidusio/solidus#4062. Co-authored-by: Cameron Day <cameron@super.gd>
This change to the docs applies to all versions of Solidus since version 3.1 when the preferences for customizing image sizes were added solidusio/solidus#4062. Co-authored-by: Cameron Day <cameron@super.gd>
This commit adds Spree configuration options for styles, which will make
it easier to customize product and taxon image styles. Currently, the
user would have to create an override file or supersede the current
modules ActiveStorageAttachment for either class. This will make editing
styles clean and a single step process by allowing users to edit their
spree.rb configuration to modify these settings.
Description
Checklist: