Commits

Olemis Lang committed 9d138af

TracRpc: Look & feel more similar to wiki pages ... bah!

Comments (0)

Files changed (1)

t5437/t5437-protocol_api-r7194.diff

 rename to trunk/tracrpc/templates/rpc_api.html
 --- a/trunk/tracrpc/templates/xmlrpclist.html
 +++ b/trunk/tracrpc/templates/rpc_api.html
-@@ -7,23 +7,16 @@
+@@ -7,103 +7,49 @@
    <xi:include href="layout.html" />
    <xi:include href="macros.html" />
    <head>
    <body>
 -
      <div id="content" class="wiki">
-       <h1>Remote Procedure Call (RPC) Interface</h1>
+-      <h1>Remote Procedure Call (RPC) Interface</h1>
 -      <dl>
 -        <dt>API Status:</dt>
 -          <dd>XML-RPC is <strong>available</strong></dd>
 -            ${xmlrpc.json and 'available' or 'not available'}</strong></dd>
 -      </dl>
 -
-       <h2>RPC exported functions</h2>
- 
-       <div id="searchable">
+-      <h2>RPC exported functions</h2>
+-
+-      <div id="searchable">
 -        <dl py:for="key in sorted(xmlrpc.functions)" py:with="namespace = xmlrpc.functions[key]">
-+        <dl py:for="key in sorted(rpc.functions)" py:with="namespace = rpc.functions[key]">
-           <dt>
-             <h3 id="${'xmlrpc.' + to_unicode(namespace.namespace)}">
-               ${namespace.namespace} - ${namespace.description}
-@@ -50,60 +43,11 @@
-         </dl>
+-          <dt>
+-            <h3 id="${'xmlrpc.' + to_unicode(namespace.namespace)}">
+-              ${namespace.namespace} - ${namespace.description}
+-            </h3>
+-          </dt>
+-          <dd>
+-            <table class="listing tickets">
+-              <thead>
+-                <tr>
+-                  <th style="width:40%">Function</th>
+-                  <th style="width:45%">Description</th>
+-                  <th style="width:15%">Permission required</th>
+-                </tr>
+-              </thead>
+-              <tbody py:for="idx, function in enumerate(namespace.methods)">
+-                <tr class="${'color3-' + (idx % 2 == 0 and 'even' or 'odd')}">
+-                  <td style="padding-left:4em;text-indent:-4em">${function[0]}</td>
+-                  <td>${function[1]}</td>
+-                  <td>${function[2] or "By resource"}</td>
+-                </tr>
+-              </tbody>
+-            </table>
+-          </dd>
+-        </dl>
++      <div class="wikipage searchable">
++        <h1>Remote Procedure Call (RPC) Interface</h1>
++        <h2>RPC exported functions</h2>
++  
++        <div id="searchable">
++          <dl py:for="key in sorted(rpc.functions)" py:with="namespace = rpc.functions[key]">
++            <dt>
++              <h3 id="${'xmlrpc.' + to_unicode(namespace.namespace)}">
++                ${namespace.namespace} - ${namespace.description}
++              </h3>
++            </dt>
++            <dd>
++              <table class="listing tickets">
++                <thead>
++                  <tr>
++                    <th style="width:40%">Function</th>
++                    <th style="width:45%">Description</th>
++                    <th style="width:15%">Permission required</th>
++                  </tr>
++                </thead>
++                <tbody py:for="idx, function in enumerate(namespace.methods)">
++                  <tr class="${'color3-' + (idx % 2 == 0 and 'even' or 'odd')}">
++                    <td style="padding-left:4em;text-indent:-4em">${function[0]}</td>
++                    <td>${function[1]}</td>
++                    <td>${function[2] or "By resource"}</td>
++                  </tr>
++                </tbody>
++              </table>
++            </dd>
++          </dl>
++        </div>
++        
++        <div class="help">
++          <strong>Note:</strong>
++          See <a href="${req.abs_href.rpc()}">RPC protocol reference</a> 
++          for help on available RPC protocols.
++        </div>
        </div>
-       
+-      
 -      <h2>Calling Methods</h2>
 -      <p>XML and JSON libraries for remote procedure calls and parsing exists
 -        for all major languages and platforms - use a tested, standard library
 -        for consistent results.</p>
 -      <p>The following are examples for illustration only, and shows raw
 -        access to RPC using <tt>curl</tt> (with Content-Type and Body for POST request):</p>
-       <div class="help">
+-      <div class="help">
 -        <h4>XML-RPC example</h4>
 -        <pre>
 -user: ~ &gt; cat body.xml
 -        <li>Use <tt>${req.abs_href.login('xmlrpc')}</tt> with basic
 -            authentication for user context.</li>
 -      </ul>
