ソースを参照

[fix] router heading fix for translate

version-14
Rushabh Mehta 9年前
コミット
0b05a48bd8
2個のファイルの変更12行の追加8行の削除
  1. +1
    -1
      frappe/desk/doctype/bulk_update/bulk_update.py
  2. +11
    -7
      frappe/website/router.py

+ 1
- 1
frappe/desk/doctype/bulk_update/bulk_update.py ファイルの表示

@@ -22,7 +22,7 @@ def update(doctype, field, value, condition='', limit=500):
if ';' in condition:
frappe.throw('; not allowed in condition')

items = frappe.db.sql_list('select name from `tab{0}`{1} limit 0, {2}'.format(doctype,
items = frappe.db.sql_list('''select name from `tab{0}`{1} limit 0, {2}'''.format(doctype,
condition, limit), debug=1)
n = len(items)



+ 11
- 7
frappe/website/router.py ファイルの表示

@@ -282,14 +282,18 @@ def make_toc(context, out):
def load_properties(page_info):
'''Load properties like no_cache, title from raw'''
import re
if "<!-- title:" in page_info.source:
page_info.title = re.findall('<!-- title:([^>]*) -->', page_info.source)[0].strip()
elif "<h1>" in page_info.source:
page_info.title = re.findall('<h1>([^>]*)</h1>', page_info.source)[0].strip()
else:
page_info.title = os.path.basename(page_info.name).replace('_', ' ').replace('-', ' ').title()

if not '{% block title %}' in page_info.source:
if not page_info.title:
if "<!-- title:" in page_info.source:
page_info.title = re.findall('<!-- title:([^>]*) -->', page_info.source)[0].strip()
elif "<h1>" in page_info.source:
match = re.findall('<h1>([^>]*)</h1>', page_info.source)
if match:
page_info.title = match[0].strip()
else:
page_info.title = os.path.basename(page_info.name).replace('_', ' ').replace('-', ' ').title()

if page_info.title and not '{% block title %}' in page_info.source:
page_info.source += '\n{% block title %}' + page_info.title + '{% endblock %}'

if "<!-- no-breadcrumbs -->" in page_info.source:


読み込み中…
キャンセル
保存