gitlab-org--gitlab-foss/lib/gitlab/theme.rb

40 lines
914 B
Ruby
Raw Normal View History

module Gitlab
class Theme
BASIC = 1 unless const_defined?(:BASIC)
MARS = 2 unless const_defined?(:MARS)
MODERN = 3 unless const_defined?(:MODERN)
GRAY = 4 unless const_defined?(:GRAY)
COLOR = 5 unless const_defined?(:COLOR)
2015-03-12 00:29:11 -04:00
BLUE = 6 unless const_defined?(:BLUE)
def self.css_class_by_id(id)
2012-11-20 23:14:05 -05:00
themes = {
BASIC => "ui_basic",
MARS => "ui_mars",
MODERN => "ui_modern",
GRAY => "ui_gray",
2015-03-12 00:29:11 -04:00
COLOR => "ui_color",
BLUE => "ui_blue"
}
id ||= Gitlab.config.gitlab.default_theme
2015-03-24 21:35:57 -04:00
themes[id]
end
2014-12-14 20:01:59 -05:00
def self.type_css_class_by_id(id)
types = {
BASIC => 'light_theme',
MARS => 'dark_theme',
MODERN => 'dark_theme',
GRAY => 'dark_theme',
COLOR => 'dark_theme'
}
id ||= Gitlab.config.gitlab.default_theme
types[id]
end
end
end