merge
diff --git a/erpnext/home/page/profile_settings/profile_settings.js b/erpnext/home/page/profile_settings/profile_settings.js
index 667265e..e9cd81f 100644
--- a/erpnext/home/page/profile_settings/profile_settings.js
+++ b/erpnext/home/page/profile_settings/profile_settings.js
@@ -108,44 +108,42 @@
this.change_image = function() {
var d = new wn.widgets.Dialog({
title: 'Set your Profile'
- })
- me.uploader = new Uploader(d.body, {
- modulename:'home.page.profile_settings.profile_settings',
- method: 'set_user_image'
- },
- pscript.user_image_upload, 1)
+ });
+
+ wn.upload.make({
+ parent: d.body,
+ args: {
+ method: 'home.page.profile_settings.profile_settings.set_user_image'
+ },
+ callback: function(fid) {
+ if(fid) {
+ d.hide();
+ wn.boot.user_info[user].image = 'files/' + fid;
+ pscript.myprofile.img.src = 'files/' + fid;
+ }
+ }
+ });
d.show();
- pscript.open_dialog = d;
}
this.change_background = function() {
var d = new wn.widgets.Dialog({
title: 'Set Background Image'
})
- me.uploader = new Uploader(d.body, {
- modulename:'home.page.profile_settings.profile_settings',
- method: 'set_user_background'
- },
- pscript.background_change, 1)
+
+ wn.upload.make({
+ parent: d.body,
+ args: {
+ method: 'home.page.profile_settings.profile_settings.set_user_background'
+ },
+ callback: function(fid) {
+ if(fid) {
+ d.hide();
+ erpnext.set_user_background(fid);
+ }
+ }
+ });
d.show();
- pscript.open_dialog = d;
}
this.make();
-}
-
-pscript.background_change = function(fid) {
- msgprint('File Uploaded');
- if(fid) {
- erpnext.set_user_background(fid);
- pscript.open_dialog.hide();
- }
-}
-
-pscript.user_image_upload = function(fid) {
- msgprint('File Uploaded');
- if(fid) {
- pscript.open_dialog.hide();
- wn.boot.user_info[user].image = 'files/' + fid;
- pscript.myprofile.img.src = 'files/' + fid;
- }
-}
+}
\ No newline at end of file
diff --git a/erpnext/home/page/profile_settings/profile_settings.py b/erpnext/home/page/profile_settings/profile_settings.py
index 631d22a..4e48eee 100644
--- a/erpnext/home/page/profile_settings/profile_settings.py
+++ b/erpnext/home/page/profile_settings/profile_settings.py
@@ -64,14 +64,16 @@
webnotes.msgprint('Updated')
@webnotes.whitelist()
-def set_user_image(fid, fname):
+def set_user_image():
"""
Set uploaded image as user image
"""
check_demo()
- from webnotes.utils.file_manager import add_file_list, remove_file
+ from webnotes.utils.file_manager import add_file_list, remove_file, save_uploaded
user = webnotes.session['user']
-
+
+ fid, fname = save_uploaded()
+
# remove old file
old_image = webnotes.conn.get_value('Profile', user, 'user_image')
if old_image:
@@ -80,15 +82,19 @@
# add new file
add_file_list('Profile', user, fname, fid)
webnotes.conn.set_value('Profile', user, 'user_image', fid)
+
+ return fid
@webnotes.whitelist()
-def set_user_background(fid, fname):
+def set_user_background():
"""
Set uploaded image as user image
"""
check_demo()
- from webnotes.utils.file_manager import add_file_list, remove_file
+ from webnotes.utils.file_manager import add_file_list, remove_file, save_uploaded
user = webnotes.session['user']
+
+ fid, fname = save_uploaded()
# remove old file
old_image = webnotes.conn.get_value('Profile', user, 'background_image')
@@ -98,3 +104,5 @@
# add new file
add_file_list('Profile', user, fname, fid)
webnotes.conn.set_value('Profile', user, 'background_image', fid)
+
+ return fid
diff --git a/public/css/all-app.css b/public/css/all-app.css
index d3062d9..a9ca08b 100644
--- a/public/css/all-app.css
+++ b/public/css/all-app.css
@@ -3202,7 +3202,7 @@
margin-bottom: 7px;
background-color: #fff;
height: 18px;
- border: 2px solid #aaa;
+ border: 1px solid #aaa;
border-radius: 9px;
overflow: hidden;
}
diff --git a/public/css/all-web.css b/public/css/all-web.css
index 27f81df..c54d72b 100644
--- a/public/css/all-web.css
+++ b/public/css/all-web.css
@@ -2438,7 +2438,7 @@
margin-bottom: 7px;
background-color: #fff;
height: 18px;
- border: 2px solid #aaa;
+ border: 1px solid #aaa;
border-radius: 9px;
overflow: hidden;
}
diff --git a/public/css/wn-web.css b/public/css/wn-web.css
index 78cb222..8814437 100644
--- a/public/css/wn-web.css
+++ b/public/css/wn-web.css
@@ -1,9 +1,9 @@
#body_div {
- background: url("../files/indian-textile-5.gif") repeat;
+ background: url("files/indian-textile-5.gif") repeat;
- font-family: 'Arial', Verdana, Sans !important;
+ font-family: 'Lato', Verdana, Sans !important;
font-size: 14px !important;
@@ -17,8 +17,10 @@
+
+
h1, h2, h3, h4, h5 {
- font-family: 'Arial', Arial, 'Helvetica Neue' !important;
+ font-family: 'Lato', Arial, 'Helvetica Neue' !important;
}
@@ -91,7 +93,7 @@
clear: both;
margin: -50px;
margin-top: 50px;
- background-color: #FFFAED;
+ background-color: #DEE1D0; //#E7DFCA;
padding: 50px;
}
@@ -117,12 +119,19 @@
padding: 4px;
}
+.avatar {
+ height: 75px;
+ width: 75px;
+ border-radius: 100px 100px 100px 100px;
+ overflow: hidden;
+}
+
.link-big {
font-size: 140%;
}
.sticky {
- background-color: #F0EDDD;
+ background-color: #FFFBC4;
padding: 15px;
margin-left: 15px;
font-size: 12px;
diff --git a/public/js/all-app.js b/public/js/all-app.js
index 27b6e01..e2d88b3 100644
--- a/public/js/all-app.js
+++ b/public/js/all-app.js
@@ -153,7 +153,8 @@
/*
* lib/js/wn/dom.js
*/
-wn.provide('wn.dom');wn.dom={id_count:0,by_id:function(id){return document.getElementById(id);},set_unique_id:function(ele){var id='unique-'+wn.dom.id_count;ele.setAttribute('id',id);wn.dom.id_count++;return id;},eval:function(txt){if(!txt)return;var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);},set_style:function(txt){if(!txt)return;var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
+wn.provide('wn.dom');wn.dom={id_count:0,by_id:function(id){return document.getElementById(id);},set_unique_id:function(ele){var id='unique-'+wn.dom.id_count;if(ele)
+ele.setAttribute('id',id);wn.dom.id_count++;return id;},eval:function(txt){if(!txt)return;var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);},set_style:function(txt){if(!txt)return;var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
document.getElementsByTagName('head')[0].appendChild(se);},add:function(parent,newtag,className,cs,innerHTML,onclick){if(parent&&parent.substr)parent=wn.dom.by_id(parent);var c=document.createElement(newtag);if(parent)
parent.appendChild(c);if(className){if(newtag.toLowerCase()=='img')
c.src=className
@@ -931,6 +932,17 @@
this.load();},addnode:function(label,expandable){if(!this.$ul){this.$ul=$('<ul>').toggle(false).appendTo(this.parent);}
return new wn.ui.TreeNode({tree:this.tree,parent:$('<li>').appendTo(this.$ul),label:label,expandable:expandable});},load:function(){var me=this;args=$.extend(this.tree.args,{parent:this.label});$(me.$a).set_working();wn.call({method:this.tree.method,args:args,callback:function(r){$(me.$a).done_working();$.each(r.message,function(i,v){node=me.addnode(v.value||v,v.expandable);node.$a.data('node-data',v);});me.loaded=true;me.selectnode();}})}})
/*
+ * lib/js/wn/upload.js
+ */
+wn.upload={make:function(opts){var id=wn.dom.set_unique_id();$(opts.parent).append(repl('<iframe id="%(id)s" name="%(id)s" src="blank.html" \
+ style="width:0px; height:0px; border:0px"></iframe>\
+ <form method="POST" enctype="multipart/form-data" \
+ action="%(action)s" target="%(id)s">\
+ <input type="file" name="filedata" /><br>\
+ <input type="submit" class="btn btn-small" value="Upload" />\
+ </form>',{id:id,action:wn.request.url}));opts.args.cmd='uploadfile';opts.args._id=id;for(key in opts.args){if(opts.args[key]){$('<input type="hidden">').attr('name',key).attr('value',opts.args[key]).appendTo($(opts.parent).find('form'));}}
+$('#'+id).get(0).callback=opts.callback},callback:function(id,file_id,args){$('#'+id).get(0).callback(file_id,args);}}
+/*
* lib/js/wn/misc/about.js
*/
wn.provide('wn.ui.misc');wn.ui.misc.about=function(){if(!wn.ui.misc.about_dialog){var d=new wn.widgets.Dialog({title:'About wnframework'})
@@ -1273,14 +1285,6 @@
var newdoc=new_doc;var pscript={};function loadpage(page_name,call_back,no_history){wn.set_route(page_name);}
function loaddocbrowser(dt){wn.set_route('List',dt);}
/*
- * lib/js/legacy/webpage/uploader.js
- */
-var uploaders={};var upload_frame_count=0;Uploader=function(parent,args,callback){var id='frame'+upload_frame_count;upload_frame_count++;this.callback=callback;var div=$a(parent,'div');div.innerHTML='<iframe id="'+id+'" name="'+id+'" src="blank.html" \
- style="width:0px; height:0px; border:0px"></iframe>';var div=$a(parent,'div');div.innerHTML='<form method="POST" enctype="multipart/form-data" action="'+wn.request.url+'" target="'+id+'"></form>';var ul_form=div.childNodes[0];var f_list=[];var inp_fdata=$a_input($a(ul_form,'span'),'file',{name:'filedata'},{marginLeft:'7px'});if(!('cmd'in args)){var inp=$a_input($a(ul_form,'span'),'hidden',{name:'cmd'});inp.value='uploadfile';}
-var inp=$a_input($a(ul_form,'span'),'hidden',{name:'uploader_id'});inp.value=id;var inp=$a_input($a(ul_form,'span'),'submit',null,{marginLeft:'7px'});inp.value='Upload';$y(inp,{width:'80px'});for(var key in args){var inp=$a_input($a(ul_form,'span'),'hidden',{name:key});inp.value=args[key];}
-uploaders[id]=this;}
-function upload_callback(id,fid){uploaders[id].callback(fid);}
-/*
* lib/js/legacy/wn/page_layout.js
*/
wn.PageLayout=function(args){$.extend(this,args)
@@ -1412,7 +1416,7 @@
/*
* lib/js/wn/ui/toolbar/report.js
*/
-wn.ui.toolbar.Report=wn.ui.toolbar.SelectorDialog.extend({init:function(){this._super({title:"Start Report For",execute:function(val){loadreport(val,null,null,null,1);},});this.set_values(profile.can_get_report.join(',').split(','));}});
+wn.ui.toolbar.Report=wn.ui.toolbar.SelectorDialog.extend({init:function(){this._super({title:"Start Report For",execute:function(val){wn.set_route('Report2',val);},});this.set_values(profile.can_get_report.join(',').split(','));}});
/*
* lib/js/wn/ui/toolbar/recent.js
*/
@@ -2211,7 +2215,7 @@
this.add_attachment=function(){if(!this.dialog){this.dialog=new wn.widgets.Dialog({title:'Add Attachment',width:400})
$y(this.dialog.body,{margin:'13px'})
this.dialog.make();}
-this.dialog.body.innerHTML='';this.dialog.show();this.uploader=new Uploader(this.dialog.body,{from_form:1,doctype:doctype,docname:docname,at_id:this.at_id},wn.widgets.form.file_upload_done);}
+this.dialog.body.innerHTML='';this.dialog.show();wn.upload.make({parent:this.dialog.body,args:{from_form:1,doctype:doctype,docname:docname},callback:wn.widgets.form.file_upload_done});}
this.make();}
wn.widgets.form.sidebar.Attachment=function(parent,filedet,frm){filedet=filedet.split(',')
this.filename=filedet[0];this.fileid=filedet[1];this.frm=frm;var me=this;this.wrapper=$a(parent,'div','sidebar-comment-message');this.remove_fileid=function(){var doc=locals[me.frm.doctype][me.frm.docname];var fl=doc.file_list.split('\n');new_fl=[];for(var i=0;i<fl.length;i++){if(fl[i].split(',')[1]!=me.fileid)new_fl.push(fl[i]);}
@@ -2220,7 +2224,7 @@
display_name=this.filename;this.ln=$a(this.wrapper,'a','link_type small',{},display_name);this.ln.href='files/'+this.fileid;this.ln.target='_blank';this.del=$a(this.wrapper,'span','close','','×');this.del.onclick=function(){var yn=confirm("Are you sure you want to delete the attachment?")
if(yn){var callback=function(r,rt){locals[me.frm.doctype][me.frm.docname].modified=r.message;$dh(me.wrapper);me.remove_fileid();frm.refresh();}
$c('webnotes.widgets.form.utils.remove_attach',args={'fid':me.fileid,dt:me.frm.doctype,dn:me.frm.docname},callback);}}}
-wn.widgets.form.file_upload_done=function(doctype,docname,fileid,filename,at_id,new_timestamp){var at_id=cint(at_id);var doc=locals[doctype][docname];if(doc.file_list){var fl=doc.file_list.split('\n')
+wn.widgets.form.file_upload_done=function(doctype,docname,fileid,filename,at_id,new_timestamp){var doc=locals[doctype][docname];if(doc.file_list){var fl=doc.file_list.split('\n')
fl.push(filename+','+fileid)
doc.file_list=fl.join('\n');}
else
diff --git a/public/js/all-web.js b/public/js/all-web.js
index 1dc35ac..5db2af5 100644
--- a/public/js/all-web.js
+++ b/public/js/all-web.js
@@ -40,7 +40,8 @@
/*
* lib/js/wn/dom.js
*/
-wn.provide('wn.dom');wn.dom={id_count:0,by_id:function(id){return document.getElementById(id);},set_unique_id:function(ele){var id='unique-'+wn.dom.id_count;ele.setAttribute('id',id);wn.dom.id_count++;return id;},eval:function(txt){if(!txt)return;var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);},set_style:function(txt){if(!txt)return;var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
+wn.provide('wn.dom');wn.dom={id_count:0,by_id:function(id){return document.getElementById(id);},set_unique_id:function(ele){var id='unique-'+wn.dom.id_count;if(ele)
+ele.setAttribute('id',id);wn.dom.id_count++;return id;},eval:function(txt){if(!txt)return;var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);},set_style:function(txt){if(!txt)return;var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
document.getElementsByTagName('head')[0].appendChild(se);},add:function(parent,newtag,className,cs,innerHTML,onclick){if(parent&&parent.substr)parent=wn.dom.by_id(parent);var c=document.createElement(newtag);if(parent)
parent.appendChild(c);if(className){if(newtag.toLowerCase()=='img')
c.src=className
diff --git a/public/js/wn-web.js b/public/js/wn-web.js
index e45acf2..cd6552a 100644
--- a/public/js/wn-web.js
+++ b/public/js/wn-web.js
@@ -1,4 +1,4 @@
-window.home_page = "home";
+window.home_page = "index";
// footer signup widget
// automatically adds it to the .layout-main div of the page
// adds events and also random goodies.
@@ -8,30 +8,18 @@
// goodies
var goodies = [
"ERPNext also contains a module to build your website. \
- The way it works is, when you log out, the app becomes your website. \
- This website is generated from ERPNext.",
+The way it works is, when you log out, the app becomes your website. \
+This website is generated from ERPNext.",
- "You can add custom fields to your transactions in ERPNext to \
- capture specific information about your business.",
+ "You can add custom fields to your transactions in ERPNext to capture specific information about your business.",
- "All forms in ERPNext can be customized, if you feel there are \
- features you do not want to use, you can hide them.",
+ "All forms in ERPNext can be customized, if you feel there are features you do not want to use, you can hide them.",
- "You can email transactions like Quotations and Invoices directly \
- from the system. You can also set this process to become automatic",
+ "You can email transactions like Quotations and Invoices directly from the system. You can also set this process to become automatic",
- "You can create your own Roles and assign user to those roles. \
- You can also set detailed permissions for each role in transactions.",
+ "You can create your own Roles and assign user to those roles. You can also set detailed permissions for each role in transactions.",
- "ERPNext allows you to assign any transaction like an Invoice \
- or Customer Issue to a user. You can also add comments on any \
- transaction.",
-
- "Stay on top with a daily, weekly or montly email summarizing all your business\
- activites and accounting data like Income, Receivables, Paybles etc.",
-
- "Integrate incoming Support queries to your email into ERPNext. \
- Keep track of open tickets and allocate tickets to your users."
+ "ERPNext allows you to assign any transaction like an Invoice or Customer Issue to a user. You can also add comments on any transaction."
];
@@ -40,82 +28,54 @@
$('#page-' + page_name + ' .layout-main').append('<div class="page-footer">\
<h2 style="padding: 0px">Try before you buy. \
-Request a 30-day Free Trial.</h2>\
-<ul>\
-<li><a href="erpnext-pricing.html">Starts at an un-believable $299 per year.</a>\
-<li><a href="http://demo.erpnext.com" target="_blank">\
-Show me a full demo (new page).</a>\
-<li><a href="sign-up.html">Take me to the sign-up page.</a>\
-</ul>\
-<p>\
+Request a 30-day Free Trial.</h2><br>\
+\
+<input name="company_name" type="text" placeholder="Company Name"> \
+<input name="sender_name" type="text" placeholder="Your Name"> \
+<input name="email" type="text" placeholder="Email"> \
+<input name="password" type="password" placeholder="Password"> \
+<button class="btn btn-success btn-small btn-request">Request</button>\
+\
+<p>Note: Free trials usually take one business day to setup. \
+Please fill out your genuine information because we verify \
+your name and company before setting up a demo to \
+ensure that spammers don\'t crash our servers. \
+If you would like to see something right now, \
+<a href="#!demo">jump to the demo.</a></p>\
+\
+<p style="font-size: 90%; margin-top: 10px;">\
<i class="icon-hand-right"></i> <b>ERPNext Goodies:</b> <span class="goodie">'
+ goodies[parseInt(Math.random() * goodies.length)]+
'</goodie></p>\
-<p>ERPNext is <a href="open-source.html">Open Source</a> under the GNU/General Public License.</p>\
-<p><g:plusone size="medium" annotation="inline"></g:plusone></p>\
-\
-<table><tr><td style="width: 115px">\
- <a href="https://twitter.com/erpnext" class="twitter-follow-button" \
- data-show-count="false">Follow @erpnext</a></td>\
- <td style="width: 150px; font-size: 80%; vertical-align: middle;">\
- Get status updates on Twitter.</td></tr>\
-</table>');
+</span>');
- // render plusone
- window.gapi && window.gapi.plusone.go();
-
- // render twitter button
- twttr.widgets.load();
-}
+ // bind the events
-//////////////// Hide Login for frappe!
+ $('#page-'+page_name+' .btn-request').click(function() {
-$(document).ready(function() {
- setTimeout("$('#login-topbar-item').toggle(false);", 1000);
-});
+ var page = $('#page-' + wn.container.page.page_name);
+ var args = {
+ sender_name: page.find('[name="sender_name"]').val(),
+ company_name: page.find('[name="company_name"]').val(),
+ email: page.find('[name="email"]').val(),
+ password: page.find('[name="password"]').val()
+ }
-//////////////// Analytics
-
-window._gaq = window._gaq || [];
-window._gaq.push(['_setAccount', 'UA-8911157-1']);
-window._gaq.push(['_trackPageview']);
-
-(function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-})();
+ if(!(args.sender_name && args.company_name && args.email && args.password)) {
+ msgprint("All fields are necessary. Please try again.");
+ return;
+ }
-/////////////// Page view
-
-$(window).bind('hashchange', function() {
- window._gaq.push(['_trackPageview', wn.get_route_str()]);
-});
-
-/////////////// Update conversion
-
-erpnext.update_conversion = function() {
- $('body').append('<div style="display:inline;">\
-<img height="1" width="1" style="border-style:none;" alt="" \
-src="http://www.googleadservices.com/pagead/conversion/1032834481/?label=JvAUCLX41gEQsZu_7AM&guid=ON&script=0"/>\
-</div>')
-};
-
-////////////// Plus One
-
-(function() {
- var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
- po.src = 'https://apis.google.com/js/plusone.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
-})();
-
-////////////// Twitter
-
-(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];
-if(!d.getElementById(id)){js=d.createElement(s);js.id=id;
-js.src="//platform.twitter.com/widgets.js";
-fjs.parentNode.insertBefore(js,fjs);}})(document,"script","twitter-wjs");
-
+ erpnext.send_message({
+ subject:'New Trial Request',
+ sender: page.find('[name="sender_name"]').val(),
+ message: args,
+ callback: function() {
+ page.find(':input').val('');
+ }
+ });
+ });
+}
\ No newline at end of file