Changeset - 985db7f7b9b2
[Not reviewed]
beta
0 6 0
Marcin Kuzminski - 12 years ago 2013-05-30 16:08:14
marcin@python-works.com
Added flag to controll option for changing the repos path location
from web interface
6 files changed with 16 insertions and 10 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -212,6 +212,7 @@ auth_ret_code =
 
## codes don't break the transactions while 4XX codes do
 
lock_ret_code = 423
 

	
 
allow_repo_location_change = True
 

	
 
####################################
 
###        CELERY CONFIG        ####
production.ini
Show inline comments
 
@@ -212,6 +212,7 @@ auth_ret_code =
 
## codes don't break the transactions while 4XX codes do
 
lock_ret_code = 423
 

	
 
allow_repo_location_change = True
 

	
 
####################################
 
###        CELERY CONFIG        ####
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -212,6 +212,7 @@ auth_ret_code =
 
## codes don't break the transactions while 4XX codes do
 
lock_ret_code = 423
 

	
 
allow_repo_location_change = True
 

	
 
####################################
 
###        CELERY CONFIG        ####
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -242,10 +242,10 @@ class SettingsController(BaseController)
 
                sett = RhodeCodeUi.get_by_key('push_ssl')
 
                sett.ui_value = form_result['web_push_ssl']
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key('/')
 
                sett.ui_value = form_result['paths_root_path']
 
                Session().add(sett)
 
                if c.visual.allow_repo_location_change:
 
                    sett = RhodeCodeUi.get_by_key('/')
 
                    sett.ui_value = form_result['paths_root_path']
 
                    Session().add(sett)
 

	
 
                #HOOKS
 
                sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_UPDATE)
rhodecode/lib/base.py
Show inline comments
 
@@ -277,6 +277,7 @@ class BaseController(WSGIController):
 

	
 
        ## INI stored
 
        self.cut_off_limit = int(config.get('cut_off_limit'))
 
        c.visual.allow_repo_location_change = str2bool(config.get('allow_repo_location_change', True))
 

	
 
        c.repo_name = get_repo_slug(request)  # can be empty
 
        c.backends = BACKENDS.keys()
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -268,20 +268,21 @@
 
                    ##<span class="help-block">${_('Requires hg-git library installed. Allows cloning from git remote locations')}</span>
 
                </div>
 
            </div>
 
            %if c.visual.allow_repo_location_change:
 
            <div class="field">
 
                <div class="label">
 
                    <label for="paths_root_path">${_('Repositories location')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('paths_root_path',size=30,readonly="readonly")}
 
                    <span id="path_unlock" class="tooltip"
 
                            title="${h.tooltip(_('This a crucial application setting. If you are really sure you need to change this, you must restart application in order to make this setting take effect. Click this label to unlock.'))}">
 
                    ${h.text('paths_root_path',size=30,readonly="readonly", class_="disabled")}
 
                    <span id="path_unlock" class="tooltip" style="cursor: pointer"
 
                            title="${h.tooltip(_('Click to unlock. You must restart RhodeCode in order to make this setting take effect.'))}">
 
                        ${_('Unlock')}
 
                    </span>
 
                    <span class="help-block">${_('Location where repositories are stored. After changing this value a restart, and rescan is required')}</span>
 
                </div>
 
            </div>
 

	
 
            %endif
 
            <div class="buttons">
 
                ${h.submit('save',_('Save settings'),class_="ui-btn large")}
 
                ${h.reset('reset',_('Reset'),class_="ui-btn large")}
 
@@ -292,8 +293,9 @@
 

	
 
    <script type="text/javascript">
 
        YAHOO.util.Event.onDOMReady(function(){
 
            YAHOO.util.Event.addListener('path_unlock','click',function(){
 
                YAHOO.util.Dom.get('paths_root_path').removeAttribute('readonly');
 
            YUE.on('path_unlock','click',function(){
 
                YUD.get('paths_root_path').removeAttribute('readonly');
 
                YUD.removeClass('paths_root_path', 'disabled')
 
            });
 
        });
 
    </script>
0 comments (0 inline, 0 general)