changeset 2682:3f938458f716 octave-forge

Package listing now features javascript
author hauberg
date Sat, 14 Oct 2006 15:09:33 +0000
parents 5aad991269cf
children 9da47715addc
files www/build-www.py www/macros.m4 www/octave-forge.css
diffstat 3 files changed, 49 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/www/build-www.py	Sat Oct 14 12:45:02 2006 +0000
+++ b/www/build-www.py	Sat Oct 14 15:09:33 2006 +0000
@@ -285,15 +285,30 @@
                 outdir  = "./" + p;
                 try:
                     desc = handle_package(packdir, outdir, p);
-                    archiv = desc['name'].lower() + '-' + desc['version'] + '.tar.gz';
-                    index.write('<div class="package">\n');
-                    index.write('  <b>' + desc['name'] + '</b>\n');
-                    index.write('<p>' + desc['description'][:100]);
-                    if (len(desc['description']) > 100):
-                        index.write('...');
-                    index.write('</p>\n');
-                    index.write('<p class="package_link">&raquo; <a href="' + outdir + '/index.html">details</a> | ');
-                    index.write('<a href="__PACKAGE__/' + archiv + '?download">download</a></p>\n');
+                    n = desc['name'].lower();
+                    archiv = n + '-' + desc['version'] + '.tar.gz';
+                    
+                    index.write('<div class="package" id="' + n + '_detailed" style="display: none;">\n');
+                    index.write('  <table class="package"><tr>\n');
+                    index.write('    <td><b><a href="javascript:fold(\'' + n + '\');" class="package_head_link">' + desc['name'] + '</a></b></td>\n');
+                    index.write('    <td style="text-align: right;">&raquo; <a href="' + outdir + '/index.html" class="package_link">details</a> |\n');
+                    index.write('    <a class="package_link" href="__PACKAGE__/' + archiv + '?download">download</a></p>\n');
+                    
+                    index.write('    </td>\n');
+                    index.write('  </tr></table>\n');
+                    index.write('  <p id="' + n + '_details">\n');
+                    index.write(desc['description']);
+                    index.write('  </p>\n');
+                    index.write('</div>\n');
+
+                    index.write('<div class="package" id="' + n + '">\n');
+                    index.write('  <table class="package"><tr>\n');
+                    index.write('    <td><b><a href="javascript:unfold(\'' + n + '\');" class="package_head_link">' + desc['name'] + '</a></b></td>\n');
+                    index.write('    <td style="text-align: right;">&raquo; <a href="' + outdir + '/index.html" class="package_link">details</a> |\n');
+                    index.write('    <a class="package_link" href="__PACKAGE__/' + archiv + '?download">download</a></p>\n');
+                    
+                    index.write('    </td>\n');
+                    index.write('  </tr></table>\n');
                     index.write('</div>\n');
                 except Exception, e:
                     print("Skipping " + p);
--- a/www/macros.m4	Sat Oct 14 12:45:02 2006 +0000
+++ b/www/macros.m4	Sat Oct 14 15:09:33 2006 +0000
@@ -83,8 +83,8 @@
 m4_define(`__HTML_HEADER__', `<!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" lang="en" xml:lang="en">
-<meta http-equiv="content-type" content="text/html; charset=utf-8">
 <head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
 <title>$1</title>
 <link rel="stylesheet" type="text/css" href="__BASE_ADDRESS__/octave-forge.css" />
 <script type="text/javascript">
@@ -94,6 +94,14 @@
     location.href=url;
   }
 }
+function unfold(id) {
+    document.getElementById(id).style.display = "none;";
+    document.getElementById(id+"_detailed").style.display = "block;";
+}
+function fold(id) {
+    document.getElementById(id+"_detailed").style.display = "none;";
+    document.getElementById(id).style.display = "block;";
+}
 // -->
 </script>
 </head>
@@ -202,9 +210,10 @@
 m4_dnl
 m4_dnl
 m4_define(`__TRAILER__', `
+</div>
 <div id="sf_logo">
   <a  href="__SOURCEFORGE__"><img src="__SOURCEFORGE__/sflogo.php?__GROUP_ID__&amp;type=1"  width="88"
-height="31" border="0" alt="SourceForge.net Logo"  /></a>
+height="31" style="border: 0;" alt="SourceForge.net Logo"  /></a>
 </div>
 </body>
 </html>')m4_dnl
--- a/www/octave-forge.css	Sat Oct 14 12:45:02 2006 +0000
+++ b/www/octave-forge.css	Sat Oct 14 15:09:33 2006 +0000
@@ -176,20 +176,29 @@
 }
 
 div.package {
-  margin-top: 0.5em;
+  margin-top: 0.2em;
   background-color: #d3d7cf;
   border: 1px solid;
   border-color: #babdb6;
-  margin: 1em 5em 0 1em;
   padding: 0.2em 0.2em 0em 0.2em;
-  text-decoration: none;
   color: black;
 }
 
-p.package_link {
-  margin: 0.2em;
+a.package_link {
+  color: black;
   font-weight: bold;
   font-size: 80%;
+  text-decoration: none;
+}
+
+a.package_head_link {
+  color: black;
+  text-decoration: none;
+}
+
+table.package {
+  table-layout: fixed;
+  width: 100%;
 }
 
 p.package_link a {