Merge pull request #4210 from rmehta/defaut-title-in-email

[fix] default email subject should be title
This commit is contained in:
Rushabh Mehta 2017-09-29 15:03:27 +05:30 committed by GitHub
commit be4cbc1f4e
3 changed files with 18 additions and 5 deletions

View file

@ -133,6 +133,7 @@
background-color: #ff5858;
}
.navbar-form .awesomplete {
margin-left: -15px;
width: 300px;
}
@media (max-width: 1199px) {
@ -195,13 +196,14 @@
}
#navbar-breadcrumbs > li > a {
padding: 6px 15px 10px 0px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 170px;
}
@media (min-width: 991px) and (max-width: 1199px) {
#navbar-breadcrumbs > li > a {
max-width: 143px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 120px;
}
}
.toolbar-user-fullname {

View file

@ -149,7 +149,7 @@ frappe.views.CommunicationComposer = Class.extend({
if (this.frm.subject_field && this.frm.doc[this.frm.subject_field]) {
this.subject = __("Re: {0}", [this.frm.doc[this.frm.subject_field]]);
} else {
this.subject = __(this.frm.doctype) + ': ' + this.frm.docname;
this.subject = __(this.frm.doctype) + ': ' + this.frm[this.frm.meta.title_field || name];
}
}
}

View file

@ -2,6 +2,17 @@ import json
import bleach, bleach_whitelist.bleach_whitelist as bleach_whitelist
from six import string_types
def clean_html(html):
if not isinstance(html, string_types):
return html
return bleach.clean(html,
tags=['div', 'p', 'br', 'ul', 'ol', 'li', 'b', 'i', 'em',
'table', 'thead', 'tbody', 'td', 'tr'],
attributes=[],
styles=['color', 'border', 'border-color'],
strip=True, strip_comments=True)
def sanitize_html(html, linkify=False):
"""
Sanitize HTML tags, attributes and style to prevent XSS attacks