Commits

jonas  committed 654b0f4

The header-logo is now configurable from the CONFIG table

  • Participants
  • Parent commits a890696
  • Branches trunk

Comments (0)

Files changed (5)

File htdocs/topheader-svntrac.png

Removed
Old image

File scripts/initdb.py

 INSERT INTO permission (user, action) VALUES('anonymous', 'CHANGESET_VIEW');
 
 INSERT INTO config (section, name, value)
+VALUES('svntrac', 'database_version', '1');
+INSERT INTO config (section, name, value)
 VALUES('general', 'htdocs_location', '/svntrac/');
 INSERT INTO config (section, name, value)
 VALUES('general', 'repository_dir', '/var/svn/myrep');
 VALUES('ticket', 'default_milestone', '');
 INSERT INTO config (section, name, value)
 VALUES('ticket', 'default_component', 'general');
+INSERT INTO config (section, name, value)
+VALUES('header_logo', 'link', 'http://svntrac.edgewall.com/');
+INSERT INTO config (section, name, value)
+VALUES('header_logo', 'src', 'svntrac_logo.png');
+INSERT INTO config (section, name, value)
+VALUES('header_logo', 'alt', 'svntrac');
+INSERT INTO config (section, name, value)
+VALUES('header_logo', 'width', '500');
+INSERT INTO config (section, name, value)
+VALUES('header_logo', 'height', '70');
 
 INSERT INTO report (id, author, title, sql) 
 	VALUES (1, NULL, 'Active tickets', 

File svntrac/Module.py

         self.cgi.hdf.setValue('svntrac.href.search', href.search())
         self.cgi.hdf.setValue('svntrac.href.login', href.login())
         self.cgi.hdf.setValue('svntrac.href.logout', href.logout())
+        self.cgi.hdf.setValue('svntrac.version', '0.0.1')
+
+        
+        self.cgi.hdf.setValue('header_logo.link',
+                              self.config['header_logo']['link'])
+        self.cgi.hdf.setValue('header_logo.alt',
+                              self.config['header_logo']['alt'])
+        if self.config['header_logo']['src'][0] == '/':
+            self.cgi.hdf.setValue('header_logo.src',
+                                  self.config['header_logo']['src'])
+        else:
+            self.cgi.hdf.setValue('header_logo.src',
+                                  self.config['general']['htdocs_location']
+                                  + '/' + self.config['header_logo']['src'])
+        self.cgi.hdf.setValue('header_logo.width',
+                              self.config['header_logo']['width'])
+        self.cgi.hdf.setValue('header_logo.height',
+                              self.config['header_logo']['height'])
+        self.cgi.hdf.setValue('svntrac.href.logout', href.logout())
         
         templates_dir = self.config['general']['templates_dir']
         tmpl_filename = os.path.join (templates_dir, self.template_name)

File templates/footer.cs

   <table id="page-footer" width="100%" bgcolor="#eeeeee">
     <tr>
       <td align="left" class="footer">
-	Powered by <a href="http://svntrac.edgewall.com/">SVNTRAC</a>
+	Powered by <a href="http://svntrac.edgewall.com/">SVNTRAC
+	<?cs var:svntrac.version ?></a>
       </td>
       <td align="right" class="footer">
 	Please visit <a href="http://www.edgewall.com/">www.edgewall.com.</a>

File templates/header.cs

 <link rel="stylesheet" type="text/css" href="<?cs var:htdocs_location ?>/svntrac.css">
 </head>
 <body marginheight="0" marginwidth="0" rightmargin="0" leftmargin="0" 
-topmargin="0" bottommargin="0" link="#aa0000" alink="#cc0000" vlink="#880000">
+  topmargin="0" bottommargin="0" 
+  link="#aa0000" alink="#cc0000" vlink="#880000">
+
     <div id="page-header">
-      <table bgcolor="#eeeeee" 
-	background="<?cs var:htdocs_location ?>topbar_gradient.png" 
-	id="page-topbar" border="0" 
-	cellspacing="0" cellpadding="0" width="100%">
-	  <tr>
-	    <td align="right" class="topbar">
-	      <a href="http://www.edgewall.com/press/" class="topbar-link">Press Center</a> |
-	      <a href="http://www.edgewall.com/company/" class="topbar-link">Company</a> |
-	      <a href="http://www.edgewall.com/contact/" class="topbar-link">Contact</a>
-	    </td>
-	  </tr>
-      </table>
       <table id="page-header" border="0" cellspacing="0" 
 	cellpadding="0" width="100%">
 	  <tr>
 	    <td bgcolor="white" width="100%" style="white-space:nowrap">
-	      <a href="http://svntrac.edgewall.com/">
-		<img src="<?cs var:htdocs_location ?>svntrac_logo.png" 
-		  width="500" height="70" alt="svntrac" border="0" 
+	      <a href="<?cs var:header_logo.link ?>">
+		<img src="<?cs var:header_logo.src ?>" 
+		  width="<?cs var:header_logo.width ?>" 
+		  height="<?cs var:header_logo.height ?>" 
+		  alt="<?cs var:header_logo.alt ?>" border="0" 
 		  hspace="0" vspace="0" />
 	      </a>
 	    </td>
 	  </tr>
       </table>
     </div>
-<!-- <?cs var:toolbar ?> -->
-
+    
 <!-- Toolbar -->
 <?cs def:link(text, href, id) ?>
   <?cs if $id == $svntrac.active_module ?>