##// END OF EJS Templates
fixed branches and tags, fetching for new vcs implementation
marcink -
r277:7ec4463b default
parent child Browse files
Show More
@@ -22,7 +22,7 b' Created on April 21, 2010'
22 branches controller for pylons
22 branches controller for pylons
23 @author: marcink
23 @author: marcink
24 """
24 """
25 from pylons import tmpl_context as c, app_globals as g
25 from pylons import tmpl_context as c
26 from pylons_app.lib.auth import LoginRequired
26 from pylons_app.lib.auth import LoginRequired
27 from pylons_app.lib.base import BaseController, render
27 from pylons_app.lib.base import BaseController, render
28 from pylons_app.model.hg_model import HgModel
28 from pylons_app.model.hg_model import HgModel
@@ -39,6 +39,8 b' class BranchesController(BaseController)'
39 def index(self):
39 def index(self):
40 hg_model = HgModel()
40 hg_model = HgModel()
41 c.repo_info = hg_model.get_repo(c.repo_name)
41 c.repo_info = hg_model.get_repo(c.repo_name)
42 c.repo_branches = c.repo_info.branches
42 c.repo_branches = {}
43 for name, hash in c.repo_info.branches.items():
44 c.repo_branches[name] = c.repo_info.get_changeset(hash)
43
45
44 return render('branches/branches.html')
46 return render('branches/branches.html')
@@ -47,6 +47,12 b' class SummaryController(BaseController):'
47 'host':e.get('HTTP_HOST'),
47 'host':e.get('HTTP_HOST'),
48 'repo_name':c.repo_name, }
48 'repo_name':c.repo_name, }
49 c.clone_repo_url = uri
49 c.clone_repo_url = uri
50 c.repo_tags = c.repo_info.tags[:10]
50 c.repo_tags = {}
51 c.repo_branches = c.repo_info.branches[:10]
51 for name, hash in c.repo_info.tags.items()[:10]:
52 c.repo_tags[name] = c.repo_info.get_changeset(hash)
53
54 c.repo_branches = {}
55 for name, hash in c.repo_info.branches.items()[:10]:
56 c.repo_branches[name] = c.repo_info.get_changeset(hash)
57
52 return render('summary/summary.html')
58 return render('summary/summary.html')
@@ -39,6 +39,8 b' class TagsController(BaseController):'
39 def index(self):
39 def index(self):
40 hg_model = HgModel()
40 hg_model = HgModel()
41 c.repo_info = hg_model.get_repo(c.repo_name)
41 c.repo_info = hg_model.get_repo(c.repo_name)
42 c.repo_tags = c.repo_info.tags
42 c.repo_tags = {}
43 for name, hash in c.repo_info.tags.items():
44 c.repo_tags[name] = c.repo_info.get_changeset(hash)
43
45
44 return render('tags/tags.html')
46 return render('tags/tags.html')
@@ -18,18 +18,19 b''
18 <h2 class="no-link no-border">${_('Branches')}</h2>
18 <h2 class="no-link no-border">${_('Branches')}</h2>
19
19
20 <table>
20 <table>
21 %for cnt,branch in enumerate(c.repo_branches):
21 %for cnt,branch in enumerate(c.repo_branches.items()):
22 <tr class="parity${cnt%2}">
22 <tr class="parity${cnt%2}">
23 <td>${branch._ctx.date()|n,filters.age}</td>
23 <td>${branch[1]._ctx.date()|n,filters.age}</td>
24 <td>
24 <td>
25 <span class="logtags">
25 <span class="logtags">
26 <span class="branchtag">${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}</span>
26 <span class="branchtag">${h.link_to(branch[0],
27 h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
27 </span>
28 </span>
28 </td>
29 </td>
29 <td class="nowrap">
30 <td class="nowrap">
30 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}
31 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
31 |
32 |
32 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch._short))}
33 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
33 </td>
34 </td>
34 </tr>
35 </tr>
35 %endfor
36 %endfor
@@ -22,9 +22,9 b' from pylons_app.lib import filters'
22 </span>
22 </span>
23 </td>
23 </td>
24 <td class="nowrap">
24 <td class="nowrap">
25 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs._short))}
25 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
26 |
26 |
27 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs._short))}
27 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
28 </td>
28 </td>
29 </tr>
29 </tr>
30 %endfor
30 %endfor
@@ -93,18 +93,19 b' E.onDOMReady(function(e){'
93
93
94 <h2>${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</h2>
94 <h2>${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</h2>
95 <table>
95 <table>
96 %for cnt,tag in enumerate(c.repo_tags):
96 %for cnt,tag in enumerate(c.repo_tags.items()):
97 <tr class="parity${cnt%2}">
97 <tr class="parity${cnt%2}">
98 <td>${tag._ctx.date()|n,filters.age}</td>
98 <td>${tag[1]._ctx.date()|n,filters.age}</td>
99 <td>
99 <td>
100 <span class="logtags">
100 <span class="logtags">
101 <span class="tagtag">${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}</span>
101 <span class="tagtag">${h.link_to(tag[0],
102 h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span>
102 </span>
103 </span>
103 </td>
104 </td>
104 <td class="nowrap">
105 <td class="nowrap">
105 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}
106 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
106 |
107 |
107 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag._short))}
108 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
108 </td>
109 </td>
109 </tr>
110 </tr>
110 %endfor
111 %endfor
@@ -112,18 +113,19 b' E.onDOMReady(function(e){'
112
113
113 <h2>${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</h2>
114 <h2>${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</h2>
114 <table>
115 <table>
115 %for cnt,branch in enumerate(c.repo_branches):
116 %for cnt,branch in enumerate(c.repo_branches.items()):
116 <tr class="parity${cnt%2}">
117 <tr class="parity${cnt%2}">
117 <td>${branch._ctx.date()|n,filters.age}</td>
118 <td>${branch[1]._ctx.date()|n,filters.age}</td>
118 <td>
119 <td>
119 <span class="logtags">
120 <span class="logtags">
120 <span class="branchtag">${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}</span>
121 <span class="branchtag">${h.link_to(branch[0],
122 h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
121 </span>
123 </span>
122 </td>
124 </td>
123 <td class="nowrap">
125 <td class="nowrap">
124 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))}
126 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
125 |
127 |
126 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch._short))}
128 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
127 </td>
129 </td>
128 </tr>
130 </tr>
129 %endfor
131 %endfor
@@ -18,20 +18,20 b' from pylons_app.lib import filters'
18 <%def name="main()">
18 <%def name="main()">
19
19
20 <h2 class="no-link no-border">${_('Tags')}</h2>
20 <h2 class="no-link no-border">${_('Tags')}</h2>
21
22 <table>
21 <table>
23 %for cnt,tag in enumerate(c.repo_tags):
22 %for cnt,tag in enumerate(c.repo_tags.items()):
24 <tr class="parity${cnt%2}">
23 <tr class="parity${cnt%2}">
25 <td>${tag._ctx.date()|n,filters.age}</td>
24 <td>${tag[1]._ctx.date()|n,filters.age}</td>
26 <td>
25 <td>
27 <span class="logtags">
26 <span class="logtags">
28 <span class="tagtag">${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}</span>
27 <span class="tagtag">${h.link_to(tag[0],
28 h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span>
29 </span>
29 </span>
30 </td>
30 </td>
31 <td class="nowrap">
31 <td class="nowrap">
32 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))}
32 ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
33 |
33 |
34 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag._short))}
34 ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
35 </td>
35 </td>
36 </tr>
36 </tr>
37 %endfor
37 %endfor
General Comments 0
You need to be logged in to leave comments. Login now