changeset 7166:2d6ec8b9b633

email templates: reorder references to pullrequests The current references to PRs in email templates are: Pull request from <repo> branch <branch> to <repo> branch <branch>: <niceid> <title> by <user> as the first line can become very long and therefore hard to read, a first step is to introduce a newline before the destination branch: Pull request from <repo> branch <branch> to <repo> branch <branch>: <niceid> <title> by <user> But it would be nicer if the from/to part aligns more. Moreover, the most useful part is (hopefully) the PR title, the from/to is secondary and can sometimes even be inferred from the title and context the recipient is already aware of. Thus, this commit proposes the following format: Pull request <niceid> <title> by <user> from <repo> branch <branch> to <repo> branch <branch> This adds some divergence with the changeset references, which could be aligned later if desired.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Tue, 06 Feb 2018 22:00:01 +0100
parents 67e561f832b2
children 8f3469917832
files kallithea/templates/email_templates/pull_request.html kallithea/templates/email_templates/pull_request.txt kallithea/templates/email_templates/pull_request_comment.html kallithea/templates/email_templates/pull_request_comment.txt kallithea/tests/models/test_dump_html_mails.ref.html
diffstat 5 files changed, 154 insertions(+), 118 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/email_templates/pull_request.html	Tue Feb 06 21:42:50 2018 +0100
+++ b/kallithea/templates/email_templates/pull_request.html	Tue Feb 06 22:00:01 2018 +0100
@@ -9,23 +9,25 @@
     <tr>
         <td>
             <div>
-                ${_('Pull request from')}
+                ${_('Pull request')}
+                <a style="${link_style}"
+                   href="${pr_url}">${pr_nice_id} "${pr_title}"</a>
+                ${_('by')}
+                <span style="${data_style}">${pr_owner.full_name_and_username}</span>.
+            </div>
+            <div>
+                ${_('from')}
                 <a style="${link_text_style}"
                    href="${pr_source_repo}">${pr_source_repo}</a>
                 ${_('branch')}
                 <span style="${data_style}">${pr_source_branch}</span>
+                <br/>
                 ${_('to')}
                 <a style="${link_text_style}"
                    href="${pr_target_repo}">${pr_target_repo}</a>
                 ${_('branch')}
                 <span style="${data_style}">${pr_target_branch}</span>
             </div>
-            <div>
-                <a style="${link_style}"
-                   href="${pr_url}">${pr_nice_id} "${pr_title}"</a>
-                ${_('by')}
-                <span style="${data_style}">${pr_owner.full_name_and_username}</span>.
-            </div>
         </td>
     </tr>
     <tr><td height="10px" style="height:10px"></td></tr>
--- a/kallithea/templates/email_templates/pull_request.txt	Tue Feb 06 21:42:50 2018 +0100
+++ b/kallithea/templates/email_templates/pull_request.txt	Tue Feb 06 22:00:01 2018 +0100
@@ -3,18 +3,19 @@
 <%include file="header.txt" args="title=title,link=pr_url"/>\
 </%block>\
 
-${_('Pull request from')|n,unicode} \
+${_('Pull request')|n,unicode} \
+${pr_nice_id|n,unicode} \
+"${pr_title|n,unicode}" \
+${_('by')|n,unicode} \
+${pr_owner.full_name_and_username|n,unicode}
+${_('from')} \
 ${pr_source_repo|n,unicode} \
 ${_('branch')|n,unicode} \
-${pr_source_branch|n,unicode} \
+${pr_source_branch|n,unicode}
 ${_('to')|n,unicode} \
 ${pr_target_repo|n,unicode} \
 ${_('branch')|n,unicode} \
-${pr_target_branch|n,unicode}:
-${pr_nice_id|n,unicode} \
-"${pr_title|n,unicode}" \
-${_('by')|n,unicode} \
-${pr_owner.full_name_and_username|n,unicode}.
+${pr_target_branch|n,unicode}
 
 
 ${_('Description')|n,unicode}:
--- a/kallithea/templates/email_templates/pull_request_comment.html	Tue Feb 06 21:42:50 2018 +0100
+++ b/kallithea/templates/email_templates/pull_request_comment.html	Tue Feb 06 22:00:01 2018 +0100
@@ -17,23 +17,25 @@
     <tr>
         <td>
             <div>
-                ${_('Pull request from')}
+                ${_('Pull request')}
+                <a style="${link_style}"
+                   href="${pr_url}">${pr_nice_id} "${pr_title}"</a>
+                ${_('by')}
+                <span style="${data_style}">${pr_owner.full_name_and_username}</span>.
+            </div>
+            <div>
+                ${_('from')}
                 <a style="${link_text_style}"
                    href="${pr_source_repo}">${pr_source_repo}</a>
                 ${_('branch')}
                 <span style="${data_style}">${pr_source_branch}</span>
+                <br/>
                 ${_('to')}
                 <a style="${link_text_style}"
                    href="${pr_target_repo}">${pr_target_repo}</a>
                 ${_('branch')}
                 <span style="${data_style}">${pr_target_branch}</span>:
             </div>
