From da0c65e6008cc1dbc88b05ed53553d70ec04e3fd Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Tue, 9 Jan 2018 16:10:55 +0100 Subject: [PATCH] fix links to local files in editor --- apps/wiki/templates/wiki/bootstrap.html | 2 +- apps/wiki/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/wiki/templates/wiki/bootstrap.html b/apps/wiki/templates/wiki/bootstrap.html index 02458e20..8428a60c 100644 --- a/apps/wiki/templates/wiki/bootstrap.html +++ b/apps/wiki/templates/wiki/bootstrap.html @@ -347,7 +347,7 @@ documentDiffUrl: function(id) { return '/editor/diff/' + id + '/'; }, documentRestoreUrl: function(id) { return '/editor/revert/' + id + '/'}, documentAttachmentUrl: function(attachmentName) { - return '{{MEDIA_URL}}{{IMAGE_DIR}}{{slug}}/' + attachmentName; + return '{{MEDIA_URL}}{{IMAGE_DIR}}{{gallery}}/' + attachmentName; }, documentUrl: function(id, version) { var url = '{% url 'wiki_editor' slug %}'; diff --git a/apps/wiki/views.py b/apps/wiki/views.py index d37801f2..1cee83ad 100644 --- a/apps/wiki/views.py +++ b/apps/wiki/views.py @@ -110,7 +110,8 @@ def editor(request, slug, chunk=None, template_name='wiki/bootstrap.html'): }, 'tags': list(save_form.fields['stage_completed'].choices), 'can_pubmark': request.user.has_perm('catalogue.can_pubmark'), - 'slug': chunk.book.slug + 'slug': chunk.book.slug, + 'gallery': chunk.book.gallery, }) -- 2.20.1