## DATA TABLE RE USABLE ELEMENTS ## usage: ## <%namespace name="dt" file="/data_table/_dt_elements.html"/> <%def name="repo_actions(repo_name)"> ${h.form(h.url('repo', repo_name=repo_name),method='delete')} ${h.submit('remove_%s' % repo_name,_('delete'),class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} ${h.end_form()} <%def name="quick_menu(repo_name)"> <%def name="repo_name(name,rtype,private,fork_of,short_name=False, admin=False)"> <% def get_name(name,short_name=short_name): if short_name: return name.split('/')[-1] else: return name %>
##TYPE OF REPO %if h.is_hg(rtype): ${_('Mercurial repository')} %elif h.is_git(rtype): ${_('Git repository')} %endif ##PRIVATE/PUBLIC %if private: ${_('private repository')} %else: ${_('public repository')} %endif ##NAME %if admin: ${h.link_to(get_name(name),h.url('edit_repo',repo_name=name),class_="repo_name")} %else: ${h.link_to(get_name(name),h.url('summary_home',repo_name=name),class_="repo_name")} %endif %if fork_of: ${_('fork')} %endif
<%def name="revision(name,rev,tip,author,last_msg)">
%if rev >= 0:
${'r%s:%s' % (rev,h.short_id(tip))}
%else: ${_('No changesets yet')} %endif
<%def name="user_gravatar(email, size=24)">
gravatar
<%def name="user_actions(user_id, username)"> ${h.form(h.url('delete_user', id=user_id),method='delete')} ${h.submit('remove_',_('delete'),id="remove_user_%s" % user_id, class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")} ${h.end_form()} <%def name="user_name(user_id, username)"> ${h.link_to(username,h.url('edit_user', id=user_id))}