From 32b14845c130a2739b00748e5c49871f5b92ef40 Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Fri, 21 Jul 2023 10:43:02 -0600 Subject: [PATCH 1/7] Fix issue #355 #trivial --- app/helpers/application_helper.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5a14260995..88e0456042 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -58,37 +58,37 @@ def current_locale_logo # we need different urls. This will be changed when we move to DMPRoadmap 3.0 # as there is a service that handles fetching this information. def contact_us_path - if I18n.locale == 'fr_CA' + if I18n.locale == :'fr-CA' 'https://portagenetwork.ca/fr/contactez-nous/' else - # Handling "en_CA" locale + # Handling :'en-CA' locale 'https://portagenetwork.ca/contact-us/' end end def terms_of_use_path - if I18n.locale == 'fr_CA' + if I18n.locale == :'fr-CA' 'https://portagenetwork.ca/fr/outils-et-ressources/assistant-pgd/conditions-dutilisation-de-lassistant-pgd/' else - # Handling "en_CA" locale + # Handling :'en-CA' locale 'https://assistant.portagenetwork.ca/terms' end end def how_to_manage_your_data_path - if I18n.locale == 'fr_CA' + if I18n.locale == :'fr-CA' 'https://portagenetwork.ca/fr/outils-et-ressources/assistant-pgd/comment-gerer-vos-donnees/' else - # Handling "en_CA" locale + # Handling :'en-CA' locale 'https://portagenetwork.ca/tools-and-resources/dmp-assistant/how-to-manage-your-data/' end end def contacts_at_your_instutution_path - if I18n.locale == 'fr_CA' + if I18n.locale == :'fr-CA' 'https://alliancecan.ca/fr/services/gestion-des-donnees-de-recherche/apprentissage-et-ressources/personnes-ressources-dans-les-etablissements' else - # Handling "en_CA" locale + # Handling :'en-CA' locale 'https://alliancecan.ca/en/services/research-data-management/learning-and-training/institutional-contacts' end end From 8a7dc020f427ee8ea3d5ba83ad5ee5facbae2e5f Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Fri, 21 Jul 2023 12:26:37 -0600 Subject: [PATCH 2/7] Delete comment We will not be using the provided LocaleService. Thus, issue #390 can be closed. --- app/helpers/application_helper.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 88e0456042..4447faaa85 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -53,10 +53,6 @@ def current_locale_logo end end - # We are overriding this method in order to provide different contact us urls - # based on the chosen locale. Using the branding.yml does not work for this as - # we need different urls. This will be changed when we move to DMPRoadmap 3.0 - # as there is a service that handles fetching this information. def contact_us_path if I18n.locale == :'fr-CA' 'https://portagenetwork.ca/fr/contactez-nous/' From aedc50ce5bd74bf87afc10597230ae8eafd7404e Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Fri, 21 Jul 2023 12:43:52 -0600 Subject: [PATCH 3/7] Make example text a bit clearer --- app/helpers/application_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4447faaa85..4920619ca4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -42,9 +42,9 @@ def title(page_title) content_for(:title) { page_title } end - # This method assumes there will be an image file called dmp_logo_xx_XX.png - # Where xx_XX is the current locale in ww-WW format. Examples of this are - # en_CA, fr_CA + # This method assumes there will be an image file called dmp_logo_xx-XX.png + # where xx-XX is the string formatted I18n.locale. + # e.g. if I18n.locale == :'en_CA', then "#{I18n.locale}" == 'en-CA' def current_locale_logo if FeatureFlagHelper.enabled?(:on_sandbox) "sandbox_logo_#{I18n.locale}.png" From 48a7b235148a9d508fc4fc3454c1672ae43a3fe7 Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:43:40 -0600 Subject: [PATCH 4/7] Fix issue #397 Commit affects how "Terms of Use" is routed in footer and how "How to Manage Your Data" is routed on homepage. --- app/views/home/_welcome.html.erb | 2 +- app/views/layouts/_footer.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home/_welcome.html.erb b/app/views/home/_welcome.html.erb index 1cf4827fb8..ac6cd0fa00 100644 --- a/app/views/home/_welcome.html.erb +++ b/app/views/home/_welcome.html.erb @@ -32,7 +32,7 @@ Primer – Data Management Plan
  • - How to Manage Your Data + How to Manage Your Data
  • Tutorial Videos: diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 71944a40cd..274442c606 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -68,7 +68,7 @@ }, Rails.configuration.branding[:organisation][:url])%>
  • <%= _('Contact us') %>
  • -
  • <%= _('Terms of use') %>
  • +
  • <%= _('Terms of use') %>
  • <%= _('Privacy statement') %>
  • <%= _('GitHub') %>
  • From f2e9db110f05b066dc2f19b3efa0627e74c87254 Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:54:06 -0600 Subject: [PATCH 5/7] Set terms_of_use_path to only return '/terms' This is a temporary change until the corresponding French terms route is available. --- app/helpers/application_helper.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4920619ca4..48dd2b669b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -62,13 +62,16 @@ def contact_us_path end end + # Regardless of locale, we are currently only routing to '/terms' + # This will be changed when the French terms route is made available def terms_of_use_path - if I18n.locale == :'fr-CA' - 'https://portagenetwork.ca/fr/outils-et-ressources/assistant-pgd/conditions-dutilisation-de-lassistant-pgd/' - else - # Handling :'en-CA' locale - 'https://assistant.portagenetwork.ca/terms' - end + 'https://assistant.portagenetwork.ca/terms' + # if I18n.locale == :'fr-CA' + # 'https://portagenetwork.ca/fr/outils-et-ressources/assistant-pgd/conditions-dutilisation-de-lassistant-pgd/' + # else + # # Handling :'en-CA' locale + # 'https://assistant.portagenetwork.ca/terms' + # end end def how_to_manage_your_data_path From 20d307c44c7a2b3bedb5470449b72f46472ad503 Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Mon, 24 Jul 2023 11:26:26 -0600 Subject: [PATCH 6/7] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc707cca89..bf9c505c74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,11 +16,14 @@ ### Fixed - Resolved problem when creating organisations [portagenetwork/roadmap#336](https://github.com/portagenetwork/roadmap/issues/336) + - Fixed equality checks in application_helper.rb [#355](https://github.com/portagenetwork/roadmap/issues/355) ### Changed - Help-desk email now has correct address [portagenetwork/roadmap#338](https://github.com/portagenetwork/roadmap/issues/338) - Password reset mail no longer instructs the user against replying to email. [portagenetwork/roadmap#338](https://github.com/portagenetwork/roadmap/issues/338) + - Edited terms-of-use and how-to-manage-your-data links to always be the localized routes in application_helper.rb [#397](https://github.com/portagenetwork/roadmap/issues/397) + - Temporarily hardcoded terms_of_use_path in application_helper.rb to always return en-CA route. This will have to be changed again when the French terms-of-use route is made available. ### Added From 554d59cec8c905c1f9ccd73e713d850c84018d42 Mon Sep 17 00:00:00 2001 From: aaronskiba <71047780+aaronskiba@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:42:24 -0600 Subject: [PATCH 7/7] Make comment clearer --- app/helpers/application_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 48dd2b669b..34434a0947 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -62,10 +62,9 @@ def contact_us_path end end - # Regardless of locale, we are currently only routing to '/terms' - # This will be changed when the French terms route is made available + # TODO: Replace function body with the commented-out code when French version of this path is made available. def terms_of_use_path - 'https://assistant.portagenetwork.ca/terms' + 'https://assistant.portagenetwork.ca/terms' # TEMPORARY FIX # if I18n.locale == :'fr-CA' # 'https://portagenetwork.ca/fr/outils-et-ressources/assistant-pgd/conditions-dutilisation-de-lassistant-pgd/' # else