Configure OSEM via environment variables

Instead of reading a yaml file we get configuration from the
environment.
This commit is contained in:
Henne Vogelsang 2016-03-22 18:14:40 +01:00
parent 45c31f210f
commit ebcb2780cd
17 changed files with 39 additions and 34 deletions

View file

@ -11,7 +11,7 @@
%legend
%span
=link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do
= CONFIG['name']
= ENV['OSEM_NAME'] || 'OSEM'
Account
%span.pull-right#account-already
=link_to('#signin', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do

View file

@ -1,4 +1,4 @@
- if !CONFIG['authentication']['ichain']['enabled']
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
= form_tag(new_user_session_path, class: 'form-horizontal') do
%legend
%span

View file

@ -7,7 +7,7 @@
%span.icon-bar
%span.icon-bar
%span.icon-bar
= link_to CONFIG['name'], root_path, class: 'navbar-brand', title: 'Open Source Event Manager'
= link_to (ENV['OSEM_NAME'] || 'OSEM'), root_path, class: 'navbar-brand', title: 'Open Source Event Manager'
.collapse.navbar-collapse
- if content_for :splash_nav
%ul.nav.navbar-nav#splash-nav
@ -43,7 +43,7 @@
%li= link_to 'See all Comments', admin_comments_path(anchor: 'all_comments')
- else
%ul.nav.navbar-nav.navbar-right
- if CONFIG['authentication']['ichain']['enabled']
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
%li{:class=> "#{active_nav_li(new_ichain_registration_path('user'))}"}
= link_to(new_ichain_registration_path('user')) do
%span.fa.fa-heart
@ -59,7 +59,7 @@
Sign In
%span.caret
.dropdown-menu{:style => "padding: 17px; min-width: 225px;"}
- if CONFIG['authentication']['ichain']['enabled']
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
= form_tag User.ichain_login_url do
= text_field_tag 'username', nil, id: 'user_ichain_email_dd', placeholder: 'Username'
= password_field_tag 'password', nil, id: 'user_ichain_password_dd', placeholder: 'Password'

View file

@ -1,4 +1,4 @@
- unless CONFIG['authentication']['ichain']['enabled']
- unless ENV['OSEM_ICHAIN_ENABLED'] == 'true'
%li
= link_to(edit_user_registration_path) do
%span.fa.fa-wrench
@ -13,7 +13,7 @@
%span.fa.fa-comment
My Submissions
%li
- if CONFIG['authentication']['ichain']['enabled']
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
= link_to(destroy_user_ichain_session_path, :method=>'delete') do
%span.fa.fa-minus
Sign out

View file

@ -2,7 +2,7 @@
%head
%meta{:charset => "utf-8"}
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"}
%title= content_for?(:title) ? yield(:title) : CONFIG['name']
%title= content_for?(:title) ? yield(:title) : (ENV['OSEM_NAME'] || 'OSEM')
%meta{:content => "", :name => "description"}
%meta{:content => "", :name => "author"}
= stylesheet_link_tag "application", :media => "all"
@ -11,7 +11,7 @@
= csrf_meta_tags
:javascript
window.liveSettings = {
api_key: "#{CONFIG['transifex_live_api_key']}",
api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}",
picker: "bottom-right",
detectlang: true,
autocollect: true

View file

@ -3,7 +3,7 @@
%head
%meta{:charset => "utf-8"}
%meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"}
%title= content_for?(:title) ? yield(:title) : CONFIG['name']
%title= content_for?(:title) ? yield(:title) : (ENV['OSEM_NAME'] || 'OSEM')
%meta{:content => "", :name => "description"}
%meta{:content => "", :name => "author"}
= stylesheet_link_tag "/stylesheets/schedule/jquery-ui-1.9.2.custom.min"
@ -17,4 +17,4 @@
= yield(:head)
%body
.content
= yield
= yield

View file

@ -12,7 +12,7 @@
%legend
%span
=link_to('#signup', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do
= CONFIG['name']
= ENV['OSEM_NAME'] || 'OSEM'
Account
%span.pull-right#account-already
=link_to('#signin', role: 'tab', 'aria-controls' => 'home', 'data-toggle' => 'tab') do