diff --git a/frappe/cli.py b/frappe/cli.py index f4bade4b8f..f3f30bdb80 100755 --- a/frappe/cli.py +++ b/frappe/cli.py @@ -29,7 +29,6 @@ def main(): sites_path = parsed_args.get("sites_path") if not parsed_args.get("make_app"): - if parsed_args.get("site")=="all": for site in get_sites(parsed_args["sites_path"]): print "\nRunning", fn, "for", site @@ -131,7 +130,7 @@ def setup_parser(): return parser.parse_args() def setup_install(parser): - parser.add_argument("--make_app", metavar="DEST", nargs=1, + parser.add_argument("--make_app", metavar=("DESTINATION", "APP-NAME"), nargs=2, help="Make a new application with boilerplate") parser.add_argument("--install", metavar="DB-NAME", nargs=1, help="Install a new db") @@ -296,9 +295,9 @@ def setup_translation(parser): # methods @cmd -def make_app(destination): +def make_app(destination, app_name): from frappe.utils.boilerplate import make_boilerplate - make_boilerplate(destination) + make_boilerplate(destination, app_name) @cmd def use(sites_path): diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css index 002f1e9e95..5b22262e91 100644 --- a/frappe/public/css/desk.css +++ b/frappe/public/css/desk.css @@ -16,6 +16,12 @@ body { cursor: pointer; } a, +a:hover, +a:active, +a:focus { + outline: 0; +} +a, .badge, .ui-menu .ui-menu-item { -webkit-transition: 0.2s; diff --git a/frappe/public/css/website.css b/frappe/public/css/website.css index d59f2a75db..42a8e63612 100644 --- a/frappe/public/css/website.css +++ b/frappe/public/css/website.css @@ -10,6 +10,12 @@ a { cursor: pointer; } +a, +a:hover, +a:active, +a:focus { + outline: 0; +} img { max-width: 100%; } @@ -198,6 +204,9 @@ fieldset { margin-bottom: 20px; padding: 25px 0px; } +.page-container { + padding: 0px; +} .page-header h1, .page-header h2, .page-header h3 { @@ -208,10 +217,10 @@ fieldset { } .sidebar-item { /*background-color: #f7f7f7;*/ - border-left: 1px solid #eee; + border-left: 1px solid #d1d8dd; margin-left: -30px; padding: 5px 15px; - color: #999; + color: #8d99a6; font-size: 85%; } .sidebar-item:first-child { @@ -221,19 +230,7 @@ fieldset { padding-bottom: 10px; } .sidebar-item a { - color: #999; - text-decoration: none; -} -.sidebar-item a:hover, -.sidebar-item a:focus, -.sidebar-item a:active { - color: #333; - text-decoration: none; - /* thanks medium: https://medium.com/designing-medium/crafting-link-underlines-on-medium-7c03a9274f9 */ - background-image: linear-gradient(to bottom, transparent 50%, rgba(153, 153, 153, 0.5) 50%); - background-repeat: repeat-x; - background-size: 5% 20%; - background-position: 0 100%; + color: #8d99a6; } .sidebar-item a.active { color: #000; @@ -364,7 +361,6 @@ a.active { } .page-breadcrumbs .breadcrumb { padding: 0px; - margin-bottom: 2px; background-color: transparent; border-radius: 0px; font-size: 85%; @@ -372,6 +368,9 @@ a.active { .breadcrumb a { color: inherit; } +.breadcrumb > .active { + color: #8d99a6; +} @media (min-width: 768px) { .page-sidebar { padding-left: 3em; @@ -399,7 +398,6 @@ a.active { padding-left: 30px; } a.grey, -.sidebar-section a, .nav-pills a, .control-value a, .data-row a { @@ -408,7 +406,6 @@ a.grey, margin-bottom: 0.4em; } a.grey:hover, -.sidebar-section a:hover, .nav-pills a:hover, .control-value a:hover, .data-row a:hover { diff --git a/frappe/public/less/desk.less b/frappe/public/less/desk.less index 0b5d59e4fb..3809b1c5d2 100644 --- a/frappe/public/less/desk.less +++ b/frappe/public/less/desk.less @@ -21,6 +21,10 @@ body { cursor: pointer; } +a, a:hover, a:active, a:focus { + outline: 0; +} + // transition a, .badge, diff --git a/frappe/public/less/website.less b/frappe/public/less/website.less index f5270460a8..acd97376ce 100644 --- a/frappe/public/less/website.less +++ b/frappe/public/less/website.less @@ -13,6 +13,9 @@ a { cursor: pointer; } +a, a:hover, a:active, a:focus { + outline: 0; +} img { max-width: 100%; @@ -232,7 +235,7 @@ fieldset { } .page-container { - + padding: 0px; } .page-header h1, @@ -251,10 +254,10 @@ fieldset { .sidebar-item { /*background-color: #f7f7f7;*/ - border-left: 1px solid #eee; + border-left: 1px solid @border-color; margin-left: -30px; padding: 5px 15px; - color: #999; + color: @text-muted; font-size: 85%; } @@ -266,21 +269,7 @@ fieldset { } .sidebar-item a { - color: #999; - text-decoration: none; -} - -.sidebar-item a:hover, -.sidebar-item a:focus, -.sidebar-item a:active { - color: #333; - text-decoration: none; - - /* thanks medium: https://medium.com/designing-medium/crafting-link-underlines-on-medium-7c03a9274f9 */ - background-image: linear-gradient(to bottom, transparent 50%, rgba(153,153,153, 0.5) 50%); - background-repeat: repeat-x; - background-size: 5% 20%; - background-position: 0 100%; + color: @text-muted; } .sidebar-item a.active { @@ -441,7 +430,6 @@ a.active { .page-breadcrumbs .breadcrumb { padding: 0px; - margin-bottom: 2px; background-color: transparent; border-radius: 0px; font-size: 85%; @@ -451,6 +439,10 @@ a.active { color: inherit; } +.breadcrumb > .active { + color: @text-muted; +} + @media (min-width: 768px) { .page-sidebar { padding-left: 3em; @@ -486,13 +478,13 @@ a.active { // links and text -a.grey, .sidebar-section a, .nav-pills a, .control-value a, .data-row a { +a.grey, .nav-pills a, .control-value a, .data-row a { color: inherit; border-bottom: 1px solid transparent; margin-bottom: 0.4em; } -a.grey:hover, .sidebar-section a:hover, .nav-pills a:hover, .control-value a:hover, .data-row a:hover { +a.grey:hover, .nav-pills a:hover, .control-value a:hover, .data-row a:hover { border-bottom: 1px solid @grey-link-color; color: @grey-link-color; } diff --git a/frappe/templates/generators/web_page.html b/frappe/templates/generators/web_page.html index 2311ca6872..7775e64af6 100644 --- a/frappe/templates/generators/web_page.html +++ b/frappe/templates/generators/web_page.html @@ -1,9 +1,3 @@ -{% block title %}{{ title }}{% endblock %} - -{% block header %} -{{ header }} -{% endblock %} - {% block content %}
{% include "templates/includes/slideshow.html" %} diff --git a/frappe/utils/boilerplate.py b/frappe/utils/boilerplate.py index 8756616f9c..e328ebb33e 100644 --- a/frappe/utils/boilerplate.py +++ b/frappe/utils/boilerplate.py @@ -6,25 +6,29 @@ from __future__ import unicode_literals import frappe, os from frappe.utils import touch_file -def make_boilerplate(dest): +def make_boilerplate(dest, app_name): if not os.path.exists(dest): print "Destination directory does not exist" return hooks = frappe._dict() - for key in ("App Name", "App Title", "App Description", "App Publisher", - "App Icon", "App Color", "App Email", "App URL", "App License"): - hook_key = key.lower().replace(" ", "_") + hooks.app_name = app_name + app_title = hooks.app_name.replace("_", " ").title() + for key in ("App Title (defaut: {0})".format(app_title), "App Description", "App Publisher", + "App Icon (e.g. 'octicon octicon-zap')", "App Color", "App Email", "App License"): + hook_key = key.split(" (")[0].lower().replace(" ", "_") hook_val = None while not hook_val: hook_val = raw_input(key + ": ") if hook_key=="app_name" and hook_val.lower().replace(" ", "_") != hook_val: print "App Name must be all lowercase and without spaces" hook_val = "" + elif hook_key=="app_title" and not hook_val: + hook_val = app_title hooks[hook_key] = hook_val - frappe.create_folder(os.path.join(dest, hooks.app_name, hooks.app_name, frappe.scrub(hooks.app_title)), + frappe.create_folder(os.path.join(dest, hooks.app_name, hooks.app_name, hooks.app_title), with_init=True) frappe.create_folder(os.path.join(dest, hooks.app_name, hooks.app_name, "templates"), with_init=True) frappe.create_folder(os.path.join(dest, hooks.app_name, hooks.app_name, "www")) @@ -93,7 +97,6 @@ app_description = "{app_description}" app_icon = "{app_icon}" app_color = "{app_color}" app_email = "{app_email}" -app_url = "{app_url}" app_version = "0.0.1" # Includes in diff --git a/frappe/website/doctype/web_page/web_page.py b/frappe/website/doctype/web_page/web_page.py index 5f23819d8e..4160fe5c7b 100644 --- a/frappe/website/doctype/web_page/web_page.py +++ b/frappe/website/doctype/web_page/web_page.py @@ -49,8 +49,8 @@ class WebPage(WebsiteGenerator): self.set_metatags(context) - if not context.header: - context.header = self.title + # if not context.header: + # context.header = self.title # for sidebar if not context.children: diff --git a/frappe/website/js/website.js b/frappe/website/js/website.js index d33190a247..038c83277d 100644 --- a/frappe/website/js/website.js +++ b/frappe/website/js/website.js @@ -199,7 +199,7 @@ $.extend(frappe, { if(frappe.supports_pjax()) { // hack for chrome's onload popstate call window.initial_href = window.location.href - $(document).on("click", "#wrap a", frappe.handle_click); + $(document).on("click", "a", frappe.handle_click); $(window).on("popstate", function(event) { // don't run this on hash change diff --git a/frappe/website/template.py b/frappe/website/template.py index 67cf5ff389..408a58c5ab 100644 --- a/frappe/website/template.py +++ b/frappe/website/template.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import strip_html +from frappe import _ from frappe.website.utils import scrub_relative_urls from jinja2.utils import concat from jinja2 import meta @@ -36,11 +37,13 @@ def render_blocks(context): if "title" not in out: out["title"] = context.get("title") - if "header" not in out and out.get("title"): - out["header"] = out["title"] + + if not out.get("header") and "" + out["header"] = "

" + out["header"] + "

" if "breadcrumbs" not in out: if context.doc and hasattr(context.doc, "get_parents"): @@ -64,15 +67,14 @@ def render_blocks(context): if "{index}" in out.get("content", "") and context.get("children"): html = frappe.get_template("templates/includes/static_index.html").render({ "items": context["children"]}) + out["content"] = out["content"].replace("{index}", html) if "{next}" in out.get("content", ""): next_item = context.doc.get_next() if next_item: if next_item.name[0]!="/": next_item.name = "/" + next_item.name - html = '''


- {title} -

'''.format(**next_item) + html = '


'+_("Next")+': {title}

'.format(**next_item) out["content"] = out["content"].replace("{next}", html) if "sidebar" not in out and not out.get("no_sidebar"): diff --git a/frappe/website/website_generator.py b/frappe/website/website_generator.py index f20f892609..90ad6512d6 100644 --- a/frappe/website/website_generator.py +++ b/frappe/website/website_generator.py @@ -183,20 +183,19 @@ class WebsiteGenerator(Document): return self.get(self.parent_website_route_field) def get_children(self, context=None): + children = [] if self.get_route()==get_home_page(): - return frappe.db.sql("""select url as name, label as page_title, + children = frappe.db.sql("""select url as name, label as page_title, 1 as public_read from `tabTop Bar Item` where parentfield='sidebar_items' order by idx""", as_dict=True) - if self.meta.get_field("parent_website_route"): + if not children and self.meta.get_field("parent_website_route"): children = self.get_children_of(self.get_route()) if not children and self.parent_website_route: children = self.get_children_of(self.parent_website_route) - return children - else: - return [] + return children def get_children_of(self, route): children = frappe.db.sql("""select name, page_name,