- changes = []
- for change in doc.history().reverse():
- changes.append({
- "version": change.revision,
- "description": change.description,
- "author": change.author_str(),
- "date": localize(change.created_at),
- "publishable": _("Publishable") + "\n" if change.publishable else "",
- "tag": ',\n'.join(unicode(tag) for tag in change.tags.all()),
- "published": _("Published") + ": " + \
- localize(change.publish_log.order_by('-book_record__timestamp')[0].book_record.timestamp) \
- if change.publish_log.exists() else "",
- })
- return JSONResponse(changes)