{{ group.group_title }}
+{% block content %} {%- if group.group_description -%}{{ group.group_description }}
{%- endif -%} -{% endblock %} -{% block breadcrumbs %}{% include "templates/includes/breadcrumbs.html" %}{% endblock %} - -{% block content %}-
{%- for t in views -%}
{% set url = (pathname if t.default else "{}?view={}".format(pathname, t.name)) %}
@@ -39,5 +34,3 @@
{% endblock %}
-
-{% block sidebar %}{% include "templates/includes/sidebar.html" %}{% endblock %}
\ No newline at end of file
diff --git a/webnotes/templates/includes/breadcrumbs.html b/webnotes/templates/includes/breadcrumbs.html
index aa7fc5f773..c7eb541ac4 100644
--- a/webnotes/templates/includes/breadcrumbs.html
+++ b/webnotes/templates/includes/breadcrumbs.html
@@ -1,6 +1,6 @@
- {{ parent.page_title or parent.title }} +
- {{ parent.page_title or parent.title or "" }} {% endfor %} -
- {{ title }} +
- {{ title or "" }}
-
{% for parent in parents or [] %}
-
About Us
{% endblock %} - {% block content %}
{{ obj.doc.company_introduction or """
Some Introduction about your company that you would diff --git a/webnotes/templates/pages/blog.html b/webnotes/templates/pages/blog.html index b4ff098db7..c1a9d97590 100644 --- a/webnotes/templates/pages/blog.html +++ b/webnotes/templates/pages/blog.html @@ -1,7 +1,5 @@ {% block title %}{{ blog_title or "Blog" }}{% endblock %} -{% block header %}
{{ blog_title or "Blog" }}
{% endblock %} - {% block content %}
{% if blog_introduction %}
@@ -26,5 +24,3 @@
{% endblock %}
{% block footer %}{% include 'templates/includes/blog_footer.html' %}{% endblock %}
-
-{% block sidebar %}{% include "templates/includes/sidebar.html" %}{% endblock %}
\ No newline at end of file
diff --git a/webnotes/templates/pages/contact.html b/webnotes/templates/pages/contact.html
index f145caa6ef..970621b790 100644
--- a/webnotes/templates/pages/contact.html
+++ b/webnotes/templates/pages/contact.html
@@ -1,7 +1,5 @@
{% block title %}{{ heading or "Contact Us"}}{% endblock %}
-{% block header %}
{{ heading or "Contact Us"}}
{% endblock %} - {% block content %}
diff --git a/webnotes/templates/pages/login.html b/webnotes/templates/pages/login.html
index 51b0b0bd0b..fc32603f27 100644
--- a/webnotes/templates/pages/login.html
+++ b/webnotes/templates/pages/login.html
@@ -1,5 +1,3 @@
-{% block title %} Login {% endblock %}
-
{% block content %}
@@ -48,4 +46,6 @@
-{% endblock %}
\ No newline at end of file
+{% endblock %}
+
+{% block sidebar %}{% endblock %}
\ No newline at end of file
diff --git a/webnotes/templates/pages/login.py b/webnotes/templates/pages/login.py
index aa568bc763..6a37ed7182 100644
--- a/webnotes/templates/pages/login.py
+++ b/webnotes/templates/pages/login.py
@@ -7,4 +7,4 @@ import webnotes
def get_context(context):
# get settings from site config
if webnotes.conf.get("fb_app_id"):
- return { "fb_app_id": webnotes.conf.fb_app_id }
+ return { "fb_app_id": webnotes.conf.fb_app_id, "title": "Login" }
diff --git a/webnotes/templates/pages/message.html b/webnotes/templates/pages/message.html
index 536078b221..90b6fb794b 100644
--- a/webnotes/templates/pages/message.html
+++ b/webnotes/templates/pages/message.html
@@ -1,6 +1,6 @@
{% block title %}{{ title }}{% endblock %}
-{% block header %}
{{ title }}
{% endblock %} +{% block header %}{{ title }}{% endblock %} {% block content %}
diff --git a/webnotes/templates/pages/website_script.js b/webnotes/templates/pages/website_script.js
index 5e382c3332..63a4634248 100644
--- a/webnotes/templates/pages/website_script.js
+++ b/webnotes/templates/pages/website_script.js
@@ -1,14 +1,13 @@
{% if javascript -%}{{ javascript }}{%- endif %}
{% if google_analytics_id -%}
-// Google Analytics template
-window._gaq = window._gaq || [];
-window._gaq.push(['_setAccount', '{{ google_analytics_id }}']);
-window._gaq.push(['_trackPageview']);
+
+(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-(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);
-})();
+ga('create', '{{ google_analytics_id }}', 'auto');
+ga('send', 'pageview');
+
{%- endif %}
\ No newline at end of file
diff --git a/webnotes/templates/pages/website_script.py b/webnotes/templates/pages/website_script.py
index 0b809c2f82..3a2926d942 100644
--- a/webnotes/templates/pages/website_script.py
+++ b/webnotes/templates/pages/website_script.py
@@ -8,7 +8,10 @@ no_sitemap = 1
base_template_path = "templates/pages/website_script.js"
def get_context(context):
- return {
- "javascript": webnotes.conn.get_value('Website Script', None, 'javascript'),
- "google_analytics_id": webnotes.conn.get_value("Website Settings", "Website Settings", "google_analytics_id")
- }
\ No newline at end of file
+ script_context = { "javascript": webnotes.conn.get_value('Website Script', None, 'javascript') }
+
+ if not webnotes.conf.developer_mode:
+ script_context["google_analytics_id"] = webnotes.conn.get_value("Website Settings", "Website Settings",
+ "google_analytics_id")
+
+ return script_context
diff --git a/webnotes/templates/pages/writers.html b/webnotes/templates/pages/writers.html
index 23ac00b879..9843d99294 100644
--- a/webnotes/templates/pages/writers.html
+++ b/webnotes/templates/pages/writers.html
@@ -1,7 +1,5 @@
{% block title %} Blog Writers {% endblock %}
-{% block header %}
Blog Writers
{% endblock %} - {% block content %}
{% if writers_introduction %}
@@ -15,5 +13,3 @@
{% endblock %}
{% block footer %}{% include "templates/includes/blog_footer.html" %}{% endblock %}
-
-{% block sidebar %}{% include "templates/includes/sidebar.html" %}{% endblock %}
\ No newline at end of file
diff --git a/webnotes/templates/website_group/forum.html b/webnotes/templates/website_group/forum.html
index 7f843bf4a0..1f17020a51 100644
--- a/webnotes/templates/website_group/forum.html
+++ b/webnotes/templates/website_group/forum.html
@@ -1,6 +1,6 @@
-{{ post_list_html }}
+{{ post_list_html }}
diff --git a/webnotes/utils/verified_command.py b/webnotes/utils/verified_command.py
index 600bc5e591..9c43aa2ac7 100644
--- a/webnotes/utils/verified_command.py
+++ b/webnotes/utils/verified_command.py
@@ -14,7 +14,7 @@ def get_url(params, nonce, secret=None):
return ''.join([webnotes.local.request.url_root, '?', urllib.urlencode(params)])
def get_signature(params, nonce, secret=None):
- params = "".join((cstr(p) for p in params))
+ params = "".join((cstr(p) for p in params.values()))
if not secret:
secret = webnotes.local.conf.get("secret") or "secret"
diff --git a/webnotes/website/css/website.css b/webnotes/website/css/website.css
index a67e5fa0e3..8ee7ca3093 100644
--- a/webnotes/website/css/website.css
+++ b/webnotes/website/css/website.css
@@ -391,7 +391,7 @@ a.no-decoration {
a.active {
pointer-events: none;
cursor: default;
- color: initial;
+ border-bottom: inherit;
}
.page-breadcrumbs .breadcrumb {
diff --git a/webnotes/website/js/website.js b/webnotes/website/js/website.js
index a61acf34d8..5feec878de 100644
--- a/webnotes/website/js/website.js
+++ b/webnotes/website/js/website.js
@@ -248,11 +248,14 @@ $.extend(wn, {
window.previous_href = href;
history.pushState(null, null, href);
+ NProgress.start();
$.ajax({ url: href, cache: false }).done(function(data) {
history.replaceState(data, data.title, href);
$("html, body").animate({ scrollTop: 0 }, "slow");
wn.render_json(data);
- })
+ }).always(function() {
+ NProgress.done();
+ });
},
render_json: function(data) {
if(data.reload) {
@@ -270,6 +273,7 @@ $.extend(wn, {
}
});
if(data.title) $("title").html(data.title);
+ window.ga && ga('send', 'pageview', location.pathname);
$(document).trigger("page_change");
}
},
@@ -429,6 +433,10 @@ $(document).on("page_change", function() {
$(".page-footer").toggleClass("hidden", !!!$(".page-footer").text().trim());
$("[data-html-block='breadcrumbs'] .breadcrumb").toggleClass("hidden",
$("[data-html-block='breadcrumbs']").text().trim()==$("[data-html-block='header']").text().trim());
+
+ if(!$(".page-sidebar").hasClass("hidden-xs")) {
+ $(".toggle-sidebar").trigger("click");
+ }
// add prive pages to sidebar
if(website.private_pages && $(".page-sidebar").length) {
diff --git a/webnotes/website/js/website_group.js b/webnotes/website/js/website_group.js
index 1f0de63555..c5eae61b65 100644
--- a/webnotes/website/js/website_group.js
+++ b/webnotes/website/js/website_group.js
@@ -9,9 +9,18 @@ $.extend(website, {
$('li[data-view="add"]').toggleClass("hide", !website.access.write);
$('li[data-view="settings"]').toggleClass("hide", !website.access.admin);
$('li[data-view="edit"]').toggleClass("hide", website.view!=="edit");
-
+
// show message
- $(".post-list-help").html(!website.access.write ? "You do not have permission to post" : "");
+ if(!website.access.write) {
+ var sid = wn.get_cookie("sid");
+ if(!sid || sid==="Guest") {
+ $(".post-list-help").html("Please login to post");
+ } else {
+ $(".post-list-help").html("You do not have permission to post");
+ }
+ } else {
+ $(".post-list-help").html("");
+ }
}
},
setup_pagination: function() {
diff --git a/webnotes/webutils.py b/webnotes/webutils.py
index ee9a6b7c11..110f8f33a5 100644
--- a/webnotes/webutils.py
+++ b/webnotes/webutils.py
@@ -471,6 +471,21 @@ def render_blocks(context):
_render_blocks(context["template_path"])
+ # default blocks if not found
+ if "title" not in out:
+ out["title"] = context.get("title")
+
+ if "header" not in out:
+ out["header"] = out["title"]
+
+ if "breadcrumbs" not in out:
+ out["breadcrumbs"] = scrub_relative_urls(
+ webnotes.get_template("templates/includes/breadcrumbs.html").render(context))
+
+ if "sidebar" not in out:
+ out["sidebar"] = scrub_relative_urls(
+ webnotes.get_template("templates/includes/sidebar.html").render(context))
+
return out
def scrub_relative_urls(html):
diff --git a/webnotes/widgets/query_report.py b/webnotes/widgets/query_report.py
index bba8569c8a..599535e6ac 100644
--- a/webnotes/widgets/query_report.py
+++ b/webnotes/widgets/query_report.py
@@ -75,7 +75,7 @@ def run(report_name, filters=()):
if report.is_standard=="Yes":
method_name = webnotes.local.module_app[scrub(module)] + "." + scrub(module) \
+ ".report." + scrub(report.name) + "." + scrub(report.name) + ".execute"
- columns, result = webnotes.get_attr(method_name)(filters or {})
+ columns, result = webnotes.get_attr(method_name)(webnotes._dict(filters))
result = get_filtered_data(report.ref_doctype, columns, result)