Sfoglia il codice sorgente

[minor] title fix for web pages

version-14
Rushabh Mehta 8 anni fa
parent
commit
14ca4119ba
3 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. +1
    -1
      frappe/public/js/frappe/form/linked_with.js
  2. +2
    -0
      frappe/website/render.py
  3. +2
    -2
      frappe/website/router.py

+ 1
- 1
frappe/public/js/frappe/form/linked_with.js Vedi File

@@ -12,7 +12,7 @@ frappe.ui.form.LinkedWith = Class.extend({
if(!this.dialog) if(!this.dialog)
this.make_dialog(); this.make_dialog();


this.dialog.fields_dict.list.$wrapper.html('<div class="text-muted text-center">'
this.dialog.fields_dict.list.$wrapper.html('<div class="text-muted text-center" style="padding: 30px 0px">'
+ __("Loading") + '...</div>'); + __("Loading") + '...</div>');


this.dialog.show(); this.dialog.show();


+ 2
- 0
frappe/website/render.py Vedi File

@@ -136,6 +136,8 @@ def build_page(path):


context = get_context(path) context = get_context(path)


print 2, context.title, context.source

if context.source: if context.source:
html = frappe.render_template(context.source, context) html = frappe.render_template(context.source, context)
elif context.template: elif context.template:


+ 2
- 2
frappe/website/router.py Vedi File

@@ -299,7 +299,7 @@ def load_properties(page_info):
page_info.title = os.path.basename(page_info.name).replace('_', ' ').replace('-', ' ').title() page_info.title = os.path.basename(page_info.name).replace('_', ' ').replace('-', ' ').title()


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


if "<!-- no-breadcrumbs -->" in page_info.source: if "<!-- no-breadcrumbs -->" in page_info.source:
page_info.no_breadcrumbs = 1 page_info.no_breadcrumbs = 1
@@ -313,7 +313,7 @@ def load_properties(page_info):
# every page needs a header # every page needs a header
# add missing header if there is no <h1> tag # add missing header if there is no <h1> tag
if (not '{% block header %}' in page_info.source) and (not '<h1' in page_info.source): if (not '{% block header %}' in page_info.source) and (not '<h1' in page_info.source):
page_info.source += '\n{% block header %}<h1>' + page_info.title + '</h1>{% endblock %}'
page_info.source += '\n{% block header %}<h1>{{ title }}</h1>{% endblock %}'


if "<!-- no-cache -->" in page_info.source: if "<!-- no-cache -->" in page_info.source:
page_info.no_cache = 1 page_info.no_cache = 1


Caricamento…
Annulla
Salva