Updated document page view to display zoom level and rotation degrees in the title
This commit is contained in:
+15
-1
@@ -1,3 +1,5 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import zipfile
|
import zipfile
|
||||||
import urlparse
|
import urlparse
|
||||||
@@ -830,11 +832,23 @@ def document_page_view(request, document_page_id):
|
|||||||
rotation = int(request.GET.get('rotation', 0))
|
rotation = int(request.GET.get('rotation', 0))
|
||||||
document_page_form = DocumentPageForm(instance=document_page, zoom=zoom, rotation=rotation)
|
document_page_form = DocumentPageForm(instance=document_page, zoom=zoom, rotation=rotation)
|
||||||
|
|
||||||
|
base_title = _(u'details for: %s') % document_page
|
||||||
|
|
||||||
|
if zoom != 100:
|
||||||
|
zoom_text = u'(%d%%)' % zoom
|
||||||
|
else:
|
||||||
|
zoom_text = u''
|
||||||
|
|
||||||
|
if rotation != 0 and rotation != 360:
|
||||||
|
rotation_text = u'(%d°)' % rotation
|
||||||
|
else:
|
||||||
|
rotation_text = u''
|
||||||
|
|
||||||
return render_to_response('generic_detail.html', {
|
return render_to_response('generic_detail.html', {
|
||||||
'object': document_page,
|
'object': document_page,
|
||||||
'web_theme_hide_menus': True,
|
'web_theme_hide_menus': True,
|
||||||
'form': document_page_form,
|
'form': document_page_form,
|
||||||
'title': _(u'details for: %s') % document_page,
|
'title': u' '.join([base_title, zoom_text, rotation_text])
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user