mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-14 20:35:09 +00:00
Merge branch 'latest' of github.com:webnotes/erpnext into latest
This commit is contained in:
@@ -119,6 +119,13 @@ li {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 18px 0;
|
||||
border: 0;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #ffffff;
|
||||
}
|
||||
|
||||
a:active { outline:none; }
|
||||
|
||||
:focus { -moz-outline-style:none; }
|
||||
|
||||
@@ -119,6 +119,13 @@ li {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 18px 0;
|
||||
border: 0;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
border-bottom: 1px solid #ffffff;
|
||||
}
|
||||
|
||||
a:active { outline:none; }
|
||||
|
||||
:focus { -moz-outline-style:none; }
|
||||
@@ -1044,6 +1051,14 @@ h1 {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 11px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #F8F8F8;
|
||||
border: 1px solid #CCCCCC;
|
||||
@@ -1078,13 +1093,6 @@ header .topbar .container {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.web-main-section p,
|
||||
.web-main-section h4,
|
||||
.web-main-section h5,
|
||||
.web-main-section pre {
|
||||
margin-left: 9px;
|
||||
}
|
||||
|
||||
.web-side-section {
|
||||
width: 30%;
|
||||
float: right;
|
||||
|
||||
@@ -11,6 +11,14 @@ h1 {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-bottom: 11px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #F8F8F8;
|
||||
border: 1px solid #CCCCCC;
|
||||
@@ -45,13 +53,6 @@ header .topbar .container {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.web-main-section p,
|
||||
.web-main-section h4,
|
||||
.web-main-section h5,
|
||||
.web-main-section pre {
|
||||
margin-left: 9px;
|
||||
}
|
||||
|
||||
.web-side-section {
|
||||
width: 30%;
|
||||
float: right;
|
||||
|
||||
@@ -21,7 +21,7 @@ pscript['onload_{{ doc.name }}'] = function(wrapper) {
|
||||
|
||||
|
||||
// comments
|
||||
$(wrapper).find('.web-main-section').append('<h3>Comments</h3>');
|
||||
$(wrapper).find('.web-main-section').append('<hr><h3>Comments</h3>');
|
||||
|
||||
wrapper.comment_list = new wn.widgets.Listing({
|
||||
parent: $(wrapper).find('.web-main-section').get(0),
|
||||
|
||||
@@ -32,6 +32,7 @@ class DocType:
|
||||
|
||||
website.utils.add_guest_access_to_page(p.name)
|
||||
self.cleanup_temp()
|
||||
self.if_home_clear_cache()
|
||||
|
||||
def add_page_links(self):
|
||||
"""add links for next_page and see_also"""
|
||||
@@ -54,4 +55,10 @@ class DocType:
|
||||
for f in fl:
|
||||
if f in self.doc.fields:
|
||||
del self.doc.fields[f]
|
||||
|
||||
def if_home_clear_cache(self):
|
||||
"""if home page, clear cache"""
|
||||
if webnotes.conn.get_value("Website Settings", None, "home_page")==self.doc.name:
|
||||
from webnotes.session_cache import clear_cache
|
||||
clear_cache('Guest')
|
||||
|
||||
@@ -13,6 +13,7 @@ erpnext.topbar.TopBar = Class.extend({
|
||||
this.make();
|
||||
$('.brand').html(wn.boot.website_settings.brand_html);
|
||||
this.make_items();
|
||||
$('.topbar').dropdown();
|
||||
},
|
||||
make: function() {
|
||||
$('header').append('<div class="topbar">\
|
||||
@@ -31,13 +32,32 @@ erpnext.topbar.TopBar = Class.extend({
|
||||
$('.brand').attr('href', '#!' + (wn.boot.website_settings.home_page || 'Login Page'))
|
||||
},
|
||||
make_items: function() {
|
||||
var items = wn.boot.website_menus
|
||||
var items = wn.boot.website_menus;
|
||||
|
||||
// parent labels
|
||||
for(var i=0;i<items.length;i++) {
|
||||
var item = items[i];
|
||||
if(!item.parent_label && item.parentfield=='top_bar_items') {
|
||||
item.route = item.url || item.custom_page;
|
||||
$('header .nav:first').append(repl('<li><a href="#!%(route)s" \
|
||||
data-label="%(label)s">%(label)s</a></li>', item))
|
||||
$('header .nav:first').append(repl('<li data-label="%(label)s">\
|
||||
<a href="#!%(route)s">%(label)s</a></li>', item))
|
||||
}
|
||||
}
|
||||
|
||||
// child labels
|
||||
for(var i=0;i<items.length;i++) {
|
||||
var item = items[i];
|
||||
if(item.parent_label && item.parentfield=='top_bar_items') {
|
||||
// check if parent label has class "dropdown"
|
||||
$parent_li = $(repl('header li[data-label="%(parent_label)s"]', item));
|
||||
if(!$parent_li.hasClass('dropdown')) {
|
||||
$parent_li.addClass('dropdown');
|
||||
$parent_li.find('a:first').addClass('dropdown-toggle');
|
||||
$parent_li.append('<ul class="dropdown-menu"></ul>');
|
||||
}
|
||||
item.route = item.url || item.custom_page;
|
||||
$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
|
||||
<a href="#!%(route)s">%(label)s</a></li>', item))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import json, webnotes
|
||||
|
||||
@webnotes.whitelist()
|
||||
@webnotes.whitelist(allow_guest=True)
|
||||
def send(args):
|
||||
"""create support ticket"""
|
||||
args = json.loads(args)
|
||||
|
||||
@@ -67,7 +67,7 @@ erpnext.products.make_product_list = function(wrapper) {
|
||||
<div style="float:left; width: 400px">\
|
||||
<p><b><a href="#!%(page_name)s">%(title)s</a></b></p>\
|
||||
<p>%(short_description)s</p></div>\
|
||||
<div style="clear: both; margin-bottom: 15px; border-bottom: 1px solid #AAA"></div>', data);
|
||||
<div style="clear: both;"></div><hr />', data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ return"";else
|
||||
st=document.documentElement.scrollTop;else if(document.body&&document.body.scrollTop)
|
||||
st=document.body.scrollTop;return st;}
|
||||
function get_cookie(c){var t=""+document.cookie;var ind=t.indexOf(c);if(ind==-1||c=="")return"";var ind1=t.indexOf(';',ind);if(ind1==-1)ind1=t.length;return unescape(t.substring(ind+c.length+1,ind1));}
|
||||
wn.urllib={get_arg:function(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
|
||||
wn.urllib={get_arg:function(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
|
||||
return"";else
|
||||
return decodeURIComponent(results[1]);},get_dict:function(){var d={}
|
||||
var t=window.location.href.split('?')[1];if(!t)return d;if(t.indexOf('#')!=-1)t=t.split('#')[0];if(!t)return d;t=t.split('&');for(var i=0;i<t.length;i++){var a=t[i].split('=');d[decodeURIComponent(a[0])]=decodeURIComponent(a[1]);}
|
||||
@@ -554,7 +554,10 @@ $dh(this.input_area);$ds(this.disp_area);}else{if(this.hide)this.hide();else $dh
|
||||
if(this.show)this.show()
|
||||
else{$ds(this.wrapper);}
|
||||
if(this.input){$ds(this.input_area);$dh(this.disp_area);if(this.input.refresh)this.input.refresh();}else{$dh(this.input_area);$ds(this.disp_area);}}else if(this.disp_status=='Read'){if(this.show)this.show()
|
||||
else{$ds(this.wrapper);}
|
||||
else{$ds(this.wrapper);}
|
||||
$dh(this.input_area);$ds(this.disp_area);}else{if(this.hide)this.hide();else $dh(this.wrapper);}
|
||||
this.set_status=this.disp_status;}}
|
||||
Field.prototype.refresh=function(){this.disp_status=this.get_status();if(this.in_grid&&this.table_refresh&&this.disp_status=='Write')
|
||||
{this.table_refresh();return;}
|
||||
this.set_label();this.refresh_display();if(this.onrefresh)
|
||||
this.onrefresh();if(this.input){if(this.input.refresh)this.input.refresh(this.df);}
|
||||
@@ -1486,7 +1489,10 @@ $dh(this.input_area);$ds(this.disp_area);}else{if(this.hide)this.hide();else $dh
|
||||
if(this.show)this.show()
|
||||
else{$ds(this.wrapper);}
|
||||
if(this.input){$ds(this.input_area);$dh(this.disp_area);if(this.input.refresh)this.input.refresh();}else{$dh(this.input_area);$ds(this.disp_area);}}else if(this.disp_status=='Read'){if(this.show)this.show()
|
||||
else{$ds(this.wrapper);}
|
||||
else{$ds(this.wrapper);}
|
||||
$dh(this.input_area);$ds(this.disp_area);}else{if(this.hide)this.hide();else $dh(this.wrapper);}
|
||||
this.set_status=this.disp_status;}}
|
||||
Field.prototype.refresh=function(){this.disp_status=this.get_status();if(this.in_grid&&this.table_refresh&&this.disp_status=='Write')
|
||||
{this.table_refresh();return;}
|
||||
this.set_label();this.refresh_display();if(this.onrefresh)
|
||||
this.onrefresh();if(this.input){if(this.input.refresh)this.input.refresh(this.df);}
|
||||
@@ -2200,7 +2206,8 @@ this.make();}
|
||||
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();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.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]);}
|
||||
doc.file_list=new_fl.join('\n');}
|
||||
|
||||
@@ -353,7 +353,7 @@ return"";else
|
||||
return decodeURIComponent(results[1]);},get_dict:function(){var d={}
|
||||
var t=window.location.href.split('?')[1];if(!t)return d;if(t.indexOf('#')!=-1)t=t.split('#')[0];if(!t)return d;t=t.split('&');for(var i=0;i<t.length;i++){var a=t[i].split('=');d[decodeURIComponent(a[0])]=decodeURIComponent(a[1]);}
|
||||
return d;},get_base_url:function(){var url=window.location.href.split('#')[0].split('?')[0].split('index.html')[0];if(url.substr(url.length-1,1)=='/')url=url.substr(0,url.length-1)
|
||||
return url},get_file_url:function(file_id){return repl('files/%(fn)s',{fn:file_id,ac:ac_id})}}
|
||||
return url},get_file_url:function(file_id){return repl('files/%(fn)s',{fn:file_id})}}
|
||||
get_url_arg=wn.urllib.get_arg;get_url_dict=wn.urllib.get_dict;var user_img={}
|
||||
var user_img_queue={};var user_img_loading=[];set_user_img=function(img,username,get_latest,img_id){function set_it(i){if(user_img[username]=='no_img_m')
|
||||
i.src='lib/images/ui/no_img_m.gif';else if(user_img[username]=='no_img_f')
|
||||
@@ -463,7 +463,10 @@ $dh(this.input_area);$ds(this.disp_area);}else{if(this.hide)this.hide();else $dh
|
||||
this.set_status=this.disp_status;}}
|
||||
Field.prototype.refresh=function(){this.disp_status=this.get_status();if(this.in_grid&&this.table_refresh&&this.disp_status=='Write')
|
||||
{this.table_refresh();return;}
|
||||
this.set_label();this.refresh_display();if(this.onrefresh)this.onrefresh();if(this.input&&this.input.refresh)this.input.refresh(this.df);if(!this.not_in_form)
|
||||
this.set_label();this.refresh_display();if(this.onrefresh)
|
||||
this.onrefresh();if(this.input){if(this.input.refresh)this.input.refresh(this.df);}
|
||||
if(this.wrapper){this.wrapper.fieldobj=this;$(this.wrapper).trigger('refresh');}
|
||||
if(!this.not_in_form)
|
||||
this.set_input(_f.get_value(this.doctype,this.docname,this.df.fieldname));this.refresh_mandatory();this.set_max_width();}
|
||||
Field.prototype.refresh_label_icon=function(){if(this.df.reqd){if(this.get_value&&is_null(this.get_value())){if(this.label_icon)$ds(this.label_icon);$(this.txt?this.txt:this.input).addClass('field-to-update')}else{if(this.label_icon)$dh(this.label_icon);$(this.txt?this.txt:this.input).removeClass('field-to-update')}}}
|
||||
Field.prototype.set=function(val){if(this.not_in_form)
|
||||
@@ -1134,7 +1137,7 @@ $(document).bind('startup',function(){erpnext.startup.start();});
|
||||
/*
|
||||
* erpnext/website/js/topbar.js
|
||||
*/
|
||||
wn.provide('erpnext.topbar');erpnext.topbar.TopBar=Class.extend({init:function(){this.make();$('.brand').html(wn.boot.website_settings.brand_html);this.make_items();},make:function(){$('header').append('<div class="topbar">\
|
||||
wn.provide('erpnext.topbar');erpnext.topbar.TopBar=Class.extend({init:function(){this.make();$('.brand').html(wn.boot.website_settings.brand_html);this.make_items();$('.topbar').dropdown();},make:function(){$('header').append('<div class="topbar">\
|
||||
<div class="topbar-inner">\
|
||||
<div class="container">\
|
||||
<a class="brand">[brand]</a>\
|
||||
@@ -1146,9 +1149,11 @@ wn.provide('erpnext.topbar');erpnext.topbar.TopBar=Class.extend({init:function()
|
||||
</ul>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>');$('.brand').attr('href','#!'+(wn.boot.website_settings.home_page||'Login Page'))},make_items:function(){var items=wn.boot.website_menus
|
||||
for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='top_bar_items'){item.route=item.url||item.custom_page;$('header .nav:first').append(repl('<li><a href="#!%(route)s" \
|
||||
data-label="%(label)s">%(label)s</a></li>',item))}}}});erpnext.Footer=Class.extend({init:function(){$('footer').html(repl('<div class="web-footer">\
|
||||
</div>');$('.brand').attr('href','#!'+(wn.boot.website_settings.home_page||'Login Page'))},make_items:function(){var items=wn.boot.website_menus;for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='top_bar_items'){item.route=item.url||item.custom_page;$('header .nav:first').append(repl('<li data-label="%(label)s">\
|
||||
<a href="#!%(route)s">%(label)s</a></li>',item))}}
|
||||
for(var i=0;i<items.length;i++){var item=items[i];if(item.parent_label&&item.parentfield=='top_bar_items'){$parent_li=$(repl('header li[data-label="%(parent_label)s"]',item));if(!$parent_li.hasClass('dropdown')){$parent_li.addClass('dropdown');$parent_li.find('a:first').addClass('dropdown-toggle');$parent_li.append('<ul class="dropdown-menu"></ul>');}
|
||||
item.route=item.url||item.custom_page;$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
|
||||
<a href="#!%(route)s">%(label)s</a></li>',item))}}}});erpnext.Footer=Class.extend({init:function(){$('footer').html(repl('<div class="web-footer">\
|
||||
<div class="web-footer-menu"><ul></ul></div>\
|
||||
<div class="web-footer-address">%(address)s</div>\
|
||||
<div class="web-footer-copyright">© %(copyright)s</div>\
|
||||
|
||||
@@ -1 +1 @@
|
||||
425
|
||||
438
|
||||
Reference in New Issue
Block a user