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
 
@@ -338,6 +338,7 @@ class EmailNotificationModel(object):
 
            _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,
 
                })
kallithea/templates/email_templates/changeset_comment.html
Show inline comments
 
@@ -21,13 +21,13 @@
 
                <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>
kallithea/templates/email_templates/pull_request.html
Show inline comments
 
@@ -13,19 +13,19 @@
 
                <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>
kallithea/templates/email_templates/pull_request_comment.html
Show inline comments
 
@@ -21,19 +21,19 @@
 
                <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>
kallithea/templates/email_templates/registration.html
Show inline comments
 
@@ -10,7 +10,7 @@
 
        <td>
 
            ${_('Username')}:
 
        </td>
 
        <td style="color:${color_link}">
 
        <td style="${data_style}">
 
            ${new_username}
 
        </td>
 
    </tr>
 
@@ -21,7 +21,7 @@
 
        <td>
 
            ${_('Full Name')}:
 
        </td>
 
        <td style="color:${color_link}">
 
        <td style="${data_style}">
 
            ${new_full_name}
 
        </td>
 
    </tr>
 
@@ -32,7 +32,7 @@
 
        <td>
 
            ${_('Email')}:
 
        </td>
 
        <td style="color:${color_link}">
 
        <td style="${data_style}">
 
            ${new_email}
 
        </td>
 
    </tr>
kallithea/tests/models/test_dump_html_mails.ref.html
Show inline comments
 
@@ -114,13 +114,13 @@ View Comment: http://comment.org
 
                <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>
 
@@ -273,13 +273,13 @@ View Comment: http://comment.org
 
                <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>
 
@@ -450,13 +450,13 @@ View Comment: http://comment.org
 
                <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>
 
@@ -627,13 +627,13 @@ View Comment: http://comment.org
 
                <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>
 
@@ -815,7 +815,7 @@ View User Profile: http://newbie.org
 
        <td>
 
            Username:
 
        </td>
 
        <td style="color:#395fa0">
 
        <td style="border:#ddd 1px solid;background:#f9f9f9">
 
            newbie
 
        </td>
 
    </tr>
 
@@ -826,7 +826,7 @@ View User Profile: http://newbie.org
 
        <td>
 
            Full Name:
 
        </td>
 
        <td style="color:#395fa0">
 
        <td style="border:#ddd 1px solid;background:#f9f9f9">
 
            New Full Name
 
        </td>
 
    </tr>
 
@@ -837,7 +837,7 @@ View User Profile: http://newbie.org
 
        <td>
 
            Email:
 
        </td>
 
        <td style="color:#395fa0">
 
        <td style="border:#ddd 1px solid;background:#f9f9f9">
 
            new@email.com
 
        </td>
 
    </tr>
 
@@ -960,19 +960,19 @@ View Pull Request: http://pr.org/7
 
                <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>
 
@@ -1149,19 +1149,19 @@ View Pull Request: http://pr.org/7
 
                <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>
 
@@ -1368,19 +1368,19 @@ View Comment: http://pr.org/comment
 
                <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>
 
@@ -1533,19 +1533,19 @@ View Comment: http://pr.org/comment
 
                <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>
 
@@ -1716,19 +1716,19 @@ View Comment: http://pr.org/comment
 
                <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>
 
@@ -1899,19 +1899,19 @@ View Comment: http://pr.org/comment
 
                <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>
 
@@ -2081,19 +2081,19 @@ View Comment: http://pr.org/comment
 
                <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>
 
@@ -2263,19 +2263,19 @@ View Comment: http://pr.org/comment
 
                <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>
 
@@ -2451,19 +2451,19 @@ View Comment: http://pr.org/comment
 
                <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>
 
@@ -2639,19 +2639,19 @@ View Comment: http://pr.org/comment
 
                <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>
0 comments (0 inline, 0 general)