from django.shortcuts import get_object_or_404, render
from django.utils import simplejson
from django.shortcuts import get_object_or_404, render
from django.utils import simplejson
import nice_diff
from wiki import forms
from wiki.helpers import (JSONResponse, JSONFormInvalid, JSONServerError,
import nice_diff
from wiki import forms
from wiki.helpers import (JSONResponse, JSONFormInvalid, JSONServerError,
'document_id': chunk.id,
'title': chunk.book.title,
'history': get_history(chunk),
'document_id': chunk.id,
'title': chunk.book.title,
'history': get_history(chunk),
- 'version': chunk.revision()
+ 'version': chunk.revision(),
+ 'stage': chunk.stage.name if chunk.stage else None,
+ 'assignment': chunk.user.username if chunk.user else None
'forms': {
"text_save": save_form,
"text_revert": forms.DocumentTextRevertForm(prefix="textrevert")
},
'tags': list(save_form.fields['stage_completed'].choices),
'can_pubmark': request.user.has_perm('catalogue.can_pubmark'),
'forms': {
"text_save": save_form,
"text_revert": forms.DocumentTextRevertForm(prefix="textrevert")
},
'tags': list(save_form.fields['stage_completed'].choices),
'can_pubmark': request.user.has_perm('catalogue.can_pubmark'),
revision = doc.revision()
return JSONResponse({
'text': doc.materialize() if parent_revision != revision else None,
revision = doc.revision()
return JSONResponse({
'text': doc.materialize() if parent_revision != revision else None,
- 'text': doc.materialize() if before != doc.revision() else None,
- 'meta': {},
- 'revision': doc.revision(),
+ 'document': doc.materialize() if before != doc.revision() else None,
+ 'version': doc.revision(),