added about_us

This commit is contained in:
Rushabh Mehta
2012-01-27 12:17:09 +05:30
parent 4adaae6974
commit 51e51da63f
16 changed files with 318 additions and 9 deletions

View File

@@ -5,7 +5,7 @@
{
'creation': '2012-01-23 17:05:32',
'docstatus': 0,
'modified': '2012-01-25 16:12:14',
'modified': '2012-01-27 10:14:58',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -66,6 +66,13 @@
'doctype': 'Module Def Item'
},
# Module Def Item
{
'display_name': 'About Us Settings',
'doc_name': 'About Us Settings',
'doctype': 'Module Def Item'
},
# Module Def Role
{
'doctype': 'Module Def Role',

View File

@@ -22,4 +22,7 @@ header .topbar .container {
width: 30%;
float: right;
margin-bottom: 20px;
margin-right: 15px;
color: #606060;
overflow-x: hidden;
}

View File

@@ -0,0 +1,23 @@
"""
generate html
"""
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def on_update(self):
"""make home html"""
from website.utils import make_template
import os
path = os.path.join(os.path.dirname(__file__), 'template.html')
self.doc.about_team = webnotes.conn.sql("""select * from `tabAbout Us Team`
where parent='About Us Settings'""", as_dict=1)
import markdown2
for t in self.doc.about_team:
t['bio'] = markdown2.markdown(t['bio'])
webnotes.conn.set_value('Page', 'about', 'content', make_template(self.doc, path))

View File

@@ -0,0 +1,106 @@
# DocType, About Us Settings
[
# These values are common in all dictionaries
{
'creation': '2012-01-27 10:13:16',
'docstatus': 0,
'modified': '2012-01-27 11:36:44',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1327641155',
'allow_attach': 1,
'colour': 'White:FFF',
'doctype': 'DocType',
'issingle': 1,
'max_attachments': 10,
'module': 'Website',
'name': '__common__',
'section_style': 'Simple',
'show_in_menu': 0,
'version': 4
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'About Us Settings',
'parentfield': 'fields',
'parenttype': 'DocType',
'permlevel': 0
},
# These values are common for all DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'About Us Settings',
'parentfield': 'permissions',
'parenttype': 'DocType',
'permlevel': 0,
'read': 1,
'role': 'Website Manager',
'write': 1
},
# DocType, About Us Settings
{
'doctype': 'DocType',
'name': 'About Us Settings'
},
# DocPerm
{
'doctype': 'DocPerm'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'headline',
'fieldtype': 'Data',
'label': 'Headline'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'main_section',
'fieldtype': 'Code',
'label': 'Main Section'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'team',
'fieldtype': 'Table',
'label': 'Team',
'options': 'About Us Team'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'side_section',
'fieldtype': 'Code',
'label': 'Side Section'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'file_list',
'fieldtype': 'Text',
'hidden': 1,
'label': 'File List',
'no_copy': 1,
'print_hide': 1
}
]

View File

@@ -0,0 +1,36 @@
<div class="layout_wrapper">
<div class="web-content" id="content-contact-us">
{% if doc.headline %}
<h1>{{ doc.headline }}</h1>
{% endif %}
<div class="web-main-section">
{{ doc.main_section_html }}
{% if doc.about_team %}
<h2>Team</h2>
<table style="width: 90%">
<tbody>
{% for p in doc.about_team %}
<tr>
<td style="width: 110px">
<img src="files/{{ p.image }}"
style="width: 100px; margin-right: 10px;
margin-bottom: 15px;" />
</td>
<td>
<h4>{{ p.person_name }}</h4>
<div class="comment">{{ p.designation }}</div>
<div style="margin-bottom: 15px">{{ p.bio }}</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
<div class="web-side-section">
{{ doc.side_section_html }}
</div>
<div style="clear: both"></div>
</div>
</div>

View File

@@ -0,0 +1,74 @@
# DocType, About Us Team
[
# These values are common in all dictionaries
{
'creation': '2012-01-27 10:14:18',
'docstatus': 0,
'modified': '2012-01-27 11:54:18',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'colour': 'White:FFF',
'doctype': 'DocType',
'istable': 1,
'module': 'Website',
'name': '__common__',
'section_style': 'Simple',
'show_in_menu': 0,
'version': 5
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'About Us Team',
'parentfield': 'fields',
'parenttype': 'DocType',
'permlevel': 0
},
# DocType, About Us Team
{
'doctype': 'DocType',
'name': 'About Us Team'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'person_name',
'fieldtype': 'Data',
'label': 'Person Name'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'designation',
'fieldtype': 'Data',
'label': 'Designation'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'image',
'fieldtype': 'Select',
'label': 'Image',
'options': 'attach_files:'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'bio',
'fieldtype': 'Text',
'label': 'Bio (markdown)',
'width': '300px'
}
]

View File

View File

@@ -0,0 +1,42 @@
# Page, about
[
# These values are common in all dictionaries
{
'creation': '2012-01-27 11:37:57',
'docstatus': 0,
'modified': '2012-01-27 11:37:57',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Page
{
'doctype': 'Page',
'module': 'Website',
'name': '__common__',
'page_name': 'about',
'standard': 'Yes'
},
# These values are common for all Page Role
{
'doctype': 'Page Role',
'name': '__common__',
'parent': 'about',
'parentfield': 'roles',
'parenttype': 'Page',
'role': 'Guest'
},
# Page, about
{
'doctype': 'Page',
'name': 'about'
},
# Page Role
{
'doctype': 'Page Role'
}
]