diff --git a/README.md b/README.md index ed92050ff..a0e07ea17 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,12 @@ For Apache, registry admin goes to port 443 in production, /etc/apache2/sites-en SSLCipherSuite RC4-SHA:HIGH:!ADH - 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 diff --git a/app/assets/images/alpha.png b/app/assets/images/alpha.png new file mode 100644 index 000000000..c3f1bf12d Binary files /dev/null and b/app/assets/images/alpha.png differ diff --git a/app/assets/images/development.png b/app/assets/images/development.png new file mode 100644 index 000000000..1dd9fb7b5 Binary files /dev/null and b/app/assets/images/development.png differ diff --git a/app/assets/images/staging.png b/app/assets/images/staging.png new file mode 100644 index 000000000..fcb408e19 Binary files /dev/null and b/app/assets/images/staging.png differ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be7945..a7942966a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/views/layouts/application.haml b/app/views/layouts/application.haml index a7e4a80e9..487098041 100644 --- a/app/views/layouts/application.haml +++ b/app/views/layouts/application.haml @@ -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