## snippet for displaying issue tracker settings ## usage: ## <%namespace name="its" file="/base/issue_tracker_settings.mako"/> ## ${its.issue_tracker_settings_table(patterns, form_url, delete_url)} ## ${its.issue_tracker_settings_test(test_url)} <%def name="issue_tracker_settings_table(patterns, form_url, delete_url)"> <% # Name/desc, pattern, issue prefix examples = [ ( ' ', ' ', ' ', ' ' ), ( 'Redmine', '(^#|\s#)(?P\d+)', 'https://myissueserver.com/${repo}/issue/${issue_id}', '' ), ( 'Redmine - Alternative', '(?:issue-)(\d+)', 'https://myissueserver.com/redmine/issue/${id}', '' ), ( 'Redmine - Wiki', '(?:wiki-)([a-zA-Z0-9]+)', 'http://example.org/projects/${repo_name}/wiki/${id}', 'wiki-' ), ( 'JIRA - All tickets', '(^|\s\w+-\d+)', 'https://myjira.com/browse/${id}', '' ), ( 'JIRA - Project (JRA)', '(?:(^|\s)(?P(?:JRA-|JRA-)(?:\d+)))', 'https://myjira.com/${issue_id}', '' ), ( 'Confluence WIKI', '(?:conf-)([A-Z0-9]+)', 'https://example.atlassian.net/display/wiki/${id}/${repo_name}', 'CONF-', ), ( 'Pivotal Tracker', '(?:pivot-)(?\d+)-(?\d+)', 'https://www.pivotaltracker.com/s/projects/${project_id}/stories/${story}', 'PIV-', ), ( 'Trello', '(?:trello-)(?[a-zA-Z0-9]+)', 'https://trello.com/example.com/${card_id}', 'TRELLO-', ), ] %> % for name, pat, url, pref in examples: % endfor %for uid, entry in patterns: %endfor
${_('Description')} ${_('Pattern')} ${_('Url')} ${_('Extra Prefix')}
${name} ${pat} ${url} ${pref} % if loop.index == 0: ${_('show examples')} % else: copy to input % endif
${entry.desc} ${h.text('new_pattern_description_'+uid, class_='medium-inline', value=entry.desc or '')} ${entry.pat} ${h.text('new_pattern_pattern_'+uid, class_='medium-inline', value=entry.pat or '')} ${entry.url} ${h.text('new_pattern_url_'+uid, class_='medium-inline', value=entry.url or '')} ${entry.pref} ${h.text('new_pattern_prefix_'+uid, class_='medium-inline', value=entry.pref or '')}

${_('Add new')}

<%def name="issue_tracker_new_row()"> <%def name="issue_tracker_settings_test(test_url)">
${_('Preview')}

${_('Test Pattern Preview')}