Class: Gitlab::Favicon
- Inherits:
-
Object
- Object
- Gitlab::Favicon
- Defined in:
- lib/gitlab/favicon.rb
Class Method Summary collapse
- .available_status_names ⇒ Object
- .ci_status_overlay(status_name) ⇒ Object
- .development_favicon ⇒ Object
- .main ⇒ Object
- .mr_status_overlay(status_name) ⇒ Object
Class Method Details
.available_status_names ⇒ Object
45 46 47 48 49 |
# File 'lib/gitlab/favicon.rb', line 45 def available_status_names @available_status_names ||= Dir.glob(Rails.root.join('app', 'assets', 'images', 'ci_favicons', '*.png')) .map { |file| File.basename(file, '.png') } .sort end |
.ci_status_overlay(status_name) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/gitlab/favicon.rb', line 27 def (status_name) path = File.join( 'ci_favicons', "#{status_name}.png" ) ActionController::Base.helpers.image_path(path, host: host) end |
.development_favicon ⇒ Object
21 22 23 24 25 |
# File 'lib/gitlab/favicon.rb', line 21 def development_favicon # This is a separate method so that EE can return a different favicon # for development environments. 'favicon-blue.png' end |
.main ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/gitlab/favicon.rb', line 6 def main image_name = if appearance.favicon.exists? appearance.favicon_path elsif Gitlab.canary? 'favicon-yellow.png' elsif Rails.env.development? development_favicon else 'favicon.png' end ActionController::Base.helpers.image_path(image_name, host: host) end |
.mr_status_overlay(status_name) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/gitlab/favicon.rb', line 36 def (status_name) path = File.join( 'mr_favicons', "#{status_name}.png" ) ActionController::Base.helpers.image_path(path, host: host) end |