|
@@
-1,5
+1,6
b''
|
|
1
|
## -*- coding: utf-8 -*-
|
|
1
|
## -*- coding: utf-8 -*-
|
|
2
|
<%inherit file="/base/base.mako"/>
|
|
2
|
<%inherit file="/base/base.mako"/>
|
|
|
|
|
3
|
<%namespace name="dt" file="/data_table/_dt_elements.mako"/>
|
|
3
|
|
|
4
|
|
|
4
|
<%def name="robots()">
|
|
5
|
<%def name="robots()">
|
|
5
|
%if c.gist.gist_type != 'public':
|
|
6
|
%if c.gist.gist_type != 'public':
|
|
@@
-27,28
+28,21
b''
|
|
27
|
<%def name="main()">
|
|
28
|
<%def name="main()">
|
|
28
|
<div class="box">
|
|
29
|
<div class="box">
|
|
29
|
<!-- box / title -->
|
|
30
|
<!-- box / title -->
|
|
30
|
<div class="title">
|
|
|
|
|
31
|
${self.breadcrumbs()}
|
|
|
|
|
32
|
</div>
|
|
|
|
|
33
|
|
|
31
|
|
|
34
|
<div class="table">
|
|
32
|
<div class="table">
|
|
35
|
<div id="files_data">
|
|
33
|
<div id="files_data">
|
|
36
|
<div id="codeblock" class="codeblock">
|
|
34
|
<div id="codeblock" class="codeblock">
|
|
37
|
<div class="code-header">
|
|
35
|
<div class="code-header">
|
|
38
|
<div class="gist_url">
|
|
36
|
<div class="gist_url">
|
|
|
|
|
37
|
<div class="pull-left">
|
|
39
|
<code>
|
|
38
|
<code>
|
|
|
|
|
39
|
${dt.gist_type(c.gist.gist_type)}
|
|
|
|
|
40
|
<span class="tag disabled">${c.gist.gist_access_id}</span>
|
|
40
|
${c.gist.gist_url()} <span class="icon-clipboard clipboard-action" data-clipboard-text="${c.gist.gist_url()}" title="${_('Copy the url')}"></span>
|
|
41
|
${c.gist.gist_url()} <span class="icon-clipboard clipboard-action" data-clipboard-text="${c.gist.gist_url()}" title="${_('Copy the url')}"></span>
|
|
41
|
</code>
|
|
42
|
</code>
|
|
42
|
</div>
|
|
43
|
</div>
|
|
43
|
<div class="stats">
|
|
44
|
|
|
44
|
%if c.is_super_admin or c.gist.gist_owner == c.rhodecode_user.user_id:
|
|
45
|
<div class="pull-right buttons">
|
|
45
|
<div class="remove_gist">
|
|
|
|
|
46
|
${h.secure_form(h.route_path('gist_delete', gist_id=c.gist.gist_access_id), request=request)}
|
|
|
|
|
47
|
${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")}
|
|
|
|
|
48
|
${h.end_form()}
|
|
|
|
|
49
|
</div>
|
|
|
|
|
50
|
%endif
|
|
|
|
|
51
|
<div class="buttons">
|
|
|
|
|
52
|
## only owner should see that
|
|
46
|
## only owner should see that
|
|
53
|
<a href="#copySource" onclick="return false;" class="btn btn-mini icon-clipboard clipboard-action" data-clipboard-text="${c.files[0].content}">${_('Copy content')}</a>
|
|
47
|
<a href="#copySource" onclick="return false;" class="btn btn-mini icon-clipboard clipboard-action" data-clipboard-text="${c.files[0].content}">${_('Copy content')}</a>
|
|
54
|
|
|
48
|
|
|
@@
-56,26
+50,31
b''
|
|
56
|
${h.link_to(_('Edit'), h.route_path('gist_edit', gist_id=c.gist.gist_access_id), class_="btn btn-mini")}
|
|
50
|
${h.link_to(_('Edit'), h.route_path('gist_edit', gist_id=c.gist.gist_access_id), class_="btn btn-mini")}
|
|
57
|
%endif
|
|
51
|
%endif
|
|
58
|
${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")}
|
|
52
|
${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")}
|
|
|
|
|
53
|
|
|
|
|
|
54
|
%if c.is_super_admin or c.gist.gist_owner == c.rhodecode_user.user_id:
|
|
|
|
|
55
|
<div class="pull-right remove_gist">
|
|
|
|
|
56
|
${h.secure_form(h.route_path('gist_delete', gist_id=c.gist.gist_access_id), request=request)}
|
|
|
|
|
57
|
${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")}
|
|
|
|
|
58
|
${h.end_form()}
|
|
59
|
</div>
|
|
59
|
</div>
|
|
60
|
<div class="left" >
|
|
|
|
|
61
|
%if c.gist.gist_type != 'public':
|
|
|
|
|
62
|
<span class="tag tag-ok disabled">${_('Private Gist')}</span>
|
|
|
|
|
63
|
%endif
|
|
60
|
%endif
|
|
64
|
<span> ${c.gist.gist_description}</span>
|
|
61
|
</div>
|
|
65
|
<span>${_('Expires')}:
|
|
62
|
</div>
|
|
|
|
|
63
|
|
|
|
|
|
64
|
<div class="gist-desc">
|
|
|
|
|
65
|
<code>${c.gist.gist_description}</code>
|
|
|
|
|
66
|
</div>
|
|
|
|
|
67
|
|
|
|
|
|
68
|
<div class="author">
|
|
|
|
|
69
|
<div title="${h.tooltip(c.file_last_commit.author)}">
|
|
|
|
|
70
|
${self.gravatar_with_user(c.file_last_commit.author, 16, tooltip=True)} - ${_('created')} ${h.age_component(c.file_last_commit.date)},
|
|
|
|
|
71
|
${_('expires')}:
|
|
66
|
%if c.gist.gist_expires == -1:
|
|
72
|
%if c.gist.gist_expires == -1:
|
|
67
|
${_('never')}
|
|
73
|
${_('never')}
|
|
68
|
%else:
|
|
74
|
%else:
|
|
69
|
${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))}
|
|
75
|
${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))}
|
|
70
|
%endif
|
|
76
|
%endif
|
|
71
|
</span>
|
|
77
|
</span>
|
|
72
|
|
|
|
|
|
73
|
</div>
|
|
|
|
|
74
|
</div>
|
|
|
|
|
75
|
|
|
|
|
|
76
|
<div class="author">
|
|
|
|
|
77
|
<div title="${h.tooltip(c.file_last_commit.author)}">
|
|
|
|
|
78
|
${self.gravatar_with_user(c.file_last_commit.author, 16, tooltip=True)} - ${_('created')} ${h.age_component(c.file_last_commit.date)}
|
|
|
|
|
79
|
</div>
|
|
78
|
</div>
|
|
80
|
|
|
79
|
|
|
81
|
</div>
|
|
80
|
</div>
|
|
@@
-83,22
+82,22
b''
|
|
83
|
</div>
|
|
82
|
</div>
|
|
84
|
|
|
83
|
|
|
85
|
## iterate over the files
|
|
84
|
## iterate over the files
|
|
86
|
% for file in c.files:
|
|
85
|
% for gist_file in c.files:
|
|
87
|
<% renderer = c.render and h.renderer_from_filename(file.path, exclude=['.txt', '.TXT'])%>
|
|
86
|
<% renderer = c.render and h.renderer_from_filename(gist_file.path, exclude=['.txt', '.TXT'])%>
|
|
88
|
<!--
|
|
87
|
<!--
|
|
89
|
<div id="${h.FID('G', file.path)}" class="stats" >
|
|
88
|
<div id="${h.FID('G', gist_file.path)}" class="stats" >
|
|
90
|
<a href="${c.gist.gist_url()}">¶</a>
|
|
89
|
<a href="${c.gist.gist_url()}">¶</a>
|
|
91
|
<b >${file.path}</b>
|
|
90
|
<b >${gist_file.path}</b>
|
|
92
|
<div>
|
|
91
|
<div>
|
|
93
|
${h.link_to(_('Show as raw'), h.route_path('gist_show_formatted_path', gist_id=c.gist.gist_access_id, revision=file.commit.raw_id, format='raw', f_path=file.path), class_="btn btn-mini")}
|
|
92
|
${h.link_to(_('Show as raw'), h.route_path('gist_show_formatted_path', gist_id=c.gist.gist_access_id, revision=gist_file.commit.raw_id, format='raw', f_path=gist_file.path), class_="btn btn-mini")}
|
|
94
|
</div>
|
|
93
|
</div>
|
|
95
|
</div>
|
|
94
|
</div>
|
|
96
|
-->
|
|
95
|
-->
|
|
97
|
<div class="code-body textarea text-area editor">
|
|
96
|
<div class="code-body textarea text-area editor">
|
|
98
|
%if renderer:
|
|
97
|
%if renderer:
|
|
99
|
${h.render(file.content, renderer=renderer)}
|
|
98
|
${h.render(gist_file.content, renderer=renderer)}
|
|
100
|
%else:
|
|
99
|
%else:
|
|
101
|
${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
|
|
100
|
${h.pygmentize(gist_file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
|
|
102
|
%endif
|
|
101
|
%endif
|
|
103
|
</div>
|
|
102
|
</div>
|
|
104
|
%endfor
|
|
103
|
%endfor
|