discourse/plugins/discourse-hcaptcha/plugin.rb
Kris 59d53dc18a
UX: add admin sidebar icons for preinstalled plugins (#36764)
Currently all our preinstalled plugins use the default "gear" icon from
fontawesome — this PR adds unique icons for each of them using a new
plugin API method, `setAdminPluginIcon()`. Plugins without an icon
defined will still fall back to the gear icon.


Before:
<img width="250" alt="image"
src="https://github.com/user-attachments/assets/06b5c6e7-0aae-44f8-b8ee-1486b98bfc6b"
/>


After: 
<img width="250" alt="image"
src="https://github.com/user-attachments/assets/46d45d4b-6c75-4473-ae53-1a0e71c4d6fb"
/>
2025-12-18 16:39:00 -05:00

29 lines
802 B
Ruby

# coding: utf-8
# frozen_string_literal: true
# name: discourse-hcaptcha
# about: hCaptcha support for Discourse
# version: 0.0.1
# authors: Discourse
# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-hcaptcha
# required_version: 2.7.0
# meta_topic_id: 291383
enabled_site_setting :discourse_hcaptcha_enabled
register_svg_icon "hand"
extend_content_security_policy(script_src: %w[https://hcaptcha.com])
module ::DiscourseHcaptcha
PLUGIN_NAME = "discourse-hcaptcha"
end
require_relative "lib/discourse_hcaptcha/engine"
after_initialize do
reloadable_patch { UsersController.include(DiscourseHcaptcha::CreateUsersControllerPatch) }
require_relative "app/services/problem_check/hcaptcha_configuration"
register_problem_check ProblemCheck::HcaptchaConfiguration
end