<commit_before><%def name="nav_link(href, text, li_class='', a_class='',  a_rel='', id_='', title='', condition=True)">
%if condition:
<li class="${li_class}" id="${id_}">
    <a href="${href}" class="${a_class}" rel="${a_rel}" title="${title}">${text}</a>
</li>
%endif
</%def>


<%def name="global_nav(active)">

<%
   active_nav = {}
   active_nav[active] = 'current'

   def _class(identifier):
       return active_nav.get(identifier, '')
%>

<!-- begin: main navi -->
<nav>
    <div id="nav">
        <!-- skiplink anchor: navigation -->
        <a id="navigation" name="navigation"></a>
        <!-- main navigation: horizontal list -->
        <div class="menu hlist">
            <ul>
                ${nav_link(href=h.base_url('/', None),
                text=_("Start"),
                li_class=_class('home'),
                id_="nav_home")}

                %if not h.config.get_bool('adhocracy.hide_instance_list_in_navigation'):
                %if app_globals.single_instance is None:
                ${nav_link(href=h.base_url('/instance', None),
                           a_rel='#overlay-default',
                           li_class=_class('instances'),
                           text=_("Instances"),
                           id_="nav_instances")}
                %endif
                %endif

                %if not h.config.get_bool('adhocracy.put_watchlist_in_user_menu') and c.user:
                ${nav_link(href=h.entity_url(c.user, member='watchlist'),
                           li_class=_class('watchlist'),
                           text=_("Watchlist"),
                           id_="nav_watchlist")}
                %endif
                ${nav_link(href=h.base_url('/static/about.html', None),
                           text=_('About'),
                           a_class='staticlink_about',
                           li_class=_class('about'),
                           id_="nav_about")}
                <!--TODO: remove dummy link to merge in new links with diazo themeing-->
                <li id="nav_dummy" style="display: none;"></li>
                ${nav_link(href=h.base_url('/static/help.html', None),
                           text=_("Help"),
                           a_class='staticlink_help',
                           li_class=_class('help'),
                           id_="nav_help")}

                %if c.user is None:
                ${nav_link(href=h.login_redirect_url(),
                           a_rel='#overlay-default',
                           text=_("Login"),
                           li_class=_class('login'),
                           id_="nav_login")}
                %else:
                <li id="user_menu" class="${_class('user')}">
                    <a class="icon_link show_me"
                       href="${h.base_url(u'/user/dashboard')}">${c.user.name}</a>
                    <ul class="children">
                        <li>
                            <a href="${h.base_url(u'/user/dashboard')}">
                                ${_('Dashboard')}
                            </a>
                        </li>

                        %if h.config.get_bool('adhocracy.put_watchlist_in_user_menu'):
                        <li>
                            <a href="${h.entity_url(c.user, member='watchlist')}">
                                ${_('Watchlist')}
                            </a>
                        </li>
                        %endif

                        %if can.user.edit(c.user):
                        <li>
                            <a href="${h.entity_url(c.user, instance=c.instance, member='settings')}">
                                ${_('Edit Profile')}
                            </a>
                        </li>
                        %endif
                        %if can.user.show(c.user):
                        <li>
                            <a href="${h.entity_url(c.user, instance=c.instance)}">
                                ${_('View Profile')}
                            </a>
                        </li>
                        %endif
                        %if h.has_permission("global.admin"):
                        <li>
                            <a href="${h.base_url('/admin', None)}">
                                ${_('Administrate Site')}
                            </a>
                        </li>
                        %endif
                        <li><a href="/logout">${_("Logout")}</a></li>
                    </ul>
                </li>
                %endif

            </ul>
        </div>
    </div>
</nav>
</%def>


<%def name="subheader_navigation(logo, label, search_action=None, search_label='',
                                 search_button_text=None, url=None)">

  <div id="subheader" class="${'logo' if logo else ''}">
      <div class="page_wrapper">
        <div id="logo_row">
            <div id="organisation_logo">
                %if url:
                <a href="${url}">
                %endif
                %if logo:
                <img src="${logo}" alt=""/>
                %endif
                <h2>${label}</h2>
                %if url:
                </a>
                %endif
            </div>
            %if can.instance.edit(c.instance):
            <div id="instance_settings">
              <a href="${h.entity_url(c.instance, member='settings')}" class="button settings">${_("Settings")}</a>
            </div>
            %endif
        </div>

        <div id="nav_row">
            %if search_action:
            <div id="searchbox">
                <form action="${search_action}"
                      id="searchform" method="get">
                    <input type="text" id="s" name="serp_q" placeholder="${search_label|n}"
                           class="search_text" /><commit_msg>Fix link to instance settings<commit_after><%def name="nav_link(href, text, li_class='', a_class='',  a_rel='', id_='', title='', condition=True)">
