Version 9 (modified by 16 years ago) (diff) | ,
---|
Last Modified Macro
Notice: This plugin is unmaintained and available for adoption.
Description
Shows the last modification date of the specified page, or the page the macro appears in if not specified. An optional argument, delta
, can be given to show the time elapsed since the last modification. The output is placed in a <span>
with a title that gives the exact modification date and the author of the change.
Bugs/Feature Requests
Existing bugs and feature requests for LastModifiedMacro are here.
If you have any issues, create a new ticket.
Download
Download the zipped source from [download:lastmodifiedmacro here].
Source
You can check out LastModifiedMacro from here using Subversion, or browse the source with Trac.
Example
Basic usage:
[[LastModified]] [[LastModified(delta)]] [[LastModified(MacroBazaar)]] [[LastModified(MacroBazaar,delta)]]
For example, [[LastModified(CustomMacros)]]
produces:
<span class="last-modified" title="Wed Oct 6 20:34:51 2004 by username">2004-10-06</span>
Alternatively, [[LastModified(CustomMacros,delta)]]
produces:
<span class="last-modified" title="Wed Oct 6 20:34:51 2004 by username">7 weeks</span>
This is a CSS style to apply that will make it about 3.14% slicker:
span.last-modified { border-bottom: 1px dotted gray; cursor: help; }
Building off the above style, I did the following to match the colour of the TocMacro. (To apply this to all projects, append the below text to this file: /usr/share/trac/htdocs/css/wiki.css)
/* Styles for the LastModified wikimacro */ span.last-modified { border-bottom: 1px dotted gray; border-top: 1px dotted gray; background: #FFFFDD; cursor: help; }
Recent Changes
- 17870 by rjollos on 2020-11-11 17:56:54
-
Add
LatestRevision
macro
- 17680 by rjollos on 2020-03-05 16:54:55
-
Make default date format configurable
Fixes #13760.
- 17679 by rjollos on 2020-03-03 18:38:47
-
Make compatible with Trac 1.3+
- Require Trac >= 1.0
- Add keyword argument for specifying timestamp format
- Fix SQL injection vulnerability
Includes contributions from david@santinoli.com
Fixes #13759.
(more)
LastModified.py file attached by Bill Coffman, which works on 0.11. This new version:
- Does not support mouseover.
- Does not support the delta argument all by itself. That is, LastModified(delta) will just look for a wiki page named delta.
- The above style sheets mentioned above won't work with this version.
- Has changed the format of the date to something that I personally found more compact, precise and readable.
- Most importantly, it works with 0.11, and seems to be pretty much compliant with the coding standards for 0.11
- Because of the above changes, it should probably be officially considered a fork, and could be named something differently. I leave it to someone who cares sufficiently to make this code compliant with the previous version.
The patch attached by Paul Heinlein will, when applied to Bill's 0.11 version of the plugin, report the author's full name rather than login username if the full name exists as a session attribute.
Author/Contributors
Author: HorsePunchKid
Contributors: Nathan Kidd, Bill Coffman