##// END OF EJS Templates
added mimetypes to files
marcink -
r495:15f837c6 celery
parent child Browse files
Show More
@@ -1,71 +1,77 b''
1 <%def name="file_class(node)">
1 <%def name="file_class(node)">
2 %if node.is_file():
2 %if node.is_file():
3 <%return "browser-file" %>
3 <%return "browser-file" %>
4 %else:
4 %else:
5 <%return "browser-dir"%>
5 <%return "browser-dir"%>
6 %endif
6 %endif
7 </%def>
7 </%def>
8 <div id="body" class="browserblock">
8 <div id="body" class="browserblock">
9 <div class="browser-header">
9 <div class="browser-header">
10 ${h.form(h.url.current())}
10 ${h.form(h.url.current())}
11 <div class="info_box">
11 <div class="info_box">
12 <span >${_('view')}@rev</span>
12 <span >${_('view')}@rev</span>
13 <a href="${c.url_prev}">&laquo;</a>
13 <a href="${c.url_prev}">&laquo;</a>
14 ${h.text('at_rev',value=c.rev_nr,size=3)}
14 ${h.text('at_rev',value=c.rev_nr,size=3)}
15 <a href="${c.url_next}">&raquo;</a>
15 <a href="${c.url_next}">&raquo;</a>
16 ${h.submit('view','view')}
16 ${h.submit('view','view')}
17 </div>
17 </div>
18 ${h.end_form()}
18 ${h.end_form()}
19 </div>
19 </div>
20 <div class="browser-body">
20 <div class="browser-body">
21 <table class="code-browser">
21 <table class="code-browser">
22 <thead>
22 <thead>
23 <tr>
23 <tr>
24 <th>${_('Name')}</th>
24 <th>${_('Name')}</th>
25 <th>${_('Size')}</th>
25 <th>${_('Size')}</th>
26 <th>${_('Mimetype')}</th>
26 <th>${_('Revision')}</th>
27 <th>${_('Revision')}</th>
27 <th>${_('Last modified')}</th>
28 <th>${_('Last modified')}</th>
28 <th>${_('Last commiter')}</th>
29 <th>${_('Last commiter')}</th>
29 </tr>
30 </tr>
30 </thead>
31 </thead>
31 <tr class="parity0">
32 <tr class="parity0">
32 <td>
33 <td>
33 % if c.files_list.parent:
34 % if c.files_list.parent:
34 ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.files_list.parent.path),class_="browser-dir")}
35 ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.files_list.parent.path),class_="browser-dir")}
35 %endif
36 %endif
36 </td>
37 </td>
37 <td></td>
38 <td></td>
38 <td></td>
39 <td></td>
39 <td></td>
40 <td></td>
40 <td></td>
41 <td></td>
41 </tr>
42 </tr>
42 %for cnt,node in enumerate(c.files_list,1):
43 %for cnt,node in enumerate(c.files_list,1):
43 <tr class="parity${cnt%2}">
44 <tr class="parity${cnt%2}">
44 <td>
45 <td>
45 ${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))}
46 ${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))}
46 </td>
47 </td>
47 <td>
48 <td>
48 %if node.is_file():
49 %if node.is_file():
49 ${h.format_byte_size(node.size,binary=True)}
50 ${h.format_byte_size(node.size,binary=True)}
50 %endif
51 %endif
51 </td>
52 </td>
52 <td>
53 <td>
54 %if node.is_file():
55 ${node.mimetype}
56 %endif
57 </td>
58 <td>
53 %if node.is_file():
59 %if node.is_file():
54 ${node.last_changeset.revision}
60 ${node.last_changeset.revision}
55 %endif
61 %endif
56 </td>
62 </td>
57 <td>
63 <td>
58 %if node.is_file():
64 %if node.is_file():
59 ${h.age(node.last_changeset._ctx.date())} - ${node.last_changeset.date}
65 ${h.age(node.last_changeset._ctx.date())} - ${node.last_changeset.date}
60 %endif
66 %endif
61 </td>
67 </td>
62 <td>
68 <td>
63 %if node.is_file():
69 %if node.is_file():
64 ${node.last_changeset.author}
70 ${node.last_changeset.author}
65 %endif
71 %endif
66 </td>
72 </td>
67 </tr>
73 </tr>
68 %endfor
74 %endfor
69 </table>
75 </table>
70 </div>
76 </div>
71 </div> No newline at end of file
77 </div>
@@ -1,55 +1,57 b''
1 <dl>
1 <dl>
2 <dt>${_('Last revision')}</dt>
2 <dt>${_('Last revision')}</dt>
3 <dd>
3 <dd>
4 ${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset._short),
4 ${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset._short),
5 h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset._short,f_path=c.f_path))}
5 h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset._short,f_path=c.f_path))}
6 </dd>
6 </dd>
7 <dt>${_('Size')}</dt>
7 <dt>${_('Size')}</dt>
8 <dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd>
8 <dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd>
9 <dt>${_('Mimetype')}</dt>
10 <dd>${c.files_list.mimetype}</dd>
9 <dt>${_('Options')}</dt>
11 <dt>${_('Options')}</dt>
10 <dd>${h.link_to(_('show annotation'),
12 <dd>${h.link_to(_('show annotation'),
11 h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
13 h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
12 / ${h.link_to(_('show as raw'),
14 / ${h.link_to(_('show as raw'),
13 h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
15 h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
14 / ${h.link_to(_('download as raw'),
16 / ${h.link_to(_('download as raw'),
15 h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
17 h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
16 </dd>
18 </dd>
17 <dt>${_('History')}</dt>
19 <dt>${_('History')}</dt>
18 <dd>
20 <dd>
19 <div>
21 <div>
20 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
22 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
21 ${h.hidden('diff2',c.files_list.last_changeset._short)}
23 ${h.hidden('diff2',c.files_list.last_changeset._short)}
22 ${h.select('diff1',c.files_list.last_changeset._short,c.file_history)}
24 ${h.select('diff1',c.files_list.last_changeset._short,c.file_history)}
23 ${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
25 ${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
24 ${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
26 ${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
25 ${h.end_form()}
27 ${h.end_form()}
26 </div>
28 </div>
27 </dd>
29 </dd>
28 </dl>
30 </dl>
29
31
30
32
31 <div id="body" class="codeblock">
33 <div id="body" class="codeblock">
32 <div class="code-header">
34 <div class="code-header">
33 <div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</div>
35 <div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</div>
34 <div class="commit">"${c.files_list.last_changeset.message}"</div>
36 <div class="commit">"${c.files_list.last_changeset.message}"</div>
35 </div>
37 </div>
36 <div class="code-body">
38 <div class="code-body">
37 % if c.files_list.size < c.file_size_limit:
39 % if c.files_list.size < c.file_size_limit:
38 ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")}
40 ${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")}
39 %else:
41 %else:
40 ${_('File is to big to display')} ${h.link_to(_('show as raw'),
42 ${_('File is to big to display')} ${h.link_to(_('show as raw'),
41 h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
43 h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
42 %endif
44 %endif
43 </div>
45 </div>
44 </div>
46 </div>
45
47
46 <script type="text/javascript">
48 <script type="text/javascript">
47 YAHOO.util.Event.onDOMReady(function(){
49 YAHOO.util.Event.onDOMReady(function(){
48 YAHOO.util.Event.addListener('show_rev','click',function(e){
50 YAHOO.util.Event.addListener('show_rev','click',function(e){
49 YAHOO.util.Event.preventDefault(e);
51 YAHOO.util.Event.preventDefault(e);
50 var cs = YAHOO.util.Dom.get('diff1').value;
52 var cs = YAHOO.util.Dom.get('diff1').value;
51 var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs);
53 var url = "${h.url('files_home',repo_name=c.repo_name,revision='__CS__',f_path=c.f_path)}".replace('__CS__',cs);
52 window.location = url;
54 window.location = url;
53 });
55 });
54 });
56 });
55 </script> No newline at end of file
57 </script>
General Comments 0
You need to be logged in to leave comments. Login now