## -*- 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} <%def name="menu_bar_nav()"> ${self.menu_items(active='gists')} <%def name="main()">
${self.breadcrumbs()} %if c.rhodecode_user.username != h.DEFAULT_USER: %endif
${c.gist.gist_url()}
%if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id:
${h.secure_form(h.route_path('gist_delete', gist_id=c.gist.gist_access_id), method='POST')} ${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.route_path('gist_edit', gist_id=c.gist.gist_access_id), class_="btn btn-mini")} %endif ${h.link_to(_('Show as Raw'), h.route_path('gist_show_formatted', gist_id=c.gist.gist_access_id, revision='tip', 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, None)}
## 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