# HG changeset patch # User Kateryna Musina # Date 1457965822 -3600 # Node ID c82f90f4fc19de508970564c58d5d13d0b8b794f # Parent 8b75085c2c026fa0cae75f6fa56728297e9e451f notifications: new email templates with html styling - with heavy interfering and hacking by Mads Kiilerich. diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/model/notification.py --- a/kallithea/model/notification.py Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/model/notification.py Mon Mar 14 15:30:22 2016 +0100 @@ -326,5 +326,21 @@ 'h': h, 'c': c} _kwargs.update(kwargs) + if content_type == 'html': + _kwargs.update({ + "color_text": "#202020", + "color_emph": "#395fa0", + "color_link": "#395fa0", + "color_border": "#ddd", + "color_background_grey": "#f9f9f9", + "color_button": "#395fa0", + "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, + }) + log.debug('rendering tmpl %s with kwargs %s', base, _kwargs) return email_template.render(**_kwargs) diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/templates/email_templates/button.html --- a/kallithea/templates/email_templates/button.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/templates/email_templates/button.html Mon Mar 14 15:30:22 2016 +0100 @@ -1,8 +1,26 @@ <%page args="url,title='',padding_top=True,padding_bottom=True" />\ ## -

- - ${_(title)} + + %if padding_top: + + + + %endif + + + + %if padding_bottom: + + + + %endif +
+ +
+ + ${_(title)} + +
-

+
## diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/templates/email_templates/changeset_comment.html --- a/kallithea/templates/email_templates/changeset_comment.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/templates/email_templates/changeset_comment.html Mon Mar 14 15:30:22 2016 +0100 @@ -5,15 +5,35 @@ <%include file="header.html" args="title=title,link=cs_comment_url"/>\ \ \ + + + + + + + + + + + + + +
<%include file="comment.html" args="text=body,author=cs_comment_user,status=status_change"/>\ -

+

+
${_('Changeset on')} - ${cs_target_repo} + ${cs_target_repo} ${_('branch')} - ${branch}: -
- "${h.shorter(message, 60, firstline=True)}" + ${branch}: +
+
+ "${h.shorter(message, 60, firstline=True)}" ${_('by')} - ${cs_author.full_name_and_username}. -

+ ${cs_author.full_name_and_username}. +
+
<%include file="button.html" args="url=cs_comment_url,title=_('View Comment'),padding_bottom=False"/>\ +
diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/templates/email_templates/comment.html --- a/kallithea/templates/email_templates/comment.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/templates/email_templates/comment.html Mon Mar 14 15:30:22 2016 +0100 @@ -1,17 +1,57 @@ <%page args="author,text,status,close=False" />\ \ ## -

+ + + + + + + + + + + + +
%if link is not None: - ${title} %else: - ${title} + ${title} %endif - +
## diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/templates/email_templates/main.html --- a/kallithea/templates/email_templates/main.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/templates/email_templates/main.html Mon Mar 14 15:30:22 2016 +0100 @@ -6,8 +6,37 @@ + + + + + + +
+ + + + + + + + + + + + + + + + +
+<%block name="header"/>\ +
## ${self.body()}\ ## +
+
diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/templates/email_templates/password_reset.html --- a/kallithea/templates/email_templates/password_reset.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/templates/email_templates/password_reset.html Mon Mar 14 15:30:22 2016 +0100 @@ -4,23 +4,44 @@ <%include file="header.html" args="title=_('Password Reset Request'),link=None"/>\ \ \ -

${_('Hello %s') % user},

-

- ${_('We have received a request to reset the password for your account.')} -

-

- + + + + + + + + + + + + + + + + + + + + + + +
${_('Hello %s') % user},
+ ${_('We have received a request to reset the password for your account.')} +
%if reset_token is None: - ${_('This account is however managed outside this system and the password cannot be changed here.')} +
${_('This account is however managed outside this system and the password cannot be changed here.')}
%else: +
${_('To set a new password, click the following link')}:
- ${reset_url}
${_("Should you not be able to use the link above, please type the following code into the password reset form")}: ${reset_token} +
%endif -

