annotate rhodecode/templates/admin/gists/show.html @ 4032:d15b3db4a3b4

fixed show as raw link for private gists and separate files
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 21 Jun 2013 04:13:39 +0200
parents 4f2e514a55e9
children ffd45b185016
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3840
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 ## -*- coding: utf-8 -*-
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2 <%inherit file="/base/base.html"/>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4 <%def name="title()">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 ${_('gist')}:${c.gist.gist_access_id} &middot; ${c.rhodecode_name}
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 </%def>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 <%def name="breadcrumbs_links()">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 ${_('Gist')} &middot; gist:${c.gist.gist_access_id}
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 </%def>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 <%def name="page_nav()">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 ${self.menu('gists')}
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 </%def>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 <%def name="main()">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 <div class="box">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 <!-- box / title -->
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 <div class="title">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 ${self.breadcrumbs()}
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 %if c.rhodecode_user.username != 'default':
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 <ul class="links">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 <li>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
24 <span>${h.link_to(_(u'Create new gist'), h.url('new_gist'))}</span>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25 </li>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26 </ul>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 %endif
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29 <div class="table">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 <div id="files_data">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31 <div id="body" class="codeblock">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 <div class="code-header">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 <div class="stats">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34 <div class="left" style="margin: -4px 0px 0px 0px">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35 %if c.gist.gist_type == 'public':
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 <div class="ui-btn green badge">${_('Public gist')}</div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
37 %else:
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
38 <div class="ui-btn yellow badge">${_('Private gist')}</div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
39 %endif
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
40 </div>
3850
7a4df261a375 added alias configuration option for gists.
Marcin Kuzminski <marcin@python-works.com>
parents: 3843
diff changeset
41 <div class="left item ${'' if c.gist.gist_description else 'last'}" style="color: #AAA">
3840
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
42 %if c.gist.gist_expires == -1:
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
43 ${_('Expires')}: ${_('never')}
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
44 %else:
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
45 ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))}
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
46 %endif
3850
7a4df261a375 added alias configuration option for gists.
Marcin Kuzminski <marcin@python-works.com>
parents: 3843
diff changeset
47 </div>
7a4df261a375 added alias configuration option for gists.
Marcin Kuzminski <marcin@python-works.com>
parents: 3843
diff changeset
48 <div class="left item last">
7a4df261a375 added alias configuration option for gists.
Marcin Kuzminski <marcin@python-works.com>
parents: 3843
diff changeset
49 ${c.gist.gist_description}
7a4df261a375 added alias configuration option for gists.
Marcin Kuzminski <marcin@python-works.com>
parents: 3843
diff changeset
50 </div>
3867
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
51 %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id:
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
52 <div style="float:right;margin:-4px 0px 0px 0px">
3866
1fdec7e3aeb2 refactored url.resource to full definition of routes
Marcin Kuzminski <marcin@python-works.com>
parents: 3850
diff changeset
53 ${h.form(url('gist', gist_id=c.gist.gist_id),method='delete')}
3843
ad4a680113b7 Gist: implemented delete of gists by owner, or super admin
Marcin Kuzminski <marcin@python-works.com>
parents: 3840
diff changeset
54 ${h.submit('remove_gist', _('Delete'),class_="ui-btn red",onclick="return confirm('"+_('Confirm to delete this gist')+"');")}
ad4a680113b7 Gist: implemented delete of gists by owner, or super admin
Marcin Kuzminski <marcin@python-works.com>
parents: 3840
diff changeset
55 ${h.end_form()}
3867
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
56 </div>
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
57 %endif
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
58 <div class="buttons">
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
59 ## only owner should see that
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
60 ##%if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id:
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
61 ##${h.link_to(_('Edit'),h.url(''),class_="ui-btn")}
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
62 ##%endif
4031
4f2e514a55e9 fixed show as raw link for private gists
Marcin Kuzminski <marcin@python-works.com>
parents: 3867
diff changeset
63 ${h.link_to(_('Show as raw'),h.url('formatted_gist', gist_id=c.gist.gist_access_id, format='raw'),class_="ui-btn")}
3840
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
64 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
65 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
66
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
67 <div class="author">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
68 <div class="gravatar">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
69 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(c.file_changeset.author),16)}"/>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
70 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
71 <div title="${c.file_changeset.author}" class="user">${h.person(c.file_changeset.author)} - ${_('created')} ${h.age(c.file_changeset.date)}</div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
72 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
73 <div class="commit">${h.urlify_commit(c.file_changeset.message,c.repo_name)}</div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
74 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
75 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
76
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
77 ## iterate over the files
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
78 % for file in c.files:
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
79 <div style="border: 1px solid #EEE;margin-top:20px">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
80 <div id="${h.FID('G', file.path)}" class="stats" style="border-bottom: 1px solid #DDD;padding: 8px 14px;">
3850
7a4df261a375 added alias configuration option for gists.
Marcin Kuzminski <marcin@python-works.com>
parents: 3843
diff changeset
81 <a href="${c.gist.gist_url()}">ΒΆ</a>
7a4df261a375 added alias configuration option for gists.
Marcin Kuzminski <marcin@python-works.com>
parents: 3843
diff changeset
82 <b style="margin:0px 0px 0px 4px">${file.path}</b>
3867
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
83 <div style="float:right">
4032
d15b3db4a3b4 fixed show as raw link for private gists and separate files
Marcin Kuzminski <marcin@python-works.com>
parents: 4031
diff changeset
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")}
3867
73f7149f2cc0 Added show as raw into gist
Marcin Kuzminski <marcin@python-works.com>
parents: 3866
diff changeset
85 </div>
3840
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
86 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
87 <div class="code-body">
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
88 ${h.pygmentize(file,linenos=True,anchorlinenos=True,lineanchors='L',cssclass="code-highlight")}
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
89 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
90 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
91 %endfor
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
92 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
93 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
94
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
95
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
96 </div>
dc4644865e8b Implemented simple gist functionality ref #530.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
97 </%def>