diff --git a/rhodecode/public/css/code-block.less b/rhodecode/public/css/code-block.less --- a/rhodecode/public/css/code-block.less +++ b/rhodecode/public/css/code-block.less @@ -418,9 +418,17 @@ div.codeblock { } .gist_url { - padding: 0px 0px 10px 0px; + padding: 0px 0px 35px 0px; } + .gist-desc { + clear: both; + margin: 0 0 10px 0; + code { + white-space: pre-line; + line-height: inherit + } + } .author { clear: both; vertical-align: middle; diff --git a/rhodecode/public/css/tags.less b/rhodecode/public/css/tags.less --- a/rhodecode/public/css/tags.less +++ b/rhodecode/public/css/tags.less @@ -49,6 +49,19 @@ .tag7 { .border ( @border-thickness-tags, @color7 ); color:@color7; } .tag8 { .border ( @border-thickness-tags, @color8 ); color:@color8; } + +.tag-gist-public { + .border (@border-thickness-tags, @color1); + color: @color1; +} + + +.tag-gist-private { + .border (@border-thickness-tags, @color2); + color: @color2; +} + + .metatag-list { margin: 0; padding: 0; diff --git a/rhodecode/templates/admin/gists/gist_show.mako b/rhodecode/templates/admin/gists/gist_show.mako --- a/rhodecode/templates/admin/gists/gist_show.mako +++ b/rhodecode/templates/admin/gists/gist_show.mako @@ -1,5 +1,6 @@ ## -*- 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': @@ -27,55 +28,53 @@ <%def name="main()">
-
- ${self.breadcrumbs()} -
- +
+ + ${dt.gist_type(c.gist.gist_type)} + ${c.gist.gist_access_id} ${c.gist.gist_url()} - -
-
- %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 -
+ +
## 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")} + ${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
-
- %if c.gist.gist_type != 'public': - ${_('Private Gist')} - %endif - ${c.gist.gist_description} - ${_('Expires')}: +
+ +
+ ${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 - -
-
- -
-
- ${self.gravatar_with_user(c.file_last_commit.author, 16, tooltip=True)} - ${_('created')} ${h.age_component(c.file_last_commit.date)}
@@ -83,22 +82,22 @@
## iterate over the files - % for file in c.files: - <% renderer = c.render and h.renderer_from_filename(file.path, exclude=['.txt', '.TXT'])%> + % for gist_file in c.files: + <% renderer = c.render and h.renderer_from_filename(gist_file.path, exclude=['.txt', '.TXT'])%>
%if renderer: - ${h.render(file.content, renderer=renderer)} + ${h.render(gist_file.content, renderer=renderer)} %else: - ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} + ${h.pygmentize(gist_file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} %endif
%endfor diff --git a/rhodecode/templates/data_table/_dt_elements.mako b/rhodecode/templates/data_table/_dt_elements.mako --- a/rhodecode/templates/data_table/_dt_elements.mako +++ b/rhodecode/templates/data_table/_dt_elements.mako @@ -338,8 +338,10 @@ <%def name="gist_type(gist_type)"> - %if gist_type != 'public': -
${_('Private')}
+ %if gist_type == 'public': + ${_('Public Gist')} + %else: + ${_('Private Gist')} %endif