Skip to content

Commit

Permalink
- Convert pinax templates bodies to HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed May 21, 2019
1 parent dad94b2 commit de34e4f
Show file tree
Hide file tree
Showing 27 changed files with 73 additions and 109 deletions.
11 changes: 9 additions & 2 deletions geonode/security/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,19 @@ def send_email_owner_on_view(owner, viewer, layer_id, geonode_email="email@geo.n
layer = Layer.objects.get(id=layer_id)
# check if those values are empty
if owner_email and geonode_email:
from django.core.mail import send_mail
from django.core.mail import EmailMessage
# TODO: Copy edit message.
subject_email = "Your Layer has been seen."
msg = ("Your layer called {0} with uuid={1}"
" was seen by {2}").format(layer.name, layer.uuid, viewer)
try:
send_mail(subject_email, msg, geonode_email, [owner_email, ])
email = EmailMessage(
subject=subject_email,
body=msg,
from_email=geonode_email,
to=[owner_email, ],
reply_to=[geonode_email, ])
email.content_subtype = "html"
email.send()
except BaseException:
pass
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{% load i18n %}

{% trans "Your account has been approved and is now active." %} ({{ username }})

{% trans "You can use the login form at" %}: http://{{ current_site.name }}
{% load i18n %}
{% trans "Your account has been approved and is now active." %} ({{ username }})<br/>
{% trans "You can use the login form at" %}: http://{{ current_site.name }}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% load i18n %}{% trans "Welcome at" %} {{ current_site.name }}
{% load i18n %}{% trans "Welcome at" %} {{ current_site.name }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{% load i18n %}

{% trans "Your account has been approved and is now active." %}

{% trans "Your account has been approved and is now active." %}<br/>
{% trans "You can use the login form at" %}: http://{{ current_site }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following document was approved" %} by a Manager or Staff member:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following document was approved" %} by a Manager or Staff member:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the document's detail page here" %}: http://{{ current_site }}{% url "document_detail" resource.id %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{% load i18n %}

{% trans "A comment has been posted for the document" %} {{ instance.content_object.title }} {% trans "by the user" %} {{ instance.author.username }}

{% trans "A comment has been posted for the document" %} {{ instance.content_object.title }} {% trans "by the user" %} {{ instance.author.username }}<br/>
{% trans "You can visit the document's detail page here" %}: http://{{ current_site }}{% url "document_detail" instance.content_object.id %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The user" %} {{ resource.owner.username }} {% trans "uploaded the following document" %}:
{{ resource.title }}

{% trans "The user" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i> {% trans "uploaded the following document" %}:<br/>
<strong>{{ resource.title }}</strong><br/>
{% trans "You can visit the document's detail page here" %}: http://{{ current_site }}{% url "document_detail" resource.id %}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% load i18n %}

{% trans "The following document was deleted" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}
{% trans "The following document was deleted" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following document was published" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following document was published" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the document's detail page here" %}: http://{{ current_site }}{% url "document_detail" resource.id %}
10 changes: 4 additions & 6 deletions geonode/templates/pinax/notifications/document_rated/full.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% load i18n %}

{% trans "The user" %} {{ instance.user.username }}
{% trans "rated" %} {{ instance.rating }}
{% trans "the following document" %}:
{{ instance.content_object.title }}, {% trans "owned by" %} {{ instance.content_object.owner.username }}

{% trans "The user" %} {{ instance.user.username }} <br/>
{% trans "rated" %} {{ instance.rating }} <br/>
{% trans "the following document" %}: <br/>
{{ instance.content_object.title }}, {% trans "owned by" %} {{ instance.content_object.owner.username }}<br/>
{% trans "You can visit the layer's detail page here" %}: http://{{ current_site }}{% url "document_detail" instance.content_object.id %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following document was updated" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following document was updated" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the document's detail page here" %}: http://{{ current_site }}{% url "document_detail" resource.id %}
14 changes: 9 additions & 5 deletions geonode/templates/pinax/notifications/email_body.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{% load i18n %}{% url "notice_settings" as notices_url %}{% blocktrans %}You have received the following notice from {{ current_site }}:

{% load i18n %}
<body>
{% url "notice_settings" as notices_url %}{% blocktrans %}You have received the following notice from{% endblocktrans %} {{ current_site }}:
<p>
{{ message }}

To change how you receive notifications, please go to {{ default_http_protocol }}://{{ current_site }}{{ notices_url }}
{% endblocktrans %}
</p>
<p>
{% blocktrans %}To change how you receive notifications, please go to{% endblocktrans %} {{ default_http_protocol }}://{{ current_site }}{{ notices_url }}
</p>
</body>
6 changes: 2 additions & 4 deletions geonode/templates/pinax/notifications/layer_approved/full.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following layer was approved" %} by a Manager or Staff member:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following layer was approved" %} by a Manager or Staff member:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the layer's detail page here" %}: http://{{ current_site }}{% url "layer_detail" resource.service_typename %}
4 changes: 1 addition & 3 deletions geonode/templates/pinax/notifications/layer_comment/full.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{% load i18n %}

{% trans "A comment has been posted for the layer" %} {{ instance.content_object.title }} {% trans "by the user" %} {{ instance.author.username }}

{% trans "A comment has been posted for the layer" %} {{ instance.content_object.title }} {% trans "by the user" %} {{ instance.author.username }}<br/>
{% trans "You can visit the layer's detail page here" %}: http://{{ current_site }}{% url "layer_detail" instance.content_object.service_typename %}
6 changes: 2 additions & 4 deletions geonode/templates/pinax/notifications/layer_created/full.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The user" %} {{ resource.owner.username }} {% trans "uploaded the following layer" %}:
{{ resource.title }}

{% trans "The user" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i> {% trans "uploaded the following layer" %}:<br/>
<strong>{{ resource.title }}</strong><br/>
{% trans "You can visit the layer's detail page here" %}: http://{{ current_site }}{% url "layer_detail" resource.service_typename %}
5 changes: 2 additions & 3 deletions geonode/templates/pinax/notifications/layer_deleted/full.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% load i18n %}

{% trans "The following layer was deleted" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}
{% trans "The following layer was deleted" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following layer was published" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following layer was published" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the layer's detail page here" %}: http://{{ current_site }}{% url "layer_detail" resource.service_typename %}
10 changes: 4 additions & 6 deletions geonode/templates/pinax/notifications/layer_rated/full.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% load i18n %}

{% trans "The user" %} {{ instance.user.username }}
{% trans "rated" %} {{ instance.rating }}
{% trans "the following layer" %}:
{{ instance.content_object.title }}, {% trans "owned by" %} {{ instance.content_object.owner.username }}

{% trans "The user" %} {{ instance.user.username }}<br/>
{% trans "rated" %} {{ instance.rating }}<br/>
{% trans "the following layer" %}:<br/>
{{ instance.content_object.title }}, {% trans "owned by" %} {{ instance.content_object.owner.username }}<br/>
{% trans "You can visit the layer's detail page here" %}: http://{{ current_site }}{% url "layer_detail" instance.content_object.service_typename %}
6 changes: 2 additions & 4 deletions geonode/templates/pinax/notifications/layer_updated/full.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following layer was updated" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following layer was updated" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the layer's detail page here" %}: http://{{ current_site }}{% url "layer_detail" resource.service_typename %}
6 changes: 2 additions & 4 deletions geonode/templates/pinax/notifications/map_approved/full.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following map was approved" %} by a Manager or Staff member:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following map was approved" %} by a Manager or Staff member:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the map's detail page here" %}: http://{{ current_site }}{% url "map_detail" resource.id %}
6 changes: 2 additions & 4 deletions geonode/templates/pinax/notifications/map_comment/full.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "A comment has been posted for the map" %} {{ instance.content_object.title }}
{% trans "by the user" %} {{ instance.author.username }}

