Mercurial > kallithea
annotate rhodecode/templates/changeset/diff_block.html @ 1787:d4a7b6c82efe beta
code garden for changeset ranges and comments
- disabled (for now) comments on changeset ranges
- code reuse by mako namespaces
- added flag for enabling comments in diffs
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 18 Dec 2011 04:24:53 +0200 |
parents | |
children | 17caf4efe15c |
rev | line source |
---|---|
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 ## -*- coding: utf-8 -*- |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 ##usage: |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 ## <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 ## ${diff_block.diff_block(changes)} |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 ## |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
6 <%def name="diff_block(changes)"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
8 %for change,filenode,diff,cs1,cs2,stat in changes: |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
9 %if change !='removed': |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 <div id="${h.FID(filenode.changeset.raw_id,filenode.path)}" style="clear:both;height:90px;margin-top:-60px"></div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
11 <div class="diffblock margined comm"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 <div class="code-header"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
13 <div class="changeset_header"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
14 <div class="changeset_file"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
15 ${h.link_to_if(change!='removed',h.safe_unicode(filenode.path),h.url('files_home',repo_name=c.repo_name, |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))} |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 </div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 <div class="diff-menu-wrapper"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 <img class="diff-menu-activate" style="margin-bottom:-6px;cursor: pointer" alt="diff-menu" src="${h.url('/images/icons/script_gear.png')}" /> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
20 <div class="diff-menu" style="display:none"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 <ul> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
22 <li>${h.link_to(_('diff'),h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))}</li> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 <li>${h.link_to(_('raw diff'),h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))}</li> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
24 <li>${h.link_to(_('download diff'),h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))}</li> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 <li>${c.ignorews_url(h.FID(filenode.changeset.raw_id,filenode.path))}</li> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 <li>${c.context_url(h.FID(filenode.changeset.raw_id,filenode.path))}</li> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
27 </ul> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
28 </div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
29 </div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
30 <span style="float:right;margin-top:-3px"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
31 <label> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
32 ${_('show inline comments')} |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
33 ${h.checkbox('',checked="checked",class_="show-inline-comments",id_for=h.FID(filenode.changeset.raw_id,filenode.path))} |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
34 </label> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
35 </span> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
36 </div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
37 </div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
38 <div class="code-body"> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
39 <div class="full_f_path" path="${h.safe_unicode(filenode.path)}"></div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
40 %if diff: |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
41 ${diff|n} |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
42 %else: |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
43 ${_('No changes in this file')} |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
44 %endif |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
45 </div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
46 </div> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
47 %endif |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
48 %endfor |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
49 |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
50 </%def> |