]> git.notmuchmail.org Git - notmuch/commitdiff
contrib/nmbug/nmbug-status: added table of views
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 24 Oct 2012 06:59:58 +0000 (09:59 +0300)
committerDavid Bremner <bremner@debian.org>
Wed, 24 Oct 2012 21:53:58 +0000 (18:53 -0300)
In latest configuration quite a few long views were added to the
Notmuch Patches page. To ease navigating to the views a 'Views'
section was added to the beginning of page containing hyperlink
to every view.

contrib/nmbug/nmbug-status

index 9a334cccf39064aa4c26c358af7493b4f1a9be8e..c6634096ae9a48bd8e655615b6ca38be8acbdd8e 100755 (executable)
@@ -67,7 +67,7 @@ def print_view(title, query, comment):
     last['thread_id'] = ''
 
     if output_format == 'html':
-        print '<h3>%s</h3>' % title
+        print '<h3><a name="%s" />%s</h3>' % (title, title)
         print comment
         print 'The view is generated from the following query:'
         print '<blockquote>'
@@ -144,6 +144,12 @@ if output_format == 'html':
     print 'Generated: %s<br />' % datetime.datetime.utcnow().date()
     print 'For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>'
 
+    print '<h3>Views</h3>'
+    print '<ul>'
+    for view in config['views']:
+        print '<li><a href="#%(title)s">%(title)s</a></li>' % view
+    print '</ul>'
+
 for view in config['views']:
     print_view(**view)