## -*- 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} } } %def>