@@ -16,7 +16,7 @@ | |||||
</head> | </head> | ||||
<body> | <body> | ||||
<header> | <header> | ||||
<div class="navbar navbar-fixed-top"> | |||||
<div class="navbar"> | |||||
<div class="container"> | <div class="container"> | ||||
<button type="button" class="navbar-toggle" | <button type="button" class="navbar-toggle" | ||||
data-toggle="collapse" data-target=".navbar-responsive-collapse"> | data-toggle="collapse" data-target=".navbar-responsive-collapse"> | ||||
@@ -26,7 +26,7 @@ | |||||
</button> | </button> | ||||
<a class="navbar-brand" href="index.html"> | <a class="navbar-brand" href="index.html"> | ||||
<object data="img/splash.svg" class="erpnext-logo" | <object data="img/splash.svg" class="erpnext-logo" | ||||
type="image/svg+xml"></object> erpnext</a> | |||||
type="image/svg+xml"></object> erpnext.org</a> | |||||
<div class="nav-collapse collapse navbar-responsive-collapse"> | <div class="nav-collapse collapse navbar-responsive-collapse"> | ||||
<ul class="nav navbar-nav"> | <ul class="nav navbar-nav"> | ||||
<li><a href="docs.user.html">User</a></li> | <li><a href="docs.user.html">User</a></li> | ||||
@@ -42,7 +42,7 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</header> | </header> | ||||
<div class="container" style=" margin-top: 70px;"> | |||||
<div class="container" style=" margin-top: 30px;"> | |||||
<!-- div class="logo" style="margin-bottom: 15px; height: 71px;"> | <!-- div class="logo" style="margin-bottom: 15px; height: 71px;"> | ||||
<a href="docs.html"> | <a href="docs.html"> | ||||
<img src="img/erpnext-2013.png" style="width: 71px; margin-top: -10px;" /> | <img src="img/erpnext-2013.png" style="width: 71px; margin-top: -10px;" /> | ||||
@@ -60,14 +60,16 @@ | |||||
<div class="footer text-muted" style="font-size: 80%;"> | <div class="footer text-muted" style="font-size: 80%;"> | ||||
<div class="content row"> | <div class="content row"> | ||||
<div class="col col-lg-12"> | <div class="col col-lg-12"> | ||||
© <a href="https://erpnext.com">Web Notes Technologies Pvt Ltd.</a><br> | |||||
ERPNext is an <a href="https://github.com/webnotes/erpnext" target="_blank"> | |||||
open source project</a>. Code licensed under the | |||||
<a href="https://www.gnu.org/licenses/gpl.html">GNU/GPL License</a>. | |||||
Documentation Licensed under <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a>.<br> | |||||
<a href="docs.user.help.html">Get Help</a> / | |||||
<a href="https://erpnext.com">Buy Hosting or Support Services</a><br> | |||||
<a href="https://erpnext.com/donate">Donate to help make this product better</a> | |||||
© <a href="https://erpnext.com">Web Notes</a> | | |||||
<a href="docs.user.help.html">Help</a> | | |||||
<a href="https://github.com/webnotes/erpnext" target="_blank">Code</a> | | |||||
<a href="https://erpnext.com">Buy Hosting</a> | | |||||
<a href="https://erpnext.com/donate">Donate</a> | |||||
<br> | |||||
<p> | |||||
Code License: <a href="https://www.gnu.org/licenses/gpl.html">GNU/GPL 3</a>. | |||||
Documentation License: <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a>. | |||||
</p> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -216,18 +216,20 @@ wn.docs.DocsPage = Class.extend({ | |||||
} | } | ||||
}, | }, | ||||
make_footer: function() { | make_footer: function() { | ||||
$("<br>").appendTo(this.parent); | |||||
$p = $('<p style="font-size: 80%;" class="text-muted pull-right"></p>').appendTo(this.parent); | |||||
$('<div class="clearfix">').appendTo(this.parent); | |||||
if(this.obj._gh_source) { | if(this.obj._gh_source) { | ||||
$("<br>").appendTo(this.parent); | |||||
$(repl('<p><a href="%(source)s" target="_blank">\ | |||||
<i class="icon-github"></i> Source: Improve this doc</i></a></p>', { | |||||
$(repl('<a href="%(source)s" target="_blank">\ | |||||
<i class="icon-github"></i> Source</i></a>', { | |||||
source: this.obj._gh_source | source: this.obj._gh_source | ||||
})).appendTo(this.parent); | |||||
})).appendTo($p); | |||||
} | } | ||||
if(this.obj._modified) { | if(this.obj._modified) { | ||||
$(repl('<p class="text-muted" style="margin-top: 10px; font-size: 90%;">\ | |||||
Last Updated: %(modified)s</p>', { | |||||
$(repl("<span>" + (this.obj._gh_source ? " | " : "") + 'Last Updated: %(modified)s</span>', { | |||||
modified: wn.datetime.global_date_format(this.obj._modified) | modified: wn.datetime.global_date_format(this.obj._modified) | ||||
})).appendTo(this.parent); | |||||
})).appendTo($p); | |||||
} | } | ||||
}, | }, | ||||
make_links: function() { | make_links: function() { | ||||
@@ -40,7 +40,10 @@ def get_static_pages(): | |||||
with open(fpath, "r") as docfile: | with open(fpath, "r") as docfile: | ||||
src = unicode(docfile.read(), "utf-8") | src = unicode(docfile.read(), "utf-8") | ||||
temp, headers, body = src.split("---", 2) | temp, headers, body = src.split("---", 2) | ||||
d = json.loads(headers) | |||||
try: | |||||
d = json.loads(headers) | |||||
except Exception, e: | |||||
webnotes.msgprint("Bad Headers in: " + fname) | |||||
d["_intro"] = body | d["_intro"] = body | ||||
d["_gh_source"] = get_gh_url(fpath) | d["_gh_source"] = get_gh_url(fpath) | ||||
d["_modified"] = get_timestamp(fpath) | d["_modified"] = get_timestamp(fpath) | ||||
@@ -1,6 +1,6 @@ | |||||
--- | --- | ||||
{ | { | ||||
"_label": "Framework API", | |||||
"_label": "Framework", | |||||
"_toc": [ | "_toc": [ | ||||
"docs.dev.framework.server", | "docs.dev.framework.server", | ||||
"docs.dev.framework.client" | "docs.dev.framework.client" | ||||
@@ -4,7 +4,7 @@ wn.ui.toolbar.Bookmarks = Class.extend({ | |||||
$('.navbar .nav:first').append('<li class="dropdown">\ | $('.navbar .nav:first').append('<li class="dropdown">\ | ||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" \ | <a class="dropdown-toggle" data-toggle="dropdown" href="#" \ | ||||
title="'+wn._("Bookmarks")+'"\ | title="'+wn._("Bookmarks")+'"\ | ||||
onclick="return false;">Bookmarks</a>\ | |||||
onclick="return false;">'+wn._("Bookmarks")+'</a>\ | |||||
<ul class="dropdown-menu" id="toolbar-bookmarks">\ | <ul class="dropdown-menu" id="toolbar-bookmarks">\ | ||||
<li class="divider"></li>\ | <li class="divider"></li>\ | ||||
<li><a href="#" id="add-bookmark-link"><i class="icon-plus"></i> ' | <li><a href="#" id="add-bookmark-link"><i class="icon-plus"></i> ' | ||||
@@ -26,7 +26,7 @@ wn.ui.toolbar.RecentDocs = Class.extend({ | |||||
$('.navbar .nav:first').append('<li class="dropdown">\ | $('.navbar .nav:first').append('<li class="dropdown">\ | ||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" \ | <a class="dropdown-toggle" data-toggle="dropdown" href="#" \ | ||||
title="'+wn._("History")+'"\ | title="'+wn._("History")+'"\ | ||||
onclick="return false;">History</i></a>\ | |||||
onclick="return false;">'+wn._("History")+'</i></a>\ | |||||
<ul class="dropdown-menu" id="toolbar-recent"></ul>\ | <ul class="dropdown-menu" id="toolbar-recent"></ul>\ | ||||
</li>'); | </li>'); | ||||
this.setup(); | this.setup(); | ||||
@@ -154,7 +154,7 @@ wn.ui.toolbar.Toolbar = Class.extend({ | |||||
$('.navbar .nav:first').append('<li class="dropdown">\ | $('.navbar .nav:first').append('<li class="dropdown">\ | ||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" \ | <a class="dropdown-toggle" data-toggle="dropdown" href="#" \ | ||||
title="'+wn._("Tools")+'"\ | title="'+wn._("Tools")+'"\ | ||||
onclick="return false;">Tools</a>\ | |||||
onclick="return false;">'+wn._("Tools")+'</a>\ | |||||
<ul class="dropdown-menu" id="toolbar-tools">\ | <ul class="dropdown-menu" id="toolbar-tools">\ | ||||
<li><a href="#" onclick="return wn.ui.toolbar.clear_cache();">' | <li><a href="#" onclick="return wn.ui.toolbar.clear_cache();">' | ||||
+wn._('Clear Cache & Refresh')+'</a></li>\ | +wn._('Clear Cache & Refresh')+'</a></li>\ | ||||
@@ -441,18 +441,17 @@ def get_config(): | |||||
if not _config: | if not _config: | ||||
import webnotes.utils, json | import webnotes.utils, json | ||||
def update_config(path): | |||||
with open(path, "r") as configfile: | |||||
this_config = json.loads(configfile.read()) | |||||
_config.modules.update(this_config["modules"]) | |||||
_config.web.pages.update(this_config["web"]["pages"]) | |||||
_config.web.generators.update(this_config["web"]["generators"]) | |||||
_config = _dict({"modules": {}, "web": _dict({"pages": {}, "generators": {}})}) | _config = _dict({"modules": {}, "web": _dict({"pages": {}, "generators": {}})}) | ||||
with open(webnotes.utils.get_path("lib", "config.json"), "r") as configf: | |||||
framework_config = json.loads(configf.read()) | |||||
_config.modules.update(framework_config["modules"]) | |||||
_config.web.pages.update(framework_config["web"]["pages"]) | |||||
_config.web.generators.update(framework_config["web"]["generators"]) | |||||
with open(webnotes.utils.get_path("app", "config.json"), "r") as configf: | |||||
app_config = json.loads(configf.read()) | |||||
_config.modules.update(app_config["modules"]) | |||||
_config.web.pages.update(app_config["web"]["pages"]) | |||||
_config.web.generators.update(app_config["web"]["generators"]) | |||||
update_config(webnotes.utils.get_path("lib", "config.json")) | |||||
update_config(webnotes.utils.get_path("app", "config.json")) | |||||
return _config | return _config | ||||
@@ -111,8 +111,6 @@ def build_message_files(): | |||||
build_for_framework('lib/public/js/wn', 'js') | build_for_framework('lib/public/js/wn', 'js') | ||||
build_for_framework('app/public/js', 'js', with_doctype_names=True) | build_for_framework('app/public/js', 'js', with_doctype_names=True) | ||||
#build_for_modules() | |||||
def build_for_pages(path): | def build_for_pages(path): | ||||
"""make locale files for framework py and js (all)""" | """make locale files for framework py and js (all)""" | ||||
messages = [] | messages = [] | ||||
@@ -129,27 +127,6 @@ def build_for_pages(path): | |||||
if messages_py: | if messages_py: | ||||
write_messages_file(basepath, messages_py, "py") | write_messages_file(basepath, messages_py, "py") | ||||
def build_for_modules(): | |||||
"""doctype descriptions, module names, etc for each module""" | |||||
from webnotes.modules import get_module_path, get_doc_path | |||||
for m in webnotes.conn.sql("""select name from `tabModule Def`"""): | |||||
module_path = get_module_path(m[0]) | |||||
if os.path.exists(module_path): | |||||
messages = [] | |||||
messages += [t[0] for t in webnotes.conn.sql("""select description from tabDocType | |||||
where module=%s""", m[0])] | |||||
for t in webnotes.conn.sql("""select | |||||
if(ifnull(title,'')='',name,title) | |||||
from tabPage where module=%s | |||||
and ifnull(standard,'No')='Yes' """, m[0]): | |||||
messages.append(t[0]) | |||||
messages += [t[0] for t in webnotes.conn.sql("""select t1.name from | |||||
tabReport t1, tabDocType t2 where | |||||
t1.ref_doctype = t2.name and | |||||
t1.is_standard = "Yes" and | |||||
t2.module = %s""", m[0])] | |||||
doctype_path = get_doc_path(m[0], 'Module Def', m[0]) | doctype_path = get_doc_path(m[0], 'Module Def', m[0]) | ||||
write_messages_file(doctype_path, messages, 'doc') | write_messages_file(doctype_path, messages, 'doc') | ||||
@@ -206,6 +183,12 @@ def build_for_framework(path, mtype, with_doctype_names = False): | |||||
for m in webnotes.conn.sql("""select name, module from `tabDocType`"""): | for m in webnotes.conn.sql("""select name, module from `tabDocType`"""): | ||||
messages.append(m[0]) | messages.append(m[0]) | ||||
messages.append(m[1]) | messages.append(m[1]) | ||||
# append labels from config.json | |||||
config = webnotes.get_config() | |||||
for m in config["modules"]: | |||||
if m.get("label"): | |||||
messages.append(m["label"]) | |||||
if messages: | if messages: | ||||
write_messages_file(path, messages, mtype) | write_messages_file(path, messages, mtype) | ||||