desktop icons now use font-awesome

This commit is contained in:
Rushabh Mehta
2012-12-21 15:00:29 +05:30
parent d49ca03335
commit 946e6d4a46
24 changed files with 122 additions and 189 deletions

View File

@@ -1,49 +1,13 @@
/* Sprite CSS */ /* Sprite CSS */
.sprite-account{ background-position: 0 0; width: 32px; height: 40px; }
.sprite-buying{ background-position: 0 -90px; width: 40px; height: 40px; }
.sprite-calendar{ background-position: 0 -180px; width: 35px; height: 40px; }
.sprite-feed{ background-position: 0 -349px; width: 32px; height: 40px; }
.sprite-hr{ background-position: 0 -439px; width: 40px; height: 32px; }
.sprite-kb{ background-position: 0 -521px; width: 24px; height: 39px; }
.sprite-messages{ background-position: 0 -610px; width: 40px; height: 26px; }
.sprite-manufacturing{ background-position: 0 -686px; width: 40px; height: 33px; }
.sprite-project{ background-position: 0 -769px; width: 40px; height: 22px; }
.sprite-report{ background-position: 0 -841px; width: 29px; height: 40px; }
.sprite-selling{ background-position: 0 -931px; width: 34px; height: 40px; }
.sprite-setting{ background-position: 0 -1021px; width: 37px; height: 40px; }
.sprite-stock{ background-position: 0 -1111px; width: 34px; height: 39px; }
.sprite-support{ background-position: 0 -1200px; width: 40px; height: 40px; }
.sprite-todo{ background-position: 0 -1290px; width: 40px; height: 34px; }
.sprite-website{ background-position: 0 -1374px; width: 40px; height: 40px; }
.sprite-image { background-image: url("app/images/sprite-desktop.png"); }
.sprite-account{ margin-top: 8px; margin-left: 12px; }
.sprite-selling{ margin-top: 8px; margin-left: 12px; }
.sprite-stock{ margin-top: 8px; margin-left: 8px; }
.sprite-buying{ margin-top: 8px; margin-left: 8px; }
.sprite-support{ margin-top: 8px; margin-left: 8px; }
.sprite-hr{ margin-top: 12px; margin-left: 8px; }
.sprite-project{ margin-top: 16px; margin-left: 8px; }
.sprite-manufacturing{ margin-top: 10px; margin-left: 8px; }
.sprite-website{ margin-top: 8px; margin-left: 8px; }
.sprite-setting{ margin-top: 8px; margin-left: 8px; }
.sprite-report{ margin-top: 8px; margin-left: 14px; }
.sprite-messages{ margin-top: 14px; margin-left: 8px; }
.sprite-todo{ margin-top: 10px; margin-left: 10px; }
.sprite-calendar{ margin-top: 8px; margin-left: 10px; }
.sprite-kb{ margin-top: 8px; margin-left: 16px; }
.sprite-feed{ margin-top: 8px; margin-left: 14px; }
.case-border { .case-border {
border-radius: 10px; border-radius: 10px;
-moz-border-radius: 10px; -moz-border-radius: 10px;
-webkit-border-radius: 10px; -webkit-border-radius: 10px;
width: 56px; width: 32px;
height: 56px; height: 32px;
border: 4px solid white; padding: 12px;
border: 2px solid white;
box-shadow: 0 0 4px 1px black; box-shadow: 0 0 4px 1px black;
-moz-box-shadow: 0 0 4px 1px black; -moz-box-shadow: 0 0 4px 1px black;
-webkit-box-shadow: 0 0 4px 1px black; -webkit-box-shadow: 0 0 4px 1px black;
@@ -58,6 +22,12 @@
height: 100px; height: 100px;
} }
.case-wrapper i {
font-size: 32px;
color: #f8f8f8;
margin-top: 8px;
}
.case-label { .case-label {
color: white; color: white;
padding-top: 10px; padding-top: 10px;

View File

@@ -1,74 +1,48 @@
wn.provide('erpnext.desktop'); wn.provide('erpnext.desktop');
erpnext.desktop.gradient = "<style>\
.case-%(name)s {\
background: %(start)s; /* Old browsers */\
background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%, %(middle)s 44%, %(end)s 100%); /* FF3.6+ */\
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,%(start)s), color-stop(44%,%(middle)s), color-stop(100%,%(end)s)); /* Chrome,Safari4+ */\
background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Chrome10+,Safari5.1+ */\
background: -o-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Opera 12+ */\
background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* IE10+ */\
background: radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* W3C */\
}\
</style>"
erpnext.desktop.refresh = function() { erpnext.desktop.refresh = function() {
erpnext.desktop.add_classes();
erpnext.desktop.render(); erpnext.desktop.render();
}
erpnext.desktop.add_classes = function() { $("#icon-grid").sortable({
$.each(wn.module_css_classes, function(i, v) { update: function() {
v.name = i; new_order = [];
$(repl(erpnext.desktop.gradient, v)).appendTo('head'); $("#icon-grid .case-wrapper").each(function(i, e) {
new_order.push($(this).attr("data-name"));
});
wn.user.set_default("_desktop_items", new_order);
}
}); });
} }
erpnext.desktop.render = function() { erpnext.desktop.render = function() {
var icons = {
'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<br />Resources'},
'Projects': { sprite: 'project', label: 'Projects'},
'Manufacturing': { sprite: 'manufacturing', label: 'Manufacturing'},
'Website': { sprite: 'website', label: 'Website'},
'Activity': { sprite: 'feed', label: 'Activity'},
'Setup': { sprite: 'setting', label: 'Setup'},
'To Do': { sprite: 'todo', label: 'To Do'},
'Messages': { sprite: 'messages', label: 'Messages'},
'Calendar': { sprite: 'calendar', label: 'Calendar'},
'Knowledge Base': { sprite: 'kb', label: 'Knowledge<br />Base'}
}
var add_icon = function(m) { var add_icon = function(m) {
var icon = icons[m]; var module = wn.modules[m];
icon.link = erpnext.modules[m]; if(!module.label)
icon.gradient = wn.module_css_map[m]; module.label = m;
module.name = m;
module.gradient_css = wn.get_gradient_css(module.color, 45);
$('#icon-grid').append(repl('\ $('#icon-grid').append(repl('\
<div id="%(sprite)s" class="case-wrapper"><a href="#!%(link)s">\ <div id="module-icon-%(link)s" class="case-wrapper" data-name="%(name)s"><a href="#%(link)s">\
<div class="case-border case-%(gradient)s">\ <div class="case-border" style="%(gradient_css)s">\
<div class="sprite-image sprite-%(sprite)s"></div>\ <i class="%(icon)s"></i>\
</div></a>\ </div></a>\
<div class="case-label">%(label)s</div>\ <div class="case-label">%(label)s</div>\
</div>', icon)); </div>', module));
} }
// setup // modules
for(var i in wn.boot.modules_list) { var modules_list = wn.user.get_default("_desktop_items") || wn.boot.modules_list;
var m = wn.boot.modules_list[i]; $.each(modules_list, function(i, m) {
if(!in_list(['Setup', 'Core'], m) && wn.boot.profile.allow_modules.indexOf(m)!=-1) if(!in_list(['Setup', 'Core'], m) && wn.boot.profile.allow_modules.indexOf(m)!=-1)
add_icon(m); add_icon(m);
} })
// setup
if(user_roles.indexOf('System Manager')!=-1) if(user_roles.indexOf('System Manager')!=-1)
add_icon('Setup') add_icon('Setup')
// apps // notifications
erpnext.desktop.show_pending_notifications(); erpnext.desktop.show_pending_notifications();
} }
@@ -100,12 +74,12 @@ erpnext.desktop.show_pending_notifications = function() {
} }
add_circle('messages', 'unread_messages', 'Unread Messages'); add_circle('module-icon-messages', 'unread_messages', 'Unread Messages');
add_circle('support', 'open_support_tickets', 'Open Support Tickets'); add_circle('module-icon-support', 'open_support_tickets', 'Open Support Tickets');
add_circle('todo', 'things_todo', 'Things To Do'); add_circle('module-icon-todo', 'things_todo', 'Things To Do');
add_circle('calendar', 'todays_events', 'Todays Events'); add_circle('module-icon-calendar', 'todays_events', 'Todays Events');
add_circle('project', 'open_tasks', 'Open Tasks'); add_circle('module-icon-project', 'open_tasks', 'Open Tasks');
add_circle('kb', 'unanswered_questions', 'Unanswered Questions'); add_circle('module-icon-kb', 'unanswered_questions', 'Unanswered Questions');
erpnext.update_messages(); erpnext.update_messages();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -7,7 +7,7 @@ erpnext.set_about = function() {
source: 'https://github.com/webnotes/erpnext', source: 'https://github.com/webnotes/erpnext',
publisher: 'Web Notes Technologies Pvt Ltd, Mumbai', publisher: 'Web Notes Technologies Pvt Ltd, Mumbai',
copyright: '&copy; Web Notes Technologies Pvt Ltd', copyright: '&copy; Web Notes Technologies Pvt Ltd',
version: '2' //+ '.' + window._version_number version: 'Please see git log for the release number'
}); });
} }

View File

@@ -14,75 +14,85 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
erpnext.modules = { $.extend(wn.modules, {
'Selling': 'selling-home', "Selling": {
'Accounts': 'accounts-home', link: "selling-home",
'Stock': 'stock-home', color: "#3f4901",
'Buying': 'buying-home', icon: "icon-tag"
'Support': 'support-home', },
'Projects': 'projects-home', "Accounts": {
'Manufacturing': 'manufacturing-home', link: "accounts-home",
'Website': 'website-home', color: "#025770",
'HR': 'hr-home', icon: "icon-money"
'Setup': 'Setup', },
'Activity': 'activity', "Stock": {
'To Do': 'todo', link: "stock-home",
'Calendar': 'calendar', color: "#a66a02",
'Messages': 'messages', icon: "icon-truck"
'Knowledge Base': 'questions', },
} "Buying": {
link: "buying-home",
wn.provide('wn.modules'); color: "#8F0222",
$.extend(wn.modules, erpnext.modules); icon: "icon-shopping-cart"
wn.modules['Core'] = 'Setup'; },
"Support": {
wn.module_css_classes = { link: "support-home",
'red': { start: '#A90329', middle: '#8F0222', end: '#6D0019' }, color: "#410169",
'brown': { start: '#723e02', middle: '#633501', end: '#4a2700' }, icon: "icon-phone"
'green': { start: '#4b5602', middle: '#3f4901', end: '#313800' }, },
'blue': { start: '#026584', middle: '#025770', end: '#004256' }, "Projects": {
'yellow': { start: '#be7902', middle: '#a66a02', end: '#865500' }, link: "projects-home",
'purple': { start: '#4d017d', middle: '#410169', end: '#310050' }, color: "#473b7f",
'ocean': { start: '#02a47e', middle: '#018d6c', end: '#006a51' }, icon: "icon-tasks"
'pink': { start: '#a40281', middle: '#8d016e', end: '#6a0053' }, },
'grey': { start: '#545454', middle: '#484848', end: '#363636' }, "Manufacturing": {
'dark-red': { start: '#68021a', middle: '#590116', end: '#440010' }, link: "manufacturing-home",
'leaf-green': { start: '#b0a400', middle: '#968c00', end: '#726a00' }, color: "#590116",
//'dark-blue': { start: '#023bae', middle: '#013295', end: '#002672' }, icon: "icon-magic"
'bright-green': { start: '#03ad1f', middle: '#02941a', end: '#007213' }, },
'bright-yellow': { start: '#ffd65e', middle: '#febf04', end: '#ed9017' }, "Website": {
'peacock': { start: '#026584', middle: '#026584', end: '#322476' }, link: "website-home",
'violet': { start: '#50448e', middle: '#473b7f', end: '#3a3169' }, color: "#968c00",
'ultra-dark-green': { start: '#014333', middle: '#01372b', end: '#002a20' }, icon: "icon-globe"
} },
"HR": {
wn.module_css_map = { link: "hr-home",
'Accounts': 'blue', color: "#018d6c",
'Selling': 'green', label: "Human Resources",
'Stock': 'yellow', icon: "icon-group"
'Buying': 'red', },
'Support': 'purple', "Setup": {
'HR': 'ocean', link: "hr-home",
'Projects': 'violet', color: "#484848",
'Manufacturing': 'dark-red', icon: "icon-wrench"
'Website': 'leaf-green', },
'Activity': 'brown', "Activity": {
'Setup': 'grey', link: "activity",
'To Do': 'bright-yellow', color: "#633501",
'Messages': 'pink', icon: "icon-play"
'Calendar': 'peacock', },
'Knowledge Base': 'ultra-dark-green' "To Do": {
} link: "todo",
color: "#febf04",
wn.get_module_color = function(module) { icon: "icon-check"
try { },
var color = wn.module_css_classes[wn.module_css_map[module]].middle; "Calendar": {
} catch(e) { link: "calendar",
var color = "#000"; color: "#026584",
} icon: "icon-calendar"
return color; },
} "Messages": {
link: "messages",
color: "#8d016e",
icon: "icon-comments"
},
"Knowledge Base": {
link: "questions",
color: "#01372b",
icon: "icon-question-sign"
},
});
wn.provide('erpnext.module_page'); wn.provide('erpnext.module_page');

View File

@@ -60,25 +60,4 @@ span, div, td, input, textarea, button, select {
.show-all-reports { .show-all-reports {
margin-top: 5px; margin-top: 5px;
font-size: 11px; font-size: 11px;
}
.small-module-icons-accounts{ background-position: 0 0; width: 14px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-selling{ background-position: 0 -67px; width: 14px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-calendar{ background-position: 0 -134px; width: 15px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-feed{ background-position: 0 -263px; width: 14px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-hr{ background-position: 0 -330px; width: 17px; height: 14px; margin-top: -1px; }
.small-module-icons-kb{ background-position: 0 -394px; width: 10px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-messages{ background-position: 0 -461px; width: 17px; height: 11px; }
.small-module-icons-manufacturing{ background-position: 0 -522px; width: 17px; height: 14px; margin-top: -1px; }
.small-module-icons-projects{ background-position: 0 -586px; width: 17px; height: 10px; }
.small-module-icons-buying{ background-position: 0 -646px; width: 17px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-setup{ background-position: 0 -713px; width: 16px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-stock{ background-position: 0 -780px; width: 14px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-support{ background-position: 0 -847px; width: 17px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons-todo{ background-position: 0 -914px; width: 17px; height: 15px; margin-top: -1px; margin-bottom: -1px; }
.small-module-icons-website{ background-position: 0 -979px; width: 17px; height: 17px; margin-top: -2px; margin-bottom: -2px; }
.small-module-icons {
background-image: url("../app/images/module-icons-small.png");
display: inline-block;
} }

View File

@@ -59,7 +59,7 @@ erpnext.toolbar.add_modules = function() {
wn.boot.modules_list = JSON.parse(wn.boot.modules_list); wn.boot.modules_list = JSON.parse(wn.boot.modules_list);
} }
else else
wn.boot.modules_list = keys(erpnext.modules).sort(); wn.boot.modules_list = keys(wn.modules).sort();
// add to dropdown // add to dropdown
for(var i in wn.boot.modules_list) { for(var i in wn.boot.modules_list) {
@@ -68,8 +68,8 @@ erpnext.toolbar.add_modules = function() {
if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1) { if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1) {
args = { args = {
module: m, module: m,
module_page: erpnext.modules[m], module_page: wn.modules[m].link,
module_label: m=='HR' ? 'Human Resources' : m module_label: wn.modules[m].label || m
} }
$('.navbar .modules').append(repl('<li><a href="#!%(module_page)s" \ $('.navbar .modules').append(repl('<li><a href="#!%(module_page)s" \