##// 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 22 branches controller for pylons
23 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 26 from pylons_app.lib.auth import LoginRequired
27 27 from pylons_app.lib.base import BaseController, render
28 28 from pylons_app.model.hg_model import HgModel
@@ -39,6 +39,8 b' class BranchesController(BaseController)'
39 39 def index(self):
40 40 hg_model = HgModel()
41 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 46 return render('branches/branches.html')
@@ -47,6 +47,12 b' class SummaryController(BaseController):'
47 47 'host':e.get('HTTP_HOST'),
48 48 'repo_name':c.repo_name, }
49 49 c.clone_repo_url = uri
50 c.repo_tags = c.repo_info.tags[:10]
51 c.repo_branches = c.repo_info.branches[:10]
50 c.repo_tags = {}
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 58 return render('summary/summary.html')
@@ -39,6 +39,8 b' class TagsController(BaseController):'
39 39 def index(self):
40 40 hg_model = HgModel()
41 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 46 return render('tags/tags.html')
@@ -18,18 +18,19 b''
18 18 <h2 class="no-link no-border">${_('Branches')}</h2>
19 19
20 20 <table>
21 %for cnt,branch in enumerate(c.repo_branches):
21 %for cnt,branch in enumerate(c.repo_branches.items()):
22 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 24 <td>
25 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 28 </span>
28 29 </td>
29 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 34 </td>
34 35 </tr>
35 36 %endfor
@@ -22,9 +22,9 b' from pylons_app.lib import filters'
22 22 </span>
23 23 </td>
24 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 28 </td>
29 29 </tr>
30 30 %endfor
@@ -93,18 +93,19 b' E.onDOMReady(function(e){'
93 93
94 94 <h2>${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</h2>
95 95 <table>
96 %for cnt,tag in enumerate(c.repo_tags):
96 %for cnt,tag in enumerate(c.repo_tags.items()):
97 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 99 <td>
100 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 103 </span>
103 104 </td>
104 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 109 </td>
109 110 </tr>
110 111 %endfor
@@ -112,18 +113,19 b' E.onDOMReady(function(e){'
112 113
113 114 <h2>${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</h2>
114 115 <table>
115 %for cnt,branch in enumerate(c.repo_branches):
116 %for cnt,branch in enumerate(c.repo_branches.items()):
116 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 119 <td>
119 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 123 </span>
122 124 </td>
123 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 129 </td>
128 130 </tr>
129 131 %endfor
@@ -18,20 +18,20 b' from pylons_app.lib import filters'
18 18 <%def name="main()">
19 19
20 20 <h2 class="no-link no-border">${_('Tags')}</h2>
21
22 21 <table>
23 %for cnt,tag in enumerate(c.repo_tags):
22 %for cnt,tag in enumerate(c.repo_tags.items()):
24 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 25 <td>
27 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 29 </span>
30 30 </td>
31 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 35 </td>
36 36 </tr>
37 37 %endfor
General Comments 0
You need to be logged in to leave comments. Login now