diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 5da69b3..3d9d60a 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -3,7 +3,7 @@
def edit
@user.create_default_preferences if @user.prefs == {}
- @languages = Language.all.order("name")
+ @languages = Language.sorted_by_abbreviation
@orgs = Org.where(parent_id: nil).order("name")
@other_organisations = Org.where(parent_id: nil, is_other: true).pluck(:id)
@identifier_schemes = IdentifierScheme.where(active: true).order(:name)
diff --git a/app/models/language.rb b/app/models/language.rb
index 2d02783..1d86727 100644
--- a/app/models/language.rb
+++ b/app/models/language.rb
@@ -11,4 +11,6 @@
scope :sorted_by_abbreviation, -> { all.order(:abbreviation) }
scope :default, -> { where(default_language: true).first }
+ # Retrieves the id for a given abbreviation of a language
+ scope :id_for, -> (abbreviation) { where(abbreviation: abbreviation).pluck(:id).first }
end
\ No newline at end of file
diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb
index 201002d..6be60ae 100644
--- a/app/views/devise/passwords/new.html.erb
+++ b/app/views/devise/passwords/new.html.erb
@@ -4,7 +4,7 @@
<%= _('The email address you entered is not registered.') %>
<% end %>
-<%= t('helpers.forgot_password') %>
+<%= _('Forgot your password?') %>
<%= _('Please enter your email below and we will send you instructions on how to reset your password.') %>
@@ -13,9 +13,8 @@
<% end %>
-
-
+
\ No newline at end of file
diff --git a/app/views/devise/registrations/_password_details.html.erb b/app/views/devise/registrations/_password_details.html.erb
index 9a93588..561f8d7 100644
--- a/app/views/devise/registrations/_password_details.html.erb
+++ b/app/views/devise/registrations/_password_details.html.erb
@@ -5,33 +5,29 @@
<%= hidden_field_tag :skip_personal_details, "true" %>
-
-
+ <%= f.label(:current_password, _('Current Password'), class: 'required') %>
+ <%= f.password_field(:current_password, class: 'left-indent required input-medium') %>
-
-
+ <%= f.label(:password, _('New Password'), class: 'required') %>
+ <%= f.password_field(:password, class: 'left-indent required input-medium', id: 'user_new_password') %>
-
-
+ <%= f.label(:password_confirmation, _('Password Confirmation'), class: 'required') %>
+ <%= f.password_field(:password_confirmation, class: 'left-indent required input-medium') %>
-
-
+ <%= label_tag(:password_show, _('Show passwords')) %>
+ <%= check_box_tag(:password_show, "1", false, class: 'left-indent') %>
diff --git a/app/views/devise/registrations/_personal_details.html.erb b/app/views/devise/registrations/_personal_details.html.erb
index 5ee124f..14d676a 100644
--- a/app/views/devise/registrations/_personal_details.html.erb
+++ b/app/views/devise/registrations/_personal_details.html.erb
@@ -16,47 +16,40 @@
<%= hidden_field_tag :skip_personal_details, "false" %>
-
-
+ <%= f.label(:email, _('Email'), class: 'required') %>
+ <%= f.email_field(:email, class: 'left-indent required input-medium',
+ title: _('Please enter your current password below when changing your email address.'),
+ value: @user.email) %>
-
-
+ <%= f.label(:firstname, _('First Name'), class: 'required') %>
+ <%= f.text_field(:firstname, class: 'input-small required left-indent', value: @user.firstname) %>
-
-
+ <%= f.label(:surname, _('Last Name'), class: 'required') %>
+ <%= f.text_field(:surname, class: 'input-small required left-indent', value: @user.surname) %>
-
-
+ <%= f.label(:recovery_email, _('Recovery Email'), class: 'required') %>
+ <%= f.email_field(:recovery_email, class: 'left-indent required input-medium',
+ title: _('This email will be used to recover your account if you change institutions'),
+ value: @user.recovery_email) %>
-
-
+ <%= f.label(:password, _('Password'), class: 'required') %>
+ <%= f.password_field(:password, class: 'left-indent required input-medium') %>