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:
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
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