h1. New recent changes class The current recent changes helper is pretty simple, and relies on automatic summary to do the dirty work. Bil Kleb made the following request: 1. Filter out the changes made by /^Automatic/ authors 2. Chunk changes to a given page by day, i.e, collapse
Feedback revised on 2005 Mar 05 04:37 by Bil Kleb
Feedback revised on 2005 Mar 05 04:36 by Bil Kleb
Feedback revised on 2005 Mar 05 04:35 by Bil Kleb
Feedback revised on 2005 Mar 05 04:34 by Bil Kleb
Feedback revised on 2005 Mar 05 04:33 by Bil Kleb
to something like usemod produces:
March 5, 2005
* (diff) Feedback 4:37 am (5 changes) Bil Kleb
where "diff" shows you that last diff and "changes" shows you all the changes to this page
This would require the following changes:
1) Re-write the AutomaticRecentchanges so that it creates the page itself rather than passing off to an AutomaticSummary class.
That would involve:
a) registering with the wiki to be notified of page changes ( wiki.watch_for( :page_revised ) { |event, page, revision| do_something_with( page, revision ) }
b) when a revision event occurs, update some data structure of the recent revisions
c) converting the data structure into a textile representation and writing to the wiki ( wiki.revise pagename, content, author )
2) Create some new 'view' types that would have the 'diff' and the 'changes' laid out as you would like.
New views can be created in the views directory of the wiki. If the wiki receives a request for a url http://whatever.com/diff/feedback it will look in the views folder for a file called Page_diff.rhtml. This is expected to be an Erb file. The ruby in the erb file is bound to the context of the View class, so has local variables: pagename (String), page (Page), renderedview (String - html from textile), and access to the methods of the View and the Wiki classes.
3) (Maybe) the changes and diff probably want to point to a specific set of changes / diff. That would mean would need to work out a way of getting a 'revision' variable from the url, through to the view method in the view class.
I guess the format for the url could be:
a) http://whaterver.com/diff/3/feedback
or
b) http://whaterver.com/diff/feedback?revision=3
I guess I visually prefer a) but b) would be easier to code.
Would then need to change:
lib/soks-servlet.rb/WikiServlet#service to extract the desired revision number from the request (e.g. by looking at request.query['revision']) and then edit the call to view.view to have an extra parameter (e.g. view(pagename, view, person, revision)).
Then modify lib/soks-view.rb/View#view to accept the extra parameter. It would then be available as a local variable in the Page_diff.rhtml
----
Our Soks Wiki went "live" yesterday within a group of about 40 people and the recent changes page has nearly become useless in it's current form. I have it set to only show 100 changes for performance reasons, and these folks generated that many changes per hour(!) figuring this Wiki stuff out. (Note: the number of changes would probably be lower if they were able to preview before saving. However, it was interesting to see some of their intermediate page changes.) They are talking about going live within our entire center (~3,500 people) on Monday... --Bil
--
Ok, the cvs version now has a few improvements that are getting toward this: Automatic helpers are exlcuded, runs of changes by the same person are merged, and the changes are arranged under day headings. No direct link to specific diffs yet. -- tamc2
p(. Updated 19 March via cvs, excellent so far. Thanks. --Bil