Changeset - 2b2e37660e95
[Not reviewed]
default
0 5 0
Thomas De Schampheleire - 8 years ago 2018-02-13 11:09:14
thomas.de_schampheleire@nokia.com
HTML email templates: introduce link_style variable

Avoid repetition inside the templates and simplify future refactoring by
using 'style' variables provided by the model.
5 files changed with 11 insertions and 10 deletions:
0 comments (0 inline, 0 general)
kallithea/model/notification.py
Show inline comments
 
@@ -339,6 +339,7 @@ class EmailNotificationModel(object):
 
                "default_style": "%(sans_style)s;font-weight:200;font-size:14px;line-height:17px;color:%(color_text)s" % _kwargs,
 
                "comment_style": "%(monospace_style)s;white-space:pre-wrap" % _kwargs,
 
                "emph_style": "font-weight:600;color:%(color_emph)s" % _kwargs,
 
                "link_style": "color:%(color_link)s;text-decoration:none" % _kwargs,
 
                })
 

	
 
        log.debug('rendering tmpl %s with kwargs %s', base, _kwargs)
kallithea/templates/email_templates/changeset_comment.html
Show inline comments
 
@@ -18,13 +18,13 @@
 
        <td>
 
            <div>
 
                ${_('Changeset on')}
 
                <a style="color:${color_link};text-decoration:none"
 
                <a style="${link_style}"
 
                   href="${cs_target_repo}">${cs_target_repo}</a>
 
                ${_('branch')}
 
                <span style="color:${color_link}">${branch}</span>:
 
            </div>
 
            <div>
 
                "<a style="color:${color_link};text-decoration:none"
 
                "<a style="${link_style}"
 
                   href="${cs_url}">${h.shorter(message, 60, firstline=True)}</a>"
 
                ${_('by')}
 
                <span style="color:${color_link}">${cs_author.full_name_and_username}</span>.
kallithea/templates/email_templates/password_reset.html
Show inline comments
 
@@ -27,7 +27,7 @@
 
                <div>
 
                    ${_('To set a new password, click the following link')}:
 
                    <br/>
 
                    <a style="color:${color_link};text-decoration:none" href="${reset_url}"
 
                    <a style="${link_style}" href="${reset_url}"
 
                        target="_blank">${reset_url}</a>
 
                    <br/>
 
                    ${_("Should you not be able to use the link above, please type the following code into the password reset form")}:
kallithea/templates/email_templates/pull_request.html
Show inline comments
 
@@ -10,18 +10,18 @@
 
        <td>
 
            <div>
 
                ${_('Pull request from')}
 
                <a style="color:${color_link};text-decoration:none"
 
                <a style="${link_style}"
 
                   href="${pr_source_repo}">${pr_source_repo}</a>
 
                ${_('at')}
 
                <span style="color:${color_link}">${pr_source_branch}</span>
 
                ${_('to')}
 
                <a style="color:${color_link};text-decoration:none"
 
                <a style="${link_style}"
 
                   href="${pr_target_repo}">${pr_target_repo}</a>
 
                ${_('at')}
 
                <span style="color:${color_link}">${pr_target_branch}</span>:
 
            </div>
 
            <div>
 
                <a style="color:${color_link};text-decoration:none"
 
                <a style="${link_style}"
 
                   href="${pr_url}">${pr_nice_id}</a>
 
                "<span style="color:${color_link}">${pr_title}</span>"
 
                ${_('by')}
 
@@ -56,7 +56,7 @@
 
            <ul style="color:${color_link};padding-left:15px;margin:0">
 
                %for revision, desc in pr_revisions:
 
                    <li style="mso-special-format:bullet">
 
                        <a style="color:${color_link};text-decoration:none"
 
                        <a style="${link_style}"
 
                           href="${h.canonical_url('changeset_home', repo_name=org_repo_name, revision=revision)}">
 
                            ${h.shorter(desc, 80, firstline=True)}
 
                        </a>
kallithea/templates/email_templates/pull_request_comment.html
Show inline comments
 
@@ -18,18 +18,18 @@
 
        <td>
 
            <div>
 
                ${_('Pull request from')}
 
                <a style="color:${color_link};text-decoration:none"
 
                <a style="${link_style}"
 
                   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"
 
                <a style="${link_style}"
 
                   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"
 
                <a style="${link_style}"
 
                   href="${pr_url}">${pr_nice_id}</a>
 
                "<span style="color:${color_link}">${pr_title}</span>"
 
                ${_('by')}
0 comments (0 inline, 0 general)