Changeset - 221d6a002601
[Not reviewed]
default
0 4 0
Mads Kiilerich - 10 years ago 2015-06-09 22:53:24
madski@unity3d.com
repos: cleanup of stuff related to clone_uri
4 files changed with 7 insertions and 26 deletions:
0 comments (0 inline, 0 general)
kallithea/model/validators.py
Show inline comments
 
@@ -471,9 +471,9 @@ def ValidCloneUri():
 

	
 
    class _validator(formencode.validators.FancyValidator):
 
        messages = {
 
            'clone_uri': _(u'invalid clone URL'),
 
            'invalid_clone_uri': _(u'Invalid clone URL, provide a '
 
                                    'valid clone http(s)/svn+http(s)/ssh URL')
 
            'clone_uri': _(u'Invalid repository URL'),
 
            'invalid_clone_uri': _(u'Invalid repository URL. It must be a '
 
                                    'valid http, https, ssh, svn+http or svn+https URL'),
 
        }
 

	
 
        def validate_python(self, value, state):
kallithea/templates/admin/repos/repo_add_base.html
Show inline comments
 
@@ -10,18 +10,9 @@ ${h.form(url('repos'))}
 
            </div>
 
            <div class="input">
 
                ${h.text('repo_name',class_="small")}
 
                <div style="margin: 6px 0px 0px 0px">
 
                    <a id="remote_clone_toggle" href="#">
 
                        <i class="icon-download-cloud"></i>
 
                        ${_('Import existing repository ?')}
 
                    </a>
 
                </div>
 
                %if not c.authuser.is_admin:
 
                    ${h.hidden('user_created',True)}
 
                %endif
 
            </div>
 
         </div>
 
        <div id="remote_clone" class="field" style="display: none">
 
        <div id="remote_clone" class="field">
 
            <div class="label">
 
                <label for="clone_uri">${_('Clone from')}:</label>
 
            </div>
 
@@ -102,16 +93,6 @@ ${h.form(url('repos'))}
 
            }
 
        }
 

	
 
        $('#remote_clone_toggle').on('click', function(e){
 
            $('#remote_clone').show();
 
            e.preventDefault();
 
        });
 
        if($('#remote_clone input').hasClass('error')){
 
            $('#remote_clone').show();
 
        }
 
        if($('#remote_clone input').val()){
 
            $('#remote_clone').show();
 
        }
 
        $("#repo_group").select2({
 
            'dropdownAutoWidth': true
 
        });
kallithea/templates/admin/repos/repo_edit_settings.html
Show inline comments
 
@@ -27,7 +27,7 @@ ${h.form(url('repo', repo_name=c.repo_in
 
                        <span style="cursor: pointer; padding: 0px 0px 5px 0px" id="edit_clone_uri"><i class="icon-edit"></i>${_('Edit')}</span>
 
                    </div>
 
                    <div id="alter_clone_uri" style="display: none">
 
                        ${h.text('clone_uri',class_="medium",  placeholder=_('new value'))}
 
                        ${h.text('clone_uri',class_="medium", placeholder=_('New URL'))}
 
                    </div>
 
                  %else:
 
                    ## not set yet, display form to set it
kallithea/tests/functional/test_admin_repos.py
Show inline comments
 
@@ -348,7 +348,7 @@ class _BaseTest(object):
 
                                                repo_description=description,
 
                                                clone_uri='http://127.0.0.1/repo',
 
                                                _authentication_token=self.authentication_token()))
 
        response.mustcontain('invalid clone URL')
 
        response.mustcontain('Invalid repository URL')
 

	
 

	
 
    def test_create_remote_repo_wrong_clone_uri_hg_svn(self):
 
@@ -362,7 +362,7 @@ class _BaseTest(object):
 
                                                repo_description=description,
 
                                                clone_uri='svn+http://127.0.0.1/repo',
 
                                                _authentication_token=self.authentication_token()))
 
        response.mustcontain('invalid clone URL')
 
        response.mustcontain('Invalid repository URL')
 

	
 

	
 
    def test_delete(self):
0 comments (0 inline, 0 general)