debian-mirror-gitlab/lib/gitlab/theme.rb

40 lines
914 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
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-04-26 12:48:37 +05:30
BLUE = 6 unless const_defined?(:BLUE)
2014-09-02 18:07:02 +05:30
def self.css_class_by_id(id)
themes = {
BASIC => "ui_basic",
MARS => "ui_mars",
MODERN => "ui_modern",
GRAY => "ui_gray",
2015-04-26 12:48:37 +05:30
COLOR => "ui_color",
BLUE => "ui_blue"
2014-09-02 18:07:02 +05:30
}
id ||= Gitlab.config.gitlab.default_theme
2015-04-26 12:48:37 +05:30
themes[id]
end
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]
2014-09-02 18:07:02 +05:30
end
end
end