Show website route for generator via set_intro, fix in Outgoing Email Settings
This commit is contained in:
parent
26fa28a3bc
commit
2e36802a64
3 changed files with 8 additions and 8 deletions
|
|
@ -11,7 +11,7 @@ from frappe.model.document import Document
|
|||
class OutgoingEmailSettings(Document):
|
||||
|
||||
def validate(self):
|
||||
if self.mail_server:
|
||||
if self.mail_server and not frappe.local.flags.in_patch:
|
||||
from frappe.utils import cint
|
||||
from frappe.utils.email_lib.smtp import SMTPServer
|
||||
smtpserver = SMTPServer(login = self.mail_login,
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@ cur_frm.cscript.refresh = function(doc) {
|
|||
});
|
||||
}
|
||||
|
||||
cur_frm.appframe.add_button("View In Website", function() {
|
||||
window.open(doc.__onload.website_route);
|
||||
}, "icon-globe");
|
||||
if (!doc.__islocal && doc.published) {
|
||||
cur_frm.set_intro(__("Published on website at: {0}",
|
||||
[repl('<a href="/%(website_route)s" target="_blank">/%(website_route)s</a>', doc.__onload)]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,9 @@ $.extend(cur_frm.cscript, {
|
|||
},
|
||||
refresh: function(doc) {
|
||||
cur_frm.cscript.layout(doc);
|
||||
if(!doc.__islocal && doc.published) {
|
||||
cur_frm.appframe.add_button("View In Website", function() {
|
||||
window.open(doc.__onload.website_route);
|
||||
}, "icon-globe");
|
||||
if (!doc.__islocal && doc.published) {
|
||||
cur_frm.set_intro(__("Published on website at: {0}",
|
||||
[repl('<a href="/%(website_route)s" target="_blank">/%(website_route)s</a>', doc.__onload)]));
|
||||
}
|
||||
},
|
||||
insert_style: function(doc) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue