diff --git a/pandora/text/models.py b/pandora/text/models.py index 74ef7726b..4024e3fc6 100644 --- a/pandora/text/models.py +++ b/pandora/text/models.py @@ -38,7 +38,7 @@ class Text(models.Model): upload_to=lambda i, x: i.path("icon.jpg")) text = models.TextField(default="") - links = DictField(default={}, editable=True) + embeds = TupleField(default=[], editable=True) poster_frames = TupleField(default=[], editable=False) subscribed_users = models.ManyToManyField(User, related_name='subscribed_texts') @@ -142,6 +142,8 @@ class Text(models.Model): self.type = data['type'] == 'pdf' and 'pdf' or 'html' if 'posterFrames' in data: self.poster_frames = tuple(data['posterFrames']) + if 'embeds' in data: + self.embeds = tuple(data['embeds']) self.save() if 'posterFrames' in data: self.update_icon() @@ -181,6 +183,7 @@ class Text(models.Model): response[key] = getattr(self, _map.get(key,key)) if self.type == 'pdf': response['uploaded'] = True if self.file and not self.uploading else False + response['embeds'] = self.embeds return response def path(self, name=''): diff --git a/pandora/text/templates/pdf/viewer.html b/pandora/text/templates/pdf/viewer.html index dfea65936..75a2bb196 100644 --- a/pandora/text/templates/pdf/viewer.html +++ b/pandora/text/templates/pdf/viewer.html @@ -32,7 +32,7 @@ limitations under the License. diff --git a/pandora/text/views.py b/pandora/text/views.py index 8e4444c68..c740bcf9f 100644 --- a/pandora/text/views.py +++ b/pandora/text/views.py @@ -398,7 +398,7 @@ def pdf_viewer(request, id): if text.type == 'pdf' and text.file and not text.uploading: context = RequestContext(request, { 'editable': json.dumps(text.editable(request.user)), - 'links': json.dumps(text.links), + 'embeds': json.dumps(text.embeds), 'settings': settings, 'url': text.get_absolute_pdf_url() })