doortts doortts 2017-08-08
user: Change user expression at renderred page
@loginId -> @username
@898a2503b240f7fbe9c605041090bb2a8a04811f
app/models/NotificationMail.java
--- app/models/NotificationMail.java
+++ app/models/NotificationMail.java
@@ -609,8 +609,15 @@
 
     private static String getHtmlMessage(Lang lang, String message, String urlToView,
                                          Resource resource, boolean acceptsReply) {
+        String renderred = null;
+
+        if( resource != null) {
+            renderred = Markdown.render(message, resource.getProject());
+        } else {
+            renderred = Markdown.render(message);
+        }
         String content = views.html.common.notificationMail.render(
-                lang, Markdown.render(message), urlToView, resource, acceptsReply).toString();
+                lang, renderred, urlToView, resource, acceptsReply).toString();
 
         Document doc = Jsoup.parse(content);
 
app/utils/AutoLinkRenderer.java
--- app/utils/AutoLinkRenderer.java
+++ app/utils/AutoLinkRenderer.java
@@ -330,7 +330,7 @@
             } else {
                 avatarImage = "<img src='" + user.avatarUrl() + "' class='avatar-wrap smaller no-margin-no-padding vertical-top' alt='@" + user.loginId + "'> ";
             }
-            return new Link(RouteUtil.getUrl(user), "no-text-decoration", "<span data-toggle='popover' data-placement='top' data-trigger='hover' data-html='true' data-content=\"" + StringEscapeUtils.escapeHtml4(avatarImage + user.name) + "\">@" + user.loginId + "</span>");
+            return new Link(RouteUtil.getUrl(user), "no-text-decoration", "<span data-toggle='popover' data-placement='top' data-trigger='hover' data-html='true' data-content=\"" + StringEscapeUtils.escapeHtml4(avatarImage + user.loginId) + "\">@" + user.name + "</span>");
         }
     }
 
Add a comment
List