changed desktop modules now using font-awesome instead of noun project fonts

This commit is contained in:
Rushabh Mehta 2012-12-21 18:27:40 +05:30
parent 90a06878e1
commit 5fd89da028
9 changed files with 75 additions and 30 deletions

View file

@ -1,5 +1,4 @@
cur_frm.cscript.onload = function(doc) {
cur_frm.frm_head.appframe.remove_tabs();
if(!cur_frm.roles_editor) {
var role_area = $('<div style="min-height: 300px">')
.appendTo(cur_frm.fields_dict.roles_html.wrapper);

View file

@ -3,7 +3,7 @@ div.appframe-titlebar {
padding: 6px;
padding-left: 13px;
background: #dfdfdf; /* Old browsers */
height: 30px;
height: 28px;
color: #555;
border-bottom: 1px solid #c2c2c2;
vertical-align: middle;
@ -18,6 +18,36 @@ div.appframe-titlebar {
width: 60%;
}
span.appframe-breadcrumb {
display: inline-block;
margin: 5px 0px 0px 0px;
padding: 0px;
float: left;
}
span.appframe-breadcrumb span {
display: inline-block;
padding: 4px 19px 0px 0px;
margin-right: 13px;
background: url('../lib/images/ui/navbarsep.png') right no-repeat;
margin-top: -4px;
color: #777;
font-size: 20px;
}
span.appframe-breadcrumb span:last-child {
background: none;
}
.appframe-breadcrumb span a {
color: #777;
text-decoration: none;
}
.appframe-breadcrumb span a:hover {
color: #999;
}
.appframe-title {
font-size: 150%;
text-overflow: ellipsis;
@ -62,7 +92,7 @@ span.appframe-tab {
margin-top: -6px;
padding: 12px 11px;
height: 18px;
vertical-align: middle;
/*vertical-align: middle;*/
cursor: pointer;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

View file

@ -982,7 +982,7 @@ _f.Frm.prototype.disable_save = function() {
// IMPORTANT: this function should be called in refresh event
cur_frm.save_disabled = true;
cur_frm.page_layout.footer.hide_save();
cur_frm.frm_head.appframe.buttons.Save.toggle(false);
cur_frm.frm_head.appframe.buttons.Save.remove();
}
_f.get_value = function(dt, dn, fn) {

View file

@ -33,12 +33,13 @@ _f.FrmHeader = Class.extend({
this.$w = this.appframe.$w;
this.frm = frm;
this.appframe.add_home_breadcrumb();
this.appframe.add_module_breadcrumb(frm.meta.module)
if(!frm.meta.issingle) {
this.appframe.add_tab(frm.doctype + " List", 0.5, function() {
wn.set_route("List", frm.doctype);
});
this.appframe.add_list_breadcrumb(frm.meta.name)
}
this.appframe.add_module_tab(frm.meta.module);
this.appframe.add_breadcrumb("icon-file");
},
refresh: function() {
this.appframe.set_title(this.frm.docname);

View file

@ -2,7 +2,7 @@ wn.provide('wn.utils');
wn.utils = {
get_file_link: function(filename) {
return wn.utils.is_url(filename) || (filename.indexOf("images/")!=-1)
return wn.utils.is_url(filename) || (filename.indexOf("images/")!=-1) || (filename.indexOf("files/")!=-1)
? filename : 'files/' + filename;
},
is_url: function(txt) {

View file

@ -5,7 +5,8 @@ wn.ui.AppFrame = Class.extend({
this.$w = $('<div></div>').appendTo(parent);
this.$titlebar = $('<div class="appframe-titlebar">\
<div class="appframe-marker"></div>\
<span class="appframe-breadcrumb">\
</span>\
<span class="appframe-center">\
<span class="appframe-title"></span>\
<span class="appframe-subject"></span>\
@ -19,6 +20,7 @@ wn.ui.AppFrame = Class.extend({
if(title)
this.set_title(title);
},
title: function(txt) {
this.set_title(txt);
@ -28,27 +30,36 @@ wn.ui.AppFrame = Class.extend({
document.title = txt;
this.$titlebar.find(".appframe-title").html(txt);
},
add_tab: function(tab_name, opacity, click) {
var span = $('<span class="appframe-tab"></span>')
.html(tab_name).insertAfter(this.$titlebar.find(".close"));
opacity && span.css("opacity", opacity);
click && span.click(click);
return span
clear_breadcrumbs: function() {
this.$w.find(".appframe-breadcrumb").empty();
},
remove_tabs: function() {
this.$w.find(".appframe-tab").remove();
add_breadcrumb: function(icon, link, title) {
if(link) {
$(repl("<span><a href='#%(link)s' title='%(title)s'><i class='%(icon)s'></i>\
</a></span>", {
icon: icon,
link: link,
title: title
})).appendTo(this.$w.find(".appframe-breadcrumb"));
} else {
$(repl("<span><i class='%(icon)s'></i></span>", {
icon: icon,
})).appendTo(this.$w.find(".appframe-breadcrumb"));
}
},
add_module_tab: function(module) {
if(!wn.modules[module]) return;
this.add_tab('<span class="small-module-icons small-module-icons-'+
module.toLowerCase()+'"></span>'+' <span>'
+ wn._(module) + "</span>", 0.7, function() {
wn.set_route(wn.modules[module].link);
});
add_home_breadcrumb: function() {
this.add_breadcrumb("icon-home", wn.home_page, "Home");
},
add_list_breadcrumb: function(doctype) {
this.add_breadcrumb("icon-list", "List/" + encodeURIComponent(doctype), doctype + " List");
},
add_module_breadcrumb: function(module) {
var module_info = wn.modules[module];
if(module_info) {
this.add_breadcrumb(module_info.icon, module_info.link,
module_info.label || module);
}
},
add_button: function(label, click, icon) {
this.add_toolbar();
args = { label: label, icon:'' };

View file

@ -82,7 +82,9 @@ wn.views.DocListView = wn.ui.Listing.extend({
var module = locals.DocType[this.doctype].module;
this.appframe.set_title(this.doctype + " List");
this.appframe.add_module_tab(module);
this.appframe.add_home_breadcrumb();
this.appframe.add_module_breadcrumb(module);
this.appframe.add_breadcrumb("icon-list");
},
setup: function() {

View file

@ -28,7 +28,9 @@ wn.views.ReportViewPage = Class.extend({
make_report_view: function() {
var module = locals.DocType[this.doctype].module;
this.page.appframe.set_title(this.doctype);
this.page.appframe.add_module_tab(module);
this.page.appframe.add_home_breadcrumb()
this.page.appframe.add_module_breadcrumb(module)
this.page.appframe.add_breadcrumb("icon-table");
this.page.reportview = new wn.views.ReportView({
doctype: this.doctype,