fix links to local files in editor
authorJan Szejko <janek37@gmail.com>
Tue, 9 Jan 2018 15:10:55 +0000 (16:10 +0100)
committerJan Szejko <janek37@gmail.com>
Tue, 9 Jan 2018 15:10:55 +0000 (16:10 +0100)
apps/wiki/templates/wiki/bootstrap.html
apps/wiki/views.py

index 02458e2..8428a60 100644 (file)
                 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 %}';
index d37801f..1cee83a 100644 (file)
@@ -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,
     })