diff --git a/css/bootstrap/buttons.css b/css/bootstrap/buttons.css index c0d5993b03..812707d52b 100644 --- a/css/bootstrap/buttons.css +++ b/css/bootstrap/buttons.css @@ -1,4 +1,5 @@ .close { + font-family: Helvetica, Sans; float: right; font-size: 20px; font-weight: bold; diff --git a/css/fonts/droidsans.woff b/css/fonts/droidsans.woff new file mode 100644 index 0000000000..3807cd67d7 Binary files /dev/null and b/css/fonts/droidsans.woff differ diff --git a/css/fonts/pontanosans.woff b/css/fonts/pontanosans.woff new file mode 100644 index 0000000000..d728f0ca15 Binary files /dev/null and b/css/fonts/pontanosans.woff differ diff --git a/css/legacy/body.css b/css/legacy/body.css index 74c93df118..dbc9ba801a 100644 --- a/css/legacy/body.css +++ b/css/legacy/body.css @@ -213,6 +213,7 @@ div.std-footer-item { box-shadow: 0px 0px 6px rgba(0,0,0,0.3); background-color: #fff; padding: 15px; + margin-bottom: 30px; } .layout-wrapper-background { @@ -225,7 +226,7 @@ div.std-footer-item { float: left; padding: 15px; background-color: #FFF; - min-height: 450px; + min-height: 600px; -moz-box-shadow: 7px 0px 6px -2px #ddd; -webkit-box-shadow: 7px 0px 6px -2px #ddd; box-shadow: 7px 0px 6px -2px #ddd; @@ -237,7 +238,7 @@ div.std-footer-item { color: #606060; overflow-x: hidden; padding: 15px; - min-height: 450px; + min-height: 600px; } /* from bootstrap */ diff --git a/css/legacy/sidebar.css b/css/legacy/sidebar.css index a6f3b46fd4..82ae9c2ccc 100644 --- a/css/legacy/sidebar.css +++ b/css/legacy/sidebar.css @@ -14,9 +14,8 @@ div.psidebar div.section { } div.psidebar div.section-head { - font-size: 12px; padding: 5px 11px; - border-bottom: 2px solid #444; + border-bottom: 2px solid #777; } div.psidebar div.section-body { diff --git a/css/ui/fonts.css b/css/ui/fonts.css new file mode 100644 index 0000000000..a56a215d96 --- /dev/null +++ b/css/ui/fonts.css @@ -0,0 +1,13 @@ +@font-face { + font-family: 'Pontano Sans'; + font-style: normal; + font-weight: 400; + src: url('../lib/css/fonts/pontanosans.woff') format('woff'); +} + +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: normal; + src: local('Droid Sans'), local('DroidSans'), url('../lib/css/fonts/droidsans.woff') format('woff'); +} \ No newline at end of file diff --git a/js/core.min.js b/js/core.min.js index 468250df07..39dcd54c39 100644 --- a/js/core.min.js +++ b/js/core.min.js @@ -48,7 +48,7 @@ wn.get_cookie=function(c){var t=""+document.cookie;var ind=t.indexOf(c);if(ind== /* * lib/js/wn/model.js */ -wn.provide('wn.model');wn.model={no_value_type:['Section Break','Column Break','HTML','Table','Button','Image'],with_doctype:function(doctype,callback){if(locals.DocType[doctype]){callback();}else{wn.call({method:'webnotes.widgets.form.load.getdoctype',args:{doctype:doctype},callback:callback});}},with_doc:function(doctype,name,callback){if(!name)name=doctype;if(locals[doctype]&&locals[doctype][name]){callback(name);}else{if(name&&name.indexOf('New '+doctype)!=-1){name=LocalDB.create(doctype);callback(name);}else{wn.call({method:'webnotes.widgets.form.load.getdoc',args:{doctype:doctype,name:name},callback:function(r){callback(name);}});}}},can_delete:function(doctype){if(!doctype)return false;return locals.DocType[doctype].allow_trash&&wn.boot.profile.can_cancel.indexOf(doctype)!=-1;}} +wn.provide('wn.model');wn.model={no_value_type:['Section Break','Column Break','HTML','Table','Button','Image'],new_names:{},with_doctype:function(doctype,callback){if(locals.DocType[doctype]){callback();}else{wn.call({method:'webnotes.widgets.form.load.getdoctype',args:{doctype:doctype},callback:callback});}},with_doc:function(doctype,name,callback){if(!name)name=doctype;if(locals[doctype]&&locals[doctype][name]){callback(name);}else{if(name&&name.indexOf('New '+doctype)!=-1){name=LocalDB.create(doctype);callback(name);}else{wn.call({method:'webnotes.widgets.form.load.getdoc',args:{doctype:doctype,name:name},callback:function(r){callback(name);}});}}},can_delete:function(doctype){if(!doctype)return false;return locals.DocType[doctype].allow_trash&&wn.boot.profile.can_cancel.indexOf(doctype)!=-1;}} /* * lib/js/wn/misc/user.js */ @@ -95,7 +95,7 @@ wn.route=function(){wn._cur_route=window.location.hash;route=wn.get_route();swit wn.views.formview.show(route[1],route[2]);break;case"Report":wn.views.reportview.show(route[1],route[2]);break;default:wn.views.pageview.show(route[0]);}} wn.get_route=function(route){if(!route) route=window.location.hash;if(route.substr(0,1)=='#')route=route.substr(1);if(route.substr(0,1)=='!')route=route.substr(1);return $.map(route.split('/'),function(r){return decodeURIComponent(r);});} -wn.set_route=function(route){window.location.hash=route;} +wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;} wn._cur_route=null;$(window).bind('hashchange',function(){if(location.hash==wn._cur_route) return;wn.route();if(wn.boot.analytics_code){try{eval(wn.boot.analytics_code);}catch(e){console.log(e);}}}); /* @@ -144,7 +144,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\ \ \ ',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();this.make_filters();},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);} -if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype,me.new_doc_onload,true,me.new_doc_onsave);})}else{this.$w.find('.btn-new').remove();} +if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();} if(!me.show_filters){this.$w.find('.btn-filter').remove();} if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();} this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){this.$w.find('.list-toolbar').addClass('btn-group')} @@ -270,7 +270,8 @@ if(me.wrapper[event]){me.wrapper[event](me.wrapper);}}catch(e){console.log(e);}} /* * lib/js/wn/views/formview.js */ -wn.provide('wn.views.formview');wn.views.formview={show:function(dt,dn){wn.model.with_doctype(dt,function(){wn.model.with_doc(dt,dn,function(dn){if(!wn.views.formview[dt]){wn.views.formview[dt]=wn.container.add_page('Form - '+dt);wn.views.formview[dt].frm=new _f.Frm(dt,wn.views.formview[dt]);} +wn.provide('wn.views.formview');wn.views.formview={show:function(dt,dn){if(wn.model.new_names[dn]) +dn=wn.model.new_names[dn];wn.model.with_doctype(dt,function(){wn.model.with_doc(dt,dn,function(dn){if(!wn.views.formview[dt]){wn.views.formview[dt]=wn.container.add_page('Form - '+dt);wn.views.formview[dt].frm=new _f.Frm(dt,wn.views.formview[dt]);} wn.container.change_to('Form - '+dt);wn.views.formview[dt].frm.refresh(dn);});})}} /* * lib/js/wn/views/reportview.js diff --git a/js/legacy/app.js b/js/legacy/app.js index 118a1cd8ad..ea53b58430 100644 --- a/js/legacy/app.js +++ b/js/legacy/app.js @@ -58,7 +58,7 @@ function startup() { // open an existing page or record var t = to_open(); if(t) { - wn.set_route(t); + window.location.hash = t; } else if(home_page) { loadpage(home_page); } diff --git a/js/legacy/model/doclist.js b/js/legacy/model/doclist.js index 64cfc959a0..d4f0b0a9b4 100644 --- a/js/legacy/model/doclist.js +++ b/js/legacy/model/doclist.js @@ -86,12 +86,6 @@ function save_doclist(dt, dn, save_action, onsave, onerr) { } } - var f = frms[dt]; - if(f && !all_clear) { // has errors - if(f)f.savingflag = false; - return 'Error'; - } - var _save = function() { //console.log(compress_doclist(doclist)); $c('webnotes.widgets.form.save.savedocs', {'docs':compress_doclist(doclist), 'docname':dn, 'action': save_action, 'user':user }, diff --git a/js/legacy/model/local_data.js b/js/legacy/model/local_data.js index e7f47f6008..c49aca2150 100644 --- a/js/legacy/model/local_data.js +++ b/js/legacy/model/local_data.js @@ -107,8 +107,11 @@ LocalDB.sync = function(list) { fields[d.parent][d.label] = d; } } - if(d.localname) - notify_rename_observers(d.doctype, d.localname, d.name); + if(d.localname) { + wn.model.new_names[d.localname] = d.name; + $(document).trigger('rename', [d.doctype, d.localname, d.name]); + delete locals[d.doctype][d.localname]; + } } } @@ -145,17 +148,6 @@ LocalDB.set_default_values = function(doc) { } return fields_to_refresh; } -// ====================================================================================== - -LocalDB.is_doc_loaded = function(dt, dn) { - var exists = false; - if(locals[dt] && locals[dt][dn]) exists = true; - if(exists && dt=='DocType' // if it is a doctype - && !locals[dt][dn].__islocal // and not copied - && !frms[dt]) // and not loaded - exists = false; // reload - return exists; -} // ====================================================================================== @@ -315,25 +307,6 @@ function make_doclist(dt, dn, deleted) { return dl; } -// Renaming notification list -// ====================================================================================== - -var rename_observers = []; -function notify_rename_observers(dt, old_name, new_name) { - // delete from local - try { - delete locals[dt][old_name]; - } catch(e) { - alert("[rename_from_local] No Document for: "+ old_name); - } - - // everyone who observers - for(var i=0; iCreated:
\ + \ + %(creation)s

\ +

Modified:
\ + \ + %(modified)s

', { + created_by: wn.user_info(doc.owner).fullname, + avatar_created: wn.user_info(doc.owner).image, + creation: scrub_date(doc.creation), + modified_by: wn.user_info(doc.modified_by).fullname, + avatar_modified: wn.user_info(doc.modified_by).image, + modified: scrub_date(doc.modified) + })); + }, + display: function() { return !me.form.doc.__islocal } + }, { title: 'Help', diff --git a/js/wn/model.js b/js/wn/model.js index e181d01071..4eac1e02d2 100644 --- a/js/wn/model.js +++ b/js/wn/model.js @@ -26,6 +26,8 @@ wn.model = { no_value_type: ['Section Break', 'Column Break', 'HTML', 'Table', 'Button', 'Image'], + new_names: {}, + with_doctype: function(doctype, callback) { if(locals.DocType[doctype]) { callback(); diff --git a/js/wn/router.js b/js/wn/router.js index 193bfdaafb..15a563f66b 100644 --- a/js/wn/router.js +++ b/js/wn/router.js @@ -32,7 +32,8 @@ wn.get_route = function(route) { return $.map(route.split('/'), function(r) { return decodeURIComponent(r); }); } -wn.set_route = function(route) { +wn.set_route = function() { + route = $.map(arguments, function(a) { return encodeURIComponent(a) }).join('/'); window.location.hash = route; } diff --git a/js/wn/ui/listing.js b/js/wn/ui/listing.js index deae534435..bb79d0805a 100644 --- a/js/wn/ui/listing.js +++ b/js/wn/ui/listing.js @@ -43,8 +43,6 @@ // page_length (20) // hide_refresh (False) // new_doctype -// new_doc_onload -// new_doc_onsave // [function] render_row(parent, data) // [function] onrun // no_loading (no ajax indicator) @@ -158,7 +156,7 @@ wn.ui.Listing = Class.extend({ // new if(this.new_doctype) { this.$w.find('.btn-new').toggle(true).click(function() { - newdoc(me.new_doctype, me.new_doc_onload, true, me.new_doc_onsave); + newdoc(me.new_doctype); }) } else { this.$w.find('.btn-new').remove(); diff --git a/js/wn/ui/toolbar.min.js b/js/wn/ui/toolbar.min.js index 2d0dfc1c35..f25f51b60f 100644 --- a/js/wn/ui/toolbar.min.js +++ b/js/wn/ui/toolbar.min.js @@ -24,7 +24,7 @@ wn.ui.toolbar.RecentDocs=Class.extend({init:function(){$('.navbar .nav:first').a Recent\ \ - ');this.setup();this.bind_events();},bind_events:function(){rename_observers.push(this);},rename_notify:function(dt,old,name){this.remove(dt,old);this.add(dt,name,1);},add:function(dt,dn,on_top){if(this.istable(dt))return;this.remove(dt,dn);var html=repl('
  • \ +
  • ');this.setup();this.bind_events();},bind_events:function(){var me=this;$(document).bind('rename',function(event,dt,old_name,new_name){me.rename_notify(dt,old_name,new_name)});},rename_notify:function(dt,old,name){this.remove(dt,old);this.add(dt,name,1);},add:function(dt,dn,on_top){if(this.istable(dt))return;this.remove(dt,dn);var html=repl('
  • \ \ %(dn)s (%(dt)s)\
  • ',{dt:dt,dn:dn});if(on_top){$('#toolbar-recent').prepend(html);}else{$('#toolbar-recent').append(html);}},istable:function(dt){return locals.DocType[dt]&&locals.DocType[dt].istable||false;},remove:function(dt,dn){$(repl('#toolbar-recent li[data-docref="%(dt)s/%(dn)s"]',{dt:dt,dn:dn})).remove();},setup:function(){try{var rlist=JSON.parse(profile.recent);} diff --git a/js/wn/ui/toolbar/recent.js b/js/wn/ui/toolbar/recent.js index c3592ffb32..08ce9d81ea 100644 --- a/js/wn/ui/toolbar/recent.js +++ b/js/wn/ui/toolbar/recent.js @@ -31,8 +31,12 @@ wn.ui.toolbar.RecentDocs = Class.extend({ this.setup(); this.bind_events(); }, - bind_events: function() { - rename_observers.push(this); + bind_events: function() { + // notify on rename + var me = this; + $(document).bind('rename', function(event, dt, old_name, new_name) { + me.rename_notify(dt, old_name, new_name) + }); }, rename_notify: function(dt, old, name) { this.remove(dt, old); diff --git a/js/wn/views/formview.js b/js/wn/views/formview.js index b06ac57d57..179a663682 100644 --- a/js/wn/views/formview.js +++ b/js/wn/views/formview.js @@ -4,6 +4,10 @@ wn.provide('wn.views.formview'); wn.views.formview = { show: function(dt, dn) { + // renamed (on save)? + if(wn.model.new_names[dn]) + dn = wn.model.new_names[dn]; + // show doctype wn.model.with_doctype(dt, function() { wn.model.with_doc(dt, dn, function(dn) { diff --git a/py/webnotes/utils/file_manager.py b/py/webnotes/utils/file_manager.py index 594f7ab162..4d806b2c4f 100644 --- a/py/webnotes/utils/file_manager.py +++ b/py/webnotes/utils/file_manager.py @@ -34,7 +34,7 @@ def upload(): if not webnotes.form['filedata'].filename: webnotes.response['result'] = """ """ % dt return @@ -53,7 +53,7 @@ def upload(): webnotes.response['result'] = """ """ % { 'dt': dt,