-
-
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
Feature image crop #3380
Feature image crop #3380
Conversation
That's pretty exciting @bricesanchez |
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.
If you say it works in all the major browsers, I believe you. 😄
keen for @anitagraham to take a look |
|
||
<% content_for :stylesheets do %> | ||
<%= stylesheet_link_tag('refinery/plugins/cropper') %> | ||
<% end %> |
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.
if it's just one, you can normally in-line it:
<% content_for :stylesheets, stylesheet_link_tag('refinery/plugins/cropper') -%>
23bac85
to
5575ad5
Compare
@parndt I've made some change to support a message if there is no crop. Could you review it please? |
</ul> | ||
<% if @image.crops.present? %> | ||
<ul id="crop-list" class="clearfix"> | ||
<% @image.crops.each do |crop| %> |
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.
does <%= render @image.crops %>
work here?
Or
<%= render partial: 'crop', collection: @image.crops
I think Rails handles this with syntax like one of the above, provided it can find the partial.
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.
Yes it works :)
8f1bc27
to
f7b7f28
Compare
Hi @anitagraham, do you have the time to check this PR? |
398b6ae
to
4898c25
Compare
With this latest commit, this feature works well on all major browsers including Edge :) |
2f54053
to
4898c25
Compare
* Use Cropper.js lib (https://github.com/fengyuanchen/cropperjs) * No dependency to jQuery * Add Ability to write multiple crops in Admin Image Edit form * Use pre-defined or custom crop ratios * Add Ability to use crop in WYSIWYG editors and in Image insert dialog
Also don't import cropper css in main refinery
4898c25
to
fdfab9f
Compare
Could we merge it @parndt? |
Yep 😄 |
This looks great. I am sorry I wasn't around to help review it - about to use it now, instead. |
No tests added for this feature, sorry :(