-+        <strong>Note:</strong>
-+        See <a href="${req.abs_href.rpc()}">RPC protocol reference</a> 
-+        for help on available RPC protocols.
-       </div>
+-      </div>
 -      <div>
 -        <h4>JSON-RPC example</h4>
 -        <pre>
 new file mode 100644
 --- /dev/null
 +++ b/trunk/tracrpc/templates/rpc_main.html
-@@ -0,0 +1,72 @@
+@@ -0,0 +1,73 @@
 +<!DOCTYPE html
 +    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 +    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 +  
 +  <body>
 +    <div id="content" class="wiki">
-+      <h1>Remote Procedure Call (RPC) Interface</h1>
-+      <h2>Protocol reference:</h2>
-+      <p>Below you will find a detailed description of all the RPC 
-+        protocols installed in this environment. This includes 
-+        supported content types as well as target URLs for 
-+        anonymous and authenticated access. You should use this 
-+        information in order to interact with this environment from 
-+        remote. In the next section you 
-+        will find simple examples and protocol specific information.
-+      </p>
-+      <dl>
-+        <py:for each="protocol in rpc.protocols" >
-+          <dt>${protocol[0]}</dt>
-+          <dd >
-+            <p>To access the ${protocol[0]} protocol</p>
-+            <ul>
-+              <li py:for="h, ct in protocol[2]">
-+                Use <tt>{'Content-Type': '$ct'}</tt> with
-+                request to:
-+                <ul>
-+                  <li><a href="${req.abs_href(h)}">${req.abs_href(h)}</a> 
-+                  for anonymous access</li>
-+                  <li><a href="${req.abs_href.login(h)}">${req.abs_href.login(h)}</a>
-+                  for authenticated access</li>
-+                </ul>
-+              </li>
-+            </ul>
-+          </dd>
-+        </py:for>
-+      </dl>
-+
-+      <h2>Calling Methods</h2>
-+      <p>Libraries for remote procedure calls and parsing exists
-+        for most major languages and platforms - use a tested, standard library
-+        for consistent results.</p>
-+      <p>The following are examples for illustration only, and shows raw
-+        access to RPC using <tt>curl</tt> (with <tt>Content-Type</tt> 
-+        and Body for POST request):</p>
-+      <div class="help">
-+        <py:for each="protocol in rpc.protocols">
-+          <h3>${protocol[0]}</h3>
-+          <div>
-+            ${wiki_to_html(context, expand_docs(protocol[1], locals()['__data__']))}
-+          </div>
-+        </py:for>
-+        <p>
-+          <strong>Note:</strong>
-+          See <a href="${req.abs_href.rpc('api')}">RPC API Reference</a> 
-+          for help on signatures and return values of available methods.
++      <div class="wikipage searchable">
++        <h1>Remote Procedure Call (RPC) Interface</h1>
++        <h2>Protocol reference:</h2>
++        <p>Below you will find a detailed description of all the RPC 
++          protocols installed in this environment. This includes 
++          supported content types as well as target URLs for 
++          anonymous and authenticated access. You should use this 
++          information in order to interact with this environment from 
++          remote. In the next section you 
++          will find simple examples and protocol specific information.
 +        </p>
++        <dl>
++          <py:for each="protocol in rpc.protocols" >
++            <dt>${protocol[0]}</dt>
++            <dd >
++              <p>To access the ${protocol[0]} protocol</p>
++              <ul>
++                <li py:for="h, ct in protocol[2]">
++                  Use <tt>{'Content-Type': '$ct'}</tt> with
++                  request to:
++                  <ul>
++                    <li><a href="${req.abs_href(h)}">${req.abs_href(h)}</a> 
++                    for anonymous access</li>
++                    <li><a href="${req.abs_href.login(h)}">${req.abs_href.login(h)}</a>
++                    for authenticated access</li>
++                  </ul>
++                </li>
++              </ul>
++            </dd>
++          </py:for>
++        </dl>
++  
++        <h2>Calling Methods</h2>
++        <p>Libraries for remote procedure calls and parsing exists
++          for most major languages and platforms - use a tested, standard library
++          for consistent results.</p>
++        <p>The following are examples for illustration only, and shows raw
++          access to RPC using <tt>curl</tt> (with <tt>Content-Type</tt> 
++          and Body for POST request):</p>
++        <div class="help">
++          <py:for each="protocol in rpc.protocols">
++            <h3>${protocol[0]}</h3>
++            <div>
++              ${wiki_to_html(context, expand_docs(protocol[1], locals()['__data__']))}
++            </div>
++          </py:for>
++          <p>
++            <strong>Note:</strong>
++            See <a href="${req.abs_href.rpc('api')}">RPC API Reference</a> 
++            for help on signatures and return values of available methods.
++          </p>
++        </div>
 +      </div>
-+      
 +      <script type="text/javascript">
 +        addHeadingLinks(document.getElementById("content"));
 +      </script>