de54eb8be0cd84a2c7f695911b94788f000df671
1 ##parameters=compare=''
3 from Products
.Plinn
.utils
import getAdapterByInterface
5 form
= context
.REQUEST
.form
6 history
= getAdapterByInterface(context
, 'Products.Plinn.interfaces.IContentHistory', None)
9 start
= form
.get('first_transaction',0)
10 stop
= start
+ resultsLength
11 batchNavigation
= None
13 if history
is not None :
14 entries
= history
.listEntries(first
=start
, last
=stop
+1)
16 previous
, next
= None, None
17 if len(entries
) == resultsLength
+ 1 :
18 entries
= entries
[0:-1]
19 next
= start
+ resultsLength
22 previous
= start
- resultsLength
24 batchNavigation
= {'previous':previous
, 'next':next
, 'current':start
}
26 options
['entries'] = entries
27 r
= form
.get('rightkey', entries
[0]['key'])
29 l
= form
.get('leftkey', entries
[1]['key'])
33 options
['leftkey'] = l
34 options
['rightkey'] = r
36 comparison
= history
.compare(l
, r
)
38 options
['entries'] = None
40 options
['comparison'] = comparison
41 options
['batchNavigation'] = batchNavigation
43 return context
.changes_history_template(**options
)