Commits

Sean Davis committed de48dcb

Fixed class=active in menu items

  • Participants
  • Parent commits 2a39321

Comments (0)

Files changed (2)

templates/base.html

           <div class="nav-collapse">
 	    <a class="brand" href="#">Bioinformatics@CCR</a>
             <ul class="nav">
-              <li><a href="/">Home</a></li>
+	      {%- for endpoint, caption in [
+	      ('hello', 'Home'),
+	      ('software_list', 'Software'),
+	      ] %}
+	      <li{% if endpoint == request.endpoint %} class="active"{% endif
+		    %}><a href={{ url_for(endpoint) }}>{{ caption }}</a>
+	      {%- endfor %}
               <li><a href="/training">Training & Education</a></li>
-              <li><a href="{{ url_for('software_list') }}">Software</a></li>
             </ul>
             <ul class="nav pull-right">
               <li class="divider-vertical"></li>

templates/index.html

           <div class="nav-collapse">
 	    <a class="brand" href="#">Bioinformatics@CCR</a>
             <ul class="nav">
-              <li><a href="{{ url_for('hello') }}">Home</a></li>
+	      {%- for endpoint, caption in [
+	      ('hello', 'Home'),
+	      ('software_list', 'Software'),
+	      ] %}
+	      <li{% if endpoint == request.endpoint %} class="active"{% endif
+		    %}><a href={{ url_for(endpoint) }}>{{ caption }}</a>
+	      {%- endfor %}
               <li><a href="/training">Training & Education</a></li>
-              <li><a href="{{ url_for('software_list') }}">Software</a></li>
             </ul>
             <ul class="nav pull-right">
               <li class="divider-vertical"></li>