2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-04-16 15:56:18 -05:00
|
|
|
class TopicSubtype
|
|
|
|
include ActiveModel::Serialization
|
|
|
|
|
|
|
|
attr_accessor :id, :options
|
|
|
|
|
|
|
|
def initialize(id, options)
|
|
|
|
@id = id
|
|
|
|
@options = options
|
|
|
|
end
|
|
|
|
|
|
|
|
def attributes
|
2023-01-09 06:10:19 -06:00
|
|
|
{ "id" => @id, "options" => @options }
|
2013-04-16 15:56:18 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.list
|
|
|
|
return [] unless @archetypes.present?
|
|
|
|
@archetypes.values
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.user_to_user
|
2023-01-09 06:10:19 -06:00
|
|
|
"user_to_user"
|
2013-04-16 15:56:18 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.system_message
|
2023-01-09 06:10:19 -06:00
|
|
|
"system_message"
|
2013-04-16 15:56:18 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.moderator_warning
|
2023-01-09 06:10:19 -06:00
|
|
|
"moderator_warning"
|
2013-04-16 15:56:18 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.notify_moderators
|
2023-01-09 06:10:19 -06:00
|
|
|
"notify_moderators"
|
2013-04-16 15:56:18 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.notify_user
|
2023-01-09 06:10:19 -06:00
|
|
|
"notify_user"
|
2013-04-16 15:56:18 -05:00
|
|
|
end
|
|
|
|
|
2014-07-16 16:53:44 -05:00
|
|
|
def self.pending_users_reminder
|
2023-01-09 06:10:19 -06:00
|
|
|
"pending_users"
|
2014-07-16 16:53:44 -05:00
|
|
|
end
|
|
|
|
|
2017-07-27 20:20:09 -05:00
|
|
|
def self.register(name, options = {})
|
2013-04-16 15:56:18 -05:00
|
|
|
@subtypes ||= {}
|
|
|
|
@subtypes[name] = TopicSubtype.new(name, options)
|
|
|
|
end
|
|
|
|
|
2023-01-09 06:10:19 -06:00
|
|
|
register "user_to_user"
|
|
|
|
register "system_message"
|
|
|
|
register "moderator_warning"
|
|
|
|
register "notify_moderators"
|
|
|
|
register "notify_user"
|
2014-02-12 22:09:47 -06:00
|
|
|
end
|