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