Changeset - ffd07396d315
rhodecode/config/routing.py
Show inline comments
 
@@ -26,25 +26,25 @@ def make_map(config):
 
        return not cr(repo_name, config['base_path'])
 

	
 
    # The ErrorController route (handles 404/500 error pages); it should
 
    # likely stay at the top, ensuring it can always be resolved
 
    map.connect('/error/{action}', controller='error')
 
    map.connect('/error/{action}/{id}', controller='error')
 

	
 
    #==========================================================================
 
    # CUSTOM ROUTES HERE
 
    #==========================================================================
 

	
 
    #MAIN PAGE
 
    map.connect('hg_home', '/', controller='hg', action='index')
 
    map.connect('home', '/', controller='home', action='index')
 
    map.connect('bugtracker', "http://bitbucket.org/marcinkuzminski/rhodecode/issues", _static=True)
 
    map.connect('gpl_license', "http://www.gnu.org/licenses/gpl.html", _static=True)
 
    #ADMIN REPOSITORY REST ROUTES
 
    with map.submapper(path_prefix='/_admin', controller='admin/repos') as m:
 
        m.connect("repos", "/repos",
 
             action="create", conditions=dict(method=["POST"]))
 
        m.connect("repos", "/repos",
 
             action="index", conditions=dict(method=["GET"]))
 
        m.connect("formatted_repos", "/repos.{format}",
 
             action="index",
 
            conditions=dict(method=["GET"]))
 
        m.connect("new_repo", "/repos/new",
rhodecode/controllers/admin/repos.py
Show inline comments
 
@@ -97,25 +97,25 @@ class ReposController(BaseController):
 
                r,
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")      
 

	
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            msg = _('error occured during creation of repository %s') \
 
                    % form_result.get('repo_name')
 
            h.flash(msg, category='error')
 
        if request.POST.get('user_created'):
 
            return redirect(url('hg_home'))    
 
            return redirect(url('home'))
 
        return redirect(url('repos'))
 
    
 
    @HasPermissionAllDecorator('hg.admin')
 
    def new(self, format='html'):
 
        """GET /repos/new: Form to create a new item"""
 
        new_repo = request.GET.get('repo', '')
 
        c.new_repo = h.repo_name_slug(new_repo)
 

	
 
        return render('admin/repos/repo_add.html')
 
    
 
    @HasPermissionAllDecorator('hg.admin')
 
    def update(self, repo_name):
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -68,25 +68,27 @@ class ChangelogController(BaseController
 
                            items_per_page=c.size)
 
            
 
        self._graph(changesets, c.size, p)
 
        
 
        return render('changelog/changelog.html')
 

	
 

	
 
    def _graph(self, repo, size, p):
 
        revcount = size
 
        if not repo.revisions:return json.dumps([]), 0
 
        
 
        max_rev = repo.revisions[-1]
 

	
 
        offset = 1 if p == 1 else  ((p - 1) * revcount + 1)
 

	
 
        rev_start = repo.revisions[(-1 * offset)]
 
        
 
        revcount = min(max_rev, revcount)
 
        rev_end = max(0, rev_start - revcount)
 
        dag = graph_rev(repo.repo, rev_start, rev_end)
 
        
 
        c.dag = tree = list(colored(dag))
 
        data = []
 
        for (id, type, ctx, vtx, edges) in tree:
 
            if type != CHANGESET:
 
                continue
 
            data.append(('', vtx, edges))
rhodecode/controllers/changeset.py
Show inline comments
 
@@ -52,25 +52,25 @@ class ChangesetController(BaseController
 
            
 
            return '''<table class="code-difftable">
 
                        <tr class="line">
 
                        <td class="lineno new"></td>
 
                        <td class="code"><pre>%s</pre></td>
 
                        </tr>
 
                      </table>''' % str
 
            
 
        try:
 
            c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision)
 
        except RepositoryError:
 
            log.error(traceback.format_exc())
 
            return redirect(url('hg_home'))
 
            return redirect(url('home'))
 
        else:
 
            try:
 
                c.changeset_old = c.changeset.parents[0]
 
            except IndexError:
 
                c.changeset_old = None
 
            c.changes = []
 
            
 
            #===================================================================
 
            # ADDED FILES
 
            #===================================================================
 
            c.sum_added = 0
 
            for node in c.changeset.added:
 
@@ -80,25 +80,25 @@ class ChangesetController(BaseController
 
                    diff = wrap_to_table(_('binary file'))
 
                else:
 
                    c.sum_added += node.size
 
                    if c.sum_added < cut_off_limit:
 
                        f_udiff = differ.get_udiff(filenode_old, node)
 
                        diff = differ.DiffProcessor(f_udiff).as_html()
 
                                                    
 
                    else:
 
                        diff = wrap_to_table(_('Changeset is to big and was cut'
 
                                            ' off, see raw changeset instead'))
 
                        
 
                cs1 = None
 
                cs2 = node.last_changeset.short_id                                        
 
                cs2 = node.last_changeset.raw_id
 
                c.changes.append(('added', node, diff, cs1, cs2))
 
            
 
            #===================================================================
 
            # CHANGED FILES
 
            #===================================================================
 
            c.sum_removed = 0    
 
            for node in c.changeset.changed:
 
                try:
 
                    filenode_old = c.changeset_old.get_node(node.path)
 
                except ChangesetError:
 
                    filenode_old = FileNode(node.path, '', EmptyChangeset())
 
                    
 
@@ -107,74 +107,74 @@ class ChangesetController(BaseController
 
                else:
 
                    
 
                    if c.sum_removed < cut_off_limit:
 
                        f_udiff = differ.get_udiff(filenode_old, node)
 
                        diff = differ.DiffProcessor(f_udiff).as_html()
 
                        if diff:
 
                            c.sum_removed += len(diff)
 
                    else:
 
                        diff = wrap_to_table(_('Changeset is to big and was cut'
 
                                            ' off, see raw changeset instead'))
 
                
 
                
 
                cs1 = filenode_old.last_changeset.short_id
 
                cs2 = node.last_changeset.short_id                    
 
                cs1 = filenode_old.last_changeset.raw_id
 
                cs2 = node.last_changeset.raw_id
 
                c.changes.append(('changed', node, diff, cs1, cs2))
 
                
 
            #===================================================================
 
            # REMOVED FILES    
 
            #===================================================================
 
            for node in c.changeset.removed:
 
                c.changes.append(('removed', node, None, None, None))            
 
            
 
        return render('changeset/changeset.html')
 

	
 
    def raw_changeset(self, revision):
 
        
 
        hg_model = HgModel()
 
        method = request.GET.get('diff', 'show')
 
        try:
 
            c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision)
 
        except RepositoryError:
 
            log.error(traceback.format_exc())
 
            return redirect(url('hg_home'))
 
            return redirect(url('home'))
 
        else:
 
            try:
 
                c.changeset_old = c.changeset.parents[0]
 
            except IndexError:
 
                c.changeset_old = None
 
            c.changes = []
 
            
 
            for node in c.changeset.added:
 
                filenode_old = FileNode(node.path, '')
 
                if filenode_old.is_binary or node.is_binary:
 
                    diff = _('binary file')
 
                else:    
 
                    f_udiff = differ.get_udiff(filenode_old, node)
 
                    diff = differ.DiffProcessor(f_udiff).raw_diff()
 

	
 
                cs1 = None
 
                cs2 = node.last_changeset.short_id                                        
 
                cs2 = node.last_changeset.raw_id
 
                c.changes.append(('added', node, diff, cs1, cs2))
 
                
 
            for node in c.changeset.changed:
 
                filenode_old = c.changeset_old.get_node(node.path)
 
                if filenode_old.is_binary or node.is_binary:
 
                    diff = _('binary file')
 
                else:    
 
                    f_udiff = differ.get_udiff(filenode_old, node)
 
                    diff = differ.DiffProcessor(f_udiff).raw_diff()
 

	
 
                cs1 = filenode_old.last_changeset.short_id
 
                cs2 = node.last_changeset.short_id                    
 
                cs1 = filenode_old.last_changeset.raw_id
 
                cs2 = node.last_changeset.raw_id
 
                c.changes.append(('changed', node, diff, cs1, cs2))      
 
        
 
        response.content_type = 'text/plain'
 
        if method == 'download':
 
            response.content_disposition = 'attachment; filename=%s.patch' % revision 
 
        parent = True if len(c.changeset.parents) > 0 else False
 
        c.parent_tmpl = 'Parent  %s' % c.changeset.parents[0].raw_id if parent else ''
 
    
 
        c.diffs = ''
 
        for x in c.changes:
 
            c.diffs += x[2]
 
            
rhodecode/controllers/feed.py
Show inline comments
 
@@ -45,36 +45,36 @@ class FeedController(BaseController):
 
        """Produce an atom-1.0 feed via feedgenerator module"""
 
        feed = Atom1Feed(title=self.title % repo_name,
 
                         link=url('summary_home', repo_name=repo_name, qualified=True),
 
                         description=self.description % repo_name,
 
                         language=self.language,
 
                         ttl=self.ttl)
 
        
 
        changesets = HgModel().get_repo(repo_name)
 

	
 
        for cs in changesets[:self.feed_nr]:
 
            feed.add_item(title=cs.message,
 
                          link=url('changeset_home', repo_name=repo_name,
 
                                   revision=cs.short_id, qualified=True),
 
                                   revision=cs.raw_id, qualified=True),
 
                                   description=str(cs.date))
 
        
 
        response.content_type = feed.mime_type
 
        return feed.writeString('utf-8')
 

	
 
    
 
    def rss(self, repo_name):
 
        """Produce an rss2 feed via feedgenerator module"""
 
        feed = Rss201rev2Feed(title=self.title % repo_name,
 
                         link=url('summary_home', repo_name=repo_name, qualified=True),
 
                         description=self.description % repo_name,
 
                         language=self.language,
 
                         ttl=self.ttl)
 
        
 
        changesets = HgModel().get_repo(repo_name)
 
        for cs in changesets[:self.feed_nr]:
 
            feed.add_item(title=cs.message,
 
                          link=url('changeset_home', repo_name=repo_name,
 
                                   revision=cs.short_id, qualified=True),
 
                                   revision=cs.raw_id, qualified=True),
 
                          description=str(cs.date))
 
            
 
        response.content_type = feed.mime_type
 
        return feed.writeString('utf-8')
rhodecode/controllers/files.py
Show inline comments
 
@@ -60,35 +60,35 @@ class FilesController(BaseController):
 
                r = max_rev
 
            return r
 
            
 
        def get_prev_rev(cur):
 
            r = cur - 1
 
            return r
 

	
 
        c.f_path = f_path
 
     
 
        
 
        try:
 
            cur_rev = repo.get_changeset(revision).revision
 
            prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).short_id
 
            next_rev = repo.get_changeset(get_next_rev(cur_rev)).short_id
 
            prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).raw_id
 
            next_rev = repo.get_changeset(get_next_rev(cur_rev)).raw_id
 
                    
 
            c.url_prev = url('files_home', repo_name=c.repo_name,
 
                             revision=prev_rev, f_path=f_path) 
 
            c.url_next = url('files_home', repo_name=c.repo_name,
 
                             revision=next_rev, f_path=f_path)   
 
                    
 
            c.changeset = repo.get_changeset(revision)
 
                        
 
            c.cur_rev = c.changeset.short_id
 
            c.cur_rev = c.changeset.raw_id
 
            c.rev_nr = c.changeset.revision
 
            c.files_list = c.changeset.get_node(f_path)
 
            c.file_history = self._get_history(repo, c.files_list, f_path)
 
            
 
        except (RepositoryError, ChangesetError):
 
            c.files_list = None
 
        
 
        return render('files/files.html')
 

	
 
    def rawfile(self, repo_name, revision, f_path):
 
        hg_model = HgModel()
 
        c.repo = hg_model.get_repo(c.repo_name)
 
@@ -103,25 +103,25 @@ class FilesController(BaseController):
 
        c.repo = hg_model.get_repo(c.repo_name)
 
        file_node = c.repo.get_changeset(revision).get_node(f_path)
 
        response.content_type = 'text/plain'
 
        
 
        return file_node.content
 
    
 
    def annotate(self, repo_name, revision, f_path):
 
        hg_model = HgModel()
 
        c.repo = hg_model.get_repo(c.repo_name)
 
        cs = c.repo.get_changeset(revision)
 
        c.file = cs.get_node(f_path)
 
        c.file_msg = cs.get_file_message(f_path)
 
        c.cur_rev = cs.short_id
 
        c.cur_rev = cs.raw_id
 
        c.rev_nr = cs.revision        
 
        c.f_path = f_path
 

	
 
        return render('files/files_annotate.html')
 
      
 
    def archivefile(self, repo_name, revision, fileformat):
 
        archive_specs = {
 
          '.tar.bz2': ('application/x-tar', 'tbz2'),
 
          '.tar.gz': ('application/x-tar', 'tgz'),
 
          '.zip': ('application/zip', 'zip'),
 
        }
 
        if not archive_specs.has_key(fileformat):
 
@@ -164,27 +164,24 @@ class FilesController(BaseController):
 
                node1 = FileNode('.', '', changeset=c.changeset_1)
 
                
 
            if diff2 not in ['', None, 'None', '0' * 12, '0' * 40]:
 
                c.changeset_2 = c.repo.get_changeset(diff2)
 
                node2 = c.changeset_2.get_node(f_path)
 
            else:
 
                c.changeset_2 = EmptyChangeset()
 
                node2 = FileNode('.', '', changeset=c.changeset_2)
 
        except RepositoryError:
 
            return redirect(url('files_home',
 
                                repo_name=c.repo_name, f_path=f_path))
 

	
 
        c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1.short_id)
 
        c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2.short_id)
 
        
 
        f_udiff = differ.get_udiff(node1, node2)
 
        diff = differ.DiffProcessor(f_udiff)
 
                                
 
        if c.action == 'download':
 
            diff_name = '%s_vs_%s.diff' % (diff1, diff2)
 
            response.content_type = 'text/plain'
 
            response.content_disposition = 'attachment; filename=%s' \
 
                                                    % diff_name             
 
            return diff.raw_diff()
 
        
 
        elif c.action == 'raw':
 
            c.cur_diff = '<pre class="raw">%s</pre>' % h.escape(diff.raw_diff())
 
@@ -202,14 +199,14 @@ class FilesController(BaseController):
 
        
 
        if not c.cur_diff: c.no_changes = True    
 
        return render('files/file_diff.html')
 
    
 
    def _get_history(self, repo, node, f_path):
 
        from vcs.nodes import NodeKind
 
        if not node.kind is NodeKind.FILE:
 
            return []
 
        changesets = node.history
 
        hist_l = []
 
        for chs in changesets:
 
            n_desc = 'r%s:%s' % (chs.revision, chs.short_id)
 
            hist_l.append((chs.short_id, n_desc,))
 
            hist_l.append((chs.raw_id, n_desc,))
 
        return hist_l
rhodecode/controllers/home.py
Show inline comments
 
file renamed from rhodecode/controllers/hg.py to rhodecode/controllers/home.py
 
@@ -21,29 +21,29 @@
 
Created on February 18, 2010
 
hg controller for pylons
 
@author: marcink
 
"""
 
from operator import itemgetter
 
from pylons import tmpl_context as c, request
 
from rhodecode.lib.auth import LoginRequired
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.model.hg import HgModel
 
import logging
 
log = logging.getLogger(__name__)
 

	
 
class HgController(BaseController):
 
class HomeController(BaseController):
 

	
 
    @LoginRequired()
 
    def __before__(self):
 
        super(HgController, self).__before__()
 
        super(HomeController, self).__before__()
 
        
 
    def index(self):
 
        sortables = ['name', 'description', 'last_change', 'tip', 'contact']
 
        current_sort = request.GET.get('sort', 'name')
 
        current_sort_slug = current_sort.replace('-', '')
 
        
 
        if current_sort_slug not in sortables:
 
            c.sort_by = 'name'
 
            current_sort_slug = c.sort_by
 
        else:
 
            c.sort_by = current_sort
 
        c.sort_slug = current_sort_slug
rhodecode/controllers/login.py
Show inline comments
 
@@ -38,50 +38,50 @@ import logging
 
log = logging.getLogger(__name__)
 

	
 
class LoginController(BaseController):
 

	
 
    def __before__(self):
 
        super(LoginController, self).__before__()
 

	
 
    def index(self):
 
        #redirect if already logged in
 
        c.came_from = request.GET.get('came_from', None)
 
        
 
        if c.rhodecode_user.is_authenticated:
 
            return redirect(url('hg_home'))
 
            return redirect(url('home'))
 
        
 
        if request.POST:
 
            #import Login Form validator class
 
            login_form = LoginForm()
 
            try:
 
                c.form_result = login_form.to_python(dict(request.POST))
 
                username = c.form_result['username']
 
                user = UserModel().get_by_username(username)
 
                auth_user = AuthUser()
 
                auth_user.username = user.username
 
                auth_user.is_authenticated = True
 
                auth_user.is_admin = user.admin
 
                auth_user.user_id = user.user_id
 
                auth_user.name = user.name
 
                auth_user.lastname = user.lastname
 
                session['rhodecode_user'] = auth_user
 
                session.save()
 
                log.info('user %s is now authenticated', username)
 
                
 
                user.update_lastlogin()
 
                                        
 
                if c.came_from:
 
                    return redirect(c.came_from)
 
                else:
 
                    return redirect(url('hg_home'))
 
                    return redirect(url('home'))
 
                               
 
            except formencode.Invalid, errors:
 
                return htmlfill.render(
 
                    render('/login.html'),
 
                    defaults=errors.value,
 
                    errors=errors.error_dict or {},
 
                    prefix_error=False,
 
                    encoding="UTF-8")
 
                        
 
        return render('/login.html')
 
    
 
    @HasPermissionAnyDecorator('hg.admin', 'hg.register.auto_activate',
 
@@ -132,13 +132,13 @@ class LoginController(BaseController):
 
                    render('/password_reset.html'),
 
                    defaults=errors.value,
 
                    errors=errors.error_dict or {},
 
                    prefix_error=False,
 
                    encoding="UTF-8")
 
        
 
        return render('/password_reset.html')
 
        
 
    def logout(self):
 
        session['rhodecode_user'] = AuthUser()
 
        session.save()
 
        log.info('Logging out and setting user as Empty')
 
        redirect(url('hg_home'))
 
        redirect(url('home'))
rhodecode/controllers/settings.py
Show inline comments
 
@@ -46,25 +46,25 @@ class SettingsController(BaseController)
 
        super(SettingsController, self).__before__()
 
        
 
    def index(self, repo_name):
 
        repo_model = RepoModel()
 
        c.repo_info = repo = repo_model.get(repo_name)
 
        if not repo:
 
            h.flash(_('%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') % repo_name,
 
                      category='error')
 
        
 
            return redirect(url('hg_home'))        
 
            return redirect(url('home'))
 
        defaults = c.repo_info.__dict__
 
        defaults.update({'user':c.repo_info.user.username})
 
        c.users_array = repo_model.get_users_js()
 
        
 
        for p in c.repo_info.repo_to_perm:
 
            defaults.update({'perm_%s' % p.user.username: 
 
                             p.permission.permission_name})
 
            
 
        return htmlfill.render(
 
            render('settings/repo_settings.html'),
 
            defaults=defaults,
 
            encoding="UTF-8",
 
@@ -110,48 +110,48 @@ class SettingsController(BaseController)
 
        #           method='delete')
 
        # url('repo_settings_delete', repo_name=ID)
 
        
 
        repo_model = RepoModel()
 
        repo = repo_model.get(repo_name)
 
        if not repo:
 
            h.flash(_('%s repository is not mapped to db perhaps' 
 
                      ' it was moved or renamed  from the filesystem'
 
                      ' please run the application again'
 
                      ' in order to rescan repositories') % repo_name,
 
                      category='error')
 
        
 
            return redirect(url('hg_home'))
 
            return redirect(url('home'))
 
        try:
 
            action_logger(self.rhodecode_user, 'user_deleted_repo',
 
                              repo_name, '', self.sa)            
 
            repo_model.delete(repo)            
 
            invalidate_cache('cached_repo_list')
 
            h.flash(_('deleted repository %s') % repo_name, category='success')
 
        except Exception:
 
            h.flash(_('An error occurred during deletion of %s') % repo_name,
 
                    category='error')
 
        
 
        return redirect(url('hg_home'))
 
        return redirect(url('home'))
 
    
 
    def fork(self, repo_name):
 
        repo_model = RepoModel()
 
        c.repo_info = repo = repo_model.get(repo_name)
 
        if not repo:
 
            h.flash(_('%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') % repo_name,
 
                      category='error')
 
        
 
            return redirect(url('hg_home'))
 
            return redirect(url('home'))
 
        
 
        return render('settings/repo_fork.html')
 
    
 
    
 
    
 
    def fork_create(self, repo_name):
 
        repo_model = RepoModel()
 
        c.repo_info = repo_model.get(repo_name)
 
        _form = RepoForkForm()()
 
        form_result = {}
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 
@@ -163,13 +163,13 @@ class SettingsController(BaseController)
 
            action_logger(self.rhodecode_user, 'user_forked_repo',
 
                            repo_name, '', self.sa)                                                 
 
        except formencode.Invalid, errors:
 
            c.new_repo = errors.value['fork_name']
 
            r = render('settings/repo_fork.html')
 
            
 
            return htmlfill.render(
 
                r,
 
                defaults=errors.value,
 
                errors=errors.error_dict or {},
 
                prefix_error=False,
 
                encoding="UTF-8")   
 
        return redirect(url('hg_home'))
 
        return redirect(url('home'))
rhodecode/lib/helpers.py
Show inline comments
 
@@ -263,30 +263,30 @@ def pygmentize_annotation(filenode, **kw
 
        else:
 
            col = color_dict[cs] = cgenerator.next()
 
        return "color: rgb(%s)! important;" % (', '.join(col))
 

	
 
    def url_func(changeset):
 
        tooltip_html = "<div style='font-size:0.8em'><b>Author:</b>" + \
 
        " %s<br/><b>Date:</b> %s</b><br/><b>Message:</b> %s<br/></div>"
 

	
 
        tooltip_html = tooltip_html % (changeset.author,
 
                                               changeset.date,
 
                                               tooltip(changeset.message))
 
        lnk_format = 'r%-5s:%s' % (changeset.revision,
 
                                 changeset.short_id)
 
                                 changeset.raw_id)
 
        uri = link_to(
 
                lnk_format,
 
                url('changeset_home', repo_name=changeset.repository.name,
 
                    revision=changeset.short_id),
 
                style=get_color_string(changeset.short_id),
 
                    revision=changeset.raw_id),
 
                style=get_color_string(changeset.raw_id),
 
                class_='tooltip',
 
                tooltip_title=tooltip_html
 
              )
 

	
 
        uri += '\n'
 
        return uri
 
    return literal(annotate_highlight(filenode, url_func, **kwargs))
 

	
 
def repo_name_slug(value):
 
    """Return slug of name of repository
 
    This function is called on each creation/modification
 
    of repository to prevent bad names in repo
 
@@ -343,24 +343,25 @@ def _age(curdate):
 

	
 
    pos = 1
 
    for scale in agescales:
 
        if scale[1] <= age_seconds:
 
            return time_ago_in_words(curdate, agescales[pos][0])
 
        pos += 1
 

	
 
age = lambda  x:_age(x)
 
capitalize = lambda x: x.capitalize()
 
email = util.email
 
email_or_none = lambda x: util.email(x) if util.email(x) != x else None
 
person = lambda x: _person(x)
 
short_id = lambda x: x[:12]
 

	
 
#==============================================================================
 
# PERMS
 
#==============================================================================
 
from rhodecode.lib.auth import HasPermissionAny, HasPermissionAll, \
 
HasRepoPermissionAny, HasRepoPermissionAll
 

	
 
#==============================================================================
 
# GRAVATAR URL
 
#==============================================================================
 
import hashlib
 
import urllib
rhodecode/lib/utils.py
Show inline comments
 
@@ -294,24 +294,25 @@ def invalidate_cache(name, *args):
 
        from rhodecode.model.hg import _full_changelog_cached
 
        region_invalidate(_full_changelog_cached, None, *args)
 

	
 
class EmptyChangeset(BaseChangeset):
 
    """
 
    An dummy empty changeset.
 
    """
 

	
 
    revision = -1
 
    message = ''
 
    author = ''
 
    date = ''
 

	
 
    @LazyProperty
 
    def raw_id(self):
 
        """
 
        Returns raw string identifying this changeset, useful for web
 
        representation.
 
        """
 
        return '0' * 40
 

	
 
    @LazyProperty
 
    def short_id(self):
 
        return self.raw_id[:12]
 

	
rhodecode/model/hg.py
Show inline comments
 
@@ -149,25 +149,25 @@ class HgModel(object):
 
                continue
 

	
 
            last_change = repo.last_change
 
            tip = h.get_changeset_safe(repo, 'tip')
 

	
 
            tmp_d = {}
 
            tmp_d['name'] = repo.name
 
            tmp_d['name_sort'] = tmp_d['name'].lower()
 
            tmp_d['description'] = repo.description
 
            tmp_d['description_sort'] = tmp_d['description']
 
            tmp_d['last_change'] = last_change
 
            tmp_d['last_change_sort'] = time.mktime(last_change.timetuple())
 
            tmp_d['tip'] = tip.short_id
 
            tmp_d['tip'] = tip.raw_id
 
            tmp_d['tip_sort'] = tip.revision
 
            tmp_d['rev'] = tip.revision
 
            tmp_d['contact'] = repo.contact
 
            tmp_d['contact_sort'] = tmp_d['contact']
 
            tmp_d['repo_archives'] = list(repo._get_archives())
 
            tmp_d['last_msg'] = tip.message
 
            tmp_d['repo'] = repo
 
            yield tmp_d
 

	
 
    def get_repo(self, repo_name):
 
        try:
 
            repo = _get_repos_cached()[repo_name]
rhodecode/public/css/style.css
Show inline comments
 
@@ -1692,24 +1692,25 @@ z-index:2;
 
 
.yui-tt {
 
visibility:hidden;
 
position:absolute;
 
color:#666;
 
background-color:#FFF;
 
font-family:arial, helvetica, verdana, sans-serif;
 
border:2px solid #003367;
 
font:100% sans-serif;
 
width:auto;
 
opacity:1px;
 
padding:8px;
 
white-space: pre;
 
}
 
 
.ac {
 
vertical-align:top;
 
}
 
 
.ac .yui-ac {
 
position:relative;
 
font-family:arial;
 
font-size:100%;
 
}
 
rhodecode/templates/base/base.html
Show inline comments
 
@@ -22,25 +22,25 @@
 
	            </div>
 
	            <div class="account">
 
	            	${h.link_to('%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname),h.url('admin_settings_my_account'))}<br/>
 
	            	${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'))}
 
	            </div>	
 
            </li>
 
            <li class="last highlight">${h.link_to(u'Logout',h.url('logout_home'))}</li>
 
        </ul>
 
        <!-- end user -->
 
        <div id="header-inner" class="title top-left-rounded-corner top-right-rounded-corner">
 
            <!-- logo -->
 
            <div id="logo">
 
                <h1><a href="${h.url('hg_home')}">${c.rhodecode_name}</a></h1>
 
                <h1><a href="${h.url('home')}">${c.rhodecode_name}</a></h1>
 
            </div>
 
            <!-- end logo -->
 
            <!-- menu -->
 
            ${self.page_nav()}
 
            <!-- quick -->
 
        </div>
 
    </div>     
 
    <!-- end header -->
 
    
 
	<!-- CONTENT -->
 
	<div id="content"> 
 
        <div class="flash_msg">
 
@@ -137,37 +137,37 @@
 
                   <a title="${_('Switch to')}" href="#">
 
                   <span class="icon">
 
                       <img src="/images/icons/arrow_switch.png" alt="${_('Switch to')}" />
 
                   </span>
 
                   <span>${_('Switch to')}</span>                 
 
                   </a>    
 
                    <ul>
 
                        <li>
 
                            ${h.link_to(_('branches'),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
 
                            <ul>
 
                            %if c.repository_branches.values():
 
						        %for cnt,branch in enumerate(c.repository_branches.items()):
 
						            <li>${h.link_to('%s - %s' % (branch[0],branch[1]),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
 
						            <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
 
						        %endfor
 
						    %else:
 
						    	<li>${h.link_to(_('There are no branches yet'),'#')}</li>
 
						    %endif
 
                            </ul>                        
 
                        </li>
 
                        <li>
 
                            ${h.link_to(_('tags'),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
 
                            <ul>
 
                            %if c.repository_tags.values():
 
                                %for cnt,tag in enumerate(c.repository_tags.items()):
 
                                 <li>${h.link_to('%s - %s' % (tag[0],tag[1]),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
 
                                 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
 
                                %endfor
 
                            %else:
 
                            	<li>${h.link_to(_('There are no tags yet'),'#')}</li>
 
                            %endif
 
                            </ul>                        
 
                        </li>                        
 
                    </ul>
 
                </li>
 
                <li ${is_current('files')}>
 
                   <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
 
                   <span class="icon">
 
                       <img src="/images/icons/file.png" alt="${_('Files')}" />
 
@@ -210,25 +210,25 @@
 
##	                  ${h.form(url('repo_settings_delete', repo_name=c.repo_name),method='delete')}
 
##	                    ${h.submit('remove_%s' % c.repo_name,'delete',class_="delete_icon action_button",onclick="return confirm('Confirm to delete this repository');")}
 
##	                  ${h.end_form()}
 
##                   	</li>
 
##                   	%endif
 
                   </ul>             
 
                </li>
 
	        </ul>
 
		%else:
 
		    ##ROOT MENU
 
            <ul id="quick">
 
                <li>
 
                    <a title="${_('Home')}"  href="${h.url('hg_home')}">
 
                    <a title="${_('Home')}"  href="${h.url('home')}">
 
                    <span class="icon">
 
                        <img src="/images/icons/home_16.png" alt="${_('Home')}" />
 
                    </span>
 
                    <span>${_('Home')}</span>                 
 
                    </a>        
 
                </li>
 
                
 
                <li>
 
                    <a title="${_('Search')}"  href="${h.url('search')}">
 
                    <span class="icon">
 
                        <img src="/images/icons/search_16.png" alt="${_('Search')}" />
 
                    </span>
rhodecode/templates/branches/branches_data.html
Show inline comments
 
% if c.repo_branches:
 
    <table class="table_disp">
 
        <tr>
 
            <th class="left">${_('date')}</th>
 
            <th class="left">${_('name')}</th>
 
            <th class="left">${_('author')}</th>
 
            <th class="left">${_('revision')}</th>
 
            <th class="left">${_('name')}</th>
 
            <th class="left">${_('links')}</th>
 
        </tr>
 
		%for cnt,branch in enumerate(c.repo_branches.items()):
 
		<tr class="parity${cnt%2}">
 
			<td>${h.age(branch[1].date)}</td>
 
			<td>r${branch[1].revision}:${branch[1].short_id}</td>
 
            <td>${branch[1].date} - ${h.age(branch[1].date)}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="branchtag">${h.link_to(branch[0],
 
					h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].short_id))}</span>
 
                    h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}</span>
 
				</span>			
 
			</td>
 
            <td title="${branch[1].author}">${h.person(branch[1].author)}</td>
 
            <td>r${branch[1].revision}:${h.short_id(branch[1].raw_id)}</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].short_id))}
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].short_id))}
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 
%else:
 
	${_('There are no branches yet')}
 
%endif
 

	
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -37,61 +37,61 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
        <div class="info_box">
 
          <span>${_('Show')}:</span>
 
          ${h.text('size',size=1,value=c.size)}
 
          <span>${_('revisions')}</span>
 
          ${h.submit('set',_('set'))}
 
        </div>
 
        ${h.end_form()}
 
						
 
					</div>
 
				%for cnt,cs in enumerate(c.pagination):
 
					<div id="chg_${cnt+1}" class="container">
 
						<div class="left">
 
							<div class="date">${_('commit')} ${cs.revision}: ${cs.short_id}@${cs.date}</div>
 
							<div class="date">${_('commit')} ${cs.revision}: ${cs.raw_id}@${cs.date}</div>
 
							<div class="author">
 
								<div class="gravatar">
 
									<img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),20)}"/>
 
								</div>
 
								<span>${h.person(cs.author)}</span><br/>
 
								<span><a href="mailto:${h.email_or_none(cs.author)}">${h.email_or_none(cs.author)}</a></span><br/>
 
							</div>
 
							<div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id))}</div>
 
							<div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
 
						</div>	
 
						<div class="right">
 
									<div class="changes">
 
										<span class="removed" title="${_('removed')}">${len(cs.removed)}</span>
 
										<span class="changed" title="${_('changed')}">${len(cs.changed)}</span>
 
										<span class="added" title="${_('added')}">${len(cs.added)}</span>
 
									</div>					
 
										%if len(cs.parents)>1:
 
										<div class="merge">
 
											${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"/>
 
										</div>
 
										%endif
 
								   %if cs.parents:							
 
									%for p_cs in reversed(cs.parents):
 
										<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id,
 
											h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)}
 
										<div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.raw_id,
 
											h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
 
										</div>
 
									%endfor
 
								   %else:	
 
                                        <div class="parent">${_('No parents')}</div>   
 
                                   %endif  
 
                    									
 
								<span class="logtags">
 
									<span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}">
 
									${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.short_id))}</span>
 
									${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
 
									%for tag in cs.tags:
 
										<span class="tagtag"  title="${'%s %s' % (_('tag'),tag)}">
 
										${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs.short_id))}</span>
 
										${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span>
 
									%endfor
 
								</span>																	
 
						</div>				
 
					</div>
 
					
 
				%endfor
 
				<div class="pagination-wh pagination-left">
 
					${c.pagination.pager('$link_previous ~2~ $link_next')}
 
				</div>			
 
				</div>
 
			</div>
 
			
rhodecode/templates/changeset/changeset.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}  - ${c.rhodecode_name}
 
    ${c.repo_name} ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)} - ${c.rhodecode_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    &raquo;
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    &raquo;
 
    ${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}
 
    ${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('changelog')}     
 
</%def>
 

	
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <div class="table">
 
		<div id="body" class="diffblock">
 
			<div class="code-header">
 
				<div>
 
				${_('Changeset')} - r${c.changeset.revision}:${c.changeset.short_id}
 
				${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
 
				 &raquo; <span>${h.link_to(_('raw diff'),
 
				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id,diff='show'))}</span>
 
				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</span>
 
				 &raquo; <span>${h.link_to(_('download diff'),
 
				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id,diff='download'))}</span>
 
				h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</span>
 
				</div>
 
			</div>
 
		</div>
 
	    <div id="changeset_content">
 
			<div class="container">
 
	             <div class="left">
 
	                 <div class="date">${_('commit')} ${c.changeset.revision}: ${c.changeset.short_id}@${c.changeset.date}</div>
 
	                 <div class="date">${_('commit')} ${c.changeset.revision}: ${h.short_id(c.changeset.raw_id)}@${c.changeset.date}</div>
 
	                 <div class="author">
 
	                     <div class="gravatar">
 
	                         <img alt="gravatar" src="${h.gravatar_url(h.email(c.changeset.author),20)}"/>
 
	                     </div>
 
	                     <span>${h.person(c.changeset.author)}</span><br/>
 
	                     <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
 
	                 </div>
 
	                 <div class="message">${h.link_to(h.wrap_paragraphs(c.changeset.message),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.short_id))}</div>
 
	                 <div class="message">${h.link_to(h.wrap_paragraphs(c.changeset.message),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</div>
 
	             </div>
 
	             <div class="right">
 
		             <div class="changes">
 
		                 <span class="removed" title="${_('removed')}">${len(c.changeset.removed)}</span>
 
		                 <span class="changed" title="${_('changed')}">${len(c.changeset.changed)}</span>
 
		                 <span class="added" title="${_('added')}">${len(c.changeset.added)}</span>
 
		             </div>                  
 
		                 %if len(c.changeset.parents)>1:
 
		                 <div class="merge">
 
		                     ${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"/>
 
		                 </div>
 
		                 %endif
 
		                 
 
		            %if c.changeset.parents:
 
		             %for p_cs in reversed(c.changeset.parents):
 
		                 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id,
 
		                     h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)}
 
		                 <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(h.short_id(p_cs.raw_id),
 
		                     h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
 
		                 </div>
 
		             %endfor
 
                    %else: 
 
                        <div class="parent">${_('No parents')}</div>   
 
                    %endif		             
 
		         <span class="logtags">
 
		             <span class="branchtag" title="${'%s %s' % (_('branch'),c.changeset.branch)}">
 
		             ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.short_id))}</span>
 
		             ${h.link_to(c.changeset.branch,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span>
 
		             %for tag in c.changeset.tags:
 
		                 <span class="tagtag"  title="${'%s %s' % (_('tag'),tag)}">
 
		                 ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.short_id))}</span>
 
		                 ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span>
 
		             %endfor
 
		         </span>                                                                 
 
	                </div>              
 
	        </div>
 
	        <span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span>
 
	        <div class="cs_files">
 
	                %for change,filenode,diff,cs1,cs2 in c.changes:
 
	                    <div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor='CHANGE-%s'%filenode.path))}</div>
 
	                %endfor
 
	        </div>         
 
	    </div>
 
	    
 
    </div>
 
    	
 
	%for change,filenode,diff,cs1,cs2 in c.changes:
 
		%if change !='removed':
 
		<div style="clear:both;height:10px"></div>
 
		<div id="body" class="diffblock">
 
			<div id="${'CHANGE-%s'%filenode.path}" class="code-header">
 
				<div>
 
					<span>
 
						${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
 
						revision=filenode.changeset.short_id,f_path=filenode.path))}
 
						revision=filenode.changeset.raw_id,f_path=filenode.path))}
 
					</span>
 
					%if 1:
 
					&raquo; <span>${h.link_to(_('diff'),
 
					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='diff'))}</span>
 
					&raquo; <span>${h.link_to(_('raw diff'),
 
					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='raw'))}</span>
 
					&raquo; <span>${h.link_to(_('download diff'),
 
					h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='download'))}</span>
 
					%endif
 
				</div>
 
			</div>
 
			<div class="code-body">        
rhodecode/templates/errors/error_404.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="./../base/base.html"/>
 
            
 
<%def name="title()">
 
    ${_('Repository not found')}
 
</%def>
 

	
 
<%def name="breadcrumbs()">
 
	${h.link_to(u'Home',h.url('hg_home'))}
 
	${h.link_to(u'Home',h.url('home'))}
 
	 / 
 
	${h.link_to(u'Admin',h.url('admin_home'))}
 
</%def>
 

	
 
<%def name="page_nav()">
 
	${self.menu('admin')}
 
</%def>
 
<%def name="js()">
 

	
 
</%def>
 
<%def name="main()">
 

	
 
    <h2 class="no-link no-border">${_('Not Found')}</h2>
 
    <p class="normal">${_('The specified repository "%s" is unknown, sorry.') % c.repo_name}</p>
 
    <p class="normal">
 
    <a href="${h.url('new_repo',repo=c.repo_name_cleaned)}">
 
    ${_('Create "%s" repository as %s' % (c.repo_name,c.repo_name_cleaned))}</a>
 

	
 
    </p>
 
    <p class="normal">${h.link_to(_('Go back to the main repository list page'),h.url('hg_home'))}</p>
 
    <p class="normal">${h.link_to(_('Go back to the main repository list page'),h.url('home'))}</p>
 
    <div class="page-footer">
 
    </div>
 
</%def>
 
\ No newline at end of file
rhodecode/templates/files/file_diff.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${c.repo_name} ${_('File diff')} - ${c.rhodecode_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    &raquo;
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    &raquo;
 
    ${'%s:  %s %s %s' % (_('File diff'),c.diff2,'&rarr;',c.diff1)|n}
 
    ${_('File diff')} r${c.changeset_1.revision}:${h.short_id(c.changeset_1.raw_id)} &rarr; r${c.changeset_2.revision}:${h.short_id(c.changeset_2.raw_id)}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('files')}     
 
</%def>
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <div class="table">
 
		<div id="body" class="diffblock">
 
			<div class="code-header">
 
				<div>
 
				<span>${h.link_to(c.f_path,h.url('files_home',repo_name=c.repo_name,
 
				revision=c.diff2.split(':')[1],f_path=c.f_path))}</span>
 
				revision=c.changeset_2.raw_id,f_path=c.f_path))}</span>
 
				 &raquo; <span>${h.link_to(_('diff'),
 
				h.url.current(diff2=c.diff2.split(':')[-1],diff1=c.diff1.split(':')[-1],diff='diff'))}</span>
 
				h.url.current(diff2=c.changeset_2.raw_id,diff1=c.changeset_1.raw_id,diff='diff'))}</span>
 
				 &raquo; <span>${h.link_to(_('raw diff'),
 
				h.url.current(diff2=c.diff2.split(':')[-1],diff1=c.diff1.split(':')[-1],diff='raw'))}</span>
 
				h.url.current(diff2=c.changeset_2.raw_id,diff1=c.changeset_1.raw_id,diff='raw'))}</span>
 
				 &raquo; <span>${h.link_to(_('download diff'),
 
				h.url.current(diff2=c.diff2.split(':')[-1],diff1=c.diff1.split(':')[-1],diff='download'))}</span>
 
				h.url.current(diff2=c.changeset_2.raw_id,diff1=c.changeset_1.raw_id,diff='download'))}</span>
 
				</div>
 
			</div>
 
			<div class="code-body">
 
		 			%if c.no_changes:
 
		            	${_('No changes')}
 
		            %else:        
 
						${c.cur_diff|n}
 
		            %endif
 
			</div>
 
		</div>   
 
    </div>
 
</div>    
rhodecode/templates/files/files.html
Show inline comments
 
@@ -2,25 +2,25 @@
 

	
 
<%def name="title()">
 
    ${c.repo_name} ${_('Files')} - ${c.rhodecode_name}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    &raquo;
 
    ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))}
 
    &raquo;
 
    ${_('files')}
 
    %if c.files_list:
 
        @ R${c.rev_nr}:${c.cur_rev}
 
        @ R${c.rev_nr}:${h.short_id(c.cur_rev)}
 
    %endif        
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('files')}     
 
</%def>
 

	
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}     
rhodecode/templates/files/files_annotate.html
Show inline comments
 
@@ -17,42 +17,42 @@
 
</%def>
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <div class="table">
 
		<div id="files_data">
 
			<h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.file.path)}</h3>
 
			<dl class="overview">
 
				<dt>${_('Last revision')}</dt>
 
				<dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset.short_id),
 
						h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset.short_id,f_path=c.f_path))} </dd>
 
				<dd>${h.link_to("r%s:%s" % (c.file.last_changeset.revision,c.file.last_changeset.raw_id),
 
						h.url('files_annotate_home',repo_name=c.repo_name,revision=c.file.last_changeset.raw_id,f_path=c.f_path))} </dd>
 
				<dt>${_('Size')}</dt>
 
				<dd>${h.format_byte_size(c.file.size,binary=True)}</dd>
 
    			<dt>${_('Mimetype')}</dt>
 
				<dd>${c.file.mimetype}</dd>				
 
				<dt>${_('Options')}</dt>
 
				<dd>${h.link_to(_('show source'),
 
						h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}  
 
					/ ${h.link_to(_('show as raw'),
 
						h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
 
					/ ${h.link_to(_('download as raw'),
 
						h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
 
				</dd>				
 
			</dl>
 
			<div id="body" class="codeblock">
 
				<div class="code-header">
 
					<div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset.short_id}</div>
 
					<div class="revision">${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset.raw_id}</div>
 
					<div class="commit">"${c.file_msg}"</div>
 
				</div>
 
				<div class="code-body">
 
					% if c.file.size < c.file_size_limit:
 
						${h.pygmentize_annotation(c.file,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")}
 
					%else:
 
						${_('File is to big to display')} ${h.link_to(_('show as raw'),
 
						h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
 
					%endif				
 
				</div>
 
			</div>
 
		</div>    
rhodecode/templates/files/files_source.html
Show inline comments
 
<dl>
 
	<dt>${_('Last revision')}</dt>
 
	<dd>
 
		${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,c.files_list.last_changeset.short_id),
 
						h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset.short_id,f_path=c.f_path))} 
 
		${h.link_to("r%s:%s" % (c.files_list.last_changeset.revision,h.short_id(c.files_list.last_changeset.raw_id)),
 
						h.url('files_home',repo_name=c.repo_name,revision=c.files_list.last_changeset.raw_id,f_path=c.f_path))} 
 
	</dd>
 
	<dt>${_('Size')}</dt>
 
	<dd>${h.format_byte_size(c.files_list.size,binary=True)}</dd>
 
	<dt>${_('Mimetype')}</dt>
 
	<dd>${c.files_list.mimetype}</dd>
 
	<dt>${_('Options')}</dt>
 
	<dd>${h.link_to(_('show annotation'),
 
			h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
 
		 / ${h.link_to(_('show as raw'),
 
			h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}			
 
		 / ${h.link_to(_('download as raw'),
 
			h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
 
	</dd>
 
	<dt>${_('History')}</dt>
 
	<dd>
 
		<div>
 
		${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')}
 
		${h.hidden('diff2',c.files_list.last_changeset.short_id)}
 
		${h.select('diff1',c.files_list.last_changeset.short_id,c.file_history)}
 
		${h.hidden('diff2',c.files_list.last_changeset.raw_id)}
 
		${h.select('diff1',c.files_list.last_changeset.raw_id,c.file_history)}
 
		${h.submit('diff','diff to revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
 
		${h.submit('show_rev','show at revision',class_="ui-button ui-widget ui-state-default ui-corner-all")}
 
		${h.end_form()}
 
		</div>
 
	</dd>
 
</dl>	
 

	
 
	
 
<div id="body" class="codeblock">
 
	<div class="code-header">
 
		<div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset.short_id}</div>
 
		<div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${h.short_id(c.files_list.last_changeset.raw_id)}</div>
 
		<div class="commit">"${c.files_list.last_changeset.message}"</div>
 
	</div>
 
	<div class="code-body">
 
		% if c.files_list.size < c.file_size_limit:
 
			${h.pygmentize(c.files_list,linenos=True,anchorlinenos=True,lineanchors='S',cssclass="code-highlight")}
 
		%else:
 
			${_('File is to big to display')} ${h.link_to(_('show as raw'),
 
			h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
 
		%endif
 
	</div>
 
</div>
 

	
rhodecode/templates/index.html
Show inline comments
 
@@ -47,51 +47,54 @@
 
			        <th class="left">${get_sort(_('Tip'))}</th>
 
			        <th class="left">${get_sort(_('Owner'))}</th>
 
			        <th class="left">${_('RSS')}</th>
 
			        <th class="left">${_('Atom')}</th>
 
	            </tr>
 
            </thead>
 
                        <tbody>
 
					    %for cnt,repo in enumerate(c.repos_list):
 
					        %if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(repo['name'],'main page check'):
 
					        <tr class="parity${cnt%2}">
 
					            <td>
 
					             %if repo['repo'].dbrepo.repo_type =='hg':
 
					               <img class="icon" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
 
					               <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
 
					             %elif repo['repo'].dbrepo.repo_type =='git':
 
					               <img class="icon" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
 
					               <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
 
					             %else:
 
					               
 
					             %endif 
 
					            
 
					             %if repo['repo'].dbrepo.private:
 
					                <img class="icon" alt="${_('private')}" src="/images/icons/lock.png"/>
 
					                <img class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/>
 
					             %else:
 
					                <img class="icon" alt="${_('public')}" src="/images/icons/lock_open.png"/>
 
					                <img class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/>
 
					             %endif  
 
					            ${h.link_to(repo['name'],
 
					                h.url('summary_home',repo_name=repo['name']))}
 
					            %if repo['repo'].dbrepo.fork:
 
					            	<a href="${h.url('summary_home',repo_name=repo['repo'].dbrepo.fork.repo_name)}">
 
					            	<img class="icon" alt="${_('public')}"
 
					            	<img class="icon" alt="${_('fork')}"
 
					            	title="${_('Fork of')} ${repo['repo'].dbrepo.fork.repo_name}" 
 
					            	src="/images/icons/arrow_divide.png"/></a>
 
					            %endif
 
					            </td>
 
					            <td title="${repo['description']}">${h.truncate(repo['description'],60)}</td>
 
					            <td><span class="tooltip" tooltip_title="${repo['description']}">
 
					               ${h.truncate(repo['description'],60)}</span>
 
					            </td>
 
					            <td><span class="tooltip" tooltip_title="${repo['last_change']}">
 
					                ${h.age(repo['last_change'])} </span></td>
 
					                ${h.age(repo['last_change'])} </span>
 
					            </td>
 
					            <td>
 
					            	%if repo['rev']>=0:
 
					            	${h.link_to('r%s:%s' % (repo['rev'],repo['tip']),
 
					            	${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])),
 
					                h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
 
					                class_="tooltip",
 
					                tooltip_title=h.tooltip(repo['last_msg']))}
 
					            	%else:
 
					            		${_('No changesets yet')}
 
					            	%endif    
 
					            </td>
 
					            <td title="${repo['contact']}">${h.person(repo['contact'])}</td>
 
					            <td>
 
					                <a title="${_('Subscribe to %s rss feed')%repo['name']}" class="rss_icon"  href="${h.url('rss_feed_home',repo_name=repo['name'])}"></a>
 
					            </td>        
 
					            <td>
rhodecode/templates/shortlog/shortlog_data.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
% if c.repo_changesets:
 
<table>
 
	<tr>
 
		<th class="left">${_('date')}</th>
 
		<th class="left">${_('commit message')}</th>
 
		<th class="left">${_('author')}</th>
 
		<th class="left">${_('revision')}</th>
 
		<th class="left">${_('commit message')}</th>
 
		<th class="left">${_('branch')}</th>
 
		<th class="left">${_('tags')}</th>
 
		<th class="left">${_('links')}</th>
 
		
 
	</tr>
 
%for cnt,cs in enumerate(c.repo_changesets):
 
	<tr class="parity${cnt%2}">
 
		<td>${h.age(cs.date)} - ${cs.date} </td>
 
		<td title="${cs.author}">${h.person(cs.author)}</td>
 
		<td>r${cs.revision}:${cs.short_id}</td>
 
		<td>${cs.date} - ${h.age(cs.date)}</td>
 
		<td>
 
			${h.link_to(h.truncate(cs.message,60),
 
			h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id),
 
            h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id),
 
			title=cs.message)}
 
		</td>
 
		<td title="${cs.author}">${h.person(cs.author)}</td>
 
		<td>r${cs.revision}:${h.short_id(cs.raw_id)}</td>
 
		<td>
 
			<span class="logtags">
 
				<span class="branchtag">${cs.branch}</span>
 
			</span>
 
		</td>
 
		<td>
 
			<span class="logtags">
 
				%for tag in cs.tags:
 
					<span class="tagtag">${tag}</span>
 
				%endfor
 
			</span>
 
		</td>
 
		<td class="nowrap">
 
		${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.short_id))}
 
		${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
 
		|
 
		${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.short_id))}
 
		${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
 
		</td>
 
	</tr>
 
%endfor
 

	
 
</table>
 

	
 
<script type="text/javascript">
 
  var data_div = 'shortlog_data';
 
  YAHOO.util.Event.onDOMReady(function(){
 
    YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){
 
            YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});});
 
</script>
rhodecode/templates/summary/summary.html
Show inline comments
 
@@ -33,28 +33,37 @@ E.onDOMReady(function(e){
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <!-- end box / title -->
 
	<div class="form">
 
	  <div class="fields">
 
		 
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Name')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			  
 
		          %if c.repo_info.dbrepo.repo_type =='hg':
 
		            <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/>
 
		          %elif c.repo_info.dbrepo.repo_type =='git':
 
		            <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/>
 
		          %else:
 
		            
 
		          %endif 
 
                                 			  
 
	             %if c.repo_info.dbrepo.private:
 
	                <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private')}" src="/images/icons/lock.png"/>
 
	                <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/>
 
	             %else:
 
	                <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public')}" src="/images/icons/lock_open.png"/>
 
	                <img style="margin-bottom:2px" class="icon" title="${_('public repository')}" alt="${_('public repository')}" src="/images/icons/lock_open.png"/>
 
	             %endif
 
			      <span style="font-size: 1.6em;font-weight: bold;vertical-align: baseline;">${c.repo_info.name}</span>
 
			      <br/>
 
		            %if c.repo_info.dbrepo.fork:
 
		            	<span style="margin-top:5px">
 
		            	<a href="${h.url('summary_home',repo_name=c.repo_info.dbrepo.fork.repo_name)}">
 
		            	<img class="icon" alt="${_('public')}"
 
		            	title="${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}" 
 
		            	src="/images/icons/arrow_divide.png"/>
 
		            	${_('Fork of')} ${c.repo_info.dbrepo.fork.repo_name}
 
		            	</a>
 
		            	</span>
rhodecode/templates/tags/tags_data.html
Show inline comments
 
%if c.repo_tags:    
 
    <table>
 
    	<tr>
 
			<th class="left">${_('date')}</th>
 
	        <th class="left">${_('name')}</th>
 
	        <th class="left">${_('author')}</th>
 
			<th class="left">${_('revision')}</th>
 
			<th class="left">${_('name')}</th>
 
			<th class="left">${_('links')}</th>
 
    	</tr>
 
		%for cnt,tag in enumerate(c.repo_tags.items()):
 
		<tr class="parity${cnt%2}">
 
			<td>${h.age(tag[1].date)}</td>
 
			<td>r${tag[1].revision}:${tag[1].short_id}</td>
 
	        <td>${tag[1].date} - ${h.age(tag[1].date)}</td>
 
			<td>
 
				<span class="logtags">
 
					<span class="tagtag">${h.link_to(tag[0],
 
					h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].short_id))}</span>
 
                    h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}</span>
 
				</span>
 
			</td>
 
	        <td title="${tag[1].author}">${h.person(tag[1].author)}</td>
 
	        <td>r${tag[1].revision}:${h.short_id(tag[1].raw_id)}</td>
 
			<td class="nowrap">
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].short_id))}
 
			${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
 
			|
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].short_id))}
 
			${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
 
			</td>
 
		</tr>	
 
		%endfor
 
    </table>
 
%else:
 
	${_('There are no tags yet')}
 
%endif    
 
\ No newline at end of file
0 comments (0 inline, 0 general)