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

Replace the picture galleries with nestable elements #1358

Merged
merged 5 commits into from
Oct 15, 2018

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Feb 14, 2018

The picture gallery feature of elements is a weird special way of grouping contents inside of elements based on a special name (essence_picture_%).

A lot of code in the frontend and in the backend is necessary to make it work. Since we have the "nestable elements" feature, we can use that instead.

Combined with the compact element style this has nearly the same UX but with less code and even more features (copy/paste, hide/show, richtext captions, etc.) for managing galleries.

Some nice little tweaks were added as well:

  • If only one nestable element is available for a parent element the button immediately creates the nested element instead of opening the element select dialog
  • The archive overlay is now independent from the pictures and attachments controllers and can be included by any other controller as well (refs FEATURE: Image selection in CRUD modules #1451)

Screenshots

screenshot 2018-09-29 at 00 32 19

@tvdeyen tvdeyen force-pushed the remove-picture-gallery branch from 0f4b91e to 8deca43 Compare February 14, 2018 14:15
@AlchemyCMS AlchemyCMS deleted a comment from houndci-bot Feb 14, 2018
@AlchemyCMS AlchemyCMS deleted a comment from houndci-bot Feb 14, 2018
@tvdeyen tvdeyen force-pushed the remove-picture-gallery branch from 8deca43 to cc586a2 Compare February 14, 2018 15:11
@tvdeyen tvdeyen added this to the 5.0 milestone Sep 18, 2018
@tvdeyen tvdeyen self-assigned this Sep 28, 2018
@tvdeyen tvdeyen force-pushed the remove-picture-gallery branch 5 times, most recently from dee763f to 3eb9910 Compare September 28, 2018 20:05
@tvdeyen tvdeyen modified the milestones: 5.0, 4.2 Sep 28, 2018
@tvdeyen tvdeyen force-pushed the remove-picture-gallery branch 3 times, most recently from f04adad to 857d54c Compare September 28, 2018 22:36
@tvdeyen tvdeyen changed the title Remove the picture gallery feature Replace the picture galleries with nestable elements Sep 28, 2018
'name' => "#{element_name}_picture_gallery_picture",
'contents' => [{
'name' => 'picture',
'type' => 'EssencePicture',

Choose a reason for hiding this comment

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

Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.

Copy link
Member Author

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Should we deprecate this first?

@tvdeyen tvdeyen force-pushed the remove-picture-gallery branch from 017a33a to d879c57 Compare October 1, 2018 08:19
@mamhoff
Copy link
Contributor

mamhoff commented Oct 1, 2018

Right now, the feature is quite broken, so I think it's actually, exceptionally, better to just ship this instead.

@tvdeyen tvdeyen force-pushed the remove-picture-gallery branch 2 times, most recently from da53dd7 to b84bd06 Compare October 1, 2018 09:27
Why did this ever work?
Please use nestable elements instead.

Run

    rake alchemy:upgrade

to convert existing content.
The `picture_gallery_editor` is deprecated and will be removed soon. It is encouraged to use nested elements instead. This upgrader helps with the transition:

    bin/rake alchemy:upgrade:4.2
In admin attachments and admin elements controllers we use the
same code to handle the archive rendering. Either in an overlay
dialog (if a content_id is available) or as normal html index view.
If only one nestable element is available for a parent element, then the button immediately creates the element instead of opening a select element dialog.
@tvdeyen tvdeyen force-pushed the remove-picture-gallery branch from b84bd06 to 63b0716 Compare October 2, 2018 07:23
@tvdeyen tvdeyen merged commit f1d37fd into AlchemyCMS:master Oct 15, 2018
@tvdeyen tvdeyen deleted the remove-picture-gallery branch October 15, 2018 07:13
tvdeyen added a commit to tvdeyen/alchemy_cms that referenced this pull request Mar 29, 2019
- Use element name local in generators [AlchemyCMS#1556](AlchemyCMS#1556) ([tvdeyen](https://github.com/tvdeyen))
- Remove invalid bytecode handler [AlchemyCMS#1555](AlchemyCMS#1555) ([tvdeyen](https://github.com/tvdeyen))
- Separate render element calls [AlchemyCMS#1554](AlchemyCMS#1554) ([tvdeyen](https://github.com/tvdeyen))
- Expose the element into partials as local object [AlchemyCMS#1553](AlchemyCMS#1553) ([tvdeyen](https://github.com/tvdeyen))
- Allow admins to switch all languages [AlchemyCMS#1552](AlchemyCMS#1552) ([tvdeyen](https://github.com/tvdeyen))
- Raise targeted Ruby version to 2.3 [AlchemyCMS#1545](AlchemyCMS#1545) ([tvdeyen](https://github.com/tvdeyen))
- Introduces an Elements finder class [AlchemyCMS#1544](AlchemyCMS#1544) ([tvdeyen](https://github.com/tvdeyen))
- Fixate sqlite dep for bug fix [AlchemyCMS#1543](AlchemyCMS#1543) ([tvdeyen](https://github.com/tvdeyen))
- Upgrade shoulda-matchers to version 4.0.0 [AlchemyCMS#1542](AlchemyCMS#1542) ([depfu](https://github.com/apps/depfu))
- Upgrade factory_bot_rails to version 5.0.1 [AlchemyCMS#1540](AlchemyCMS#1540) ([depfu](https://github.com/apps/depfu))
- Use Flatpickr as Datepicker [AlchemyCMS#1533](AlchemyCMS#1533) ([mamhoff](https://github.com/mamhoff))
-  Use system tests over feature specs [AlchemyCMS#1528](AlchemyCMS#1528) ([tvdeyen](https://github.com/tvdeyen))
- Flexible width for admin navigation entry labels [AlchemyCMS#1527](AlchemyCMS#1527) ([tvdeyen](https://github.com/tvdeyen))
- Responsive elements window and sidebar [AlchemyCMS#1519](AlchemyCMS#1519) ([tvdeyen](https://github.com/tvdeyen))
- Change element eye icon on public state [AlchemyCMS#1517](AlchemyCMS#1517) ([oniram88](https://github.com/oniram88))
- Maximize element window if Tinymce is fullscreen [AlchemyCMS#1515](AlchemyCMS#1515) ([tvdeyen](https://github.com/tvdeyen))
- Remove cells in favour of fixed elements [AlchemyCMS#1514](AlchemyCMS#1514) ([tvdeyen](https://github.com/tvdeyen))
- Feature: Autogenerate nestable elements [AlchemyCMS#1513](AlchemyCMS#1513) ([tvdeyen](https://github.com/tvdeyen))
- Allow "data" key for module navigations [AlchemyCMS#1512](AlchemyCMS#1512) ([mamhoff](https://github.com/mamhoff))
- Allow to define layout for page previews [AlchemyCMS#1500](AlchemyCMS#1500) ([westonganger](https://github.com/westonganger))
- Fix capitalization for login/logout/leave [AlchemyCMS#1497](AlchemyCMS#1497) ([westonganger](https://github.com/westonganger))
- Verify controller keys within `register_module` [AlchemyCMS#1495](AlchemyCMS#1495) ([westonganger](https://github.com/westonganger))
- Update bundled Tinymce to 4.8.3 [AlchemyCMS#1491](AlchemyCMS#1491) ([tvdeyen](https://github.com/tvdeyen))
- Use dynamic attributes in factories [AlchemyCMS#1484](AlchemyCMS#1484) ([tvdeyen](https://github.com/tvdeyen))
- Migrating to active_model_serializers ~> 0.10.0 [AlchemyCMS#1478](AlchemyCMS#1478) ([pmashchak](https://github.com/pmashchak))
- Replace picture galleries with nestable elements [AlchemyCMS#1358](AlchemyCMS#1358) ([tvdeyen](https://github.com/tvdeyen))
- Add a compact nested element style [AlchemyCMS#1357](AlchemyCMS#1357) by [tvdeyen](https://github.com/tvdeyen)
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.

4 participants