Changeset - c4caeca9dd66
[Not reviewed]
default
0 2 0
Marcin Kuzminski - 15 years ago 2010-06-14 00:17:08
marcin@python-works.com
fixed paragraphs wrapping for ultralong commit messages. Disabled tooltips for new repos without a last commit message. ie. when tooltip_title is empty (there is a strange bug on empty tooltip_title)
2 files changed with 11 insertions and 5 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/helpers.py
Show inline comments
 
@@ -91,53 +91,60 @@ class _ToolTip(object):
 
        YAHOO.util.Event.onDOMReady(function(){
 
            function toolTipsId(){
 
                var ids = [];
 
                var tts = YAHOO.util.Dom.getElementsByClassName('tooltip');
 
                
 
                for (var i = 0; i < tts.length; i++) {
 
                    //if element doesn not have and id autgenerate one for tooltip
 
                    
 
                    if (!tts[i].id){
 
                        tts[i].id='tt'+i*100;
 
                    }
 
                    ids.push(tts[i].id);
 
                }
 
                return ids        
 
            };
 
            var myToolTips = new YAHOO.widget.Tooltip("tooltip", { 
 
                context: toolTipsId(),
 
                monitorresize:false,
 
                xyoffset :[0,0],
 
                autodismissdelay:300000,
 
                hidedelay:5,
 
                showdelay:20,
 
            });
 
            
 
            //Mouse subscribe optional arguments
 
            //Mouse Over event disabled for new repositories since they dont
 
            //have last commit message
 
            myToolTips.contextMouseOverEvent.subscribe(
 
                function(type, args) {
 
                    var context = args[0];
 
                    return true;
 
                    var txt = context.getAttribute('tooltip_title');
 
                    if(txt){
 
                        return true;
 
                    }
 
                    else{
 
                        return false;
 
                    }
 
                });
 
            
 
            // Set the text for the tooltip just before we display it. Lazy method
 
            myToolTips.contextTriggerEvent.subscribe( 
 
                 function(type, args) { 
 
                        var context = args[0]; 
 
                        var txt = context.getAttribute('tooltip_title');
 
                        this.cfg.setProperty("text", txt);                     
 
                  });
 
        });
 
        '''         
 
        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=''))]
 
        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]))))
pylons_app/templates/changelog/changelog.html
Show inline comments
 
@@ -19,51 +19,50 @@
 
    <h2 class="no-link no-border">${_('Changelog')} - ${_('showing ')} 
 
    	${c.size if c.size <= c.total_cs else c.total_cs}
 
    	${_('out of')} ${c.total_cs} ${_('revisions')}
 
    </h2>
 
	<noscript>${_('The revision graph only works with JavaScript-enabled browsers.')}</noscript>
 
% if c.pagination:
 

	
 
<div id="graph">
 
	##<div id="graph_nodes" style="height:1000px">
 
	##	<canvas id="graph" width="160"></canvas>
 
	##</div>
 
	<div id="graph_content">
 
		<div class="container_header">
 
			${h.form(h.url.current(),method='get')}
 
				${_('Show')}: ${h.text('size',size=2,value=c.size)} ${_('revisions')}
 
				${h.submit('','set')}
 
			${h.end_form()}
 
		</div>
 
	%for cnt,cs in enumerate(c.pagination):
 
		<div class="container">
 
			<div class="left">
 
				<div class="date">${_('commit')} ${cs.revision}: ${cs.raw_id}@${cs.date}</div>
 
				<div class="author">${cs.author}</div>
 
				<div id="chg_${cnt}" class="message">
 
					${h.link_to(cs.message,
 
					h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id),
 
					title=cs.message)}
 
					${h.link_to(h.wrap_paragraphs(cs.message),
 
					h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
 
				</div>
 
					<span class="logtags">
 
						<span class="branchtag">${cs.branch}</span>
 
						%for tag in cs.tags:
 
							<span class="tagtag">${tag}</span>
 
						%endfor
 
					</span>
 
			</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						
 
						%for p_cs in reversed(cs.parents):
 
							<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								
0 comments (0 inline, 0 general)