Skip to content

Commit 50f617c

Browse files
authored
Merge pull request #692 from CDLUC3/feature/BR-protect-contact
Remove contact form for users who are not logged in
2 parents d706c70 + 5e64a2f commit 50f617c

File tree

11 files changed

+256
-73
lines changed

11 files changed

+256
-73
lines changed

app/views/branded/contact_us/contacts/_new_right.html.erb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ if telephone.present? %>
1717
<!-- <strong><%#= "#{_('Helpline')} #{telephone}" %></strong> -->
1818
<%# end %>
1919
<%
20-
email=Rails.configuration.x.dmproadmap.organisation_helpdesk_email
2120
if email.present? %>
2221
<address>
23-
<strong><%= _('Email') %></strong>
24-
<a href="<%= "mailto:#{email}" %>"><%= email %></a>
25-
</address>
22+
<% if user_signed_in? %>
23+
<strong><%= _('Email') %></strong> <a href="<%= "mailto:#{email}" %>"><%= email %></a>
24+
<% else %>
25+
<strong><%= _('Email') %></strong> <%= masked_email %>
26+
<% end %>
27+
</address>
2628
<% end %>
2729
<%
2830
link=Rails.configuration.x.dmproadmap.organisation_google_maps_link
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<%
2+
title _('Contact Us')
3+
4+
email = Rails.configuration.x.dmproadmap.organisation_helpdesk_email
5+
masked_email = email.gsub('@', ' [at] ').gsub('.', ' [dot] ')
6+
7+
if user_signed_in?
8+
instructions = _('%{application_name} is provided by the %{organisation_name}.<br /> You can find out more about us on our <a href="%{organisation_url}" class="has-new-window-popup-info" target="_blank">website</a>. If you would like to contact us about the %{application_name}, please fill out the form below.')
9+
else
10+
instructions = _('%{application_name} is provided by the %{organisation_name}.<br /> You can find out more about us on our <a href="%{organisation_url}" class="has-new-window-popup-info" target="_blank">website</a>. <p>If you would like to learn more about the %{application_name}, would like to become a participating organization, or are having difficulty accessing your account, please email our helpdesk: %{helpdesk_email}.</p>')
11+
end
12+
%>
13+
14+
<div class="row">
15+
<div class="col-md-12">
16+
<h1><%= _("Contact Us") %></h1>
17+
</div>
18+
</div>
19+
<div class="row">
20+
<div class="col-md-6"><!-- Left column container -->
21+
<p>
22+
<%= sanitize instructions % {
23+
organisation_name: Rails.configuration.x.dmproadmap.organisation_name,
24+
organisation_url: Rails.configuration.x.dmproadmap.organisation_url,
25+
application_name: ApplicationService.application_name,
26+
helpdesk_email: masked_email,
27+
open_in_new_window_text: _('Opens in new window') },
28+
tags: %w( a br span em p ) %>
29+
</p>
30+
31+
<% if user_signed_in? %>
32+
<%= render :partial => "contact_us/contacts/new_left" %>
33+
<% end %>
34+
</div><!-- Left column container -->
35+
<div class="col-md-6"><!-- Right column container -->
36+
<div class="pull-right">
37+
<%= render :partial => "contact_us/contacts/new_right",
38+
locals: { masked_email: masked_email, email: email } %>
39+
</div>
40+
</div><!-- Right column container -->
41+
</div>

config/locale/client.pot

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2024 dmptool
3-
# This file is distributed under the same license as the dmptool package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
2+
# Copyright (C) 2025 app
3+
# This file is distributed under the same license as the app package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
55
#
66
#, fuzzy
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: dmptool 1.0\n"
9+
"Project-Id-Version: app 1.0\n"
1010
"Report-Msgid-Bugs-To: contact@translation.io\n"
11-
"POT-Creation-Date: 2024-05-22 15:18-0700\n"
12-
"PO-Revision-Date: 2024-05-22 15:18-0700\n"
11+
"POT-Creation-Date: 2025-01-30 00:28+0000\n"
12+
"PO-Revision-Date: 2025-01-30 00:28+0000\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
1515
"Language: \n"
@@ -69,6 +69,7 @@ msgstr ""
6969

7070
#: ../../app/views/branded/contact_us/contacts/_new_left.html.erb:13
7171
#: ../../app/views/branded/contact_us/contacts/_new_right.html.erb:23
72+
#: ../../app/views/branded/contact_us/contacts/_new_right.html.erb:25
7273
#: ../../app/views/branded/contributors/_form.html.erb:19
7374
#: ../../app/views/branded/plans/_collaborator_form.html.erb:74
7475
msgid "Email"
@@ -88,6 +89,36 @@ msgstr ""
8889
msgid "Submit"
8990
msgstr ""
9091

92+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:2
93+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:16
94+
msgid "Contact Us"
95+
msgstr ""
96+
97+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:8
98+
msgid ""
99+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
100+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
101+
"-popup-info\" target=\"_blank\">website</a>. If you would like to contact us abou"
102+
"t the %{application_name}, please fill out the form below."
103+
msgstr ""
104+
105+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:10
106+
msgid ""
107+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
108+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
109+
"-popup-info\" target=\"_blank\">website</a>. <p>If you would like to learn more a"
110+
"bout the %{application_name}, would like to become a participating organizatio"
111+
"n, or are having difficulty accessing your account, please email our helpdesk:"
112+
" %{helpdesk_email}.</p>"
113+
msgstr ""
114+
115+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:27
116+
#: ../../app/views/branded/paginable/plans/_organisationally_or_publicly_visible.html.erb:51
117+
#: ../../app/views/branded/paginable/templates/_organisational.html.erb:95
118+
#: ../../app/views/branded/paginable/templates/_publicly_visible.html.erb:36
119+
msgid "Opens in new window"
120+
msgstr ""
121+
91122
#: ../../app/views/branded/contributors/_form.html.erb:4
92123
msgid "Phone numbers should only include numbers and dashes ('-')."
93124
msgstr ""
@@ -1359,13 +1390,6 @@ msgstr ""
13591390
msgid "(new window)"
13601391
msgstr ""
13611392

1362-
#:
1363-
#: ../../app/views/branded/paginable/plans/_organisationally_or_publicly_visible.html.erb:51
1364-
#: ../../app/views/branded/paginable/templates/_organisational.html.erb:95
1365-
#: ../../app/views/branded/paginable/templates/_publicly_visible.html.erb:36
1366-
msgid "Opens in new window"
1367-
msgstr ""
1368-
13691393
#: ../../app/views/branded/paginable/plans/_privately_visible.html.erb:9
13701394
msgid "Edited"
13711395
msgstr ""
1.47 KB
Binary file not shown.

config/locale/en/client.po

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# English translations for dmptool package.
2-
# Copyright (C) 2024 dmptool
3-
# This file is distributed under the same license as the dmptool package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
1+
# English translations for app package.
2+
# Copyright (C) 2025 app
3+
# This file is distributed under the same license as the app package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
55
#
66
msgid ""
77
msgstr ""
8-
"Project-Id-Version: dmptool 1.0\n"
8+
"Project-Id-Version: app 1.0\n"
99
"Report-Msgid-Bugs-To: contact@translation.io\n"
10-
"POT-Creation-Date: 2024-05-22 15:18-0700\n"
11-
"PO-Revision-Date: 2024-05-22 15:18-0700\n"
10+
"POT-Creation-Date: 2025-01-30 00:28+0000\n"
11+
"PO-Revision-Date: 2025-01-30 00:29+0000\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: English\n"
1414
"Language: en\n"
@@ -69,6 +69,7 @@ msgstr "Name"
6969

7070
#: ../../app/views/branded/contact_us/contacts/_new_left.html.erb:13
7171
#: ../../app/views/branded/contact_us/contacts/_new_right.html.erb:23
72+
#: ../../app/views/branded/contact_us/contacts/_new_right.html.erb:25
7273
#: ../../app/views/branded/contributors/_form.html.erb:19
7374
#: ../../app/views/branded/plans/_collaborator_form.html.erb:74
7475
msgid "Email"
@@ -88,6 +89,46 @@ msgstr "Message"
8889
msgid "Submit"
8990
msgstr "Submit"
9091

92+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:2
93+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:16
94+
msgid "Contact Us"
95+
msgstr "Contact Us"
96+
97+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:8
98+
msgid ""
99+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
100+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
101+
"-popup-info\" target=\"_blank\">website</a>. If you would like to contact us abou"
102+
"t the %{application_name}, please fill out the form below."
103+
msgstr ""
104+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
105+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
106+
"-popup-info\" target=\"_blank\">website</a>. If you would like to contact us abou"
107+
"t the %{application_name}, please fill out the form below."
108+
109+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:10
110+
msgid ""
111+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
112+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
113+
"-popup-info\" target=\"_blank\">website</a>. <p>If you would like to learn more a"
114+
"bout the %{application_name}, would like to become a participating organizatio"
115+
"n, or are having difficulty accessing your account, please email our helpdesk:"
116+
" %{helpdesk_email}.</p>"
117+
msgstr ""
118+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
119+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
120+
"-popup-info\" target=\"_blank\">website</a>. <p>If you would like to learn more a"
121+
"bout the %{application_name}, would like to become a participating organizatio"
122+
"n, or are having difficulty accessing your account, please email our helpdesk:"
123+
" %{helpdesk_email}.</p>"
124+
125+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:27
126+
#: ../../app/views/branded/paginable/plans/_organisationally_or_publicly_visible.html.erb:51
127+
#: ../../app/views/branded/paginable/templates/_organisational.html.erb:95
128+
#: ../../app/views/branded/paginable/templates/_publicly_visible.html.erb:36
129+
msgid "Opens in new window"
130+
msgstr "Opens in new window"
131+
91132
#: ../../app/views/branded/contributors/_form.html.erb:4
92133
msgid "Phone numbers should only include numbers and dashes ('-')."
93134
msgstr "Phone numbers should only include numbers and dashes ('-')."
@@ -1426,13 +1467,6 @@ msgstr "Download"
14261467
msgid "(new window)"
14271468
msgstr "(new window)"
14281469

1429-
#:
1430-
#: ../../app/views/branded/paginable/plans/_organisationally_or_publicly_visible.html.erb:51
1431-
#: ../../app/views/branded/paginable/templates/_organisational.html.erb:95
1432-
#: ../../app/views/branded/paginable/templates/_publicly_visible.html.erb:36
1433-
msgid "Opens in new window"
1434-
msgstr "Opens in new window"
1435-
14361470
#: ../../app/views/branded/paginable/plans/_privately_visible.html.erb:9
14371471
msgid "Edited"
14381472
msgstr "Edited"
34 Bytes
Binary file not shown.

config/locale/en_US/client.po

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# English translations for dmptool package.
2-
# Copyright (C) 2024 dmptool
3-
# This file is distributed under the same license as the dmptool package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
1+
# English translations for app package.
2+
# Copyright (C) 2025 app
3+
# This file is distributed under the same license as the app package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
55
#
66
msgid ""
77
msgstr ""
8-
"Project-Id-Version: dmptool 1.0\n"
8+
"Project-Id-Version: app 1.0\n"
99
"Report-Msgid-Bugs-To: contact@translation.io\n"
10-
"POT-Creation-Date: 2024-05-22 15:18-0700\n"
11-
"PO-Revision-Date: 2024-05-23 00:18+0200\n"
10+
"POT-Creation-Date: 2025-01-30 00:28+0000\n"
11+
"PO-Revision-Date: 2025-01-30 01:28+0100\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: English\n"
1414
"Language: en_US\n"
@@ -69,6 +69,7 @@ msgstr "Name"
6969

7070
#: ../../app/views/branded/contact_us/contacts/_new_left.html.erb:13
7171
#: ../../app/views/branded/contact_us/contacts/_new_right.html.erb:23
72+
#: ../../app/views/branded/contact_us/contacts/_new_right.html.erb:25
7273
#: ../../app/views/branded/contributors/_form.html.erb:19
7374
#: ../../app/views/branded/plans/_collaborator_form.html.erb:74
7475
msgid "Email"
@@ -88,6 +89,36 @@ msgstr "Message"
8889
msgid "Submit"
8990
msgstr "Submit"
9091

92+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:2
93+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:16
94+
msgid "Contact Us"
95+
msgstr "Contact Us"
96+
97+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:8
98+
msgid ""
99+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
100+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
101+
"-popup-info\" target=\"_blank\">website</a>. If you would like to contact us abou"
102+
"t the %{application_name}, please fill out the form below."
103+
msgstr ""
104+
105+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:10
106+
msgid ""
107+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
108+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
109+
"-popup-info\" target=\"_blank\">website</a>. <p>If you would like to learn more a"
110+
"bout the %{application_name}, would like to become a participating organizatio"
111+
"n, or are having difficulty accessing your account, please email our helpdesk:"
112+
" %{helpdesk_email}.</p>"
113+
msgstr ""
114+
115+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:27
116+
#: ../../app/views/branded/paginable/plans/_organisationally_or_publicly_visible.html.erb:51
117+
#: ../../app/views/branded/paginable/templates/_organisational.html.erb:95
118+
#: ../../app/views/branded/paginable/templates/_publicly_visible.html.erb:36
119+
msgid "Opens in new window"
120+
msgstr ""
121+
91122
#: ../../app/views/branded/contributors/_form.html.erb:4
92123
msgid "Phone numbers should only include numbers and dashes ('-')."
93124
msgstr ""
@@ -1361,13 +1392,6 @@ msgstr ""
13611392
msgid "(new window)"
13621393
msgstr ""
13631394

