Commits

Olemis Lang committed 9c13d1a

TracRpc: Updating ctxt nav links

  • Participants
  • Parent commits 95fee12

Comments (0)

Files changed (1)

t5437/t5437-protocol_api-r7194.diff

 diff --git a/trunk/tracrpc/web_ui.py b/trunk/tracrpc/web_ui.py
 --- a/trunk/tracrpc/web_ui.py
 +++ b/trunk/tracrpc/web_ui.py
-@@ -6,305 +6,145 @@
+@@ -6,305 +6,140 @@
  (c) 2009      ::: www.CodeResort.com - BV Network AS (simon-code@bvnetwork.no)
  """
  
 +        add_stylesheet(req, 'tracrpc/css/rpc.css')
 +        add_script(req, 'tracrpc/js/rpc.js')
 +        self._rpc_ctxtnav(req)
-+        try:
-+            # Paths of the form `/rpc/<pageid>`
-+            template = req.path_info.split('/')[2]
-+        except:
-+            # Paths of the form `/<xxx>rpc` (e.g. `/rpc`, `/xmlrpc`)
-+            template = 'main'
-+        return ('rpc_%s.html' % template, 
++        return ('rpc_main.html', 
 +                    {'rpc': {'functions': namespaces,
 +                      'protocols': [p.rpc_info() + (list(p.rpc_match()),) \
 +                                      for p in self.protocols],
 +
 +    def _rpc_ctxtnav(self, req):
 +        """Add ctxtnav entries for docs (RPC methods + protocols)."""
-+        add_ctxtnav(req, _('API Reference'), req.href.rpc('api'))
-+        add_ctxtnav(req, _('Protocol Reference'), req.href.rpc())
++        page = req.href.rpc()
++        add_ctxtnav(req, _('API Reference'), page + "#Methods")
++        add_ctxtnav(req, _('Protocol Reference'), page + "#Protocols")
 +
 diff --git a/trunk/tracrpc/wiki.py b/trunk/tracrpc/wiki.py
 --- a/trunk/tracrpc/wiki.py