mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
added current env style
This commit is contained in:
parent
5ddb7ff268
commit
0444b75fee
6 changed files with 23 additions and 10 deletions
BIN
app/assets/images/alpha.png
Normal file
BIN
app/assets/images/alpha.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
BIN
app/assets/images/development.png
Normal file
BIN
app/assets/images/development.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
app/assets/images/staging.png
Normal file
BIN
app/assets/images/staging.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue