##// END OF EJS Templates
user-bookmarks: add ${server_url} template to be used in the links.
dan -
r3526:0c9e5d56 default
parent child Browse files
Show More
@@ -496,6 +496,7 b' class MyAccountView(BaseAppView, DataGri'
496 if not user_bookmark:
496 if not user_bookmark:
497 raise HTTPFound(redirect_url)
497 raise HTTPFound(redirect_url)
498
498
499 # repository set
499 if user_bookmark.repository:
500 if user_bookmark.repository:
500 repo_name = user_bookmark.repository.repo_name
501 repo_name = user_bookmark.repository.repo_name
501 base_redirect_url = h.route_path(
502 base_redirect_url = h.route_path(
@@ -506,7 +507,7 b' class MyAccountView(BaseAppView, DataGri'
506 .safe_substitute({'repo_url': base_redirect_url})
507 .safe_substitute({'repo_url': base_redirect_url})
507 else:
508 else:
508 redirect_url = base_redirect_url
509 redirect_url = base_redirect_url
509
510 # repository group set
510 elif user_bookmark.repository_group:
511 elif user_bookmark.repository_group:
511 repo_group_name = user_bookmark.repository_group.group_name
512 repo_group_name = user_bookmark.repository_group.group_name
512 base_redirect_url = h.route_path(
513 base_redirect_url = h.route_path(
@@ -517,9 +518,11 b' class MyAccountView(BaseAppView, DataGri'
517 .safe_substitute({'repo_group_url': base_redirect_url})
518 .safe_substitute({'repo_group_url': base_redirect_url})
518 else:
519 else:
519 redirect_url = base_redirect_url
520 redirect_url = base_redirect_url
520
521 # custom URL set
521 elif user_bookmark.redirect_url:
522 elif user_bookmark.redirect_url:
522 redirect_url = user_bookmark.redirect_url
523 server_url = h.route_url('home').rstrip('/')
524 redirect_url = string.Template(user_bookmark.redirect_url) \
525 .safe_substitute({'server_url': server_url})
523
526
524 log.debug('Redirecting bookmark %s to %s', user_bookmark, redirect_url)
527 log.debug('Redirecting bookmark %s to %s', user_bookmark, redirect_url)
525 raise HTTPFound(redirect_url)
528 raise HTTPFound(redirect_url)
@@ -23,8 +23,11 b''
23 <label class="btn-link btn-danger">${_('Clear')}:</label>
23 <label class="btn-link btn-danger">${_('Clear')}:</label>
24 ${h.checkbox('remove', value=True)}
24 ${h.checkbox('remove', value=True)}
25 </div>
25 </div>
26 </div>
26 </div>
27 </div>
27 </div>
28 <p class="help-block help-block-inline" >
29 ${_('Server URL is available as ${server_url} variable. E.g. Redirect url: ${server_url}/_admin/exception_tracker')}
30 </p>
28
31
29 <div class="label">
32 <div class="label">
30 <label for="redirect_url">${_('Redirect URL')}:</label>
33 <label for="redirect_url">${_('Redirect URL')}:</label>
General Comments 0
You need to be logged in to leave comments. Login now