mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
added wesite slideshow and attributions on website
This commit is contained in:
@@ -41,5 +41,10 @@ class DocType():
|
||||
clear_cache('index')
|
||||
|
||||
def prepare_template_args(self):
|
||||
self.doc.main_section_html = self.doc.main_section
|
||||
self.doc.side_section_html = self.doc.side_section
|
||||
if self.doc.slideshow:
|
||||
slideshow = webnotes.model_wrapper("Website Slideshow", self.doc.slideshow)
|
||||
self.slides = slideshow.doclist.get({"doctype":"Website Slideshow Item"})
|
||||
self.doc.slideshow_header = slideshow.doc.header or ""
|
||||
for s in self.slides:
|
||||
if s.image and not s.image.lower().startswith("http"):
|
||||
s.image = "files/" + s.image
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-11-30 18:14:18",
|
||||
"creation": "2012-12-07 15:15:17",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-06 15:59:02"
|
||||
"modified": "2012-12-25 17:04:19"
|
||||
},
|
||||
{
|
||||
"allow_attach": 1,
|
||||
@@ -26,9 +26,7 @@
|
||||
"name": "__common__",
|
||||
"parent": "Web Page",
|
||||
"read": 1,
|
||||
"submit": 0,
|
||||
"doctype": "DocPerm",
|
||||
"amend": 0,
|
||||
"parenttype": "DocType",
|
||||
"role": "Website Manager",
|
||||
"parentfield": "permissions"
|
||||
@@ -37,16 +35,8 @@
|
||||
"name": "Web Page",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Title and Style",
|
||||
"fieldname": "sb0",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Title / headline of your page",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Title",
|
||||
"fieldname": "title",
|
||||
@@ -54,15 +44,6 @@
|
||||
"reqd": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Page url name (auto-generated) ",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Page Name",
|
||||
"fieldname": "page_name",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"width": "50%",
|
||||
@@ -78,43 +59,40 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Page url name (auto-generated) (add \".html\")",
|
||||
"doctype": "DocField",
|
||||
"label": "Layout",
|
||||
"options": "Single column\nTwo column",
|
||||
"fieldname": "layout",
|
||||
"fieldtype": "Select",
|
||||
"permlevel": 0
|
||||
"label": "Page Name",
|
||||
"fieldname": "page_name",
|
||||
"fieldtype": "Data",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"description": "Page content",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Content",
|
||||
"fieldname": "sb1",
|
||||
"fieldtype": "Section Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Begin this page with a slideshow of images",
|
||||
"doctype": "DocField",
|
||||
"label": "Slideshow",
|
||||
"options": "Website Slideshow",
|
||||
"fieldname": "slideshow",
|
||||
"fieldtype": "Link",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Content in markdown format that appears on the main side of your page",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Main Section",
|
||||
"fieldname": "main_section",
|
||||
"fieldtype": "Text Editor",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Content in markdown format that appears on the right side",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Side Section",
|
||||
"fieldname": "side_section",
|
||||
"fieldtype": "Text Editor",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Link to other pages in the side bar and next section",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "More",
|
||||
"fieldname": "sb2",
|
||||
@@ -131,7 +109,6 @@
|
||||
},
|
||||
{
|
||||
"description": "Add code as <script>",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Insert Code",
|
||||
"fieldname": "insert_code",
|
||||
@@ -175,14 +152,10 @@
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
}
|
||||
]
|
||||
@@ -4,7 +4,7 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-07-12 23:29:36",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-20 14:28:46"
|
||||
"modified": "2012-12-25 15:41:48"
|
||||
},
|
||||
{
|
||||
"issingle": 1,
|
||||
@@ -104,10 +104,11 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Address and other legal information you may want to put in the footer.",
|
||||
"doctype": "DocField",
|
||||
"label": "Address",
|
||||
"fieldname": "address",
|
||||
"fieldtype": "Text",
|
||||
"fieldtype": "Text Editor",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
|
||||
0
website/doctype/website_slideshow/__init__.py
Normal file
0
website/doctype/website_slideshow/__init__.py
Normal file
9
website/doctype/website_slideshow/website_slideshow.js
Normal file
9
website/doctype/website_slideshow/website_slideshow.js
Normal file
@@ -0,0 +1,9 @@
|
||||
cur_frm.cscript.refresh = function(doc) {
|
||||
cur_frm.set_intro("");
|
||||
if(doc.__islocal) {
|
||||
cur_frm.set_intro("First set the name and save the record.");
|
||||
}
|
||||
else {
|
||||
cur_frm.set_intro("Attach files / urls and add in table.");
|
||||
}
|
||||
}
|
||||
8
website/doctype/website_slideshow/website_slideshow.py
Normal file
8
website/doctype/website_slideshow/website_slideshow.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# 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
|
||||
85
website/doctype/website_slideshow/website_slideshow.txt
Normal file
85
website/doctype/website_slideshow/website_slideshow.txt
Normal file
@@ -0,0 +1,85 @@
|
||||
[
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-12-25 16:47:53",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-25 16:56:34"
|
||||
},
|
||||
{
|
||||
"autoname": "field:slideshow_name",
|
||||
"allow_attach": 1,
|
||||
"name": "__common__",
|
||||
"doctype": "DocType",
|
||||
"module": "Website",
|
||||
"max_attachments": 10,
|
||||
"document_type": "Transaction",
|
||||
"description": "Slideshow like display for the website"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Website Slideshow",
|
||||
"doctype": "DocField",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"parentfield": "fields"
|
||||
},
|
||||
{
|
||||
"parent": "Website Slideshow",
|
||||
"read": 1,
|
||||
"cancel": 1,
|
||||
"name": "__common__",
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"parenttype": "DocType",
|
||||
"role": "Website Manager",
|
||||
"permlevel": 0,
|
||||
"parentfield": "permissions"
|
||||
},
|
||||
{
|
||||
"name": "Website Slideshow",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"read_only": 0,
|
||||
"doctype": "DocField",
|
||||
"label": "Slideshow Name",
|
||||
"fieldname": "slideshow_name",
|
||||
"fieldtype": "Data",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"doctype": "DocField",
|
||||
"label": "Slideshow Items",
|
||||
"fieldname": "sb0",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"doctype": "DocField",
|
||||
"label": "Slideshow Items",
|
||||
"fieldname": "slideshow_items",
|
||||
"fieldtype": "Table",
|
||||
"options": "Website Slideshow Item"
|
||||
},
|
||||
{
|
||||
"description": "This goes above the slideshow.",
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"doctype": "DocField",
|
||||
"label": "Header",
|
||||
"fieldname": "header",
|
||||
"fieldtype": "Text Editor"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "File List",
|
||||
"fieldname": "file_list",
|
||||
"fieldtype": "Text",
|
||||
"hidden": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
}
|
||||
]
|
||||
0
website/doctype/website_slideshow_item/__init__.py
Normal file
0
website/doctype/website_slideshow_item/__init__.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# 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
|
||||
@@ -0,0 +1,59 @@
|
||||
[
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-12-25 16:48:49",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-25 16:55:40"
|
||||
},
|
||||
{
|
||||
"istable": 1,
|
||||
"allow_attach": 0,
|
||||
"doctype": "DocType",
|
||||
"module": "Website",
|
||||
"max_attachments": 10,
|
||||
"name": "__common__"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Website Slideshow Item",
|
||||
"doctype": "DocField",
|
||||
"parenttype": "DocType",
|
||||
"permlevel": 0,
|
||||
"parentfield": "fields"
|
||||
},
|
||||
{
|
||||
"name": "Website Slideshow Item",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Image",
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Select",
|
||||
"options": "attach_files:"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Heading",
|
||||
"width": "200px",
|
||||
"fieldname": "heading",
|
||||
"fieldtype": "Data"
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Description",
|
||||
"width": "200px",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Text"
|
||||
},
|
||||
{
|
||||
"print_hide": 1,
|
||||
"no_copy": 1,
|
||||
"doctype": "DocField",
|
||||
"label": "File List",
|
||||
"fieldname": "file_list",
|
||||
"fieldtype": "Text",
|
||||
"hidden": 1
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user