## -*- coding: utf-8 -*- <%inherit file="/base/base.mako"/> <%def name="robots()"> %if c.gist.gist_type != 'public': %else: ${parent.robots()} %endif <%def name="title()"> ${_('Gist')} · ${c.gist.gist_access_id} %if c.rhodecode_name: · ${h.branding(c.rhodecode_name)} %endif <%def name="breadcrumbs_links()"> ${_('Gist')} · ${c.gist.gist_access_id} / ${_('URL')}: ${c.gist.gist_url()} <%def name="menu_bar_nav()"> ${self.menu_items(active='gists')} <%def name="main()">
${self.breadcrumbs()} %if c.rhodecode_user.username != h.DEFAULT_USER: %endif
%if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id:
${h.secure_form(url('gist', gist_id=c.gist.gist_access_id),method='delete')} ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")} ${h.end_form()}
%endif
## only owner should see that %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: ${h.link_to(_('Edit'),h.url('edit_gist', gist_id=c.gist.gist_access_id),class_="btn btn-mini")} %endif ${h.link_to(_('Show as Raw'),h.url('formatted_gist', gist_id=c.gist.gist_access_id, format='raw'),class_="btn btn-mini")}
%if c.gist.gist_type != 'public': ${_('Private Gist')} %endif ${c.gist.gist_description} ${_('Expires')}: %if c.gist.gist_expires == -1: ${_('never')} %else: ${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))} %endif
${self.gravatar_with_user(c.file_last_commit.author, 16)} - ${_('created')} ${h.age_component(c.file_last_commit.date)}
${h.urlify_commit_message(c.file_last_commit.message,c.repo_name)}
## iterate over the files % for file in c.files: <% renderer = c.render and h.renderer_from_filename(file.path, exclude=['.txt', '.TXT'])%>
%if renderer: ${h.render(file.content, renderer=renderer)} %else: ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} %endif
%endfor