Changeset - 3a3d9c8432ed
[Not reviewed]
default
0 6 0
Thomas De Schampheleire - 8 years ago 2018-02-06 20:53:54
thomas.de_schampheleire@nokia.com
HTML email templates: don't use link color for non-links

The link color should only be used for actual hyperlinks.
Using it for anything else is very confusing for users.

For text like repository names, branch names, etc. introduce a new style
'data_style' that is normal text with a grey background and border.
6 files changed with 53 insertions and 52 deletions:
0 comments (0 inline, 0 general)
kallithea/model/notification.py
Show inline comments
 
@@ -335,12 +335,13 @@ class EmailNotificationModel(object):
 
                "monospace_style": "font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace",
 
                "sans_style": "font-family:Helvetica,Arial,sans-serif",
 
                })
 
            _kwargs.update({
 
                "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,
 
                "data_style": "border:%(color_border)s 1px solid;background:%(color_background_grey)s" % _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)
 
        return email_template.render_unicode(**_kwargs)
kallithea/templates/email_templates/changeset_comment.html
Show inline comments
 
@@ -18,19 +18,19 @@
 
        <td>
 
            <div>
 
                ${_('Changeset on')}
 
                <a style="${link_style}"
 
                   href="${cs_target_repo}">${cs_target_repo}</a>
 
                ${_('branch')}
 
                <span style="color:${color_link}">${branch}</span>:
 
                <span style="${data_style}">${branch}</span>:
 
            </div>
 
            <div>
 
                "<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>.
 
                <span style="${data_style}">${cs_author.full_name_and_username}</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<%include file="button.html" args="url=cs_comment_url,title=_('View Comment'),padding_bottom=False"/>\
kallithea/templates/email_templates/pull_request.html
Show inline comments
 
@@ -10,25 +10,25 @@
 
        <td>
 
            <div>
 
                ${_('Pull request from')}
 
                <a style="${link_style}"
 
                   href="${pr_source_repo}">${pr_source_repo}</a>
 
                ${_('at')}
 
                <span style="color:${color_link}">${pr_source_branch}</span>
 
                <span style="${data_style}">${pr_source_branch}</span>
 
                ${_('to')}
 
                <a style="${link_style}"
 
                   href="${pr_target_repo}">${pr_target_repo}</a>
 
                ${_('at')}
 
                <span style="color:${color_link}">${pr_target_branch}</span>:
 
                <span style="${data_style}">${pr_target_branch}</span>
 
            </div>
 
            <div>
 
                <a style="${link_style}"
 
                   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>.
 
                <span style="${data_style}">${pr_owner.full_name_and_username}</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
kallithea/templates/email_templates/pull_request_comment.html
Show inline comments
 
@@ -18,25 +18,25 @@
 
        <td>
 
            <div>
 
                ${_('Pull request from')}
 
                <a style="${link_style}"
 
                   href="${pr_source_repo}">${pr_source_repo}</a>
 
                ${_('branch')}
 
                <span style="color:${color_link}">${pr_source_branch}</span>
 
                <span style="${data_style}">${pr_source_branch}</span>
 
                ${_('to')}
 
                <a style="${link_style}"
 
                   href="${pr_target_repo}">${pr_target_repo}</a>
 
                ${_('branch')}
 
                <span style="color:${color_link}">${pr_target_branch}</span>:
 
                <span style="${data_style}">${pr_target_branch}</span>:
 
            </div>
 
            <div>
 
                <a style="${link_style}"
 
                   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>.
 
                <span style="${data_style}">${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"/>\
kallithea/templates/email_templates/registration.html
Show inline comments
 
@@ -7,35 +7,35 @@
 
\
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
            ${_('Username')}:
 
        </td>
 
        <td style="color:${color_link}">
 
        <td style="${data_style}">
 
            ${new_username}
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="2"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            ${_('Full Name')}:
 
        </td>
 
        <td style="color:${color_link}">
 
        <td style="${data_style}">
 
            ${new_full_name}
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="2"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            ${_('Email')}:
 
        </td>
 
        <td style="color:${color_link}">
 
        <td style="${data_style}">
 
            ${new_email}
 
        </td>
 
    </tr>
 
    <tr>
 
        <td colspan="2">
 
<%include file="button.html" args="url=registered_user_url,title=_('View User Profile'),padding_bottom=False"/>\
kallithea/tests/models/test_dump_html_mails.ref.html
Show inline comments
 
@@ -111,19 +111,19 @@ View Comment: http://comment.org
 
        <td>
 
            <div>
 
                Changeset on
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://example.com/repo_target">http://example.com/repo_target</a>
 
                branch
 
                <span style="color:#395fa0">brunch</span>:
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">brunch</span>:
 
            </div>
 
            <div>
 
                "<a style="color:#395fa0;text-decoration:none"
 
                   href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -270,19 +270,19 @@ View Comment: http://comment.org
 
        <td>
 
            <div>
 
                Changeset on
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://example.com/repo_target">http://example.com/repo_target</a>
 
                branch
 
                <span style="color:#395fa0">brunch</span>:
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">brunch</span>:
 
            </div>
 
            <div>
 
                "<a style="color:#395fa0;text-decoration:none"
 
                   href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -447,19 +447,19 @@ View Comment: http://comment.org
 
        <td>
 
            <div>
 
                Changeset on
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://example.com/repo_target">http://example.com/repo_target</a>
 
                branch
 
                <span style="color:#395fa0">brunch</span>:
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">brunch</span>:
 
            </div>
 
            <div>
 
                "<a style="color:#395fa0;text-decoration:none"
 
                   href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -624,19 +624,19 @@ View Comment: http://comment.org
 
        <td>
 
            <div>
 
                Changeset on
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://example.com/repo_target">http://example.com/repo_target</a>
 
                branch
 
                <span style="color:#395fa0">brunch</span>:
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">brunch</span>:
 
            </div>
 
            <div>
 
                "<a style="color:#395fa0;text-decoration:none"
 
                   href="http://changeset.com">This changeset did something clever which is hard to explain</a>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -812,35 +812,35 @@ View User Profile: http://newbie.org
 
                    <td>
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">
 
    <tr>
 
        <td>
 
            Username:
 
        </td>
 
        <td style="color:#395fa0">
 
        <td style="border:#ddd 1px solid;background:#f9f9f9">
 
            newbie
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="2"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            Full Name:
 
        </td>
 
        <td style="color:#395fa0">
 
        <td style="border:#ddd 1px solid;background:#f9f9f9">
 
            New Full Name
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="2"></td>
 
    </tr>
 
    <tr>
 
        <td>
 
            Email:
 
        </td>
 
        <td style="color:#395fa0">
 
        <td style="border:#ddd 1px solid;background:#f9f9f9">
 
            new@email.com
 
        </td>
 
    </tr>
 
    <tr>
 
        <td colspan="2">
 
<center>
 
@@ -957,25 +957,25 @@ View Pull Request: http://pr.org/7
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                at
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                at
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
 
@@ -1146,25 +1146,25 @@ View Pull Request: http://pr.org/7
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                at
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                at
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
 
@@ -1365,25 +1365,25 @@ View Comment: http://pr.org/comment
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -1530,25 +1530,25 @@ View Comment: http://pr.org/comment
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -1713,25 +1713,25 @@ View Comment: http://pr.org/comment
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -1896,25 +1896,25 @@ View Comment: http://pr.org/comment
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -2078,25 +2078,25 @@ View Comment: http://pr.org/comment
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -2260,25 +2260,25 @@ View Comment: http://pr.org/comment
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -2448,25 +2448,25 @@ View Comment: http://pr.org/comment
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
 
@@ -2636,25 +2636,25 @@ View Comment: http://pr.org/comment
 
        <td>
 
            <div>
 
                Pull request from
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="https://dev.org/repo">https://dev.org/repo</a>
 
                branch
 
                <span style="color:#395fa0">devbranch</span>
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">devbranch</span>
 
                to
 
                <a style="color:#395fa0;text-decoration:none"
 
                   href="http://mainline.com/repo">http://mainline.com/repo</a>
 
                branch
 
                <span style="color:#395fa0">trunk</span>:
 
                <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</a>
 
                "<span style="color:#395fa0">The Title</span>"
 
                by
 
                <span style="color:#395fa0">u2 u3 (u2)</span>.
 
                <span style="border:#ddd 1px solid;background:#f9f9f9">u2 u3 (u2)</span>.
 
            </div>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td>
 
<center>
0 comments (0 inline, 0 general)