mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 18:53:53 +08:00
UX: Add image uploader widget for uploading badge images (#12377)
Currently the process of adding a custom image to badge is quite clunky; you have to upload your image to a topic, and then copy the image URL and pasting it in a text field. Besides being clucky, if the topic or post that contains the image is deleted, the image will be garbage-collected in a few days and the badge will lose the image because the application is not that the image is referenced by a badge. This commit improves that by adding a proper image uploader widget for badge images.
This commit is contained in:
@ -9,7 +9,7 @@ class Admin::BadgesController < Admin::AdminController
|
||||
badge_types: BadgeType.all.order(:id).to_a,
|
||||
badge_groupings: BadgeGrouping.all.order(:position).to_a,
|
||||
badges: Badge.includes(:badge_grouping)
|
||||
.includes(:badge_type)
|
||||
.includes(:badge_type, :image_upload)
|
||||
.references(:badge_grouping)
|
||||
.order('badge_groupings.position, badge_type_id, badges.name').to_a,
|
||||
protected_system_fields: Badge.protected_system_fields,
|
||||
|
Reference in New Issue
Block a user