added current env style

This commit is contained in:
Priit Tark 2015-01-16 12:00:40 +02:00
parent 5ddb7ff268
commit 0444b75fee
6 changed files with 23 additions and 10 deletions

View file

@ -123,7 +123,12 @@ For Apache, registry admin goes to port 443 in production, /etc/apache2/sites-en
SSLCipherSuite RC4-SHA:HIGH:!ADH
<Directory /app/registry/registry/current/public>
Require all granted
# comment out if Apache 2.4 or newer
Allow from all
# uncomment if Apache 2.4 or newer
# Require all granted
Options -MultiViews
</Directory>
</VirtualHost>

BIN
app/assets/images/alpha.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,2 +1,16 @@
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
end
def env_style
return '' if current_env.nil?
"background-image: url(#{image_path(current_env.to_s + '.png')});"
end
end

View file

@ -10,7 +10,7 @@
= javascript_include_tag 'application', 'data-turbolinks-track' => true
%link{href: "../../favicon.ico", rel: "icon"}/
%title Eesti Interneti SA
%body
%body{:style => env_style}
/ Static navbar
.navbar.navbar-inverse.navbar-static-top{role: "navigation"}
.container
@ -22,15 +22,9 @@
%span.icon-bar
= link_to root_path, class: 'navbar-brand' do
= APP_CONFIG['app_name']
- if request.host == 'registry.gitlab.eu'
- if current_env.present?
.text-center
%small{style: 'color: #0074B3;'} GITLAB STAGING
- elsif Rails.env.development?
.text-center
%small{style: 'color: #D10000;'}= Rails.env.upcase
- elsif Rails.env.staging?
.text-center
%small{style: 'color: #0074B3;'}= Rails.env.upcase
%small{style: 'color: #0074B3;'}= current_env
.navbar-collapse.collapse
%ul.nav.navbar-nav