Now emails are sended with wiki rendering information
parent
236d037770
commit
813239c601
|
@ -184,6 +184,7 @@ INSTALLED_APPS = [
|
|||
"taiga.projects.notifications",
|
||||
"taiga.projects.votes",
|
||||
"taiga.timeline",
|
||||
"taiga.mdrender",
|
||||
|
||||
"south",
|
||||
"reversion",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
|
||||
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
|
||||
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django_jinja import library
|
||||
from jinja2 import Markup
|
||||
from taiga.mdrender.service import render
|
||||
|
||||
register = library.Library()
|
||||
|
||||
|
||||
@register.global_function
|
||||
def mdrender(project, text) -> str:
|
||||
return Markup(render(project, text))
|
|
@ -78,9 +78,21 @@
|
|||
</dd>
|
||||
{% endif %}
|
||||
|
||||
{# DESCRIPTIONS #}
|
||||
{% elif field_name in ["description"] %}
|
||||
{% if values.1 != None or values.1 != "" %}
|
||||
<dd style="background: #eee; padding: 5px 15px; color: #444">
|
||||
<b>to:</b> <i>{{ mdrender(object.project, values.1) }}</i>
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if values.0 != None or values.0 != "" %}
|
||||
<dd style="padding: 5px 15px; color: #bbb">
|
||||
<b>from:</b> <i>{{ mdrender(object.project, values.0) }}</i>
|
||||
</dd>
|
||||
{% endif %}
|
||||
{# * #}
|
||||
{% else %}
|
||||
|
||||
{% if values.1 != None or values.1 != "" %}
|
||||
<dd style="background: #eee; padding: 5px 15px; color: #444">
|
||||
<b>to:</b> <i>{{ values.1|linebreaksbr }}</i>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<h2>Issue #{{ object.ref }}: {{ object.subject }}</h2>
|
||||
<p>Updated by <b>{{ changer.get_full_name() }}</b>.</p>
|
||||
{% if comment %}
|
||||
<p>Comment <b>{{ comment|linebreaksbr }}</b></p>
|
||||
<p>Comment <b>{{ mdrender(object.project, comment) }}</b></p>
|
||||
{% endif %}
|
||||
{% if changed_fields %}
|
||||
<p>Updated fields:</p>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<h2>Task #{{ object.ref }}: {{ object.subject }}</h2>
|
||||
<p>Updated by <b>{{ changer.get_full_name() }}</b>.</p>
|
||||
{% if comment %}
|
||||
<p>Comment <b>{{ comment|linebreaksbr }}</b></p>
|
||||
<p>Comment <b>{{ mdrender(object.project, comment) }}</b></p>
|
||||
{% endif %}
|
||||
{% if changed_fields %}
|
||||
<p>Updated fields:</p>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<h2>US #{{ object.ref }}: {{ object.subject }}</h2>
|
||||
<p>Updated by <b>{{ changer.get_full_name() }}</b>.</p>
|
||||
{% if comment %}
|
||||
<p>Comment <b>{{ comment|linebreaksbr }}</b></p>
|
||||
<p>Comment <b>{{ mdrender(object.project, comment)}}</b></p>
|
||||
{% endif %}
|
||||
{% if changed_fields %}
|
||||
<p>Updated fields:</p>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<h2>Wiki Page: {{ object.slug }}</h2>
|
||||
<p>Updated by <b>{{ changer.get_full_name() }}</b>.</p>
|
||||
{% if comment %}
|
||||
<p>Comment <b>{{ comment|linebreaksbr }}</b></p>
|
||||
<p>Comment <b>{{ mdrender(object.project, comment) }}</b></p>
|
||||
{% endif %}
|
||||
{% if changed_fields %}
|
||||
<p>Updated fields:</p>
|
||||
|
|
Loading…
Reference in New Issue