From d025133b393a1f117571cd037751be9622d0402e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 21 Feb 2012 17:26:50 +0530 Subject: [PATCH] added module pages and other css updates --- build.json | 2 + css/all-app.css | 205 ++++++++++++++++-- css/all-web.css | 203 +++++++++++++++-- .../page/accounts_browser/accounts_browser.js | 20 +- .../accounts/page/accounts_home/__init__.py | 0 .../page/accounts_home/accounts_home.html | 126 +++++++++++ .../page/accounts_home/accounts_home.js | 6 + .../page/accounts_home/accounts_home.txt | 28 +++ erpnext/buying/page/buying_home/__init__.py | 0 .../buying/page/buying_home/buying_home.txt | 28 +++ erpnext/hr/page/hr_home/__init__.py | 0 erpnext/hr/page/hr_home/hr_home.txt | 28 +++ .../page/production_home/__init__.py | 0 .../page/production_home/production_home.txt | 28 +++ .../projects/page/projects_home/__init__.py | 0 .../page/projects_home/projects_home.txt | 28 +++ .../page/sales_browser/sales_browser.js | 8 + erpnext/selling/page/selling_home/__init__.py | 12 - .../page/selling_home/selling_home.html | 35 ++- .../selling/page/selling_home/selling_home.js | 39 +--- erpnext/startup/modules.js | 66 ++++++ erpnext/startup/modules_new.js | 36 --- erpnext/startup/startup.js | 2 +- erpnext/startup/toolbar.js | 25 +++ erpnext/stock/page/stock_home/__init__.py | 0 erpnext/stock/page/stock_home/stock_home.html | 89 ++++++++ erpnext/stock/page/stock_home/stock_home.js | 3 + erpnext/stock/page/stock_home/stock_home.txt | 28 +++ erpnext/support/page/__init__.py | 0 erpnext/support/page/support_home/__init__.py | 0 .../page/support_home/support_home.txt | 28 +++ erpnext/utilities/__init__.py | 12 + erpnext/website/js/topbar.js | 9 +- erpnext/website/page/website_home/__init__.py | 0 .../page/website_home/website_home.txt | 28 +++ js/all-app.js | 35 ++- js/all-web.js | 19 +- version.num | 2 +- 38 files changed, 1029 insertions(+), 149 deletions(-) create mode 100644 erpnext/accounts/page/accounts_home/__init__.py create mode 100644 erpnext/accounts/page/accounts_home/accounts_home.html create mode 100644 erpnext/accounts/page/accounts_home/accounts_home.js create mode 100644 erpnext/accounts/page/accounts_home/accounts_home.txt create mode 100644 erpnext/buying/page/buying_home/__init__.py create mode 100644 erpnext/buying/page/buying_home/buying_home.txt create mode 100644 erpnext/hr/page/hr_home/__init__.py create mode 100644 erpnext/hr/page/hr_home/hr_home.txt create mode 100644 erpnext/production/page/production_home/__init__.py create mode 100644 erpnext/production/page/production_home/production_home.txt create mode 100644 erpnext/projects/page/projects_home/__init__.py create mode 100644 erpnext/projects/page/projects_home/projects_home.txt delete mode 100644 erpnext/startup/modules_new.js create mode 100644 erpnext/stock/page/stock_home/__init__.py create mode 100644 erpnext/stock/page/stock_home/stock_home.html create mode 100644 erpnext/stock/page/stock_home/stock_home.js create mode 100644 erpnext/stock/page/stock_home/stock_home.txt create mode 100644 erpnext/support/page/__init__.py create mode 100644 erpnext/support/page/support_home/__init__.py create mode 100644 erpnext/support/page/support_home/support_home.txt create mode 100644 erpnext/website/page/website_home/__init__.py create mode 100644 erpnext/website/page/website_home/website_home.txt diff --git a/build.json b/build.json index 0836706463..24e9d4559c 100644 --- a/build.json +++ b/build.json @@ -43,6 +43,7 @@ "lib/css/bootstrap/buttons.css", "lib/css/bootstrap/navbar.css", "lib/css/bootstrap/dropdown.css", + "lib/css/bootstrap/tooltip.css", "erpnext/startup/startup.css", "erpnext/website/css/website.css" ] @@ -67,6 +68,7 @@ "lib/css/bootstrap/buttons.css", "lib/css/bootstrap/navbar.css", "lib/css/bootstrap/dropdown.css", + "lib/css/bootstrap/tooltip.css", "erpnext/startup/startup.css" ] }, diff --git a/css/all-app.css b/css/all-app.css index 3397f52653..a6dcdb7366 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -65,8 +65,30 @@ hr { border-bottom: 1px solid #ffffff; } +/* links */ + a:active { outline:none; } +a { + color: #0088cc; + text-decoration: none; +} +a:hover { + color: #005580; + text-decoration: underline; +} + +.link_type { + padding:2px; + color: #0088cc; + cursor: pointer; +} + +.link_type:hover { + color: #005580; + text-decoration: underline; +} + :focus { -moz-outline-style:none; } table.simpletable { border-collapse: collapse; margin-bottom: 10px;} @@ -107,19 +129,6 @@ div#head_div { background-color: #FFF; } #head_banner { background-color: #FFF; } -.link_type { - padding:2px; - color: #00b; - text-decoration: underline; - cursor: pointer; -} - -.link_type:hover { - color: #fff !important; - background-color: #07b; - text-decoration: none; -} - div.std-footer { margin: 13px 0px; border-top: 1px solid #AAA; @@ -1590,7 +1599,7 @@ div.psidebar div.section-item { margin-bottom: 7px; } -div.psidebar .section-link { +div.psidebar div.section-item, div.psidebar .section-link { font-size: 11px; color: #666; } @@ -2617,6 +2626,174 @@ button.btn.small, input[type="submit"].btn.small { .dropdown.open .dropdown-menu { display: block; } +/* + * lib/css/bootstrap/tooltip.css + */.tooltip { + position: absolute; + z-index: 1020; + display: block; + visibility: visible; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.8; + filter: alpha(opacity=80); +} +.tooltip.top { + margin-top: -2px; +} +.tooltip.right { + margin-left: 2px; +} +.tooltip.bottom { + margin-top: 2px; +} +.tooltip.left { + margin-left: -2px; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + padding: 5px; +} +.popover.top { + margin-top: -5px; +} +.popover.right { + margin-left: 5px; +} +.popover.bottom { + margin-top: 5px; +} +.popover.left { + margin-left: -5px; +} +.popover.top .arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.popover.right .arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.popover.bottom .arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.popover.left .arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.popover .arrow { + position: absolute; + width: 0; + height: 0; +} +.popover-inner { + padding: 3px; + width: 280px; + overflow: hidden; + background: #000000; + background: rgba(0, 0, 0, 0.8); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); +} +.popover-title { + padding: 9px 15px; + line-height: 1; + background-color: #f5f5f5; + border-bottom: 1px solid #eee; + -webkit-border-radius: 3px 3px 0 0; + -moz-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; +} +.popover-content { + padding: 14px; + background-color: #ffffff; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.popover-content p, .popover-content ul, .popover-content ol { + margin-bottom: 0; +} /* * erpnext/startup/startup.css */h1, h2, h3, h4, h5 { diff --git a/css/all-web.css b/css/all-web.css index 8abd1aa849..1e1548932f 100644 --- a/css/all-web.css +++ b/css/all-web.css @@ -65,8 +65,30 @@ hr { border-bottom: 1px solid #ffffff; } +/* links */ + a:active { outline:none; } +a { + color: #0088cc; + text-decoration: none; +} +a:hover { + color: #005580; + text-decoration: underline; +} + +.link_type { + padding:2px; + color: #0088cc; + cursor: pointer; +} + +.link_type:hover { + color: #005580; + text-decoration: underline; +} + :focus { -moz-outline-style:none; } table.simpletable { border-collapse: collapse; margin-bottom: 10px;} @@ -107,19 +129,6 @@ div#head_div { background-color: #FFF; } #head_banner { background-color: #FFF; } -.link_type { - padding:2px; - color: #00b; - text-decoration: underline; - cursor: pointer; -} - -.link_type:hover { - color: #fff !important; - background-color: #07b; - text-decoration: none; -} - div.std-footer { margin: 13px 0px; border-top: 1px solid #AAA; @@ -1416,6 +1425,174 @@ button.btn.small, input[type="submit"].btn.small { .dropdown.open .dropdown-menu { display: block; } +/* + * lib/css/bootstrap/tooltip.css + */.tooltip { + position: absolute; + z-index: 1020; + display: block; + visibility: visible; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.8; + filter: alpha(opacity=80); +} +.tooltip.top { + margin-top: -2px; +} +.tooltip.right { + margin-left: 2px; +} +.tooltip.bottom { + margin-top: 2px; +} +.tooltip.left { + margin-left: -2px; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + padding: 5px; +} +.popover.top { + margin-top: -5px; +} +.popover.right { + margin-left: 5px; +} +.popover.bottom { + margin-top: 5px; +} +.popover.left { + margin-left: -5px; +} +.popover.top .arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.popover.right .arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.popover.bottom .arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.popover.left .arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.popover .arrow { + position: absolute; + width: 0; + height: 0; +} +.popover-inner { + padding: 3px; + width: 280px; + overflow: hidden; + background: #000000; + background: rgba(0, 0, 0, 0.8); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); +} +.popover-title { + padding: 9px 15px; + line-height: 1; + background-color: #f5f5f5; + border-bottom: 1px solid #eee; + -webkit-border-radius: 3px 3px 0 0; + -moz-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; +} +.popover-content { + padding: 14px; + background-color: #ffffff; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.popover-content p, .popover-content ul, .popover-content ol { + margin-bottom: 0; +} /* * erpnext/startup/startup.css */h1, h2, h3, h4, h5 { diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index 13416e6a53..2f20a6175a 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -1,11 +1,19 @@ pscript['onload_Accounts Browser'] = function(){ wn.require('lib/js/legacy/widgets/tree.js'); - // if the user directly loads the page, ask to select the chart - var parent = $i('ab_body'); - parent.innerHTML = 'Please select your chart: ' - var sel = $a(parent,'select'); - add_sel_options(sel, ['Account', 'Cost Center'], 'Account'); - var btn = $btn(parent, 'Go', function() { pscript.make_chart(sel_val(sel)); }, {marginTop:'8px'}); + + var route = location.hash; + if(route.indexOf('/')!=-1) { + var chart_type = route.split('/')[1]; + pscript.make_chart(chart_type); + return; + } + + // if the user directly loads the page, ask to select the chart + var parent = $i('ab_body'); + parent.innerHTML = 'Please select your chart: ' + var sel = $a(parent,'select'); + add_sel_options(sel, ['Account', 'Cost Center'], 'Account'); + var btn = $btn(parent, 'Go', function() { pscript.make_chart(sel_val(sel)); }, {marginTop:'8px'}); } pscript.make_chart = function(b) { diff --git a/erpnext/accounts/page/accounts_home/__init__.py b/erpnext/accounts/page/accounts_home/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/page/accounts_home/accounts_home.html b/erpnext/accounts/page/accounts_home/accounts_home.html new file mode 100644 index 0000000000..e5c8a2e87d --- /dev/null +++ b/erpnext/accounts/page/accounts_home/accounts_home.html @@ -0,0 +1,126 @@ +
+
+

Accounts

+
+
+

Journal Voucher

+

General Ledger Entries

+

Sales Invoice

+

Bills raised to Customers

+

Purchase Invoice

+

Bills raised by Suppliers

+
+
+

Chart of Accounts

+

Structure of books of accounts

+

Chart of Cost Centers

+

Structure cost centers

+
+
+
+

Reports

+
+
+ +
+
\ No newline at end of file diff --git a/erpnext/accounts/page/accounts_home/accounts_home.js b/erpnext/accounts/page/accounts_home/accounts_home.js new file mode 100644 index 0000000000..615a18ecc0 --- /dev/null +++ b/erpnext/accounts/page/accounts_home/accounts_home.js @@ -0,0 +1,6 @@ +pscript['onload_accounts-home'] = function(wrapper) { + erpnext.module_page.setup_page('Accounts', wrapper); + if(wn.control_panel.country!='India') { + $('.india-specific').toggle(false); + } +} \ No newline at end of file diff --git a/erpnext/accounts/page/accounts_home/accounts_home.txt b/erpnext/accounts/page/accounts_home/accounts_home.txt new file mode 100644 index 0000000000..5cbceff6fa --- /dev/null +++ b/erpnext/accounts/page/accounts_home/accounts_home.txt @@ -0,0 +1,28 @@ +# Page, accounts-home +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-21 13:23:08', + 'docstatus': 0, + 'modified': '2012-02-21 13:23:08', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Accounts', + 'name': '__common__', + 'page_name': u'accounts-home', + 'standard': u'Yes', + 'title': u'Accounts Home' + }, + + # Page, accounts-home + { + 'doctype': 'Page', + 'name': u'accounts-home' + } +] \ No newline at end of file diff --git a/erpnext/buying/page/buying_home/__init__.py b/erpnext/buying/page/buying_home/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/buying/page/buying_home/buying_home.txt b/erpnext/buying/page/buying_home/buying_home.txt new file mode 100644 index 0000000000..d2d2accb03 --- /dev/null +++ b/erpnext/buying/page/buying_home/buying_home.txt @@ -0,0 +1,28 @@ +# Page, buying-home +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-21 13:22:54', + 'docstatus': 0, + 'modified': '2012-02-21 13:22:54', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Buying', + 'name': '__common__', + 'page_name': u'buying-home', + 'standard': u'Yes', + 'title': u'Buying Home' + }, + + # Page, buying-home + { + 'doctype': 'Page', + 'name': u'buying-home' + } +] \ No newline at end of file diff --git a/erpnext/hr/page/hr_home/__init__.py b/erpnext/hr/page/hr_home/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/page/hr_home/hr_home.txt b/erpnext/hr/page/hr_home/hr_home.txt new file mode 100644 index 0000000000..a5a4ba9d31 --- /dev/null +++ b/erpnext/hr/page/hr_home/hr_home.txt @@ -0,0 +1,28 @@ +# Page, hr-home +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-21 13:24:05', + 'docstatus': 0, + 'modified': '2012-02-21 13:24:05', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'HR', + 'name': '__common__', + 'page_name': u'hr-home', + 'standard': u'Yes', + 'title': u'Human Resources Home' + }, + + # Page, hr-home + { + 'doctype': 'Page', + 'name': u'hr-home' + } +] \ No newline at end of file diff --git a/erpnext/production/page/production_home/__init__.py b/erpnext/production/page/production_home/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/production/page/production_home/production_home.txt b/erpnext/production/page/production_home/production_home.txt new file mode 100644 index 0000000000..4f6cabb006 --- /dev/null +++ b/erpnext/production/page/production_home/production_home.txt @@ -0,0 +1,28 @@ +# Page, production-home +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-21 13:24:34', + 'docstatus': 0, + 'modified': '2012-02-21 13:24:34', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Production', + 'name': '__common__', + 'page_name': u'production-home', + 'standard': u'Yes', + 'title': u'Production Home' + }, + + # Page, production-home + { + 'doctype': 'Page', + 'name': u'production-home' + } +] \ No newline at end of file diff --git a/erpnext/projects/page/projects_home/__init__.py b/erpnext/projects/page/projects_home/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/projects/page/projects_home/projects_home.txt b/erpnext/projects/page/projects_home/projects_home.txt new file mode 100644 index 0000000000..665ac99532 --- /dev/null +++ b/erpnext/projects/page/projects_home/projects_home.txt @@ -0,0 +1,28 @@ +# Page, projects-home +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-21 13:24:22', + 'docstatus': 0, + 'modified': '2012-02-21 13:24:22', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Projects', + 'name': '__common__', + 'page_name': u'projects-home', + 'standard': u'Yes', + 'title': u'Projects Home' + }, + + # Page, projects-home + { + 'doctype': 'Page', + 'name': u'projects-home' + } +] \ No newline at end of file diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js index c7e400e4cc..b7fc422e9b 100644 --- a/erpnext/selling/page/sales_browser/sales_browser.js +++ b/erpnext/selling/page/sales_browser/sales_browser.js @@ -1,5 +1,13 @@ pscript['onload_Sales Browser'] = function(){ wn.require('lib/js/legacy/widgets/tree.js'); + + var route = location.hash; + if(route.indexOf('/')!=-1) { + var chart_type = route.split('/')[1]; + new SalesBrowser().set_val(chart_type) + return; + } + var parent = $i('tr_body'); parent.innerHTML = 'Please select your chart: ' var sel = $a(parent,'select'); diff --git a/erpnext/selling/page/selling_home/__init__.py b/erpnext/selling/page/selling_home/__init__.py index 959135f472..e69de29bb2 100644 --- a/erpnext/selling/page/selling_home/__init__.py +++ b/erpnext/selling/page/selling_home/__init__.py @@ -1,12 +0,0 @@ -import webnotes - -@webnotes.whitelist() -def get_report_list(arg=None): - """return list of reports for this module""" - webnotes.response['values'] = webnotes.conn.sql("""select - distinct criteria_name, doc_type, parent_doc_type - from `tabSearch Criteria` - where module='Selling' - and docstatus in (0, NULL) - order by criteria_name - limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True) \ No newline at end of file diff --git a/erpnext/selling/page/selling_home/selling_home.html b/erpnext/selling/page/selling_home/selling_home.html index 5c7f1b1100..2d421b5b6b 100644 --- a/erpnext/selling/page/selling_home/selling_home.html +++ b/erpnext/selling/page/selling_home/selling_home.html @@ -29,27 +29,46 @@
Setup
-
+
+ Campaign +
+
Tools
diff --git a/erpnext/selling/page/selling_home/selling_home.js b/erpnext/selling/page/selling_home/selling_home.js index 76fac705ea..46cf459852 100644 --- a/erpnext/selling/page/selling_home/selling_home.js +++ b/erpnext/selling/page/selling_home/selling_home.js @@ -1,40 +1,3 @@ pscript['onload_selling-home'] = function(wrapper) { - erpnext.module_page.hide_links(wrapper); - erpnext.module_page.make_list('Selling', wrapper); -} - -wn.provide('erpnext.module_page'); - -// hide list links where the user does -// not have read permissions - -erpnext.module_page.hide_links = function(wrapper) { - $(wrapper).find('[href*="List/"]').each(function() { - var href = $(this).attr('href'); - var dt = href.split('/')[1]; - if(wn.boot.profile.can_read.indexOf(dt)==-1) { - $(this).toggle(false); - } - }); -} - -// make list of reports - -erpnext.module_page.make_list = function(module, wrapper) { - // make project listing - wrapper.list = new wn.widgets.Listing({ - parent: $(wrapper).find('.reports-list').get(0), - method: 'selling.page.selling_home.get_report_list', - render_row: function(row, data) { - if(!data.parent_doc_type) data.parent_doc_type = data.doc_type; - $(row).html(repl('\ - %(criteria_name)s', data)) - }, - args: { - module: module - }, - no_refresh: true - }); - wrapper.list.run(); + erpnext.module_page.setup_page('Selling', wrapper); } \ No newline at end of file diff --git a/erpnext/startup/modules.js b/erpnext/startup/modules.js index 0280c74265..35de0e8e70 100644 --- a/erpnext/startup/modules.js +++ b/erpnext/startup/modules.js @@ -1,3 +1,69 @@ +wn.provide('erpnext.module_page'); + +erpnext.module_page.setup_page = function(module, wrapper) { + erpnext.module_page.hide_links(wrapper); + erpnext.module_page.make_list(module, wrapper); + $(wrapper).find("a").tooltip({ + delay: { show: 500, hide: 100 } + }); +} + +// hide list links where the user does +// not have read permissions + +erpnext.module_page.hide_links = function(wrapper) { + // lists + $(wrapper).find('[href*="List/"]').each(function() { + var href = $(this).attr('href'); + var dt = href.split('/')[1]; + if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1) { + var txt = $(this).text(); + $(this).parent().css('color', '#999').html(txt); + } + }); + + // reports + $(wrapper).find('[data-doctype]').each(function() { + var dt = $(this).attr('data-doctype'); + if(wn.boot.profile.can_read.indexOf(dt)==-1) { + var txt = $(this).text(); + $(this).parent().css('color', '#999').html(txt); + } + }); + + // single (forms) + $(wrapper).find('[href*="Form/"]').each(function() { + var href = $(this).attr('href'); + var dt = href.split('/')[1]; + if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1) { + var txt = $(this).text(); + $(this).parent().css('color', '#999').html(txt); + } + });} + +// make list of reports + +erpnext.module_page.make_list = function(module, wrapper) { + // make project listing + wrapper.list = new wn.widgets.Listing({ + parent: $(wrapper).find('.reports-list').get(0), + method: 'utilities.get_report_list', + render_row: function(row, data) { + if(!data.parent_doc_type) data.parent_doc_type = data.doc_type; + $(row).html(repl('\ + %(criteria_name)s', data)) + }, + args: { + module: module + }, + no_refresh: true + }); + wrapper.list.run(); +} + + + // ==================================================================== pscript.startup_make_sidebar = function() { diff --git a/erpnext/startup/modules_new.js b/erpnext/startup/modules_new.js deleted file mode 100644 index 5f912b0191..0000000000 --- a/erpnext/startup/modules_new.js +++ /dev/null @@ -1,36 +0,0 @@ -// Tools Page -erpnext.ListPage = Class.extend({ - init: function(opts) { - var me = this; - this.opts = opts; - this.page = page_body.add_page[opts.title]; - this.page.wrapper = $a(this.page, 'div', 'layout_wrapper'); - this.page.head = new PageHeading(this.wrapper, this.title) - this.page.list = new wn.widgets.Listing({ - parent: this.page.wrapper, - query: opts.query, - render:row: opts.render_row - }); - }, - show: function() { - if(this.first) { - this.page.list.run(); - this.first = false; - } - page_body.change_to(this.opts.title); - } -}); - -erpnext.ToolsPage = erpnext.ListPage.extend({ - init: function(opts) { - this._super({ - title: opts.module + ' Settings', - query: repl('select name, description from tabDocType where \ - module=%(module)s and ifnull(issingle,0)=1 order by name asc', opts), - render_row: function(parent, data) { - parent.innerHTML = repl('%(name)s\ -
%(description)s
', data) - } - }) - } -}); \ No newline at end of file diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index c68650a800..a45650005b 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -111,5 +111,5 @@ erpnext.startup.set_periodic_updates = function() { // start $(document).bind('startup', function() { - erpnext.startup.start(); + erpnext.startup.start(); }); diff --git a/erpnext/startup/toolbar.js b/erpnext/startup/toolbar.js index d5c5d97cdc..1c8735cdb8 100644 --- a/erpnext/startup/toolbar.js +++ b/erpnext/startup/toolbar.js @@ -2,11 +2,15 @@ wn.provide('erpnext.toolbar'); erpnext.toolbar.setup = function() { + // modules + erpnext.toolbar.add_modules(); + // profile $('#toolbar-user').append('
  • Profile Settings
  • '); $('#toolbar-user').append('
  • Team / Messages
  • '); + $('.navbar .pull-right').prepend('\
  • '); @@ -52,3 +56,24 @@ erpnext.toolbar.setup = function() { page_body.wntoolbar.set_new_comments(); } +erpnext.toolbar.add_modules = function() { + $('').insertAfter('li[data-name="navbar-home"]'); + $('.navbar .nav:first') +} + diff --git a/erpnext/stock/page/stock_home/__init__.py b/erpnext/stock/page/stock_home/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/stock/page/stock_home/stock_home.html b/erpnext/stock/page/stock_home/stock_home.html new file mode 100644 index 0000000000..e1f7817217 --- /dev/null +++ b/erpnext/stock/page/stock_home/stock_home.html @@ -0,0 +1,89 @@ +
    +
    +

    Stock

    +
    +
    +

    Stock Entry

    +

    Transfer stock from one warehouse to another

    +

    Delivery Note

    +

    Delivery (shipment) to customers

    +

    Purchase Receipt

    +

    Goods received from Suppliers

    +
    +
    +

    Item

    +

    Item Master

    +

    Serial No

    +

    Single unit of an Item

    +

    Batch

    +

    Batch of units of an Item

    +

    Warehouse

    +

    Warehouse is where items are stored

    +
    +
    +
    +

    Reports

    +
    +
    +
    +
    + +
    +
    Setup
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/erpnext/stock/page/stock_home/stock_home.js b/erpnext/stock/page/stock_home/stock_home.js new file mode 100644 index 0000000000..ead208f93d --- /dev/null +++ b/erpnext/stock/page/stock_home/stock_home.js @@ -0,0 +1,3 @@ +pscript['onload_stock-home'] = function(wrapper) { + erpnext.module_page.setup_page('Stock', wrapper); +} \ No newline at end of file diff --git a/erpnext/stock/page/stock_home/stock_home.txt b/erpnext/stock/page/stock_home/stock_home.txt new file mode 100644 index 0000000000..f3e7cda698 --- /dev/null +++ b/erpnext/stock/page/stock_home/stock_home.txt @@ -0,0 +1,28 @@ +# Page, stock-home +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-21 13:23:22', + 'docstatus': 0, + 'modified': '2012-02-21 13:23:22', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Stock', + 'name': '__common__', + 'page_name': u'stock-home', + 'standard': u'Yes', + 'title': u'Stock Home' + }, + + # Page, stock-home + { + 'doctype': 'Page', + 'name': u'stock-home' + } +] \ No newline at end of file diff --git a/erpnext/support/page/__init__.py b/erpnext/support/page/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/support/page/support_home/__init__.py b/erpnext/support/page/support_home/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/support/page/support_home/support_home.txt b/erpnext/support/page/support_home/support_home.txt new file mode 100644 index 0000000000..a462abd6fc --- /dev/null +++ b/erpnext/support/page/support_home/support_home.txt @@ -0,0 +1,28 @@ +# Page, support-home +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-21 13:23:35', + 'docstatus': 0, + 'modified': '2012-02-21 13:23:35', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Support', + 'name': '__common__', + 'page_name': u'support-home', + 'standard': u'Yes', + 'title': u'Support Home' + }, + + # Page, support-home + { + 'doctype': 'Page', + 'name': u'support-home' + } +] \ No newline at end of file diff --git a/erpnext/utilities/__init__.py b/erpnext/utilities/__init__.py index e69de29bb2..99f3085e2a 100644 --- a/erpnext/utilities/__init__.py +++ b/erpnext/utilities/__init__.py @@ -0,0 +1,12 @@ +import webnotes + +@webnotes.whitelist() +def get_report_list(arg=None): + """return list of reports for the given module module""" + webnotes.response['values'] = webnotes.conn.sql("""select + distinct criteria_name, doc_type, parent_doc_type + from `tabSearch Criteria` + where module='%(module)s' + and docstatus in (0, NULL) + order by criteria_name + limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True) \ No newline at end of file diff --git a/erpnext/website/js/topbar.js b/erpnext/website/js/topbar.js index 0db3753791..247614b6f3 100644 --- a/erpnext/website/js/topbar.js +++ b/erpnext/website/js/topbar.js @@ -14,7 +14,7 @@ erpnext.navbar.navbar = Class.extend({ $('.brand').html(wn.boot.website_settings.brand_html); this.make_items(); $('.dropdown-toggle').dropdown(); -pull-right }, + }, make: function() { $('header').append('\ -
    ');},make_home:function(){$('.navbar .nav:first').append('
  • Home
  • ')},make_document:function(){wn.ui.toolbar.new_dialog=new wn.ui.toolbar.NewDialog();wn.ui.toolbar.search=new wn.ui.toolbar.Search();wn.ui.toolbar.report=new wn.ui.toolbar.Report();$('.navbar .nav:first').append('
  • Home
  • ')},make_document:function(){wn.ui.toolbar.new_dialog=new wn.ui.toolbar.NewDialog();wn.ui.toolbar.search=new wn.ui.toolbar.Search();wn.ui.toolbar.report=new wn.ui.toolbar.Report();$('.navbar .nav:first').append('