##// END OF EJS Templates
files: Include the repository groups when computing files url, fixes #4104.
Martin Bornhold -
r458:d58b1643 default
parent child Browse files
Show More
@@ -236,7 +236,7 b' class SummaryController(BaseRepoControll'
236 236 (_("Tag"), repo.tags, 'tag'),
237 237 (_("Bookmark"), repo.bookmarks, 'book'),
238 238 ]
239 res = self._create_reference_data(repo, refs_to_create)
239 res = self._create_reference_data(repo, repo_name, refs_to_create)
240 240 data = {
241 241 'more': False,
242 242 'results': res
@@ -253,14 +253,14 b' class SummaryController(BaseRepoControll'
253 253 # TODO: enable when vcs can handle bookmarks filters
254 254 # (_("Bookmarks"), repo.bookmarks, "book"),
255 255 ]
256 res = self._create_reference_data(repo, refs_to_create)
256 res = self._create_reference_data(repo, repo_name, refs_to_create)
257 257 data = {
258 258 'more': False,
259 259 'results': res
260 260 }
261 261 return data
262 262
263 def _create_reference_data(self, repo, refs_to_create):
263 def _create_reference_data(self, repo, full_repo_name, refs_to_create):
264 264 format_ref_id = utils.get_format_ref_id(repo)
265 265
266 266 result = []
@@ -269,28 +269,32 b' class SummaryController(BaseRepoControll'
269 269 result.append({
270 270 'text': title,
271 271 'children': self._create_reference_items(
272 repo, refs, ref_type, format_ref_id),
272 repo, full_repo_name, refs, ref_type, format_ref_id),
273 273 })
274 274 return result
275 275
276 def _create_reference_items(self, repo, refs, ref_type, format_ref_id):
276 def _create_reference_items(self, repo, full_repo_name, refs, ref_type,
277 format_ref_id):
277 278 result = []
278 279 is_svn = h.is_svn(repo)
279 for name, raw_id in refs.iteritems():
280 for ref_name, raw_id in refs.iteritems():
281 files_url = self._create_files_url(
282 repo, full_repo_name, ref_name, raw_id, is_svn)
280 283 result.append({
281 'text': name,
282 'id': format_ref_id(name, raw_id),
284 'text': ref_name,
285 'id': format_ref_id(ref_name, raw_id),
283 286 'raw_id': raw_id,
284 287 'type': ref_type,
285 'files_url': self._create_files_url(repo, name, raw_id, is_svn)
288 'files_url': files_url,
286 289 })
287 290 return result
288 291
289 def _create_files_url(self, repo, name, raw_id, is_svn):
290 use_commit_id = '/' in name or is_svn
292 def _create_files_url(self, repo, full_repo_name, ref_name, raw_id,
293 is_svn):
294 use_commit_id = '/' in ref_name or is_svn
291 295 return h.url(
292 296 'files_home',
293 repo_name=repo.name,
294 f_path=name if is_svn else '',
295 revision=raw_id if use_commit_id else name,
296 at=name)
297 repo_name=full_repo_name,
298 f_path=ref_name if is_svn else '',
299 revision=raw_id if use_commit_id else ref_name,
300 at=ref_name)
General Comments 0
You need to be logged in to leave comments. Login now