diff --git a/pandora/text/models.py b/pandora/text/models.py index dedc9dae..af5c5c14 100644 --- a/pandora/text/models.py +++ b/pandora/text/models.py @@ -5,6 +5,7 @@ import os import re import subprocess from glob import glob +from urllib import quote from django.db import models from django.db.models import Max @@ -53,7 +54,10 @@ class Text(models.Model): return self.get_id() def get_absolute_url(self): - return '/texts/%s' % self.get_id() + return '/texts/%s' % quote(self.get_id()) + + def get_absolute_pdf_url(self): + return '/texts/%s/text.pdf' % quote(self.get_id()) def get_id(self): return u'%s:%s' % (self.user.username, self.name) diff --git a/pandora/text/templates/pdf/viewer.html b/pandora/text/templates/pdf/viewer.html new file mode 100644 index 00000000..dfea6593 --- /dev/null +++ b/pandora/text/templates/pdf/viewer.html @@ -0,0 +1,206 @@ + + + +
+ + +