Mercurial > kallithea
annotate rhodecode/templates/changeset/changeset.html @ 1856:0855c64c571f beta
css: merge/branch/tag blurbs
author | Aras Pranckevicius <aras@unity3d.com> |
---|---|
date | Fri, 06 Jan 2012 21:55:18 +0200 |
parents | 61f723ae8722 |
children | c577e8211d69 |
rev | line source |
---|---|
1130
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
1 ## -*- coding: utf-8 -*- |
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
2 |
193
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 <%inherit file="/base/base.html"/> |
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 |
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 <%def name="title()"> |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
6 ${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} - ${c.rhodecode_name} |
193
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
8 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
9 <%def name="breadcrumbs_links()"> |
193
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 ${h.link_to(u'Home',h.url('/'))} |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
11 » |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
12 ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
13 » |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
14 ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} |
193
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
15 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
16 |
193
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 <%def name="page_nav()"> |
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 ${self.menu('changelog')} |
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
20 |
193
50a39f923f31
Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 <%def name="main()"> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
22 <div class="box"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
23 <!-- box / title --> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
24 <div class="title"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
25 ${self.breadcrumbs()} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
26 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
332
diff
changeset
|
27 <div class="table"> |
977
28524453bb76
started work on #93 added rev ranges view, checkboxes in changelog to view ranges of changes
Marcin Kuzminski <marcin@python-works.com>
parents:
816
diff
changeset
|
28 <div class="diffblock"> |
468
9dd372c7166c
added menu for changeset raw diff and download diff
Marcin Kuzminski <marcin@python-works.com>
parents:
387
diff
changeset
|
29 <div class="code-header"> |
1851
61f723ae8722
changeset: clean up UI
Aras Pranckevicius <aras@unity3d.com>
parents:
1787
diff
changeset
|
30 <div class="date">${c.changeset.revision}: |
61f723ae8722
changeset: clean up UI
Aras Pranckevicius <aras@unity3d.com>
parents:
1787
diff
changeset
|
31 ${h.link_to(h.short_id(c.changeset.raw_id),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} |
61f723ae8722
changeset: clean up UI
Aras Pranckevicius <aras@unity3d.com>
parents:
1787
diff
changeset
|
32 ${c.changeset.date}</div> |
1776
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
33 <div class="diff-menu-wrapper"> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
34 <img class="diff-menu-activate" style="cursor: pointer" alt="diff-menu" src="${h.url('/images/icons/script_gear.png')}" /> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
35 <div class="diff-menu" style="display:none"> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
36 <ul> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
37 <li>${h.link_to(_('raw diff'),h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</li> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
38 <li>${h.link_to(_('download diff'),h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</li> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
39 <li>${c.ignorews_url()}</li> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
40 <li>${c.context_url()}</li> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
41 </ul> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
42 </div> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
43 </div> |
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
44 <div class="comments-number" style="float:right;padding-right:5px">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> |
468
9dd372c7166c
added menu for changeset raw diff and download diff
Marcin Kuzminski <marcin@python-works.com>
parents:
387
diff
changeset
|
45 </div> |
9dd372c7166c
added menu for changeset raw diff and download diff
Marcin Kuzminski <marcin@python-works.com>
parents:
387
diff
changeset
|
46 </div> |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
47 <div id="changeset_content"> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
48 <div class="container"> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
49 <div class="left"> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
50 <div class="author"> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
51 <div class="gravatar"> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
52 <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
53 </div> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
54 <span>${h.person(c.changeset.author)}</span><br/> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
55 <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
56 </div> |
1851
61f723ae8722
changeset: clean up UI
Aras Pranckevicius <aras@unity3d.com>
parents:
1787
diff
changeset
|
57 <div class="message">${h.wrap_paragraphs(c.changeset.message)}</div> |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
58 </div> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
59 <div class="right"> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
60 <div class="changes"> |
1130
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
61 % if len(c.changeset.affected_files) <= c.affected_files_cut_off: |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
62 <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
63 <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
64 <span class="added" title="${_('added')}">${len(c.changeset.added)}</span> |
1130
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
65 % else: |
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
66 <span class="removed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> |
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
67 <span class="changed" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> |
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
68 <span class="added" title="${_('affected %s files') % len(c.changeset.affected_files)}">!</span> |
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
69 % endif |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
70 </div> |
551
f57aaf673743
fixed initial commit missing parents div,
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
71 |
f57aaf673743
fixed initial commit missing parents div,
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
72 %if c.changeset.parents: |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
73 %for p_cs in reversed(c.changeset.parents): |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
74 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(h.short_id(p_cs.raw_id), |
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
75 h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
76 </div> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
77 %endfor |
551
f57aaf673743
fixed initial commit missing parents div,
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
78 %else: |
f57aaf673743
fixed initial commit missing parents div,
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
79 <div class="parent">${_('No parents')}</div> |
f57aaf673743
fixed initial commit missing parents div,
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
80 %endif |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
81 <span class="logtags"> |
1856
0855c64c571f
css: merge/branch/tag blurbs
Aras Pranckevicius <aras@unity3d.com>
parents:
1851
diff
changeset
|
82 %if len(c.changeset.parents)>1: |
0855c64c571f
css: merge/branch/tag blurbs
Aras Pranckevicius <aras@unity3d.com>
parents:
1851
diff
changeset
|
83 <span class="merge">${_('merge')}</span> |
0855c64c571f
css: merge/branch/tag blurbs
Aras Pranckevicius <aras@unity3d.com>
parents:
1851
diff
changeset
|
84 %endif |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
85 <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}"> |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
86 ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
87 %for tag in c.changeset.tags: |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
88 <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> |
636
ffd07396d315
Fixes for raw_id, needed for git
Marcin Kuzminski <marcin@python-works.com>
parents:
619
diff
changeset
|
89 ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span> |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
90 %endfor |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
91 </span> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
92 </div> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
93 </div> |
1257
0a2a10a1912f
Implemented --stat for changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
1176
diff
changeset
|
94 <span style="font-size:1.1em;font-weight: bold"> |
0a2a10a1912f
Implemented --stat for changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
1176
diff
changeset
|
95 ${_('%s files affected with %s additions and %s deletions.') % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)} |
0a2a10a1912f
Implemented --stat for changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
1176
diff
changeset
|
96 </span> |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
97 <div class="cs_files"> |
1257
0a2a10a1912f
Implemented --stat for changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
1176
diff
changeset
|
98 %for change,filenode,diff,cs1,cs2,stat in c.changes: |
0a2a10a1912f
Implemented --stat for changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
1176
diff
changeset
|
99 <div class="cs_${change}"> |
1687
e21ec97aca1f
fixed issue with new files and removed files with using inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1686
diff
changeset
|
100 <div class="node"> |
e21ec97aca1f
fixed issue with new files and removed files with using inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1686
diff
changeset
|
101 %if change != 'removed': |
1776
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
102 ${h.link_to(h.safe_unicode(filenode.path),c.anchor_url(filenode.changeset.raw_id,filenode.path))} |
1687
e21ec97aca1f
fixed issue with new files and removed files with using inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1686
diff
changeset
|
103 %else: |
1776
22333ddd1a40
implements #307, configurable diffs
Marcin Kuzminski <marcin@python-works.com>
parents:
1775
diff
changeset
|
104 ${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.FID('',filenode.path)))} |
1687
e21ec97aca1f
fixed issue with new files and removed files with using inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1686
diff
changeset
|
105 %endif |
e21ec97aca1f
fixed issue with new files and removed files with using inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1686
diff
changeset
|
106 </div> |
1257
0a2a10a1912f
Implemented --stat for changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
1176
diff
changeset
|
107 <div class="changes">${h.fancy_file_stats(stat)}</div> |
0a2a10a1912f
Implemented --stat for changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
1176
diff
changeset
|
108 </div> |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
109 %endfor |
1130
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
110 % if c.cut_off: |
1472
aaec08ad9daf
Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents:
1257
diff
changeset
|
111 ${_('Changeset was too big and was cut off...')} |
1130
1cecc7db3106
fixed some limits in changesets and changelogs
Marcin Kuzminski <marcin@python-works.com>
parents:
1100
diff
changeset
|
112 % endif |
529
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
113 </div> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
114 </div> |
3a567e329fb6
updated whoosh deps,
Marcin Kuzminski <marcin@python-works.com>
parents:
528
diff
changeset
|
115 |
218
58b46f9194c3
version bump. Made changesets work as should, but vcs had to be fixed for that.
Marcin Kuzminski <marcin@python-works.com>
parents:
193
diff
changeset
|
116 </div> |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
117 |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
118 ## diff block |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
119 <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
120 ${diff_block.diff_block(c.changes)} |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
121 |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
122 ## template for inline comment form |
1670
d2de0c2f02cd
#77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1472
diff
changeset
|
123 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
124 ${comment.comment_inline_form(c.changeset)} |
1670
d2de0c2f02cd
#77 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1472
diff
changeset
|
125 |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
126 ${comment.comments(c.changeset)} |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
127 |
1674
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
128 <script type="text/javascript"> |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
129 var deleteComment = function(comment_id){ |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
130 |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
131 var url = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}".replace('__COMMENT_ID__',comment_id); |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
132 var postData = '_method=delete'; |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
133 var success = function(o){ |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
134 var n = YUD.get('comment-'+comment_id); |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
135 n.parentNode.removeChild(n); |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
136 } |
6f0143e5efe5
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1670
diff
changeset
|
137 ajaxPOST(url,postData,success); |
1677
7276b170ce8b
#71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
138 } |
7276b170ce8b
#71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
139 |
7276b170ce8b
#71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
140 YUE.onDOMReady(function(){ |
1775
fb423ee576e8
changed links with diff options into a pop-up menu. Saves space on long filenames and looks better
Marcin Kuzminski <marcin@python-works.com>
parents:
1772
diff
changeset
|
141 |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
142 YUE.on(YUQ('.diff-menu-activate'),'click',function(e){ |
1775
fb423ee576e8
changed links with diff options into a pop-up menu. Saves space on long filenames and looks better
Marcin Kuzminski <marcin@python-works.com>
parents:
1772
diff
changeset
|
143 var act = e.currentTarget.nextElementSibling; |
fb423ee576e8
changed links with diff options into a pop-up menu. Saves space on long filenames and looks better
Marcin Kuzminski <marcin@python-works.com>
parents:
1772
diff
changeset
|
144 |
fb423ee576e8
changed links with diff options into a pop-up menu. Saves space on long filenames and looks better
Marcin Kuzminski <marcin@python-works.com>
parents:
1772
diff
changeset
|
145 if(YUD.hasClass(act,'active')){ |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
146 YUD.removeClass(act,'active'); |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
147 YUD.setStyle(act,'display','none'); |
1775
fb423ee576e8
changed links with diff options into a pop-up menu. Saves space on long filenames and looks better
Marcin Kuzminski <marcin@python-works.com>
parents:
1772
diff
changeset
|
148 }else{ |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
149 YUD.addClass(act,'active'); |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
150 YUD.setStyle(act,'display',''); |
1775
fb423ee576e8
changed links with diff options into a pop-up menu. Saves space on long filenames and looks better
Marcin Kuzminski <marcin@python-works.com>
parents:
1772
diff
changeset
|
151 } |
fb423ee576e8
changed links with diff options into a pop-up menu. Saves space on long filenames and looks better
Marcin Kuzminski <marcin@python-works.com>
parents:
1772
diff
changeset
|
152 }); |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
153 |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
154 YUE.on(YUQ('.show-inline-comments'),'change',function(e){ |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
155 var show = 'none'; |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
156 var target = e.currentTarget; |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
157 if(target.checked){ |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
158 var show = '' |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
159 } |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
160 var boxid = YUD.getAttribute(target,'id_for'); |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
161 var comments = YUQ('#{0} .inline-comments'.format(boxid)); |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
162 for(c in comments){ |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
163 YUD.setStyle(comments[c],'display',show); |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
164 } |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
165 var btns = YUQ('#{0} .inline-comments-button'.format(boxid)); |
1772
c83d3d42ab92
- diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents:
1705
diff
changeset
|
166 for(c in btns){ |
c83d3d42ab92
- diff.css merge to main style.css
Marcin Kuzminski <marcin@python-works.com>
parents:
1705
diff
changeset
|
167 YUD.setStyle(btns[c],'display',show); |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
168 } |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
169 }) |
1677
7276b170ce8b
#71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
170 |
7276b170ce8b
#71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
171 YUE.on(YUQ('.line'),'click',function(e){ |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
172 var tr = e.currentTarget; |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
173 injectInlineForm(tr); |
1682
1f2ba96de73e
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1681
diff
changeset
|
174 }); |
1f2ba96de73e
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1681
diff
changeset
|
175 |
1f2ba96de73e
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1681
diff
changeset
|
176 // inject comments into they proper positions |
1f2ba96de73e
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1681
diff
changeset
|
177 var file_comments = YUQ('.inline-comment-placeholder'); |
1f2ba96de73e
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1681
diff
changeset
|
178 |
1f2ba96de73e
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1681
diff
changeset
|
179 for (f in file_comments){ |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
180 var box = file_comments[f]; |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
181 var inlines = box.children; |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
182 for(var i=0; i<inlines.length; i++){ |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
183 try{ |
1704
3efc47f59639
inline comment form is displayed now under all comments.
Marcin Kuzminski <marcin@python-works.com>
parents:
1703
diff
changeset
|
184 |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
185 var inline = inlines[i]; |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
186 var lineno = YUD.getAttribute(inlines[i],'line'); |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
187 var lineid = "{0}_{1}".format(YUD.getAttribute(inline,'target_id'),lineno); |
1687
e21ec97aca1f
fixed issue with new files and removed files with using inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1686
diff
changeset
|
188 var target_line = YUD.get(lineid); |
1705
5e4827a8e942
added reply comment button on top of inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1704
diff
changeset
|
189 |
5e4827a8e942
added reply comment button on top of inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1704
diff
changeset
|
190 var add = createInlineAddButton(target_line.parentNode,'${_("add another comment")}'); |
5e4827a8e942
added reply comment button on top of inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1704
diff
changeset
|
191 YUD.insertAfter(add,target_line.parentNode); |
5e4827a8e942
added reply comment button on top of inline comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1704
diff
changeset
|
192 |
1704
3efc47f59639
inline comment form is displayed now under all comments.
Marcin Kuzminski <marcin@python-works.com>
parents:
1703
diff
changeset
|
193 var comment = new YAHOO.util.Element(tableTr('inline-comments',inline.innerHTML)) |
3efc47f59639
inline comment form is displayed now under all comments.
Marcin Kuzminski <marcin@python-works.com>
parents:
1703
diff
changeset
|
194 YUD.insertAfter(comment,target_line.parentNode); |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
195 }catch(e){ |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
196 console.log(e); |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
197 } |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
198 } |
1682
1f2ba96de73e
#71 code review
Marcin Kuzminski <marcin@python-works.com>
parents:
1681
diff
changeset
|
199 } |
1677
7276b170ce8b
#71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
200 }) |
7276b170ce8b
#71 code-review
Marcin Kuzminski <marcin@python-works.com>
parents:
1676
diff
changeset
|
201 |
1787
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
202 </script> |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
203 |
d4a7b6c82efe
code garden for changeset ranges and comments
Marcin Kuzminski <marcin@python-works.com>
parents:
1776
diff
changeset
|
204 </div> |
1472
aaec08ad9daf
Added pt_BR localization, added i18n wrappers on some places missing, fixed css in settings screen for longer labels.
Augusto Herrmann <augusto.herrmann@planejamento.gov.br>
parents:
1257
diff
changeset
|
205 </%def> |