Show More
@@ -1,110 +1,112 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.mako"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="robots()"> |
|
5 | 5 | %if c.gist.gist_type != 'public': |
|
6 | 6 | <meta name="robots" content="noindex, nofollow"> |
|
7 | 7 | %else: |
|
8 | 8 | ${parent.robots()} |
|
9 | 9 | %endif |
|
10 | 10 | </%def> |
|
11 | 11 | |
|
12 | 12 | <%def name="title()"> |
|
13 | 13 | ${_('Gist')} · ${c.gist.gist_access_id} |
|
14 | 14 | %if c.rhodecode_name: |
|
15 | 15 | · ${h.branding(c.rhodecode_name)} |
|
16 | 16 | %endif |
|
17 | 17 | </%def> |
|
18 | 18 | |
|
19 | 19 | <%def name="breadcrumbs_links()"> |
|
20 | 20 | ${_('Gist')} · ${c.gist.gist_access_id} |
|
21 | 21 | </%def> |
|
22 | 22 | |
|
23 | 23 | <%def name="menu_bar_nav()"> |
|
24 | 24 | ${self.menu_items(active='gists')} |
|
25 | 25 | </%def> |
|
26 | 26 | |
|
27 | 27 | <%def name="main()"> |
|
28 | 28 | <div class="box"> |
|
29 | 29 | <!-- box / title --> |
|
30 | 30 | <div class="title"> |
|
31 | 31 | ${self.breadcrumbs()} |
|
32 | 32 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
33 | 33 | <ul class="links"> |
|
34 | 34 | <li> |
|
35 | 35 | <a href="${h.route_path('gists_new')}" class="btn btn-primary">${_(u'Create New Gist')}</a> |
|
36 | 36 | </li> |
|
37 | 37 | </ul> |
|
38 | 38 | %endif |
|
39 | 39 | </div> |
|
40 | 40 | <code>${c.gist.gist_url()}</code> |
|
41 | 41 | <div class="table"> |
|
42 | 42 | <div id="files_data"> |
|
43 | 43 | <div id="codeblock" class="codeblock"> |
|
44 | 44 | <div class="code-header"> |
|
45 | 45 | <div class="stats"> |
|
46 | 46 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: |
|
47 | 47 | <div class="remove_gist"> |
|
48 | 48 | ${h.secure_form(h.route_path('gist_delete', gist_id=c.gist.gist_access_id), request=request)} |
|
49 | 49 | ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")} |
|
50 | 50 | ${h.end_form()} |
|
51 | 51 | </div> |
|
52 | 52 | %endif |
|
53 | 53 | <div class="buttons"> |
|
54 | 54 | ## only owner should see that |
|
55 | <a href="#copySource" onclick="return false;" class="btn btn-mini icon-clipboard clipboard-action" data-clipboard-text="${c.files[0].content}">${_('Copy Content')}</a> | |
|
56 | ||
|
55 | 57 |
|
|
56 | 58 | ${h.link_to(_('Edit'), h.route_path('gist_edit', gist_id=c.gist.gist_access_id), class_="btn btn-mini")} |
|
57 | 59 | %endif |
|
58 | 60 | ${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")} |
|
59 | 61 | </div> |
|
60 | 62 | <div class="left" > |
|
61 | 63 | %if c.gist.gist_type != 'public': |
|
62 | 64 | <span class="tag tag-ok disabled">${_('Private Gist')}</span> |
|
63 | 65 | %endif |
|
64 | 66 | <span> ${c.gist.gist_description}</span> |
|
65 | 67 | <span>${_('Expires')}: |
|
66 | 68 | %if c.gist.gist_expires == -1: |
|
67 | 69 | ${_('never')} |
|
68 | 70 | %else: |
|
69 | 71 | ${h.age_component(h.time_to_utcdatetime(c.gist.gist_expires))} |
|
70 | 72 | %endif |
|
71 | 73 | </span> |
|
72 | 74 | </div> |
|
73 | 75 | </div> |
|
74 | 76 | |
|
75 | 77 | <div class="author"> |
|
76 | 78 | <div title="${h.tooltip(c.file_last_commit.author)}"> |
|
77 | 79 | ${self.gravatar_with_user(c.file_last_commit.author, 16)} - ${_('created')} ${h.age_component(c.file_last_commit.date)} |
|
78 | 80 | </div> |
|
79 | 81 | |
|
80 | 82 | </div> |
|
81 | 83 | <div class="commit">${h.urlify_commit_message(c.file_last_commit.message, None)}</div> |
|
82 | 84 | </div> |
|
83 | 85 | |
|
84 | 86 | ## iterate over the files |
|
85 | 87 | % for file in c.files: |
|
86 | 88 | <% renderer = c.render and h.renderer_from_filename(file.path, exclude=['.txt', '.TXT'])%> |
|
87 | 89 | <!-- |
|
88 | 90 | <div id="${h.FID('G', file.path)}" class="stats" > |
|
89 | 91 | <a href="${c.gist.gist_url()}">¶</a> |
|
90 | 92 | <b >${file.path}</b> |
|
91 | 93 | <div> |
|
92 | 94 | ${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")} |
|
93 | 95 | </div> |
|
94 | 96 | </div> |
|
95 | 97 | --> |
|
96 | 98 | <div class="code-body textarea text-area editor"> |
|
97 | 99 | %if renderer: |
|
98 | 100 | ${h.render(file.content, renderer=renderer)} |
|
99 | 101 | %else: |
|
100 | 102 | ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")} |
|
101 | 103 | %endif |
|
102 | 104 | </div> |
|
103 | 105 | %endfor |
|
104 | 106 | </div> |
|
105 | 107 | </div> |
|
106 | 108 | </div> |
|
107 | 109 | |
|
108 | 110 | |
|
109 | 111 | </div> |
|
110 | 112 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now