Changeset 10238 for main/ngren.theme


Ignore:
Timestamp:
28 May 2013, 10:26:53 (11 years ago)
Author:
uli
Message:

Display user options as a dropdown menu.

Location:
main/ngren.theme/branches/ulif-user-dropdown/ngren/theme/ngren_theme
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/ngren.theme/branches/ulif-user-dropdown/ngren/theme/ngren_theme/full.html

    r10230 r10238  
    6060                                                <h1><a href="home.html">Nigerian Research and<br/>Education Network</a></h1>
    6161                                        </div>
    62                                         <div id="user-options">
    63                                                 <ul>
    64                                                         <li><a href="example.html">Login</a></li>
    65                                                         <li><span class="separator">|</span></li>
    66                                                         <li><a href="example.html">Register</a></li>
    67                                                 </ul>
    68                                         </div>
     62                                        <div class="btn-group pull-right btn-small"
     63                                             id="user-options">
     64                                          <a class="btn btn-small btn-primary"
     65                                             href="#">
     66                                            <i class="icon-user icon-white"></i>
     67                                            <span id="user-options-name">
     68                                              Username
     69                                            </span>
     70                                          </a>
     71                                          <a class="btn btn-small btn-primary
     72                                                    dropdown-toggle"
     73                                             data-toggle="dropdown"
     74                                             href="#">
     75                                            <span class="caret"></span>
     76                                          </a>
     77                                          <ul class="dropdown-menu btn-small">
     78                                            <li><a href="#">Dashboard</a></li>
     79                                            <li><a href="#">Logout</a></li>
     80                                          </ul>
     81                                        </div><!-- user-options -->
    6982                                        <form class="navbar-form pull-right">
    7083                                                <input type="text" />
  • main/ngren.theme/branches/ulif-user-dropdown/ngren/theme/ngren_theme/rules.xml

    r10230 r10238  
    2828   
    2929   
    30         <!-- Top / Header -->
    31         <copy attributes="href" css:content='#portal-logo' css:theme="#logo-container a" />
     30    <!-- Top / Header -->
     31    <copy attributes="href" css:content='#portal-logo' css:theme="#logo-container a" />
    3232
    33         <copy css:theme="#user-options ul">
    34                 <xsl:for-each css:select="#portal-personaltools li">
    35                 <xsl:if test="not(position()=last())">
    36                                                 <xsl:copy-of select="." />
    37                 </xsl:if>
    38         </xsl:for-each>
    39         </copy>
     33    <!-- User options (upper right) -->
     34    <!--      user name in options menu   -->
     35    <replace css:theme-children="#user-options-name"
     36             css:content-children="#portal-personaltools li:nth-child(1) a" />
     37
     38    <!--      href of username link -->
     39    <copy attributes="href"
     40          css:content="#portal-personaltools li:nth-child(1) a"
     41          css:theme="#user-options a:nth-child(1)" />
     42    <!--      2nd to last link of user options (separators filtered out) -->
     43    <copy css:theme="#user-options ul">
     44      <xsl:for-each css:select="#portal-personaltools li">
     45        <xsl:if test="not(position() mod 2 = 0)">
     46          <xsl:if test="not(position() = 1)">
     47            <xsl:copy-of select="." />
     48          </xsl:if>
     49        </xsl:if>
     50      </xsl:for-each>
     51    </copy>
    4052       
    4153        <replace css:theme=".navbar-form" css:content="#portal-searchbox form"/>
Note: See TracChangeset for help on using the changeset viewer.