Changeset - 25e01cb65282
[Not reviewed]
default
0 3 0
Marcin Kuzminski - 16 years ago 2010-04-21 00:12:51
marcin@python-works.com
Added menu generation as function
3 files changed with 47 insertions and 19 deletions:
0 comments (0 inline, 0 general)
pylons_app/templates/base/base.html
Show inline comments
 
@@ -16,7 +16,7 @@
 
            ${next.breadcrumbs()}
 
        </h1>
 
        <ul class="page-nav">
 
            ${next.page_nav()}
 
            ${self.page_nav()}
 
        </ul>
 
    </div>
 
    ${next.main()}
 
@@ -40,6 +40,50 @@
 
</body>
 
</html>
 

	
 
<%def name="page_nav()">
 

	
 
	${self.menu()}
 

	
 
</%def>
 

	
 

	
 
<%def name="menu(current)">
 
        <ul class="page-nav">
 

	
 
            <li 
 
            %if current=='summary':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='summary',_('summary'),h.url('summary_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='changelog':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='changelog',_('changelog'),h.url('changelog_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='branches':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='branches',_('branches'),h.url('branches_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='tags':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='tags',_('tags'),h.url('tags_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='graph':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='graph',_('graph'),h.url('graph_home',repo_name=c.repo_name))}</li>
 
            <li 
 
            %if current=='files':
 
            	class='current' 
 
            %endif
 
            >${h.link_to_unless(current=='files',_('files'),h.url('files_home',repo_name=c.repo_name))}</li>
 
        </ul>
 
</%def>
 

	
 

	
 

	
 
<%def name="js()">
 
<script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
pylons_app/templates/shortlog.html
Show inline comments
 
@@ -18,15 +18,7 @@
 
            </dl>
 
        </form>
 

	
 
        <ul class="page-nav">
 
            <li>${h.link(_('summary'),h.url('summary_home',repo_name=c.repo_name))}</li>
 
            <li class="current">${_('shortlog')}</li>
 
            <li><a href="log">changelog</a></li>
 
            <li><a href="graph/{node|short}">graph</a></li>
 
            <li><a href="tags">tags</a></li>
 
            <li><a href="branches">branches</a></li>
 
            <li><a href="file/{node|short}">files</a></li>
 
        </ul>      
 
		${self.menu('changelog')}     
 
</%def>
 
<%def name="main()">
 

	
pylons_app/templates/summary.html
Show inline comments
 
@@ -20,15 +20,7 @@ from pylons_app.lib import filters
 
            </dl>
 
        </form>
 

	
 
        <ul class="page-nav">
 
            <li class="current">${_('summary')}</li>
 
            <li>${h.link(_('shortlog'),h.url('shortlog_home',repo_name=c.repo_name))}</li>
 
            <li><a href="log">changelog</a></li>
 
            <li><a href="graph/{node|short}">graph</a></li>
 
            <li><a href="tags">tags</a></li>
 
            <li><a href="branches">branches</a></li>
 
            <li><a href="file/{node|short}">files</a></li>
 
        </ul>      
 
		${self.menu('summary')}    
 
</%def>
 
<%def name="main()">
 

	
0 comments (0 inline, 0 general)