{% trans "A comment has been posted for the map" %} {{ instance.content_object.title }} <br/>
{% trans "by the user" %} {{ instance.author.username }}<br/>
{% trans "You can visit the map's detail page here" %}: http://{{ current_site }}{% url "map_detail" instance.content_object.id %}
6 changes: 2 additions & 4 deletions geonode/templates/pinax/notifications/map_created/full.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The user" %} {{ resource.owner.username }} {% trans "created the following map" %}:
{{ resource.title }}

{% trans "The user" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i> {% trans "created the following map" %}:<br/>
<strong>{{ resource.title }}</strong><br/>
{% trans "You can visit the map's detail page here" %}: http://{{ current_site }}{% url "map_detail" resource.id %}
5 changes: 2 additions & 3 deletions geonode/templates/pinax/notifications/map_deleted/full.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% load i18n %}

{% trans "The following map was deleted" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}
{% trans "The following map was deleted" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i>
6 changes: 2 additions & 4 deletions geonode/templates/pinax/notifications/map_published/full.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following map was published" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following map was published" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the map's detail page here" %}: http://{{ current_site }}{% url "map_detail" resource.id %}
10 changes: 4 additions & 6 deletions geonode/templates/pinax/notifications/map_rated/full.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% load i18n %}

{% trans "The user" %} {{ instance.user.username }}
{% trans "rated" %} {{ instance.rating }}
{% trans "the following map" %}:
{{ instance.content_object.title }}, {% trans "owned by" %} {{ instance.content_object.owner.username }}

{% trans "The user" %} {{ instance.user.username }} <br/>
{% trans "rated" %} {{ instance.rating }} <br/>
{% trans "the following map" %}:<br/>
{{ instance.content_object.title }}, {% trans "owned by" %} {{ instance.content_object.owner.username }}<br/>
{% trans "You can visit the map's detail page here" %}: http://{{ current_site }}{% url "map_detail" instance.content_object.id %}
6 changes: 2 additions & 4 deletions geonode/templates/pinax/notifications/map_updated/full.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{% load i18n %}

{% trans "The following map was updated" %}:
{{ resource.title }}, {% trans "owned by" %} {{ resource.owner.username }}

{% trans "The following map was updated" %}:<br/>
<strong>{{ resource.title }}</strong>, {% trans "owned by" %} <i><a href="{{ default_http_protocol }}://{{ current_site }}/people/profile/{{ resource.owner.username }}">{{ resource.owner.username }}</a></i><br/>
{% trans "You can visit the map's detail page here" %}: http://{{ current_site }}{% url "map_detail" resource.id %}
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{% load i18n %}

{% trans "The user" %} {{ from_user.username }} {% trans "requested you to download this resource" %}:
{{ resource.title }}

{% trans "The user" %} {{ from_user.username }} {% trans "requested you to download this resource" %}:<br/>
<strong>{{ resource.title }}</strong><br/>
{% if resource.polymorphic_ctype.name = 'layer' %}
{% trans "Layer" %}: {{ current_site }}{% url "layer_detail" resource.layer.service_typename %}
{% trans "Layer" %}: {{ current_site }}{% url "layer_detail" resource.layer.service_typename %}<br/>
{% else %}
{% trans "Document" %}: {{ current_site }}{% url "document_detail" resource.document.id %}
{% trans "Document" %}: {{ current_site }}{% url "document_detail" resource.document.id %}<br/>
{% endif %}

{% trans "Please go to resource page and assign the download permissions if you wish" %}.

0 comments on commit de34e4f

Please sign in to comment.