Changeset - a8f2d78d14ea
[Not reviewed]
rhodecode/controllers/admin/defaults.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.admin.defaults
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    default settings controller for Rhodecode
 

	
 
    :created_on: Apr 27, 2010
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 
from formencode import htmlfill
 

	
 
from pylons import request, session, tmpl_context as c, url
 
from pylons.controllers.util import abort, redirect
 
from pylons.i18n.translation import _
 

	
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.model.forms import DefaultsForm
 
from rhodecode.model.meta import Session
 
from rhodecode import BACKENDS
 
from rhodecode.model.db import RhodeCodeSetting
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class DefaultsController(BaseController):
 
    """REST Controller styled on the Atom Publishing Protocol"""
 
    # To properly map this controller, ensure your config/routing.py
 
    # file has a resource setup:
 
    #     map.resource('default', 'defaults')
 

	
 
    @LoginRequired()
 
    @HasPermissionAllDecorator('hg.admin')
 
    def __before__(self):
 
        super(DefaultsController, self).__before__()
 

	
 
    def index(self, format='html'):
 
        """GET /defaults: All items in the collection"""
 
        # url('defaults')
 
        c.backends = BACKENDS.keys()
 
        defaults = RhodeCodeSetting.get_default_repo_settings()
 

	
 
        return htmlfill.render(
 
            render('admin/defaults/defaults.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    def create(self):
 
        """POST /defaults: Create a new item"""
 
        # url('defaults')
 

	
 
    def new(self, format='html'):
 
        """GET /defaults/new: Form to create a new item"""
 
        # url('new_default')
 

	
 
    def update(self, id):
 
        """PUT /defaults/id: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('default', id=ID),
 
        #           method='put')
 
        # url('default', id=ID)
 

	
 
        _form = DefaultsForm()()
 

	
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 
            for k, v in form_result.iteritems():
 
                setting = RhodeCodeSetting.get_by_name_or_create(k)
 
                setting.app_settings_value = v
 
                Session().add(setting)
 
            Session().commit()
 
            h.flash(_('Default settings updated successfully'),
 
                    category='success')
 

	
 
        except formencode.Invalid, errors:
 
            defaults = errors.value
 

	
 
            return htmlfill.render(
 
                render('admin/defaults/defaults.html'),
 
                defaults=defaults,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during update of defaults'),
 
            h.flash(_('Error occurred during update of defaults'),
 
                    category='error')
 

	
 
        return redirect(url('defaults'))
 

	
 
    def delete(self, id):
 
        """DELETE /defaults/id: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('default', id=ID),
 
        #           method='delete')
 
        # url('default', id=ID)
 

	
 
    def show(self, id, format='html'):
 
        """GET /defaults/id: Show a specific item"""
 
        # url('default', id=ID)
 

	
 
    def edit(self, id, format='html'):
 
        """GET /defaults/id/edit: Form to edit an existing item"""
 
        # url('edit_default', id=ID)
rhodecode/controllers/admin/ldap_settings.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.admin.ldap_settings
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    ldap controller for RhodeCode
 

	
 
    :created_on: Nov 26, 2010
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
import logging
 
import formencode
 
import traceback
 

	
 
from formencode import htmlfill
 

	
 
from pylons import request, response, session, tmpl_context as c, url
 
from pylons.controllers.util import abort, redirect
 
from pylons.i18n.translation import _
 

	
 
from sqlalchemy.exc import DatabaseError
 

	
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
 
from rhodecode.lib.exceptions import LdapImportError
 
from rhodecode.model.forms import LdapSettingsForm
 
from rhodecode.model.db import RhodeCodeSetting
 
from rhodecode.model.meta import Session
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class LdapSettingsController(BaseController):
 

	
 
    search_scope_choices = [('BASE', _('BASE'),),
 
                            ('ONELEVEL', _('ONELEVEL'),),
 
                            ('SUBTREE', _('SUBTREE'),),
 
                            ]
 
    search_scope_default = 'SUBTREE'
 

	
 
    tls_reqcert_choices = [('NEVER', _('NEVER'),),
 
                           ('ALLOW', _('ALLOW'),),
 
                           ('TRY', _('TRY'),),
 
                           ('DEMAND', _('DEMAND'),),
 
                           ('HARD', _('HARD'),),
 
                           ]
 
    tls_reqcert_default = 'DEMAND'
 

	
 
    tls_kind_choices = [('PLAIN', _('No encryption'),),
 
                        ('LDAPS', _('LDAPS connection'),),
 
                        ('START_TLS', _('START_TLS on LDAP connection'),)
 
                        ]
 

	
 
    tls_kind_default = 'PLAIN'
 

	
 
    @LoginRequired()
 
    @HasPermissionAllDecorator('hg.admin')
 
    def __before__(self):
 
        c.admin_user = session.get('admin_user')
 
        c.admin_username = session.get('admin_username')
 
        c.search_scope_choices = self.search_scope_choices
 
        c.tls_reqcert_choices = self.tls_reqcert_choices
 
        c.tls_kind_choices = self.tls_kind_choices
 

	
 
        c.search_scope_cur = self.search_scope_default
 
        c.tls_reqcert_cur = self.tls_reqcert_default
 
        c.tls_kind_cur = self.tls_kind_default
 

	
 
        super(LdapSettingsController, self).__before__()
 

	
 
    def index(self):
 
        defaults = RhodeCodeSetting.get_ldap_settings()
 
        c.search_scope_cur = defaults.get('ldap_search_scope')
 
        c.tls_reqcert_cur = defaults.get('ldap_tls_reqcert')
 
        c.tls_kind_cur = defaults.get('ldap_tls_kind')
 

	
 
        return htmlfill.render(
 
                    render('admin/ldap/ldap.html'),
 
                    defaults=defaults,
 
                    encoding="UTF-8",
 
                    force_defaults=True,)
 

	
 
    def ldap_settings(self):
 
        """POST ldap create and store ldap settings"""
 

	
 
        _form = LdapSettingsForm([x[0] for x in self.tls_reqcert_choices],
 
                                 [x[0] for x in self.search_scope_choices],
 
                                 [x[0] for x in self.tls_kind_choices])()
 
        # check the ldap lib
 
        ldap_active = False
 
        try:
 
            import ldap
 
            ldap_active = True
 
        except ImportError:
 
            pass
 

	
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 

	
 
            try:
 

	
 
                for k, v in form_result.items():
 
                    if k.startswith('ldap_'):
 
                        if k == 'ldap_active':
 
                            v = ldap_active
 
                        setting = RhodeCodeSetting.get_by_name(k)
 
                        setting.app_settings_value = v
 
                        Session().add(setting)
 

	
 
                Session().commit()
 
                h.flash(_('Ldap settings updated successfully'),
 
                h.flash(_('LDAP settings updated successfully'),
 
                        category='success')
 
                if not ldap_active:
 
                    #if ldap is missing send an info to user
 
                    h.flash(_('Unable to activate ldap. The "python-ldap" library '
 
                              'is missing.'), category='warning')
 

	
 
            except (DatabaseError,):
 
                raise
 

	
 
        except formencode.Invalid, errors:
 
            e = errors.error_dict or {}
 

	
 
            return htmlfill.render(
 
                render('admin/ldap/ldap.html'),
 
                defaults=errors.value,
 
                errors=e,
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during update of ldap settings'),
 
            h.flash(_('Error occurred during update of ldap settings'),
 
                    category='error')
 

	
 
        return redirect(url('ldap_home'))
rhodecode/controllers/admin/permissions.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.admin.permissions
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    permissions controller for Rhodecode
 

	
 
    :created_on: Apr 27, 2010
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 
from formencode import htmlfill
 

	
 
from pylons import request, session, tmpl_context as c, url
 
from pylons.controllers.util import abort, redirect
 
from pylons.i18n.translation import _
 

	
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator,\
 
    AuthUser
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.model.forms import DefaultPermissionsForm
 
from rhodecode.model.permission import PermissionModel
 
from rhodecode.model.db import User, UserIpMap
 
from rhodecode.model.meta import Session
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class PermissionsController(BaseController):
 
    """REST Controller styled on the Atom Publishing Protocol"""
 
    # To properly map this controller, ensure your config/routing.py
 
    # file has a resource setup:
 
    #     map.resource('permission', 'permissions')
 

	
 
    @LoginRequired()
 
    @HasPermissionAllDecorator('hg.admin')
 
    def __before__(self):
 
        c.admin_user = session.get('admin_user')
 
        c.admin_username = session.get('admin_username')
 
        super(PermissionsController, self).__before__()
 

	
 
        self.repo_perms_choices = [('repository.none', _('None'),),
 
                                   ('repository.read', _('Read'),),
 
                                   ('repository.write', _('Write'),),
 
                                   ('repository.admin', _('Admin'),)]
 
        self.group_perms_choices = [('group.none', _('None'),),
 
                                    ('group.read', _('Read'),),
 
                                    ('group.write', _('Write'),),
 
                                    ('group.admin', _('Admin'),)]
 
        self.register_choices = [
 
            ('hg.register.none',
 
                _('disabled')),
 
            ('hg.register.manual_activate',
 
                _('allowed with manual account activation')),
 
            ('hg.register.auto_activate',
 
                _('allowed with automatic account activation')), ]
 

	
 
        self.create_choices = [('hg.create.none', _('Disabled')),
 
                               ('hg.create.repository', _('Enabled'))]
 

	
 
        self.fork_choices = [('hg.fork.none', _('Disabled')),
 
                             ('hg.fork.repository', _('Enabled'))]
 

	
 
        # set the global template variables
 
        c.repo_perms_choices = self.repo_perms_choices
 
        c.group_perms_choices = self.group_perms_choices
 
        c.register_choices = self.register_choices
 
        c.create_choices = self.create_choices
 
        c.fork_choices = self.fork_choices
 

	
 
    def index(self, format='html'):
 
        """GET /permissions: All items in the collection"""
 
        # url('permissions')
 

	
 
    def create(self):
 
        """POST /permissions: Create a new item"""
 
        # url('permissions')
 

	
 
    def new(self, format='html'):
 
        """GET /permissions/new: Form to create a new item"""
 
        # url('new_permission')
 

	
 
    def update(self, id):
 
        """PUT /permissions/id: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('permission', id=ID),
 
        #           method='put')
 
        # url('permission', id=ID)
 
        if id == 'default':
 
            c.user = default_user = User.get_by_username('default')
 
            c.perm_user = AuthUser(user_id=default_user.user_id)
 
            c.user_ip_map = UserIpMap.query()\
 
                            .filter(UserIpMap.user == default_user).all()
 
            permission_model = PermissionModel()
 

	
 
            _form = DefaultPermissionsForm(
 
                    [x[0] for x in self.repo_perms_choices],
 
                    [x[0] for x in self.group_perms_choices],
 
                    [x[0] for x in self.register_choices],
 
                    [x[0] for x in self.create_choices],
 
                    [x[0] for x in self.fork_choices])()
 

	
 
            try:
 
                form_result = _form.to_python(dict(request.POST))
 
                form_result.update({'perm_user_name': id})
 
                permission_model.update(form_result)
 
                Session().commit()
 
                h.flash(_('Default permissions updated successfully'),
 
                        category='success')
 

	
 
            except formencode.Invalid, errors:
 
                defaults = errors.value
 

	
 
                return htmlfill.render(
 
                    render('admin/permissions/permissions.html'),
 
                    defaults=defaults,
 
                    errors=errors.error_dict or {},
 
                    prefix_error=False,
 
                    encoding="UTF-8")
 
            except Exception:
 
                log.error(traceback.format_exc())
 
                h.flash(_('error occurred during update of permissions'),
 
                h.flash(_('Error occurred during update of permissions'),
 
                        category='error')
 

	
 
        return redirect(url('edit_permission', id=id))
 

	
 
    def delete(self, id):
 
        """DELETE /permissions/id: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('permission', id=ID),
 
        #           method='delete')
 
        # url('permission', id=ID)
 

	
 
    def show(self, id, format='html'):
 
        """GET /permissions/id: Show a specific item"""
 
        # url('permission', id=ID)
 

	
 
    def edit(self, id, format='html'):
 
        """GET /permissions/id/edit: Form to edit an existing item"""
 
        #url('edit_permission', id=ID)
 

	
 
        #this form can only edit default user permissions
 
        if id == 'default':
 
            c.user = default_user = User.get_by_username('default')
 
            defaults = {'anonymous': default_user.active}
 
            c.perm_user = AuthUser(user_id=default_user.user_id)
 
            c.user_ip_map = UserIpMap.query()\
 
                            .filter(UserIpMap.user == default_user).all()
 
            for p in default_user.user_perms:
 
                if p.permission.permission_name.startswith('repository.'):
 
                    defaults['default_repo_perm'] = p.permission.permission_name
 

	
 
                if p.permission.permission_name.startswith('group.'):
 
                    defaults['default_group_perm'] = p.permission.permission_name
 

	
 
                if p.permission.permission_name.startswith('hg.register.'):
 
                    defaults['default_register'] = p.permission.permission_name
 

	
 
                if p.permission.permission_name.startswith('hg.create.'):
 
                    defaults['default_create'] = p.permission.permission_name
 

	
 
                if p.permission.permission_name.startswith('hg.fork.'):
 
                    defaults['default_fork'] = p.permission.permission_name
 

	
 
            return htmlfill.render(
 
                render('admin/permissions/permissions.html'),
 
                defaults=defaults,
 
                encoding="UTF-8",
 
                force_defaults=False
 
            )
 
        else:
 
            return redirect(url('admin_home'))
rhodecode/controllers/admin/repos.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.admin.repos
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    Repositories controller for RhodeCode
 

	
 
    :created_on: Apr 7, 2010
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 
from formencode import htmlfill
 

	
 
from webob.exc import HTTPInternalServerError, HTTPForbidden
 
from pylons import request, session, tmpl_context as c, url
 
from pylons.controllers.util import redirect
 
from pylons.i18n.translation import _
 
from sqlalchemy.exc import IntegrityError
 

	
 
import rhodecode
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator, \
 
    HasPermissionAnyDecorator, HasRepoPermissionAllDecorator, NotAnonymous,\
 
    HasPermissionAny, HasReposGroupPermissionAny
 
from rhodecode.lib.base import BaseRepoController, render
 
from rhodecode.lib.utils import invalidate_cache, action_logger, repo_name_slug
 
from rhodecode.lib.helpers import get_token
 
from rhodecode.model.meta import Session
 
from rhodecode.model.db import User, Repository, UserFollowing, RepoGroup,\
 
    RhodeCodeSetting, RepositoryField
 
from rhodecode.model.forms import RepoForm, RepoFieldForm
 
from rhodecode.model.scm import ScmModel, GroupList
 
from rhodecode.model.repo import RepoModel
 
from rhodecode.lib.compat import json
 
from sqlalchemy.sql.expression import func
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class ReposController(BaseRepoController):
 
    """
 
    REST Controller styled on the Atom Publishing Protocol"""
 
    # To properly map this controller, ensure your config/routing.py
 
    # file has a resource setup:
 
    #     map.resource('repo', 'repos')
 

	
 
    @LoginRequired()
 
    def __before__(self):
 
        c.admin_user = session.get('admin_user')
 
        c.admin_username = session.get('admin_username')
 
        super(ReposController, self).__before__()
 

	
 
    def __load_defaults(self):
 
        acl_groups = GroupList(RepoGroup.query().all(),
 
                               perm_set=['group.write', 'group.admin'])
 
        c.repo_groups = RepoGroup.groups_choices(groups=acl_groups)
 
        c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups)
 

	
 
        repo_model = RepoModel()
 
        c.users_array = repo_model.get_users_js()
 
        c.users_groups_array = repo_model.get_users_groups_js()
 
        choices, c.landing_revs = ScmModel().get_repo_landing_revs()
 
        c.landing_revs_choices = choices
 

	
 
    def __load_data(self, repo_name=None):
 
        """
 
        Load defaults settings for edit, and update
 

	
 
        :param repo_name:
 
        """
 
        self.__load_defaults()
 

	
 
        c.repo_info = db_repo = Repository.get_by_repo_name(repo_name)
 
        repo = db_repo.scm_instance
 

	
 
        if c.repo_info is None:
 
            h.not_mapped_error(repo_name)
 
            return redirect(url('repos'))
 

	
 
        ##override defaults for exact repo info here git/hg etc
 
        choices, c.landing_revs = ScmModel().get_repo_landing_revs(c.repo_info)
 
        c.landing_revs_choices = choices
 

	
 
        c.default_user_id = User.get_by_username('default').user_id
 
        c.in_public_journal = UserFollowing.query()\
 
            .filter(UserFollowing.user_id == c.default_user_id)\
 
            .filter(UserFollowing.follows_repository == c.repo_info).scalar()
 

	
 
        if c.repo_info.stats:
 
            # this is on what revision we ended up so we add +1 for count
 
            last_rev = c.repo_info.stats.stat_on_revision + 1
 
        else:
 
            last_rev = 0
 
        c.stats_revision = last_rev
 

	
 
        c.repo_last_rev = repo.count() if repo.revisions else 0
 

	
 
        if last_rev == 0 or c.repo_last_rev == 0:
 
            c.stats_percentage = 0
 
        else:
 
            c.stats_percentage = '%.2f' % ((float((last_rev)) /
 
                                            c.repo_last_rev) * 100)
 

	
 
        c.repo_fields = RepositoryField.query()\
 
            .filter(RepositoryField.repository == db_repo).all()
 

	
 
        defaults = RepoModel()._get_defaults(repo_name)
 

	
 
        c.repos_list = [('', _('--REMOVE FORK--'))]
 
        c.repos_list += [(x.repo_id, x.repo_name) for x in
 
                    Repository.query().order_by(Repository.repo_name).all()
 
                    if x.repo_id != c.repo_info.repo_id]
 

	
 
        defaults['id_fork_of'] = db_repo.fork.repo_id if db_repo.fork else ''
 
        return defaults
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def index(self, format='html'):
 
        """GET /repos: All items in the collection"""
 
        # url('repos')
 

	
 
        c.repos_list = Repository.query()\
 
                        .order_by(func.lower(Repository.repo_name))\
 
                        .all()
 

	
 
        repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list,
 
                                                   admin=True,
 
                                                   super_user_actions=True)
 
        #json used to render the grid
 
        c.data = json.dumps(repos_data)
 

	
 
        return render('admin/repos/repos.html')
 

	
 
    @NotAnonymous()
 
    def create(self):
 
        """
 
        POST /repos: Create a new item"""
 
        # url('repos')
 

	
 
        self.__load_defaults()
 
        form_result = {}
 
        try:
 
            form_result = RepoForm(repo_groups=c.repo_groups_choices,
 
                                   landing_revs=c.landing_revs_choices)()\
 
                            .to_python(dict(request.POST))
 

	
 
            new_repo = RepoModel().create(form_result,
 
                                          self.rhodecode_user.user_id)
 
            if form_result['clone_uri']:
 
                h.flash(_('created repository %s from %s') \
 
                h.flash(_('Created repository %s from %s') \
 
                    % (form_result['repo_name'], form_result['clone_uri']),
 
                    category='success')
 
            else:
 
                repo_url = h.link_to(form_result['repo_name'],
 
                    h.url('summary_home', repo_name=form_result['repo_name']))
 
                h.flash(h.literal(_('created repository %s') % repo_url),
 
                h.flash(h.literal(_('Created repository %s') % repo_url),
 
                        category='success')
 

	
 
            if request.POST.get('user_created'):
 
                # created by regular non admin user
 
                action_logger(self.rhodecode_user, 'user_created_repo',
 
                              form_result['repo_name_full'], self.ip_addr,
 
                              self.sa)
 
            else:
 
                action_logger(self.rhodecode_user, 'admin_created_repo',
 
                              form_result['repo_name_full'], self.ip_addr,
 
                              self.sa)
 
            Session().commit()
 
        except formencode.Invalid, errors:
 
            return htmlfill.render(
 
                render('admin/repos/repo_add.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 

	
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            msg = _('error occurred during creation of repository %s') \
 
                    % form_result.get('repo_name')
 
            h.flash(msg, category='error')
 
            if c.rhodecode_user.is_admin:
 
                return redirect(url('repos'))
 
            return redirect(url('home'))
 
        #redirect to our new repo !
 
        return redirect(url('summary_home', repo_name=new_repo.repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def new(self, format='html'):
 
        """
 
        WARNING: this function is depracated see settings.create_repo !!
 

	
 
        GET /repos/new: Form to create a new item
 
        """
 

	
 
        parent_group = request.GET.get('parent_group')
 
        self.__load_defaults()
 
        ## apply the defaults from defaults page
 
        defaults = RhodeCodeSetting.get_default_repo_settings(strip_prefix=True)
 
        if parent_group:
 
            defaults.update({'repo_group': parent_group})
 

	
 
        return htmlfill.render(
 
            render('admin/repos/repo_add.html'),
 
            defaults=defaults,
 
            errors={},
 
            prefix_error=False,
 
            encoding="UTF-8"
 
        )
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def update(self, repo_name):
 
        """
 
        PUT /repos/repo_name: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('repo', repo_name=ID),
 
        #           method='put')
 
        # url('repo', repo_name=ID)
 
        self.__load_defaults()
 
        repo_model = RepoModel()
 
        changed_name = repo_name
 
        #override the choices with extracted revisions !
 
        choices, c.landing_revs = ScmModel().get_repo_landing_revs(repo_name)
 
        c.landing_revs_choices = choices
 
        repo = Repository.get_by_repo_name(repo_name)
 
        _form = RepoForm(edit=True, old_data={'repo_name': repo_name,
 
                                              'repo_group': repo.group.get_dict() \
 
                                              if repo.group else {}},
 
                         repo_groups=c.repo_groups_choices,
 
                         landing_revs=c.landing_revs_choices)()
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 
            repo = repo_model.update(repo_name, **form_result)
 
            invalidate_cache('get_repo_cached_%s' % repo_name)
 
            h.flash(_('Repository %s updated successfully') % repo_name,
 
                    category='success')
 
            changed_name = repo.repo_name
 
            action_logger(self.rhodecode_user, 'admin_updated_repo',
 
                              changed_name, self.ip_addr, self.sa)
 
            Session().commit()
 
        except formencode.Invalid, errors:
 
            defaults = self.__load_data(repo_name)
 
            defaults.update(errors.value)
 
            return htmlfill.render(
 
                render('admin/repos/repo_edit.html'),
 
                defaults=defaults,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 

	
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during update of repository %s') \
 
            h.flash(_('Error occurred during update of repository %s') \
 
                    % repo_name, category='error')
 
        return redirect(url('edit_repo', repo_name=changed_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def delete(self, repo_name):
 
        """
 
        DELETE /repos/repo_name: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('repo', repo_name=ID),
 
        #           method='delete')
 
        # url('repo', repo_name=ID)
 

	
 
        repo_model = RepoModel()
 
        repo = repo_model.get_by_repo_name(repo_name)
 
        if not repo:
 
            h.not_mapped_error(repo_name)
 
            return redirect(url('repos'))
 
        try:
 
            _forks = repo.forks.count()
 
            if _forks and request.POST.get('forks'):
 
                do = request.POST['forks']
 
                if do == 'detach_forks':
 
                    for r in repo.forks:
 
                        log.debug('Detaching fork %s from repo %s' % (r, repo))
 
                        r.fork = None
 
                        Session().add(r)
 
                    h.flash(_('detached %s forks') % _forks, category='success')
 
                    h.flash(_('Detached %s forks') % _forks, category='success')
 
                elif do == 'delete_forks':
 
                    for r in repo.forks:
 
                        log.debug('Deleting fork %s of repo %s' % (r, repo))
 
                        repo_model.delete(r)
 
                    h.flash(_('deleted %s forks') % _forks, category='success')
 
                    h.flash(_('Deleted %s forks') % _forks, category='success')
 
            action_logger(self.rhodecode_user, 'admin_deleted_repo',
 
                              repo_name, self.ip_addr, self.sa)
 
            repo_model.delete(repo)
 
            invalidate_cache('get_repo_cached_%s' % repo_name)
 
            h.flash(_('deleted repository %s') % repo_name, category='success')
 
            h.flash(_('Deleted repository %s') % repo_name, category='success')
 
            Session().commit()
 
        except IntegrityError, e:
 
            if e.message.find('repositories_fork_id_fkey') != -1:
 
                log.error(traceback.format_exc())
 
                h.flash(_('Cannot delete %s it still contains attached '
 
                          'forks') % repo_name,
 
                        category='warning')
 
            else:
 
                log.error(traceback.format_exc())
 
                h.flash(_('An error occurred during '
 
                          'deletion of %s') % repo_name,
 
                        category='error')
 

	
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of %s') % repo_name,
 
                    category='error')
 

	
 
        return redirect(url('repos'))
 

	
 
    @HasRepoPermissionAllDecorator('repository.admin')
 
    def delete_perm_user(self, repo_name):
 
        """
 
        DELETE an existing repository permission user
 

	
 
        :param repo_name:
 
        """
 
        try:
 
            RepoModel().revoke_user_permission(repo=repo_name,
 
                                               user=request.POST['user_id'])
 
            Session().commit()
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of repository user'),
 
                    category='error')
 
            raise HTTPInternalServerError()
 

	
 
    @HasRepoPermissionAllDecorator('repository.admin')
 
    def delete_perm_users_group(self, repo_name):
 
        """
 
        DELETE an existing repository permission user group
 

	
 
        :param repo_name:
 
        """
 

	
 
        try:
 
            RepoModel().revoke_users_group_permission(
 
                repo=repo_name, group_name=request.POST['users_group_id']
 
            )
 
            Session().commit()
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of repository'
 
                      ' user groups'),
 
                    category='error')
 
            raise HTTPInternalServerError()
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def repo_stats(self, repo_name):
 
        """
 
        DELETE an existing repository statistics
 

	
 
        :param repo_name:
 
        """
 

	
 
        try:
 
            RepoModel().delete_stats(repo_name)
 
            Session().commit()
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of repository stats'),
 
                    category='error')
 
        return redirect(url('edit_repo', repo_name=repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def repo_cache(self, repo_name):
 
        """
 
        INVALIDATE existing repository cache
 

	
 
        :param repo_name:
 
        """
 

	
 
        try:
 
            ScmModel().mark_for_invalidation(repo_name)
 
            Session().commit()
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during cache invalidation'),
 
                    category='error')
 
        return redirect(url('edit_repo', repo_name=repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def repo_locking(self, repo_name):
 
        """
 
        Unlock repository when it is locked !
 

	
 
        :param repo_name:
 
        """
 

	
 
        try:
 
            repo = Repository.get_by_repo_name(repo_name)
 
            if request.POST.get('set_lock'):
 
                Repository.lock(repo, c.rhodecode_user.user_id)
 
            elif request.POST.get('set_unlock'):
 
                Repository.unlock(repo)
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during unlocking'),
 
                    category='error')
 
        return redirect(url('edit_repo', repo_name=repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def repo_public_journal(self, repo_name):
 
        """
 
        Set's this repository to be visible in public journal,
 
        in other words assing default user to follow this repo
 

	
 
        :param repo_name:
 
        """
 

	
 
        cur_token = request.POST.get('auth_token')
 
        token = get_token()
 
        if cur_token == token:
 
            try:
 
                repo_id = Repository.get_by_repo_name(repo_name).repo_id
 
                user_id = User.get_by_username('default').user_id
 
                self.scm_model.toggle_following_repo(repo_id, user_id)
 
                h.flash(_('Updated repository visibility in public journal'),
 
                        category='success')
 
                Session().commit()
 
            except:
 
                h.flash(_('An error occurred during setting this'
 
                          ' repository in public journal'),
 
                        category='error')
 

	
 
        else:
 
            h.flash(_('Token mismatch'), category='error')
 
        return redirect(url('edit_repo', repo_name=repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def repo_pull(self, repo_name):
 
        """
 
        Runs task to update given repository with remote changes,
 
        ie. make pull on remote location
 

	
 
        :param repo_name:
 
        """
 
        try:
 
            ScmModel().pull_changes(repo_name, self.rhodecode_user.username)
 
            h.flash(_('Pulled from remote location'), category='success')
 
        except Exception, e:
 
            h.flash(_('An error occurred during pull from remote location'),
 
                    category='error')
 

	
 
        return redirect(url('edit_repo', repo_name=repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def repo_as_fork(self, repo_name):
 
        """
 
        Mark given repository as a fork of another
 

	
 
        :param repo_name:
 
        """
 
        try:
 
            fork_id = request.POST.get('id_fork_of')
 
            repo = ScmModel().mark_as_fork(repo_name, fork_id,
 
                                    self.rhodecode_user.username)
 
            fork = repo.fork.repo_name if repo.fork else _('Nothing')
 
            Session().commit()
 
            h.flash(_('Marked repo %s as fork of %s') % (repo_name, fork),
 
                    category='success')
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during this operation'),
 
                    category='error')
 

	
 
        return redirect(url('edit_repo', repo_name=repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def show(self, repo_name, format='html'):
 
        """GET /repos/repo_name: Show a specific item"""
 
        # url('repo', repo_name=ID)
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def edit(self, repo_name, format='html'):
 
        """GET /repos/repo_name/edit: Form to edit an existing item"""
 
        # url('edit_repo', repo_name=ID)
 
        defaults = self.__load_data(repo_name)
 

	
 
        return htmlfill.render(
 
            render('admin/repos/repo_edit.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def create_repo_field(self, repo_name):
 
        try:
 
            form_result = RepoFieldForm()().to_python(dict(request.POST))
 
            new_field = RepositoryField()
 
            new_field.repository = Repository.get_by_repo_name(repo_name)
 
            new_field.field_key = form_result['new_field_key']
 
            new_field.field_type = form_result['new_field_type']  # python type
 
            new_field.field_value = form_result['new_field_value']  # set initial blank value
 
            new_field.field_desc = form_result['new_field_desc']
 
            new_field.field_label = form_result['new_field_label']
 
            Session().add(new_field)
 
            Session().commit()
 

	
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            msg = _('An error occurred during creation of field')
 
            if isinstance(e, formencode.Invalid):
 
                msg += ". " + e.msg
 
            h.flash(msg, category='error')
 
        return redirect(url('edit_repo', repo_name=repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def delete_repo_field(self, repo_name, field_id):
 
        field = RepositoryField.get_or_404(field_id)
 
        try:
 
            Session().delete(field)
 
            Session().commit()
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            msg = _('An error occurred during removal of field')
 
            h.flash(msg, category='error')
 
        return redirect(url('edit_repo', repo_name=repo_name))
rhodecode/controllers/admin/repos_groups.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.admin.repos_groups
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    Repository groups controller for RhodeCode
 

	
 
    :created_on: Mar 23, 2010
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 

	
 
from formencode import htmlfill
 

	
 
from pylons import request, tmpl_context as c, url
 
from pylons.controllers.util import abort, redirect
 
from pylons.i18n.translation import _
 

	
 
from sqlalchemy.exc import IntegrityError
 

	
 
import rhodecode
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.ext_json import json
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAnyDecorator,\
 
    HasReposGroupPermissionAnyDecorator, HasReposGroupPermissionAll,\
 
    HasPermissionAll
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.model.db import RepoGroup, Repository
 
from rhodecode.model.repos_group import ReposGroupModel
 
from rhodecode.model.forms import ReposGroupForm
 
from rhodecode.model.meta import Session
 
from rhodecode.model.repo import RepoModel
 
from webob.exc import HTTPInternalServerError, HTTPNotFound
 
from rhodecode.lib.utils2 import str2bool, safe_int
 
from sqlalchemy.sql.expression import func
 
from rhodecode.model.scm import GroupList
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class ReposGroupsController(BaseController):
 
    """REST Controller styled on the Atom Publishing Protocol"""
 
    # To properly map this controller, ensure your config/routing.py
 
    # file has a resource setup:
 
    #     map.resource('repos_group', 'repos_groups')
 

	
 
    @LoginRequired()
 
    def __before__(self):
 
        super(ReposGroupsController, self).__before__()
 

	
 
    def __load_defaults(self, allow_empty_group=False, exclude_group_ids=[]):
 
        if HasPermissionAll('hg.admin')('group edit'):
 
            #we're global admin, we're ok and we can create TOP level groups
 
            allow_empty_group = True
 

	
 
        #override the choices for this form, we need to filter choices
 
        #and display only those we have ADMIN right
 
        groups_with_admin_rights = GroupList(RepoGroup.query().all(),
 
                                             perm_set=['group.admin'])
 
        c.repo_groups = RepoGroup.groups_choices(groups=groups_with_admin_rights,
 
                                                 show_empty_group=allow_empty_group)
 
        # exclude filtered ids
 
        c.repo_groups = filter(lambda x: x[0] not in exclude_group_ids,
 
                               c.repo_groups)
 
        c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups)
 
        repo_model = RepoModel()
 
        c.users_array = repo_model.get_users_js()
 
        c.users_groups_array = repo_model.get_users_groups_js()
 

	
 
    def __load_data(self, group_id):
 
        """
 
        Load defaults settings for edit, and update
 

	
 
        :param group_id:
 
        """
 
        repo_group = RepoGroup.get_or_404(group_id)
 
        data = repo_group.get_dict()
 
        data['group_name'] = repo_group.name
 

	
 
        # fill repository users
 
        for p in repo_group.repo_group_to_perm:
 
            data.update({'u_perm_%s' % p.user.username:
 
                             p.permission.permission_name})
 

	
 
        # fill repository groups
 
        for p in repo_group.users_group_to_perm:
 
            data.update({'g_perm_%s' % p.users_group.users_group_name:
 
                             p.permission.permission_name})
 

	
 
        return data
 

	
 
    def _revoke_perms_on_yourself(self, form_result):
 
        _up = filter(lambda u: c.rhodecode_user.username == u[0],
 
                     form_result['perms_updates'])
 
        _new = filter(lambda u: c.rhodecode_user.username == u[0],
 
                      form_result['perms_new'])
 
        if _new and _new[0][1] != 'group.admin' or _up and _up[0][1] != 'group.admin':
 
            return True
 
        return False
 

	
 
    def index(self, format='html'):
 
        """GET /repos_groups: All items in the collection"""
 
        # url('repos_groups')
 
        group_iter = GroupList(RepoGroup.query().all(), perm_set=['group.admin'])
 
        sk = lambda g: g.parents[0].group_name if g.parents else g.group_name
 
        c.groups = sorted(group_iter, key=sk)
 
        return render('admin/repos_groups/repos_groups_show.html')
 

	
 
    def create(self):
 
        """POST /repos_groups: Create a new item"""
 
        # url('repos_groups')
 

	
 
        self.__load_defaults()
 

	
 
        # permissions for can create group based on parent_id are checked
 
        # here in the Form
 
        repos_group_form = ReposGroupForm(available_groups=
 
                                map(lambda k: unicode(k[0]), c.repo_groups))()
 
        try:
 
            form_result = repos_group_form.to_python(dict(request.POST))
 
            ReposGroupModel().create(
 
                    group_name=form_result['group_name'],
 
                    group_description=form_result['group_description'],
 
                    parent=form_result['group_parent_id'],
 
                    owner=self.rhodecode_user.user_id
 
            )
 
            Session().commit()
 
            h.flash(_('created repos group %s') \
 
            h.flash(_('Created repos group %s') \
 
                    % form_result['group_name'], category='success')
 
            #TODO: in futureaction_logger(, '', '', '', self.sa)
 
        except formencode.Invalid, errors:
 
            return htmlfill.render(
 
                render('admin/repos_groups/repos_groups_add.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during creation of repos group %s') \
 
            h.flash(_('Error occurred during creation of repos group %s') \
 
                    % request.POST.get('group_name'), category='error')
 
        parent_group_id = form_result['group_parent_id']
 
        #TODO: maybe we should get back to the main view, not the admin one
 
        return redirect(url('repos_groups', parent_group=parent_group_id))
 

	
 
    def new(self, format='html'):
 
        """GET /repos_groups/new: Form to create a new item"""
 
        # url('new_repos_group')
 
        if HasPermissionAll('hg.admin')('group create'):
 
            #we're global admin, we're ok and we can create TOP level groups
 
            pass
 
        else:
 
            # we pass in parent group into creation form, thus we know
 
            # what would be the group, we can check perms here !
 
            group_id = safe_int(request.GET.get('parent_group'))
 
            group = RepoGroup.get(group_id) if group_id else None
 
            group_name = group.group_name if group else None
 
            if HasReposGroupPermissionAll('group.admin')(group_name, 'group create'):
 
                pass
 
            else:
 
                return abort(403)
 

	
 
        self.__load_defaults()
 
        return render('admin/repos_groups/repos_groups_add.html')
 

	
 
    @HasReposGroupPermissionAnyDecorator('group.admin')
 
    def update(self, group_name):
 
        """PUT /repos_groups/group_name: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('repos_group', group_name=GROUP_NAME),
 
        #           method='put')
 
        # url('repos_group', group_name=GROUP_NAME)
 

	
 
        c.repos_group = ReposGroupModel()._get_repos_group(group_name)
 
        if HasPermissionAll('hg.admin')('group edit'):
 
            #we're global admin, we're ok and we can create TOP level groups
 
            allow_empty_group = True
 
        elif not c.repos_group.parent_group:
 
            allow_empty_group = True
 
        else:
 
            allow_empty_group = False
 
        self.__load_defaults(allow_empty_group=allow_empty_group,
 
                             exclude_group_ids=[c.repos_group.group_id])
 

	
 
        repos_group_form = ReposGroupForm(
 
            edit=True,
 
            old_data=c.repos_group.get_dict(),
 
            available_groups=c.repo_groups_choices,
 
            can_create_in_root=allow_empty_group,
 
        )()
 
        try:
 
            form_result = repos_group_form.to_python(dict(request.POST))
 
            if not c.rhodecode_user.is_admin:
 
                if self._revoke_perms_on_yourself(form_result):
 
                    msg = _('Cannot revoke permission for yourself as admin')
 
                    h.flash(msg, category='warning')
 
                    raise Exception('revoke admin permission on self')
 

	
 
            new_gr = ReposGroupModel().update(group_name, form_result)
 
            Session().commit()
 
            h.flash(_('updated repos group %s') \
 
            h.flash(_('Updated repos group %s') \
 
                    % form_result['group_name'], category='success')
 
            # we now have new name !
 
            group_name = new_gr.group_name
 
            #TODO: in future action_logger(, '', '', '', self.sa)
 
        except formencode.Invalid, errors:
 

	
 
            return htmlfill.render(
 
                render('admin/repos_groups/repos_groups_edit.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during update of repos group %s') \
 
            h.flash(_('Error occurred during update of repos group %s') \
 
                    % request.POST.get('group_name'), category='error')
 

	
 
        return redirect(url('edit_repos_group', group_name=group_name))
 

	
 
    @HasReposGroupPermissionAnyDecorator('group.admin')
 
    def delete(self, group_name):
 
        """DELETE /repos_groups/group_name: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('repos_group', group_name=GROUP_NAME),
 
        #           method='delete')
 
        # url('repos_group', group_name=GROUP_NAME)
 

	
 
        gr = c.repos_group = ReposGroupModel()._get_repos_group(group_name)
 
        repos = gr.repositories.all()
 
        if repos:
 
            h.flash(_('This group contains %s repositores and cannot be '
 
                      'deleted') % len(repos), category='warning')
 
            return redirect(url('repos_groups'))
 

	
 
        children = gr.children.all()
 
        if children:
 
            h.flash(_('This group contains %s subgroups and cannot be deleted'
 
                      % (len(children))), category='warning')
 
            return redirect(url('repos_groups'))
 

	
 
        try:
 
            ReposGroupModel().delete(group_name)
 
            Session().commit()
 
            h.flash(_('removed repos group %s') % group_name,
 
            h.flash(_('Removed repos group %s') % group_name,
 
                    category='success')
 
            #TODO: in future action_logger(, '', '', '', self.sa)
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during deletion of repos '
 
            h.flash(_('Error occurred during deletion of repos '
 
                      'group %s') % group_name, category='error')
 

	
 
        return redirect(url('repos_groups'))
 

	
 
    @HasReposGroupPermissionAnyDecorator('group.admin')
 
    def delete_repos_group_user_perm(self, group_name):
 
        """
 
        DELETE an existing repository group permission user
 

	
 
        :param group_name:
 
        """
 
        try:
 
            if not c.rhodecode_user.is_admin:
 
                if c.rhodecode_user.user_id == safe_int(request.POST['user_id']):
 
                    msg = _('Cannot revoke permission for yourself as admin')
 
                    h.flash(msg, category='warning')
 
                    raise Exception('revoke admin permission on self')
 
            recursive = str2bool(request.POST.get('recursive', False))
 
            ReposGroupModel().delete_permission(
 
                repos_group=group_name, obj=request.POST['user_id'],
 
                obj_type='user', recursive=recursive
 
            )
 
            Session().commit()
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of group user'),
 
                    category='error')
 
            raise HTTPInternalServerError()
 

	
 
    @HasReposGroupPermissionAnyDecorator('group.admin')
 
    def delete_repos_group_users_group_perm(self, group_name):
 
        """
 
        DELETE an existing repository group permission user group
 

	
 
        :param group_name:
 
        """
 

	
 
        try:
 
            recursive = str2bool(request.POST.get('recursive', False))
 
            ReposGroupModel().delete_permission(
 
                repos_group=group_name, obj=request.POST['users_group_id'],
 
                obj_type='users_group', recursive=recursive
 
            )
 
            Session().commit()
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of group'
 
                      ' user groups'),
 
                    category='error')
 
            raise HTTPInternalServerError()
 

	
 
    def show_by_name(self, group_name):
 
        """
 
        This is a proxy that does a lookup group_name -> id, and shows
 
        the group by id view instead
 
        """
 
        group_name = group_name.rstrip('/')
 
        id_ = RepoGroup.get_by_group_name(group_name)
 
        if id_:
 
            return self.show(id_.group_id)
 
        raise HTTPNotFound
 

	
 
    @HasReposGroupPermissionAnyDecorator('group.read', 'group.write',
 
                                         'group.admin')
 
    def show(self, group_name, format='html'):
 
        """GET /repos_groups/group_name: Show a specific item"""
 
        # url('repos_group', group_name=GROUP_NAME)
 

	
 
        c.group = c.repos_group = ReposGroupModel()._get_repos_group(group_name)
 
        c.group_repos = c.group.repositories.all()
 

	
 
        #overwrite our cached list with current filter
 
        gr_filter = c.group_repos
 
        c.repo_cnt = 0
 

	
 
        groups = RepoGroup.query().order_by(RepoGroup.group_name)\
 
            .filter(RepoGroup.group_parent_id == c.group.group_id).all()
 
        c.groups = self.scm_model.get_repos_groups(groups)
 

	
 
        if c.visual.lightweight_dashboard is False:
 
            c.repos_list = self.scm_model.get_repos(all_repos=gr_filter)
 
        ## lightweight version of dashboard
 
        else:
 
            c.repos_list = Repository.query()\
 
                            .filter(Repository.group_id == c.group.group_id)\
 
                            .order_by(func.lower(Repository.repo_name))\
 
                            .all()
 

	
 
            repos_data = RepoModel().get_repos_as_dict(repos_list=c.repos_list,
 
                                                       admin=False)
 
            #json used to render the grid
 
            c.data = json.dumps(repos_data)
 

	
 
        return render('admin/repos_groups/repos_groups.html')
 

	
 
    @HasReposGroupPermissionAnyDecorator('group.admin')
 
    def edit(self, group_name, format='html'):
 
        """GET /repos_groups/group_name/edit: Form to edit an existing item"""
 
        # url('edit_repos_group', group_name=GROUP_NAME)
 

	
 
        c.repos_group = ReposGroupModel()._get_repos_group(group_name)
 
        #we can only allow moving empty group if it's already a top-level
 
        #group, ie has no parents, or we're admin
 
        if HasPermissionAll('hg.admin')('group edit'):
 
            #we're global admin, we're ok and we can create TOP level groups
 
            allow_empty_group = True
 
        elif not c.repos_group.parent_group:
 
            allow_empty_group = True
 
        else:
 
            allow_empty_group = False
 

	
 
        self.__load_defaults(allow_empty_group=allow_empty_group,
 
                             exclude_group_ids=[c.repos_group.group_id])
 
        defaults = self.__load_data(c.repos_group.group_id)
 

	
 
        return htmlfill.render(
 
            render('admin/repos_groups/repos_groups_edit.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
rhodecode/controllers/admin/settings.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.admin.settings
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    settings controller for rhodecode admin
 

	
 
    :created_on: Jul 14, 2010
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 
import pkg_resources
 
import platform
 

	
 
from sqlalchemy import func
 
from formencode import htmlfill
 
from pylons import request, session, tmpl_context as c, url, config
 
from pylons.controllers.util import abort, redirect
 
from pylons.i18n.translation import _
 

	
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator, \
 
    HasPermissionAnyDecorator, NotAnonymous, HasPermissionAny,\
 
    HasReposGroupPermissionAll, HasReposGroupPermissionAny, AuthUser
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.lib.celerylib import tasks, run_task
 
from rhodecode.lib.utils import repo2db_mapper, invalidate_cache, \
 
    set_rhodecode_config, repo_name_slug, check_git_version
 
from rhodecode.model.db import RhodeCodeUi, Repository, RepoGroup, \
 
    RhodeCodeSetting, PullRequest, PullRequestReviewers
 
from rhodecode.model.forms import UserForm, ApplicationSettingsForm, \
 
    ApplicationUiSettingsForm, ApplicationVisualisationForm
 
from rhodecode.model.scm import ScmModel, GroupList
 
from rhodecode.model.user import UserModel
 
from rhodecode.model.repo import RepoModel
 
from rhodecode.model.db import User
 
from rhodecode.model.notification import EmailNotificationModel
 
from rhodecode.model.meta import Session
 
from rhodecode.lib.utils2 import str2bool, safe_unicode
 
from rhodecode.lib.compat import json
 
from webob.exc import HTTPForbidden
 
log = logging.getLogger(__name__)
 

	
 

	
 
class SettingsController(BaseController):
 
    """REST Controller styled on the Atom Publishing Protocol"""
 
    # To properly map this controller, ensure your config/routing.py
 
    # file has a resource setup:
 
    #     map.resource('setting', 'settings', controller='admin/settings',
 
    #         path_prefix='/admin', name_prefix='admin_')
 

	
 
    @LoginRequired()
 
    def __before__(self):
 
        c.admin_user = session.get('admin_user')
 
        c.admin_username = session.get('admin_username')
 
        c.modules = sorted([(p.project_name, p.version)
 
                            for p in pkg_resources.working_set]
 
                           + [('git', check_git_version())],
 
                           key=lambda k: k[0].lower())
 
        c.py_version = platform.python_version()
 
        c.platform = platform.platform()
 
        super(SettingsController, self).__before__()
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def index(self, format='html'):
 
        """GET /admin/settings: All items in the collection"""
 
        # url('admin_settings')
 

	
 
        defaults = RhodeCodeSetting.get_app_settings()
 
        defaults.update(self._get_hg_ui_settings())
 

	
 
        return htmlfill.render(
 
            render('admin/settings/settings.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def create(self):
 
        """POST /admin/settings: Create a new item"""
 
        # url('admin_settings')
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def new(self, format='html'):
 
        """GET /admin/settings/new: Form to create a new item"""
 
        # url('admin_new_setting')
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def update(self, setting_id):
 
        """PUT /admin/settings/setting_id: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('admin_setting', setting_id=ID),
 
        #           method='put')
 
        # url('admin_setting', setting_id=ID)
 

	
 
        if setting_id == 'mapping':
 
            rm_obsolete = request.POST.get('destroy', False)
 
            log.debug('Rescanning directories with destroy=%s' % rm_obsolete)
 
            initial = ScmModel().repo_scan()
 
            log.debug('invalidating all repositories')
 
            for repo_name in initial.keys():
 
                invalidate_cache('get_repo_cached_%s' % repo_name)
 

	
 
            added, removed = repo2db_mapper(initial, rm_obsolete)
 
            _repr = lambda l: ', '.join(map(safe_unicode, l)) or '-'
 
            h.flash(_('Repositories successfully '
 
                      'rescanned added: %s ; removed: %s') %
 
                    (_repr(added), _repr(removed)),
 
                    category='success')
 

	
 
        if setting_id == 'whoosh':
 
            repo_location = self._get_hg_ui_settings()['paths_root_path']
 
            full_index = request.POST.get('full_index', False)
 
            run_task(tasks.whoosh_index, repo_location, full_index)
 
            h.flash(_('Whoosh reindex task scheduled'), category='success')
 

	
 
        if setting_id == 'global':
 

	
 
            application_form = ApplicationSettingsForm()()
 
            try:
 
                form_result = application_form.to_python(dict(request.POST))
 
            except formencode.Invalid, errors:
 
                return htmlfill.render(
 
                     render('admin/settings/settings.html'),
 
                     defaults=errors.value,
 
                     errors=errors.error_dict or {},
 
                     prefix_error=False,
 
                     encoding="UTF-8"
 
                )
 

	
 
            try:
 
                sett1 = RhodeCodeSetting.get_by_name_or_create('title')
 
                sett1.app_settings_value = form_result['rhodecode_title']
 
                Session().add(sett1)
 

	
 
                sett2 = RhodeCodeSetting.get_by_name_or_create('realm')
 
                sett2.app_settings_value = form_result['rhodecode_realm']
 
                Session().add(sett2)
 

	
 
                sett3 = RhodeCodeSetting.get_by_name_or_create('ga_code')
 
                sett3.app_settings_value = form_result['rhodecode_ga_code']
 
                Session().add(sett3)
 

	
 
                Session().commit()
 
                set_rhodecode_config(config)
 
                h.flash(_('Updated application settings'), category='success')
 

	
 
            except Exception:
 
                log.error(traceback.format_exc())
 
                h.flash(_('error occurred during updating '
 
                h.flash(_('Error occurred during updating '
 
                          'application settings'),
 
                          category='error')
 

	
 
        if setting_id == 'visual':
 

	
 
            application_form = ApplicationVisualisationForm()()
 
            try:
 
                form_result = application_form.to_python(dict(request.POST))
 
            except formencode.Invalid, errors:
 
                return htmlfill.render(
 
                     render('admin/settings/settings.html'),
 
                     defaults=errors.value,
 
                     errors=errors.error_dict or {},
 
                     prefix_error=False,
 
                     encoding="UTF-8"
 
                )
 

	
 
            try:
 
                sett1 = RhodeCodeSetting.get_by_name_or_create('show_public_icon')
 
                sett1.app_settings_value = \
 
                    form_result['rhodecode_show_public_icon']
 
                Session().add(sett1)
 

	
 
                sett2 = RhodeCodeSetting.get_by_name_or_create('show_private_icon')
 
                sett2.app_settings_value = \
 
                    form_result['rhodecode_show_private_icon']
 
                Session().add(sett2)
 

	
 
                sett3 = RhodeCodeSetting.get_by_name_or_create('stylify_metatags')
 
                sett3.app_settings_value = \
 
                    form_result['rhodecode_stylify_metatags']
 
                Session().add(sett3)
 

	
 
                sett4 = RhodeCodeSetting.get_by_name_or_create('lightweight_dashboard')
 
                sett4.app_settings_value = \
 
                    form_result['rhodecode_lightweight_dashboard']
 
                Session().add(sett4)
 

	
 
                sett4 = RhodeCodeSetting.get_by_name_or_create('repository_fields')
 
                sett4.app_settings_value = \
 
                    form_result['rhodecode_repository_fields']
 
                Session().add(sett4)
 

	
 
                Session().commit()
 
                set_rhodecode_config(config)
 
                h.flash(_('Updated visualisation settings'),
 
                        category='success')
 

	
 
            except Exception:
 
                log.error(traceback.format_exc())
 
                h.flash(_('error occurred during updating '
 
                h.flash(_('Error occurred during updating '
 
                          'visualisation settings'),
 
                        category='error')
 

	
 
        if setting_id == 'vcs':
 
            application_form = ApplicationUiSettingsForm()()
 
            try:
 
                form_result = application_form.to_python(dict(request.POST))
 
            except formencode.Invalid, errors:
 
                return htmlfill.render(
 
                     render('admin/settings/settings.html'),
 
                     defaults=errors.value,
 
                     errors=errors.error_dict or {},
 
                     prefix_error=False,
 
                     encoding="UTF-8"
 
                )
 

	
 
            try:
 
                # fix namespaces for hooks and extensions
 
                _f = lambda s: s.replace('.', '_')
 

	
 
                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)
 

	
 
                #HOOKS
 
                sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_UPDATE)
 
                sett.ui_active = form_result[_f('hooks_%s' %
 
                                                RhodeCodeUi.HOOK_UPDATE)]
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_REPO_SIZE)
 
                sett.ui_active = form_result[_f('hooks_%s' %
 
                                                RhodeCodeUi.HOOK_REPO_SIZE)]
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_PUSH)
 
                sett.ui_active = form_result[_f('hooks_%s' %
 
                                                RhodeCodeUi.HOOK_PUSH)]
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_PULL)
 
                sett.ui_active = form_result[_f('hooks_%s' %
 
                                                 RhodeCodeUi.HOOK_PULL)]
 

	
 
                Session().add(sett)
 

	
 
                ## EXTENSIONS
 
                sett = RhodeCodeUi.get_by_key('largefiles')
 
                if not sett:
 
                    #make one if it's not there !
 
                    sett = RhodeCodeUi()
 
                    sett.ui_key = 'largefiles'
 
                    sett.ui_section = 'extensions'
 
                sett.ui_active = form_result[_f('extensions_largefiles')]
 
                Session().add(sett)
 

	
 
                sett = RhodeCodeUi.get_by_key('hgsubversion')
 
                if not sett:
 
                    #make one if it's not there !
 
                    sett = RhodeCodeUi()
 
                    sett.ui_key = 'hgsubversion'
 
                    sett.ui_section = 'extensions'
 

	
 
                sett.ui_active = form_result[_f('extensions_hgsubversion')]
 
                Session().add(sett)
 

	
 
#                sett = RhodeCodeUi.get_by_key('hggit')
 
#                if not sett:
 
#                    #make one if it's not there !
 
#                    sett = RhodeCodeUi()
 
#                    sett.ui_key = 'hggit'
 
#                    sett.ui_section = 'extensions'
 
#
 
#                sett.ui_active = form_result[_f('extensions_hggit')]
 
#                Session().add(sett)
 

	
 
                Session().commit()
 

	
 
                h.flash(_('Updated VCS settings'), category='success')
 

	
 
            except Exception:
 
                log.error(traceback.format_exc())
 
                h.flash(_('error occurred during updating '
 
                h.flash(_('Error occurred during updating '
 
                          'application settings'), category='error')
 

	
 
        if setting_id == 'hooks':
 
            ui_key = request.POST.get('new_hook_ui_key')
 
            ui_value = request.POST.get('new_hook_ui_value')
 
            try:
 

	
 
                if ui_value and ui_key:
 
                    RhodeCodeUi.create_or_update_hook(ui_key, ui_value)
 
                    h.flash(_('Added new hook'),
 
                            category='success')
 

	
 
                # check for edits
 
                update = False
 
                _d = request.POST.dict_of_lists()
 
                for k, v in zip(_d.get('hook_ui_key', []),
 
                                _d.get('hook_ui_value_new', [])):
 
                    RhodeCodeUi.create_or_update_hook(k, v)
 
                    update = True
 

	
 
                if update:
 
                    h.flash(_('Updated hooks'), category='success')
 
                Session().commit()
 
            except Exception:
 
                log.error(traceback.format_exc())
 
                h.flash(_('error occurred during hook creation'),
 
                h.flash(_('Error occurred during hook creation'),
 
                        category='error')
 

	
 
            return redirect(url('admin_edit_setting', setting_id='hooks'))
 

	
 
        if setting_id == 'email':
 
            test_email = request.POST.get('test_email')
 
            test_email_subj = 'RhodeCode TestEmail'
 
            test_email_body = 'RhodeCode Email test'
 

	
 
            test_email_html_body = EmailNotificationModel()\
 
                .get_email_tmpl(EmailNotificationModel.TYPE_DEFAULT,
 
                                body=test_email_body)
 

	
 
            recipients = [test_email] if test_email else None
 

	
 
            run_task(tasks.send_email, recipients, test_email_subj,
 
                     test_email_body, test_email_html_body)
 

	
 
            h.flash(_('Email task created'), category='success')
 
        return redirect(url('admin_settings'))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def delete(self, setting_id):
 
        """DELETE /admin/settings/setting_id: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('admin_setting', setting_id=ID),
 
        #           method='delete')
 
        # url('admin_setting', setting_id=ID)
 
        if setting_id == 'hooks':
 
            hook_id = request.POST.get('hook_id')
 
            RhodeCodeUi.delete(hook_id)
 
            Session().commit()
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def show(self, setting_id, format='html'):
 
        """
 
        GET /admin/settings/setting_id: Show a specific item"""
 
        # url('admin_setting', setting_id=ID)
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def edit(self, setting_id, format='html'):
 
        """
 
        GET /admin/settings/setting_id/edit: Form to
 
        edit an existing item"""
 
        # url('admin_edit_setting', setting_id=ID)
 

	
 
        c.hooks = RhodeCodeUi.get_builtin_hooks()
 
        c.custom_hooks = RhodeCodeUi.get_custom_hooks()
 

	
 
        return htmlfill.render(
 
            render('admin/settings/hooks.html'),
 
            defaults={},
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    def _load_my_repos_data(self):
 
        repos_list = Session().query(Repository)\
 
                     .filter(Repository.user_id ==
 
                             self.rhodecode_user.user_id)\
 
                     .order_by(func.lower(Repository.repo_name)).all()
 

	
 
        repos_data = RepoModel().get_repos_as_dict(repos_list=repos_list,
 
                                                   admin=True)
 
        #json used to render the grid
 
        return json.dumps(repos_data)
 

	
 
    @NotAnonymous()
 
    def my_account(self):
 
        """
 
        GET /_admin/my_account Displays info about my account
 
        """
 
        # url('admin_settings_my_account')
 

	
 
        c.user = User.get(self.rhodecode_user.user_id)
 
        c.perm_user = AuthUser(user_id=self.rhodecode_user.user_id,
 
                               ip_addr=self.ip_addr)
 
        c.ldap_dn = c.user.ldap_dn
 

	
 
        if c.user.username == 'default':
 
            h.flash(_("You can't edit this user since it's"
 
              " crucial for entire application"), category='warning')
 
            return redirect(url('users'))
 

	
 
        #json used to render the grid
 
        c.data = self._load_my_repos_data()
 

	
 
        defaults = c.user.get_dict()
 

	
 
        c.form = htmlfill.render(
 
            render('admin/users/user_edit_my_account_form.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 
        return render('admin/users/user_edit_my_account.html')
 

	
 
    @NotAnonymous()
 
    def my_account_update(self):
 
        """PUT /_admin/my_account_update: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('admin_settings_my_account_update'),
 
        #           method='put')
 
        # url('admin_settings_my_account_update', id=ID)
 
        uid = self.rhodecode_user.user_id
 
        c.user = User.get(self.rhodecode_user.user_id)
 
        c.perm_user = AuthUser(user_id=self.rhodecode_user.user_id,
 
                               ip_addr=self.ip_addr)
 
        c.ldap_dn = c.user.ldap_dn
 
        email = self.rhodecode_user.email
 
        _form = UserForm(edit=True,
 
                         old_data={'user_id': uid, 'email': email})()
 
        form_result = {}
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 
            skip_attrs = ['admin', 'active']  # skip attr for my account
 
            if c.ldap_dn:
 
                #forbid updating username for ldap accounts
 
                skip_attrs.append('username')
 
            UserModel().update(uid, form_result, skip_attrs=skip_attrs)
 
            h.flash(_('Your account was updated successfully'),
 
                    category='success')
 
            Session().commit()
 
        except formencode.Invalid, errors:
 
            #json used to render the grid
 
            c.data = self._load_my_repos_data()
 
            c.form = htmlfill.render(
 
                render('admin/users/user_edit_my_account_form.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 
            return render('admin/users/user_edit_my_account.html')
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during update of user %s') \
 
            h.flash(_('Error occurred during update of user %s') \
 
                    % form_result.get('username'), category='error')
 

	
 
        return redirect(url('my_account'))
 

	
 
    @NotAnonymous()
 
    def my_account_my_pullrequests(self):
 
        c.show_closed = request.GET.get('pr_show_closed')
 

	
 
        def _filter(pr):
 
            s = sorted(pr, key=lambda o: o.created_on, reverse=True)
 
            if not c.show_closed:
 
                s = filter(lambda p: p.status != PullRequest.STATUS_CLOSED, s)
 
            return s
 

	
 
        c.my_pull_requests = _filter(PullRequest.query()\
 
                                .filter(PullRequest.user_id ==
 
                                        self.rhodecode_user.user_id)\
 
                                .all())
 

	
 
        c.participate_in_pull_requests = _filter([
 
                    x.pull_request for x in PullRequestReviewers.query()\
 
                    .filter(PullRequestReviewers.user_id ==
 
                            self.rhodecode_user.user_id).all()])
 

	
 
        return render('admin/users/user_edit_my_account_pullrequests.html')
 

	
 
    @NotAnonymous()
 
    def create_repository(self):
 
        """GET /_admin/create_repository: Form to create a new item"""
 
        new_repo = request.GET.get('repo', '')
 
        parent_group = request.GET.get('parent_group')
 
        if not HasPermissionAny('hg.admin', 'hg.create.repository')():
 
            #you're not super admin nor have global create permissions,
 
            #but maybe you have at least write permission to a parent group ?
 
            _gr = RepoGroup.get(parent_group)
 
            gr_name = _gr.group_name if _gr else None
 
            if not HasReposGroupPermissionAny('group.admin', 'group.write')(group_name=gr_name):
 
                raise HTTPForbidden
 

	
 
        acl_groups = GroupList(RepoGroup.query().all(),
 
                               perm_set=['group.write', 'group.admin'])
 
        c.repo_groups = RepoGroup.groups_choices(groups=acl_groups)
 
        c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups)
 
        choices, c.landing_revs = ScmModel().get_repo_landing_revs()
 

	
 
        c.new_repo = repo_name_slug(new_repo)
 

	
 
        ## apply the defaults from defaults page
 
        defaults = RhodeCodeSetting.get_default_repo_settings(strip_prefix=True)
 
        if parent_group:
 
            defaults.update({'repo_group': parent_group})
 

	
 
        return htmlfill.render(
 
            render('admin/repos/repo_add.html'),
 
            defaults=defaults,
 
            errors={},
 
            prefix_error=False,
 
            encoding="UTF-8"
 
        )
 

	
 
    def _get_hg_ui_settings(self):
 
        ret = RhodeCodeUi.query().all()
 

	
 
        if not ret:
 
            raise Exception('Could not get application ui settings !')
 
        settings = {}
 
        for each in ret:
 
            k = each.ui_key
 
            v = each.ui_value
 
            if k == '/':
 
                k = 'root_path'
 

	
 
            if k == 'push_ssl':
 
                v = str2bool(v)
 

	
 
            if k.find('.') != -1:
 
                k = k.replace('.', '_')
 

	
 
            if each.ui_section in ['hooks', 'extensions']:
 
                v = each.ui_active
 

	
 
            settings[each.ui_section + '_' + k] = v
 
        return settings
rhodecode/controllers/admin/users.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.admin.users
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    Users crud controller for pylons
 

	
 
    :created_on: Apr 4, 2010
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 
from pylons import response
 

	
 
from formencode import htmlfill
 
from pylons import request, session, tmpl_context as c, url, config
 
from pylons.controllers.util import redirect
 
from pylons.i18n.translation import _
 

	
 
import rhodecode
 
from rhodecode.lib.exceptions import DefaultUserException, \
 
    UserOwnsReposException
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator, \
 
    AuthUser
 
from rhodecode.lib.base import BaseController, render
 

	
 
from rhodecode.model.db import User, UserEmailMap, UserIpMap
 
from rhodecode.model.forms import UserForm
 
from rhodecode.model.user import UserModel
 
from rhodecode.model.meta import Session
 
from rhodecode.lib.utils import action_logger
 
from rhodecode.lib.compat import json
 
from rhodecode.lib.utils2 import datetime_to_time, str2bool
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class UsersController(BaseController):
 
    """REST Controller styled on the Atom Publishing Protocol"""
 
    # To properly map this controller, ensure your config/routing.py
 
    # file has a resource setup:
 
    #     map.resource('user', 'users')
 

	
 
    @LoginRequired()
 
    @HasPermissionAllDecorator('hg.admin')
 
    def __before__(self):
 
        c.admin_user = session.get('admin_user')
 
        c.admin_username = session.get('admin_username')
 
        super(UsersController, self).__before__()
 
        c.available_permissions = config['available_permissions']
 

	
 
    def index(self, format='html'):
 
        """GET /users: All items in the collection"""
 
        # url('users')
 

	
 
        c.users_list = User.query().order_by(User.username).all()
 

	
 
        users_data = []
 
        total_records = len(c.users_list)
 
        _tmpl_lookup = rhodecode.CONFIG['pylons.app_globals'].mako_lookup
 
        template = _tmpl_lookup.get_template('data_table/_dt_elements.html')
 

	
 
        grav_tmpl = lambda user_email, size: (
 
                template.get_def("user_gravatar")
 
                .render(user_email, size, _=_, h=h, c=c))
 

	
 
        user_lnk = lambda user_id, username: (
 
                template.get_def("user_name")
 
                .render(user_id, username, _=_, h=h, c=c))
 

	
 
        user_actions = lambda user_id, username: (
 
                template.get_def("user_actions")
 
                .render(user_id, username, _=_, h=h, c=c))
 

	
 
        for user in c.users_list:
 

	
 
            users_data.append({
 
                "gravatar": grav_tmpl(user. email, 24),
 
                "raw_username": user.username,
 
                "username": user_lnk(user.user_id, user.username),
 
                "firstname": user.name,
 
                "lastname": user.lastname,
 
                "last_login": h.fmt_date(user.last_login),
 
                "last_login_raw": datetime_to_time(user.last_login),
 
                "active": h.bool2icon(user.active),
 
                "admin": h.bool2icon(user.admin),
 
                "ldap": h.bool2icon(bool(user.ldap_dn)),
 
                "action": user_actions(user.user_id, user.username),
 
            })
 

	
 
        c.data = json.dumps({
 
            "totalRecords": total_records,
 
            "startIndex": 0,
 
            "sort": None,
 
            "dir": "asc",
 
            "records": users_data
 
        })
 

	
 
        return render('admin/users/users.html')
 

	
 
    def create(self):
 
        """POST /users: Create a new item"""
 
        # url('users')
 

	
 
        user_model = UserModel()
 
        user_form = UserForm()()
 
        try:
 
            form_result = user_form.to_python(dict(request.POST))
 
            user_model.create(form_result)
 
            usr = form_result['username']
 
            action_logger(self.rhodecode_user, 'admin_created_user:%s' % usr,
 
                          None, self.ip_addr, self.sa)
 
            h.flash(_('created user %s') % usr,
 
            h.flash(_('Created user %s') % usr,
 
                    category='success')
 
            Session().commit()
 
        except formencode.Invalid, errors:
 
            return htmlfill.render(
 
                render('admin/users/user_add.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during creation of user %s') \
 
            h.flash(_('Error occurred during creation of user %s') \
 
                    % request.POST.get('username'), category='error')
 
        return redirect(url('users'))
 

	
 
    def new(self, format='html'):
 
        """GET /users/new: Form to create a new item"""
 
        # url('new_user')
 
        return render('admin/users/user_add.html')
 

	
 
    def update(self, id):
 
        """PUT /users/id: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('update_user', id=ID),
 
        #           method='put')
 
        # url('user', id=ID)
 
        user_model = UserModel()
 
        c.user = user_model.get(id)
 
        c.ldap_dn = c.user.ldap_dn
 
        c.perm_user = AuthUser(user_id=id, ip_addr=self.ip_addr)
 
        _form = UserForm(edit=True, old_data={'user_id': id,
 
                                              'email': c.user.email})()
 
        form_result = {}
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 
            skip_attrs = []
 
            if c.ldap_dn:
 
                #forbid updating username for ldap accounts
 
                skip_attrs = ['username']
 
            user_model.update(id, form_result, skip_attrs=skip_attrs)
 
            usr = form_result['username']
 
            action_logger(self.rhodecode_user, 'admin_updated_user:%s' % usr,
 
                          None, self.ip_addr, self.sa)
 
            h.flash(_('User updated successfully'), category='success')
 
            Session().commit()
 
        except formencode.Invalid, errors:
 
            c.user_email_map = UserEmailMap.query()\
 
                            .filter(UserEmailMap.user == c.user).all()
 
            c.user_ip_map = UserIpMap.query()\
 
                            .filter(UserIpMap.user == c.user).all()
 
            defaults = errors.value
 
            e = errors.error_dict or {}
 
            defaults.update({
 
                'create_repo_perm': user_model.has_perm(id, 'hg.create.repository'),
 
                'fork_repo_perm': user_model.has_perm(id, 'hg.fork.repository'),
 
                '_method': 'put'
 
            })
 
            return htmlfill.render(
 
                render('admin/users/user_edit.html'),
 
                defaults=defaults,
 
                errors=e,
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during update of user %s') \
 
            h.flash(_('Error occurred during update of user %s') \
 
                    % form_result.get('username'), category='error')
 
        return redirect(url('edit_user', id=id))
 

	
 
    def delete(self, id):
 
        """DELETE /users/id: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('delete_user', id=ID),
 
        #           method='delete')
 
        # url('user', id=ID)
 
        usr = User.get_or_404(id)
 
        try:
 
            UserModel().delete(usr)
 
            Session().commit()
 
            h.flash(_('successfully deleted user'), category='success')
 
            h.flash(_('Successfully deleted user'), category='success')
 
        except (UserOwnsReposException, DefaultUserException), e:
 
            h.flash(e, category='warning')
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of user'),
 
                    category='error')
 
        return redirect(url('users'))
 

	
 
    def show(self, id, format='html'):
 
        """GET /users/id: Show a specific item"""
 
        # url('user', id=ID)
 

	
 
    def edit(self, id, format='html'):
 
        """GET /users/id/edit: Form to edit an existing item"""
 
        # url('edit_user', id=ID)
 
        c.user = User.get_or_404(id)
 

	
 
        if c.user.username == 'default':
 
            h.flash(_("You can't edit this user"), category='warning')
 
            return redirect(url('users'))
 

	
 
        c.perm_user = AuthUser(user_id=id, ip_addr=self.ip_addr)
 
        c.user.permissions = {}
 
        c.granted_permissions = UserModel().fill_perms(c.user)\
 
            .permissions['global']
 
        c.user_email_map = UserEmailMap.query()\
 
                        .filter(UserEmailMap.user == c.user).all()
 
        c.user_ip_map = UserIpMap.query()\
 
                        .filter(UserIpMap.user == c.user).all()
 
        user_model = UserModel()
 
        c.ldap_dn = c.user.ldap_dn
 
        defaults = c.user.get_dict()
 
        defaults.update({
 
            'create_repo_perm': user_model.has_perm(id, 'hg.create.repository'),
 
            'fork_repo_perm': user_model.has_perm(id, 'hg.fork.repository'),
 
        })
 

	
 
        return htmlfill.render(
 
            render('admin/users/user_edit.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    def update_perm(self, id):
 
        """PUT /users_perm/id: Update an existing item"""
 
        # url('user_perm', id=ID, method='put')
 
        usr = User.get_or_404(id)
 
        grant_create_perm = str2bool(request.POST.get('create_repo_perm'))
 
        grant_fork_perm = str2bool(request.POST.get('fork_repo_perm'))
 
        inherit_perms = str2bool(request.POST.get('inherit_default_permissions'))
 

	
 
        user_model = UserModel()
 

	
 
        try:
 
            usr.inherit_default_permissions = inherit_perms
 
            Session().add(usr)
 

	
 
            if grant_create_perm:
 
                user_model.revoke_perm(usr, 'hg.create.none')
 
                user_model.grant_perm(usr, 'hg.create.repository')
 
                h.flash(_("Granted 'repository create' permission to user"),
 
                        category='success')
 
            else:
 
                user_model.revoke_perm(usr, 'hg.create.repository')
 
                user_model.grant_perm(usr, 'hg.create.none')
 
                h.flash(_("Revoked 'repository create' permission to user"),
 
                        category='success')
 

	
 
            if grant_fork_perm:
 
                user_model.revoke_perm(usr, 'hg.fork.none')
 
                user_model.grant_perm(usr, 'hg.fork.repository')
 
                h.flash(_("Granted 'repository fork' permission to user"),
 
                        category='success')
 
            else:
 
                user_model.revoke_perm(usr, 'hg.fork.repository')
 
                user_model.grant_perm(usr, 'hg.fork.none')
 
                h.flash(_("Revoked 'repository fork' permission to user"),
 
                        category='success')
 

	
 
            Session().commit()
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during permissions saving'),
 
                    category='error')
 
        return redirect(url('edit_user', id=id))
 

	
 
    def add_email(self, id):
 
        """POST /user_emails:Add an existing item"""
 
        # url('user_emails', id=ID, method='put')
 

	
 
        email = request.POST.get('new_email')
 
        user_model = UserModel()
 

	
 
        try:
 
            user_model.add_extra_email(id, email)
 
            Session().commit()
 
            h.flash(_("Added email %s to user") % email, category='success')
 
        except formencode.Invalid, error:
 
            msg = error.error_dict['email']
 
            h.flash(msg, category='error')
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during email saving'),
 
                    category='error')
 
        return redirect(url('edit_user', id=id))
 

	
 
    def delete_email(self, id):
 
        """DELETE /user_emails_delete/id: Delete an existing item"""
 
        # url('user_emails_delete', id=ID, method='delete')
 
        user_model = UserModel()
 
        user_model.delete_extra_email(id, request.POST.get('del_email'))
 
        Session().commit()
 
        h.flash(_("Removed email from user"), category='success')
 
        return redirect(url('edit_user', id=id))
 

	
 
    def add_ip(self, id):
 
        """POST /user_ips:Add an existing item"""
 
        # url('user_ips', id=ID, method='put')
 

	
 
        ip = request.POST.get('new_ip')
 
        user_model = UserModel()
 

	
 
        try:
 
            user_model.add_extra_ip(id, ip)
 
            Session().commit()
 
            h.flash(_("Added ip %s to user") % ip, category='success')
 
        except formencode.Invalid, error:
 
            msg = error.error_dict['ip']
 
            h.flash(msg, category='error')
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during ip saving'),
 
                    category='error')
 
        if 'default_user' in request.POST:
 
            return redirect(url('edit_permission', id='default'))
 
        return redirect(url('edit_user', id=id))
 

	
 
    def delete_ip(self, id):
 
        """DELETE /user_ips_delete/id: Delete an existing item"""
 
        # url('user_ips_delete', id=ID, method='delete')
 
        user_model = UserModel()
 
        user_model.delete_extra_ip(id, request.POST.get('del_ip'))
 
        Session().commit()
 
        h.flash(_("Removed ip from user"), category='success')
 
        if 'default_user' in request.POST:
 
            return redirect(url('edit_permission', id='default'))
 
        return redirect(url('edit_user', id=id))
rhodecode/controllers/admin/users_groups.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.admin.users_groups
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    User Groups crud controller for pylons
 

	
 
    :created_on: Jan 25, 2011
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 

	
 
from formencode import htmlfill
 
from pylons import request, session, tmpl_context as c, url, config
 
from pylons.controllers.util import abort, redirect
 
from pylons.i18n.translation import _
 

	
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.exceptions import UserGroupsAssignedException
 
from rhodecode.lib.utils2 import safe_unicode, str2bool
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator
 
from rhodecode.lib.base import BaseController, render
 

	
 
from rhodecode.model.users_group import UserGroupModel
 

	
 
from rhodecode.model.db import User, UserGroup, UserGroupToPerm,\
 
    UserGroupRepoToPerm, UserGroupRepoGroupToPerm
 
from rhodecode.model.forms import UserGroupForm
 
from rhodecode.model.meta import Session
 
from rhodecode.lib.utils import action_logger
 
from sqlalchemy.orm import joinedload
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class UsersGroupsController(BaseController):
 
    """REST Controller styled on the Atom Publishing Protocol"""
 
    # To properly map this controller, ensure your config/routing.py
 
    # file has a resource setup:
 
    #     map.resource('users_group', 'users_groups')
 

	
 
    @LoginRequired()
 
    @HasPermissionAllDecorator('hg.admin')
 
    def __before__(self):
 
        c.admin_user = session.get('admin_user')
 
        c.admin_username = session.get('admin_username')
 
        super(UsersGroupsController, self).__before__()
 
        c.available_permissions = config['available_permissions']
 

	
 
    def index(self, format='html'):
 
        """GET /users_groups: All items in the collection"""
 
        # url('users_groups')
 
        c.users_groups_list = UserGroup().query().all()
 
        return render('admin/users_groups/users_groups.html')
 

	
 
    def create(self):
 
        """POST /users_groups: Create a new item"""
 
        # url('users_groups')
 

	
 
        users_group_form = UserGroupForm()()
 
        try:
 
            form_result = users_group_form.to_python(dict(request.POST))
 
            UserGroupModel().create(name=form_result['users_group_name'],
 
                                     active=form_result['users_group_active'])
 
            gr = form_result['users_group_name']
 
            action_logger(self.rhodecode_user,
 
                          'admin_created_users_group:%s' % gr,
 
                          None, self.ip_addr, self.sa)
 
            h.flash(_('created user group %s') % gr, category='success')
 
            h.flash(_('Created user group %s') % gr, category='success')
 
            Session().commit()
 
        except formencode.Invalid, errors:
 
            return htmlfill.render(
 
                render('admin/users_groups/users_group_add.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during creation of user group %s') \
 
            h.flash(_('Error occurred during creation of user group %s') \
 
                    % request.POST.get('users_group_name'), category='error')
 

	
 
        return redirect(url('users_groups'))
 

	
 
    def new(self, format='html'):
 
        """GET /users_groups/new: Form to create a new item"""
 
        # url('new_users_group')
 
        return render('admin/users_groups/users_group_add.html')
 

	
 
    def _load_data(self, id):
 
        c.users_group.permissions = {
 
            'repositories': {},
 
            'repositories_groups': {}
 
        }
 

	
 
        ugroup_repo_perms = UserGroupRepoToPerm.query()\
 
            .options(joinedload(UserGroupRepoToPerm.permission))\
 
            .options(joinedload(UserGroupRepoToPerm.repository))\
 
            .filter(UserGroupRepoToPerm.users_group_id == id)\
 
            .all()
 

	
 
        for gr in ugroup_repo_perms:
 
            c.users_group.permissions['repositories'][gr.repository.repo_name]  \
 
                = gr.permission.permission_name
 

	
 
        ugroup_group_perms = UserGroupRepoGroupToPerm.query()\
 
            .options(joinedload(UserGroupRepoGroupToPerm.permission))\
 
            .options(joinedload(UserGroupRepoGroupToPerm.group))\
 
            .filter(UserGroupRepoGroupToPerm.users_group_id == id)\
 
            .all()
 

	
 
        for gr in ugroup_group_perms:
 
            c.users_group.permissions['repositories_groups'][gr.group.group_name] \
 
                = gr.permission.permission_name
 

	
 
        c.group_members_obj = [x.user for x in c.users_group.members]
 
        c.group_members = [(x.user_id, x.username) for x in
 
                           c.group_members_obj]
 
        c.available_members = [(x.user_id, x.username) for x in
 
                               User.query().all()]
 

	
 
    def update(self, id):
 
        """PUT /users_groups/id: Update an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="PUT" />
 
        # Or using helpers:
 
        #    h.form(url('users_group', id=ID),
 
        #           method='put')
 
        # url('users_group', id=ID)
 

	
 
        c.users_group = UserGroup.get_or_404(id)
 
        self._load_data(id)
 

	
 
        available_members = [safe_unicode(x[0]) for x in c.available_members]
 

	
 
        users_group_form = UserGroupForm(edit=True,
 
                                          old_data=c.users_group.get_dict(),
 
                                          available_members=available_members)()
 

	
 
        try:
 
            form_result = users_group_form.to_python(request.POST)
 
            UserGroupModel().update(c.users_group, form_result)
 
            gr = form_result['users_group_name']
 
            action_logger(self.rhodecode_user,
 
                          'admin_updated_users_group:%s' % gr,
 
                          None, self.ip_addr, self.sa)
 
            h.flash(_('updated user group %s') % gr, category='success')
 
            h.flash(_('Updated user group %s') % gr, category='success')
 
            Session().commit()
 
        except formencode.Invalid, errors:
 
            ug_model = UserGroupModel()
 
            defaults = errors.value
 
            e = errors.error_dict or {}
 
            defaults.update({
 
                'create_repo_perm': ug_model.has_perm(id,
 
                                                      'hg.create.repository'),
 
                'fork_repo_perm': ug_model.has_perm(id,
 
                                                    'hg.fork.repository'),
 
                '_method': 'put'
 
            })
 

	
 
            return htmlfill.render(
 
                render('admin/users_groups/users_group_edit.html'),
 
                defaults=defaults,
 
                errors=e,
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during update of user group %s') \
 
            h.flash(_('Error occurred during update of user group %s') \
 
                    % request.POST.get('users_group_name'), category='error')
 

	
 
        return redirect(url('edit_users_group', id=id))
 

	
 
    def delete(self, id):
 
        """DELETE /users_groups/id: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('users_group', id=ID),
 
        #           method='delete')
 
        # url('users_group', id=ID)
 
        usr_gr = UserGroup.get_or_404(id)
 
        try:
 
            UserGroupModel().delete(usr_gr)
 
            Session().commit()
 
            h.flash(_('successfully deleted user group'), category='success')
 
            h.flash(_('Successfully deleted user group'), category='success')
 
        except UserGroupsAssignedException, e:
 
            h.flash(e, category='error')
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of user group'),
 
                    category='error')
 
        return redirect(url('users_groups'))
 

	
 
    def show(self, id, format='html'):
 
        """GET /users_groups/id: Show a specific item"""
 
        # url('users_group', id=ID)
 

	
 
    def edit(self, id, format='html'):
 
        """GET /users_groups/id/edit: Form to edit an existing item"""
 
        # url('edit_users_group', id=ID)
 

	
 
        c.users_group = UserGroup.get_or_404(id)
 
        self._load_data(id)
 

	
 
        ug_model = UserGroupModel()
 
        defaults = c.users_group.get_dict()
 
        defaults.update({
 
            'create_repo_perm': ug_model.has_perm(c.users_group,
 
                                                  'hg.create.repository'),
 
            'fork_repo_perm': ug_model.has_perm(c.users_group,
 
                                                'hg.fork.repository'),
 
        })
 

	
 
        return htmlfill.render(
 
            render('admin/users_groups/users_group_edit.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    def update_perm(self, id):
 
        """PUT /users_perm/id: Update an existing item"""
 
        # url('users_group_perm', id=ID, method='put')
 

	
 
        users_group = UserGroup.get_or_404(id)
 
        grant_create_perm = str2bool(request.POST.get('create_repo_perm'))
 
        grant_fork_perm = str2bool(request.POST.get('fork_repo_perm'))
 
        inherit_perms = str2bool(request.POST.get('inherit_default_permissions'))
 

	
 
        usergroup_model = UserGroupModel()
 

	
 
        try:
 
            users_group.inherit_default_permissions = inherit_perms
 
            Session().add(users_group)
 

	
 
            if grant_create_perm:
 
                usergroup_model.revoke_perm(id, 'hg.create.none')
 
                usergroup_model.grant_perm(id, 'hg.create.repository')
 
                h.flash(_("Granted 'repository create' permission to user group"),
 
                        category='success')
 
            else:
 
                usergroup_model.revoke_perm(id, 'hg.create.repository')
 
                usergroup_model.grant_perm(id, 'hg.create.none')
 
                h.flash(_("Revoked 'repository create' permission to user group"),
 
                        category='success')
 

	
 
            if grant_fork_perm:
 
                usergroup_model.revoke_perm(id, 'hg.fork.none')
 
                usergroup_model.grant_perm(id, 'hg.fork.repository')
 
                h.flash(_("Granted 'repository fork' permission to user group"),
 
                        category='success')
 
            else:
 
                usergroup_model.revoke_perm(id, 'hg.fork.repository')
 
                usergroup_model.grant_perm(id, 'hg.fork.none')
 
                h.flash(_("Revoked 'repository fork' permission to user group"),
 
                        category='success')
 

	
 
            Session().commit()
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during permissions saving'),
 
                    category='error')
 

	
 
        return redirect(url('edit_users_group', id=id))
rhodecode/controllers/forks.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.forks
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    forks controller for rhodecode
 

	
 
    :created_on: Apr 23, 2011
 
    :author: marcink
 
    :copyright: (C) 2011-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
import logging
 
import formencode
 
import traceback
 
from formencode import htmlfill
 

	
 
from pylons import tmpl_context as c, request, url
 
from pylons.controllers.util import redirect
 
from pylons.i18n.translation import _
 

	
 
import rhodecode.lib.helpers as h
 

	
 
from rhodecode.lib.helpers import Page
 
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator, \
 
    NotAnonymous, HasRepoPermissionAny, HasPermissionAllDecorator,\
 
    HasPermissionAnyDecorator
 
from rhodecode.lib.base import BaseRepoController, render
 
from rhodecode.model.db import Repository, RepoGroup, UserFollowing, User
 
from rhodecode.model.repo import RepoModel
 
from rhodecode.model.forms import RepoForkForm
 
from rhodecode.model.scm import ScmModel, GroupList
 
from rhodecode.lib.utils2 import safe_int
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class ForksController(BaseRepoController):
 

	
 
    @LoginRequired()
 
    def __before__(self):
 
        super(ForksController, self).__before__()
 

	
 
    def __load_defaults(self):
 
        acl_groups = GroupList(RepoGroup.query().all(),
 
                               perm_set=['group.write', 'group.admin'])
 
        c.repo_groups = RepoGroup.groups_choices(groups=acl_groups)
 
        c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups)
 
        choices, c.landing_revs = ScmModel().get_repo_landing_revs()
 
        c.landing_revs_choices = choices
 

	
 
    def __load_data(self, repo_name=None):
 
        """
 
        Load defaults settings for edit, and update
 

	
 
        :param repo_name:
 
        """
 
        self.__load_defaults()
 

	
 
        c.repo_info = db_repo = Repository.get_by_repo_name(repo_name)
 
        repo = db_repo.scm_instance
 

	
 
        if c.repo_info is None:
 
            h.not_mapped_error(repo_name)
 
            return redirect(url('repos'))
 

	
 
        c.default_user_id = User.get_by_username('default').user_id
 
        c.in_public_journal = UserFollowing.query()\
 
            .filter(UserFollowing.user_id == c.default_user_id)\
 
            .filter(UserFollowing.follows_repository == c.repo_info).scalar()
 

	
 
        if c.repo_info.stats:
 
            last_rev = c.repo_info.stats.stat_on_revision+1
 
        else:
 
            last_rev = 0
 
        c.stats_revision = last_rev
 

	
 
        c.repo_last_rev = repo.count() if repo.revisions else 0
 

	
 
        if last_rev == 0 or c.repo_last_rev == 0:
 
            c.stats_percentage = 0
 
        else:
 
            c.stats_percentage = '%.2f' % ((float((last_rev)) /
 
                                            c.repo_last_rev) * 100)
 

	
 
        defaults = RepoModel()._get_defaults(repo_name)
 
        # alter the description to indicate a fork
 
        defaults['description'] = ('fork of repository: %s \n%s'
 
                                   % (defaults['repo_name'],
 
                                      defaults['description']))
 
        # add suffix to fork
 
        defaults['repo_name'] = '%s-fork' % defaults['repo_name']
 

	
 
        return defaults
 

	
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def forks(self, repo_name):
 
        p = safe_int(request.params.get('page', 1), 1)
 
        repo_id = c.rhodecode_db_repo.repo_id
 
        d = []
 
        for r in Repository.get_repo_forks(repo_id):
 
            if not HasRepoPermissionAny(
 
                'repository.read', 'repository.write', 'repository.admin'
 
            )(r.repo_name, 'get forks check'):
 
                continue
 
            d.append(r)
 
        c.forks_pager = Page(d, page=p, items_per_page=20)
 

	
 
        c.forks_data = render('/forks/forks_data.html')
 

	
 
        if request.environ.get('HTTP_X_PARTIAL_XHR'):
 
            return c.forks_data
 

	
 
        return render('/forks/forks.html')
 

	
 
    @NotAnonymous()
 
    @HasPermissionAnyDecorator('hg.admin', 'hg.fork.repository')
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def fork(self, repo_name):
 
        c.repo_info = Repository.get_by_repo_name(repo_name)
 
        if not c.repo_info:
 
            h.not_mapped_error(repo_name)
 
            return redirect(url('home'))
 

	
 
        defaults = self.__load_data(repo_name)
 

	
 
        return htmlfill.render(
 
            render('forks/fork.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    @NotAnonymous()
 
    @HasPermissionAnyDecorator('hg.admin', 'hg.fork.repository')
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def fork_create(self, repo_name):
 
        self.__load_defaults()
 
        c.repo_info = Repository.get_by_repo_name(repo_name)
 
        _form = RepoForkForm(old_data={'repo_type': c.repo_info.repo_type},
 
                             repo_groups=c.repo_groups_choices,
 
                             landing_revs=c.landing_revs_choices)()
 
        form_result = {}
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 

	
 
            # create fork is done sometimes async on celery, db transaction
 
            # management is handled there.
 
            RepoModel().create_fork(form_result, self.rhodecode_user.user_id)
 
            fork_url = h.link_to(form_result['repo_name'],
 
                    h.url('summary_home', repo_name=form_result['repo_name_full']))
 

	
 
            h.flash(h.literal(_('forked repository %s as %s') \
 
            h.flash(h.literal(_('Forked repository %s as %s') \
 
                      % (repo_name, fork_url)),
 
                    category='success')
 
        except formencode.Invalid, errors:
 
            c.new_repo = errors.value['repo_name']
 

	
 
            return htmlfill.render(
 
                render('forks/fork.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during repository forking %s') %
 
                    repo_name, category='error')
 

	
 
        return redirect(url('home'))
rhodecode/controllers/settings.py
Show inline comments
 
# -*- coding: utf-8 -*-
 
"""
 
    rhodecode.controllers.settings
 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

	
 
    Settings controller for rhodecode
 

	
 
    :created_on: Jun 30, 2010
 
    :author: marcink
 
    :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
 
    :license: GPLv3, see COPYING for more details.
 
"""
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
 
# the Free Software Foundation, either version 3 of the License, or
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 

	
 
from formencode import htmlfill
 

	
 
from pylons import tmpl_context as c, request, url
 
from pylons.controllers.util import redirect
 
from pylons.i18n.translation import _
 

	
 
import rhodecode.lib.helpers as h
 

	
 
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAllDecorator,\
 
    HasRepoPermissionAnyDecorator
 
from rhodecode.lib.base import BaseRepoController, render
 
from rhodecode.lib.utils import invalidate_cache, action_logger
 

	
 
from rhodecode.model.forms import RepoSettingsForm
 
from rhodecode.model.repo import RepoModel
 
from rhodecode.model.db import RepoGroup, Repository, RepositoryField
 
from rhodecode.model.meta import Session
 
from rhodecode.model.scm import ScmModel, GroupList
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class SettingsController(BaseRepoController):
 

	
 
    @LoginRequired()
 
    def __before__(self):
 
        super(SettingsController, self).__before__()
 

	
 
    def __load_defaults(self):
 
        acl_groups = GroupList(RepoGroup.query().all(),
 
                               perm_set=['group.write', 'group.admin'])
 
        c.repo_groups = RepoGroup.groups_choices(groups=acl_groups)
 
        c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups)
 

	
 
        repo_model = RepoModel()
 
        c.users_array = repo_model.get_users_js()
 
        c.users_groups_array = repo_model.get_users_groups_js()
 
        choices, c.landing_revs = ScmModel().get_repo_landing_revs()
 
        c.landing_revs_choices = choices
 

	
 
    def __load_data(self, repo_name=None):
 
        """
 
        Load defaults settings for edit, and update
 

	
 
        :param repo_name:
 
        """
 
        self.__load_defaults()
 

	
 
        c.repo_info = db_repo = Repository.get_by_repo_name(repo_name)
 

	
 
        if c.repo_info is None:
 
            h.not_mapped_error(repo_name)
 
            return redirect(url('home'))
 

	
 
        ##override defaults for exact repo info here git/hg etc
 
        choices, c.landing_revs = ScmModel().get_repo_landing_revs(c.repo_info)
 
        c.landing_revs_choices = choices
 
        c.repo_fields = RepositoryField.query()\
 
            .filter(RepositoryField.repository == db_repo).all()
 
        defaults = RepoModel()._get_defaults(repo_name)
 

	
 
        return defaults
 

	
 
    @HasRepoPermissionAllDecorator('repository.admin')
 
    def index(self, repo_name):
 
        defaults = self.__load_data(repo_name)
 

	
 
        return htmlfill.render(
 
            render('settings/repo_settings.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
            force_defaults=False
 
        )
 

	
 
    @HasRepoPermissionAllDecorator('repository.admin')
 
    def update(self, repo_name):
 
        self.__load_defaults()
 
        repo_model = RepoModel()
 
        changed_name = repo_name
 
        #override the choices with extracted revisions !
 
        choices, c.landing_revs = ScmModel().get_repo_landing_revs(repo_name)
 
        c.landing_revs_choices = choices
 
        repo = Repository.get_by_repo_name(repo_name)
 
        _form = RepoSettingsForm(edit=True,
 
                                old_data={'repo_name': repo_name,
 
                                          'repo_group': repo.group.get_dict() \
 
                                              if repo.group else {}},
 
                                 repo_groups=c.repo_groups_choices,
 
                                 landing_revs=c.landing_revs_choices)()
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 
            repo_model.update(repo_name, **form_result)
 
            invalidate_cache('get_repo_cached_%s' % repo_name)
 
            h.flash(_('Repository %s updated successfully') % repo_name,
 
                    category='success')
 
            changed_name = form_result['repo_name_full']
 
            action_logger(self.rhodecode_user, 'user_updated_repo',
 
                          changed_name, self.ip_addr, self.sa)
 
            Session().commit()
 
        except formencode.Invalid, errors:
 
            defaults = self.__load_data(repo_name)
 
            defaults.update(errors.value)
 
            return htmlfill.render(
 
                render('settings/repo_settings.html'),
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")
 

	
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during update of repository %s') \
 
            h.flash(_('Error occurred during update of repository %s') \
 
                    % repo_name, category='error')
 

	
 
        return redirect(url('repo_settings_home', repo_name=changed_name))
 

	
 
    @HasRepoPermissionAllDecorator('repository.admin')
 
    def delete(self, repo_name):
 
        """DELETE /repos/repo_name: Delete an existing item"""
 
        # Forms posted to this method should contain a hidden field:
 
        #    <input type="hidden" name="_method" value="DELETE" />
 
        # Or using helpers:
 
        #    h.form(url('repo_settings_delete', repo_name=ID),
 
        #           method='delete')
 
        # url('repo_settings_delete', repo_name=ID)
 

	
 
        repo_model = RepoModel()
 
        repo = repo_model.get_by_repo_name(repo_name)
 
        if not repo:
 
            h.not_mapped_error(repo_name)
 
            return redirect(url('home'))
 
        try:
 
            action_logger(self.rhodecode_user, 'user_deleted_repo',
 
                              repo_name, self.ip_addr, self.sa)
 
            repo_model.delete(repo)
 
            invalidate_cache('get_repo_cached_%s' % repo_name)
 
            h.flash(_('deleted repository %s') % repo_name, category='success')
 
            h.flash(_('Deleted repository %s') % repo_name, category='success')
 
            Session().commit()
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during deletion of %s') % repo_name,
 
                    category='error')
 

	
 
        return redirect(url('admin_settings_my_account', anchor='my'))
 

	
 
    @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
 
    def toggle_locking(self, repo_name):
 
        """
 
        Toggle locking of repository by simple GET call to url
 

	
 
        :param repo_name:
 
        """
 

	
 
        try:
 
            repo = Repository.get_by_repo_name(repo_name)
 

	
 
            if repo.enable_locking:
 
                if repo.locked[0]:
 
                    Repository.unlock(repo)
 
                    action = _('unlocked')
 
                else:
 
                    Repository.lock(repo, c.rhodecode_user.user_id)
 
                    action = _('locked')
 

	
 
                h.flash(_('Repository has been %s') % action,
 
                        category='success')
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            h.flash(_('An error occurred during unlocking'),
 
                    category='error')
 
        return redirect(url('summary_home', repo_name=repo_name))
rhodecode/i18n/en/LC_MESSAGES/rhodecode.mo
Show inline comments
 
binary diff not shown
rhodecode/i18n/en/LC_MESSAGES/rhodecode.po
Show inline comments
 
# English translations for rhodecode.
 
# Copyright (C) 2010 ORGANIZATION
 
# This file is distributed under the same license as the rhodecode project.
 
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
 
#
 
msgid ""
 
msgstr ""
 
"Project-Id-Version: rhodecode 0.1\n"
 
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
 
"POT-Creation-Date: 2013-01-28 00:24+0100\n"
 
"PO-Revision-Date: 2011-02-25 19:13+0100\n"
 
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 
"Language-Team: en <LL@li.org>\n"
 
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
 
"MIME-Version: 1.0\n"
 
"Content-Type: text/plain; charset=utf-8\n"
 
"Content-Transfer-Encoding: 8bit\n"
 
"Generated-By: Babel 0.9.6\n"
 

	
 
#: rhodecode/controllers/changelog.py:95
 
msgid "All Branches"
 
msgstr ""
 

	
 
#: rhodecode/controllers/changeset.py:83
 
msgid "show white space"
 
msgstr ""
 

	
 
#: rhodecode/controllers/changeset.py:90 rhodecode/controllers/changeset.py:97
 
msgid "ignore white space"
 
msgstr ""
 

	
 
#: rhodecode/controllers/changeset.py:163
 
#, python-format
 
msgid "%s line context"
 
msgstr ""
 

	
 
#: rhodecode/controllers/changeset.py:329
 
#: rhodecode/controllers/pullrequests.py:416
 
#, python-format
 
msgid "Status change -> %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/changeset.py:360
 
msgid ""
 
"Changing status on a changeset associated with a closed pull request is "
 
"not allowed"
 
msgstr ""
 

	
 
#: rhodecode/controllers/compare.py:75
 
#: rhodecode/controllers/pullrequests.py:121
 
#: rhodecode/controllers/shortlog.py:100
 
msgid "There are no changesets yet"
 
msgstr ""
 

	
 
#: rhodecode/controllers/error.py:69
 
msgid "Home page"
 
msgstr ""
 

	
 
#: rhodecode/controllers/error.py:98
 
msgid "The request could not be understood by the server due to malformed syntax."
 
msgstr ""
 

	
 
#: rhodecode/controllers/error.py:101
 
msgid "Unauthorized access to resource"
 
msgstr ""
 

	
 
#: rhodecode/controllers/error.py:103
 
msgid "You don't have permission to view this page"
 
msgstr ""
 

	
 
#: rhodecode/controllers/error.py:105
 
msgid "The resource could not be found"
 
msgstr ""
 

	
 
#: rhodecode/controllers/error.py:107
 
msgid ""
 
"The server encountered an unexpected condition which prevented it from "
 
"fulfilling the request."
 
msgstr ""
 

	
 
#: rhodecode/controllers/feed.py:52
 
#, python-format
 
msgid "Changes on %s repository"
 
msgstr ""
 

	
 
#: rhodecode/controllers/feed.py:53
 
#, python-format
 
msgid "%s %s feed"
 
msgstr ""
 

	
 
#: rhodecode/controllers/feed.py:86
 
#: rhodecode/templates/changeset/changeset.html:137
 
#: rhodecode/templates/changeset/changeset.html:149
 
#: rhodecode/templates/compare/compare_diff.html:62
 
#: rhodecode/templates/compare/compare_diff.html:73
 
#: rhodecode/templates/pullrequests/pullrequest_show.html:112
 
#: rhodecode/templates/pullrequests/pullrequest_show.html:171
 
msgid "Changeset was too big and was cut off..."
 
msgstr ""
 

	
 
#: rhodecode/controllers/feed.py:92
 
msgid "commited on"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:86
 
msgid "click here to add new file"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:87
 
#, python-format
 
msgid "There are no files yet %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:269 rhodecode/controllers/files.py:338
 
#, python-format
 
msgid "This repository is has been locked by %s on %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:281
 
msgid "You can only edit files with revision being a valid branch "
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:295
 
#, python-format
 
msgid "Edited file %s via RhodeCode"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:311
 
msgid "No changes"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:321 rhodecode/controllers/files.py:384
 
#, python-format
 
msgid "Successfully committed to %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:326 rhodecode/controllers/files.py:390
 
msgid "Error occurred during commit"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:350
 
msgid "Added file via RhodeCode"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:370
 
msgid "No content"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:374
 
msgid "No filename"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:416
 
msgid "downloads disabled"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:427
 
#, python-format
 
msgid "Unknown revision %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:429
 
msgid "Empty repository"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:431
 
msgid "Unknown archive type"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:576
 
#: rhodecode/templates/changeset/changeset_range.html:13
 
#: rhodecode/templates/changeset/changeset_range.html:31
 
msgid "Changesets"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:577 rhodecode/controllers/pullrequests.py:74
 
#: rhodecode/controllers/summary.py:236 rhodecode/model/scm.py:564
 
msgid "Branches"
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:578 rhodecode/controllers/pullrequests.py:78
 
#: rhodecode/controllers/summary.py:237 rhodecode/model/scm.py:575
 
msgid "Tags"
 
msgstr ""
 

	
 
#: rhodecode/controllers/forks.py:165
 
#, python-format
 
msgid "forked %s repository as %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/forks.py:179
 
#, python-format
 
msgid "An error occurred during repository forking %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/journal.py:275 rhodecode/controllers/journal.py:318
 
msgid "public journal"
 
msgstr ""
 

	
 
#: rhodecode/controllers/journal.py:279 rhodecode/controllers/journal.py:322
 
#: rhodecode/templates/base/base.html:238
 
#: rhodecode/templates/journal/journal.html:12
 
msgid "journal"
 
msgstr ""
 

	
 
#: rhodecode/controllers/login.py:142
 
msgid "You have successfully registered into rhodecode"
 
msgstr ""
 

	
 
#: rhodecode/controllers/login.py:163
 
msgid "Your password reset link was sent"
 
msgstr ""
 

	
 
#: rhodecode/controllers/login.py:183
 
msgid ""
 
"Your password reset was successful, new password has been sent to your "
 
"email"
 
msgstr ""
 

	
 
#: rhodecode/controllers/pullrequests.py:76 rhodecode/model/scm.py:570
 
msgid "Bookmarks"
 
msgstr ""
 

	
 
#: rhodecode/controllers/pullrequests.py:190
 
msgid "Pull request requires a title with min. 3 chars"
 
msgstr ""
 

	
 
#: rhodecode/controllers/pullrequests.py:192
 
msgid "error during creation of pull request"
 
msgstr ""
 

	
 
#: rhodecode/controllers/pullrequests.py:224
 
msgid "Successfully opened new pull request"
 
msgstr ""
 

	
 
#: rhodecode/controllers/pullrequests.py:227
 
msgid "Error occurred during sending pull request"
 
msgstr ""
 

	
 
#: rhodecode/controllers/pullrequests.py:260
 
msgid "Successfully deleted pull request"
 
msgstr ""
 

	
 
#: rhodecode/controllers/pullrequests.py:451
 
msgid "Closing pull request on other statuses than rejected or approved forbidden"
 
msgstr ""
 

	
 
#: rhodecode/controllers/search.py:134
 
msgid "Invalid search query. Try quoting it."
 
msgstr ""
 

	
 
#: rhodecode/controllers/search.py:139
 
msgid "There is no index to search in. Please run whoosh indexer"
 
msgstr ""
 

	
 
#: rhodecode/controllers/search.py:143
 
msgid "An error occurred during this search operation"
 
msgstr ""
 

	
 
#: rhodecode/controllers/settings.py:120
 
#: rhodecode/controllers/admin/repos.py:254
 
#, python-format
 
msgid "Repository %s updated successfully"
 
msgstr ""
 

	
 
#: rhodecode/controllers/settings.py:138
 
#: rhodecode/controllers/admin/repos.py:272
 
#, python-format
 
msgid "error occurred during update of repository %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/settings.py:163
 
#: rhodecode/controllers/admin/repos.py:297
 
#, python-format
 
msgid "deleted repository %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/settings.py:167
 
#: rhodecode/controllers/admin/repos.py:307
 
#: rhodecode/controllers/admin/repos.py:313
 
#, python-format
 
msgid "An error occurred during deletion of %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/settings.py:186
 
msgid "unlocked"
 
msgstr ""
 

	
 
#: rhodecode/controllers/settings.py:189
 
msgid "locked"
 
msgstr ""
 

	
 
#: rhodecode/controllers/settings.py:191
 
#, python-format
 
msgid "Repository has been %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/settings.py:195
 
#: rhodecode/controllers/admin/repos.py:405
 
msgid "An error occurred during unlocking"
 
msgstr ""
 

	
 
#: rhodecode/controllers/summary.py:140
 
msgid "No data loaded yet"
 
msgstr ""
 

	
 
#: rhodecode/controllers/summary.py:144
 
#: rhodecode/templates/summary/summary.html:157
 
msgid "Statistics are disabled for this repository"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/defaults.py:96
 
msgid "Default settings updated successfully"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/defaults.py:110
 
msgid "error occurred during update of defaults"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:50
 
msgid "BASE"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:51
 
msgid "ONELEVEL"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:52
 
msgid "SUBTREE"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:56
 
msgid "NEVER"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:57
 
msgid "ALLOW"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:58
 
msgid "TRY"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:59
 
msgid "DEMAND"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:60
 
msgid "HARD"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:64
 
msgid "No encryption"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:65
 
msgid "LDAPS connection"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:66
 
msgid "START_TLS on LDAP connection"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:126
 
msgid "Ldap settings updated successfully"
 
msgid "LDAP settings updated successfully"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:130
 
msgid "Unable to activate ldap. The \"python-ldap\" library is missing."
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:147
 
msgid "error occurred during update of ldap settings"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:60
 
#: rhodecode/controllers/admin/permissions.py:64
 
msgid "None"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:61
 
#: rhodecode/controllers/admin/permissions.py:65
 
msgid "Read"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:62
 
#: rhodecode/controllers/admin/permissions.py:66
 
msgid "Write"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:63
 
#: rhodecode/controllers/admin/permissions.py:67
 
#: rhodecode/templates/admin/defaults/defaults.html:9
 
#: rhodecode/templates/admin/ldap/ldap.html:9
 
#: rhodecode/templates/admin/permissions/permissions.html:9
 
#: rhodecode/templates/admin/repos/repo_add.html:9
 
#: rhodecode/templates/admin/repos/repo_edit.html:9
 
#: rhodecode/templates/admin/repos/repos.html:9
 
#: rhodecode/templates/admin/repos_groups/repos_groups_add.html:8
 
#: rhodecode/templates/admin/repos_groups/repos_groups_edit.html:8
 
#: rhodecode/templates/admin/repos_groups/repos_groups_show.html:10
 
#: rhodecode/templates/admin/settings/hooks.html:9
 
#: rhodecode/templates/admin/settings/settings.html:9
 
#: rhodecode/templates/admin/users/user_add.html:8
 
#: rhodecode/templates/admin/users/user_edit.html:9
 
#: rhodecode/templates/admin/users/user_edit.html:130
 
#: rhodecode/templates/admin/users/users.html:9
 
#: rhodecode/templates/admin/users_groups/users_group_add.html:8
 
#: rhodecode/templates/admin/users_groups/users_group_edit.html:9
 
#: rhodecode/templates/admin/users_groups/users_groups.html:9
 
#: rhodecode/templates/base/base.html:203
 
#: rhodecode/templates/base/base.html:324
 
#: rhodecode/templates/base/base.html:326
 
#: rhodecode/templates/base/base.html:328
 
msgid "Admin"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:70
 
msgid "disabled"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:72
 
msgid "allowed with manual account activation"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:74
 
msgid "allowed with automatic account activation"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:76
 
#: rhodecode/controllers/admin/permissions.py:79
 
msgid "Disabled"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:77
 
#: rhodecode/controllers/admin/permissions.py:80
 
msgid "Enabled"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:128
 
msgid "Default permissions updated successfully"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/permissions.py:142
 
msgid "error occurred during update of permissions"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:123
 
msgid "--REMOVE FORK--"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:162
 
#, python-format
 
msgid "created repository %s from %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:166
 
#, python-format
 
msgid "created repository %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:197
 
#, python-format
 
msgid "error occurred during creation of repository %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:302
 
#, python-format
 
msgid "Cannot delete %s it still contains attached forks"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:331
 
msgid "An error occurred during deletion of repository user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:350
 
msgid "An error occurred during deletion of repository users groups"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:368
 
msgid "An error occurred during deletion of repository stats"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:385
 
msgid "An error occurred during cache invalidation"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:425
 
msgid "Updated repository visibility in public journal"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:429
 
msgid "An error occurred during setting this repository in public journal"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:434 rhodecode/model/validators.py:301
 
msgid "Token mismatch"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:447
 
msgid "Pulled from remote location"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:449
 
msgid "An error occurred during pull from remote location"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:465
 
msgid "Nothing"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:467
 
#, python-format
 
msgid "Marked repo %s as fork of %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos.py:471
 
msgid "An error occurred during this operation"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:136
 
#, python-format
 
msgid "created repos group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:148
 
#, python-format
 
msgid "error occurred during creation of repos group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:205
 
#, python-format
 
msgid "updated repos group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:220
 
#, python-format
 
msgid "error occurred during update of repos group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:238
 
#, python-format
 
msgid "This group contains %s repositores and cannot be deleted"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:246
 
#, python-format
 
msgid "removed repos group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:252
 
msgid "Cannot delete this group it still contains subgroups"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:257
 
#: rhodecode/controllers/admin/repos_groups.py:262
 
#, python-format
 
msgid "error occurred during deletion of repos group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:283
 
msgid "An error occurred during deletion of group user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:304
 
msgid "An error occurred during deletion of group users groups"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:124
 
#, python-format
 
msgid "Repositories successfully rescanned added: %s ; removed: %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:133
 
msgid "Whoosh reindex task scheduled"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:164
 
msgid "Updated application settings"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:168
 
#: rhodecode/controllers/admin/settings.py:301
 
msgid "error occurred during updating application settings"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:209
 
msgid "Updated visualisation settings"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:214
 
msgid "error occurred during updating visualisation settings"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:297
 
msgid "Updated VCS settings"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:311
 
msgid "Added new hook"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:323
 
msgid "Updated hooks"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:327
 
msgid "error occurred during hook creation"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:346
 
msgid "Email task created"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:408
 
msgid "You can't edit this user since it's crucial for entire application"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:448
 
msgid "Your account was updated successfully"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/settings.py:463
 
#: rhodecode/controllers/admin/users.py:198
 
#, python-format
 
msgid "error occurred during update of user %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:130
 
#, python-format
 
msgid "created user %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:142
 
#, python-format
 
msgid "error occurred during creation of user %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:176
 
msgid "User updated successfully"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:214
 
msgid "successfully deleted user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:219
 
msgid "An error occurred during deletion of user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:233
 
msgid "You can't edit this user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:276
 
msgid "Granted 'repository create' permission to user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:281
 
msgid "Revoked 'repository create' permission to user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:287
 
msgid "Granted 'repository fork' permission to user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:292
 
msgid "Revoked 'repository fork' permission to user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:298
 
#: rhodecode/controllers/admin/users_groups.py:279
 
msgid "An error occurred during permissions saving"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:312
 
#, python-format
 
msgid "Added email %s to user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:318
 
msgid "An error occurred during email saving"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:328
 
msgid "Removed email from user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:341
 
#, python-format
 
msgid "Added ip %s to user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:347
 
msgid "An error occurred during ip saving"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users.py:359
 
msgid "Removed ip from user"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:86
 
#, python-format
 
msgid "created users group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:97
 
#, python-format
 
msgid "error occurred during creation of users group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:164
 
#, python-format
 
msgid "updated users group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:186
 
#, python-format
 
msgid "error occurred during update of users group %s"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:203
 
msgid "successfully deleted users group"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:208
 
msgid "An error occurred during deletion of users group"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:257
 
msgid "Granted 'repository create' permission to users group"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:262
 
msgid "Revoked 'repository create' permission to users group"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:268
 
msgid "Granted 'repository fork' permission to users group"
 
msgstr ""
 

	
 
#: rhodecode/controllers/admin/users_groups.py:273
 
msgid "Revoked 'repository fork' permission to users group"
 
msgstr ""
 

	
 
#: rhodecode/lib/auth.py:509
 
#, python-format
 
msgid "IP %s not allowed"
 
msgstr ""
 

	
 
#: rhodecode/lib/auth.py:558
 
msgid "You need to be a registered user to perform this action"
 
msgstr ""
 

	
 
#: rhodecode/lib/auth.py:599
 
msgid "You need to be a signed in to view this page"
 
msgstr ""
 

	
 
#: rhodecode/lib/diffs.py:74
 
msgid "binary file"
 
msgstr ""
 

	
 
#: rhodecode/lib/diffs.py:90
 
msgid "Changeset was too big and was cut off, use diff menu to display this diff"
 
msgstr ""
 

	
 
#: rhodecode/lib/diffs.py:100
 
msgid "No changes detected"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:374
 
#, python-format
 
msgid "%a, %d %b %Y %H:%M:%S"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:486
 
msgid "True"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:490
 
msgid "False"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:530
 
#, python-format
 
msgid "Deleted branch: %s"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:533
 
#, python-format
 
msgid "Created tag: %s"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:546
 
msgid "Changeset not found"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:589
 
#, python-format
 
msgid "Show all combined changesets %s->%s"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:595
 
msgid "compare view"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:615
 
msgid "and"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:616
 
#, python-format
 
msgid "%s more"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:617 rhodecode/templates/changelog/changelog.html:51
 
msgid "revisions"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:641
 
#, python-format
 
msgid "fork name %s"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:658
 
#: rhodecode/templates/pullrequests/pullrequest_show.html:4
 
#: rhodecode/templates/pullrequests/pullrequest_show.html:12
 
#, python-format
 
msgid "Pull request #%s"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:664
 
msgid "[deleted] repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:666 rhodecode/lib/helpers.py:676
 
msgid "[created] repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:668
 
msgid "[created] repository as fork"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:670 rhodecode/lib/helpers.py:678
 
msgid "[forked] repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:672 rhodecode/lib/helpers.py:680
 
msgid "[updated] repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:674
 
msgid "[delete] repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:682
 
msgid "[created] user"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:684
 
msgid "[updated] user"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:686
 
msgid "[created] users group"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:688
 
msgid "[updated] users group"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:690
 
msgid "[commented] on revision in repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:692
 
msgid "[commented] on pull request for"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:694
 
msgid "[closed] pull request for"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:696
 
msgid "[pushed] into"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:698
 
msgid "[committed via RhodeCode] into repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:700
 
msgid "[pulled from remote] into repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:702
 
msgid "[pulled] from"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:704
 
msgid "[started following] repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:706
 
msgid "[stopped following] repository"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:884
 
#, python-format
 
msgid " and %s more"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:888
 
msgid "No Files"
 
msgstr ""
 

	
 
#: rhodecode/lib/helpers.py:1164
 
#, python-format
 
msgid ""
 
"%s repository is not mapped to db perhaps it was created or renamed from "
 
"the filesystem please run the application again in order to rescan "
 
"repositories"
 
msgstr ""
 

	
 
#: rhodecode/lib/utils2.py:403
 
#, python-format
 
msgid "%d year"
 
msgid_plural "%d years"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: rhodecode/lib/utils2.py:404
 
#, python-format
 
msgid "%d month"
 
msgid_plural "%d months"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: rhodecode/lib/utils2.py:405
 
#, python-format
 
msgid "%d day"
 
msgid_plural "%d days"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: rhodecode/lib/utils2.py:406
 
#, python-format
 
msgid "%d hour"
 
msgid_plural "%d hours"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: rhodecode/lib/utils2.py:407
 
#, python-format
 
msgid "%d minute"
 
msgid_plural "%d minutes"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: rhodecode/lib/utils2.py:408
 
#, python-format
 
msgid "%d second"
 
msgid_plural "%d seconds"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: rhodecode/lib/utils2.py:424
 
#, python-format
 
msgid "in %s"
 
msgstr ""
 

	
 
#: rhodecode/lib/utils2.py:426
 
#, python-format
 
msgid "%s ago"
 
msgstr ""
 

	
 
#: rhodecode/lib/utils2.py:428
 
#, python-format
 
msgid "in %s and %s"
 
msgstr ""
 

	
 
#: rhodecode/lib/utils2.py:431
 
#, python-format
 
msgid "%s and %s ago"
 
msgstr ""
 

	
 
#: rhodecode/lib/utils2.py:434
 
msgid "just now"
 
msgstr ""
 

	
 
#: rhodecode/lib/celerylib/tasks.py:270
 
msgid "password reset link"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1163
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1183 rhodecode/model/db.py:1313
 
msgid "Repository no access"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1164
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1184 rhodecode/model/db.py:1314
 
msgid "Repository read access"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1165
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1185 rhodecode/model/db.py:1315
 
msgid "Repository write access"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1166
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1186 rhodecode/model/db.py:1316
 
msgid "Repository admin access"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1168
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1188 rhodecode/model/db.py:1318
 
msgid "Repositories Group no access"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1169
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1189 rhodecode/model/db.py:1319
 
msgid "Repositories Group read access"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1170
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1190 rhodecode/model/db.py:1320
 
msgid "Repositories Group write access"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1171
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1191 rhodecode/model/db.py:1321
 
msgid "Repositories Group admin access"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1173
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1193 rhodecode/model/db.py:1323
 
msgid "RhodeCode Administrator"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1174
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1194 rhodecode/model/db.py:1324
 
msgid "Repository creation disabled"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1175
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1195 rhodecode/model/db.py:1325
 
msgid "Repository creation enabled"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1176
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1196 rhodecode/model/db.py:1326
 
msgid "Repository forking disabled"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1177
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1197 rhodecode/model/db.py:1327
 
msgid "Repository forking enabled"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1178
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1198 rhodecode/model/db.py:1328
 
msgid "Register disabled"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1179
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1199 rhodecode/model/db.py:1329
 
msgid "Register new user with RhodeCode with manual activation"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1182
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1202 rhodecode/model/db.py:1332
 
msgid "Register new user with RhodeCode with auto activation"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1623
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1643 rhodecode/model/db.py:1776
 
msgid "Not Reviewed"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1624
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1644 rhodecode/model/db.py:1777
 
msgid "Approved"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1625
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1645 rhodecode/model/db.py:1778
 
msgid "Rejected"
 
msgstr ""
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1626
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1646 rhodecode/model/db.py:1779
 
msgid "Under Review"
 
msgstr ""
 

	
 
#: rhodecode/model/comment.py:109
 
#, python-format
 
msgid "on line %s"
 
msgstr ""
 

	
 
#: rhodecode/model/comment.py:176
 
msgid "[Mention]"
 
msgstr ""
 

	
 
#: rhodecode/model/forms.py:43
 
msgid "Please enter a login"
 
msgstr ""
 

	
 
#: rhodecode/model/forms.py:44
 
#, python-format
 
msgid "Enter a value %(min)i characters long or more"
 
msgstr ""
 

	
 
#: rhodecode/model/forms.py:52
 
msgid "Please enter a password"
 
msgstr ""
 

	
 
#: rhodecode/model/forms.py:53
 
#, python-format
 
msgid "Enter %(min)i characters or more"
 
msgstr ""
 

	
 
#: rhodecode/model/notification.py:220
 
#, python-format
 
msgid "commented on commit at %(when)s"
 
msgstr ""
 

	
 
#: rhodecode/model/notification.py:221
 
#, python-format
 
msgid "sent message at %(when)s"
 
msgstr ""
 

	
 
#: rhodecode/model/notification.py:222
 
#, python-format
rhodecode/i18n/fr/LC_MESSAGES/rhodecode.mo
Show inline comments
 
binary diff not shown
rhodecode/i18n/fr/LC_MESSAGES/rhodecode.po
Show inline comments
 
# French translations for RhodeCode.
 
# Copyright (C) 2011 ORGANIZATION
 
# This file is distributed under the same license as the RhodeCode project.
 
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
 
#
 
msgid ""
 
msgstr ""
 
"Project-Id-Version: RhodeCode 1.1.5\n"
 
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
 
"POT-Creation-Date: 2013-01-28 00:24+0100\n"
 
"PO-Revision-Date: 2012-10-02 11:32+0100\n"
 
"Last-Translator: Vincent Duvert <vincent@duvert.net>\n"
 
"Language-Team: fr <LL@li.org>\n"
 
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
 
"MIME-Version: 1.0\n"
 
"Content-Type: text/plain; charset=utf-8\n"
 
"Content-Transfer-Encoding: 8bit\n"
 
"Generated-By: Babel 0.9.6\n"
 

	
 
#: rhodecode/controllers/changelog.py:95
 
msgid "All Branches"
 
msgstr "Toutes les branches"
 

	
 
#: rhodecode/controllers/changeset.py:83
 
msgid "show white space"
 
msgstr "Afficher les espaces et tabulations"
 

	
 
#: rhodecode/controllers/changeset.py:90 rhodecode/controllers/changeset.py:97
 
msgid "ignore white space"
 
msgstr "Ignorer les espaces et tabulations"
 

	
 
#: rhodecode/controllers/changeset.py:163
 
#, python-format
 
msgid "%s line context"
 
msgstr "Afficher %s lignes de contexte"
 

	
 
#: rhodecode/controllers/changeset.py:329
 
#: rhodecode/controllers/pullrequests.py:416
 
#, python-format
 
msgid "Status change -> %s"
 
msgstr "Changement de statut -> %s"
 

	
 
#: rhodecode/controllers/changeset.py:360
 
#, fuzzy
 
msgid ""
 
"Changing status on a changeset associated with a closed pull request is "
 
"not allowed"
 
msgstr ""
 
"Le changement de statut d’un changeset associé à une pull request fermée "
 
"n’est pas autorisé."
 

	
 
#: rhodecode/controllers/compare.py:75
 
#: rhodecode/controllers/pullrequests.py:121
 
#: rhodecode/controllers/shortlog.py:100
 
msgid "There are no changesets yet"
 
msgstr "Il n’y a aucun changement pour le moment"
 

	
 
#: rhodecode/controllers/error.py:69
 
msgid "Home page"
 
msgstr "Accueil"
 

	
 
#: rhodecode/controllers/error.py:98
 
msgid "The request could not be understood by the server due to malformed syntax."
 
msgstr ""
 
"Le serveur n’a pas pu interpréter la requête à cause d’une erreur de "
 
"syntaxe"
 

	
 
#: rhodecode/controllers/error.py:101
 
msgid "Unauthorized access to resource"
 
msgstr "Accès interdit à cet ressource"
 

	
 
#: rhodecode/controllers/error.py:103
 
msgid "You don't have permission to view this page"
 
msgstr "Vous n’avez pas la permission de voir cette page"
 

	
 
#: rhodecode/controllers/error.py:105
 
msgid "The resource could not be found"
 
msgstr "Ressource introuvable"
 

	
 
#: rhodecode/controllers/error.py:107
 
msgid ""
 
"The server encountered an unexpected condition which prevented it from "
 
"fulfilling the request."
 
msgstr ""
 
"La requête n’a pu être traitée en raison d’une erreur survenue sur le "
 
"serveur."
 

	
 
#: rhodecode/controllers/feed.py:52
 
#, python-format
 
msgid "Changes on %s repository"
 
msgstr "Changements sur le dépôt %s"
 

	
 
#: rhodecode/controllers/feed.py:53
 
#, python-format
 
msgid "%s %s feed"
 
msgstr "Flux %s de %s"
 

	
 
#: rhodecode/controllers/feed.py:86
 
#: rhodecode/templates/changeset/changeset.html:137
 
#: rhodecode/templates/changeset/changeset.html:149
 
#: rhodecode/templates/compare/compare_diff.html:62
 
#: rhodecode/templates/compare/compare_diff.html:73
 
#: rhodecode/templates/pullrequests/pullrequest_show.html:112
 
#: rhodecode/templates/pullrequests/pullrequest_show.html:171
 
msgid "Changeset was too big and was cut off..."
 
msgstr "Cet ensemble de changements était trop important et a été découpé…"
 

	
 
#: rhodecode/controllers/feed.py:92
 
msgid "commited on"
 
msgstr "a commité, le"
 

	
 
#: rhodecode/controllers/files.py:86
 
msgid "click here to add new file"
 
msgstr "Ajouter un nouveau fichier"
 

	
 
#: rhodecode/controllers/files.py:87
 
#, python-format
 
msgid "There are no files yet %s"
 
msgstr "Il n’y a pas encore de fichiers %s"
 

	
 
#: rhodecode/controllers/files.py:269 rhodecode/controllers/files.py:338
 
#, python-format
 
msgid "This repository is has been locked by %s on %s"
 
msgstr "Ce dépôt a été verrouillé par %s sur %s."
 

	
 
#: rhodecode/controllers/files.py:281
 
msgid "You can only edit files with revision being a valid branch "
 
msgstr ""
 

	
 
#: rhodecode/controllers/files.py:295
 
#, fuzzy, python-format
 
msgid "Edited file %s via RhodeCode"
 
msgstr "%s édité via RhodeCode"
 

	
 
#: rhodecode/controllers/files.py:311
 
msgid "No changes"
 
msgstr "Aucun changement"
 

	
 
#: rhodecode/controllers/files.py:321 rhodecode/controllers/files.py:384
 
#, python-format
 
msgid "Successfully committed to %s"
 
msgstr "Commit réalisé avec succès sur %s"
 

	
 
#: rhodecode/controllers/files.py:326 rhodecode/controllers/files.py:390
 
msgid "Error occurred during commit"
 
msgstr "Une erreur est survenue durant le commit"
 

	
 
#: rhodecode/controllers/files.py:350
 
#, fuzzy
 
msgid "Added file via RhodeCode"
 
msgstr "%s ajouté par RhodeCode"
 

	
 
#: rhodecode/controllers/files.py:370
 
msgid "No content"
 
msgstr "Aucun contenu"
 

	
 
#: rhodecode/controllers/files.py:374
 
msgid "No filename"
 
msgstr "Aucun nom de fichier"
 

	
 
#: rhodecode/controllers/files.py:416
 
msgid "downloads disabled"
 
msgstr "Les téléchargements sont désactivés"
 

	
 
#: rhodecode/controllers/files.py:427
 
#, python-format
 
msgid "Unknown revision %s"
 
msgstr "Révision %s inconnue."
 

	
 
#: rhodecode/controllers/files.py:429
 
msgid "Empty repository"
 
msgstr "Dépôt vide."
 

	
 
#: rhodecode/controllers/files.py:431
 
msgid "Unknown archive type"
 
msgstr "Type d’archive inconnu"
 

	
 
#: rhodecode/controllers/files.py:576
 
#: rhodecode/templates/changeset/changeset_range.html:13
 
#: rhodecode/templates/changeset/changeset_range.html:31
 
msgid "Changesets"
 
msgstr "Changesets"
 

	
 
#: rhodecode/controllers/files.py:577 rhodecode/controllers/pullrequests.py:74
 
#: rhodecode/controllers/summary.py:236 rhodecode/model/scm.py:564
 
msgid "Branches"
 
msgstr "Branches"
 

	
 
#: rhodecode/controllers/files.py:578 rhodecode/controllers/pullrequests.py:78
 
#: rhodecode/controllers/summary.py:237 rhodecode/model/scm.py:575
 
msgid "Tags"
 
msgstr "Tags"
 

	
 
#: rhodecode/controllers/forks.py:165
 
#, python-format
 
msgid "forked %s repository as %s"
 
msgstr "dépôt %s forké en tant que %s"
 

	
 
#: rhodecode/controllers/forks.py:179
 
#, python-format
 
msgid "An error occurred during repository forking %s"
 
msgstr "Une erreur est survenue durant le fork du dépôt %s."
 

	
 
#: rhodecode/controllers/journal.py:275 rhodecode/controllers/journal.py:318
 
msgid "public journal"
 
msgstr "Journal public"
 

	
 
#: rhodecode/controllers/journal.py:279 rhodecode/controllers/journal.py:322
 
#: rhodecode/templates/base/base.html:238
 
#: rhodecode/templates/journal/journal.html:12
 
msgid "journal"
 
msgstr "Journal"
 

	
 
#: rhodecode/controllers/login.py:142
 
msgid "You have successfully registered into rhodecode"
 
msgstr "Vous vous êtes inscrits avec succès à RhodeCode"
 

	
 
#: rhodecode/controllers/login.py:163
 
msgid "Your password reset link was sent"
 
msgstr "Un lien de rénitialisation de votre mot de passe vous a été envoyé."
 

	
 
#: rhodecode/controllers/login.py:183
 
msgid ""
 
"Your password reset was successful, new password has been sent to your "
 
"email"
 
msgstr ""
 
"Votre mot de passe a été réinitialisé. Votre nouveau mot de passe vous a "
 
"été envoyé par e-mail."
 

	
 
#: rhodecode/controllers/pullrequests.py:76 rhodecode/model/scm.py:570
 
msgid "Bookmarks"
 
msgstr "Signets"
 

	
 
#: rhodecode/controllers/pullrequests.py:190
 
msgid "Pull request requires a title with min. 3 chars"
 
msgstr "Les requêtes de pull nécessitent un titre d’au moins 3 caractères."
 

	
 
#: rhodecode/controllers/pullrequests.py:192
 
msgid "error during creation of pull request"
 
msgstr "Une erreur est survenue lors de la création de la requête de pull."
 

	
 
#: rhodecode/controllers/pullrequests.py:224
 
msgid "Successfully opened new pull request"
 
msgstr "La requête de pull a été ouverte avec succès."
 

	
 
#: rhodecode/controllers/pullrequests.py:227
 
msgid "Error occurred during sending pull request"
 
msgstr "Une erreur est survenue durant l’envoi de la requête de pull."
 

	
 
#: rhodecode/controllers/pullrequests.py:260
 
msgid "Successfully deleted pull request"
 
msgstr "La requête de pull a été supprimée avec succès."
 

	
 
#: rhodecode/controllers/pullrequests.py:451
 
msgid "Closing pull request on other statuses than rejected or approved forbidden"
 
msgstr ""
 

	
 
#: rhodecode/controllers/search.py:134
 
msgid "Invalid search query. Try quoting it."
 
msgstr "Requête invalide. Essayer de la mettre entre guillemets."
 

	
 
#: rhodecode/controllers/search.py:139
 
msgid "There is no index to search in. Please run whoosh indexer"
 
msgstr ""
 
"L’index de recherche n’est pas présent. Veuillez exécuter l’indexeur de "
 
"code Whoosh."
 

	
 
#: rhodecode/controllers/search.py:143
 
msgid "An error occurred during this search operation"
 
msgstr "Une erreur est survenue durant l’opération de recherche."
 

	
 
#: rhodecode/controllers/settings.py:120
 
#: rhodecode/controllers/admin/repos.py:254
 
#, python-format
 
msgid "Repository %s updated successfully"
 
msgstr "Dépôt %s mis à jour avec succès."
 

	
 
#: rhodecode/controllers/settings.py:138
 
#: rhodecode/controllers/admin/repos.py:272
 
#, python-format
 
msgid "error occurred during update of repository %s"
 
msgstr "Une erreur est survenue lors de la mise à jour du dépôt %s."
 

	
 
#: rhodecode/controllers/settings.py:163
 
#: rhodecode/controllers/admin/repos.py:297
 
#, python-format
 
msgid "deleted repository %s"
 
msgstr "Dépôt %s supprimé"
 

	
 
#: rhodecode/controllers/settings.py:167
 
#: rhodecode/controllers/admin/repos.py:307
 
#: rhodecode/controllers/admin/repos.py:313
 
#, python-format
 
msgid "An error occurred during deletion of %s"
 
msgstr "Erreur pendant la suppression de %s"
 

	
 
#: rhodecode/controllers/settings.py:186
 
msgid "unlocked"
 
msgstr "déverrouillé"
 

	
 
#: rhodecode/controllers/settings.py:189
 
msgid "locked"
 
msgstr "verrouillé"
 

	
 
#: rhodecode/controllers/settings.py:191
 
#, python-format
 
msgid "Repository has been %s"
 
msgstr "Le dépôt a été %s."
 

	
 
#: rhodecode/controllers/settings.py:195
 
#: rhodecode/controllers/admin/repos.py:405
 
msgid "An error occurred during unlocking"
 
msgstr "Une erreur est survenue durant le déverrouillage."
 

	
 
#: rhodecode/controllers/summary.py:140
 
msgid "No data loaded yet"
 
msgstr "Aucune donnée actuellement disponible."
 

	
 
#: rhodecode/controllers/summary.py:144
 
#: rhodecode/templates/summary/summary.html:157
 
msgid "Statistics are disabled for this repository"
 
msgstr "La mise à jour des statistiques est désactivée pour ce dépôt."
 

	
 
#: rhodecode/controllers/admin/defaults.py:96
 
#, fuzzy
 
msgid "Default settings updated successfully"
 
msgstr "Mise à jour réussie des réglages LDAP"
 

	
 
#: rhodecode/controllers/admin/defaults.py:110
 
#, fuzzy
 
msgid "error occurred during update of defaults"
 
msgstr "Une erreur est survenue durant la mise à jour de l’utilisateur %s."
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:50
 
msgid "BASE"
 
msgstr "Base"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:51
 
msgid "ONELEVEL"
 
msgstr "Un niveau"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:52
 
msgid "SUBTREE"
 
msgstr "Sous-arbre"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:56
 
msgid "NEVER"
 
msgstr "NEVER"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:57
 
msgid "ALLOW"
 
msgstr "Autoriser"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:58
 
msgid "TRY"
 
msgstr "TRY"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:59
 
msgid "DEMAND"
 
msgstr "DEMAND"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:60
 
msgid "HARD"
 
msgstr "HARD"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:64
 
msgid "No encryption"
 
msgstr "Pas de chiffrement"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:65
 
msgid "LDAPS connection"
 
msgstr "Connection LDAPS"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:66
 
msgid "START_TLS on LDAP connection"
 
msgstr "START_TLS à la connexion"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:126
 
msgid "Ldap settings updated successfully"
 
msgid "LDAP settings updated successfully"
 
msgstr "Mise à jour réussie des réglages LDAP"
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:130
 
msgid "Unable to activate ldap. The \"python-ldap\" library is missing."
 
msgstr "Impossible d’activer LDAP. La bibliothèque « python-ldap » est manquante."
 

	
 
#: rhodecode/controllers/admin/ldap_settings.py:147
 
msgid "error occurred during update of ldap settings"
 
msgstr "Une erreur est survenue durant la mise à jour des réglages du LDAP."
 

	
 
#: rhodecode/controllers/admin/permissions.py:60
 
#: rhodecode/controllers/admin/permissions.py:64
 
msgid "None"
 
msgstr "Aucun"
 

	
 
#: rhodecode/controllers/admin/permissions.py:61
 
#: rhodecode/controllers/admin/permissions.py:65
 
msgid "Read"
 
msgstr "Lire"
 

	
 
#: rhodecode/controllers/admin/permissions.py:62
 
#: rhodecode/controllers/admin/permissions.py:66
 
msgid "Write"
 
msgstr "Écrire"
 

	
 
#: rhodecode/controllers/admin/permissions.py:63
 
#: rhodecode/controllers/admin/permissions.py:67
 
#: rhodecode/templates/admin/defaults/defaults.html:9
 
#: rhodecode/templates/admin/ldap/ldap.html:9
 
#: rhodecode/templates/admin/permissions/permissions.html:9
 
#: rhodecode/templates/admin/repos/repo_add.html:9
 
#: rhodecode/templates/admin/repos/repo_edit.html:9
 
#: rhodecode/templates/admin/repos/repos.html:9
 
#: rhodecode/templates/admin/repos_groups/repos_groups_add.html:8
 
#: rhodecode/templates/admin/repos_groups/repos_groups_edit.html:8
 
#: rhodecode/templates/admin/repos_groups/repos_groups_show.html:10
 
#: rhodecode/templates/admin/settings/hooks.html:9
 
#: rhodecode/templates/admin/settings/settings.html:9
 
#: rhodecode/templates/admin/users/user_add.html:8
 
#: rhodecode/templates/admin/users/user_edit.html:9
 
#: rhodecode/templates/admin/users/user_edit.html:130
 
#: rhodecode/templates/admin/users/users.html:9
 
#: rhodecode/templates/admin/users_groups/users_group_add.html:8
 
#: rhodecode/templates/admin/users_groups/users_group_edit.html:9
 
#: rhodecode/templates/admin/users_groups/users_groups.html:9
 
#: rhodecode/templates/base/base.html:203
 
#: rhodecode/templates/base/base.html:324
 
#: rhodecode/templates/base/base.html:326
 
#: rhodecode/templates/base/base.html:328
 
msgid "Admin"
 
msgstr "Administration"
 

	
 
#: rhodecode/controllers/admin/permissions.py:70
 
msgid "disabled"
 
msgstr "Désactivé"
 

	
 
#: rhodecode/controllers/admin/permissions.py:72
 
msgid "allowed with manual account activation"
 
msgstr "Autorisé avec activation manuelle du compte"
 

	
 
#: rhodecode/controllers/admin/permissions.py:74
 
msgid "allowed with automatic account activation"
 
msgstr "Autorisé avec activation automatique du compte"
 

	
 
#: rhodecode/controllers/admin/permissions.py:76
 
#: rhodecode/controllers/admin/permissions.py:79
 
msgid "Disabled"
 
msgstr "Interdite"
 

	
 
#: rhodecode/controllers/admin/permissions.py:77
 
#: rhodecode/controllers/admin/permissions.py:80
 
msgid "Enabled"
 
msgstr "Autorisée"
 

	
 
#: rhodecode/controllers/admin/permissions.py:128
 
msgid "Default permissions updated successfully"
 
msgstr "Permissions par défaut mises à jour avec succès"
 

	
 
#: rhodecode/controllers/admin/permissions.py:142
 
msgid "error occurred during update of permissions"
 
msgstr "erreur pendant la mise à jour des permissions"
 

	
 
#: rhodecode/controllers/admin/repos.py:123
 
msgid "--REMOVE FORK--"
 
msgstr "[Pas un fork]"
 

	
 
#: rhodecode/controllers/admin/repos.py:162
 
#, python-format
 
msgid "created repository %s from %s"
 
msgstr "Le dépôt %s a été créé depuis %s."
 

	
 
#: rhodecode/controllers/admin/repos.py:166
 
#, python-format
 
msgid "created repository %s"
 
msgstr "Le dépôt %s a été créé."
 

	
 
#: rhodecode/controllers/admin/repos.py:197
 
#, python-format
 
msgid "error occurred during creation of repository %s"
 
msgstr "Une erreur est survenue durant la création du dépôt %s."
 

	
 
#: rhodecode/controllers/admin/repos.py:302
 
#, python-format
 
msgid "Cannot delete %s it still contains attached forks"
 
msgstr "Impossible de supprimer le dépôt %s : Des forks y sont attachés."
 

	
 
#: rhodecode/controllers/admin/repos.py:331
 
msgid "An error occurred during deletion of repository user"
 
msgstr "Une erreur est survenue durant la suppression de l’utilisateur du dépôt."
 

	
 
#: rhodecode/controllers/admin/repos.py:350
 
msgid "An error occurred during deletion of repository users groups"
 
msgstr ""
 
"Une erreur est survenue durant la suppression du groupe d’utilisateurs de"
 
" ce dépôt."
 

	
 
#: rhodecode/controllers/admin/repos.py:368
 
msgid "An error occurred during deletion of repository stats"
 
msgstr "Une erreur est survenue durant la suppression des statistiques du dépôt."
 

	
 
#: rhodecode/controllers/admin/repos.py:385
 
msgid "An error occurred during cache invalidation"
 
msgstr "Une erreur est survenue durant l’invalidation du cache."
 

	
 
#: rhodecode/controllers/admin/repos.py:425
 
msgid "Updated repository visibility in public journal"
 
msgstr "La visibilité du dépôt dans le journal public a été mise à jour."
 

	
 
#: rhodecode/controllers/admin/repos.py:429
 
msgid "An error occurred during setting this repository in public journal"
 
msgstr ""
 
"Une erreur est survenue durant la configuration du journal public pour ce"
 
" dépôt."
 

	
 
#: rhodecode/controllers/admin/repos.py:434 rhodecode/model/validators.py:301
 
msgid "Token mismatch"
 
msgstr "Jeton d’authentification incorrect."
 

	
 
#: rhodecode/controllers/admin/repos.py:447
 
msgid "Pulled from remote location"
 
msgstr "Les changements distants ont été récupérés."
 

	
 
#: rhodecode/controllers/admin/repos.py:449
 
msgid "An error occurred during pull from remote location"
 
msgstr "Une erreur est survenue durant le pull depuis la source distante."
 

	
 
#: rhodecode/controllers/admin/repos.py:465
 
msgid "Nothing"
 
msgstr "[Aucun dépôt]"
 

	
 
#: rhodecode/controllers/admin/repos.py:467
 
#, python-format
 
msgid "Marked repo %s as fork of %s"
 
msgstr "Le dépôt %s a été marké comme fork de %s"
 

	
 
#: rhodecode/controllers/admin/repos.py:471
 
msgid "An error occurred during this operation"
 
msgstr "Une erreur est survenue durant cette opération."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:136
 
#, python-format
 
msgid "created repos group %s"
 
msgstr "Le groupe de dépôts %s a été créé."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:148
 
#, python-format
 
msgid "error occurred during creation of repos group %s"
 
msgstr "Une erreur est survenue durant la création du groupe de dépôts %s."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:205
 
#, python-format
 
msgid "updated repos group %s"
 
msgstr "Le groupe de dépôts %s a été mis à jour."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:220
 
#, python-format
 
msgid "error occurred during update of repos group %s"
 
msgstr "Une erreur est survenue durant la mise à jour du groupe de dépôts %s."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:238
 
#, python-format
 
msgid "This group contains %s repositores and cannot be deleted"
 
msgstr "Ce groupe contient %s dépôts et ne peut être supprimé."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:246
 
#, python-format
 
msgid "removed repos group %s"
 
msgstr "Le groupe de dépôts %s a été supprimé."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:252
 
msgid "Cannot delete this group it still contains subgroups"
 
msgstr "Impossible de supprimer ce groupe : Il contient des sous-groupes."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:257
 
#: rhodecode/controllers/admin/repos_groups.py:262
 
#, python-format
 
msgid "error occurred during deletion of repos group %s"
 
msgstr "Une erreur est survenue durant la suppression du groupe de dépôts %s."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:283
 
msgid "An error occurred during deletion of group user"
 
msgstr ""
 
"Une erreur est survenue durant la suppression de l’utilisateur du groupe "
 
"de dépôts."
 

	
 
#: rhodecode/controllers/admin/repos_groups.py:304
 
msgid "An error occurred during deletion of group users groups"
 
msgstr ""
 
"Une erreur est survenue durant la suppression du groupe d’utilisateurs du"
 
" groupe de dépôts."
 

	
 
#: rhodecode/controllers/admin/settings.py:124
 
#, fuzzy, python-format
 
msgid "Repositories successfully rescanned added: %s ; removed: %s"
 
msgstr "Après re-scan : %s ajouté(s), %s enlevé(s)"
 

	
 
#: rhodecode/controllers/admin/settings.py:133
 
msgid "Whoosh reindex task scheduled"
 
msgstr "La tâche de réindexation Whoosh a été planifiée."
 

	
 
#: rhodecode/controllers/admin/settings.py:164
 
msgid "Updated application settings"
 
msgstr "Réglages mis à jour"
 

	
 
#: rhodecode/controllers/admin/settings.py:168
 
#: rhodecode/controllers/admin/settings.py:301
 
msgid "error occurred during updating application settings"
 
msgstr "Une erreur est survenue durant la mise à jour des options."
 

	
 
#: rhodecode/controllers/admin/settings.py:209
 
msgid "Updated visualisation settings"
 
msgstr "Réglages d’affichage mis à jour."
 

	
 
#: rhodecode/controllers/admin/settings.py:214
 
msgid "error occurred during updating visualisation settings"
 
msgstr "Une erreur est survenue durant la mise à jour des réglages d’affichages."
 

	
 
#: rhodecode/controllers/admin/settings.py:297
 
msgid "Updated VCS settings"
 
msgstr "Réglages des gestionnaires de versions mis à jour."
 

	
 
#: rhodecode/controllers/admin/settings.py:311
 
msgid "Added new hook"
 
msgstr "Le nouveau hook a été ajouté."
 

	
 
#: rhodecode/controllers/admin/settings.py:323
 
msgid "Updated hooks"
 
msgstr "Hooks mis à jour"
 

	
 
#: rhodecode/controllers/admin/settings.py:327
 
msgid "error occurred during hook creation"
 
msgstr "Une erreur est survenue durant la création du hook."
 

	
 
#: rhodecode/controllers/admin/settings.py:346
 
msgid "Email task created"
 
msgstr "La tâche d’e-mail a été créée."
 

	
 
#: rhodecode/controllers/admin/settings.py:408
 
msgid "You can't edit this user since it's crucial for entire application"
 
msgstr ""
 
"Vous ne pouvez pas éditer cet utilisateur ; il est nécessaire pour le bon"
 
" fonctionnement de l’application."
 

	
 
#: rhodecode/controllers/admin/settings.py:448
 
msgid "Your account was updated successfully"
 
msgstr "Votre compte a été mis à jour avec succès"
 

	
 
#: rhodecode/controllers/admin/settings.py:463
 
#: rhodecode/controllers/admin/users.py:198
 
#, python-format
 
msgid "error occurred during update of user %s"
 
msgstr "Une erreur est survenue durant la mise à jour de l’utilisateur %s."
 

	
 
#: rhodecode/controllers/admin/users.py:130
 
#, python-format
 
msgid "created user %s"
 
msgstr "utilisateur %s créé"
 

	
 
#: rhodecode/controllers/admin/users.py:142
 
#, python-format
 
msgid "error occurred during creation of user %s"
 
msgstr "Une erreur est survenue durant la création de l’utilisateur %s."
 

	
 
#: rhodecode/controllers/admin/users.py:176
 
msgid "User updated successfully"
 
msgstr "L’utilisateur a été mis à jour avec succès."
 

	
 
#: rhodecode/controllers/admin/users.py:214
 
msgid "successfully deleted user"
 
msgstr "L’utilisateur a été supprimé avec succès."
 

	
 
#: rhodecode/controllers/admin/users.py:219
 
msgid "An error occurred during deletion of user"
 
msgstr "Une erreur est survenue durant la suppression de l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users.py:233
 
msgid "You can't edit this user"
 
msgstr "Vous ne pouvez pas éditer cet utilisateur"
 

	
 
#: rhodecode/controllers/admin/users.py:276
 
msgid "Granted 'repository create' permission to user"
 
msgstr "La permission de création de dépôts a été accordée à l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users.py:281
 
msgid "Revoked 'repository create' permission to user"
 
msgstr "La permission de création de dépôts a été révoquée à l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users.py:287
 
msgid "Granted 'repository fork' permission to user"
 
msgstr "La permission de fork de dépôts a été accordée à l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users.py:292
 
msgid "Revoked 'repository fork' permission to user"
 
msgstr "La permission de fork de dépôts a été révoquée à l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users.py:298
 
#: rhodecode/controllers/admin/users_groups.py:279
 
msgid "An error occurred during permissions saving"
 
msgstr "Une erreur est survenue durant l’enregistrement des permissions."
 

	
 
#: rhodecode/controllers/admin/users.py:312
 
#, python-format
 
msgid "Added email %s to user"
 
msgstr "L’e-mail « %s » a été ajouté à l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users.py:318
 
msgid "An error occurred during email saving"
 
msgstr "Une erreur est survenue durant l’enregistrement de l’e-mail."
 

	
 
#: rhodecode/controllers/admin/users.py:328
 
msgid "Removed email from user"
 
msgstr "L’e-mail a été enlevé de l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users.py:341
 
#, fuzzy, python-format
 
msgid "Added ip %s to user"
 
msgstr "L’e-mail « %s » a été ajouté à l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users.py:347
 
#, fuzzy
 
msgid "An error occurred during ip saving"
 
msgstr "Une erreur est survenue durant l’enregistrement de l’e-mail."
 

	
 
#: rhodecode/controllers/admin/users.py:359
 
#, fuzzy
 
msgid "Removed ip from user"
 
msgstr "L’e-mail a été enlevé de l’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:86
 
#, python-format
 
msgid "created users group %s"
 
msgstr "Le groupe d’utilisateurs %s a été créé."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:97
 
#, python-format
 
msgid "error occurred during creation of users group %s"
 
msgstr "Une erreur est survenue durant la création du groupe d’utilisateurs %s."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:164
 
#, python-format
 
msgid "updated users group %s"
 
msgstr "Le groupe d’utilisateurs %s a été mis à jour."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:186
 
#, python-format
 
msgid "error occurred during update of users group %s"
 
msgstr "Une erreur est survenue durant la mise à jour du groupe d’utilisateurs %s."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:203
 
msgid "successfully deleted users group"
 
msgstr "Le groupe d’utilisateurs a été supprimé avec succès."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:208
 
msgid "An error occurred during deletion of users group"
 
msgstr "Une erreur est survenue lors de la suppression du groupe d’utilisateurs."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:257
 
msgid "Granted 'repository create' permission to users group"
 
msgstr ""
 
"La permission de création de dépôts a été accordée au groupe "
 
"d’utilisateurs."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:262
 
msgid "Revoked 'repository create' permission to users group"
 
msgstr ""
 
"La permission de création de dépôts a été révoquée au groupe "
 
"d’utilisateurs."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:268
 
msgid "Granted 'repository fork' permission to users group"
 
msgstr "La permission de fork de dépôts a été accordée au groupe d’utilisateur."
 

	
 
#: rhodecode/controllers/admin/users_groups.py:273
 
msgid "Revoked 'repository fork' permission to users group"
 
msgstr "La permission de fork de dépôts a été révoquée au groupe d’utilisateurs."
 

	
 
#: rhodecode/lib/auth.py:509
 
#, fuzzy, python-format
 
msgid "IP %s not allowed"
 
msgstr "Followers de %s"
 

	
 
#: rhodecode/lib/auth.py:558
 
msgid "You need to be a registered user to perform this action"
 
msgstr "Vous devez être un utilisateur enregistré pour effectuer cette action."
 

	
 
#: rhodecode/lib/auth.py:599
 
msgid "You need to be a signed in to view this page"
 
msgstr "Vous devez être connecté pour visualiser cette page."
 

	
 
#: rhodecode/lib/diffs.py:74
 
msgid "binary file"
 
msgstr "Fichier binaire"
 

	
 
#: rhodecode/lib/diffs.py:90
 
msgid "Changeset was too big and was cut off, use diff menu to display this diff"
 
msgstr ""
 
"Cet ensemble de changements était trop gros pour être affiché et a été "
 
"découpé, utilisez le menu « Diff » pour afficher les différences."
 

	
 
#: rhodecode/lib/diffs.py:100
 
msgid "No changes detected"
 
msgstr "Aucun changement détecté."
 

	
 
#: rhodecode/lib/helpers.py:374
 
#, python-format
 
msgid "%a, %d %b %Y %H:%M:%S"
 
msgstr "%d/%m/%Y à %H:%M:%S"
 

	
 
#: rhodecode/lib/helpers.py:486
 
msgid "True"
 
msgstr "Vrai"
 

	
 
#: rhodecode/lib/helpers.py:490
 
msgid "False"
 
msgstr "Faux"
 

	
 
#: rhodecode/lib/helpers.py:530
 
#, fuzzy, python-format
 
msgid "Deleted branch: %s"
 
msgstr "Dépôt %s supprimé"
 

	
 
#: rhodecode/lib/helpers.py:533
 
#, fuzzy, python-format
 
msgid "Created tag: %s"
 
msgstr "utilisateur %s créé"
 

	
 
#: rhodecode/lib/helpers.py:546
 
msgid "Changeset not found"
 
msgstr "Ensemble de changements non trouvé"
 

	
 
#: rhodecode/lib/helpers.py:589
 
#, python-format
 
msgid "Show all combined changesets %s->%s"
 
msgstr "Afficher les changements combinés %s->%s"
 

	
 
#: rhodecode/lib/helpers.py:595
 
msgid "compare view"
 
msgstr "vue de comparaison"
 

	
 
#: rhodecode/lib/helpers.py:615
 
msgid "and"
 
msgstr "et"
 

	
 
#: rhodecode/lib/helpers.py:616
 
#, python-format
 
msgid "%s more"
 
msgstr "%s de plus"
 

	
 
#: rhodecode/lib/helpers.py:617 rhodecode/templates/changelog/changelog.html:51
 
msgid "revisions"
 
msgstr "révisions"
 

	
 
#: rhodecode/lib/helpers.py:641
 
#, fuzzy, python-format
 
msgid "fork name %s"
 
msgstr "Nom du fork %s"
 

	
 
#: rhodecode/lib/helpers.py:658
 
#: rhodecode/templates/pullrequests/pullrequest_show.html:4
 
#: rhodecode/templates/pullrequests/pullrequest_show.html:12
 
#, python-format
 
msgid "Pull request #%s"
 
msgstr "Requête de pull #%s"
 

	
 
#: rhodecode/lib/helpers.py:664
 
msgid "[deleted] repository"
 
msgstr "[a supprimé] le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:666 rhodecode/lib/helpers.py:676
 
msgid "[created] repository"
 
msgstr "[a créé] le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:668
 
msgid "[created] repository as fork"
 
msgstr "[a créé] le dépôt en tant que fork"
 

	
 
#: rhodecode/lib/helpers.py:670 rhodecode/lib/helpers.py:678
 
msgid "[forked] repository"
 
msgstr "[a forké] le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:672 rhodecode/lib/helpers.py:680
 
msgid "[updated] repository"
 
msgstr "[a mis à jour] le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:674
 
msgid "[delete] repository"
 
msgstr "[a supprimé] le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:682
 
msgid "[created] user"
 
msgstr "[a créé] l’utilisateur"
 

	
 
#: rhodecode/lib/helpers.py:684
 
msgid "[updated] user"
 
msgstr "[a mis à jour] l’utilisateur"
 

	
 
#: rhodecode/lib/helpers.py:686
 
msgid "[created] users group"
 
msgstr "[a créé] le groupe d’utilisateurs"
 

	
 
#: rhodecode/lib/helpers.py:688
 
msgid "[updated] users group"
 
msgstr "[a mis à jour] le groupe d’utilisateurs"
 

	
 
#: rhodecode/lib/helpers.py:690
 
msgid "[commented] on revision in repository"
 
msgstr "[a commenté] une révision du dépôt"
 

	
 
#: rhodecode/lib/helpers.py:692
 
msgid "[commented] on pull request for"
 
msgstr "[a commenté] la requête de pull pour"
 

	
 
#: rhodecode/lib/helpers.py:694
 
msgid "[closed] pull request for"
 
msgstr "[a fermé] la requête de pull de"
 

	
 
#: rhodecode/lib/helpers.py:696
 
msgid "[pushed] into"
 
msgstr "[a pushé] dans"
 

	
 
#: rhodecode/lib/helpers.py:698
 
msgid "[committed via RhodeCode] into repository"
 
msgstr "[a commité via RhodeCode] dans le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:700
 
msgid "[pulled from remote] into repository"
 
msgstr "[a pullé depuis un site distant] dans le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:702
 
msgid "[pulled] from"
 
msgstr "[a pullé] depuis"
 

	
 
#: rhodecode/lib/helpers.py:704
 
msgid "[started following] repository"
 
msgstr "[suit maintenant] le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:706
 
msgid "[stopped following] repository"
 
msgstr "[ne suit plus] le dépôt"
 

	
 
#: rhodecode/lib/helpers.py:884
 
#, python-format
 
msgid " and %s more"
 
msgstr "et %s de plus"
 

	
 
#: rhodecode/lib/helpers.py:888
 
msgid "No Files"
 
msgstr "Aucun fichier"
 

	
 
#: rhodecode/lib/helpers.py:1164
 
#, python-format
 
msgid ""
 
"%s repository is not mapped to db perhaps it was created or renamed from "
 
"the filesystem please run the application again in order to rescan "
 
"repositories"
 
msgstr ""
 
"Le dépôt %s n’est pas représenté dans la base de données. Il a "
 
"probablement été créé ou renommé manuellement. Veuillez relancer "
 
"l’application pour rescanner les dépôts."
 

	
 
#: rhodecode/lib/utils2.py:403
 
#, python-format
 
msgid "%d year"
 
msgid_plural "%d years"
 
msgstr[0] "%d an"
 
msgstr[1] "%d ans"
 

	
 
#: rhodecode/lib/utils2.py:404
 
#, python-format
 
msgid "%d month"
 
msgid_plural "%d months"
 
msgstr[0] "%d mois"
 
msgstr[1] "%d mois"
 

	
 
#: rhodecode/lib/utils2.py:405
 
#, python-format
 
msgid "%d day"
 
msgid_plural "%d days"
 
msgstr[0] "%d jour"
 
msgstr[1] "%d jours"
 

	
 
#: rhodecode/lib/utils2.py:406
 
#, python-format
 
msgid "%d hour"
 
msgid_plural "%d hours"
 
msgstr[0] "%d heure"
 
msgstr[1] "%d heures"
 

	
 
#: rhodecode/lib/utils2.py:407
 
#, python-format
 
msgid "%d minute"
 
msgid_plural "%d minutes"
 
msgstr[0] "%d minute"
 
msgstr[1] "%d minutes"
 

	
 
#: rhodecode/lib/utils2.py:408
 
#, python-format
 
msgid "%d second"
 
msgid_plural "%d seconds"
 
msgstr[0] "%d seconde"
 
msgstr[1] "%d secondes"
 

	
 
#: rhodecode/lib/utils2.py:424
 
#, fuzzy, python-format
 
msgid "in %s"
 
msgstr "à la ligne %s"
 

	
 
#: rhodecode/lib/utils2.py:426
 
#, python-format
 
msgid "%s ago"
 
msgstr "Il y a %s"
 

	
 
#: rhodecode/lib/utils2.py:428
 
#, fuzzy, python-format
 
msgid "in %s and %s"
 
msgstr "Il y a %s et %s"
 

	
 
#: rhodecode/lib/utils2.py:431
 
#, python-format
 
msgid "%s and %s ago"
 
msgstr "Il y a %s et %s"
 

	
 
#: rhodecode/lib/utils2.py:434
 
msgid "just now"
 
msgstr "à l’instant"
 

	
 
#: rhodecode/lib/celerylib/tasks.py:270
 
msgid "password reset link"
 
msgstr "Réinitialisation du mot de passe"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1163
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1183 rhodecode/model/db.py:1313
 
msgid "Repository no access"
 
msgstr "Aucun accès au dépôt"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1164
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1184 rhodecode/model/db.py:1314
 
msgid "Repository read access"
 
msgstr "Accès en lecture au dépôt"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1165
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1185 rhodecode/model/db.py:1315
 
msgid "Repository write access"
 
msgstr "Accès en écriture au dépôt"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1166
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1186 rhodecode/model/db.py:1316
 
msgid "Repository admin access"
 
msgstr "Accès administrateur au dépôt"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1168
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1188 rhodecode/model/db.py:1318
 
msgid "Repositories Group no access"
 
msgstr "Aucun accès au groupe de dépôts"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1169
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1189 rhodecode/model/db.py:1319
 
msgid "Repositories Group read access"
 
msgstr "Accès en lecture au groupe de dépôts"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1170
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1190 rhodecode/model/db.py:1320
 
msgid "Repositories Group write access"
 
msgstr "Accès en écriture au groupe de dépôts"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1171
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1191 rhodecode/model/db.py:1321
 
msgid "Repositories Group admin access"
 
msgstr "Accès administrateur au groupe de dépôts"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1173
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1193 rhodecode/model/db.py:1323
 
msgid "RhodeCode Administrator"
 
msgstr "Administrateur RhodeCode"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1174
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1194 rhodecode/model/db.py:1324
 
msgid "Repository creation disabled"
 
msgstr "Création de dépôt désactivée"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1175
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1195 rhodecode/model/db.py:1325
 
msgid "Repository creation enabled"
 
msgstr "Création de dépôt activée"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1176
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1196 rhodecode/model/db.py:1326
 
msgid "Repository forking disabled"
 
msgstr "Fork de dépôt désactivé"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1177
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1197 rhodecode/model/db.py:1327
 
msgid "Repository forking enabled"
 
msgstr "Fork de dépôt activé"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1178
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1198 rhodecode/model/db.py:1328
 
msgid "Register disabled"
 
msgstr "Enregistrement désactivé"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1179
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1199 rhodecode/model/db.py:1329
 
msgid "Register new user with RhodeCode with manual activation"
 
msgstr "Enregistrer un nouvel utilisateur Rhodecode manuellement activé"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1182
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1202 rhodecode/model/db.py:1332
 
msgid "Register new user with RhodeCode with auto activation"
 
msgstr "Enregistrer un nouvel utilisateur Rhodecode auto-activé"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1623
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1643 rhodecode/model/db.py:1776
 
msgid "Not Reviewed"
 
msgstr "Pas encore relue"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1624
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1644 rhodecode/model/db.py:1777
 
msgid "Approved"
 
msgstr "Approuvée "
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1625
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1645 rhodecode/model/db.py:1778
 
msgid "Rejected"
 
msgstr "Rejetée"
 

	
 
#: rhodecode/lib/dbmigrate/schema/db_1_4_0.py:1626
 
#: rhodecode/lib/dbmigrate/schema/db_1_5_0.py:1646 rhodecode/model/db.py:1779
 
msgid "Under Review"
 
msgstr "En cours de relecture"
 

	
 
#: rhodecode/model/comment.py:109
 
#, python-format
 
msgid "on line %s"
 
msgstr "à la ligne %s"
 

	
 
#: rhodecode/model/comment.py:176
 
msgid "[Mention]"
 
msgstr "[Mention]"
 

	
 
#: rhodecode/model/forms.py:43
 
msgid "Please enter a login"
 
msgstr "Veuillez entrer un identifiant"
 

	
 
#: rhodecode/model/forms.py:44
 
#, python-format
 
msgid "Enter a value %(min)i characters long or more"
 
msgstr "Entrez une valeur d’au moins %(min)i caractères de long."
 

	

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)