diff --git a/app/models/user.rb b/app/models/user.rb index 03c68ba..ca5d552 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -58,8 +58,7 @@ validates :prefs, presence: true - before_validation :create_default_preferences, if: Proc.new { |x| x.prefs.empty? } - ## user.prefs = create_default_preferences + before_create :create_default_preferences ## # Scopes diff --git a/app/views/devise/registrations/_personal_details.html.erb b/app/views/devise/registrations/_personal_details.html.erb index 2c54efa..7a0bd0a 100644 --- a/app/views/devise/registrations/_personal_details.html.erb +++ b/app/views/devise/registrations/_personal_details.html.erb @@ -1,115 +1,122 @@ -

- <%= _("Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.") %> -

- -
- <%= _('You can edit any of the details below.') %> +
+ +
+ <%= _('You can edit any of the details below.') %> - <%#= hidden_field_tag :unlink_flag, "false", id: "unlink_flag" %> + <%#= hidden_field_tag :unlink_flag, "false", id: "unlink_flag" %> -
- - - -
- -
- - -
-
- - -
- -
- - - -
- -
- - <%= render partial: "shared/accessible_combobox", - locals: {name: "#{resource_name}[org_name]", - id: "#{resource_name}_org_name", - default_selection: @default_org, - models: @orgs, - attribute: 'name', - classes: 'fixed-width-large left-indent'} %> -
- - <% if MANY_LANGUAGES %>
- <% lang = current_user.language.nil? ? FastGettext.default_locale : current_user.language.abbreviation %> - - + + +
- <% end %> - <% @identifier_schemes.each do |scheme| %> - <% - if scheme.name != 'shibboleth' || - (scheme.name == 'shibboleth' && Rails.application.config.shibboleth_enabled) - %> +
+ + +
+
+ + +
+ +
+ + + +
+ +
+ + <%= render partial: "shared/accessible_combobox", + locals: {name: "#{resource_name}[org_name]", + id: "#{resource_name}_org_name", + default_selection: @default_org, + models: @orgs, + attribute: 'name', + classes: 'fixed-width-large left-indent'} %> +
+ + <% if MANY_LANGUAGES %>
- -
- <%= render partial: 'external_identifier', - locals: {scheme: scheme, - id: current_user.identifier_for(scheme)} %> -
+ <% lang = current_user.language.nil? ? FastGettext.default_locale : current_user.language.abbreviation %> + +
<% end %> - <% end %> - <% unless @user.api_token.blank? %> -
- <%= f.label :api_token, _('API token') %> -
<%= @user.api_token %>
+ <% @identifier_schemes.each do |scheme| %> + <% + if scheme.name != 'shibboleth' || + (scheme.name == 'shibboleth' && Rails.application.config.shibboleth_enabled) + %> +
+ +
+ <%= render partial: 'external_identifier', + locals: {scheme: scheme, + id: current_user.identifier_for(scheme)} %> +
+
+ <% end %> + <% end %> - -
<%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%>
+ <% unless @user.api_token.blank? %> +
+ <%= f.label :api_token, _('API token') %> +
<%= @user.api_token %>
+ + +
<%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%>
+
+ <% end %> +
+ + + + +
- - - - - + +
+

+ <%= _("Please note that your email address is used as your username. + If you change this, remember to use your new email address on sign in.") %> +

+
+ diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index db16237..7bd4782 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -17,12 +17,12 @@
-
<%= render partial: 'devise/registrations/personal_details', f: f %>
- @@ -36,7 +36,7 @@
-
+
<%= render partial: 'shared/accessible_submit_button', locals: {id: 'update', @@ -44,6 +44,30 @@ disabled_initially: true, classes: 'small-input-button', tooltip: _('Enter all of the required information above')} %> + <%= link_to 'Cancel', '#', style: 'text-decoration:none;' %>
<% end %> -
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/app/views/users/_notification_preferences.html.erb b/app/views/users/_notification_preferences.html.erb index 603b6df..7dae888 100644 --- a/app/views/users/_notification_preferences.html.erb +++ b/app/views/users/_notification_preferences.html.erb @@ -4,50 +4,34 @@

All Users

