<%namespace name="dt" file="/data_table/_dt_elements.mako"/> <%def name="form_item(count, position=None, title=None, redirect_url=None, repo=None, repo_group=None)">
${h.checkbox('remove', value=True)}

${_('Server URL is available as ${server_url} variable. E.g. Redirect url: ${server_url}/_admin/exception_tracker')}

% if repo:
${dt.repo_name(name=repo.repo_name, rtype=repo.repo_type,rstate=None,private=None,archived=False,fork_of=False)} ${h.hidden('bookmark_repo', repo.repo_id)} % elif repo_group:
${dt.repo_group_name(repo_group.group_name)} ${h.hidden('bookmark_repo_group', repo_group.group_id)} % else:
${h.hidden('bookmark_repo', class_='bookmark_repo')} OR ${h.hidden('bookmark_repo_group', class_='bookmark_repo_group')} % endif

% if repo: ${_('Available as ${repo_url} e.g. Redirect url: ${repo_url}/changelog')} % elif repo_group: ${_('Available as ${repo_group_url} e.g. Redirect url: ${repo_group_url}')} % else: ${_('Available as full url variables in redirect url. i.e: ${repo_url}, ${repo_group_url}.')} % endif

${_('Your Bookmarks')}

${_('Store upto 10 bookmark links to favorite repositories, external issue tracker or CI server. ')}
${_('Bookmarks are accessible from your username dropdown or by keyboard shortcut `g 0-9`')}

${h.secure_form(h.route_path('my_account_bookmarks_update'), request=request)}
## generate always 10 entries % for cnt, item in enumerate((c.bookmark_items + [None for i in range(10)])[:10]): % if item is None: ## empty placehodlder ${form_item(cnt)} % else: ## actual entry ${form_item(cnt, position=item.position, title=item.title, redirect_url=item.redirect_url, repo=item.repository, repo_group=item.repository_group)} % endif % endfor
${h.submit('save',_('Save'),class_="btn")}
${h.end_form()}