mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
refactored current_env to unstable_env
This commit is contained in:
parent
baa81be726
commit
dba57fde9d
2 changed files with 7 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue