fixes to about us

This commit is contained in:
Rushabh Mehta
2013-03-12 14:28:29 +05:30
parent 0642083399
commit 11b1fb811f
9 changed files with 79 additions and 66 deletions

View File

@@ -7,16 +7,16 @@ from website.utils import url_for_website
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def onload(self):
"""load employee"""
emp_list = []
for d in self.doclist.get({"doctype":"About Us Team Member"}):
emp = webnotes.doc("Employee", d.employee)
emp.image = url_for_website(emp.image)
emp_list.append(emp)
self.doclist += emp_list
def on_update(self):
from website.utils import clear_cache
clear_cache("about")
clear_cache("about")
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

@@ -1,12 +1,13 @@
[
{
"creation": "2013-01-10 16:34:32",
"creation": "2013-03-07 15:53:15",
"docstatus": 0,
"modified": "2013-01-22 14:12:16",
"modified": "2013-03-12 13:51:29",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"allow_attach": 1,
"description": "Settings for the About Us Page",
"doctype": "DocType",
"document_type": "Master",
@@ -31,7 +32,7 @@
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"report": 0,
"role": "Website Manager",
"submit": 0,
"write": 1
@@ -101,6 +102,15 @@
"fieldtype": "Text Editor",
"label": "Footer"
},
{
"doctype": "DocField",
"fieldname": "file_list",
"fieldtype": "Text",
"hidden": 1,
"label": "File List",
"no_copy": 1,
"print_hide": 1
},
{
"doctype": "DocPerm"
}

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-02-22 01:28:07",
"creation": "2013-03-07 11:55:11",
"docstatus": 0,
"modified": "2013-03-07 07:03:18",
"modified": "2013-03-12 13:51:02",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -14,23 +14,38 @@
},
{
"doctype": "DocField",
"fieldname": "employee",
"fieldtype": "Link",
"label": "Employee",
"name": "__common__",
"options": "Employee",
"parent": "About Us Team Member",
"parentfield": "fields",
"parenttype": "DocType",
"permlevel": 0,
"print_width": "300px",
"width": "300px"
"permlevel": 0
},
{
"doctype": "DocType",
"name": "About Us Team Member"
},
{
"doctype": "DocField"
"doctype": "DocField",
"fieldname": "full_name",
"fieldtype": "Data",
"label": "Full Name",
"reqd": 1,
"width": "150px"
},
{
"doctype": "DocField",
"fieldname": "image_link",
"fieldtype": "Select",
"label": "Image Link",
"options": "attach_files:",
"width": "150px"
},
{
"doctype": "DocField",
"fieldname": "bio",
"fieldtype": "Small Text",
"label": "Bio",
"reqd": 1,
"width": "200px"
}
]

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-03-08 11:36:53",
"docstatus": 0,
"modified": "2013-03-12 11:34:32",
"modified": "2013-03-12 13:35:14",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -65,6 +65,12 @@
"fieldtype": "Data",
"label": "Page Background"
},
{
"doctype": "DocField",
"fieldname": "page_border",
"fieldtype": "Check",
"label": "Page Border"
},
{
"doctype": "DocField",
"fieldname": "page_headings",
@@ -83,16 +89,11 @@
"fieldtype": "Data",
"label": "Page Links"
},
{
"doctype": "DocField",
"fieldname": "page_border",
"fieldtype": "Check",
"label": "Page Border"
},
{
"doctype": "DocField",
"fieldname": "cb0",
"fieldtype": "Column Break",
"label": "Top Bar",
"print_width": "50%",
"width": "50%"
},