changeset 2474:c1526ea8e0b5

Adds active states for links in top navbar, also adds a hyperlink macro
author sharky93 <rishabhr123@gmail.com>
date Sat, 14 Sep 2013 00:08:57 +0530
parents 1b85840f6982
children 0a5220f576f2
files MoinMoin/themes/basic/static/css/basic.css MoinMoin/themes/basic/static/custom-less/basic.less MoinMoin/themes/basic/templates/layout.html
diffstat 3 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/themes/basic/static/css/basic.css	Fri Sep 13 20:02:54 2013 +0530
+++ b/MoinMoin/themes/basic/static/css/basic.css	Sat Sep 14 00:08:57 2013 +0530
@@ -4520,6 +4520,9 @@
 .moin-navbar-inverse .navbar-nav > li > a {
   color: #c8ddf1;
 }
+.moin-navbar-inverse .navbar-nav > li > a.active {
+  color: #ffffff;
+}
 .moin-navbar-inverse .navbar-text {
   color: #c8ddf1;
 }
--- a/MoinMoin/themes/basic/static/custom-less/basic.less	Fri Sep 13 20:02:54 2013 +0530
+++ b/MoinMoin/themes/basic/static/custom-less/basic.less	Sat Sep 14 00:08:57 2013 +0530
@@ -104,6 +104,9 @@
     > li > a {
       color: @moin-navbar-inverse-textcolor;
     }
+    > li > a.active {
+      color: @navbar-inverse-link-hover-color;
+    }
   }
   .navbar-text {
     color: @moin-navbar-inverse-textcolor;
--- a/MoinMoin/themes/basic/templates/layout.html	Fri Sep 13 20:02:54 2013 +0530
+++ b/MoinMoin/themes/basic/templates/layout.html	Sat Sep 14 00:08:57 2013 +0530
@@ -25,6 +25,18 @@
     {% endfor %}
 {% endmacro %}
 
+{# Helper macro to generate links #}
+{% macro hyperlink(href, title, exists, label, iconcls) -%}
+    <a href="{{ href }}" 
+        {% if not exists %}class="moin-nonexistent"{% endif %}
+        {% if current_url == href %} class="active" {% endif %}
+        rel="nofollow" 
+        {% if title %} title="{{ title }}" {% endif %}>
+        {% if iconcls %} <i class="{{ iconcls }}"> </i> {% endif %}
+        {{ label }}
+    </a>
+{% endmacro %}
+
 {% block head %}
     {{ super() }}
     <link media="all" rel="stylesheet" href="{{ theme_static('css/basic.css') }}" />