started website

This commit is contained in:
Rushabh Mehta
2012-01-24 14:33:21 +05:30
parent 1061b4a7ea
commit 865c00a79a
29 changed files with 1030 additions and 725 deletions

View File

@@ -0,0 +1,66 @@
# Module Def, Website
[
# These values are common in all dictionaries
{
'creation': '2012-01-23 17:05:32',
'docstatus': 0,
'modified': '2012-01-24 10:29:53',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Module Def Role
{
'doctype': 'Module Def Role',
'name': '__common__',
'parent': 'Website',
'parentfield': 'roles',
'parenttype': 'Module Def'
},
# These values are common for all Module Def Item
{
'display_name': 'Top Bar Settings',
'doc_name': 'Top Bar Settings',
'doc_type': 'Single DocType',
'doctype': 'Module Def Item',
'name': '__common__',
'parent': 'Website',
'parentfield': 'items',
'parenttype': 'Module Def'
},
# These values are common for all Module Def
{
'disabled': 'No',
'doctype': u'Module Def',
'is_hidden': 'No',
'module_label': 'Website',
'module_name': 'Website',
'name': '__common__'
},
# Module Def, Website
{
'doctype': u'Module Def',
'name': 'Website'
},
# Module Def Item
{
'doctype': 'Module Def Item'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'System Manager'
},
# Module Def Role
{
'doctype': 'Module Def Role',
'role': 'Website Manager'
}
]

View File

View File

View File

@@ -0,0 +1,74 @@
# DocType, Top Bar Item
[
# These values are common in all dictionaries
{
'creation': '2012-01-24 10:24:19',
'docstatus': 0,
'modified': '2012-01-24 10:24:19',
'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': 1
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Top Bar Item',
'parentfield': 'fields',
'parenttype': 'DocType',
'permlevel': 0
},
# DocType, Top Bar Item
{
'doctype': 'DocType',
'name': 'Top Bar Item'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'label',
'fieldtype': 'Data',
'label': 'Label'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'std_page',
'fieldtype': 'Select',
'label': 'Std Page',
'options': 'Home\nAbout\nContact\nProduct\nCustomer\nBlog\nPartner\nCareer\nCustom'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'custom_page',
'fieldtype': 'Link',
'label': 'Custom Page',
'options': 'Web Page'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'parent_label',
'fieldtype': 'Select',
'label': 'Parent Label'
}
]

View File

@@ -0,0 +1,99 @@
# DocType, Top Bar Settings
[
# These values are common in all dictionaries
{
'creation': '2012-01-24 10:21:41',
'docstatus': 0,
'modified': '2012-01-24 10:45:02',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1327380941',
'allow_attach': 1,
'colour': 'White:FFF',
'doctype': 'DocType',
'document_type': 'Other',
'issingle': 1,
'max_attachments': 1,
'module': 'Website',
'name': '__common__',
'section_style': 'Simple',
'show_in_menu': 0,
'version': 3
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Top Bar Settings',
'parentfield': 'fields',
'parenttype': 'DocType',
'permlevel': 0
},
# These values are common for all DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'Top Bar Settings',
'parentfield': 'permissions',
'parenttype': 'DocType',
'permlevel': 0,
'read': 1,
'write': 1
},
# DocType, Top Bar Settings
{
'doctype': 'DocType',
'name': 'Top Bar Settings'
},
# DocPerm
{
'doctype': 'DocPerm',
'role': 'System Manager'
},
# DocPerm
{
'doctype': 'DocPerm',
'role': 'Website Manager'
},
# DocField
{
'colour': 'White:FFF',
'description': 'Brand is what appears on the top-right of the toolbar. If it is an image, make sure it\nhas a transparent background and use the <img /> tag',
'doctype': 'DocField',
'fieldname': 'brand_html',
'fieldtype': 'Text',
'label': 'Brand HTML'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'top_bar_items',
'fieldtype': 'Table',
'label': 'Top Bar Items',
'options': 'Top Bar Item'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'file_list',
'fieldtype': 'Text',
'hidden': 1,
'label': 'File List',
'no_copy': 1,
'print_hide': 1
}
]

View File

@@ -0,0 +1,46 @@
wn.provide('erpnext.topbar');
wn.require('lib/css/bootstrap/bootstrap-topbar.css');
wn.require('lib/js/bootstrap/bootstrap-dropdown.js');
/*
<li class="dropdown">\
<a class="dropdown-toggle" href="#" onclick="return false;"></a>\
<ul class="dropdown-menu" id="toolbar-user">\
</ul>\
</li>\
*/
erpnext.topbar.TopBar = Class.extend({
init: function() {
this.make();
$('.brand').html(wn.boot.topbar.brand_html);
this.make_items();
},
make: function() {
$('header').append('<div class="topbar">\
<div class="topbar-inner">\
<div class="container">\
<a class="brand">[brand]</a>\
<ul class="nav">\
</ul>\
<img src="lib/images/ui/spinner.gif" id="spinner"/>\
<ul class="nav secondary-nav">\
<li><a href="#!Login Page">Login</a></li>\
</ul>\
</div>\
</div>\
</div>');
},
make_items: function() {
var items = wn.boot.topbaritems
for(var i=0;i<items.length;i++) {
var item = items[i];
if(!item.parent_label) {
$('header .nav:first').append(repl('<li><a href="#" data-label="%(label)s">\
%(label)s</a></li>', item))
}
}
}
});
erpnext.topbar.topbar = new erpnext.topbar.TopBar();