{{ group.group_title }}
{% endblock %} -{% block header %} -{{ 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 [] %}
-
{{ 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/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/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/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 4962bdeb59..7cf0d0b9c1 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) {
@@ -263,6 +266,7 @@ $.extend(wn, {
$section.html(data[$section.attr("data-html-block")] || "");
});
if(data.title) $("title").html(data.title);
+ window.ga && ga('send', 'pageview', location.pathname);
$(document).trigger("page_change");
}
},
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 919c79b1c4..996d6f8e2d 100644
--- a/webnotes/webutils.py
+++ b/webnotes/webutils.py
@@ -460,6 +460,21 @@ def render_blocks(context):
# render each block individually
for block, render in template.blocks.items():
out[block] = scrub_relative_urls(concat(render(context)))
+
+ # default blocks if not found
+ if "title" not in out:
+ out["title"] = context.get("title")
+
+ if "header" not in out:
+ out["header"] = """