Changeset - f7cc6f446f5c
[Not reviewed]
default
0 3 0
Mads Kiilerich - 9 years ago 2016-11-23 01:37:12
madski@unity3d.com
style: fix some missed field refactorings
3 files changed with 6 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/admin/repo_groups/repo_group_add.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%block name="title">
 
    ${_('Add Repository Group')}
 
</%block>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(_('Admin'),h.url('admin_home'))}
 
    &raquo;
 
    ${h.link_to(_('Repository Groups'),h.url('repos_groups'))}
 
    &raquo;
 
    ${_('Add Repository Group')}
 
</%def>
 

	
 
<%block name="header_menu">
 
    ${self.menu('admin')}
 
</%block>
 

	
 
<%def name="main()">
 
<div class="panel panel-primary">
 
    <!-- box / title -->
 
    <div class="panel-heading">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
    ${h.form(url('repos_groups'))}
 
    <div class="form">
 
        <!-- fields -->
 
        <div class="form-horizontal">
 
            <div class="form-group">
 
                <label class="control-label" for="group_name">${_('Group name')}:</label>
 
                <div class="input">
 
                    ${h.text('group_name',class_='small')}
 
                </div>
 
            </div>
 

	
 
            <div class="form-group">
 
                <label class="control-label" for="group_description">${_('Description')}:</label>
 
                <div class="textarea-repo editor">
 
                    ${h.textarea('group_description',cols=23,rows=5,class_="medium")}
 
                </div>
 
            </div>
 

	
 
            <div class="form-group">
 
                <label class="control-label" for="parent_group_id">${_('Group parent')}:</label>
 
                <div class="input">
 
                    ${h.select('parent_group_id',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
 
                </div>
 
            </div>
 

	
 
            <div id="copy_perms" class="field">
 
            <div id="copy_perms" class="form-group">
 
                <label class="control-label" for="group_copy_permissions">${_('Copy parent group permissions')}:</label>
 
                <div class="checkboxes">
 
                    ${h.checkbox('group_copy_permissions',value="True")}
 
                    <span class="help-block">${_('Copy permission set from parent repository group.')}</span>
 
                </div>
 
            </div>
 

	
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('save',_('Save'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
        </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 
<script>
 
    $(document).ready(function(){
 
        var setCopyPermsOption = function(group_val){
 
            if(group_val != "-1"){
 
                $('#copy_perms').show();
 
            }
 
            else{
 
                $('#copy_perms').hide();
 
            }
 
        }
 
        $("#parent_group_id").select2({
 
            'dropdownAutoWidth': true
 
        });
 
        setCopyPermsOption($('#parent_group_id').val());
 
        $("#parent_group_id").on("change", function(e) {
 
            setCopyPermsOption(e.val);
 
        });
 
        $('#group_name').focus();
 
    });
 
</script>
 
</%def>
kallithea/templates/admin/repos/repo_add_base.html
Show inline comments
 
## -*- coding: utf-8 -*-
 

	
 
${h.form(url('repos'))}
 
<div class="form">
 
    <!-- fields -->
 
    <div class="form-horizontal">
 
        <div class="form-group">
 
            <label class="control-label" for="repo_name">${_('Name')}:</label>
 
            <div class="input">
 
                ${h.text('repo_name',class_="small")}
 
            </div>
 
         </div>
 
        <div id="remote_clone" class="field">
 
        <div id="remote_clone" class="form-group">
 
            <label class="control-label" for="clone_uri">${_('Clone remote repository')}:</label>
 
            <div class="input">
 
                ${h.text('clone_uri',class_="small")}
 
                <span class="help-block">
 
                    ${_('Optional: URL of a remote repository. If set, the repository will be created as a clone from this URL.')}
 
                </span>
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <label class="control-label" for="repo_description">${_('Description')}:</label>
 
            <div class="textarea-repo editor">
 
                ${h.textarea('repo_description')}
 
                <span class="help-block">${_('Keep it short and to the point. Use a README file for longer descriptions.')}</span>
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <label class="control-label" for="repo_group">${_('Repository group')}:</label>
 
            <div class="input">
 
                ${h.select('repo_group',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
 
                <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
 
            </div>
 
        </div>
 
        <div id="copy_perms" class="field">
 
        <div id="copy_perms" class="form-group">
 
            <label class="control-label" for="repo_copy_permissions">${_('Copy parent group permissions')}:</label>
 
            <div class="checkboxes">
 
                ${h.checkbox('repo_copy_permissions',value="True")}
 
                <span class="help-block">${_('Copy permission set from parent repository group.')}</span>
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <label class="control-label" for="repo_type">${_('Type')}:</label>
 
            <div class="input">
 
                ${h.select('repo_type','hg',c.backends,class_="small")}
 
                <span class="help-block">${_('Type of repository to create.')}</span>
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <label class="control-label" for="repo_landing_rev">${_('Landing revision')}:</label>
 
            <div class="input">
 
                ${h.select('repo_landing_rev','',c.landing_revs,class_="medium")}
 
                <span class="help-block">${_('Default revision for files page, downloads, full text search index and readme generation')}</span>
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <label class="control-label" for="repo_private">${_('Private repository')}:</label>
 
            <div class="checkboxes">
 
                ${h.checkbox('repo_private',value="True")}
 
                <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <div class="buttons">
 
                ${h.submit('add',_('Add'),class_="btn btn-default")}
 
            </div>
 
        </div>
 
    </div>
 
</div>
 
<script>
 
    $(document).ready(function(){
 
        var setCopyPermsOption = function(group_val){
 
            if(group_val != "-1"){
 
                $('#copy_perms').show();
 
            }
 
            else{
 
                $('#copy_perms').hide();
 
            }
 
        }
 

	
 
        $("#repo_group").select2({
 
            'dropdownAutoWidth': true
 
        });
 

	
 
        setCopyPermsOption($('#repo_group').val());
 
        $("#repo_group").on("change", function(e) {
 
            setCopyPermsOption(e.val);
 
        });
 

	
 
        $("#repo_type").select2({
 
            'minimumResultsForSearch': -1
 
        });
 
        $("#repo_landing_rev").select2({
 
            'minimumResultsForSearch': -1
 
        });
 
        $('#repo_name').focus();
 
    });
 
</script>
 
${h.end_form()}
kallithea/templates/admin/settings/settings_hooks.html
Show inline comments
 
<h4>${_('Built-in Mercurial Hooks (Read-Only)')}</h4>
 
<div class="form">
 
    <div class="form-horizontal">
 
      % for hook in c.hooks:
 
        <div class="form-group">
 
            <label class="control-label" for="${hook.ui_key}">${hook.ui_key}</label>
 
            <div class="input" style="margin-left:280px">
 
              ${h.text(hook.ui_key,hook.ui_value,size=60,readonly="readonly")}
 
            </div>
 
        </div>
 
      % endfor
 
    </div>
 
    <span class="help-block">${_('Hooks can be used to trigger actions on certain events such as push / pull. They can trigger Python functions or external applications.')}</span>
 
</div>
 

	
 
% if c.visual.allow_custom_hooks_settings:
 
<h4>${_('Custom Hooks')}</h4>
 
${h.form(url('admin_settings_hooks'), method='post')}
 
<div class="form">
 
    <div class="form-horizontal">
 

	
 
        %for hook in c.custom_hooks:
 
            <div class="field"  id="${'id%s' % hook.ui_id }">
 
            <div class="form-group" id="${'id%s' % hook.ui_id }">
 
                <label class="control-label" for="${hook.ui_key}">${hook.ui_key}</label>
 
                <div class="input" style="margin-left:280px">
 
                    ${h.hidden('hook_ui_key',hook.ui_key)}
 
                    ${h.hidden('hook_ui_value',hook.ui_value)}
 
                    ${h.text('hook_ui_value_new',hook.ui_value,size=60)}
 
                    <span class="btn btn-default btn-xs"
 
                        onclick="delete_hook(${hook.ui_id},'${'id%s' % hook.ui_id }')">
 
                        <i class="icon-minus-circled" style="color:#FF4444"></i>
 
                        ${_('Delete')}
 
                    </span>
 
                </div>
 
            </div>
 
        %endfor
 

	
 
        <div class="form-group">
 
            <div class="input" style="margin-left:-135px;position: absolute;">
 
                <div class="input">
 
            <label>
 
                    ${h.text('new_hook_ui_key',size=20)}
 
                </div>
 
            </div>
 
            </label>
 
            <div class="input" style="margin-left:280px">
 
                ${h.text('new_hook_ui_value',size=60)}
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <div class="buttons" style="margin-left:280px">
 
                ${h.submit('save',_('Save'),class_="btn btn-default")}
 
            </div>
 
        </div>
 
    </div>
 
</div>
 
${h.end_form()}
 
% endif
 

	
 
<script type="text/javascript">
 
function delete_hook(hook_id, field_id) {
 
    var sUrl = "${h.url('admin_settings_hooks_delete')}";
 
    var success = function (o) {
 
            $('#' + field_id).remove();
 
        };
 
    var failure = function (o) {
 
            alert("${_('Failed to remove hook')}");
 
        };
 
    var postData = {'hook_id': hook_id};
 
    ajaxPOST(sUrl, postData, success, failure);
 
};
 
</script>
0 comments (0 inline, 0 general)