blob: c93d4083d85bb20c1e74691ba74252262b3c84d2 [file] [log] [blame]
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{%- macro header(login_url, logout_url) %}
<header id="site-header">
<div class="wrapper">
<nav>
{% if c.user._id %}
<a href="/auth/preferences/">Account</a>
<a href="{{c.user.url()}}">{{name}}</a>
<a href="{{logout_url}}">Log Out</a>
{% else %}
<a href="/auth/create_account">Register</a>
<a href="{{login_url}}">Log In</a>
{% endif %}
</nav>
</div>
</header>
{%- endmacro %}
{%- macro footer(year, path_to_static='') %}
<footer id="site-footer">
<nav>
This project is powered by <a href="https://forge-allura.apache.org/p/allura/">Allura</a>.
</nav>
</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],
[prefix+'._trackPageview']
);
}
{%- for account in accounts %}
_add_tracking('sfnt{{ loop.index }}', '{{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 %}
{%- macro breadcrumbs(project, app) %}
<nav id="breadcrumbs">
<ul>
<li><a href="/">Home</a></li>
{% for label,url in project.breadcrumbs() %}
{% if not loop.last or app %}
<li><a href="{{ url }}">{{ label }}</a></li>
{% else %}
<li>{{ label }}</li>
{% endif %}
{% endfor %}
{% if app %}
<li>{{ app.config.options.mount_label }}</li>
{% endif %}
</ul>
</nav>
{%- endmacro %}
{%- macro project_header_right(project, app) %}
{% if project.neighborhood.icon %}
<a href="{{project.neighborhood.url()}}"><img src="{{project.neighborhood.url()}}/icon" class="neighborhood_icon"
alt="Return to {{project.neighborhood.name}}" title="Return to {{project.neighborhood.name}}"></a>
<div class="neighborhood_title">
<h1><a href="{{project.neighborhood.url()}}">{{project.neighborhood.name}}</a></h1>
{% if project.neighborhood.project_list_url %}
<div class="neighborhood_title_link">
<a href="{{project.neighborhood.project_list_url}}">
View More Projects
</a>
</div>
{% endif %}
</div>
{% endif %}
{%- endmacro %}
{%- macro login_overlay() %}
{% do g.register_js('js/jquery.lightbox_me.js') %}
{% do g.register_js('js/login_overlay.js') %}
<div id="login_overlay" class="ui-widget-content">
<h2 class="dark title">Login Required</h2>
<iframe src="{{g.login_fragment_url}}"></iframe>
</div>
{%- endmacro %}
{%- macro site_notification() %}
{% set note = g.theme.get_site_notification() %}
{% if note %}
<div id="site-notification">
<section class="site-message info" data-notification-id="{{note._id}}">
{{note.content|safe}}
<a href="" class="btn btn-close">Close</a>
</section>
</div>
{% endif %}
{%- endmacro %}