diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b2f7983..6564cb5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -32,8 +32,8 @@ I18n.locale = Language.find_by_id(current_user[:language_id]).abbreviation # if user has set preferred language use it - elsif user_signed_in? and current_user.organisation.present? and !current_user.organisation[:language_id].nil? - I18n.locale = Language.find_by_id(current_user.organisation[:language_id]).abbreviation + elsif user_signed_in? and current_user.org.present? and !current_user.org[:language_id].nil? + I18n.locale = Language.find_by_id(current_user.org[:language_id]).abbreviation # use user's organization language, keep in mine the "OTHER ORG" edge case which should use default language else diff --git a/app/models/user.rb b/app/models/user.rb index 10bedfe..11b482e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -37,7 +37,7 @@ accepts_nested_attributes_for :roles attr_accessible :password_confirmation, :encrypted_password, :remember_me, :id, :email, :firstname, :last_login,:login_count, :orcid_id, :password, :shibboleth_id, - :user_status_id, :surname, :user_type_id, :organisation_id, :skip_invitation, + :user_status_id, :surname, :user_type_id, :org_id, :skip_invitation, :other_organisation, :accept_terms, :role_ids, :dmponline3, :api_token, :organisation, :language, :language_id diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index dd293f1..ea455c7 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -37,7 +37,7 @@ <%= t("helpers.org_type.organisation") %> <%= collection_select(:user, - :organisation_id, Org.where("parent_id IS NULL").order("name"), + :org_id, Org.where("parent_id IS NULL").order("name"), :id, :name, {include_blank: constant("organisation_types.organisation")}, { :class => "typeahead org_sign_up" }) %> diff --git a/app/views/layouts/_branding.html.erb b/app/views/layouts/_branding.html.erb index 7c436ff..4774bee 100644 --- a/app/views/layouts/_branding.html.erb +++ b/app/views/layouts/_branding.html.erb @@ -1,19 +1,19 @@
<% if user_signed_in? %> - <% if !current_user.organisation.nil? %> + <% if !current_user.org.nil? %> - <% if current_user.organisation.logo.present? %> + <% if current_user.org.logo.present? %> <% end %> - <% if current_user.organisation.banner_text.present? %> + <% if current_user.org.banner_text.present? %>
- <%= raw current_user.organisation.banner_text %> + <%= raw current_user.org.banner_text %>
<%end%>