- ${_("If it weren't you who requested the password reset, just disregard this message.")} -

+
+ ${_("If it weren't you who requested the password reset, just disregard this message.")} +
diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/templates/email_templates/pull_request.html --- a/kallithea/templates/email_templates/pull_request.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/templates/email_templates/pull_request.html Mon Mar 14 15:30:22 2016 +0100 @@ -5,33 +5,69 @@ <%include file="header.html" args="title=title,link=pr_url"/>\ \ \ -

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
${_('Pull request from')} - ${pr_source_repo} + ${pr_source_repo} ${_('at')} - ${pr_source_branch} + ${pr_source_branch} ${_('to')} - ${pr_target_repo} + ${pr_target_repo} ${_('at')} - ${pr_target_branch}: -
- ${pr_nice_id} - "${pr_title}" + ${pr_target_branch}: +
+
+ ${pr_nice_id} + "${pr_title}" ${_('by')} - ${pr_owner.full_name_and_username}. -

-

+ ${pr_owner.full_name_and_username}. +

+
+
${_('Description')}: -

-
${body}
-

${_('Changesets')}:

-
    +
+
+
${body}
+
+
${_('Changesets')}:
+
+ +
<%include file="button.html" args="url=pr_url,title=_('View Pull Request'),padding_bottom=False"/>\ +
diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/templates/email_templates/pull_request_comment.html --- a/kallithea/templates/email_templates/pull_request_comment.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/templates/email_templates/pull_request_comment.html Mon Mar 14 15:30:22 2016 +0100 @@ -5,20 +5,41 @@ <%include file="header.html" args="title=title,link=pr_comment_url"/>\ \ \ + + + + + + + + + + + + + +
<%include file="comment.html" args="text=body,author=pr_comment_user,status=status_change,close=closing_pr"/>\ -

+

+
${_('Pull request from')} - ${pr_source_repo} - ${_('at')} - ${pr_source_branch} + ${pr_source_repo} + ${_('branch')} + ${pr_source_branch} ${_('to')} - ${pr_target_repo} - ${_('at')} - ${pr_target_branch}: -
- ${pr_nice_id} - "${pr_title}" + ${pr_target_repo} + ${_('branch')} + ${pr_target_branch}: +
+
+ ${pr_nice_id} + "${pr_title}" ${_('by')} - ${pr_owner.full_name_and_username}. -

+ ${pr_owner.full_name_and_username}. +
+
<%include file="button.html" args="url=pr_comment_url,title=_('View Comment'),padding_bottom=False"/>\ +
diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/templates/email_templates/registration.html --- a/kallithea/templates/email_templates/registration.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/templates/email_templates/registration.html Mon Mar 14 15:30:22 2016 +0100 @@ -5,19 +5,40 @@ <%include file="header.html" args="title=_('New User Registration'),link=registered_user_url"/>\ \ \ -

+ + + + + + + + + + + + + + + + + + + + + + +
${_('Username')}: -
+
${new_username} -

-

+

${_('Full Name')}: -
+
${new_full_name} -

-

+

${_('Email')}: -
+
${new_email} -

+
<%include file="button.html" args="url=registered_user_url,title=_('View User Profile'),padding_bottom=False"/>\ +
diff -r 8b75085c2c02 -r c82f90f4fc19 kallithea/tests/models/test_dump_html_mails.ref.html --- a/kallithea/tests/models/test_dump_html_mails.ref.html Thu Jul 28 16:44:24 2016 +0200 +++ b/kallithea/tests/models/test_dump_html_mails.ref.html Mon Mar 14 15:30:22 2016 +0100 @@ -37,29 +37,127 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Comment on Changeset "This changeset did something clever which is hard to explain" - -

Opinionated User (jsmith)

-
This is the new comment. +
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
This is the new comment. - and here it ends indented.
-

+

+
+
Changeset on - repo_target + repo_target branch - brunch: -
- "This changeset did something clever which is hard to explain" + brunch: +
+ +
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -98,29 +196,127 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Mention in Comment on Changeset "This changeset did something clever which is hard to explain" - -

