minor fixes
This commit is contained in:
parent
1560b1f3cd
commit
652cc1e136
7 changed files with 44 additions and 20 deletions
|
|
@ -330,7 +330,7 @@ def upload():
|
|||
return [d]
|
||||
|
||||
def main_doc_empty(row):
|
||||
return not (row and len(row) > 2 and (row[1] or row[2]))
|
||||
return not (row and ((len(row) > 1 and row[1]) or (len(row) > 2 and row[2])))
|
||||
|
||||
# extra input params
|
||||
import json
|
||||
|
|
|
|||
|
|
@ -75,10 +75,13 @@ wn.core.pages.desktop.show_pending_notifications = function() {
|
|||
|
||||
var sum = 0;
|
||||
if(module_doctypes) {
|
||||
$.each(module_doctypes, function(j, doctype) {
|
||||
sum += (wn.boot.notification_info.open_count_doctype[doctype] || 0);
|
||||
});
|
||||
} else if(wn.boot.notification_info.open_count_module[module]!=null) {
|
||||
if(wn.boot.notification_info.open_count_doctype) {
|
||||
$.each(module_doctypes, function(j, doctype) {
|
||||
sum += (wn.boot.notification_info.open_count_doctype[doctype] || 0);
|
||||
});
|
||||
}
|
||||
} else if(wn.boot.notification_info.open_count_module
|
||||
&& wn.boot.notification_info.open_count_module[module]!=null) {
|
||||
sum = wn.boot.notification_info.open_count_module[module];
|
||||
}
|
||||
var notifier = $("#module-count-" + wn.modules[module]._link);
|
||||
|
|
|
|||
|
|
@ -35,10 +35,19 @@ wn.pages['finder'].onload = function(wrapper) {
|
|||
|
||||
var $list = get_col(6, "file", wn._("Documents"), "info");
|
||||
var $doctype_label = $list.find(".col-heading")
|
||||
|
||||
var $list_link = $list.find(".panel-heading .pull-right")
|
||||
.append('<a class="list-link"><i class="icon-list"></i></a>')
|
||||
.find(".list-link")
|
||||
.click(function() { wn.set_route("List", doctype); })
|
||||
.toggle(false);
|
||||
|
||||
var $new_link = $list.find(".panel-heading .pull-right")
|
||||
.html('<a class="new-link"><i class="icon-plus"></i></a>')
|
||||
.append(' <a class="new-link"><i class="icon-plus"></i></a>')
|
||||
.find(".new-link")
|
||||
.click(function() { new_doc(doctype); })
|
||||
.toggle(false);
|
||||
|
||||
$list = $list.find(".list-group");
|
||||
|
||||
var reset_module = function() {
|
||||
|
|
@ -52,6 +61,7 @@ wn.pages['finder'].onload = function(wrapper) {
|
|||
var reset_doctype = function() {
|
||||
$list.empty();
|
||||
$new_link.toggle(false);
|
||||
$list_link.toggle(false);
|
||||
$doctype_label.html(wn._("Documents"));
|
||||
$('<div class="list-group-item row-select text-muted text-center">'+
|
||||
wn._("Select Document Type")+'</div>').appendTo($list);
|
||||
|
|
@ -103,6 +113,7 @@ wn.pages['finder'].onload = function(wrapper) {
|
|||
|
||||
// new link
|
||||
$new_link.toggle(!!wn.model.can_create(doctype));
|
||||
$list_link.toggle(!!wn.model.can_read(doctype));
|
||||
|
||||
render_list();
|
||||
})
|
||||
|
|
|
|||
|
|
@ -23,14 +23,15 @@ import conf
|
|||
session_stopped = """<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Session Stopped</title>
|
||||
<title>%(title)s</title>
|
||||
</head>
|
||||
<body style="background-color: #eee; font-family: Arial, Sans Serif;">
|
||||
<div style="margin: 30px auto; width: 500px; background-color: #fff;
|
||||
border: 1px solid #aaa; padding: 20px; text-align: center">
|
||||
<b>%(app_name)s: Upgrading...</b>
|
||||
<b>%(app_name)s: %(title)s</b>
|
||||
<p>We will be back in a few moments.</p>
|
||||
</div>
|
||||
<!-- trace %(trace)s -->
|
||||
</body>
|
||||
</html>"""
|
||||
|
||||
|
|
@ -48,12 +49,20 @@ def respond():
|
|||
except webnotes.SessionStopped:
|
||||
print "Content-type: text/html"
|
||||
print
|
||||
print session_stopped % {"app_name": webnotes.get_config().app_name}
|
||||
print session_stopped % {
|
||||
"app_name": webnotes.get_config().app_name,
|
||||
"trace": webnotes.getTraceback(),
|
||||
"title": "Upgrading..."
|
||||
}
|
||||
except MySQLdb.ProgrammingError, e:
|
||||
if e.args[0]==1146:
|
||||
print "Content-type: text/html"
|
||||
print
|
||||
print session_stopped % {"app_name": webnotes.get_config().app_name}
|
||||
print session_stopped % {
|
||||
"app_name": webnotes.get_config().app_name,
|
||||
"trace": webnotes.getTraceback(),
|
||||
"title": "Installing..."
|
||||
}
|
||||
else:
|
||||
raise e
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ $.extend(wn.meta, {
|
|||
if(!c[doctype][docname])
|
||||
c[doctype][docname] = {};
|
||||
|
||||
$.each(wn.meta.docfield_list[doctype], function(i, df) {
|
||||
$.each(wn.meta.docfield_list[doctype] || [], function(i, df) {
|
||||
c[doctype][docname][df.fieldname || df.label] = copy_dict(df);
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ class Installer:
|
|||
{'doctype':'Role', 'role_name': 'All', 'name': 'All'},
|
||||
{'doctype':'Role', 'role_name': 'System Manager', 'name': 'System Manager'},
|
||||
{'doctype':'Role', 'role_name': 'Report Manager', 'name': 'Report Manager'},
|
||||
{'doctype':'Role', 'role_name': 'Website Manager', 'name': 'Website Manager'},
|
||||
{'doctype':'Role', 'role_name': 'Blogger', 'name': 'Blogger'},
|
||||
{'doctype':'Role', 'role_name': 'Guest', 'name': 'Guest'},
|
||||
|
||||
# profiles
|
||||
|
|
@ -130,14 +132,6 @@ class Installer:
|
|||
doc.insert()
|
||||
webnotes.conn.commit()
|
||||
|
||||
# from webnotes.modules.import_file import import_files
|
||||
#
|
||||
# import_files([
|
||||
# ["core", "doctype", "docperm"],
|
||||
# ["core", "doctype", "docfield"],
|
||||
# ["core", "doctype", "doctype"],
|
||||
# ])
|
||||
|
||||
def set_all_patches_as_completed(self):
|
||||
try:
|
||||
from patches.patch_list import patch_list
|
||||
|
|
|
|||
|
|
@ -45,13 +45,20 @@ def translate(lang=None):
|
|||
os.remove('_lang_tmp.csv')
|
||||
|
||||
def get_all_languages():
|
||||
return [f[:-4] for f in os.listdir("app/translations") if f.endswith(".csv")]
|
||||
try:
|
||||
return [f[:-4] for f in os.listdir("app/translations") if f.endswith(".csv")]
|
||||
except OSError, e:
|
||||
if e.args[0]==2:
|
||||
return []
|
||||
else:
|
||||
raise e
|
||||
|
||||
def get_lang_dict():
|
||||
languages_path = os.path.join(get_base_path(), "app", "translations", "languages.json")
|
||||
if os.path.exists(languages_path):
|
||||
with open(languages_path, "r") as langfile:
|
||||
return json.loads(langfile.read())
|
||||
else: return {}
|
||||
|
||||
def update_translations():
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue