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 13 insertions and 7 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -209,12 +209,13 @@ instance_id =
 
auth_ret_code =
 

	
 
## locking return code. When repository is locked return this HTTP code. 2XX
 
## codes don't break the transactions while 4XX codes do
 
lock_ret_code = 423
 

	
 
allow_repo_location_change = True
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
####################################
 
use_celery = false
 
broker.host = localhost
production.ini
Show inline comments
 
@@ -209,12 +209,13 @@ instance_id =
 
auth_ret_code =
 

	
 
## locking return code. When repository is locked return this HTTP code. 2XX
 
## codes don't break the transactions while 4XX codes do
 
lock_ret_code = 423
 

	
 
allow_repo_location_change = True
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
####################################
 
use_celery = false
 
broker.host = localhost
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -209,12 +209,13 @@ instance_id =
 
auth_ret_code =
 

	
 
## locking return code. When repository is locked return this HTTP code. 2XX
 
## codes don't break the transactions while 4XX codes do
 
lock_ret_code = 423
 

	
 
allow_repo_location_change = True
 

	
 
####################################
 
###        CELERY CONFIG        ####
 
####################################
 
use_celery = false
 
broker.host = localhost
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -239,13 +239,13 @@ class SettingsController(BaseController)
 
                )
 

	
 
            try:
 
                sett = RhodeCodeUi.get_by_key('push_ssl')
 
                sett.ui_value = form_result['web_push_ssl']
 
                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
 
@@ -274,12 +274,13 @@ class BaseController(WSGIController):
 
        c.visual.dashboard_items = safe_int(rc_config.get('rhodecode_dashboard_items', 100))
 
        c.visual.repository_fields = str2bool(rc_config.get('rhodecode_repository_fields'))
 
        c.visual.show_version = str2bool(rc_config.get('rhodecode_show_version'))
 

	
 
        ## 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()
 
        c.unread_notifications = NotificationModel()\
 
                        .get_unread_cnt_for_user(c.rhodecode_user.user_id)
 
        self.sa = meta.Session
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -265,38 +265,40 @@
 
                    ##    ${h.checkbox('extensions_hggit','True')}
 
                    ##    <label for="extensions_hggit">${_('Enable hg-git extension')}</label>
 
                    ##</div>
 
                    ##<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")}
 
           </div>
 
        </div>
 
    </div>
 
    ${h.end_form()}
 

	
 
    <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>
 

	
 
    <h3>${_('Test Email')}</h3>
 
    ${h.form(url('admin_setting', setting_id='email'),method='put')}
0 comments (0 inline, 0 general)