Procházet zdrojové kódy

Merge pull request #1850 from KanchanChauhan/backlink-removed

Back link used for breadcrumbs removed
version-14
Rushabh Mehta před 9 roky
committed by GitHub
rodič
revize
b66ae3fd3a
1 změnil soubory, kde provedl 1 přidání a 21 odebrání
  1. +1
    -21
      frappe/website/doctype/web_form/web_form.py

+ 1
- 21
frappe/website/doctype/web_form/web_form.py Zobrazit soubor

@@ -138,7 +138,7 @@ def get_context(context):


if frappe.form_dict.name or frappe.form_dict.new: if frappe.form_dict.name or frappe.form_dict.new:
context.layout = self.get_layout() context.layout = self.get_layout()
context.parents = [{"name": self.route, "title": self.title }]
context.parents = [{"route": self.route, "title": self.title }]


if frappe.form_dict.name: if frappe.form_dict.name:
context.doc = frappe.get_doc(self.doc_type, frappe.form_dict.name) context.doc = frappe.get_doc(self.doc_type, frappe.form_dict.name)
@@ -161,8 +161,6 @@ def get_context(context):


self.add_custom_context_and_script(context) self.add_custom_context_and_script(context)


self.set_back_to_link(context)

def add_custom_context_and_script(self, context): def add_custom_context_and_script(self, context):
'''Update context from module if standard and append script''' '''Update context from module if standard and append script'''
if self.is_standard: if self.is_standard:
@@ -186,22 +184,6 @@ def get_context(context):
if os.path.exists(css_path): if os.path.exists(css_path):
context.style = open(css_path, 'r').read() context.style = open(css_path, 'r').read()


def set_back_to_link(self, context):
'''Sets breadcrumbs, success and fail URL if
`back-to` argument is set'''
if frappe.form_dict.get('back-to'):
link = frappe.form_dict.get('back-to')
title = frappe.form_dict.get('back-to-title') or _('Back')

# breadcrumbs
context.parents = [{'name': link, 'title': title }]

# success
context.success_url = link
context.cancel_url = link

return context

def get_layout(self): def get_layout(self):
layout = [] layout = []
for df in self.web_form_fields: for df in self.web_form_fields:
@@ -221,8 +203,6 @@ def get_context(context):


if context.is_list: if context.is_list:
parents = [{"title": _("My Account"), "name": "me"}] parents = [{"title": _("My Account"), "name": "me"}]
elif self.breadcrumbs:
parents = json.loads(self.breadcrumbs)
elif context.parents: elif context.parents:
parents = context.parents parents = context.parents




Načítá se…
Zrušit
Uložit