Commits

Anonymous committed aeded09

TracMacOS: Context & metanav in main panel. Menus missing.

Comments (0)

Files changed (16)

   keywords = "trac plugin theme",
   url = "http://trac-hacks.org/wiki/TracMacTheme",
   packages = ['tracmacos'],
-  package_data = {'tracmacos': ['htdocs/*.*']},
+  package_data = {'tracmacos': ['htdocs/*.*', 'templates/*.*']},
   classifiers = [
         'Development Status :: 4 - Beta',
         'Environment :: MacOS X',

tracmacos/htdocs/about_trac_16_x_16.png

Added
New image

tracmacos/htdocs/btnbg_32.png

Added
New image

tracmacos/htdocs/btnbg_64.png

Added
New image

tracmacos/htdocs/help_trac_16_x_16.png

Added
New image

tracmacos/htdocs/login_trac_16_x_16.png

Added
New image

tracmacos/htdocs/mac.css

+/* 
+# Copyright (c) 2010 Olemis Lang. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Trac custom stylesheet for Example theme 
+*/
+
+#mainnav {
+  background: #FFFFCC none repeat scroll 0pt 0pt;
+}
+
+#tabs {
+  background: #E0ECFF none repeat scroll 0% 0%;
+}
+
+.nav ul {
+  display: inline-block;
+}
+
+.nav .active :link, .nav .active :visited, 
+.nav .active :hover {
+  font-size: 110%;
+  font-weight: bold;
+}
+
+.nav :link, .nav :visited, .nav :hover {
+  color: #000000;
+  border: none;
+}
+
+:link:hover, :visited:hover, .nav li:hover {
+  background-color: #E0ECFF;
+}
+
+.nav li {
+  border-right: none;
+}
+
+#metanav {
+  border-left: 1px solid #999999;
+  float: right;
+  position: absolute;
+  right: 1em;
+  text-align: right;
+  top: 15px;
+}
+
+/* Round boxes */
+
+.round1 {
+  border-left: 1px solid #fff;
+  border-right: 1px solid #fff;
+}
+
+.round2 {
+  border-left: 2px solid #fff;
+  border-right: 2px solid #fff;
+}
+
+.round4 {
+  border-left: 4px solid #fff;
+  border-right: 4px solid #fff;
+}
+
+.round1,
+.round2,
+.round4 {
+  font-size: 0;
+  margin: 0;
+  padding: 0;
+  height: 1px;
+}
+
+/* Main panel */
+#mainpanel {
+  background-color: #E1E1E1;
+  clear: both;
+  min-height: 18px;
+  width: 100%;
+  
+  border-bottom: 1px solid #999999;
+  font-size: 10px;
+  font-size-adjust: none;
+  font-stretch: normal;
+  font-style: normal;
+  font-variant: normal;
+  font-weight: normal;
+  line-height: normal;
+  margin: 0.66em 0pt 0.33em;
+  padding: 0.2em 0pt;
+}
+
+#mainbutton {
+  background-color: #E1E1E1;
+  position: absolute;
+  top:5px;
+}
+
+#mainbutton:hover {
+/*  background-image: url(btnbg_64.png); */
+  background-image: url(btnbg_32.png);
+  background-repeat: repeat-y;
+}
+
+#mainbutton .box-inner {
+/*  background-image: url(trac_64_x_64.png); */
+  background-image: url(trac_32_x_32.png);
+  background-position: center center;
+  background-repeat: no-repeat;
+  border-right: 1px solid #999999;
+/*  padding: 33px; */
+  padding: 17px;
+}
+
+#navitem {
+  margin-left: 40px;
+}
+
+/* Meta navigation */
+
+.more {
+  padding
+}
+
+#metanav>ul>li {
+  padding: 0pt 0pt 0pt 18px;
+  min-height: 18px;
+  background-repeat: no-repeat;
+  background-position: left;
+}
+
+/* Background images */
+
+#metanav .login {
+  background-image: url(login_trac_16_x_16.png);
+}
+
+#metanav .prefs {
+  background-image: url(prefs_trac_16_x_16.png);
+}
+
+#metanav .help {
+  background-image: url(help_trac_16_x_16.png);
+}
+
+#metanav .about {
+  background-image: url(about_trac_16_x_16.png);
+}
+
+#metanav .logout {
+  background-image: url(logout_trac_16_x_16.png);
+}

tracmacos/htdocs/macos.css

-/* 
-# Copyright (c) 2010 Olemis Lang. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-Trac custom stylesheet for Example theme 
-*/
-
-#mainnav {
-  background:#FFFFCC none repeat scroll 0pt 0pt;
-}
-
-#tabs {
-  background:#E0ECFF none repeat scroll 0% 0%;
-}

tracmacos/htdocs/prefs_trac_16_x_16.png

Added
New image

tracmacos/htdocs/sbbottom.PNG

Added
New image

tracmacos/htdocs/sbbox.PNG

Added
New image

tracmacos/htdocs/sbtop.PNG

Added
New image

tracmacos/htdocs/trac_32_x_32.png

Added
New image

tracmacos/htdocs/trac_64_x_64.png

Added
New image

tracmacos/templates/mac_theme.html

+<!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:xi="http://www.w3.org/2001/XInclude"
+      xmlns:py="http://genshi.edgewall.org/"
+      py:strip="">
+
+  <div py:def="navigation(category)" id="${category}" class="nav">
+    <ul py:if="chrome.nav[category]">
+      <li py:for="idx, item in  enumerate(chrome.nav[category])"
+          class="${classes(first_last(idx, chrome.nav[category]), active=item.active)}">${item.label}</li>
+    </ul>
+  </div>
+
+  <py:match path="body" once="true" buffer="false"><body>
+    <div id="mainpanel" class="nav">
+      <span id="mainbutton">
+        <div class="round4"></div>
+        <div class="round2"></div>
+        <div class="round1"></div>
+        <div class="box-inner"></div>
+        <div class="round1"></div>
+        <div class="round2"></div>
+        <div class="round4"></div>
+      </span>
+      <span id="navitem" class="active">
+        <py:with vars="active = [item.label for item in chrome.nav.get('mainnav', []) if item.active]">
+          <py:choose test="">
+            <py:when test="active">
+              ${active[0]}
+            </py:when>
+            <py:otherwise>
+              <a href="${req.href.about()}"> Trac</a>
+            </py:otherwise>
+          </py:choose>
+        </py:with>
+      </span>
+      <span id="ctxtnav" class="nav">
+        <h2>Context Navigation</h2>
+          <ul py:if="chrome.ctxtnav">
+            <li py:for="i, elm in enumerate(chrome.ctxtnav)" class="${i == 0 and 'first ' or None}${i+1 == len(chrome.ctxtnav) and 'last' or None}">$elm</li>
+          </ul>
+        <hr />
+      </span>
+      <span py:with="metaitems = ('login', 'logout', 'prefs', 'help', 'about')" 
+            id="metanav" class="nav">
+        <ul py:if="chrome.nav['metanav']">
+          <li py:for="idx, item in  enumerate(chrome.nav['metanav'])" py:if="item.name in metaitems"
+              class="${(classes(first_last(idx, chrome.nav['metanav']), active=item.active) or '') + ' ' + item.name}">
+            ${item.label}
+          </li>
+          <li class="more">more</li>
+        </ul>
+      </span>
+    </div>
+    <div id="banner" py:choose="">
+      <form id="search" action="${href.search()}" method="get">
+        <div py:if="'SEARCH_VIEW' in perm">
+          <label for="proj-search">Search:</label>
+          <input type="text" id="proj-search" name="q" size="18" accesskey="f" value="" />
+          <input type="submit" value="Search" />
+        </div>
+      </form>
+      <div id="header" py:choose="" style="width: 65%;">
+        <div py:when="chrome.logo.src" style="vertical-align: middle;"> 
+          <div style="float: left; min-height: 2.5em; height: auto;">
+            <a id="logo" href="${chrome.logo.link or href.wiki('TracIni')+'#header_logo-section'}">
+                <img src="${chrome.logo.src}" alt="${chrome.logo.alt}" 
+                     height="55px" width="153px" />
+            </a> 
+          </div>
+          <div id="pname"> ${project.name} </div>
+          <div id="psum"> ${project.descr} </div>
+        </div>
+        <h1 py:otherwise="">
+          <a href="${chrome.logo.link or href.wiki('TracIni')+'#header_logo-section'}">
+            ${project.name}
+          </a>
+        </h1>
+      </div>
+      <!-- > ${navigation('metanav')} <!-->
+
+    </div>
+    <div id="outer-wrapper">
+      <div id="content-wrapper">
+
+        ${navigation('mainnav')}
+
+        <div id="main-wrapper">
+          <!-- >
+          <div id="ctxtnav" class="nav">
+            <h2>Context Navigation</h2>
+              <ul py:if="chrome.ctxtnav">
+                <li py:for="i, elm in enumerate(chrome.ctxtnav)" class="${i == 0 and 'first ' or None}${i+1 == len(chrome.ctxtnav) and 'last' or None}">$elm</li>
+              </ul>
+            <hr />
+          </div>
+          <!-->
+          <div id="main">
+            <div id="warning" py:if="chrome.warnings" class="system-message">
+              <py:choose test="len(chrome.warnings)">
+                <py:when test="1">
+                  <strong>Warning:</strong> ${chrome.warnings[0]}
+                </py:when>
+                <py:otherwise>
+                  <strong>Warnings:</strong>
+                  <ul><li py:for="w in chrome.warnings">$w</li></ul>
+                </py:otherwise>
+              </py:choose>
+            </div>
+            <div id="notice" py:if="chrome.notices" class="system-message">
+              <py:choose test="len(chrome.notices)">
+                <py:when test="1">
+                  <strong>Notice:</strong> ${chrome.notices[0]}
+                </py:when>
+                <py:otherwise>
+                  <strong>Notices:</strong>
+                  <ul><li py:for="w in chrome.notices">$w</li></ul>
+                </py:otherwise>
+              </py:choose>
+            </div>
+      
+            ${select('*|text()')}
+        
+          
+          </div>  
+      
+        </div>
+      </div>
+      
+    </div>
+    <div id="footer" xml:lang="en"><hr/>
+      <a id="tracpowered" href="http://trac.edgewall.org/"><img
+          src="${chrome.htdocs_location}trac_logo_mini.png" height="30"
+          width="107" alt="Trac Powered"/></a>
+      <p class="left">
+        Powered by <a href="${href.about()}"><strong>Trac ${trac.version}</strong></a>.
+        By <a href="http://www.edgewall.org/">Edgewall Software</a>.
+        <br />
+        PyTpp theme - maintained by <a href="http://simelo-es.blogspot.com/">Olemis Lang</a>.
+      </p>
+      <p class="right">${chrome.footer}</p>
+    </div>
+  </body></py:match>
+</html>

tracmacos/theme.py

 class MacTheme(ThemeBase):
     """A theme for Trac based on Mac OS appearance."""
     
-    htdocs = css = screenshot = True
+    template = htdocs = css = screenshot = True