Tags:
archive_me1Add my vote for this tag create new tag
, view all tags

Feature Proposal: MailerContrib - 'Changed' link should point to most recent changes, not the entire history

Motivation

At the moment, the links in the 'Changed' column point to the entire history of the topic. It would be much more useful if it only showed the revisions that have changed since the last notification.

Description and Documentation

This provides two more variables that can be used in the templates:

  • %BASE_REV%
  • %CUR_REV%

We can then use the following link in the templates:

  • <a href="%SCRIPTURL{"rdiff"}%/%WEB%/%TOPICNAME%?rev1=%BASE_REV%&rev2=%CUR_REV%" rel='nofollow'>%TIME% - %REVISION%

Impact

WhatDoesItAffect: Plugins, Usability

Implementation

Patch:

Index: lib/TWiki/Contrib/MailerContrib/Change.pm
===================================================================
--- lib/TWiki/Contrib/MailerContrib/Change.pm   (revision 14489)
+++ lib/TWiki/Contrib/MailerContrib/Change.pm   (working copy)
@@ -108,7 +108,7 @@
    * =$html= - Template to expand keys within
 Expand an HTML template using the values in this change. The following
 keys are expanded: %<nop>TOPICNAME%, %<nop>AUTHOR%, %<nop>TIME%,
-%<nop>REVISION%, %<nop>TEXTHEAD%.
+%<nop>REVISION%, %<nop>BASE_REV%, %<nop>CUR_REV%, %<nop>TEXTHEAD%.

 Returns the expanded template.

@@ -128,6 +128,8 @@
     $html =~ s/%AUTHOR%/$this->{AUTHOR}/g;
     my $tim =  TWiki::Time::formatTime( $this->{TIME} );
     $html =~ s/%TIME%/$tim/go;
+    $html =~ s/%CUR_REV%/$this->{CURR_REV}/g;
+    $html =~ s/%BASE_REV%/$this->{BASE_REV}/g;
     my $frev = '';
     if( $this->{CURR_REV} ) {
         if( $this->{CURR_REV} > 1 ) {
@@ -177,6 +179,8 @@
     $template =~ s/%TOPICNAME%/$this->{TOPIC}/g;
     $template =~ s/%AUTHOR%/$this->{AUTHOR}/g;
     $template =~ s/%TIME%/$tim/g;
+    $template =~ s/%CUR_REV%/$this->{CURR_REV}/g;
+    $template =~ s/%BASE_REV%/$this->{BASE_REV}/g;
     my $frev = '';
     if( $this->{CURR_REV} ) {
         if( $this->{CURR_REV} > 1 ) {
Index: templates/mailnotify.tmpl
===================================================================
--- templates/mailnotify.tmpl   (revision 14489)
+++ templates/mailnotify.tmpl   (working copy)
@@ -24,7 +24,7 @@
   <td width="50%">
     <a href="%SCRIPTURL{"view"}%/%WEB%/%TOPICNAME%"><b>%TOPICNAME%</b></a>
   </td><td width="30%">
-    <a href="%SCRIPTURL{"rdiff"}%/%WEB%/%TOPICNAME%" rel='nofollow'>%TIME%</a> - %REVISION%
+    <a href="%SCRIPTURL{"rdiff"}%/%WEB%/%TOPICNAME%?rev1=%BASE_REV%&rev2=%CUR_REV%" rel='nofollow'>%TIME%</a> - %REVISION%
   </td><td width="20%">
     %AUTHOR%
   </td>

-- Contributors: AndrewRJones - 30 Jul 2007

P.S - should I be doing these feature proposals for each change to default plugins, or is it ok to just go ahead and do it (providing the tests pass)?

Discussion

So 14 days have passed, which means I can commit this?

-- AndrewRJones - 14 Aug 2007

Done. Bugs:Item4461.

-- AndrewRJones - 16 Aug 2007

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2007-08-16 - AndrewRJones
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.