Mercurial > kallithea
annotate rhodecode/templates/compare/compare_diff.html @ 4178:9dd726706178 kallithea-2.2.5-rebrand
Complete copyright notices for web interface; change footer to link to them.
The original copyright notice found in the footer was not accurate as it
included only one of the many copyright holders in this project. This change
creates an "about" page, which currently contains just the copyright and
license information. It links to repository for additional potential copyright
holders not listed on the about page.
Unlisted contributors are mentioned in template comments.
Html links for Kallithea is fixed and we link to Conservancy.
Display of version information in the footer is improved.
author | Bradley M. Kuhn <bkuhn@sfconservancy.org> |
---|---|
date | Wed, 21 May 2014 13:35:27 -0400 |
parents | 8d1125a40973 |
children |
rev | line source |
---|---|
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
1 ## -*- coding: utf-8 -*- |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 <%inherit file="/base/base.html"/> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 <%def name="title()"> |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
5 %if c.compare_home: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
6 ${_('%s Compare') % c.repo_name} |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
7 %else: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
8 ${_('%s Compare') % c.repo_name} - ${'%s@%s' % (c.org_repo.repo_name, c.org_ref)} > ${'%s@%s' % (c.other_repo.repo_name, c.other_ref)} |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
9 %endif |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
10 %if c.rhodecode_name: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
11 · ${c.rhodecode_name} |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
12 %endif |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
13 </%def> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
14 |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
15 <%def name="breadcrumbs_links()"> |
3602
bb1eecda3172
clean-up of breadcrumbs on pages with repo context bar
Mads Kiilerich <madski@unity3d.com>
parents:
3601
diff
changeset
|
16 ${_('Compare revisions')} |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 </%def> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 <%def name="page_nav()"> |
3603
eacd33e0c5b3
use valid options for the top menu: repositories, journal, search and admin
Mads Kiilerich <madski@unity3d.com>
parents:
3602
diff
changeset
|
20 ${self.menu('repositories')} |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 </%def> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
22 |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 <%def name="main()"> |
3988
072a37c44f58
templates: drop context_bar, use repo_context_bar directly
Mads Kiilerich <madski@unity3d.com>
parents:
3985
diff
changeset
|
24 ${self.repo_context_bar('changelog')} |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 <div class="box"> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 <!-- box / title --> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
27 <div class="title"> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
28 ${self.breadcrumbs()} |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
29 </div> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
30 <div class="table"> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
31 <div id="body" class="diffblock"> |
4152
8d1125a40973
old style: make compare header expand to content
Mads Kiilerich <madski@unity3d.com>
parents:
4116
diff
changeset
|
32 <div class="code-header"> |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
33 <div> |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
34 ${h.hidden('compare_org')} <i class="icon-ellipsis-horizontal" style="color: #999; vertical-align: -12px; padding: 0px 0px 0px 2px"></i> ${h.hidden('compare_other')} |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
35 %if not c.compare_home: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
36 <a class="btn btn-small" href="${c.swap_url}"><i class="icon-refresh"></i> ${_('Swap')}</a> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
37 %endif |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
38 <div id="compare_revs" class="btn btn-small"><i class="icon-loop"></i> ${_('Compare Revisions')}</div> |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
39 </div> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
40 </div> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
41 </div> |
2395
b262e349a7a5
created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents:
2393
diff
changeset
|
42 |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
43 %if c.compare_home: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
44 <div id="changeset_compare_view_content"> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
45 <div style="color:#999;font-size: 18px">${_('Compare revisions, branches, bookmarks or tags.')}</div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
46 </div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
47 %else: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
48 <div id="changeset_compare_view_content"> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
49 ##CS |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
50 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)}</div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
51 <%include file="compare_cs.html" /> |
3029
685ebc84c2e9
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3015
diff
changeset
|
52 |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
53 ## FILES |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
54 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
55 |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
56 % if c.limited_diff: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
57 ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
58 % else: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
59 ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
60 %endif |
3029
685ebc84c2e9
White space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3015
diff
changeset
|
61 |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
62 </div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
63 <div class="cs_files"> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
64 %if not c.files: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
65 <span class="empty_data">${_('No files')}</span> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
66 %endif |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
67 %for fid, change, f, stat in c.files: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
68 <div class="cs_${change}"> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
69 <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid, **request.GET.mixed()))}</div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
70 <div class="changes">${h.fancy_file_stats(stat)}</div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
71 </div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
72 %endfor |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
73 </div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
74 % if c.limited_diff: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
75 <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff')}</a></h5> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
76 % endif |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
77 </div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
78 |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
79 ## diff block |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
80 <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
81 %for fid, change, f, stat in c.files: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
82 ${diff_block.diff_block_simple([c.changes[fid]])} |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
83 %endfor |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
84 % if c.limited_diff: |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
85 <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff')}</a></h4> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
86 % endif |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
87 %endif |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
88 </div> |
2434
f29469677319
Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents:
2395
diff
changeset
|
89 |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
90 </div> |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
91 <script type="text/javascript"> |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
92 |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
93 $(document).ready(function(){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
94 var cache = {} |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
95 $("#compare_org").select2({ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
96 placeholder: "${'%s@%s' % (c.org_repo.repo_name, c.org_ref)}", |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
97 formatSelection: function(obj){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
98 return '{0}@{1}'.format("${c.org_repo.repo_name}", obj.text) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
99 }, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
100 dropdownAutoWidth: true, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
101 query: function(query){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
102 var key = 'cache'; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
103 var cached = cache[key] ; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
104 if(cached) { |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
105 var data = {results: []}; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
106 //filter results |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
107 $.each(cached.results, function(){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
108 var section = this.text; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
109 var children = []; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
110 $.each(this.children, function(){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
111 if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
112 children.push({'id': this.id, 'text': this.text}) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
113 } |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
114 }) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
115 data.results.push({'text': section, 'children': children}) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
116 }); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
117 //push the typed in changeset |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
118 data.results.push({'text':_TM['specify changeset'], |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
119 'children': [{'id': query.term, 'text': query.term, 'type': 'rev'}]}) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
120 query.callback(data); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
121 }else{ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
122 $.ajax({ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
123 url: pyroutes.url('repo_refs_data', {'repo_name': '${c.org_repo.repo_name}'}), |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
124 data: {}, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
125 dataType: 'json', |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
126 type: 'GET', |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
127 success: function(data) { |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
128 cache[key] = data; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
129 query.callback({results: data.results}); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
130 } |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
131 }) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
132 } |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
133 }, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
134 }); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
135 $("#compare_other").select2({ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
136 placeholder: "${'%s@%s' % (c.other_repo.repo_name, c.other_ref)}", |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
137 dropdownAutoWidth: true, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
138 formatSelection: function(obj){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
139 return '{0}@{1}'.format("${c.other_repo.repo_name}", obj.text) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
140 }, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
141 query: function(query){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
142 var key = 'cache2'; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
143 var cached = cache[key] ; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
144 if(cached) { |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
145 var data = {results: []}; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
146 //filter results |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
147 $.each(cached.results, function(){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
148 var section = this.text; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
149 var children = []; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
150 $.each(this.children, function(){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
151 if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
152 children.push({'id': this.id, 'text': this.text}) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
153 } |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
154 }) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
155 data.results.push({'text': section, 'children': children}) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
156 }); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
157 //push the typed in changeset |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
158 data.results.push({'text':_TM['specify changeset'], |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
159 'children': [{'id': query.term, 'text': query.term, 'type': 'rev'}]}) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
160 query.callback(data); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
161 }else{ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
162 $.ajax({ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
163 url: pyroutes.url('repo_refs_data', {'repo_name': '${c.other_repo.repo_name}'}), |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
164 data: {}, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
165 dataType: 'json', |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
166 type: 'GET', |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
167 success: function(data) { |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
168 cache[key] = data; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
169 query.callback({results: data.results}); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
170 } |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
171 }) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
172 } |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
173 }, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
174 }); |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
175 |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
176 $('#compare_revs').on('click', function(e){ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
177 var org = $('#compare_org').select2('data'); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
178 var other = $('#compare_other').select2('data'); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
179 |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
180 var compare_url = "${h.url('compare_url',repo_name=c.repo_name,org_ref_type='__other_ref_type__',org_ref='__org__',other_ref_type='__org_ref_type__',other_ref='__other__', other_repo=c.other_repo.repo_name)}"; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
181 var u = compare_url.replace('__other_ref_type__',org.type) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
182 .replace('__org__',org.text) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
183 .replace('__org_ref_type__',other.type) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
184 .replace('__other__',other.text); |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
185 window.location=u; |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
186 }) |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3988
diff
changeset
|
187 }); |
2337
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
188 </script> |
f8c953c6b040
Created base for diffing two repositories inside rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
189 </%def> |