favicon and website theme

This commit is contained in:
Anand Doshi 2015-07-22 16:26:34 +05:30
parent 84579ed3bf
commit 4cabd4070f
5 changed files with 17 additions and 103 deletions

View file

@ -35,8 +35,7 @@ web_include_js = [
bootstrap = "assets/frappe/css/bootstrap.css"
web_include_css = [
"assets/css/frappe-web.css",
"website_theme.css"
"assets/css/frappe-web.css"
]
website_route_rules = [
{"from_route": "/blog", "to_route": "Blog Post"},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 522 B

View file

@ -1,92 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="260px"
height="260px"
viewBox="0 0 260 260"
enable-background="new 0 0 260 260"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="frappe.svg"><metadata
id="metadata73"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs71" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1160"
inkscape:window-height="676"
id="namedview69"
showgrid="false"
inkscape:zoom="1.8230769"
inkscape:cx="130"
inkscape:cy="130"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="text3365"
inkscape:snap-bbox="true"
inkscape:snap-smooth-nodes="true" /><g
id="g3"><g
id="g5"
transform="translate(5.5084746,2.2033898)"><g
id="g7"
transform="matrix(0.6988869,0,0,0.6988869,38.116279,42.59371)"><path
d="m 223.463,82.762 c 27.129,55.638 0.525,91.039 -60.914,120.997 C 101.111,233.715 56.835,232.875 29.705,177.238 2.578,121.601 29.182,86.199 90.62,56.242 152.06,26.284 196.335,27.126 223.463,82.762 Z"
id="path9"
inkscape:connector-curvature="0"
style="fill:#ffdd8c">
</path>
<animateTransform
attributeType="XML"
attributeName="transform"
begin="0s"
dur="10s"
type="rotate"
from="0 125 135"
to="360 125 135"
additive="sum"
repeatCount="indefinite" />
</g></g><g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#223a4e;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text3365"><path
d="m 4.1839912,112.70592 0,-0.43946 q 0,-0.8789 0.4394531,-1.27441 0.4833985,-0.43945 1.6699219,-0.43945 l 7.0751958,0 0,-4.57032 q 0,-7.250972 3.076171,-10.986324 3.076172,-3.779296 8.833008,-3.779296 4.790039,0 7.119141,2.329101 0.966797,0.966797 0.966797,2.241211 0,0.65918 -0.307617,1.186523 -0.263672,0.527344 -0.57129,0.747071 -0.307617,0.219726 -0.395507,0.175781 -1.054688,-1.230469 -2.944336,-2.06543 -1.889649,-0.834961 -3.867188,-0.834961 -3.911133,0 -5.844726,2.72461 -1.889649,2.724614 -1.889649,8.525394 l 0,4.30664 9.448242,0 q 2.153321,0 2.153321,1.71386 l 0,0.43946 q 0,1.71386 -2.153321,1.71386 l -9.360351,0 0,36.91407 q 0,2.06543 -1.889649,2.06543 l -0.483398,0 q -1.889648,0 -1.889648,-2.06543 l 0,-36.91407 -7.0751958,0 q -1.1865234,0 -1.6699219,-0.3955 -0.4394531,-0.43946 -0.4394531,-1.31836 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:90px;font-family:Omnes;-inkscape-font-specification:Omnes;fill:#223a4e;fill-opacity:1"
id="path3431" /><path
d="m 37.450593,151.33385 0,-40.60547 q 0,-0.0439 0.175781,-0.13184 0.219727,-0.13183 0.571289,-0.21972 0.351563,-0.0879 0.703125,-0.0879 2.8125,0 2.8125,4.30664 l 0,5.31738 q 2.592774,-10.23926 11.777344,-10.23926 2.548828,0 4.21875,1.01074 1.713867,1.01075 1.713867,2.59278 0,0.74707 -0.307617,1.31836 -0.263672,0.52734 -0.571289,0.74707 -0.263672,0.21972 -0.395508,0.17578 -1.845703,-1.71387 -5.097656,-1.71387 -5.581055,0 -8.4375,5.09766 -2.8125,5.05371 -2.8125,13.97461 l 0,18.45703 q 0,2.06543 -1.889649,2.06543 l -0.483398,0 q -1.977539,0 -1.977539,-2.06543 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:90px;font-family:Omnes;-inkscape-font-specification:Omnes;fill:#223a4e;fill-opacity:1"
id="path3433" /><path
d="m 64.125397,142.32506 q 0,-7.16309 7.294922,-10.41504 7.338868,-3.2959 23.466797,-3.51563 l 0.922852,0 0,-2.15332 q 0,-5.97656 -3.47168,-9.27246 -3.427734,-3.33984 -9.580078,-3.33984 -5.273438,0 -8.964844,2.24121 -3.691406,2.19727 -5.537109,5.84473 -0.219727,0 -0.703125,-0.13184 -0.439453,-0.13184 -1.098633,-0.74707 -0.615234,-0.61523 -0.615234,-1.62598 0,-0.70312 0.659179,-1.88964 0.65918,-1.23047 1.757813,-2.24122 5.405273,-5.40527 14.765625,-5.40527 7.954101,0 12.480469,4.39453 4.526369,4.39453 4.526369,12.08496 l 0,26.80664 q 0,0.0439 -0.219729,0.17578 -0.219726,0.0879 -0.615234,0.17579 -0.351563,0.0879 -0.703125,0.0879 -2.680664,0 -2.680664,-4.30664 l 0,-4.43848 q -2.109375,4.21875 -6.635742,6.81152 -4.526368,2.54883 -10.283204,2.54883 -6.811523,0 -10.810546,-3.16406 -3.955079,-3.16406 -3.955079,-8.52539 z m 4.394532,0 q 0,3.77929 2.856445,5.97656 2.900391,2.15332 7.866211,2.15332 6.943359,0 11.733398,-4.1748 4.833985,-4.17481 4.833985,-10.23926 l 0,-4.21875 -1.186524,0 q -13.974609,0.26367 -20.039062,2.68066 -6.064453,2.41699 -6.064453,7.82227 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:90px;font-family:Omnes;-inkscape-font-specification:Omnes;fill:#223a4e;fill-opacity:1"
id="path3435" /><path
d="m 112.15762,168.42857 0,-57.70019 q 0,-0.0439 0.17579,-0.13184 0.21972,-0.13183 0.57128,-0.21972 0.35157,-0.0879 0.70313,-0.0879 2.8125,0 2.8125,4.30664 l 0,4.70214 q 5.71289,-9.62402 16.91894,-9.62402 8.61329,0 14.41407,6.19629 5.80078,6.15234 5.80078,15.86426 0,9.84375 -5.80078,16.08398 -5.75684,6.19629 -14.72168,6.19629 -6.06446,0 -10.41504,-2.76855 -4.35059,-2.76856 -6.1084,-6.76758 l 0,23.95019 q 0,2.06543 -1.88965,2.06543 l -0.4834,0 q -1.97754,0 -1.97754,-2.06543 z m 4.2627,-33.57422 q 0,6.41602 4.70215,10.89844 4.74609,4.48242 11.55761,4.48242 7.42676,0 11.99708,-5.09765 4.57031,-5.1416 4.57031,-13.40332 0,-7.91016 -4.70215,-13.09571 -4.6582,-5.18554 -11.68945,-5.18554 -5.93262,0 -10.15137,3.12011 -4.21875,3.07618 -6.28418,8.48145 l 0,9.7998 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:90px;font-family:Omnes;-inkscape-font-specification:Omnes;fill:#223a4e;fill-opacity:1"
id="path3437" /><path
d="m 163.13419,168.42857 0,-57.70019 q 0,-0.0439 0.17578,-0.13184 0.21972,-0.13183 0.57129,-0.21972 0.35156,-0.0879 0.70312,-0.0879 2.8125,0 2.8125,4.30664 l 0,4.70214 q 5.71289,-9.62402 16.91895,-9.62402 8.61328,0 14.41406,6.19629 5.80078,6.15234 5.80078,15.86426 0,9.84375 -5.80078,16.08398 -5.75684,6.19629 -14.72168,6.19629 -6.06445,0 -10.41504,-2.76855 -4.35059,-2.76856 -6.1084,-6.76758 l 0,23.95019 q 0,2.06543 -1.88965,2.06543 l -0.48339,0 q -1.97754,0 -1.97754,-2.06543 z m 4.26269,-33.57422 q 0,6.41602 4.70215,10.89844 4.74609,4.48242 11.55762,4.48242 7.42676,0 11.99707,-5.09765 4.57031,-5.1416 4.57031,-13.40332 0,-7.91016 -4.70215,-13.09571 -4.6582,-5.18554 -11.68945,-5.18554 -5.93262,0 -10.15137,3.12011 -4.21875,3.07618 -6.28418,8.48145 l 0,9.7998 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:90px;font-family:Omnes;-inkscape-font-specification:Omnes;fill:#223a4e;fill-opacity:1"
id="path3439" /><path
d="m 211.2543,131.99791 q 0,-6.28418 2.72461,-11.38184 2.72461,-5.09765 7.60254,-7.99804 4.87793,-2.94434 10.89844,-2.94434 8.78906,0 14.15039,5.75684 5.40527,5.71289 5.40527,15.02929 l 0,0.43946 q 0,0.92285 -0.43945,1.23047 -0.39551,0.30761 -1.45019,0.30761 l -34.67286,0 q 0.13184,7.91016 4.96582,12.83203 4.87793,4.87793 12.56836,4.87793 10.89844,0 15.24903,-8.52539 0.17578,-0.13183 0.74707,0.0879 0.61523,0.17578 1.18652,0.83496 0.57129,0.65918 0.57129,1.58204 0,0.74707 -0.70313,2.02148 -0.70312,1.27441 -2.02148,2.59277 -2.19727,2.19727 -6.1084,3.73536 -3.91113,1.53808 -8.9209,1.53808 -9.71191,0 -15.73242,-6.15234 -6.02051,-6.19629 -6.02051,-15.86426 z m 4.39453,-3.25195 31.86036,0 q -0.26368,-6.85547 -4.39453,-11.07422 -4.08692,-4.21875 -10.63477,-4.21875 -6.54785,0 -11.20606,4.26269 -4.61425,4.2627 -5.625,11.03028 z m 11.3379,-24.82911 q -0.13184,-0.17578 1.09863,-1.66992 1.23047,-1.49414 3.7793,-3.867185 2.54882,-2.416992 5.40527,-4.570312 2.63672,-1.977539 4.04297,-1.977539 0.83496,0 1.40625,0.527344 0.57129,0.483398 0.57129,1.274414 0,0.878906 -0.74707,1.757812 -0.70313,0.878906 -2.68067,2.373047 -2.94433,2.109375 -6.06445,3.691409 -3.07617,1.58203 -4.83399,2.15332 -1.75781,0.57129 -1.97753,0.30761 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:90px;font-family:Omnes;-inkscape-font-specification:Omnes;fill:#223a4e;fill-opacity:1"
id="path3441" /></g></g></svg>

Before

Width:  |  Height:  |  Size: 9.1 KiB

View file

@ -118,8 +118,6 @@ def get_website_settings():
context.web_include_css = hooks.web_include_css or []
add_website_theme(context)
via_hooks = frappe.get_hooks("website_context")
for key in via_hooks:
context[key] = via_hooks[key]
@ -127,10 +125,12 @@ def get_website_settings():
and isinstance(context[key], (list, tuple)):
context[key] = context[key][0]
add_website_theme(context)
if not context.get("favicon"):
context["favicon"] = "/assets/frappe/images/favicon.png"
if settings.favicon:
if settings.favicon and settings.favicon != "attach_files:":
context["favicon"] = settings.favicon
return context

View file

@ -63,13 +63,20 @@ def use_theme(theme):
def add_website_theme(context):
bootstrap = frappe.get_hooks("bootstrap")[0]
website_theme = get_active_theme()
context.theme = website_theme and website_theme.as_dict() or frappe._dict()
if website_theme:
if website_theme.bootstrap:
bootstrap = website_theme.bootstrap
web_include_css = context.web_include_css
context.theme = frappe._dict()
context.no_sidebar = website_theme.no_sidebar
if not context.disable_website_theme:
website_theme = get_active_theme()
context.theme = website_theme and website_theme.as_dict() or frappe._dict()
if website_theme:
if website_theme.bootstrap:
bootstrap = website_theme.bootstrap
context.no_sidebar = website_theme.no_sidebar
context.web_include_css = ["website_theme.css"] + context.web_include_css
context.web_include_css = [bootstrap] + context.web_include_css