Opinionated User (jsmith)

-
This is the new comment. +
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
This is the new comment. - and here it ends indented.
-

+

+
+
Changeset on - repo_target + repo_target branch - brunch: -
- "This changeset did something clever which is hard to explain" + brunch: +
+ +
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -161,33 +357,143 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Comment on Changeset "This changeset did something clever which is hard to explain" - -

Opinionated User (jsmith)

-

+

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
Status change: Approved -

-
This is the new comment. +
+
+
This is the new comment. - and here it ends indented.
-

+

+
+
Changeset on - repo_target + repo_target branch - brunch: -
- "This changeset did something clever which is hard to explain" + brunch: +
+ +
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -228,33 +534,143 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Mention in Comment on Changeset "This changeset did something clever which is hard to explain" - -

Opinionated User (jsmith)

-

+

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
Status change: Approved -

-
This is the new comment. +
+
+
This is the new comment. - and here it ends indented.
-

+

+
+
Changeset on - repo_target + repo_target branch - brunch: -
- "This changeset did something clever which is hard to explain" + brunch: +
+ +
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -277,11 +693,56 @@ -

- Message -

-
This is the body of the test message - - nothing interesting here except indentation.
+ + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Message +
+
+ + + + +
This is the body of the test message + - nothing interesting here except indentation.
+
+

@@ -316,30 +777,103 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ New User Registration - -

+

+
+ + + + + + + + + + + + + + + + + + + + + + +
Username: -
+
newbie -

-

+

Full Name: -
+
New Full Name -

-

+

Email: -
+
new@email.com -

-

- - View User Profile +

+ + + + + + + +
+ +
+ + View User Profile + +
-

+
+
+
+ + + +
@@ -383,48 +917,137 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Added as Reviewer of Pull Request #7 "The Title" by Requesting User (root) - -

+

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
Pull request from - https://dev.org/repo - at - devbranch - to - http://mainline.com/repo + https://dev.org/repo at - trunk: -
- #7 - "The Title" + devbranch + to + http://mainline.com/repo + at + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

+ u2 u3 (u2). +

+
+
Description: -

-
This PR is awesome because it does stuff +
+
+
This PR is awesome because it does stuff - please approve indented!
-

Changesets:

-
    +
+
Changesets:
+
+ -

- - View Pull Request +

+ + + + + + + +
+ +
+ + View Pull Request + +
-

+
+
+
+ + + +
@@ -468,48 +1091,137 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Mention on Pull Request #7 "The Title" by Requesting User (root) - -

+

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
Pull request from - https://dev.org/repo - at - devbranch - to - http://mainline.com/repo + https://dev.org/repo at - trunk: -
- #7 - "The Title" + devbranch + to + http://mainline.com/repo + at + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

+ u2 u3 (u2). +

+
+
Description: -

-
This PR is awesome because it does stuff +
+
+
This PR is awesome because it does stuff - please approve indented!
-

Changesets:

-
    +
+
Changesets:
+
+ -

- - View Pull Request +

+ + + + + + + +
+ +
+ + View Pull Request + +
-

+
+
+
+ + + +
@@ -548,34 +1260,133 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Comment on Pull Request #7 "The Title" - -

Opinionated User (jsmith)

-
Me too! +
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
Me too! - and indented on second line
-

+

+
+
Pull request from - https://dev.org/repo - at - devbranch + https://dev.org/repo + branch + devbranch to - http://mainline.com/repo - at - trunk: -
- #7 - "The Title" + http://mainline.com/repo + branch + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

- - View Comment + u2 u3 (u2). +

+
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -614,34 +1425,133 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Mention in Comment on Pull Request #7 "The Title" - -

Opinionated User (jsmith)

-
Me too! +
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
Me too! - and indented on second line
-

+

+
+
Pull request from - https://dev.org/repo - at - devbranch + https://dev.org/repo + branch + devbranch to - http://mainline.com/repo - at - trunk: -
- #7 - "The Title" + http://mainline.com/repo + branch + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

- - View Comment + u2 u3 (u2). +

+
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -682,38 +1592,149 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Comment on Pull Request #7 "The Title" - -

