Skip to content
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

Extract Thumbnails and CropAction concerns #2141

Merged
merged 2 commits into from
Jun 28, 2021

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jun 25, 2021

What is this pull request for?

As preparation for #2061 it makes using the image cropper and displaying picture thumbnails easier for models beside the Alchemy::EssencePicture

  1. Introduces CropAction controller concern

With this module you can add a crop action to any resourceful controller.
The model needs to implement the same crop interface as the EssencePicture.
A routing concern and a shared example are available as well.

  1. Extracts PictureThumbnails concern

Holds everything you need to make your model being able to
display image thumbnails and make use of the image cropper.

Your model needs to have crop_from and crop_size attributes
as well as a Alchemy::Picture association named picture and
a settings Hash.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

With this module you can add a crop action to any resourceful controller.

The model needs to implement the same crop interface as the EssencePicture.

A routing concern and a shared example are available as well.
@tvdeyen tvdeyen added this to the 6.0 milestone Jun 25, 2021
@tvdeyen tvdeyen requested a review from mamhoff June 25, 2021 15:02
@tvdeyen tvdeyen force-pushed the croppable-resource branch 2 times, most recently from 84c982c to a45539a Compare June 26, 2021 14:58
@tvdeyen tvdeyen changed the title Thumbnailable and Croppable resources Extract Thumbnails and CropAction concerns Jun 26, 2021
Holds everything you need to make your model being able to
display image thumbnails and make use of the image cropper.

Your model needs to have `crop_from` and `crop_size` attributes
as well as a `Alchemy::Picture` association named `picture` and
a `settings` Hash.
@tvdeyen tvdeyen force-pushed the croppable-resource branch from a45539a to f9ddbf6 Compare June 27, 2021 12:04
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me likes

@tvdeyen tvdeyen force-pushed the croppable-resource branch from f9ddbf6 to 3b20f27 Compare June 28, 2021 09:48
@tvdeyen tvdeyen merged commit 52694b3 into AlchemyCMS:main Jun 28, 2021
@tvdeyen tvdeyen deleted the croppable-resource branch June 28, 2021 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants