Set USER_SUPPORT_EMAIL

This commit is contained in:
Santiago L 2023-11-23 19:59:14 +01:00
parent bae29f766f
commit 7c85f219d8
7 changed files with 127 additions and 97 deletions

View File

@ -235,6 +235,8 @@ LOGIN_URL = 'musician:login'
LOGOUT_REDIRECT_URL = 'musician:login'
USER_SUPPORT_EMAIL = "support@example.com"
#################################
## 3RD PARTY APPS CONFIGURATION ##
#################################

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-24 11:04+0100\n"
"POT-Creation-Date: 2023-11-23 19:57+0100\n"
"PO-Revision-Date: 2021-11-25 12:53+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -18,53 +18,53 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0\n"
#: api.py:113 api.py:211
#: api.py:127 api.py:226
msgid "No domain found matching the query"
msgstr "No trobem cap domini que coincideixi amb la teva consulta"
#: api.py:125
#: api.py:139
msgid "No object found matching the query"
msgstr "No trobem cap objecte que coincideixi amb la teva consulta"
#: api.py:178
#: api.py:192
msgid "No mailbox found matching the query"
msgstr "No trobem cap bústia que coincideixi amb la teva consulta"
#: forms.py:65 forms.py:99
#: forms.py:57 forms.py:88
msgid "The two password fields didnt match."
msgstr "Les contrasenyes introduïdes no coincideixen."
#: forms.py:68 forms.py:103
#: forms.py:60 forms.py:92
msgid "Password"
msgstr "Contrasenya"
#: forms.py:73 forms.py:108
#: forms.py:65 forms.py:97
msgid "Password confirmation"
msgstr "Confirma la contrasenya"
#: forms.py:76 forms.py:111
#: forms.py:68 forms.py:100
msgid "Enter the same password as before, for verification."
msgstr "Introdueix la mateixa contrasenya per verificar-la."
#: mixins.py:14
#: mixins.py:17
msgid "Domains & websites"
msgstr "Dominis i llocs web"
#: mixins.py:15
#: mixins.py:18
msgid "Mails"
msgstr "Correus"
#. Translators: This message appears on the page title
#: mixins.py:16 views.py:296
#: mixins.py:19 views.py:324
msgid "Mailing lists"
msgstr "Llistes de correu"
#. Translators: This message appears on the page title
#: mixins.py:17 models.py:147 views.py:480
#: mixins.py:20 models.py:147 views.py:446
msgid "Databases"
msgstr "Bases de dades"
#: mixins.py:18
#: mixins.py:21
msgid "SaaS"
msgstr "SaaS"
@ -73,7 +73,7 @@ msgid "Description details for databases page."
msgstr "Consulta la configuració de les teves bases de dades."
#. Translators: This message appears on the page title
#: models.py:235 views.py:185
#: models.py:235 views.py:247
msgid "Mail addresses"
msgstr "Adreces de correu"
@ -170,7 +170,7 @@ msgstr "Domini"
#. Translators: This message appears on the page title
#: templates/musician/addresses.html:17 templates/musician/mail_base.html:22
#: views.py:325
#: views.py:355
msgid "Mailboxes"
msgstr "Bústies de correu"
@ -182,24 +182,28 @@ msgstr "Redirecció"
msgid "New mail address"
msgstr "Nova adreça de correu"
#: templates/musician/base.html:60
#: templates/musician/base.html:63
msgid "Settings"
msgstr "Configuració"
#: templates/musician/base.html:63 templates/musician/profile.html:6
#: templates/musician/base.html:66 templates/musician/profile.html:6
msgid "Profile"
msgstr "Perfil"
#. Translators: This message appears on the page title
#: templates/musician/base.html:64 templates/musician/billing.html:6
#: views.py:163
#: templates/musician/base.html:67 templates/musician/billing.html:6
#: views.py:205
msgid "Billing"
msgstr "Factures"
#: templates/musician/base.html:72
#: templates/musician/base.html:82
msgid "Log out"
msgstr "Surt"
#: templates/musician/base.html:93
msgid "Language"
msgstr ""
#: templates/musician/billing.html:7
msgid "Billing page description."
msgstr "Consulta i descarrega les teves factures."
@ -285,7 +289,7 @@ msgid "Mail list"
msgstr "Llista de correu"
#. Translators: This message appears on the page title
#: templates/musician/dashboard.html:83 views.py:489
#: templates/musician/dashboard.html:83 views.py:456
msgid "Software as a Service"
msgstr "Software as a Service"
@ -293,7 +297,7 @@ msgstr "Software as a Service"
msgid "Nothing installed"
msgstr "No tens res instal·lat"
#: templates/musician/dashboard.html:90 views.py:57
#: templates/musician/dashboard.html:90 views.py:70
msgid "Disk usage"
msgstr "Ús del disc"
@ -305,26 +309,30 @@ msgstr "Detalls de configuració"
msgid "FTP access:"
msgstr "Accés FTP:"
#. Translators: domain configuration detail modal
#: templates/musician/dashboard.html:116
msgid "Contact with the support team to get details concerning FTP access."
#: templates/musician/dashboard.html:117
#, fuzzy, python-format
#| msgid ""
#| "Send an email to <a href=\"mailto:%(support_email)s\">%(support_email)s</"
#| "a> including your username and we will provide instructions."
msgid ""
"E-mail us at %(support_email_anchor)s to get details concerning FTP access."
msgstr ""
"Escriu-nos a <a href=“mailto:%(support_email)s”>%(support_email)s</a> per "
"saber com accedir al FTP."
"Envia un correu a <a href=\"mailto:%(support_email)s\">%(support_email)s</a> "
"indicant el teu nom dusuari/a i texplicarem què fer."
#: templates/musician/dashboard.html:125
#: templates/musician/dashboard.html:127
msgid "No website configured."
msgstr "No hi ha cap web configurada."
#: templates/musician/dashboard.html:127
#: templates/musician/dashboard.html:129
msgid "Root directory:"
msgstr "Directori arrel:"
#: templates/musician/dashboard.html:128
#: templates/musician/dashboard.html:130
msgid "Type:"
msgstr "Tipus:"
#: templates/musician/dashboard.html:133
#: templates/musician/dashboard.html:135
msgid "View DNS records"
msgstr "Veure registres DNS"
@ -472,56 +480,60 @@ msgid "Open service admin panel"
msgstr "Obre el panell dadministració del servei"
#. Translators: This message appears on the page title
#: views.py:41
#: views.py:54
msgid "Dashboard"
msgstr "Panell de gestió"
#: views.py:66
#: views.py:79
msgid "Traffic"
msgstr "Tràfic"
#: views.py:97
#: views.py:117
msgid "Mailbox usage"
msgstr "Ús despai a la bústia de correu"
#. Translators: This message appears on the page title
#: views.py:112
#: views.py:132
msgid "User profile"
msgstr "El teu perfil"
#. Translators: This message appears on the page title
#: views.py:170
#: views.py:219
msgid "Download bill"
msgstr "Descarrega la factura"
#: views.py:283
#: views.py:310
msgid "Address deleted!"
msgstr "Sha suprimit ladreça de correu"
#: views.py:285 views.py:422 views.py:469
#: views.py:312 views.py:412
msgid "Cannot process your request, please try again later."
msgstr ""
"Ara no podem processar la teva petició, torna a intentar-ho una mica més "
"tard sisplau"
#: views.py:420
#: views.py:410
msgid "Mailbox deleted!"
msgstr "Sha suprimit la bústia de correu"
#: views.py:467
msgid "Password updated!"
msgstr "Sha actualitzat la contrasenya"
#. Translators: This message appears on the page title
#: views.py:497
#: views.py:464
msgid "Domain details"
msgstr "Detalls del domini"
#. Translators: This message appears on the page title
#: views.py:523
#: views.py:478
msgid "Login"
msgstr "Accés"
#~ msgid "Contact with the support team to get details concerning FTP access."
#~ msgstr ""
#~ "Escriu-nos a <a href=“mailto:%(support_email)s”>%(support_email)s</a> per "
#~ "saber com accedir al FTP."
#~ msgid "Password updated!"
#~ msgstr "Sha actualitzat la contrasenya"
#~ msgid "mail address left"
#~ msgstr "adreces de correu per activar"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-24 11:04+0100\n"
"POT-Creation-Date: 2023-11-23 19:57+0100\n"
"PO-Revision-Date: 2021-11-25 12:53+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -18,53 +18,53 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0\n"
#: api.py:113 api.py:211
#: api.py:127 api.py:226
msgid "No domain found matching the query"
msgstr "No hay dominios que coincidan con tu búsqueda"
#: api.py:125
#: api.py:139
msgid "No object found matching the query"
msgstr "No hay objetos que coincidan con tu búsqueda"
#: api.py:178
#: api.py:192
msgid "No mailbox found matching the query"
msgstr "No hay buzones de correo que coincidan con tu búsqueda"
#: forms.py:65 forms.py:99
#: forms.py:57 forms.py:88
msgid "The two password fields didnt match."
msgstr "Las contraseñas introducidas no coinciden."
#: forms.py:68 forms.py:103
#: forms.py:60 forms.py:92
msgid "Password"
msgstr "Contraseña"
#: forms.py:73 forms.py:108
#: forms.py:65 forms.py:97
msgid "Password confirmation"
msgstr "Confirma la contraseña"
#: forms.py:76 forms.py:111
#: forms.py:68 forms.py:100
msgid "Enter the same password as before, for verification."
msgstr "Introduce la misma contraseña para verificarla"
#: mixins.py:14
#: mixins.py:17
msgid "Domains & websites"
msgstr "Dominios y sitios web"
#: mixins.py:15
#: mixins.py:18
msgid "Mails"
msgstr "Correos"
#. Translators: This message appears on the page title
#: mixins.py:16 views.py:296
#: mixins.py:19 views.py:324
msgid "Mailing lists"
msgstr "Listas de correo"
#. Translators: This message appears on the page title
#: mixins.py:17 models.py:147 views.py:480
#: mixins.py:20 models.py:147 views.py:446
msgid "Databases"
msgstr "Bases de datos"
#: mixins.py:18
#: mixins.py:21
msgid "SaaS"
msgstr "SaaS"
@ -73,7 +73,7 @@ msgid "Description details for databases page."
msgstr "Consulta la configuración de tus bases de datos."
#. Translators: This message appears on the page title
#: models.py:235 views.py:185
#: models.py:235 views.py:247
msgid "Mail addresses"
msgstr "Direcciones de correo"
@ -172,7 +172,7 @@ msgstr "Dominio"
#. Translators: This message appears on the page title
#: templates/musician/addresses.html:17 templates/musician/mail_base.html:22
#: views.py:325
#: views.py:355
msgid "Mailboxes"
msgstr "Buzones de correo"
@ -184,24 +184,28 @@ msgstr "Redirección"
msgid "New mail address"
msgstr "Nueva dirección de correo"
#: templates/musician/base.html:60
#: templates/musician/base.html:63
msgid "Settings"
msgstr "Configuración"
#: templates/musician/base.html:63 templates/musician/profile.html:6
#: templates/musician/base.html:66 templates/musician/profile.html:6
msgid "Profile"
msgstr "Perfil"
#. Translators: This message appears on the page title
#: templates/musician/base.html:64 templates/musician/billing.html:6
#: views.py:163
#: templates/musician/base.html:67 templates/musician/billing.html:6
#: views.py:205
msgid "Billing"
msgstr "Facturas"
#: templates/musician/base.html:72
#: templates/musician/base.html:82
msgid "Log out"
msgstr "Desconéctate"
#: templates/musician/base.html:93
msgid "Language"
msgstr ""
#: templates/musician/billing.html:7
msgid "Billing page description."
msgstr "Consulta y descarga tus facturas."
@ -287,7 +291,7 @@ msgid "Mail list"
msgstr "Lista de correo"
#. Translators: This message appears on the page title
#: templates/musician/dashboard.html:83 views.py:489
#: templates/musician/dashboard.html:83 views.py:456
msgid "Software as a Service"
msgstr "Software as a Service"
@ -295,7 +299,7 @@ msgstr "Software as a Service"
msgid "Nothing installed"
msgstr "No tienes nada instalado"
#: templates/musician/dashboard.html:90 views.py:57
#: templates/musician/dashboard.html:90 views.py:70
msgid "Disk usage"
msgstr "Uso del disco"
@ -307,26 +311,30 @@ msgstr "Detalles de configuración"
msgid "FTP access:"
msgstr "Acceso FTP:"
#. Translators: domain configuration detail modal
#: templates/musician/dashboard.html:116
msgid "Contact with the support team to get details concerning FTP access."
#: templates/musician/dashboard.html:117
#, fuzzy, python-format
#| msgid ""
#| "Send an email to <a href=\"mailto:%(support_email)s\">%(support_email)s</"
#| "a> including your username and we will provide instructions."
msgid ""
"E-mail us at %(support_email_anchor)s to get details concerning FTP access."
msgstr ""
"Escríbenos a <a href=“mailto:%(support_email)s”>%(support_email)s</a> para "
"saber cómo acceder al FTP."
"Envía un correo a <a href=“mailto:%(support_email)s”>%(support_email)s</a> "
"indicando tu nombre de usuaria/o y te explicaremos qué hacer."
#: templates/musician/dashboard.html:125
#: templates/musician/dashboard.html:127
msgid "No website configured."
msgstr "No hay ninguna web configurada."
#: templates/musician/dashboard.html:127
#: templates/musician/dashboard.html:129
msgid "Root directory:"
msgstr "Directorio raíz:"
#: templates/musician/dashboard.html:128
#: templates/musician/dashboard.html:130
msgid "Type:"
msgstr "Tipo:"
#: templates/musician/dashboard.html:133
#: templates/musician/dashboard.html:135
msgid "View DNS records"
msgstr "Ver registros DNS"
@ -474,53 +482,49 @@ msgid "Open service admin panel"
msgstr "Abre el panel de administración del servicio"
#. Translators: This message appears on the page title
#: views.py:41
#: views.py:54
msgid "Dashboard"
msgstr "Panel de gestión"
#: views.py:66
#: views.py:79
msgid "Traffic"
msgstr "Tráfico"
#: views.py:97
#: views.py:117
msgid "Mailbox usage"
msgstr "Uso de espacio en tu buzón de correo"
#. Translators: This message appears on the page title
#: views.py:112
#: views.py:132
msgid "User profile"
msgstr "Tu perfil"
#. Translators: This message appears on the page title
#: views.py:170
#: views.py:219
msgid "Download bill"
msgstr "Descarga la factura"
#: views.py:283
#: views.py:310
msgid "Address deleted!"
msgstr "Has eliminado la dirección de correo"
#: views.py:285 views.py:422 views.py:469
#: views.py:312 views.py:412
msgid "Cannot process your request, please try again later."
msgstr ""
"Ahora no podemos procesar tu petición, inténtalo de nuevo un poco más tarde "
"por favor."
#: views.py:420
#: views.py:410
msgid "Mailbox deleted!"
msgstr "Has eliminado el buzón de correo"
#: views.py:467
msgid "Password updated!"
msgstr "Contraseña actualizada"
#. Translators: This message appears on the page title
#: views.py:497
#: views.py:464
msgid "Domain details"
msgstr "Detalles del dominio"
#. Translators: This message appears on the page title
#: views.py:523
#: views.py:478
msgid "Login"
msgstr "Accede"

View File

@ -113,7 +113,9 @@
<div class="domain-ftp pb-3 border-bottom">
<h6 class="pl-4 mb-4">{% trans "FTP access:" %}</h6>
{# Translators: domain configuration detail modal #}
<p>{% trans "Contact with the support team to get details concerning FTP access." %}</p>
<p>
{% blocktrans %}E-mail us at {{ support_email_anchor }} to get details concerning FTP access.{% endblocktrans %}
</p>
{% comment %}
<!-- hidden until API provides FTP information -->
<label>{% trans "Username" %}:</label> <span id="config-username" class="font-weight-bold">username</span><br/>

View File

@ -87,10 +87,17 @@ class DashboardView(CustomContextMixin, UserTokenRequiredMixin, TemplateView):
'mailbox': self.get_mailbox_usage(profile_type),
}
support_email = getattr(settings, "USER_SUPPORT_EMAIL", "suport@pangea.org")
support_email_anchor = format_html(
"<a href='mailto:{}'>{}</a>",
support_email,
support_email,
)
context.update({
'domains': domains,
'resource_usage': resource_usage,
'notifications': notifications,
"support_email_anchor": support_email_anchor,
})
return context
@ -252,10 +259,11 @@ class MailView(ServiceListView):
context = super().get_context_data(**kwargs)
domain_id = self.request.GET.get('domain')
if domain_id:
qs = Domain.objects.filter(account=self.request.user)
context.update({
'active_domain': self.orchestra.retrieve_domain(domain_id)
'active_domain': get_object_or_404(qs, pk=domain_id)
})
context['mailboxes'] = self.orchestra.retrieve_mailbox_list()
context['mailboxes'] = Mailbox.objects.filter(account=self.request.user)
return context
@ -316,22 +324,24 @@ class MailingListsView(ServiceListView):
'title': _('Mailing lists'),
}
def get_queryset(self):
return self.model.objects.filter(account=self.request.user).order_by("name")
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
domain_id = self.request.GET.get('domain')
if domain_id:
qs = Domain.objects.filter(account=self.request.user)
context.update({
'active_domain': self.orchestra.retrieve_domain(domain_id)
'active_domain': get_object_or_404(qs, pk=domain_id)
})
return context
def get_queryfilter(self):
"""Retrieve query params (if any) to filter queryset"""
# TODO(@slamora): this is not working because backend API
# doesn't support filtering by domain
domain_id = self.request.GET.get('domain')
if domain_id:
return {"domain": domain_id}
return {"address_domain_id": domain_id}
return {}