- - - <%#= check_box_tag 'prefs[users][permission_granted]', true, @user.prefs[:users][:permission_granted] %> - <%#= label_tag 'prefs[users][permission_granted]', 'New permissions granted to me', :class => 'checkbox-label' %> + <%= check_box_tag 'prefs[users][permission_granted]', true, @user.prefs[:users][:permission_granted] %> + <%= label_tag 'prefs[users][permission_granted]', 'New permissions granted to me', :class => 'checkbox-label' %>
- - - <%#= check_box_tag 'prefs[users][new_comment]', true, @user.prefs[:users][:new_comment] %> - <%#= label_tag 'prefs[users][new_comment]', 'A new comment has been added to my DMP', :class => 'checkbox-label' %> + <%= check_box_tag 'prefs[users][new_comment]', true, @user.prefs[:users][:new_comment] %> + <%= label_tag 'prefs[users][new_comment]', 'A new comment has been added to my DMP', :class => 'checkbox-label' %>

DMP owners and co-owners

- - - <%#= check_box_tag 'prefs[owners_and_coowners][visibility_changed]', true, @user.prefs[:owners_and_coowners][:visibility_changed] %> - <%#= label_tag 'prefs[owners_and_coowners][visibility_changed]', "My DMP's visibility has changed", :class => 'checkbox-label' %> + <%= check_box_tag 'prefs[owners_and_coowners][visibility_changed]', true, @user.prefs[:owners_and_coowners][:visibility_changed] %> + <%= label_tag 'prefs[owners_and_coowners][visibility_changed]', "My DMP's visibility has changed", :class => 'checkbox-label' %>
- - - <%#= check_box_tag 'prefs[owners_and_coowners][user_added]', true, @user.prefs[:owners_and_coowners][:user_added] %> - <%#= label_tag 'prefs[owners_and_coowners][user_added]', 'I have been made a co-owner of a DMP', :class => 'checkbox-label' %> + <%= check_box_tag 'prefs[owners_and_coowners][user_added]', true, @user.prefs[:owners_and_coowners][:user_added] %> + <%= label_tag 'prefs[owners_and_coowners][user_added]', 'I have been made a co-owner of a DMP', :class => 'checkbox-label' %>

DMP administrators

- - - <%#= check_box_tag 'prefs[admins][template_published]', true, @user.prefs[:admins][:template_published] %> - <%#= label_tag 'prefs[admins][template_published]', 'An organisational template is published', :class => 'checkbox-label' %> + <%= check_box_tag 'prefs[admins][template_published]', true, @user.prefs[:admins][:template_published] %> + <%= label_tag 'prefs[admins][template_published]', 'An organisational template is published', :class => 'checkbox-label' %>
- - - <%#= check_box_tag 'prefs[admins][template_unpublished]', true, @user.prefs[:admins][:template_unpublished] %> - <%#= label_tag 'prefs[admins][template_unpublished]', 'An organisational template is unpublished', :class => 'checkbox-label' %> + <%= check_box_tag 'prefs[admins][template_unpublished]', true, @user.prefs[:admins][:template_unpublished] %> + <%= label_tag 'prefs[admins][template_unpublished]', 'An organisational template is unpublished', :class => 'checkbox-label' %>
diff --git a/lib/assets/stylesheets/roadmap-tabs.scss b/lib/assets/stylesheets/roadmap-tabs.scss index bd781df..a2e6842 100644 --- a/lib/assets/stylesheets/roadmap-tabs.scss +++ b/lib/assets/stylesheets/roadmap-tabs.scss @@ -2,7 +2,7 @@ /* Roadmap Tab Styling */ /* ------------------------------------------------ */ -.tabs #user_profile.tabs { +.tabs { list-style: none; margin: 0; @@ -29,7 +29,7 @@ background-color: $white; } } -.tabs:after #user_profile.tabs:after { +.tabs:after { visibility: hidden; display: block; font-size: 0; @@ -37,11 +37,11 @@ clear: both; height: 0; } -.tab-panels #user_profile.tab-panels { +.tab-panels { position: relative; - min-height: 400px; + min-height: 350px; } -.tabbed-area div.tab-panel #user_profile.tabbed-area #user-profile.tab-panel { +.tabbed-area div.tab-panel { padding: 10px 10px; min-height: 300px; position: absolute; @@ -49,6 +49,6 @@ left: 0; width: 100%; } -.tab-panel div.active #user_profile.tab-panel { +.tab-panel div.active { z-index: 1; } \ No newline at end of file diff --git a/lib/assets/stylesheets/roadmap.scss b/lib/assets/stylesheets/roadmap.scss index 55d8802..2a645da 100644 --- a/lib/assets/stylesheets/roadmap.scss +++ b/lib/assets/stylesheets/roadmap.scss @@ -97,4 +97,4 @@ height: 17px; margin: 0 4px 0 0; padding: 0; -} +} \ No newline at end of file