Changeset - 8d0c7276db3d
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 15 years ago 2010-06-05 10:45:12
marcin@python-works.com
fixed repo switcher
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
pylons_app/templates/base/base.html
Show inline comments
 
@@ -50,48 +50,49 @@
 
</html>
 

	
 
### MAKO DEFS ### 
 

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

	
 
<%def name="menu(current)">
 
<% 
 
def is_current(selected):
 
	if selected == current:
 
		return "class='current'"
 
%>
 
		%if current not in ['home','admin']:
 
		##regular menu
 
	       <script type="text/javascript">
 
	       	YAHOO.util.Event.onDOMReady(function(){
 
				YAHOO.util.Event.addListener('repo_switcher','click',function(){
 
					if(YAHOO.util.Dom.hasClass('repo_switcher','selected')){
 
						YAHOO.util.Dom.setStyle('switch_repos','display','none');
 
						YAHOO.util.Dom.setStyle('repo_switcher','background','');
 
						YAHOO.util.Dom.removeClass('repo_switcher','selected');
 
						YAHOO.util.Dom.get('repo_switcher').removeAttribute('style');
 
					}
 
					else{
 
						YAHOO.util.Dom.setStyle('switch_repos','display','');
 
						YAHOO.util.Dom.setStyle('repo_switcher','background','#FFFFFF');
 
						YAHOO.util.Dom.setStyle('repo_switcher','color','#556CB5');
 
						YAHOO.util.Dom.addClass('repo_switcher','selected');
 
					}
 
					});
 
				YAHOO.util.Event.addListener('repos_list','change',function(e){
 
		            var wa = YAHOO.util.Dom.get('repos_list').value;
 
		        	
 
		            var url = "${h.url('summary_home',repo_name='__REPLACE__')}".replace('__REPLACE__',wa);
 
			        window.location = url;
 
				})
 
	           });
 
	       	</script>       	
 
	        <ul class="page-nav">
 
				<li>
 
					<a id="repo_switcher" title="${_('Switch repository')}" href="#">&darr;</a>
 
					<div id="switch_repos" style="display:none;position: absolute;width: 150px;height: 25px">
 
						<select id="repos_list" size="=10">
 
						%for repo in c.cached_repo_list.values():
 
							<option value="${repo.name}">${repo.name}</option>
 
						%endfor
0 comments (0 inline, 0 general)