[website] [cleanup] selectable images will now be relative urls (files/..) or full urls (http:..)

This commit is contained in:
Rushabh Mehta
2013-03-28 16:26:11 +05:30
parent 0c541a0fe2
commit 2fe802c81e
12 changed files with 26 additions and 42 deletions

View File

@@ -2,7 +2,6 @@
from __future__ import unicode_literals
import webnotes
from website.utils import url_for_website
class DocType:
def __init__(self, d, dl):
@@ -14,9 +13,6 @@ class DocType:
def get_args():
obj = webnotes.get_obj("About Us Settings")
for d in obj.doclist.get({"doctype":"About Us Team Member"}):
if not "/" in d.image_link:
d.image_link = "files/" + d.image_link
return {
"obj": obj
}

View File

@@ -78,8 +78,6 @@ class DocType:
self.doc.content_html = self.doc.content
if self.doc.blogger:
self.doc.blogger_info = webnotes.doc("Blogger", self.doc.blogger).fields
if self.doc.blogger_info.avatar and not "/" in self.doc.blogger_info.avatar:
self.doc.blogger_info.avatar = "files/" + self.doc.blogger_info.avatar
self.doc.description = self.doc.blog_intro or self.doc.content[:140]

View File

@@ -4,7 +4,7 @@
body {
{% if doc.background_image %}
background: url("../files/{{ doc.background_image }}") repeat;
background: url("../{{ doc.background_image }}") repeat;
{% elif doc.background_color %}
background-color: #{{ doc.background_color }};
background-image: none;
@@ -67,16 +67,10 @@ div.web-footer, div.web-footer a {
/* Bootstrap Navbar */
.navbar-inverse .navbar-inner {
box-shadow: none;
background-color: #{{ doc.top_bar_background or "444444"}};
background-repeat: repeat-x;
background-image: none;
}
.navbar-inner {
box-shadow: none;
}
.navbar-inner {
border-bottom: 1px solid {% if doc.top_bar_background == doc.page_background -%}
#{{ get_hex_shade(doc.page_background or "ffffff", 15) }};
{%- else -%}

View File

@@ -48,7 +48,6 @@ cur_frm.cscript.set_banner_from_image = function(doc) {
msgprint(wn._("Select a Banner Image first."));
}
var src = doc.banner_image;
if(src.indexOf("/")==-1) src = "files/" + src;
cur_frm.set_value("banner_html", "<a href='/'><img src='"+ src
+"' style='max-width: 200px;'></a>");
}