1364-
#:
1365-
#: ../../app/views/branded/paginable/plans/_organisationally_or_publicly_visible.html.erb:51
1366-
#: ../../app/views/branded/paginable/templates/_organisational.html.erb:95
1367-
#: ../../app/views/branded/paginable/templates/_publicly_visible.html.erb:36
1368-
msgid "Opens in new window"
1369-
msgstr ""
1370-
13711395
#: ../../app/views/branded/paginable/plans/_privately_visible.html.erb:9
13721396
msgid "Edited"
13731397
msgstr ""
35 Bytes
Binary file not shown.

config/locale/es/client.po

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Spanish translations for dmptool package.
2-
# Copyright (C) 2024 dmptool
3-
# This file is distributed under the same license as the dmptool package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
1+
# Spanish translations for app package.
2+
# Copyright (C) 2025 app
3+
# This file is distributed under the same license as the app package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
55
#
66
msgid ""
77
msgstr ""
8-
"Project-Id-Version: dmptool 1.0\n"
8+
"Project-Id-Version: app 1.0\n"
99
"Report-Msgid-Bugs-To: contact@translation.io\n"
10-
"POT-Creation-Date: 2024-05-22 15:18-0700\n"
11-
"PO-Revision-Date: 2024-05-23 00:18+0200\n"
10+
"POT-Creation-Date: 2025-01-30 00:28+0000\n"
11+
"PO-Revision-Date: 2025-01-30 01:28+0100\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: Spanish\n"
1414
"Language: es\n"
@@ -69,6 +69,7 @@ msgstr "Nombre"
6969

7070
#: ../../app/views/branded/contact_us/contacts/_new_left.html.erb:13
7171
#: ../../app/views/branded/contact_us/contacts/_new_right.html.erb:23
72+
#: ../../app/views/branded/contact_us/contacts/_new_right.html.erb:25
7273
#: ../../app/views/branded/contributors/_form.html.erb:19
7374
#: ../../app/views/branded/plans/_collaborator_form.html.erb:74
7475
msgid "Email"
@@ -88,6 +89,36 @@ msgstr "Mensaje"
8889
msgid "Submit"
8990
msgstr "Enviar"
9091

92+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:2
93+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:16
94+
msgid "Contact Us"
95+
msgstr "Contactanos"
96+
97+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:8
98+
msgid ""
99+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
100+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
101+
"-popup-info\" target=\"_blank\">website</a>. If you would like to contact us abou"
102+
"t the %{application_name}, please fill out the form below."
103+
msgstr ""
104+
105+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:10
106+
msgid ""
107+
"%{application_name} is provided by the %{organisation_name}.<br /> You can fin"
108+
"d out more about us on our <a href=\"%{organisation_url}\" class=\"has-new-window"
109+
"-popup-info\" target=\"_blank\">website</a>. <p>If you would like to learn more a"
110+
"bout the %{application_name}, would like to become a participating organizatio"
111+
"n, or are having difficulty accessing your account, please email our helpdesk:"
112+
" %{helpdesk_email}.</p>"
113+
msgstr ""
114+
115+
#: ../../app/views/branded/contact_us/contacts/new.html.erb:27
116+
#: ../../app/views/branded/paginable/plans/_organisationally_or_publicly_visible.html.erb:51
117+
#: ../../app/views/branded/paginable/templates/_organisational.html.erb:95
118+
#: ../../app/views/branded/paginable/templates/_publicly_visible.html.erb:36
119+
msgid "Opens in new window"
120+
msgstr "Abre en nueva ventana"
121+
91122
#: ../../app/views/branded/contributors/_form.html.erb:4
92123
msgid "Phone numbers should only include numbers and dashes ('-')."
93124
msgstr "Los números de teléfono solo deben incluir números y guiones ('-')."
@@ -1387,13 +1418,6 @@ msgstr "descargar"
13871418
msgid "(new window)"
13881419
msgstr "(nueva ventana)"
13891420

1390-
#:
1391-
#: ../../app/views/branded/paginable/plans/_organisationally_or_publicly_visible.html.erb:51
1392-
#: ../../app/views/branded/paginable/templates/_organisational.html.erb:95
1393-
#: ../../app/views/branded/paginable/templates/_publicly_visible.html.erb:36
1394-
msgid "Opens in new window"
1395-
msgstr "Abre en nueva ventana"
1396-
13971421
#: ../../app/views/branded/paginable/plans/_privately_visible.html.erb:9
13981422
msgid "Edited"
13991423
msgstr "Editado"
1.48 KB
Binary file not shown.

0 commit comments

Comments
 (0)