-            <div>
-                <a style="${link_style}"
-                   href="${pr_url}">${pr_nice_id} "${pr_title}"</a>
-                ${_('by')}
-                <span style="${data_style}">${pr_owner.full_name_and_username}</span>.
-            </div>
         </td>
     </tr>
     <tr>
--- a/kallithea/templates/email_templates/pull_request_comment.txt	Tue Feb 06 21:42:50 2018 +0100
+++ b/kallithea/templates/email_templates/pull_request_comment.txt	Tue Feb 06 22:00:01 2018 +0100
@@ -5,17 +5,18 @@
 
 <%include file="comment.txt" args="text=body,author=pr_comment_user,status=status_change,close=closing_pr"/>\
 
-${_('Pull request from')|n,unicode} \
+${_('Pull request')|n,unicode} \
+${pr_nice_id|n,unicode} \
+"${pr_title|n,unicode}" \
+${_('by')|n,unicode} \
+${pr_owner.full_name_and_username|n,unicode}
+${_('from')} \
 ${pr_source_repo|n,unicode} \
 ${_('branch')|n,unicode} \
-${pr_source_branch|n,unicode} \
+${pr_source_branch|n,unicode}
 ${_('to')|n,unicode} \
 ${pr_target_repo|n,unicode} \
 ${_('branch')|n,unicode} \
-${pr_target_branch|n,unicode}:
-${pr_nice_id|n,unicode} \
-"${pr_title|n,unicode}" \
-${_('by')|n,unicode} \
-${pr_owner.full_name_and_username|n,unicode}.
+${pr_target_branch|n,unicode}
 
 <%include file="button.txt" args="url=pr_comment_url,title=_('View Comment')"/>\
--- a/kallithea/tests/models/test_dump_html_mails.ref.html	Tue Feb 06 21:42:50 2018 +0100
+++ b/kallithea/tests/models/test_dump_html_mails.ref.html	Tue Feb 06 22:00:01 2018 +0100
@@ -891,8 +891,9 @@
 Added as Reviewer of Pull Request #7 "The Title" by Requesting User (root)
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 Description:
@@ -956,23 +957,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr><td height="10px" style="height:10px"></td></tr>
@@ -1079,8 +1082,9 @@
 Mention on Pull Request #7 "The Title" by Requesting User (root)
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 Description:
@@ -1144,23 +1148,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr><td height="10px" style="height:10px"></td></tr>
@@ -1274,8 +1280,9 @@
  - and indented on second line
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 View Comment: http://pr.org/comment
@@ -1362,23 +1369,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>:
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr>
@@ -1438,8 +1447,9 @@
  - and indented on second line
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 View Comment: http://pr.org/comment
@@ -1526,23 +1536,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>:
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr>
@@ -1604,8 +1616,9 @@
  - and indented on second line
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 View Comment: http://pr.org/comment
@@ -1708,23 +1721,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>:
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr>
@@ -1786,8 +1801,9 @@
  - and indented on second line
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 View Comment: http://pr.org/comment
@@ -1890,23 +1906,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>:
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr>
@@ -1968,8 +1986,9 @@
  - and indented on second line
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 View Comment: http://pr.org/comment
@@ -2071,23 +2090,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>:
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr>
@@ -2149,8 +2170,9 @@
  - and indented on second line
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 View Comment: http://pr.org/comment
@@ -2252,23 +2274,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>:
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr>
@@ -2332,8 +2356,9 @@
  - and indented on second line
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 View Comment: http://pr.org/comment
@@ -2439,23 +2464,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>:
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr>
@@ -2519,8 +2546,9 @@
  - and indented on second line
 
 
-Pull request from https://dev.org/repo branch devbranch to http://mainline.com/repo branch trunk:
-#7 "The Title" by u2 u3 (u2).
+Pull request #7 "The Title" by u2 u3 (u2)
+from https://dev.org/repo branch devbranch
+to http://mainline.com/repo branch trunk
 
 
 View Comment: http://pr.org/comment
@@ -2626,23 +2654,25 @@
     <tr>
         <td>
             <div>
-                Pull request from
+                Pull request
+                <a style="color:#395fa0;text-decoration:none"
+                   href="http://pr.org/7">#7 "The Title"</a>
+                by
+                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
+            </div>
+            <div>
+                from
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="https://dev.org/repo">https://dev.org/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
+                <br/>
                 to
                 <a style="color:#202020;text-decoration:none;border:#ddd 1px solid;background:#f9f9f9"
                    href="http://mainline.com/repo">http://mainline.com/repo</a>
                 branch
                 <span style="border:#ddd 1px solid;background:#f9f9f9">trunk</span>:
             </div>
-            <div>
-                <a style="color:#395fa0;text-decoration:none"
-                   href="http://pr.org/7">#7 "The Title"</a>
-                by
-                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
-            </div>
         </td>
     </tr>
     <tr>