You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2014/12/10 12:53:42 UTC
[1/3] allura git commit: [#7802] make it possible for a child theme
to re-use all the resources from the parent
Repository: allura
Updated Branches:
refs/heads/master 5407aa963 -> f2e4241ea
[#7802] make it possible for a child theme to re-use all the resources from the parent
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/f2e4241e
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/f2e4241e
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/f2e4241e
Branch: refs/heads/master
Commit: f2e4241ea10884dab86b28c56d3f81cfe59011b4
Parents: ffd5a36
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Dec 8 23:15:45 2014 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Dec 10 13:51:35 2014 +0200
----------------------------------------------------------------------
Allura/allura/lib/app_globals.py | 4 +---
Allura/allura/lib/plugin.py | 13 +++++++++++++
2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/f2e4241e/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 8435f0f..d196cc8 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -539,9 +539,7 @@ class Globals(object):
self.resource_manager.register(ew.JSScript(text, **kw))
def theme_href(self, href):
- theme_name = config.get('theme', 'allura')
- return self.resource_manager.absurl(
- 'theme/%s/%s' % (theme_name, href))
+ return self.theme.href(href)
def forge_static(self, resource):
base = config['static.url_base']
http://git-wip-us.apache.org/repos/asf/allura/blob/f2e4241e/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 006a8e0..e761ef3 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -963,6 +963,8 @@ class ThemeProvider(object):
own jinja templates. Use the standard templates as a reference, you should
provide matching macros and block names.
+ For more information, see https://forge-allura.apache.org/p/allura/wiki/Themes%20in%20Allura/
+
:var icons: a dictionary of sized icons for each tool
'''
@@ -991,6 +993,17 @@ class ThemeProvider(object):
'allura',
os.path.join('nf', name)))
+ def href(self, href, theme_name=None):
+ '''
+ Build a full URL for a given resource path
+ :param href: a path like ``css/site_style.css``
+ :param theme_name: defaults to current theme
+ :return: a full URL
+ '''
+ if theme_name is None:
+ theme_name = config.get('theme', 'allura')
+ return g.resource_manager.absurl('theme/%s/%s' % (theme_name, href))
+
@LazyProperty
def personal_data_form(self):
'''
[2/3] allura git commit: [#7802] make it easier for a custom theme to
extend macros
Posted by je...@apache.org.
[#7802] make it easier for a custom theme to extend macros
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/ffd5a363
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/ffd5a363
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/ffd5a363
Branch: refs/heads/master
Commit: ffd5a363dbec70b5d3f74e366e172971751dd8be
Parents: 2c41b00
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Dec 8 22:55:06 2014 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Dec 10 13:51:35 2014 +0200
----------------------------------------------------------------------
.../templates/jinja_master/theme_macros.html | 25 ++++++++++++++++++++
1 file changed, 25 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/ffd5a363/Allura/allura/templates/jinja_master/theme_macros.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/theme_macros.html b/Allura/allura/templates/jinja_master/theme_macros.html
index 4693b9a..fd3f6fb 100644
--- a/Allura/allura/templates/jinja_master/theme_macros.html
+++ b/Allura/allura/templates/jinja_master/theme_macros.html
@@ -16,6 +16,14 @@
specific language governing permissions and limitations
under the License.
-#}
+
+{#
+Each macro is wrapped with an 'if' clause so that a custom theme may extend this file and override individual macros
+http://stackoverflow.com/questions/26582731/redefining-imported-jinja-macros
+#}
+
+
+{% if not header %}
{%- macro header(login_url, logout_url) %}
<header id="site-header">
<div class="wrapper">
@@ -34,7 +42,9 @@
</div>
</header>
{%- endmacro %}
+{% endif %}
+{% if not footer %}
{%- macro footer(year, path_to_static='') %}
<footer id="site-footer">
<nav>
@@ -42,11 +52,15 @@
</nav>
</footer>
{%- endmacro %}
+{% endif %}
+{% if not custom_js %}
{%- macro custom_js(path_to_static) %}
{%- endmacro %}
+{% endif %}
+{% if not custom_tracking_js %}
{%- macro custom_tracking_js(accounts, user, project) %}
{# This should be overridden in your custom theme (e.g., sftheme) to implement custom tracking code. #}
var _gaq = _gaq || [];
@@ -76,11 +90,15 @@
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
{%- endmacro %}
+{% endif %}
+{% if not extra_header %}
{%- macro extra_header(path_to_static) %}
{%- endmacro %}
+{% endif %}
+{% if not breadcrumbs %}
{%- macro breadcrumbs(project, app) %}
<nav id="breadcrumbs">
<ul>
@@ -98,7 +116,9 @@
</ul>
</nav>
{%- endmacro %}
+{% endif %}
+{% if not project_header_right %}
{%- macro project_header_right(project, app) %}
{% if project.neighborhood.icon %}
<a href="{{project.neighborhood.url()}}"><img src="{{project.neighborhood.url()}}/icon" class="neighborhood_icon"
@@ -115,7 +135,9 @@
</div>
{% endif %}
{%- endmacro %}
+{% endif %}
+{% if not login_overlay %}
{%- macro login_overlay() %}
{% do g.register_js('js/jquery.lightbox_me.js') %}
{% do g.register_js('js/login_overlay.js') %}
@@ -124,7 +146,9 @@
<iframe src="{{g.login_fragment_url}}"></iframe>
</div>
{%- endmacro %}
+{% endif %}
+{% if not site_notification %}
{%- macro site_notification() %}
{% set note = g.theme.get_site_notification() %}
{% if note %}
@@ -136,3 +160,4 @@
</div>
{% endif %}
{%- endmacro %}
+{% endif %}
[3/3] allura git commit: [#7802] remove ASF copyright from site
footer; add TM; add underline since footer links are same color as text
Posted by je...@apache.org.
[#7802] remove ASF copyright from site footer; add TM; add underline since footer links are same color as text
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/2c41b009
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/2c41b009
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/2c41b009
Branch: refs/heads/master
Commit: 2c41b009665bc9d2de2f34624c1e42b7301c8d4f
Parents: 5407aa9
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Dec 5 21:48:15 2014 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Dec 10 13:51:35 2014 +0200
----------------------------------------------------------------------
Allura/allura/nf/allura/css/site_style.css | 1 +
Allura/allura/templates/jinja_master/theme_macros.html | 7 +------
2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/2c41b009/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 93692f6..4c62314 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -431,6 +431,7 @@ blockquote {
#site-header a, #site-footer a {
color: #555555;
margin-left: 1em;
+ text-decoration: underline;
}
#site-header a:visited, #site-footer a:visited {
color: #555555;
http://git-wip-us.apache.org/repos/asf/allura/blob/2c41b009/Allura/allura/templates/jinja_master/theme_macros.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/theme_macros.html b/Allura/allura/templates/jinja_master/theme_macros.html
index b828718..4693b9a 100644
--- a/Allura/allura/templates/jinja_master/theme_macros.html
+++ b/Allura/allura/templates/jinja_master/theme_macros.html
@@ -38,12 +38,7 @@
{%- macro footer(year, path_to_static='') %}
<footer id="site-footer">
<nav>
- <p>This project is powered by <a href="https://allura.apache.org/">Apache Allura</a>.</p>
- <p>
- Copyright © 2014 The Apache Software Foundation, Licensed under the
- <a style="color: #069;" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br/>
- Apache, Allura, Apache Allura, and the Apache feather logo are trademarks of The Apache Software Foundation.
- </p>
+ <p>This project is powered by <a href="https://allura.apache.org/">Apache Allura</a>™.</p>
</nav>
</footer>
{%- endmacro %}