Blame Identity/Webenv/Trac/ArtworkToc.py

ef5584
# -*- coding: utf-8 -*-
ef5584
"""
ef5584
This macro shows the CentOS Artwork Table of Content.
ef5584
"""
ef5584
ef5584
TOC = [('Identity',	   		                '

1. Identity:

'),
ef5584
       ('IdentityConcept',                  '1.1. Concept'),
ef5584
       ('IdentityLogo',			            '1.2. Logo'),
ef5584
       ('IdentityTypography',	            '1.3. Typography'),
ef5584
       ('IdentityColors',                   '1.4. Colors'),
ef5584
       ('IdentityNewIdeas',		            '1.5. New Ideas'),
ef5584
       ('Anaconda',	   		                '

2. Anaconda:

'),
ef5584
       ('AnacondaPrompt',   	    	    '2.1. Prompt'),
ef5584
       ('AnacondaHeader',	                '2.2. Header'),
ef5584
       ('AnacondaSplash',		            '2.3. Spalsh'),
ef5584
       ('AnacondaProgress', 		        '2.4. Progress'),
ef5584
       ('AnacondaProgressSlides', 		    '2.4.1. Slides'),
ef5584
       ('AnacondaFirstboot', 		        '2.5. First Boot'),
ef5584
       ('BootUp',			                '

3. Boot Up:

'),
ef5584
       ('BootUpGRUB',			            '3.1. GRUB'),
ef5584
       ('BootUpRHGB',			            '3.2. RHGB'),
ef5584
       ('BootUpGDM',			            '3.3. GDM'),
ef5584
       ('BootUpGnomeSplash',		        '3.3. GnomeSplash'),
ef5584
       ('HighVisibility',		            '

4. High Visibility:

'),
ef5584
       ('HighVisibilityWallpapers',	        '4.1. Wallpapers'),
ef5584
       ('Promo',			                '

5. Promotion:

'),
ef5584
       ('PromoMedia',			            '5.1.  Media'),
ef5584
       ('PromoPosters',			            '5.2. Posters'),
ef5584
       ('PromoTShirts',			            '5.3. T-Shirts'),
ef5584
       ('PromoOOoTemplates',		        '5.5. OOo Templates'),
ef5584
       ('Repo',				                '

6. Image Repositories:

'),
ef5584
       ('RepoWidgets',			            '6.1. Widgets'),
ef5584
       ('Theming',			                '

7. Theming:

'),
ef5584
       ('ThemingApache',		            '7.1. Apache Web Server'),
ef5584
       ('ThemingSquid',		                '7.2. Squid Cache Proxy'),
ef5584
       ('ThemingBrowserDefaultPage',        '7.3. Browser Default Page'),
ef5584
       ('ThemingMantis',		            '7.4. Mantis'),
ef5584
       ('ThemingMoin',		                '7.5. Moin'),
ef5584
       ('ThemingTrac',		                '7.5. Trac'),
ef5584
       ('ThemingPunbb',		                '7.5. Punbb'),
ef5584
       ('ThemingPuntal',		            '7.5. Puntal'),
ef5584
       ]
ef5584
ef5584
def execute(hdf, args, env):
ef5584
    html = '
' \
ef5584
           '

Table of Contents

' \
ef5584
           '
    '
ef5584
    curpage = '%s' % hdf.getValue('wiki.page_name', '')
ef5584
    lang, page = '/' in curpage and curpage.split('/', 1) or ('', curpage)
ef5584
    for ref, title in TOC:
ef5584
        if page == ref:
ef5584
            cls =  ' class="active"'
ef5584
        else:
ef5584
            cls = ''
ef5584
        html += '<li%s>%s' \
ef5584
                % (cls, env.href.wiki(lang+ref), title)
ef5584
    return html + ''