Explorar o código

[editor] Provide more information in the history

Romain Rigaux %!s(int64=10) %!d(string=hai) anos
pai
achega
4933a9b
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      desktop/libs/notebook/src/notebook/api.py

+ 4 - 3
desktop/libs/notebook/src/notebook/api.py

@@ -259,9 +259,10 @@ def get_history(request):
   response['status'] = 0
   response['history'] = [{
       'name': doc.name,
-      'id': doc.id
-      } for doc in Document2.objects.filter(type='notebook', owner=request.user, is_history=True).order_by('-last_modified')]
-  response['message'] = _('Notebook saved !')
+      'id': doc.id,
+      'data': Notebook(document=doc).get_data()
+      } for doc in Document2.objects.filter(type='notebook', owner=request.user, is_history=True).order_by('-last_modified')[:25]]
+  response['message'] = _('History saved !')
 
   return JsonResponse(response)