Changeset - 5827c739b0bd
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-06-22 22:32:19
marcin@python-works.com
webhelpers breadcrumbs bugfix
1 file changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/helpers.py
Show inline comments
 
@@ -149,54 +149,59 @@ class _ToolTip(object):
 
            myToolTips.contextMouseOutEvent.subscribe(
 
                function(type, args) {
 
                    var context = args[0];
 
                    
 
                    //console.log(this.cfg.config.x.value);
 
                    //console.log(this.cfg.config.y.value);
 
                    //console.log(this.cfg.config.xy.value);
 
                    //console.log(this.cfg.config);
 
                    //this.cfg.config.xy = [0,0];
 
                    //this.cfg.config.xyoffset = [0,0];
 
                    
 
                    
 
                    
 
                });
 
                                  
 
        });
 
        '''         
 
        return literal(js)
 

	
 
tooltip = _ToolTip()
 

	
 
class _FilesBreadCrumbs(object):
 
    
 
    def __call__(self, repo_name, rev, paths):
 
        url_l = [link_to(repo_name, url('files_home', repo_name=repo_name, revision=rev, f_path=''))]
 
        url_l = [link_to(repo_name, url('files_home',
 
                                        repo_name=repo_name,
 
                                        revision=rev, f_path=''))]
 
        paths_l = paths.split(' / ')
 
        
 
        for cnt, p in enumerate(paths_l, 1):
 
            if p != '':
 
                url_l.append(link_to(p, url('files_home', repo_name=repo_name, revision=rev, f_path=' / '.join(paths_l[:cnt]))))
 
                url_l.append(link_to(p, url('files_home',
 
                                            repo_name=repo_name,
 
                                            revision=rev,
 
                                            f_path='/'.join(paths_l[:cnt]))))
 

	
 
        return literal(' / '.join(url_l))
 

	
 
files_breadcrumbs = _FilesBreadCrumbs()
 

	
 
def pygmentize(filenode, **kwargs):
 
    """
 
    pygmentize function using pygments
 
    @param filenode:
 
    """
 
    return literal(code_highlight(filenode.content, filenode.lexer, HtmlFormatter(**kwargs)))
 

	
 
def pygmentize_annotation(filenode, **kwargs):
 
    """
 
    pygmentize function for annotation
 
    @param filenode:
 
    """
 
    
 
    color_dict = g.changeset_annotation_colors
 
    def gen_color():
 
        import random
 
        return [str(random.randrange(10, 235)) for _ in xrange(3)]
 
    def get_color_string(cs):
 
        if color_dict.has_key(cs):
0 comments (0 inline, 0 general)