浏览代码

Fixed Scrub Relative URLs to include url(something), styling

version-14
Anand Doshi 11 年前
父节点
当前提交
adbfc48d99
共有 4 个文件被更改,包括 10 次插入5 次删除
  1. +1
    -1
      frappe/templates/pages/style_settings.py
  2. +4
    -1
      frappe/website/css/website.css
  3. +2
    -2
      frappe/website/doctype/style_settings/style_settings.txt
  4. +3
    -1
      frappe/website/utils.py

+ 1
- 1
frappe/templates/pages/style_settings.py 查看文件

@@ -32,7 +32,7 @@ def prepare(doc):
doc.fields[d] = default_colours[d] doc.fields[d] = default_colours[d]
if not doc.font_size: if not doc.font_size:
doc.font_size = "13px"
doc.font_size = "14px"
doc.small_font_size = cstr(cint(doc.font_size[:-2])-2) + 'px' doc.small_font_size = cstr(cint(doc.font_size[:-2])-2) + 'px'
doc.page_border = cint(doc.page_border) doc.page_border = cint(doc.page_border)


+ 4
- 1
frappe/website/css/website.css 查看文件

@@ -248,6 +248,10 @@ fieldset {
border-bottom: 2px solid #999; border-bottom: 2px solid #999;
} }


.sidebar-item a.active {
border-bottom: 2px solid #999;
}

html, html,
body { body {
height: 100%; height: 100%;
@@ -392,7 +396,6 @@ a.no-decoration {
a.active { a.active {
pointer-events: none; pointer-events: none;
cursor: default; cursor: default;
border-bottom: inherit;
} }


.page-breadcrumbs .breadcrumb { .page-breadcrumbs .breadcrumb {


+ 2
- 2
frappe/website/doctype/style_settings/style_settings.txt 查看文件

@@ -2,7 +2,7 @@
{ {
"creation": "2013-03-25 16:01:33", "creation": "2013-03-25 16:01:33",
"docstatus": 0, "docstatus": 0,
"modified": "2013-12-20 19:21:48",
"modified": "2013-12-20 19:22:48",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@@ -136,7 +136,7 @@
"fieldname": "font_size", "fieldname": "font_size",
"fieldtype": "Select", "fieldtype": "Select",
"label": "Font Size (Text)", "label": "Font Size (Text)",
"options": "\n12px\n13px\n14px\n15px\n16px"
"options": "\n12px\n13px\n14px\n15px\n16px\n17px\n18px"
}, },
{ {
"doctype": "DocField", "doctype": "DocField",


+ 3
- 1
frappe/website/utils.py 查看文件

@@ -6,7 +6,9 @@ import frappe, re


def scrub_relative_urls(html): def scrub_relative_urls(html):
"""prepend a slash before a relative url""" """prepend a slash before a relative url"""
return re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#)([^'" >]+)['"]""", '\g<1> = "/\g<2>"', html)
html = re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#)([^'" >]+)['"]""", '\g<1> = "/\g<2>"', html)
html = re.sub("""url\((?!http|ftp|/|#)([^\(\)]+)\)""", 'url(/\g<1>)', html)
return html


def can_cache(no_cache=False): def can_cache(no_cache=False):
return not (frappe.conf.disable_website_cache or no_cache) return not (frappe.conf.disable_website_cache or no_cache)


正在加载...
取消
保存