##// END OF EJS Templates
fixed show as raw link for private gists and separate files
marcink -
r4032:d15b3db4 default
parent child Browse files
Show More
@@ -1,97 +1,97 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.html"/>
3 3
4 4 <%def name="title()">
5 5 ${_('gist')}:${c.gist.gist_access_id} &middot; ${c.rhodecode_name}
6 6 </%def>
7 7
8 8 <%def name="breadcrumbs_links()">
9 9 ${_('Gist')} &middot; gist:${c.gist.gist_access_id}
10 10 </%def>
11 11
12 12 <%def name="page_nav()">
13 13 ${self.menu('gists')}
14 14 </%def>
15 15
16 16 <%def name="main()">
17 17 <div class="box">
18 18 <!-- box / title -->
19 19 <div class="title">
20 20 ${self.breadcrumbs()}
21 21 %if c.rhodecode_user.username != 'default':
22 22 <ul class="links">
23 23 <li>
24 24 <span>${h.link_to(_(u'Create new gist'), h.url('new_gist'))}</span>
25 25 </li>
26 26 </ul>
27 27 %endif
28 28 </div>
29 29 <div class="table">
30 30 <div id="files_data">
31 31 <div id="body" class="codeblock">
32 32 <div class="code-header">
33 33 <div class="stats">
34 34 <div class="left" style="margin: -4px 0px 0px 0px">
35 35 %if c.gist.gist_type == 'public':
36 36 <div class="ui-btn green badge">${_('Public gist')}</div>
37 37 %else:
38 38 <div class="ui-btn yellow badge">${_('Private gist')}</div>
39 39 %endif
40 40 </div>
41 41 <div class="left item ${'' if c.gist.gist_description else 'last'}" style="color: #AAA">
42 42 %if c.gist.gist_expires == -1:
43 43 ${_('Expires')}: ${_('never')}
44 44 %else:
45 45 ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))}
46 46 %endif
47 47 </div>
48 48 <div class="left item last">
49 49 ${c.gist.gist_description}
50 50 </div>
51 51 %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id:
52 52 <div style="float:right;margin:-4px 0px 0px 0px">
53 53 ${h.form(url('gist', gist_id=c.gist.gist_id),method='delete')}
54 54 ${h.submit('remove_gist', _('Delete'),class_="ui-btn red",onclick="return confirm('"+_('Confirm to delete this gist')+"');")}
55 55 ${h.end_form()}
56 56 </div>
57 57 %endif
58 58 <div class="buttons">
59 59 ## only owner should see that
60 60 ##%if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id:
61 61 ##${h.link_to(_('Edit'),h.url(''),class_="ui-btn")}
62 62 ##%endif
63 63 ${h.link_to(_('Show as raw'),h.url('formatted_gist', gist_id=c.gist.gist_access_id, format='raw'),class_="ui-btn")}
64 64 </div>
65 65 </div>
66 66
67 67 <div class="author">
68 68 <div class="gravatar">
69 69 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(c.file_changeset.author),16)}"/>
70 70 </div>
71 71 <div title="${c.file_changeset.author}" class="user">${h.person(c.file_changeset.author)} - ${_('created')} ${h.age(c.file_changeset.date)}</div>
72 72 </div>
73 73 <div class="commit">${h.urlify_commit(c.file_changeset.message,c.repo_name)}</div>
74 74 </div>
75 75 </div>
76 76
77 77 ## iterate over the files
78 78 % for file in c.files:
79 79 <div style="border: 1px solid #EEE;margin-top:20px">
80 80 <div id="${h.FID('G', file.path)}" class="stats" style="border-bottom: 1px solid #DDD;padding: 8px 14px;">
81 81 <a href="${c.gist.gist_url()}"></a>
82 82 <b style="margin:0px 0px 0px 4px">${file.path}</b>
83 83 <div style="float:right">
84 ${h.link_to(_('Show as raw'),h.url('formatted_gist_file', gist_id=c.gist.gist_id, format='raw', revision=file.changeset.raw_id, f_path=file.path),class_="ui-btn")}
84 ${h.link_to(_('Show as raw'),h.url('formatted_gist_file', gist_id=c.gist.gist_access_id, format='raw', revision=file.changeset.raw_id, f_path=file.path),class_="ui-btn")}
85 85 </div>
86 86 </div>
87 87 <div class="code-body">
88 88 ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
89 89 </div>
90 90 </div>
91 91 %endfor
92 92 </div>
93 93 </div>
94 94
95 95
96 96 </div>
97 97 </%def>
General Comments 0
You need to be logged in to leave comments. Login now