allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] 05/07: [#8284] Improve artifact link details in email
Date Thu, 08 Aug 2019 21:17:41 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 272e29feb117a915ba48ec1b6f00ef1488bb8754
Author: Shalitha Suranga <shalithasuranga@gmail.com>
AuthorDate: Sun Jul 21 22:22:55 2019 +0530

    [#8284] Improve artifact link details in email
---
 Allura/allura/model/auth.py                        | 10 ++++++----
 Allura/allura/templates/mail/usermentions_email.md |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 915f4df..e85850f 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -464,14 +464,16 @@ class User(MappedClass, ActivityNode, ActivityObject, SearchIndexable):
         tmpl = g.jinja2_env.get_template('allura:templates/mail/usermentions_email.md')
         subject = '[%s:%s] Your name was mentioned' % (
             c.project.shortname, c.app.config.options.mount_point)
+        item_url = artifact.url()
+        if artifact.type_s == 'Post':
+            item_url = artifact.url_paginated()
         tmpl_context = {
             'site_domain': config['domain'],
             'base_url': config['base_url'],
             'user': c.user,
-            'artifact_link': h.absurl(artifact.url()),
-            'mentioned_by': mentioned_by,
-            'project_name': c.project.shortname,
-            'mount_point': c.app.config.options.mount_point
+            'artifact_link': h.absurl(item_url),
+            'artifact_linktext': artifact.link_text(),
+            'mentioned_by': mentioned_by
         }
         allura.tasks.mail_tasks.sendsimplemail.post(
             toaddr=self.get_pref('email_address'),
diff --git a/Allura/allura/templates/mail/usermentions_email.md b/Allura/allura/templates/mail/usermentions_email.md
index 886f16f..02898ca 100644
--- a/Allura/allura/templates/mail/usermentions_email.md
+++ b/Allura/allura/templates/mail/usermentions_email.md
@@ -16,7 +16,7 @@
        specific language governing permissions and limitations
        under the License.
 -#}
-Your name was mentioned at [{{project_name}}:{{mount_point}}]({{artifact_link}}) by {{mentioned_by.display_name}}
+Your name was mentioned at [{{artifact_linktext}}]({{artifact_link}}) by {{mentioned_by.display_name}}
 
 It can be viewed using the link below:
 {{artifact_link}}


Mime
View raw message