{{ introduction_text }}
--{% endif %} + +
{{ introduction_text }}
++ {% endif %} +
diff --git a/frappe/__init__.py b/frappe/__init__.py index 59507ea25b..67fda8b335 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -397,9 +397,10 @@ def has_website_permission(doctype, ptype="read", doc=None, user=None, verbose=F :param doc: Checks User permissions for given doc. :param user: [optional] Check for given user. Default: current user.""" - if not user: user = session.user + if not user: + user = session.user - for method in get_hooks("has_website_permission").get(doctype, []): + for method in (get_hooks("has_website_permission") or {}).get(doctype, []): if not call(get_attr(method), doc=doc, ptype=ptype, user=user, verbose=verbose): return False @@ -905,21 +906,32 @@ def get_print(doctype, name, print_format=None, style=None, as_pdf=False): else: return html -def attach_print(doctype, name, file_name): +def attach_print(doctype, name, file_name=None): from frappe.utils import scrub_urls + if not file_name: file_name = name + print_settings = db.get_singles_dict("Print Settings") + + local.flags.ignore_print_permissions = True + if int(print_settings.send_print_as_pdf or 0): - return { + out = { "fname": file_name + ".pdf", "fcontent": get_print(doctype, name, as_pdf=True) } else: - return { + out = { "fname": file_name + ".html", "fcontent": scrub_urls(get_print(doctype, name)).encode("utf-8") } + print print_settings, out + + local.flags.ignore_print_permissions = False + + return out + logging_setup_complete = False def get_logger(module=None): from frappe.setup_logging import setup_logging diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index 49e53b899b..380f284967 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -119,6 +119,12 @@ class DocType(Document): delete_notification_count_for(doctype=self.name) frappe.clear_cache(doctype=self.name) + # save singles when made + if self.issingle and not frappe.db.get_singles_dict(self.name): + doc = frappe.new_doc(self.name) + doc.flags.ignore_mandatory=True + doc.save() + def before_rename(self, old, new, merge=False): """Throw exception if merge. DocTypes cannot be merged.""" if merge: diff --git a/frappe/email/doctype/email_alert/email_alert.json b/frappe/email/doctype/email_alert/email_alert.json index 6e97754cea..a97d396651 100644 --- a/frappe/email/doctype/email_alert/email_alert.json +++ b/frappe/email/doctype/email_alert/email_alert.json @@ -118,6 +118,13 @@ "permlevel": 0, "reqd": 1 }, + { + "fieldname": "attach_print", + "fieldtype": "Check", + "label": "Attach Print", + "permlevel": 0, + "precision": "" + }, { "fieldname": "message_examples", "fieldtype": "HTML", @@ -127,7 +134,7 @@ } ], "icon": "icon-envelope", - "modified": "2015-02-05 05:11:37.924396", + "modified": "2015-03-11 16:43:51.288063", "modified_by": "Administrator", "module": "Email", "name": "Email Alert", diff --git a/frappe/email/doctype/email_alert/email_alert.py b/frappe/email/doctype/email_alert/email_alert.py index e5324258eb..ebd45d5bed 100644 --- a/frappe/email/doctype/email_alert/email_alert.py +++ b/frappe/email/doctype/email_alert/email_alert.py @@ -90,6 +90,9 @@ def evaluate_alert(doc, alert, event): return # send alert + print "test" + frappe.sendmail(recipients=recipients, subject=alert.subject, message= frappe.render_template(alert.message, {"doc": doc, "alert":alert}), - bulk=True, ref_doctype = doc.doctype, ref_docname = doc.name) + bulk=True, ref_doctype = doc.doctype, ref_docname = doc.name, + attachments = [frappe.attach_print(doc.doctype, doc.name)] if alert.attach_print else None) diff --git a/frappe/public/css/common.css b/frappe/public/css/common.css index bcca7545a5..3a71ec83c1 100644 --- a/frappe/public/css/common.css +++ b/frappe/public/css/common.css @@ -46,26 +46,23 @@ a.disabled:hover { } a.grey, .sidebar-section a, -.nav-pills a, .control-value a, .data-row a { - text-decoration: underline; + text-decoration: none; } a.grey:hover, .sidebar-section a:hover, -.nav-pills a:hover, .control-value a:hover, .data-row a:hover, a.grey:focus, .sidebar-section a:focus, -.nav-pills a:focus, .control-value a:focus, .data-row a:focus { text-decoration: underline; } a.text-muted, a.text-extra-muted { - text-underline: none; + text-decoration: none; } a.text-muted:hover, a.text-muted:focus, diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css index 7a9b8320b0..bde4e82f8f 100644 --- a/frappe/public/css/desk.css +++ b/frappe/public/css/desk.css @@ -46,26 +46,23 @@ a.disabled:hover { } a.grey, .sidebar-section a, -.nav-pills a, .control-value a, .data-row a { - text-decoration: underline; + text-decoration: none; } a.grey:hover, .sidebar-section a:hover, -.nav-pills a:hover, .control-value a:hover, .data-row a:hover, a.grey:focus, .sidebar-section a:focus, -.nav-pills a:focus, .control-value a:focus, .data-row a:focus { text-decoration: underline; } a.text-muted, a.text-extra-muted { - text-underline: none; + text-decoration: none; } a.text-muted:hover, a.text-muted:focus, diff --git a/frappe/public/css/sidebar.css b/frappe/public/css/sidebar.css index d7770ee4ef..3219888e0e 100644 --- a/frappe/public/css/sidebar.css +++ b/frappe/public/css/sidebar.css @@ -85,7 +85,6 @@ body[data-route^="Module"] .main-menu .form-sidebar { display: none !important; } .layout-side-section .sidebar-menu > li > a { - text-decoration: underline; display: inline-block; } .layout-side-section .sidebar-menu { diff --git a/frappe/public/css/website.css b/frappe/public/css/website.css index 96c4c55dd8..35ba21a02e 100644 --- a/frappe/public/css/website.css +++ b/frappe/public/css/website.css @@ -46,26 +46,23 @@ a.disabled:hover { } a.grey, .sidebar-section a, -.nav-pills a, .control-value a, .data-row a { - text-decoration: underline; + text-decoration: none; } a.grey:hover, .sidebar-section a:hover, -.nav-pills a:hover, .control-value a:hover, .data-row a:hover, a.grey:focus, .sidebar-section a:focus, -.nav-pills a:focus, .control-value a:focus, .data-row a:focus { text-decoration: underline; } a.text-muted, a.text-extra-muted { - text-underline: none; + text-decoration: none; } a.text-muted:hover, a.text-muted:focus, @@ -539,6 +536,12 @@ fieldset { border-top: 1px solid #d1d8dd; margin: 0px -15px -20px -15px; } +.blog-text { + padding: 15px 0px; +} +.blog-text p { + margin-bottom: 30px; +} .blogger { padding: 10px 15px; border-top: 1px solid #d1d8dd; @@ -685,7 +688,7 @@ a.active { .offcanvas .sidebar-menu { margin-bottom: 0; } - .offcanvas ul { + .offcanvas .sidebar ul { margin: 0px; } .offcanvas .sidebar-page-sidebar { diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index ce0c942b4a..02aca005ef 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -902,7 +902,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ $('
').prependTo(this.input_area); diff --git a/frappe/public/less/common.less b/frappe/public/less/common.less index 1601f96439..7e5be68561 100644 --- a/frappe/public/less/common.less +++ b/frappe/public/less/common.less @@ -47,17 +47,17 @@ a.disabled, a.disabled:hover { text-decoration: none; } -a.grey, .sidebar-section a, .nav-pills a, .control-value a, .data-row a { - .underline(); +a.grey, .sidebar-section a, .control-value a, .data-row a { + text-decoration: none; } -a.grey:hover, .sidebar-section a:hover, .nav-pills a:hover, .control-value a:hover, .data-row a:hover, -a.grey:focus, .sidebar-section a:focus, .nav-pills a:focus, .control-value a:focus, .data-row a:focus { - .underline-hover(); +a.grey:hover, .sidebar-section a:hover, .control-value a:hover, .data-row a:hover, +a.grey:focus, .sidebar-section a:focus, .control-value a:focus, .data-row a:focus { + text-decoration: underline; } a.text-muted, a.text-extra-muted { - text-underline: none; + text-decoration: none; } a.text-muted:hover, diff --git a/frappe/public/less/sidebar.less b/frappe/public/less/sidebar.less index fe718e8f14..64279e1974 100644 --- a/frappe/public/less/sidebar.less +++ b/frappe/public/less/sidebar.less @@ -43,7 +43,6 @@ body[data-route^="Module"] .main-menu { } .sidebar-menu > li > a { - .underline; display: inline-block; } diff --git a/frappe/public/less/website.less b/frappe/public/less/website.less index 7260c8ef96..472aa78744 100644 --- a/frappe/public/less/website.less +++ b/frappe/public/less/website.less @@ -244,6 +244,14 @@ fieldset { margin: 0px -15px -20px -15px; } +.blog-text { + padding: 15px 0px; + + p { + margin-bottom: 30px; + } +} + .blogger { padding: 10px 15px; border-top: 1px solid @border-color; @@ -363,7 +371,7 @@ a.active { .offcanvas-mobile-mixin(); .offcanvas { - ul { + .sidebar ul { margin: 0px; } diff --git a/frappe/templates/generators/blog_post.html b/frappe/templates/generators/blog_post.html index 0a7e601eb1..f9ac7f95a2 100644 --- a/frappe/templates/generators/blog_post.html +++ b/frappe/templates/generators/blog_post.html @@ -11,7 +11,7 @@ {{ blogger_info and blogger_info.full_name or full_name }}, {{ updated }} -{{ introduction_text }}
-{{ introduction_text }}
+