refactored current_env to unstable_env

This commit is contained in:
Priit Tark 2015-01-16 13:12:04 +02:00
parent baa81be726
commit dba57fde9d
2 changed files with 7 additions and 12 deletions

View file

@ -1,16 +1,11 @@
module ApplicationHelper
def current_env
if request.host == 'registry.gitlab.eu'
:alpha
elsif request.host == 'testepp.internet.ee'
:staging
elsif Rails.env.development?
:development
end
def unstable_env
return nil if Rails.env.production?
Rails.env
end
def env_style
return '' if current_env.nil?
"background-image: url(#{image_path(current_env.to_s + '.png')});"
return '' if unstable_env.nil?
"background-image: url(#{image_path(unstable_env.to_s + '.png')});"
end
end

View file

@ -22,9 +22,9 @@
%span.icon-bar
= link_to root_path, class: 'navbar-brand' do
= APP_CONFIG['app_name']
- if current_env.present?
- if unstable_env.present?
.text-center
%small{style: 'color: #0074B3;'}= current_env
%small{style: 'color: #0074B3;'}= unstable_env
.navbar-collapse.collapse
%ul.nav.navbar-nav