added blog settings and metadata

This commit is contained in:
Rushabh Mehta
2013-03-11 17:57:57 +05:30
parent bbbceb617c
commit b33693db35
12 changed files with 74 additions and 26 deletions

View File

@@ -74,13 +74,15 @@ class DocType:
# temp fields
from webnotes.utils import global_date_format, get_fullname
self.doc.full_name = get_fullname(self.doc.owner)
self.doc.updated = global_date_format(self.doc.creation)
self.doc.updated = global_date_format(self.doc.published_on)
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]
self.doc.categories = webnotes.conn.sql_list("select name from `tabBlog Category` order by name")
self.doc.texts = {

View File

@@ -39,6 +39,9 @@ class DocType:
from webnotes.sessions import clear_cache
clear_cache('Guest')
from website.utils import clear_cache
clear_cache()
for f in ["small_font_size", "at_import", "heading_text_style"]:
if f in self.doc.fields:

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-01-27 16:31:21",
"creation": "2013-02-12 13:19:11",
"docstatus": 0,
"modified": "2013-02-12 09:33:47",
"modified": "2013-03-11 17:41:11",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -24,18 +24,16 @@
"permlevel": 0
},
{
"create": 1,
"amend": 0,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Web Page",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Website Manager",
"submit": 0,
"write": 1
"submit": 0
},
{
"doctype": "DocType",
@@ -85,6 +83,13 @@
"label": "Slideshow",
"options": "Website Slideshow"
},
{
"description": "Description for page header.",
"doctype": "DocField",
"fieldname": "description",
"fieldtype": "Small Text",
"label": "Description"
},
{
"description": "Content in markdown format that appears on the main side of your page",
"doctype": "DocField",
@@ -143,6 +148,17 @@
"print_hide": 1
},
{
"doctype": "DocPerm"
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"write": 1
},
{
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"permlevel": 1,
"write": 0
}
]