1. Luke Plant
  2. lukeplant_python

Commits

Luke Plant  committed 6261726

Added visual highlighting of current page.

  • Participants
  • Parent commits 0267fa2
  • Branches default

Comments (0)

Files changed (3)

File lukeplant_me_uk/bibleverses/templates/base.html

View file
  • Ignore whitespace
   <div id="header">
     <div id="headertext">Bible Memorisation Schemes</div>
     <div id="navbarcont">
+      {% spaceless %}
       <ul id="navbar">
-	<li><a href="{{ mediaprefix }}/index.html">Home</a></li><li><a href="{{ mediaprefix }}/schemes.html">Schemes</a></li><li><a href="{{ mediaprefix }}/topics.html">Topics</a></li><li><a href="{{ mediaprefix }}/sources.html">Sources</a></li>
+	{% for page in menupages %}
+	<li {% ifequal page.name pagename %}class="here"{% endifequal %}><a href="{{ mediaprefix }}/{{ page.name }}">{{ page.title }}</a></li>
+	{% endfor %}
       </ul>
+      {% endspaceless %}
       <br class="floatclear"/>
     </div>
   </div>

File lukeplant_me_uk/bibleverses/update.py

View file
  • Ignore whitespace
 # For the moment, it seems easiest to have one function that generates
 # both wiki and html.
 
+class HtmlPage(object):
+    def __init__(self, name, title):
+        self.name, self.title = name, title
+    
+menupages = [
+    HtmlPage('index.html', 'Home'),
+    HtmlPage('schemes.html', 'Schemes'),
+    HtmlPage('topics.html', 'Topics'),
+    HtmlPage('sources.html', 'Sources'),
+]
+
 def write_page(name, data):
     for format, text in data.items():
         writer = datawriters.get(format)
         write_page(page, {'html': loader.render_to_string(template, 
                                                           {'mediaprefix': '.',
                                                            'title': title,
+                                                           'menupages': menupages,
+                                                           'pagename': template,
                                                            }
                                                           )
                           })
 
     html = loader.render_to_string("topics.html",
                                    {'title':  u"Topics",
+                                    'menupages': menupages,
+                                    'pagename': 'topics.html',
                                     'description': u"Index of topics used for Bible memorisation schemes",
                                     'topicnodes': topictree.nodes,
                                     'uncategorised': extras,
 
     html = loader.render_to_string("scheme.html",
                                    {'title': u"Memorisation Scheme - %s" % scheme.name,
+                                    'pagename': FileWriter.make_html_filename(scheme_page_name(SCHEMESPAGENAMEPREFIX, scheme)),
+                                    'menupages': menupages,
                                     'description': u"Bible memorisation scheme",
                                     'scheme': scheme,
                                     'mediaprefix': '..',
 
     html = loader.render_to_string("schemes.html", 
                             {'title': u"Schemes",
+                             'menupages': menupages,
+                             'pagename': 'schemes.html',
                              'description': u"Index of Bible memorisation schemes",
                              'schemes': schemes,
                              'mediaprefix': '.',

File lukeplant_me_uk/bibleverses/web/css/style.css

View file
  • Ignore whitespace
     font-size: 1.15em;
 }
 
+
+#navbarcont ul li.here a {
+    background-color: #258;
+}
+
 #navbarcont ul li a:hover
 {
     background-color: #369;