Parent: [accc11] (diff)

Child: [44233e] (diff)

Download this file

theme_macros.html    65 lines (55 with data), 2.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{%- macro header(login_url, logout_url) %}
<header id="site-header">
<div class="wrapper">
<a id="header-logo" title="opensourceprojects.eu logo" href="/"><img src="{{g.theme_href('images/logo.png')}}"/></a>
<nav>
<div class="top_menu">
<a href="/p/">Projects</a>
{% if c.user._id %}
<a href="/auth/prefs/">Settings</a>
<a href="{{c.user.url()}}">Profile</a>
<a href="{{logout_url}}">Log Out</a>
{% else %}
<a href="/auth/create_account">Register</a>
<a href="{{login_url}}">Log In</a>
{% endif %}
</div>
</nav>
</div>
</header>
{%- endmacro %}
{%- macro footer(year, path_to_static='') %}
<footer id="site-footer">
<a href="/about">About</a>
<a href="/p/osp/tickets/">Report a bug</a>
</footer>
{%- endmacro %}
{%- macro custom_js(path_to_static) %}
{%- endmacro %}
{%- 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 || [];
function _add_tracking(prefix, tracking_id) {
_gaq.push([prefix+'._setAccount', tracking_id]);
_gaq.push([prefix+'_setDomainName', 'opensourceprojects.eu']);
_gaq.push([prefix+'._trackPageview']);
}
{%- for account in accounts %}
_add_tracking('', '{{account}}');
{%- endfor %}
{% if project and project.neighborhood.features['google_analytics'] -%}
{% if project.neighborhood.tracking_id -%}
_add_tracking('nbhd', '{{project.neighborhood.tracking_id}}');
{%- endif %}
{% if project.tracking_id -%}
_add_tracking('proj', '{{project.tracking_id}}');
{%- endif %}
{%- endif %}
(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);
})();
{%- endmacro %}
{%- macro extra_header(path_to_static) %}
{%- endmacro %}