plugin.rb 942 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # frozen_string_literal: true
  2. # name: discourse-bbb
  3. # about: Integrate BigBlueButton in Discourse.
  4. # version: 1.0.0
  5. # authors: Penar Musaraj
  6. # url: https://github.com/pmusaraj/discourse-bbb
  7. enabled_site_setting :bbb_enabled
  8. register_asset "stylesheets/common/bbb.scss"
  9. register_svg_icon "fab-bootstrap"
  10. register_svg_icon "video"
  11. after_initialize do
  12. [
  13. "../app/controllers/bbb_client_controller",
  14. ].each { |path| require File.expand_path(path, __FILE__) }
  15. module ::BigBlue
  16. PLUGIN_NAME ||= "discourse-bbb".freeze
  17. class Engine < ::Rails::Engine
  18. engine_name BigBlue::PLUGIN_NAME
  19. isolate_namespace BigBlue
  20. end
  21. end
  22. BigBlue::Engine.routes.draw do
  23. post '/create' => 'bbb_client#create', constraints: { format: :json }
  24. get '/status/:meeting_id' => 'bbb_client#status', constraints: { format: :json }
  25. end
  26. Discourse::Application.routes.append do
  27. mount ::BigBlue::Engine, at: "/bbb"
  28. end
  29. end