mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
added blogger, updated style and blogs
This commit is contained in:
0
website/doctype/blogger/__init__.py
Normal file
0
website/doctype/blogger/__init__.py
Normal file
18
website/doctype/blogger/blogger.py
Normal file
18
website/doctype/blogger/blogger.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
class DocType:
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def on_update(self):
|
||||
"if profile is set, then update all older blogs"
|
||||
if self.doc.profile:
|
||||
for blog in webnotes.conn.sql_list("""select name from tabBlog where owner=%s
|
||||
and ifnull(blogger,'')=''""", self.doc.profile):
|
||||
b = webnotes.bean("Blog", blog)
|
||||
b.blogger = self.doc.name
|
||||
b.save()
|
||||
|
||||
95
website/doctype/blogger/blogger.txt
Normal file
95
website/doctype/blogger/blogger.txt
Normal file
@@ -0,0 +1,95 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-03-07 16:28:19",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-03-07 16:33:37",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_attach": 1,
|
||||
"autoname": "field:short_name",
|
||||
"description": "Profile of a Blogger",
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"max_attachments": 1,
|
||||
"module": "Website",
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"name": "__common__",
|
||||
"parent": "Blogger",
|
||||
"parentfield": "fields",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"name": "__common__",
|
||||
"parent": "Blogger",
|
||||
"parentfield": "permissions",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"read": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocType",
|
||||
"name": "Blogger"
|
||||
},
|
||||
{
|
||||
"description": "Will be used in url (usually first name).",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "short_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Short Name",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "full_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Full Name",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "profile",
|
||||
"fieldtype": "Link",
|
||||
"label": "Profile",
|
||||
"options": "Profile"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "bio",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Bio"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "avatar",
|
||||
"fieldtype": "Select",
|
||||
"label": "Avatar",
|
||||
"options": "attach_files:"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "file_list",
|
||||
"fieldtype": "Text",
|
||||
"hidden": 1,
|
||||
"label": "File List",
|
||||
"no_copy": 1,
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"role": "Website Manager"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"match": "owner:profile",
|
||||
"role": "Blogger"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user