Currently, mail-list.dvsl assumes the <subscribe/> and <unsubscribe/>
elements are email addresses.  Unfortunately, this doesn't work for those
of us with mailing lists on SourceForge, which uses Mailman.  The links to
subscribe and unsubscribe from the list are http links to forms.

The attached patch allows for http links in addition to the current 
format.  It also deals with missing <mailingList> elements.

Glenn McAllister
SOMA Networks, Inc.
Index: mail-lists.dvsl
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/dvsl/xdocs/mail-lists.dvsl,v
retrieving revision 1.2
diff -u -r1.2 mail-lists.dvsl
--- mail-lists.dvsl     17 Mar 2002 19:21:04 -0000      1.2
+++ mail-lists.dvsl     23 Apr 2002 02:01:32 -0000
@@ -50,8 +50,32 @@
 #match ("mailingList")
         <tr>
           <td>$node.name.value()</td>
-          <td><a href="mailto:$node.subscribe.value()">Subscribe</a></td>
-          <td><a href="mailto:$node.unsubscribe.value()">Unsubscribe</a></td>
+          #if( $node.subscribe )
+            #if( $node.subscribe.value().startsWith( "http" ) )
+              #set( $subscribe = $node.subscribe.value() )
+            #else
+              #set( $subscribe = "mailto:$node.subscribe.value()" )
+            #end
+          <td><a href="$subscribe">Subscribe</a></td>
+          #else
+          <td>Subscribe</td>
+          #end
+
+          #if( $node.unsubscribe )
+            #if( $node.unsubscribe.value().startsWith( "http" ) )
+              #set( $unsubscribe = $node.unsubscribe.value() )
+            #else
+              #set( $unsubscribe = "mailto:$node.unsubscribe.value()" )
+            #end
+          <td><a href="$unsubscribe">Unsubscribe</a></td>
+          #else
+          <td>Unsubscribe</td>
+          #end
+          
+          #if( $node.archive )
           <td><a href="$node.archive.value()">Archive</a></td>
+          #else
+          <td>No archive available</td>
+          #end
         </tr>
 #end

Reply via email to