I took a stab at creating a plugin that can organize a bunch of images into somewhat of a gallery. See a screenshot of it in action here: Screenshot here:
This doesn’t handle displaying images in lightboxes, instead it wraps the existing Discourse lightboxing that occurs on images.
You can customize the size the images get scaled down to.
There is a minor detail that I would like to see fixed - on any forum you cannot quote the tags to give rise to a description, for example:
On my forum, a line containing code quoted [image-gallery] … [/image-gallery] will process these words/tags wherever they are written, unlike the [spoiler] plugin.
Does this work on the latest version of Discourse? I tried to install it on my development version of Discourse, I can’t get it to work. When the tags are used on a new post, I can’t save it as it gives me “Internal Server Error 500”. I will include the production.log error message as soon as possible as I can get to my devbox.
EDIT: added error message from production.log:
Started POST "/posts" for "IP-ADDRESS" at 2015-01-13 21:06:42 +0000
Processing by PostsController#create as */*
Parameters: {"raw"=>"[image-gallery]\n<img src=\"/uploads/default/17/02c9eeb0ca7f57e9.png\">\n<img src=\"/uploads/default/10/d2d06cb573f66f29.jpg\">\n<img src=\"/uploads/default/18/6033609447a3dc8c.jpg\">\n[/image-gallery]", "title"=>"testiaaanaskffgbkvb", "is_warning"=>"false", "archetype"=>"regular"}
Completed 500 Internal Server Error in 81ms
PrettyText::JavaScriptError (Object [/image-gallery] has no method 'exec'):
lib/pretty_text.rb:165:in `block in markdown'
lib/pretty_text.rb:330:in `block in protect'
lib/pretty_text.rb:328:in `synchronize'
lib/pretty_text.rb:328:in `protect'
lib/pretty_text.rb:146:in `markdown'
lib/pretty_text.rb:198:in `cook'
app/models/post_analyzer.rb:12:in `cook'
app/models/post_analyzer.rb:104:in `cooked_document'
app/models/post_analyzer.rb:49:in `raw_mentions'
app/models/post.rb:154:in `block (2 levels) in <class:Post>'
lib/validators/post_validator.rb:40:in `max_mention_validator'
lib/validators/post_validator.rb:10:in `validate'
lib/post_creator.rb:258:in `save_post'
lib/post_creator.rb:81:in `block in create'
lib/post_creator.rb:140:in `call'
lib/post_creator.rb:140:in `block in transaction'
lib/post_creator.rb:138:in `transaction'
lib/post_creator.rb:76:in `create'
app/controllers/posts_controller.rb:80:in `create_post'
app/controllers/posts_controller.rb:65:in `create'
lib/middleware/anonymous_cache.rb:119:in `call'
config/initializers/quiet_logger.rb:10:in `call_with_quiet_assets'
config/initializers/silence_logger.rb:26:in `call'
lib/middleware/unicorn_oobgc.rb:95:in `process_client'
Sorry all for not keeping this updated. I’ll be glad to get it updated when I get a chance, or merge any pull requests if someone else wants to fix it. Would love to get back into making some other Discourse plugins.
Great. If you don’t hear from @crob611 in a week or so we can point to your fork instead of the defunct repo and move this out of #plugin:broken-plugin, provided someone else confirm that it’s working!
I can merge it in, but I’m not setup to test to make sure it’s working or anything. I’d also be glad to transfer the repo if someone else would like to maintain it going forward. @chasovoy85?