plugin.rb 909 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 "video"
  10. after_initialize do
  11. [
  12. "../app/controllers/bbb_client_controller",
  13. ].each { |path| require File.expand_path(path, __FILE__) }
  14. module ::BigBlue
  15. PLUGIN_NAME ||= "discourse-bbb".freeze
  16. class Engine < ::Rails::Engine
  17. engine_name BigBlue::PLUGIN_NAME
  18. isolate_namespace BigBlue
  19. end
  20. end
  21. BigBlue::Engine.routes.draw do
  22. post '/create' => 'bbb_client#create', constraints: { format: :json }
  23. get '/status/:meeting_id' => 'bbb_client#status', constraints: { format: :json }
  24. end
  25. Discourse::Application.routes.append do
  26. mount ::BigBlue::Engine, at: "/bbb"
  27. end
  28. end