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
 
@@ -203,24 +203,25 @@ issue_prefix = #
 
## all running rhodecode instances. Leave empty if you don't use it
 
instance_id = 
 

	
 
## alternative return HTTP header for failed authentication. Default HTTP
 
## response is 401 HTTPUnauthorized. Currently HG clients have troubles with 
 
## handling that. Set this variable to 403 to return HTTPForbidden
 
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
 
broker.vhost = rabbitmqhost
 
broker.port = 5672
 
broker.user = rabbitmq
 
broker.password = qweqwe
 

	
 
celery.imports = rhodecode.lib.celerylib.tasks
production.ini
Show inline comments
 
@@ -203,24 +203,25 @@ issue_prefix = #
 
## all running rhodecode instances. Leave empty if you don't use it
 
instance_id = 
 

	
 
## alternative return HTTP header for failed authentication. Default HTTP
 
## response is 401 HTTPUnauthorized. Currently HG clients have troubles with 
 
## handling that. Set this variable to 403 to return HTTPForbidden
 
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
 
broker.vhost = rabbitmqhost
 
broker.port = 5672
 
broker.user = rabbitmq
 
broker.password = qweqwe
 

	
 
celery.imports = rhodecode.lib.celerylib.tasks
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -203,24 +203,25 @@ issue_prefix = #
 
## all running rhodecode instances. Leave empty if you don't use it
 
instance_id = 
 

	
 
## alternative return HTTP header for failed authentication. Default HTTP
 
## response is 401 HTTPUnauthorized. Currently HG clients have troubles with 
 
## handling that. Set this variable to 403 to return HTTPForbidden
 
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
 
broker.vhost = rabbitmqhost
 
broker.port = 5672
 
broker.user = rabbitmq
 
broker.password = qweqwe
 

	
 
celery.imports = rhodecode.lib.celerylib.tasks
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -233,28 +233,28 @@ class SettingsController(BaseController)
 
                return htmlfill.render(
 
                     render('admin/settings/settings.html'),
 
                     defaults=errors.value,
 
                     errors=errors.error_dict or {},
 
                     prefix_error=False,
 
                     encoding="UTF-8"
 
                )
 

	
 
            try:
 
                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)
 
                sett.ui_active = form_result['hooks_changegroup_update']
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_REPO_SIZE)
 
                sett.ui_active = form_result['hooks_changegroup_repo_size']
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_PUSH)
 
                sett.ui_active = form_result['hooks_changegroup_push_logger']
rhodecode/lib/base.py
Show inline comments
 
@@ -268,24 +268,25 @@ class BaseController(WSGIController):
 
        c.visual = AttributeDict({})
 
        rc_config = RhodeCodeSetting.get_app_settings()
 
        ## DB stored
 
        c.visual.show_public_icon = str2bool(rc_config.get('rhodecode_show_public_icon'))
 
        c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon'))
 
        c.visual.stylify_metatags = str2bool(rc_config.get('rhodecode_stylify_metatags'))
 
        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
 
        self.scm_model = ScmModel(self.sa)
 

	
 
    def __call__(self, environ, start_response):
 
        """Invoke the Controller"""
 
        # WSGIController.__call__ dispatches to the Controller method
 
        # the request is routed to. This routing information is
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -259,50 +259,52 @@
 
                    <div class="checkbox">
 
                        ${h.checkbox('extensions_hgsubversion','True')}
 
                        <label for="extensions_hgsubversion">${_('Enable hgsubversion extension')}</label>
 
                    </div>
 
                    <span class="help-block">${_('Requires hgsubversion library installed. Allows cloning from svn remote locations')}</span>
 
                    ##<div class="checkbox">
 
                    ##    ${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')}
 
    <div class="form">
 
        <!-- fields -->
 

	
 
        <div class="fields">
 
            <div class="field">
 
                <div class="label">
0 comments (0 inline, 0 general)