|
a |
|
b/opensourceprojects/templates/jinja_master/theme_macros.html |
|
|
1 |
{%- macro header(login_url, logout_url) %}
|
|
|
2 |
<header id="site-header">
|
|
|
3 |
<div class="wrapper">
|
|
|
4 |
<a id="header-logo" title="opensourceprojects.eu logo" href="/"><img src="{{g.theme_href('images/logo.png')}}"/></a>
|
|
|
5 |
<nav>
|
|
|
6 |
<div class="opacity50"></div>
|
|
|
7 |
<div class="top_menu">
|
|
|
8 |
<a href="/p/">Projects</a>
|
|
|
9 |
{% if c.user._id %}
|
|
|
10 |
<a href="/auth/prefs/">Settings</a>
|
|
|
11 |
<a href="{{c.user.url()}}">Profile</a>
|
|
|
12 |
<a href="{{logout_url}}">Log Out</a>
|
|
|
13 |
{% else %}
|
|
|
14 |
<a href="/auth/create_account">Register</a>
|
|
|
15 |
<a href="{{login_url}}">Log In</a>
|
|
|
16 |
{% endif %}
|
|
|
17 |
</div>
|
|
|
18 |
</nav>
|
|
|
19 |
</div>
|
|
|
20 |
</header>
|
|
|
21 |
{%- endmacro %}
|
|
|
22 |
|
|
|
23 |
{%- macro footer(year, path_to_static='') %}
|
|
|
24 |
<footer id="site-footer">
|
|
|
25 |
<nav>
|
|
|
26 |
This project is powered by <a href="http://sourceforge.net/p/allura/">Allura</a>.
|
|
|
27 |
</nav>
|
|
|
28 |
</footer>
|
|
|
29 |
{%- endmacro %}
|
|
|
30 |
|
|
|
31 |
{%- macro custom_js(path_to_static) %}
|
|
|
32 |
|
|
|
33 |
{%- endmacro %}
|
|
|
34 |
|
|
|
35 |
{%- macro custom_tracking_js(accounts, user, project) %}
|
|
|
36 |
{# This should be overridden in your custom theme (e.g., sftheme) to implement custom tracking code. #}
|
|
|
37 |
var _gaq = _gaq || [];
|
|
|
38 |
|
|
|
39 |
function _add_tracking(prefix, tracking_id) {
|
|
|
40 |
_gaq.push(
|
|
|
41 |
[prefix+'._setAccount', tracking_id],
|
|
|
42 |
[prefix+'._trackPageview'],
|
|
|
43 |
);
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
{%- for account in accounts %}
|
|
|
47 |
_add_tracking('sfnt{{ loop.index }}', '{{account}}');
|
|
|
48 |
{%- endfor %}
|
|
|
49 |
{% if project and project.neighborhood.features['google_analytics'] -%}
|
|
|
50 |
{% if project.neighborhood.tracking_id -%}
|
|
|
51 |
_add_tracking('nbhd', '{{project.neighborhood.tracking_id}}');
|
|
|
52 |
{%- endif %}
|
|
|
53 |
{% if project.tracking_id -%}
|
|
|
54 |
_add_tracking('proj', '{{project.tracking_id}}');
|
|
|
55 |
{%- endif %}
|
|
|
56 |
{%- endif %}
|
|
|
57 |
|
|
|
58 |
(function() {
|
|
|
59 |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
|
60 |
ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
|
61 |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
|
62 |
})();
|
|
|
63 |
{%- endmacro %}
|
|
|
64 |
|
|
|
65 |
{%- macro extra_header(path_to_static) %}
|
|
|
66 |
|
|
|
67 |
{%- endmacro %}
|