## -*- coding: utf-8 -*- <%inherit file="/base/base.mako"/> <%namespace name="dt" file="/data_table/_dt_elements.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()">
${dt.gist_type(c.gist.gist_type)} ${c.gist.gist_access_id} ${c.gist.gist_url()}
## only owner should see that ${_('Copy content')} %if c.is_super_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.is_super_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), request=request)} ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")} ${h.end_form()}
%endif
${c.gist.gist_description}
${self.gravatar_with_user(c.file_last_commit.author, 16, tooltip=True)} - ${_('created')} ${h.age_component(c.file_last_commit.date)}, ${_('expires')}: %if c.gist.gist_expires == -1: ${_('never')} %else: ${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))} %endif
${h.urlify_commit_message(c.file_last_commit.message, None)}
## iterate over the files % for gist_file in c.files: <% renderer = c.render and h.renderer_from_filename(gist_file.path, exclude=['.txt', '.TXT'])%>
%if renderer: ${h.render(gist_file.content, renderer=renderer)} %else: ${h.pygmentize(gist_file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} %endif
%endfor