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