vcs_settings.mako
330 lines
| 15.9 KiB
| application/x-mako
|
MakoHtmlLexer
r1282 | ## snippet for displaying vcs settings | |||
## usage: | ||||
## <%namespace name="vcss" file="/base/vcssettings.mako"/> | ||||
## ${vcss.vcs_settings_fields()} | ||||
r5356 | <%def name="vcs_settings_fields(suffix='', svn_branch_patterns=None, svn_tag_patterns=None, repo_type=None, display_globals=False, **kwargs)"> | |||
r1282 | % if display_globals: | |||
r5531 | ||||
r1282 | % endif | |||
% if display_globals or repo_type in ['git', 'hg']: | ||||
<div class="panel panel-default"> | ||||
r1597 | <div class="panel-heading" id="vcs-hooks-options"> | |||
<h3 class="panel-title">${_('Internal Hooks')}<a class="permalink" href="#vcs-hooks-options"> ¶</a></h3> | ||||
r1282 | </div> | |||
<div class="panel-body"> | ||||
<div class="field"> | ||||
<div class="checkbox"> | ||||
${h.checkbox('hooks_changegroup_repo_size' + suffix, 'True', **kwargs)} | ||||
<label for="hooks_changegroup_repo_size${suffix}">${_('Show repository size after push')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Trigger a hook that calculates repository size after each push.')}</span> | ||||
</div> | ||||
<div class="checkbox"> | ||||
${h.checkbox('hooks_changegroup_push_logger' + suffix, 'True', **kwargs)} | ||||
<label for="hooks_changegroup_push_logger${suffix}">${_('Execute pre/post push hooks')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Execute Built in pre/post push hooks. This also executes rcextensions hooks.')}</span> | ||||
</div> | ||||
<div class="checkbox"> | ||||
${h.checkbox('hooks_outgoing_pull_logger' + suffix, 'True', **kwargs)} | ||||
<label for="hooks_outgoing_pull_logger${suffix}">${_('Execute pre/post pull hooks')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Execute Built in pre/post pull hooks. This also executes rcextensions hooks.')}</span> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
% endif | ||||
% if display_globals or repo_type in ['hg']: | ||||
<div class="panel panel-default"> | ||||
r1597 | <div class="panel-heading" id="vcs-hg-options"> | |||
<h3 class="panel-title">${_('Mercurial Settings')}<a class="permalink" href="#vcs-hg-options"> ¶</a></h3> | ||||
r1282 | </div> | |||
<div class="panel-body"> | ||||
<div class="checkbox"> | ||||
${h.checkbox('extensions_largefiles' + suffix, 'True', **kwargs)} | ||||
<label for="extensions_largefiles${suffix}">${_('Enable largefiles extension')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
r1563 | % if display_globals: | |||
<span class="help-block">${_('Enable Largefiles extensions for all repositories.')}</span> | ||||
% else: | ||||
<span class="help-block">${_('Enable Largefiles extensions for this repository.')}</span> | ||||
% endif | ||||
r1282 | </div> | |||
r1563 | ||||
% if display_globals: | ||||
<div class="field"> | ||||
<div class="input"> | ||||
${h.text('largefiles_usercache' + suffix, size=59)} | ||||
</div> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Filesystem location where Mercurial largefile objects should be stored.')}</span> | ||||
</div> | ||||
% endif | ||||
r1282 | <div class="checkbox"> | |||
${h.checkbox('phases_publish' + suffix, 'True', **kwargs)} | ||||
<label for="phases_publish${suffix}">${_('Set repositories as publishing') if display_globals else _('Set repository as publishing')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('When this is enabled all commits in the repository are seen as public commits by clients.')}</span> | ||||
</div> | ||||
r1738 | ||||
<div class="checkbox"> | ||||
${h.checkbox('extensions_evolve' + suffix, 'True', **kwargs)} | ||||
r3625 | <label for="extensions_evolve${suffix}">${_('Enable Evolve and Topic extension')}</label> | |||
r1738 | </div> | |||
<div class="label"> | ||||
% if display_globals: | ||||
r3625 | <span class="help-block">${_('Enable Evolve and Topic extensions for all repositories.')}</span> | |||
r1738 | % else: | |||
r3625 | <span class="help-block">${_('Enable Evolve and Topic extensions for this repository.')}</span> | |||
r1738 | % endif | |||
</div> | ||||
r1282 | </div> | |||
</div> | ||||
% endif | ||||
r1570 | % if display_globals or repo_type in ['git']: | |||
<div class="panel panel-default"> | ||||
r1597 | <div class="panel-heading" id="vcs-git-options"> | |||
<h3 class="panel-title">${_('Git Settings')}<a class="permalink" href="#vcs-git-options"> ¶</a></h3> | ||||
r1570 | </div> | |||
<div class="panel-body"> | ||||
<div class="checkbox"> | ||||
${h.checkbox('vcs_git_lfs_enabled' + suffix, 'True', **kwargs)} | ||||
<label for="vcs_git_lfs_enabled${suffix}">${_('Enable lfs extension')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
% if display_globals: | ||||
<span class="help-block">${_('Enable lfs extensions for all repositories.')}</span> | ||||
% else: | ||||
<span class="help-block">${_('Enable lfs extensions for this repository.')}</span> | ||||
% endif | ||||
</div> | ||||
% if display_globals: | ||||
<div class="field"> | ||||
<div class="input"> | ||||
${h.text('vcs_git_lfs_store_location' + suffix, size=59)} | ||||
</div> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Filesystem location where Git lfs objects should be stored.')}</span> | ||||
</div> | ||||
% endif | ||||
</div> | ||||
</div> | ||||
% endif | ||||
r1282 | % if display_globals or repo_type in ['svn']: | |||
<div class="panel panel-default"> | ||||
r1597 | <div class="panel-heading" id="vcs-svn-options"> | |||
<h3 class="panel-title">${_('Subversion Settings')}<a class="permalink" href="#vcs-svn-options"> ¶</a></h3> | ||||
r1282 | </div> | |||
<div class="panel-body"> | ||||
r5395 | % if display_globals: | |||
r1282 | <div class="field"> | |||
<div class="content" > | ||||
r5394 | <label>${_('mod_dav config')}</label><br/> | |||
<code>path: ${c.svn_config_path}</code> | ||||
</div> | ||||
<br/> | ||||
<div> | ||||
% if c.svn_generate_config: | ||||
<span class="buttons"> | ||||
<button class="btn btn-primary" id="vcs_svn_generate_cfg">${_('Re-generate Apache Config')}</button> | ||||
</span> | ||||
% endif | ||||
</div> | ||||
</div> | ||||
r5395 | % endif | |||
r5394 | ||||
<div class="field"> | ||||
<div class="content" > | ||||
r1282 | <label>${_('Repository patterns')}</label><br/> | |||
</div> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Patterns for identifying SVN branches and tags. For recursive search, use "*". Eg.: "/branches/*"')}</span> | ||||
</div> | ||||
<div class="field branch_patterns"> | ||||
<div class="input" > | ||||
<label>${_('Branches')}:</label><br/> | ||||
</div> | ||||
% if svn_branch_patterns: | ||||
% for branch in svn_branch_patterns: | ||||
<div class="input adjacent" id="${'id%s' % branch.ui_id}"> | ||||
${h.hidden('branch_ui_key' + suffix, branch.ui_key)} | ||||
${h.text('branch_value_%d' % branch.ui_id + suffix, branch.ui_value, size=59, readonly="readonly", class_='disabled')} | ||||
% if kwargs.get('disabled') != 'disabled': | ||||
<span class="btn btn-x" onclick="ajaxDeletePattern(${branch.ui_id},'${'id%s' % branch.ui_id}')"> | ||||
${_('Delete')} | ||||
</span> | ||||
% endif | ||||
</div> | ||||
% endfor | ||||
%endif | ||||
</div> | ||||
% if kwargs.get('disabled') != 'disabled': | ||||
<div class="field branch_patterns"> | ||||
<div class="input" > | ||||
${h.text('new_svn_branch',size=59,placeholder='New branch pattern')} | ||||
</div> | ||||
</div> | ||||
% endif | ||||
<div class="field tag_patterns"> | ||||
<div class="input" > | ||||
<label>${_('Tags')}:</label><br/> | ||||
</div> | ||||
% if svn_tag_patterns: | ||||
% for tag in svn_tag_patterns: | ||||
<div class="input" id="${'id%s' % tag.ui_id + suffix}"> | ||||
${h.hidden('tag_ui_key' + suffix, tag.ui_key)} | ||||
${h.text('tag_ui_value_new_%d' % tag.ui_id + suffix, tag.ui_value, size=59, readonly="readonly", class_='disabled tag_input')} | ||||
% if kwargs.get('disabled') != 'disabled': | ||||
<span class="btn btn-x" onclick="ajaxDeletePattern(${tag.ui_id},'${'id%s' % tag.ui_id}')"> | ||||
${_('Delete')} | ||||
</span> | ||||
%endif | ||||
</div> | ||||
% endfor | ||||
% endif | ||||
</div> | ||||
% if kwargs.get('disabled') != 'disabled': | ||||
<div class="field tag_patterns"> | ||||
<div class="input" > | ||||
${h.text('new_svn_tag' + suffix, size=59, placeholder='New tag pattern')} | ||||
</div> | ||||
</div> | ||||
%endif | ||||
</div> | ||||
</div> | ||||
% else: | ||||
${h.hidden('new_svn_branch' + suffix, '')} | ||||
${h.hidden('new_svn_tag' + suffix, '')} | ||||
% endif | ||||
% if display_globals or repo_type in ['hg', 'git']: | ||||
<div class="panel panel-default"> | ||||
r1597 | <div class="panel-heading" id="vcs-pull-requests-options"> | |||
<h3 class="panel-title">${_('Pull Request Settings')}<a class="permalink" href="#vcs-pull-requests-options"> ¶</a></h3> | ||||
r1282 | </div> | |||
<div class="panel-body"> | ||||
<div class="checkbox"> | ||||
${h.checkbox('rhodecode_pr_merge_enabled' + suffix, 'True', **kwargs)} | ||||
<label for="rhodecode_pr_merge_enabled${suffix}">${_('Enable server-side merge for pull requests')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Note: when this feature is enabled, it only runs hooks defined in the rcextension package. Custom hooks added on the Admin -> Settings -> Hooks page will not be run when pull requests are automatically merged from the web interface.')}</span> | ||||
</div> | ||||
<div class="checkbox"> | ||||
${h.checkbox('rhodecode_use_outdated_comments' + suffix, 'True', **kwargs)} | ||||
<label for="rhodecode_use_outdated_comments${suffix}">${_('Invalidate and relocate inline comments during update')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('During the update of a pull request, the position of inline comments will be updated and outdated inline comments will be hidden.')}</span> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
% endif | ||||
Bartłomiej Wołyńczyk
|
r2685 | % if display_globals or repo_type in ['hg', 'git', 'svn']: | ||
<div class="panel panel-default"> | ||||
<div class="panel-heading" id="vcs-pull-requests-options"> | ||||
<h3 class="panel-title">${_('Diff cache')}<a class="permalink" href="#vcs-pull-requests-options"> ¶</a></h3> | ||||
</div> | ||||
<div class="panel-body"> | ||||
<div class="checkbox"> | ||||
${h.checkbox('rhodecode_diff_cache' + suffix, 'True', **kwargs)} | ||||
<label for="rhodecode_diff_cache${suffix}">${_('Enable caching diffs for pull requests cache and commits')}</label> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
% endif | ||||
r2056 | % if display_globals or repo_type in ['hg',]: | |||
<div class="panel panel-default"> | ||||
<div class="panel-heading" id="vcs-pull-requests-options"> | ||||
<h3 class="panel-title">${_('Mercurial Pull Request Settings')}<a class="permalink" href="#vcs-hg-pull-requests-options"> ¶</a></h3> | ||||
</div> | ||||
<div class="panel-body"> | ||||
## Specific HG settings | ||||
<div class="checkbox"> | ||||
${h.checkbox('rhodecode_hg_use_rebase_for_merging' + suffix, 'True', **kwargs)} | ||||
<label for="rhodecode_hg_use_rebase_for_merging${suffix}">${_('Use rebase as merge strategy')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Use rebase instead of creating a merge commit when merging via web interface.')}</span> | ||||
</div> | ||||
<div class="checkbox"> | ||||
${h.checkbox('rhodecode_hg_close_branch_before_merging' + suffix, 'True', **kwargs)} | ||||
<label for="rhodecode_hg_close_branch_before_merging{suffix}">${_('Close branch before merging it')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Close branch before merging it into destination branch. No effect when rebase strategy is use.')}</span> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
% endif | ||||
r5449 | % if display_globals or repo_type in ['git']: | |||
<div class="panel panel-default"> | ||||
<div class="panel-heading" id="vcs-pull-requests-options"> | ||||
<h3 class="panel-title">${_('Git Pull Request Settings')}<a class="permalink" href="#vcs-git-pull-requests-options"> ¶</a></h3> | ||||
</div> | ||||
<div class="panel-body"> | ||||
## <div class="checkbox"> | ||||
## ${h.checkbox('rhodecode_git_use_rebase_for_merging' + suffix, 'True', **kwargs)} | ||||
## <label for="rhodecode_git_use_rebase_for_merging${suffix}">${_('Use rebase as merge strategy')}</label> | ||||
## </div> | ||||
## <div class="label"> | ||||
## <span class="help-block">${_('Use rebase instead of creating a merge commit when merging via web interface.')}</span> | ||||
## </div> | ||||
<div class="checkbox"> | ||||
${h.checkbox('rhodecode_git_close_branch_before_merging' + suffix, 'True', **kwargs)} | ||||
<label for="rhodecode_git_close_branch_before_merging{suffix}">${_('Delete branch after merging it')}</label> | ||||
</div> | ||||
<div class="label"> | ||||
<span class="help-block">${_('Delete branch after merging it into destination branch.')}</span> | ||||
</div> | ||||
</div> | ||||
</div> | ||||
% endif | ||||
r2056 | ||||
r5395 | <script type="text/javascript"> | |||
r2056 | ||||
r5395 | $(document).ready(function() { | |||
/* On click handler for the `Generate Apache Config` button. It sends a | ||||
POST request to trigger the (re)generation of the mod_dav_svn config. */ | ||||
$('#vcs_svn_generate_cfg').on('click', function(event) { | ||||
event.preventDefault(); | ||||
var url = "${h.route_path('admin_settings_vcs_svn_generate_cfg')}"; | ||||
var jqxhr = $.post(url, {'csrf_token': CSRF_TOKEN}); | ||||
jqxhr.done(function(data) { | ||||
$.Topic('/notifications').publish(data); | ||||
}); | ||||
}); | ||||
}); | ||||
</script> | ||||
r1282 | </%def> | |||
r5395 | ||||