## -*- coding: utf-8 -*- <%! from rhodecode.lib import html_filters %> <%inherit file="root.mako"/> <%include file="/ejs_templates/templates.html"/>
${self.menu_bar_nav()}
${self.menu_bar_subnav()}
${next.main()}
### MAKO DEFS ### <%def name="menu_bar_subnav()"> <%def name="breadcrumbs(class_='breadcrumbs')">
${self.breadcrumbs_links()}
<%def name="admin_menu(active=None)">
% if c.is_super_admin: ${_('Super-admin Panel')} % else: ${_('Delegated Admin Panel')} % endif
<%def name="dt_info_panel(elements)">
%for dt, dd, title, show_items in elements:
${dt}:
%if callable(dd): ## allow lazy evaluation of elements ${dd()} %else: ${dd} %endif %if show_items: ${_('Show More')} %endif
%if show_items: %endif %endfor
<%def name="tr_info_entry(element)"> <% key, val, title, show_items = element %> ${key} %if callable(val): ## allow lazy evaluation of elements ${val()} %else: ${val} %endif %if show_items: %endif %if show_items: ${_('Show More')} %endif <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None, extra_class=None)"> <% if size > 16: gravatar_class = ['gravatar','gravatar-large'] else: gravatar_class = ['gravatar'] data_hovercard_url = '' data_hovercard_alt = tooltip_alt.replace('<', '<').replace('>', '>') if tooltip_alt else '' if tooltip: gravatar_class += ['tooltip-hovercard'] if extra_class: gravatar_class += extra_class if tooltip and user: if user.username == h.DEFAULT_USER: gravatar_class.pop(-1) else: data_hovercard_url = request.route_path('hovercard_user', user_id=getattr(user, 'user_id', '')) gravatar_class = ' '.join(gravatar_class) %> <%doc> TODO: johbo: For now we serve double size images to make it smooth for retina. This is how it worked until now. Should be replaced with a better solution at some point. <%def name="gravatar_with_user(contact, size=16, show_disabled=False, tooltip=False, _class='rc-user')"> <% email = h.email_or_none(contact) rc_user = h.discover_user(contact) %>
${self.gravatar(email, size, tooltip=tooltip, tooltip_alt=contact, user=rc_user)} ${h.link_to_user(rc_user or contact)}
<%def name="user_group_icon(user_group=None, size=16, tooltip=False)"> <% if (size > 16): gravatar_class = 'icon-user-group-alt' else: gravatar_class = 'icon-user-group-alt' if tooltip: gravatar_class += ' tooltip-hovercard' data_hovercard_url = request.route_path('hovercard_user_group', user_group_id=user_group.users_group_id) %> <%doc> TODO: johbo: For now we serve double size images to make it smooth for retina. This is how it worked until now. Should be replaced with a better solution at some point. <%def name="repo_page_title(repo_instance)">
## SVN/HG/GIT icons %if h.is_hg(repo_instance): %endif %if h.is_git(repo_instance): %endif %if h.is_svn(repo_instance): %endif ## public/private %if repo_instance.private: %else: %endif ## repo name with group name ${h.breadcrumb_repo_link(repo_instance)} ## Context Actions
%if c.rhodecode_user.username != h.DEFAULT_USER: RSS % if c.repository_is_user_following: ${_('Unwatch')} % else: ${_('Watch')} % endif %else: RSS %endif
## FORKED %if repo_instance.fork:

${_('Fork of')} ${h.link_to_if(c.has_origin_repo_read_perm,repo_instance.fork.repo_name, h.route_path('repo_summary', repo_name=repo_instance.fork.repo_name))}

%endif ## IMPORTED FROM REMOTE %if repo_instance.clone_uri:

${_('Clone from')} ${h.hide_credentials(repo_instance.clone_uri)}

%endif ## LOCKING STATUS %if repo_instance.locked[0]:

${_('Repository locked by %(user)s') % {'user': h.person_by_id(repo_instance.locked[0])}}

%elif repo_instance.enable_locking:

${_('Repository not locked. Pull repository to lock it.')}

%endif
<%def name="repo_menu(active=None)"> <% ## determine if we have "any" option available can_lock = h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking has_actions = can_lock %> % if c.rhodecode_db_repo.archived:
${_('This repository has been archived. It is now read-only.')}
% endif
${self.repo_page_title(c.rhodecode_db_repo)}
<%def name="repo_group_page_title(repo_group_instance)">
## Repository Group icon ## repo name with group name ${h.breadcrumb_repo_group_link(repo_group_instance)}
<%namespace name="dt" file="/data_table/_dt_elements.mako"/>
${dt.repo_group_desc(repo_group_instance.description_safe, repo_group_instance.personal, c.visual.stylify_metatags)}
<%def name="repo_group_menu(active=None)"> <% gr_name = c.repo_group.group_name if c.repo_group else None # create repositories with write permission on group is set to true group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') %>
${self.repo_group_page_title(c.repo_group)}
<%def name="usermenu(active=False)"> <% not_anonymous = c.rhodecode_user.username != h.DEFAULT_USER gr_name = c.repo_group.group_name if (hasattr(c, 'repo_group') and c.repo_group) else None # create repositories with write permission on group is set to true can_fork = c.is_super_admin or h.HasPermissionAny('hg.fork.repository')() create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() group_write = h.HasRepoGroupPermissionAny('group.write')(gr_name, 'can write into group index page') group_admin = h.HasRepoGroupPermissionAny('group.admin')(gr_name, 'group admin index page') can_create_repos = c.is_super_admin or c.can_create_repo can_create_repo_groups = c.is_super_admin or c.can_create_repo_group can_create_repos_in_group = c.is_super_admin or group_admin or (group_write and create_on_write) can_create_repo_groups_in_group = c.is_super_admin or group_admin %> % if not_anonymous: <% default_target_group = dict() if c.rhodecode_user.personal_repo_group: default_target_group = dict(parent_group=c.rhodecode_user.personal_repo_group.group_id) %> ## create action
  • ## notifications
  • ${c.unread_notifications}
  • % endif ## USER MENU
  • % if c.rhodecode_user.username == h.DEFAULT_USER: ${gravatar(c.rhodecode_user.email, 20)} ${_('Sign in')} % else: ## logged in user ${gravatar(c.rhodecode_user.email, 20)} ${c.rhodecode_user.username}
    ## subnav with menu for logged in user % endif
  • <%def name="menu_items(active=None)"> <% notice_messages, notice_level = c.rhodecode_user.get_notice_messages() notice_display = 'none' if len(notice_messages) == 0 else '' %>