diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index de4c2d5..b83a57e 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -267,7 +267,8 @@ center: _('Created using the %{application_name}. Last modified %{date}') % {application_name: Rails.configuration.branding[:application][:name], date: l(@plan.updated_at.to_date, formats: :short)}, font_size: 8, spacing: (Integer(@formatting[:margin][:bottom]) / 2) - 4, - right: '[page] of [topage]' + right: '[page] of [topage]', + encoding: 'utf8' } end end diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 3b65891..5afb8b1 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -21,7 +21,7 @@ else if user.nil? registered = false - User.invite!(email: params[:user]) + User.invite!({ email: params[:user] }, current_user) message = _('Invitation to %{email} issued successfully. \n') % {email: params[:user]} user = User.find_by(email: params[:user]) end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 8cde110..246602b 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -16,7 +16,10 @@ @user = user FastGettext.with_locale FastGettext.default_locale do mail(to: @role.user.email, - subject: _('A Data Management Plan in %{tool_name} has been shared with you') %{ :tool_name => Rails.configuration.branding[:application][:name] }) + subject: _('%{user_name} has shared a Data Management Plan with you in %{tool_name}') %{ + :user_name => @user.invited_by.name(false), + :tool_name => Rails.configuration.branding[:application][:name] + }) end end diff --git a/app/models/user.rb b/app/models/user.rb index 0bee5c5..065e740 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -281,7 +281,10 @@ # Override devise_invitable email title # -------------------------------------------------------------- def deliver_invitation(options = {}) - super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]})) + super(options.merge(subject: _('%{user_name} has shared a Data Management Plan with you in %{tool_name}') % { + user_name: self.invited_by.name(false), + tool_name: Rails.configuration.branding[:application][:name] + })) end ## # Case insensitive search over User model diff --git a/app/views/branded/home/_welcome.html.erb b/app/views/branded/home/_welcome.html.erb index 5c548da..d0314d7 100644 --- a/app/views/branded/home/_welcome.html.erb +++ b/app/views/branded/home/_welcome.html.erb @@ -1,8 +1,7 @@
- <%= raw _('
%{application_name} helps you to create, review, and share data management plans that meet institutional and funder requirements. It has been jointly developed by the Digital Curation Centre (DCC) and the University of California Curation Center (UC3).') % {:application_name => Rails.configuration.branding[:application][:name], :organisation_name => Rails.configuration.branding[:organisation][:name]} %> - + <%= raw _('
%{application_name} has been developed by the %{organisation_name} to help you write data management plans.
') % {:application_name => Rails.configuration.branding[:application][:name], :organisation_name => Rails.configuration.branding[:organisation][:name]} %> + -- <%= _('A colleague has invited you to contribute to their Data Management Plan in %{tool_name}') %{ :tool_name => tool_name } %> + <%= _('%{sender_name} has invited you to contribute to their Data Management Plan in %{tool_name}') %{ + :sender_name => sender_name, + :tool_name => tool_name + }%>
<%= raw(_('%{click_here} to accept the invitation, (or copy %{link} into your browser). If you don\'t want to accept the invitation, please ignore this email.') %{ :click_here => link_to(_('Click here'), link), :link => link }) %> diff --git a/app/views/user_mailer/sharing_notification.html.erb b/app/views/user_mailer/sharing_notification.html.erb index 1b4a0f1..3c555d4 100644 --- a/app/views/user_mailer/sharing_notification.html.erb +++ b/app/views/user_mailer/sharing_notification.html.erb @@ -1,5 +1,6 @@ <% tool_name = Rails.configuration.branding[:application][:name] + sender_name = @user.invited_by.name(false) user_email = @user.email link = url_for(action: 'show', controller: 'plans', id: @role.plan.id) %> @@ -8,7 +9,10 @@ <%= _('Hello %{user_email}') %{ :user_email => user_email } %>
- <%= _('A colleague has invited you to contribute to their Data Management Plan in %{tool_name}') %{ :tool_name => tool_name }%> + <%= _('%{sender_name} has invited you to contribute to their Data Management Plan in %{tool_name}') %{ + :sender_name => sender_name, + :tool_name => tool_name + }%>
<%= raw(_('%{click_here} to accept the invitation, (or copy %{link} into your browser). If you don\'t want to accept the invitation, please ignore this email.') %{ :click_here => link_to(_('Click here'), link), :link => link }) %> diff --git a/config/locale/dmpopidor.pot b/config/locale/dmpopidor.pot index e4c4bec..e27bbe0 100644 --- a/config/locale/dmpopidor.pot +++ b/config/locale/dmpopidor.pot @@ -49,4 +49,11 @@ msgstr "" msgid "You have the right of access, of correction, of portability, or of removal of this data, or of a limitation of their processing. You can oppose the processing of the data that concerns you and you have the right to withdraw your agreement at any time, by contacting: %{contact_url}. You can also direct a complaint at a controlling body." -msgstr "" \ No newline at end of file +msgstr "" + +msgid "%{user_name} has shared a Data Management Plan with you in %{tool_name}" +msgstr "" + +msgid "%{sender_name} has invited you to contribute to their Data Management Plan in %{tool_name}" +msgstr "" + diff --git a/config/locale/en_GB/dmpopidor.po b/config/locale/en_GB/dmpopidor.po index 8edf8e8..68f4d19 100644 --- a/config/locale/en_GB/dmpopidor.po +++ b/config/locale/en_GB/dmpopidor.po @@ -47,4 +47,10 @@ msgstr "The information collected that concerns you will be processed and is destined for the Inist-CNRS (UPS76) and the correspondent for Computing and Liberties (CIL). For the following goal: management of user accounts. The recipients of this data are the administrators of the Inist-CNRS. The duration of conservation of the data is 5 years following the last login." msgid "You have the right of access, of correction, of portability, or of removal of this data, or of a limitation of their processing. You can oppose the processing of the data that concerns you and you have the right to withdraw your agreement at any time, by contacting: %{contact_url}. You can also direct a complaint at a controlling body." -msgstr "You have the right of access, of correction, of portability, or of removal of this data, or of a limitation of their processing. You can oppose the processing of the data that concerns you and you have the right to withdraw your agreement at any time, by contacting: %{contact_url}. You can also direct a complaint at a controlling body." \ No newline at end of file +msgstr "You have the right of access, of correction, of portability, or of removal of this data, or of a limitation of their processing. You can oppose the processing of the data that concerns you and you have the right to withdraw your agreement at any time, by contacting: %{contact_url}. You can also direct a complaint at a controlling body." + +msgid "%{user_name} has shared a Data Management Plan with you in %{tool_name}" +msgstr "%{user_name} has shared a Data Management Plan with you in %{tool_name}" + +msgid "%{sender_name} has invited you to contribute to their Data Management Plan in %{tool_name}" +msgstr "%{sender_name} has invited you to contribute to their Data Management Plan in %{tool_name}" \ No newline at end of file diff --git a/config/locale/fr_FR/dmpopidor.po b/config/locale/fr_FR/dmpopidor.po index 5d10a14..b421077 100644 --- a/config/locale/fr_FR/dmpopidor.po +++ b/config/locale/fr_FR/dmpopidor.po @@ -46,4 +46,10 @@ msgstr "Les informations recueillies vous concernant vont faire l’objet d’un traitement destiné à l'Inist-CNRS (UPS76) et au correspondant Informatique et Libertés. Pour la finalité suivante : gestion des comptes des utilisateurs. Les destinataires de ces données sont les administrateurs DMP OPIDoR de l’Inist-CNRS. La durée de conservation des données est de 5 ans suite à la dernière connexion." msgid "You have the right of access, of correction, of portability, or of removal of this data, or of a limitation of their processing. You can oppose the processing of the data that concerns you and you have the right to withdraw your agreement at any time, by contacting: %{contact_url}. You can also direct a complaint at a controlling body." -msgstr "Vous bénéficiez d’un droit d’accès, de rectification, de portabilité, d’effacement de celles-ci ou une limitation du traitement. Vous pouvez vous opposer au traitement des données vous concernant et disposez du droit de retirer votre consentement à tout moment en vous adressant à %{contact_url}. Vous avez la possibilité d’introduire une réclamation auprès d’une autorité de contrôle." \ No newline at end of file +msgstr "Vous bénéficiez d’un droit d’accès, de rectification, de portabilité, d’effacement de celles-ci ou une limitation du traitement. Vous pouvez vous opposer au traitement des données vous concernant et disposez du droit de retirer votre consentement à tout moment en vous adressant à %{contact_url}. Vous avez la possibilité d’introduire une réclamation auprès d’une autorité de contrôle." + +msgid "%{user_name} has shared a Data Management Plan with you in %{tool_name}" +msgstr "%{user_name} a partagé un plan de gestion de données avec vous sur %{tool_name}" + +msgid "%{sender_name} has invited you to contribute to their Data Management Plan in %{tool_name}" +msgstr "%{sender_name} vous a invité à contribuer à son plan de gestion de données sur %{tool_name}" \ No newline at end of file