changeset 41:686059a8a32b trunk

Sync Trac port with vendor branch r44 and add missing template files.
author cmlenz
date Mon, 03 Jul 2006 21:01:42 +0000
parents f8a5a6ee2097
children 28ddb79414b2
files examples/trac/templates/layout.html examples/trac/templates/settings.html
diffstat 2 files changed, 157 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/examples/trac/templates/layout.html
@@ -0,0 +1,81 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:py="http://purl.org/kid/ns#"
+      xmlns:xi="http://www.w3.org/2001/XInclude"
+      py:strip="">
+  <xi:include href="site.html"><xi:fallback/></xi:include>
+
+  <head py:match="head">
+    <title>${select('title/text()')} – Trac</title>
+    <div py:for="rel, links in chrome.links.items()" py:strip="">
+      <link rel="${rel}" py:for="link in links" href="${link.href}"
+          type="${link.type}" class="${link['class']}" title="${link.title}"/>
+    </div>
+    <script py:for="script in chrome.scripts"
+            type="${script.type}" src="${script.href}"/>
+  </head>
+
+  <body py:match="body">
+    <div id="banner">
+      <div id="header">
+        <a id="logo" py:if="chrome.logo.src" href="${chrome.logo.link}"><img
+          src="${chrome.logo.src}" /></a>
+      </div>
+      <form py:if="perm.has_permission('SEARCH_VIEW')" id="search"
+            action="${href.search()}" method="get">
+       <div>
+        <label for="proj-search">Search:</label>
+        <input type="text" id="proj-search" name="q" size="10" accesskey="f" value="" />
+        <input type="submit" value="Search" />
+        <input type="hidden" name="wiki" value="on" />
+        <input type="hidden" name="changeset" value="on" />
+        <input type="hidden" name="ticket" value="on" />
+       </div>
+      </form>
+      <div id="metanav" class="nav">
+        <ul py:if="chrome.nav.metanav">
+          <li py:for="idx, item in enumerate(chrome.nav.metanav)"
+              py:content="HTML(item.label)"
+            class="${' '.join(filter(None, [
+                      (idx == 0) and 'first',
+                      (idx == len(chrome.nav.metanav) - 1) and 'last'
+                     ])) or None}"/>
+        </ul>
+      </div>
+    </div>
+    <div id="mainnav" class="nav">
+      <ul py:if="chrome.nav.mainnav">
+        <li py:for="idx, item in enumerate(chrome.nav.mainnav)"
+            py:content="HTML(item.label)"
+            class="${' '.join(filter(None, [
+                      (idx == 0) and 'first',
+                      (idx == len(chrome.nav.mainnav) - 1) and 'last'
+                     ])) or None}"/>
+      </ul>
+    </div>
+
+    <div id="main">
+      ${select('*')}
+
+      <div id="altlinks" py:if="chrome.links.alternate">
+        <h3>Download in other formats:</h3>
+        <ul><li py:for="link in chrome.links.alternate">
+            <a href="${link.href}" class="${link['class']}"
+               py:content="${link.title}" />
+        </li></ul>
+      </div>
+    </div>
+
+    <div id="footer">
+      <hr/>
+      <a id="tracpowered" href="http://trac.edgewall.com/"><img src="${href.chrome('common/trac_logo_mini.png')}" height="30" width="107" alt="Trac Powered"/></a>
+      <p class="left">
+        Powered by <a href="${href.about()}"><strong>Trac ${chrome.version}</strong></a><br />
+        By <a href="http://www.edgewall.com/">Edgewall Software</a>.
+      </p>
+      <p class="right">
+        ${HTML(config.project.get('footer'))}
+      </p>
+    </div>
+  </body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/examples/trac/templates/settings.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:py="http://purl.org/kid/ns#"
+      xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:include href="layout.html"><xi:fallback/></xi:include>
+  <head>
+    <title>Settings</title>
+  </head>
+
+  <body>
+    <div id="ctxtnav" class="nav"></div>
+
+    <div id="content" class="settings">
+
+     <h1>Settings and Session Management</h1>
+
+     <h2>User Settings</h2>
+     <p>
+     This page lets you customize and personalize your Trac settings. Session
+     settings are stored on the server and identified using  a 'Session Key'
+     stored in a browser cookie. The cookie lets Trac restore your settings.
+     </p>
+     <form method="post" action="">
+     <div>
+      <h3>Personal Information</h3>
+      <div>
+       <input type="hidden" name="action" value="save" />
+       <label for="name">Name:</label>
+       <input type="text" id="name" name="name" class="textwidget" size="30"
+              value="${settings.session.name}" />
+      </div>
+      <div>
+       <label for="email">Email:</label>
+       <input type="text" id="email" name="email" class="textwidget" size="30"
+              value="${settings.session.email}" />
+      </div>
+      <div py:if="settings.session_id" py:strip="">
+       <h3>Session</h3>
+       <div>
+        <label for="newsid">Session Key:</label>
+        <input type="text" id="newsid" name="newsid" class="textwidget" size="30"
+               value="${settings.session_id}" />
+        <p>The session key is used to identify stored  custom settings and session
+        data on the server. Automatically generated by default, you may change it
+        to something easier to remember at any time if you wish to use your settings
+        in a different web browser.</p>
+       </div>
+      </div>
+      <div>
+       <br />
+       <input type="submit" value="Submit changes" />
+      </div >
+     </div>
+    </form>
+    <div py:if="settings.session_id" py:strip="">
+     <hr />
+     <h2>Load Session</h2>
+     <p>You may load a previously created session by entering the corresponding
+     session key below and clicking 'Recover'. This lets you share settings between
+     multiple computers and/or web browsers.</p>
+     <form method="post" action="">
+      <div>
+       <input type="hidden" name="action" value="load" />
+       <label for="loadsid">Existing Session Key:</label>
+       <input type="text" id="loadsid" name="loadsid" class="textwidget" size="30"
+              value="" />
+       <input type="submit" value="Recover" />
+      </div>
+     </form>
+    </div>
+
+    </div>
+  </body>
+</html>
\ No newline at end of file
Copyright (C) 2012-2017 Edgewall Software