## -*- coding: utf-8 -*- <%def name="get_template_context()" filter="n, trim">{ ## repo data repo_name: "${getattr(c, 'repo_name', '')}", % if hasattr(c, 'rhodecode_db_repo'): repo_type: "${c.rhodecode_db_repo.repo_type}", repo_landing_commit: "${c.rhodecode_db_repo.landing_rev[1]}", % else: repo_type: null, repo_landing_commit: null, % endif ## user data % if getattr(c, 'rhodecode_user', None) and c.rhodecode_user.user_id: rhodecode_user: { username: "${c.rhodecode_user.username}", email: "${c.rhodecode_user.email}", }, % else: rhodecode_user: { username: null, email: null, }, % endif ## visual settings visual: { default_renderer: "${h.get_visual_attr(c, 'default_renderer')}" }, ## current commit context, filled inside templates that expose that commit_data: { commit_id: null, }, ## current pr context, filled inside templates that expose that pull_request_data: { pull_request_id: null, }, ## timeago settings, can be overwritten by custom user settings later timeago: { refresh_time: ${120 * 1000}, cutoff_limit: ${1000*60*60*24*7} } } ${self.title()} <%def name="robots()"> ${self.robots()} ## CSS definitions <%def name="css()"> ## EXTRA FOR CSS ${self.css_extra()} ## CSS EXTRA - optionally inject some extra CSS stuff needed for specific websites <%def name="css_extra()"> ${self.css()} ## JAVASCRIPT <%def name="js()"> ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates ${self.js_extra()} ## JAVASCRIPT EXTRA - optionally inject some extra JS for specificed templates <%def name="js_extra()"> ${self.js()} <%def name="head_extra()"> ${self.head_extra()} ## extra stuff %if c.pre_code: ${c.pre_code|n} %endif ## IE hacks ${next.body()} %if c.post_code: ${c.post_code|n} %endif