%if condition:
<li class="${li_class}" id="${id_}">
    <a href="${href}" class="${a_class}" rel="${a_rel}" title="${title}">${text}</a>
</li>
%endif
</%def>


<%def name="global_nav(active)">

<%
   active_nav = {}
   active_nav[active] = 'current'

   def _class(identifier):
       return active_nav.get(identifier, '')
%>

<!-- begin: main navi -->
<nav>
    <div id="nav">
        <!-- skiplink anchor: navigation -->
        <a id="navigation" name="navigation"></a>
        <!-- main navigation: horizontal list -->
        <div class="menu hlist">
            <ul>
                ${nav_link(href=h.base_url('/', None),
                text=_("Start"),
                li_class=_class('home'),
                id_="nav_home")}

                %if not h.config.get_bool('adhocracy.hide_instance_list_in_navigation'):
                %if app_globals.single_instance is None:
                ${nav_link(href=h.base_url('/instance', None),
                           a_rel='#overlay-default',
                           li_class=_class('instances'),
                           text=_("Instances"),
                           id_="nav_instances")}
                %endif
                %endif

                %if not h.config.get_bool('adhocracy.put_watchlist_in_user_menu') and c.user:
                ${nav_link(href=h.entity_url(c.user, member='watchlist'),
                           li_class=_class('watchlist'),
                           text=_("Watchlist"),
                           id_="nav_watchlist")}
                %endif
                ${nav_link(href=h.base_url('/static/about.html', None),
                           text=_('About'),
                           a_class='staticlink_about',
                           li_class=_class('about'),
                           id_="nav_about")}
                <!--TODO: remove dummy link to merge in new links with diazo themeing-->
                <li id="nav_dummy" style="display: none;"></li>
                ${nav_link(href=h.base_url('/static/help.html', None),
                           text=_("Help"),
                           a_class='staticlink_help',
                           li_class=_class('help'),
                           id_="nav_help")}

                %if c.user is None:
                ${nav_link(href=h.login_redirect_url(),
                           a_rel='#overlay-default',
                           text=_("Login"),
                           li_class=_class('login'),
                           id_="nav_login")}
                %else:
                <li id="user_menu" class="${_class('user')}">
                    <a class="icon_link show_me"
                       href="${h.base_url(u'/user/dashboard')}">${c.user.name}</a>
                    <ul class="children">
                        <li>
                            <a href="${h.base_url(u'/user/dashboard')}">
                                ${_('Dashboard')}
                            </a>
                        </li>

                        %if h.config.get_bool('adhocracy.put_watchlist_in_user_menu'):
                        <li>
                            <a href="${h.entity_url(c.user, member='watchlist')}">
                                ${_('Watchlist')}
                            </a>
                        </li>
                        %endif

                        %if can.user.edit(c.user):
                        <li>
                            <a href="${h.entity_url(c.user, instance=c.instance, member='settings')}">
                                ${_('Edit Profile')}
                            </a>
                        </li>
                        %endif
                        %if can.user.show(c.user):
                        <li>
                            <a href="${h.entity_url(c.user, instance=c.instance)}">
                                ${_('View Profile')}
                            </a>
                        </li>
                        %endif
                        %if h.has_permission("global.admin"):
                        <li>
                            <a href="${h.base_url('/admin', None)}">
                                ${_('Administrate Site')}
                            </a>
                        </li>
                        %endif
                        <li><a href="/logout">${_("Logout")}</a></li>
                    </ul>
                </li>
                %endif

            </ul>
        </div>
    </div>
</nav>
</%def>


<%def name="subheader_navigation(logo, label, search_action=None, search_label='',
                                 search_button_text=None, url=None)">

  <div id="subheader" class="${'logo' if logo else ''}">
      <div class="page_wrapper">
        <div id="logo_row">
            <div id="organisation_logo">
                %if url:
                <a href="${url}">
                %endif
                %if logo:
                <img src="${logo}" alt=""/>
                %endif
                <h2>${label}</h2>
                %if url:
                </a>
                %endif
            </div>
            %if can.instance.edit(c.instance):
            <div id="instance_settings">
              <a href="${h.entity_url(c.instance, member='settings/overview')}" class="button settings">${_("Settings")}</a>
            </div>
            %endif
        </div>

        <div id="nav_row">
            %if search_action:
            <div id="searchbox">
                <form action="${search_action}"
                      id="searchform" method="get">
                    <input type="text" id="s" name="serp_q" placeholder="${search_label|n}"
                           class="search_text" />
{'fraction_non_alphanumeric': 0.1511777301927195, 'fraction_numerical': 0.00034261241970021415, 'mean_word_length': 1.1213662790697674, 'pattern_counts': {'":': 0, '<': 153, '<?xml version=': 0, '>': 153, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2875242', 'n_tokens_mistral': 3202, 'n_tokens_neox': 3055, 'n_words': 510}