Update of /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates
In directory sc8-pr-cvs1:/tmp/cvs-serv5523/builds/www.webmacro.org/templates
Modified Files:
footer.wm optionsbar.wm
Added Files:
diff.wm
Log Message:
- adding a "Diff to previous" feature that uses a java version of GNU 'diff' from http://www.bmsi.com/java/#diff
I need to contact this person to ensure it's actually okay to use here. It think it will be b/c Wiki is GPL'd too
--- NEW FILE: diff.wm ---
#include as template "header.wm"
#if (!$DiffHelper) {
<form method="GET">
Page Name: <input type='text' name='PAGE'><br>
<input type='submit' value='View differences'>
</form>
} #else {
#if ($DiffHelper.Changes.size() == 1) { 1 difference }
#else {$DiffHelper.Changes.size() differences }
<table border=1 width="100%" cellspacing=1 cellpadding=2>
<tr>
<th>$OldPage.Title -- v$OldPage.Version</th>
<th>$CurrentPage.Title -- v$CurrentPage.Version #if ($IsCurrent) { (Latest Version) }</th>
</tr>
<tr>
<td>Editor: <b>$OldPage.LastEditor</b>; Date: <b>$OldPage.DateLastModified</b></td>
<td>Editor: <b>$CurrentPage.LastEditor</b>; Date: <b>$CurrentPage.DateLastModified</b></td>
</tr>
<tr>
<td colspan=2 align=center>
<table border=0 width="50%">
<tr><th colspan=3>Legend</th></tr>
<tr><td class='deleted_line'>Deleted</td><td class='inserted_line'>Inserted</td></tr>
<tr><td class='modified_line'>Modified</td><td></td></tr>
</table>
</td>
<tr>
<td valign=top width="50%">
#foreach $line in $OldPageLines indexing $idx from 0 {
#count $i from 1 to $DiffHelper.getInsertCount($idx) {<br>}
#if($DiffHelper.isModified($idx)){<span class='modified_line'> #wiki{$line}</span><br>}
#elseif($DiffHelper.isDeleted($idx)){<span class='deleted_line'> #wiki{$line}</span><br>}
#else{<span class='unchanged_line'>#wiki{$line}</span><br>}
}
</td>
<td valign=top width="50%">
#foreach $line in $CurrentPageLines indexing $idx from 0 {
#count $i from 1 to $DiffHelper.getDeleteCount($idx) {<br>}
#if($DiffHelper.isModified($idx)){<span class='modified_line'> #wiki{$line}</span><br>}
#elseif($DiffHelper.isInserted($idx)){<span class='inserted_line'> #wiki{$line}</span><br>}
#else{<span class='unchanged_line'>#wiki{$line}</span><br>}
}
</td>
</tr>
</table>
}
#include as template "footer.wm"
Index: footer.wm
===================================================================
RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/footer.wm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** footer.wm 2 Jul 2003 03:01:52 -0000 1.2
--- footer.wm 2 Jul 2003 06:55:13 -0000 1.3
***************
*** 28,33 ****
|| <a href="ControllerPage?delete=$Page.Title"><span class="Options">Delete page</span></a>
}
-
- ||
}
} #elseif (!$User) {
--- 28,31 ----
***************
*** 37,42 ****
#if ($User) {
! <a href="ControllerPage?logout=true"><span class="Options">Log Out</span></a>
}
</td>
--- 35,42 ----
#if ($User) {
! || <a href="ControllerPage?logout=true"><span class="Options">Log Out</span></a>
}
+
+
</td>
Index: optionsbar.wm
===================================================================
RCS file: /cvsroot/webmacro/wiki/builds/www.webmacro.org/templates/optionsbar.wm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** optionsbar.wm 2 Jul 2003 03:01:52 -0000 1.3
--- optionsbar.wm 2 Jul 2003 06:55:13 -0000 1.4
***************
*** 15,18 ****
--- 15,20 ----
}
+ || <a href="DiffPage?PAGE=$Page.Title">Diff to previous version</a>
+
#if ($User && $Wiki.isAdministrator($User)) {
#parse "adminoptionsbar.wm"
|