[fix] tests and show in website
This commit is contained in:
parent
c0ef741ce8
commit
b005662d0d
4 changed files with 9 additions and 6 deletions
|
|
@ -118,10 +118,10 @@ frappe.ui.form.Sidebar = Class.extend({
|
|||
},
|
||||
add_user_action: function(label, click) {
|
||||
return $('<a>').html(label).appendTo($('<li class="user-action-row">')
|
||||
.appendTo(this.user_actions.removeClass("hide"))).on("click", click);
|
||||
.appendTo(this.user_actions.removeClass("hidden"))).on("click", click);
|
||||
},
|
||||
clear_user_actions: function() {
|
||||
this.user_actions.addClass("hide")
|
||||
this.user_actions.addClass("hidden")
|
||||
this.user_actions.find(".user-action-row").remove();
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<ul class="list-unstyled sidebar-menu user-actions hidden"></ul>
|
||||
<ul class="list-unstyled sidebar-menu sidebar-image-section hidden-xs hidden-sm hide">
|
||||
<li class="divider"></li>
|
||||
<li class="sidebar-image-wrapper">
|
||||
|
|
|
|||
|
|
@ -371,7 +371,8 @@ _f.Frm.prototype.show_web_link = function() {
|
|||
}
|
||||
|
||||
_f.Frm.prototype.add_web_link = function(path) {
|
||||
this.web_link = this.sidebar.add_user_action(__("See on Website"),
|
||||
this.web_link = this.sidebar.add_user_action('<span class="octicon octicon-link-external" style="margin-right: 7px;"></span>'
|
||||
+ __("See on Website"),
|
||||
function() {}).attr("href", path || this.doc.route).attr("target", "_blank");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class WebsiteGenerator(Document):
|
|||
|
||||
def autoname(self):
|
||||
if not self.name and self.meta.autoname != "hash":
|
||||
self.name = self.make_route()
|
||||
self.name = self.scrubbed_title()
|
||||
|
||||
def onload(self):
|
||||
self.get("__onload").update({
|
||||
|
|
@ -42,6 +42,9 @@ class WebsiteGenerator(Document):
|
|||
self.route = self.route.strip('/.')[:139]
|
||||
|
||||
def make_route(self):
|
||||
return self.scrubbed_title()
|
||||
|
||||
def scrubbed_title(self):
|
||||
return self.scrub(self.get(self.get_website_properties('page_title_field', 'title')))
|
||||
|
||||
def clear_cache(self):
|
||||
|
|
@ -75,8 +78,6 @@ class WebsiteGenerator(Document):
|
|||
"controller": get_module_name(self.doctype, self.meta.module),
|
||||
})
|
||||
|
||||
print self.get_website_properties()
|
||||
|
||||
route.update(self.get_website_properties())
|
||||
|
||||
if not route.page_title:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue