diff --git a/app/models/user.rb b/app/models/user.rb index 08ed05b..08f6317 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -292,16 +292,17 @@ def self.create_default_preferences default_prefs = { users: { - permission_granted: true, - new_comment: true + new_comment: true, + admin_privileges: true, + added_as_coowner: true }, owners_and_coowners: { - visibility_changed: true, - user_added: true + visibility_changed: true }, admins: { template_published: true, - template_unpublished: true + template_unpublished: true, + feedback_requested: true } } end diff --git a/app/views/devise/registrations/_external_identifier.html.erb b/app/views/devise/registrations/_external_identifier.html.erb deleted file mode 100644 index 226b270..0000000 --- a/app/views/devise/registrations/_external_identifier.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -
- <% if id.nil? || id.identifier == '' %> - <%= link_to "#{_("Link account with #{scheme.description} ID")}", - Rails.application.routes.url_helpers.send( - "user_#{scheme.name.downcase}_omniauth_authorize_path" - ), - title: t("identifier_schemes.schemes.#{scheme.name}.connect_tooltip", default: "") - %> - <% else %> - <% if scheme.user_landing_url.nil? %> - <%= _("Your account has been linked to #{scheme.description}.") %> - <% else %> - <%= link_to "#{_("Your account has been linked to #{scheme.description}.")}", "#{scheme.user_landing_url}/#{id.identifier}", target: '_blank', - title: t("identifier_schemes.schemes.#{scheme.name}.connect_tooltip", default: "") %> - <% end %> - <%= link_to ''.html_safe, - destroy_user_identifier_path(id), method: :delete, - title: _("Unlink your account from #{scheme.description}. You can link again at any time."), - data: {confirm: _("Are you sure you want to unlink #{scheme.description} ID?")} %> - <% end %> -
diff --git a/app/views/devise/registrations/_external_identifier_orcid.html.erb b/app/views/devise/registrations/_external_identifier_orcid.html.erb new file mode 100644 index 0000000..2ba5cf0 --- /dev/null +++ b/app/views/devise/registrations/_external_identifier_orcid.html.erb @@ -0,0 +1,15 @@ +
+ <% if id.nil? || id.identifier == '' %> + <%= link_to 'Create or Connect your Orcid iD', Rails.application.routes.url_helpers.send("user_#{scheme.name.downcase}_omniauth_authorize_path"), id:"connect-orcid-button", target: '_blank', title: t("identifier_schemes.schemes.#{scheme.name}.connect_tooltip", default: "") %> + <% else %> + <% if scheme.user_landing_url.nil? %> + <%= _("Your account has been linked to #{scheme.description}.") %> + <% else %> + <%= link_to (image_tag("#{scheme.logo_url}", id: 'orcid-id-logo')) + "#{scheme.user_landing_url}/#{id.identifier}", "#{scheme.user_landing_url}/#{id.identifier}", id: 'orcid-id', target: '_blank', title: t("identifier_schemes.schemes.#{scheme.name}.connect_tooltip", default: "") %> + <% end %> + <%= link_to ''.html_safe, + destroy_user_identifier_path(id), method: :delete, + title: _("Unlink your account from #{scheme.description}. You can link again at any time."), + data: {confirm: _("Are you sure you want to unlink #{scheme.description} ID?")} %> + <% end %> +
\ No newline at end of file diff --git a/app/views/devise/registrations/_external_identifier_shibboleth.html.erb b/app/views/devise/registrations/_external_identifier_shibboleth.html.erb new file mode 100644 index 0000000..39078c1 --- /dev/null +++ b/app/views/devise/registrations/_external_identifier_shibboleth.html.erb @@ -0,0 +1,21 @@ +
+ <% if id.nil? || id.identifier == '' %> + <%= link_to "#{_("Link account with #{scheme.description} ID")}", + Rails.application.routes.url_helpers.send( + "user_#{scheme.name.downcase}_omniauth_authorize_path" + ), + title: t("identifier_schemes.schemes.#{scheme.name}.connect_tooltip", default: "") + %> + <% else %> + <% if scheme.user_landing_url.nil? %> + <%= _("Your account has been linked to #{scheme.description}.") %> + <% else %> + <%= link_to "#{_("Your account has been linked to #{scheme.description}.")}", "#{scheme.user_landing_url}/#{id.identifier}", target: '_blank', + title: t("identifier_schemes.schemes.#{scheme.name}.connect_tooltip", default: "") %> + <% end %> + <%= link_to ''.html_safe, + destroy_user_identifier_path(id), method: :delete, + title: _("Unlink your account from #{scheme.description}. You can link again at any time."), + data: {confirm: _("Are you sure you want to unlink #{scheme.description} ID?")} %> + <% end %> +
\ No newline at end of file diff --git a/app/views/devise/registrations/_personal_details.html.erb b/app/views/devise/registrations/_personal_details.html.erb index 2b9e5e6..1b2194d 100644 --- a/app/views/devise/registrations/_personal_details.html.erb +++ b/app/views/devise/registrations/_personal_details.html.erb @@ -12,7 +12,7 @@
<%= _('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" %>
@@ -73,25 +73,20 @@ <% end %> <% @identifier_schemes.each do |scheme| %> - <% - if scheme.name != 'shibboleth' || - (scheme.name == 'shibboleth' && Rails.application.config.shibboleth_enabled) - %>
- + <% if scheme.name == 'shibboleth' || Rails.application.config.shibboleth_enabled %> + + <% else %> + + <% end %>
- <%= render partial: 'external_identifier', - locals: {scheme: scheme, - id: current_user.identifier_for(scheme)} %> + <%= render partial: "external_identifier_#{scheme.name}", + locals: { scheme: scheme, + id: current_user.identifier_for(scheme)} %>
- <% end %> <% end %> <% unless @user.api_token.blank? %> @@ -130,7 +125,4 @@ <%= _('Cancel') %> <%= _('Unlink account') %>
- - - - + \ 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 d26aa69..9b79290 100644 --- a/app/views/users/_notification_preferences.html.erb +++ b/app/views/users/_notification_preferences.html.erb @@ -10,25 +10,25 @@ <%= hidden_field_tag :user_id, @user.id %>

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][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][added_as_coowner]', true, @user.prefs[:users][:added_as_coowner] %> + <%= label_tag 'prefs[users][added_as_coowner]', 'A plan has been shared with me', :class => 'checkbox-label' %> +
+
+ <%= check_box_tag 'prefs[users][admin_privileges]', true, @user.prefs[:users][:admin_privileges] %> + <%= label_tag 'prefs[users][admin_privileges]', 'Admin privileges granted to me', :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][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

@@ -40,7 +40,12 @@ <%= 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][feedback_requested]', true, @user.prefs[:admins][:feedback_requested] %> + <%= label_tag 'prefs[admins][feedback_requested]', 'A user has requested feedback on a DMP', :class => 'checkbox-label' %> +
+
<%= submit_tag 'Save', class: 'btn btn-primary' %> diff --git a/lib/assets/stylesheets/roadmap-tabs.scss b/lib/assets/stylesheets/roadmap-tabs.scss index 0b386fd..e84fa4a 100644 --- a/lib/assets/stylesheets/roadmap-tabs.scss +++ b/lib/assets/stylesheets/roadmap-tabs.scss @@ -43,11 +43,11 @@ } .tab-panels { position: relative; - min-height: 350px; + min-height: 400px; } .tabbed-area div.tab-panel { padding: 10px 10px; - min-height: 400px; + min-height: 300px; position: absolute; top: -1px; left: 0; diff --git a/lib/assets/stylesheets/roadmap.scss b/lib/assets/stylesheets/roadmap.scss index be91597..a8ad212 100644 --- a/lib/assets/stylesheets/roadmap.scss +++ b/lib/assets/stylesheets/roadmap.scss @@ -169,4 +169,44 @@ height: 17px; margin: 0 4px 0 0; padding: 0; +} + +/* ================================================ */ +/* Orcid Component Styling */ +/* ================================================ */ + +#connect-orcid-button{ + border: 1px solid #D3D3D3; + padding: 5px 5px 5px 20px; + background-color: #fff; + border-radius: 8px; + box-shadow: 1px 1px 3px #999; + cursor: pointer; + color: #999; + font-weight: bold; + font-size: .8em; + line-height: 24px; + text-decoration: none; + vertical-align: right; + background-image: url('http://orcid.org/sites/default/files/images/orcid_16x16.png'); + background-repeat: no-repeat; + background-position: left 5px; +} + +#connect-orcid-button:hover{ + border: 1px solid #338caf; + color: #338caf; +} + +#orcid-id-logo{ + display: inline-block; + vertical-align: middle; + margin: 0; + padding: 3px; + float: left; +} + +#orcid-id { + color: #338caf; + text-decoration: none; } \ No newline at end of file