Files @ 9cef5615da7b
Branch filter:

Location: kallithea/kallithea/templates/email_templates/pull_request_comment.html

Thomas De Schampheleire
issues: simplify example in ini file

The example setting from the default ini file is:
issue_pat = (?:\s*#)(\d+)
issue_server_link = https://issues.example.com/{repo}/issue/{id}
issue_prefix = #

in which the clause '(?:\s*#)' is overly complex:
1. '\s*' means optional whitespace, which means there can be whitespace or
no whitespace, which means that you could equally write:
(?:#)(\d+)
(If any leading whitespace was eaten by the regexp, 32e1e0745d3c would take
care to restore a part of it.)
2. '(?:xxx)' means a non-capturing set of parentheses. In this case this is
equal to just mentioning 'xxx'. So the simplified pattern becomes:
#(\d+)

If instead of _optional_ whitespace, _mandatory_ whitespace was intended,
then the pattern should be different. But this would also mean that
patterns like PR#123 would not be matched anymore.
<%inherit file="main.html"/>\
\
<%block name="header">\
<% title = _('Mention in Comment on Pull Request %s "%s"') % (pr_nice_id, pr_title) if is_mention else _('Pull Request %s "%s" Closed') % (pr_nice_id, pr_title) if closing_pr else _('Comment on Pull Request %s "%s"') % (pr_nice_id, pr_title) %>\
<%include file="header.html" args="title=title,link=pr_comment_url"/>\
</%block>\
\
<table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
        <td>
<%include file="comment.html" args="text=body,author=pr_comment_user,status=status_change,close=closing_pr"/>\
        </td>
    </tr>
    <tr>
        <td height="30px" style="height:30px"></td>
    </tr>
    <tr>
        <td>
            <div>
                ${_('Pull request from')}
                <a style="color:${color_link};text-decoration:none"
                   href="${pr_source_repo}">${pr_source_repo}</a>
                ${_('branch')}
                <span style="color:${color_link}">${pr_source_branch}</span>
                ${_('to')}
                <a style="color:${color_link};text-decoration:none"
                   href="${pr_target_repo}">${pr_target_repo}</a>
                ${_('branch')}
                <span style="color:${color_link}">${pr_target_branch}</span>:
            </div>
            <div>
                <a style="color:${color_link};text-decoration:none"
                   href="${pr_url}">${pr_nice_id}</a>
                "<span style="color:${color_link}">${pr_title}</span>"
                ${_('by')}
                <span style="color:${color_link}">${pr_owner.full_name_and_username}</span>.
            </div>
        </td>
    </tr>
    <tr>
        <td>
<%include file="button.html" args="url=pr_comment_url,title=_('View Comment'),padding_bottom=False"/>\
        </td>
    </tr>
</table>