From 9d1faea10ce60dc308b21c245ed816495d254de7 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 2 Oct 2012 14:56:41 +0530 Subject: [PATCH] separated query-report and added module marker to appframe --- accounts/page/accounts_home/accounts_home.js | 2 +- home/page/desktop/desktop.js | 58 +++++-------- public/build.json | 1 + public/js/modules.js | 65 +++++++++++++++ public/js/startup.js | 86 +------------------- public/js/themes.js | 44 ++++++++-- website/templates/js/login.js | 4 - website/templates/pages/login.html | 4 +- 8 files changed, 130 insertions(+), 134 deletions(-) diff --git a/accounts/page/accounts_home/accounts_home.js b/accounts/page/accounts_home/accounts_home.js index d7dceaf2c23..8e71151e656 100644 --- a/accounts/page/accounts_home/accounts_home.js +++ b/accounts/page/accounts_home/accounts_home.js @@ -15,8 +15,8 @@ // along with this program. If not, see . pscript['onload_accounts-home'] = function(wrapper) { - erpnext.module_page.setup_page('Accounts', wrapper); wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'), 'Accounts'); + erpnext.module_page.setup_page('Accounts', wrapper); if(wn.control_panel.country!='India') { $('.india-specific').toggle(false); diff --git a/home/page/desktop/desktop.js b/home/page/desktop/desktop.js index 9ba5253e41e..b3537744e84 100644 --- a/home/page/desktop/desktop.js +++ b/home/page/desktop/desktop.js @@ -18,54 +18,37 @@ erpnext.desktop.refresh = function() { } erpnext.desktop.add_classes = function() { - var classes = [ - { name: 'red', start: '#A90329', middle: '#8F0222', end: '#6D0019' }, - { name: 'brown', start: '#723e02', middle: '#633501', end: '#4a2700' }, - { name: 'green', start: '#4b5602', middle: '#3f4901', end: '#313800' }, - { name: 'blue', start: '#026584', middle: '#025770', end: '#004256' }, - { name: 'yellow', start: '#be7902', middle: '#a66a02', end: '#865500' }, - { name: 'purple', start: '#4d017d', middle: '#410169', end: '#310050' }, - { name: 'ocean', start: '#02a47e', middle: '#018d6c', end: '#006a51' }, - { name: 'pink', start: '#a40281', middle: '#8d016e', end: '#6a0053' }, - { name: 'grey', start: '#545454', middle: '#484848', end: '#363636' }, - { name: 'dark-red', start: '#68021a', middle: '#590116', end: '#440010' }, - { name: 'leaf-green', start: '#b0a400', middle: '#968c00', end: '#726a00' }, - //{ name: 'dark-blue', start: '#023bae', middle: '#013295', end: '#002672' }, - { name: 'bright-green', start: '#03ad1f', middle: '#02941a', end: '#007213' }, - { name: 'bright-yellow', start: '#ffd65e', middle: '#febf04', end: '#ed9017' }, - { name: 'peacock', start: '#026584', middle: '#026584', end: '#322476' }, - { name: 'violet', start: '#50448e', middle: '#473b7f', end: '#3a3169' }, - { name: 'ultra-dark-green', start: '#014333', middle: '#01372b', end: '#002a20' }, - ]; - $.each(classes, function(i, v) { + $.each(wn.module_css_classes, function(i, v) { + v.name = i; $(repl(erpnext.desktop.gradient, v)).appendTo('head'); }); } erpnext.desktop.render = function() { var icons = { - 'Accounts': { gradient: 'blue', sprite: 'account', label: 'Accounts'}, - 'Selling': { gradient: 'green', sprite: 'selling', label: 'Selling'}, - 'Stock': { gradient: 'yellow', sprite: 'stock', label: 'Stock'}, - 'Buying': { gradient: 'red', sprite: 'buying', label: 'Buying'}, - 'Support': { gradient: 'purple', sprite: 'support', label: 'Support'}, - 'HR': { gradient: 'ocean', sprite: 'hr', label: 'Human
Resources'}, - 'Projects': { gradient: 'violet', sprite: 'project', label: 'Projects'}, - 'Production': { gradient: 'dark-red', sprite: 'production', label: 'Production'}, - 'Website': { gradient: 'leaf-green', sprite: 'website', label: 'Website'}, - 'Activity': { gradient: 'brown', sprite: 'feed', label: 'Activity'}, - 'Setup': { gradient: 'grey', sprite: 'setting', label: 'Setup'}, - 'Dashboard': { gradient: 'bright-green', sprite: 'dashboard', label: 'Dashboard'}, - 'To Do': { gradient: 'bright-yellow', sprite: 'todo', label: 'To Do'}, - 'Messages': { gradient: 'pink', sprite: 'messages', label: 'Messages'}, - 'Calendar': { gradient: 'peacock', sprite: 'calendar', label: 'Calendar'}, - 'Knowledge Base': { gradient: 'ultra-dark-green', sprite: 'kb', label: 'Knowledge
Base'} + 'Accounts': { sprite: 'account', label: 'Accounts'}, + 'Selling': { sprite: 'selling', label: 'Selling'}, + 'Stock': { sprite: 'stock', label: 'Stock'}, + 'Buying': { sprite: 'buying', label: 'Buying'}, + 'Support': { sprite: 'support', label: 'Support'}, + 'HR': { sprite: 'hr', label: 'Human
Resources'}, + 'Projects': { sprite: 'project', label: 'Projects'}, + 'Production': { sprite: 'production', label: 'Production'}, + 'Website': { sprite: 'website', label: 'Website'}, + 'Activity': { sprite: 'feed', label: 'Activity'}, + 'Setup': { sprite: 'setting', label: 'Setup'}, + 'Dashboard': { sprite: 'dashboard', label: 'Dashboard'}, + 'To Do': { sprite: 'todo', label: 'To Do'}, + 'Messages': { sprite: 'messages', label: 'Messages'}, + 'Calendar': { sprite: 'calendar', label: 'Calendar'}, + 'Knowledge Base': { sprite: 'kb', label: 'Knowledge
Base'} } - var add_icon = function(m) { var icon = icons[m]; icon.link = erpnext.modules[m]; + icon.gradient = wn.module_css_map[m]; + $('#icon-grid').append(repl('\
\
\ @@ -76,7 +59,6 @@ erpnext.desktop.render = function() { } // setup - for(var i in wn.boot.modules_list) { var m = wn.boot.modules_list[i]; if(!in_list(['Setup', 'Dashboard'], m) && wn.boot.profile.allow_modules.indexOf(m)!=-1) diff --git a/public/build.json b/public/build.json index 7ff8ac0c9d3..e497d394419 100644 --- a/public/build.json +++ b/public/build.json @@ -13,6 +13,7 @@ "public/js/all-app.js": [ "app/public/js/startup.js", "app/public/js/modules.js", + "app/public/js/themes.js", "app/public/js/toolbar.js", "app/public/js/feature_setup.js", "app/public/js/conf.js" diff --git a/public/js/modules.js b/public/js/modules.js index 914df8116d8..a9e82d6ff8d 100644 --- a/public/js/modules.js +++ b/public/js/modules.js @@ -14,9 +14,74 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +erpnext.modules = { + 'Selling': 'selling-home', + 'Accounts': 'accounts-home', + 'Stock': 'stock-home', + 'Buying': 'buying-home', + 'Support': 'support-home', + 'Projects': 'projects-home', + 'Production': 'production-home', + 'Website': 'website-home', + 'HR': 'hr-home', + 'Setup': 'Setup', + 'Activity': 'activity', + 'To Do': 'todo', + 'Calendar': 'calendar', + 'Messages': 'messages', + 'Knowledge Base': 'questions', + 'Dashboard': 'dashboard' +} + +// wn.modules is used in breadcrumbs for getting module home page +wn.provide('wn.modules'); +$.extend(wn.modules, erpnext.modules); +wn.modules['Core'] = 'Setup'; + +wn.module_css_classes = { + 'red': { start: '#A90329', middle: '#8F0222', end: '#6D0019' }, + 'brown': { start: '#723e02', middle: '#633501', end: '#4a2700' }, + 'green': { start: '#4b5602', middle: '#3f4901', end: '#313800' }, + 'blue': { start: '#026584', middle: '#025770', end: '#004256' }, + 'yellow': { start: '#be7902', middle: '#a66a02', end: '#865500' }, + 'purple': { start: '#4d017d', middle: '#410169', end: '#310050' }, + 'ocean': { start: '#02a47e', middle: '#018d6c', end: '#006a51' }, + 'pink': { start: '#a40281', middle: '#8d016e', end: '#6a0053' }, + 'grey': { start: '#545454', middle: '#484848', end: '#363636' }, + 'dark-red': { start: '#68021a', middle: '#590116', end: '#440010' }, + 'leaf-green': { start: '#b0a400', middle: '#968c00', end: '#726a00' }, + //'dark-blue': { start: '#023bae', middle: '#013295', end: '#002672' }, + 'bright-green': { start: '#03ad1f', middle: '#02941a', end: '#007213' }, + 'bright-yellow': { start: '#ffd65e', middle: '#febf04', end: '#ed9017' }, + 'peacock': { start: '#026584', middle: '#026584', end: '#322476' }, + 'violet': { start: '#50448e', middle: '#473b7f', end: '#3a3169' }, + 'ultra-dark-green': { start: '#014333', middle: '#01372b', end: '#002a20' }, +} + +wn.module_css_map = { + 'Accounts': 'blue', + 'Selling': 'green', + 'Stock': 'yellow', + 'Buying': 'red', + 'Support': 'purple', + 'HR': 'ocean', + 'Projects': 'violet', + 'Production': 'dark-red', + 'Website': 'leaf-green', + 'Activity': 'brown', + 'Setup': 'grey', + 'Dashboard': 'bright-green', + 'To Do': 'bright-yellow', + 'Messages': 'pink', + 'Calendar': 'peacock', + 'Knowledge Base': 'ultra-dark-green' +} + + wn.provide('erpnext.module_page'); erpnext.module_page.setup_page = function(module, wrapper) { + wrapper.appframe.set_marker(module); erpnext.module_page.hide_links(wrapper); erpnext.module_page.make_list(module, wrapper); $(wrapper).find("a[title]").tooltip({ diff --git a/public/js/startup.js b/public/js/startup.js index a934063fb30..8cc02cbd487 100644 --- a/public/js/startup.js +++ b/public/js/startup.js @@ -19,30 +19,6 @@ var is_system_manager = 0; wn.provide('erpnext.startup'); -erpnext.modules = { - 'Selling': 'selling-home', - 'Accounts': 'accounts-home', - 'Stock': 'stock-home', - 'Buying': 'buying-home', - 'Support': 'support-home', - 'Projects': 'projects-home', - 'Production': 'production-home', - 'Website': 'website-home', - 'HR': 'hr-home', - 'Setup': 'Setup', - 'Activity': 'activity', - 'To Do': 'todo', - 'Calendar': 'calendar', - 'Messages': 'messages', - 'Knowledge Base': 'questions', - 'Dashboard': 'dashboard' -} - -// wn.modules is used in breadcrumbs for getting module home page -wn.provide('wn.modules'); -$.extend(wn.modules, erpnext.modules); -wn.modules['Core'] = 'Setup'; - erpnext.startup.set_globals = function() { if(inList(user_roles,'System Manager')) is_system_manager = 1; } @@ -168,11 +144,6 @@ erpnext.set_user_background = function(src) { set_style(repl('#body_div { background: url("files/%(src)s") repeat;}', {src:src})) } -// start -$(document).bind('startup', function() { - erpnext.startup.start(); -}); - // subject, sender, description erpnext.send_message = function(opts) { if(opts.btn) { @@ -210,56 +181,7 @@ Mousetrap.bind(["command+s", "ctrl+s"], function() { return false; }); -// theme setter - -erpnext.themes = { - "Default": { - sidebar: "#f2f2f2", - titlebar: "#dfdfdf", - toolbar: "#e9e9e9" - }, - Desert: { - sidebar: "#FFFDF7", - titlebar: "#DAD4C2", - toolbar: "#FAF6E9" - }, - Tropic: { - sidebar: "#FAFFF7", - toolbar: "#EEFAE9", - titlebar: "#D7ECD1" - }, - Sky: { - sidebar: "#F7FFFE", - toolbar: "#E9F9FA", - titlebar: "#D7F5F7" - }, - Snow: { - sidebar: "#fff", - titlebar: "#fff", - toolbar: "#fff" - }, - Sunny: { - sidebar: "#FFFFEF", - titlebar: "#FFFDCA", - toolbar: "lightYellow" - }, - Floral: { - sidebar: "#FFF7F7", - titlebar: "#F7CBCB", - toolbar: "#FAE9EA" - }, - Ocean: { - sidebar: "#F2FFFE", - titlebar: "#8ACFC7", - toolbar: "#C3F3EE" - } -} - -erpnext.set_theme = function(theme) { - wn.dom.set_style(repl(".layout-wrapper-background { \ - background-color: %(sidebar)s !important; }\ - .appframe-toolbar { \ - background-color: %(toolbar)s !important; }\ - .appframe-titlebar { \ - background-color: %(titlebar)s !important; }", erpnext.themes[theme])); -} \ No newline at end of file +// start +$(document).bind('startup', function() { + erpnext.startup.start(); +}); diff --git a/public/js/themes.js b/public/js/themes.js index a60d3cf6c7e..13277299733 100644 --- a/public/js/themes.js +++ b/public/js/themes.js @@ -1,33 +1,61 @@ +// ERPNext - web based ERP (http://erpnext.com) +// Copyright (C) 2012 Web Notes Technologies Pvt Ltd +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// theme setter + erpnext.themes = { - metal: { + "Default": { sidebar: "#f2f2f2", titlebar: "#dfdfdf", toolbar: "#e9e9e9" }, - desert: { + Desert: { sidebar: "#FFFDF7", titlebar: "#DAD4C2", toolbar: "#FAF6E9" }, - tropic: { + Tropic: { sidebar: "#FAFFF7", toolbar: "#EEFAE9", titlebar: "#D7ECD1" }, - sky: { + Sky: { sidebar: "#F7FFFE", toolbar: "#E9F9FA", titlebar: "#D7F5F7" }, - snow: { + Snow: { sidebar: "#fff", titlebar: "#fff", toolbar: "#fff" }, - sun: { + Sunny: { sidebar: "#FFFFEF", - titlebar: "lightYellow", - toolbar: "#FFFDCA" + titlebar: "#FFFDCA", + toolbar: "lightYellow" + }, + Floral: { + sidebar: "#FFF7F7", + titlebar: "#F7CBCB", + toolbar: "#FAE9EA" + }, + Ocean: { + sidebar: "#F2FFFE", + titlebar: "#8ACFC7", + toolbar: "#C3F3EE" } } diff --git a/website/templates/js/login.js b/website/templates/js/login.js index 4ca18c94527..1444d9ec5f7 100644 --- a/website/templates/js/login.js +++ b/website/templates/js/login.js @@ -17,10 +17,6 @@ wn.provide('erpnext.login'); wn.pages["{{ name }}"].onload = function(wrapper) { - wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area')); - wrapper.appframe.title('Login'); - wrapper.appframe.$w.find('.close').toggle(false); - var lw = $i('login_wrapper'); $bs(lw, '1px 1px 3px #888'); diff --git a/website/templates/pages/login.html b/website/templates/pages/login.html index 9bc31711288..e4040fbbd84 100644 --- a/website/templates/pages/login.html +++ b/website/templates/pages/login.html @@ -14,7 +14,9 @@ {% block content %}
-
+
+
Login
+