Skip to content

1648 create download area for sharepics - #1665

Merged
zaziemo merged 10 commits into
mainfrom
1648-create-download-area-for-sharepics
Nov 25, 2026
Merged

zaziemo merged 10 commits into
mainfrom
1648-create-download-area-for-sharepics

Conversation

@zaziemo

@zaziemo zaziemo commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Add an area for sharepics that can be added by admins and downloaded by everyone who knows the link.

Users download sharepics on a public page at /sharepics (or /de/sharepics / /en/sharepics). Right now nothing on the site links to that page, so people can only reach it if they know the URL.

How it works:

  1. An admin uploads a sharepic and ticks published. Only published sharepics are shown (Sharepic.published in app/controllers/sharepics_controller.rb:5).
  2. The page /sharepics (app/views/sharepics/index.html.erb) shows each published sharepic as a card with a thumbnail, title, description and a Download button.
  3. The button points to /sharepics/:id/download. That route redirects to the Active Storage file with disposition: :attachment, so the browser saves the original image instead of opening it (app/controllers/sharepics_controller.rb:8-11).

Issue #1648

zaziemo and others added 8 commits November 22, 2026 20:53
Add Sharepic model with Active Storage image, a login-protected
download page, admin CRUD, navigation links, DE/EN locales and specs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Redirect downloads via rails_blob_path instead of image.url, which
raises with the Disk service outside Active Storage controllers.
Pass the locale explicitly in the request specs because of the
optional (:locale) route scope.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rails 8.1 uses the vips variant processor by default, but the image
only shipped ImageMagick, so variants (e.g. sharepic thumbnails)
could not be generated in development.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Remove the login requirement from the sharepics index and download.
Unpublished sharepics stay hidden.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@zaziemo
zaziemo marked this pull request as ready for review November 23, 2026 08:18
@zaziemo
zaziemo requested a review from tyranja November 23, 2026 08:18
@zaziemo
zaziemo merged commit 066fd17 into main Nov 25, 2026
1 check passed
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