Opinionated User (jsmith)

-

+

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
Status change: Under Review -

-
Me too! +
+
+
Me too! - and indented on second line
-

+

+
+
Pull request from - https://dev.org/repo - at - devbranch + https://dev.org/repo + branch + devbranch to - http://mainline.com/repo - at - trunk: -
- #7 - "The Title" + http://mainline.com/repo + branch + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

- - View Comment + u2 u3 (u2). +

+
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -754,38 +1775,149 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Mention in Comment on Pull Request #7 "The Title" - -

Opinionated User (jsmith)

-

+

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
Status change: Under Review -

-
Me too! +
+
+
Me too! - and indented on second line
-

+

+
+
Pull request from - https://dev.org/repo - at - devbranch + https://dev.org/repo + branch + devbranch to - http://mainline.com/repo - at - trunk: -
- #7 - "The Title" + http://mainline.com/repo + branch + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

- - View Comment + u2 u3 (u2). +

+
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -826,37 +1958,148 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Pull Request #7 "The Title" Closed - -

Opinionated User (jsmith)

-

+

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
The pull request has been closed. -

-
Me too! +
+
+
Me too! - and indented on second line
-

+

+
+
Pull request from - https://dev.org/repo - at - devbranch + https://dev.org/repo + branch + devbranch to - http://mainline.com/repo - at - trunk: -
- #7 - "The Title" + http://mainline.com/repo + branch + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

- - View Comment + u2 u3 (u2). +

+
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -897,37 +2140,148 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Mention in Comment on Pull Request #7 "The Title" - -

Opinionated User (jsmith)

-

+

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
The pull request has been closed. -

-
Me too! +
+
+
Me too! - and indented on second line
-

+

+
+
Pull request from - https://dev.org/repo - at - devbranch + https://dev.org/repo + branch + devbranch to - http://mainline.com/repo - at - trunk: -
- #7 - "The Title" + http://mainline.com/repo + branch + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

- - View Comment + u2 u3 (u2). +

+
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -970,41 +2324,152 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Pull Request #7 "The Title" Closed - -

Opinionated User (jsmith)

-

+

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
Status change: Under Review -

-

+

+
The pull request has been closed. -

-
Me too! +
+
+
Me too! - and indented on second line
-

+

+
+
Pull request from - https://dev.org/repo - at - devbranch + https://dev.org/repo + branch + devbranch to - http://mainline.com/repo - at - trunk: -
- #7 - "The Title" + http://mainline.com/repo + branch + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

- - View Comment + u2 u3 (u2). +

+
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -1047,41 +2512,152 @@ -

- + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Mention in Comment on Pull Request #7 "The Title" - -

Opinionated User (jsmith)

-

+

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
Opinionated User (jsmith)
+
+
Status change: Under Review -

-

+

+
The pull request has been closed. -

-
Me too! +
+
+
Me too! - and indented on second line
-

+

+
+
Pull request from - https://dev.org/repo - at - devbranch + https://dev.org/repo + branch + devbranch to - http://mainline.com/repo - at - trunk: -
- #7 - "The Title" + http://mainline.com/repo + branch + trunk: +
+
+ #7 + "The Title" by - u2 u3 (u2). -

-

- - View Comment + u2 u3 (u2). +

+
+ + + + + + + +
+ +
+ + View Comment + +
-

+
+
+
+ + + +
@@ -1117,25 +2693,87 @@ -

- Password Reset Request -

-

Hello John Doe,

-

- We have received a request to reset the password for your account. -

-

- + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ Password Reset Request +
+
+ + + + + + + + + + + + + + + + + + + + + + +
Hello John Doe,
+ We have received a request to reset the password for your account. +
+
To set a new password, click the following link:
- http://reset.com/decbf64715098db5b0bd23eab44bd792670ab746
Should you not be able to use the link above, please type the following code into the password reset form: decbf64715098db5b0bd23eab44bd792670ab746 -

- If it weren't you who requested the password reset, just disregard this message. -

+
+
+ If it weren't you who requested the password reset, just disregard this message. +
+
+