Show More
@@ -0,0 +1,57 b'' | |||
|
1 | <%def name="file_class(node)"> | |
|
2 | %if node.is_file(): | |
|
3 | <%return "browser-file" %> | |
|
4 | %else: | |
|
5 | <%return "browser-dir"%> | |
|
6 | %endif | |
|
7 | </%def> | |
|
8 | ||
|
9 | <table class="code-browser"> | |
|
10 | <thead> | |
|
11 | <tr> | |
|
12 | <th class="width-50 lefted">${_('Name')}</th> | |
|
13 | <th class="width-10 righted">${_('Size')}</th> | |
|
14 | <th class="width-10 righted">${_('Revision')}</th> | |
|
15 | <th class="width-15 righted">${_('Last modified')}</th> | |
|
16 | <th class="width-15 righted">${_('Last commiter')}</th> | |
|
17 | </tr> | |
|
18 | </thead> | |
|
19 | <tr> | |
|
20 | % if c.files_list.parent: | |
|
21 | <td> | |
|
22 | ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.files_list.parent),class_="browser-dir")} | |
|
23 | </td> | |
|
24 | <td></td> | |
|
25 | <td></td> | |
|
26 | <td></td> | |
|
27 | <td></td> | |
|
28 | %endif | |
|
29 | </tr> | |
|
30 | %for cnt,node in enumerate(c.files_list): | |
|
31 | <tr class="parity${cnt%2}"> | |
|
32 | <td> | |
|
33 | ${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=node.path),class_=file_class(node))} | |
|
34 | </td> | |
|
35 | <td> | |
|
36 | %if node.is_file(): | |
|
37 | ${h.filesizeformat(node.size)} | |
|
38 | %endif | |
|
39 | </td> | |
|
40 | <td> | |
|
41 | %if node.is_file(): | |
|
42 | ${node.last_changeset.revision} | |
|
43 | %endif | |
|
44 | </td> | |
|
45 | <td> | |
|
46 | %if node.is_file(): | |
|
47 | ${node.last_changeset.date} | |
|
48 | %endif | |
|
49 | </td> | |
|
50 | <td> | |
|
51 | %if node.is_file(): | |
|
52 | ${node.last_changeset.author} | |
|
53 | %endif | |
|
54 | </td> | |
|
55 | </tr> | |
|
56 | %endfor | |
|
57 | </table> No newline at end of file |
@@ -0,0 +1,20 b'' | |||
|
1 | <dl class="overview"> | |
|
2 | <dt>${_('Revision')}</dt> | |
|
3 | <dd>r${c.files_list.changeset.revision}:${c.files_list.changeset._short}</dd> | |
|
4 | <dt>${_('Size')}</dt> | |
|
5 | <dd>${h.filesizeformat(c.files_list.size)}</dd> | |
|
6 | <dt>${_('Options')}</dt> | |
|
7 | <dd>history / annotate / raw </dd> | |
|
8 | <dt>${_('History')}</dt> | |
|
9 | <dd> | |
|
10 | ${h.form(h.url.current())} | |
|
11 | ${h.hidden('diff2',c.files_list.changeset._short)} | |
|
12 | ${h.select('diff1','',c.file_history)} | |
|
13 | ${h.submit('diff','diff')} | |
|
14 | ${h.end_form()} | |
|
15 | </dd> | |
|
16 | ||
|
17 | </dl> | |
|
18 | <div id="body" class="codeblock"> | |
|
19 | ${h.pygmentize(c.files_list.content,linenos=True,anchorlinenos=True,cssclass="code-highlight")} | |
|
20 | </div> No newline at end of file |
@@ -22,4 +22,18 b' class FilesController(BaseController):' | |||
|
22 | 22 | |
|
23 | 23 | c.files_list = c.changeset.get_node(f_path) |
|
24 | 24 | |
|
25 | return render('/files.html') | |
|
25 | c.file_history = self._get_history(repo, c.files_list, f_path) | |
|
26 | return render('files/files.html') | |
|
27 | ||
|
28 | ||
|
29 | def _get_history(self, repo, node, f_path): | |
|
30 | from vcs.nodes import NodeKind | |
|
31 | if not node.kind is NodeKind.FILE: | |
|
32 | return [] | |
|
33 | changesets = list(node.history) | |
|
34 | changesets.reverse() | |
|
35 | hist_l = [] | |
|
36 | for chs in changesets: | |
|
37 | n_desc = 'r%s:%s' % (chs.revision, chs._short) | |
|
38 | hist_l.append((chs._short, n_desc,)) | |
|
39 | return hist_l |
@@ -1,4 +1,4 b'' | |||
|
1 | <%inherit file="base/base.html"/> | |
|
1 | <%inherit file="/base/base.html"/> | |
|
2 | 2 | |
|
3 | 3 | <%def name="title()"> |
|
4 | 4 | ${_('Repository managment')} |
@@ -28,93 +28,11 b'' | |||
|
28 | 28 | |
|
29 | 29 | <h2 class="no-link no-border">${_('Files')}</h2> |
|
30 | 30 | <div id="files_data"> |
|
31 |
<h2>${_(' |
|
|
32 | %if c.files_list.is_dir(): | |
|
33 | <table class="code-browser"> | |
|
34 | <thead> | |
|
35 | <tr> | |
|
36 | <th class="width-50 lefted">${_('Name')}</th> | |
|
37 | <th class="width-10 righted">${_('Size')}</th> | |
|
38 | <th class="width-10 righted">${_('Revision')}</th> | |
|
39 | <th class="width-15 righted">${_('Last modified')}</th> | |
|
40 | <th class="width-15 righted">${_('Last commiter')}</th> | |
|
41 | </tr> | |
|
42 | </thead> | |
|
43 | <tr> | |
|
44 | % if c.files_list.parent: | |
|
45 | <td> | |
|
46 | ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.files_list.parent),class_="browser-dir")} | |
|
47 | </td> | |
|
48 | <td></td> | |
|
49 | <td></td> | |
|
50 | <td></td> | |
|
51 | <td></td> | |
|
52 | %endif | |
|
53 | </tr> | |
|
54 | <%def name="file_class(node)"> | |
|
55 | %if node.is_file(): | |
|
56 | <%return "browser-file" %> | |
|
57 | %else: | |
|
58 | <%return "browser-dir"%> | |
|
59 | %endif | |
|
60 | </%def> | |
|
61 | ||
|
62 | ||
|
63 | %for cnt,node in enumerate(c.files_list): | |
|
64 | <tr class="parity${cnt%2}"> | |
|
65 | ||
|
66 | <td> | |
|
67 | ${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=node.path),class_=file_class(node))} | |
|
68 | </td> | |
|
69 | <td> | |
|
70 | %if node.is_file(): | |
|
71 | ${h.filesizeformat(node.size)} | |
|
72 | %endif | |
|
73 | </td> | |
|
74 | <td> | |
|
75 | %if node.is_file(): | |
|
76 | ${node.last_changeset.revision} | |
|
77 | %endif | |
|
78 | </td> | |
|
79 | <td> | |
|
80 | %if node.is_file(): | |
|
81 | ${node.last_changeset.date} | |
|
82 | %endif | |
|
83 | </td> | |
|
84 | <td> | |
|
85 | %if node.is_file(): | |
|
86 | ${node.last_changeset.author} | |
|
87 | %endif | |
|
88 | ||
|
89 | </td> | |
|
90 | </tr> | |
|
91 | %endfor | |
|
92 | </table> | |
|
31 | <h2>${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.files_list.path)}</h2> | |
|
32 | %if c.files_list.is_dir(): | |
|
33 | <%include file='files_browser.html'/> | |
|
93 | 34 | %else: |
|
94 | <table class="info-table"> | |
|
95 | <tr> | |
|
96 | <td>r70:17ecc1c97401</td> | |
|
97 | <td>374 loc</td> | |
|
98 | <td>12.5 KB</td> | |
|
99 | <td> | |
|
100 | <a href="/marcinkuzminski/vcs/history/vcs/backends/hg.py">history</a> / | |
|
101 | <a href="/marcinkuzminski/vcs/annotate/17ecc1c97401/vcs/backends/hg.py">annotate</a> / | |
|
102 | <a href="/marcinkuzminski/vcs/raw/17ecc1c97401/vcs/backends/hg.py">raw</a> / | |
|
103 | <form class="source-view-form" method="get" action="/marcinkuzminski/vcs/diff/vcs/backends/hg.py"> | |
|
104 | ||
|
105 | <input type="hidden" value="17ecc1c97401" name="diff2"> | |
|
106 | <select class="smaller" name="diff1"> | |
|
107 | <option>history</option> | |
|
108 | </select> | |
|
109 | <input type="submit" class="smaller" value="diff"> | |
|
110 | ||
|
111 | </form> | |
|
112 | </td> | |
|
113 | </tr> | |
|
114 | </table> | |
|
115 | <div id="body" class="codeblock"> | |
|
116 | ${h.pygmentize(c.files_list.content,linenos=True,anchorlinenos=True,cssclass="code-highlight")} | |
|
117 | </div> | |
|
35 | <%include file='files_source.html'/> | |
|
118 | 36 | %endif |
|
119 | 37 | </div> |
|
120 | 38 | </%def> No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now