Get URL from router.
--- a/src/iconolab/templates/iconolab/detail_image.html Wed Feb 22 16:29:02 2017 +0100
+++ b/src/iconolab/templates/iconolab/detail_image.html Wed Feb 22 16:46:29 2017 +0100
@@ -72,6 +72,7 @@
<script>
var currentPath = "{{ request.path }}";
+ var getCommentFormURL = "{% url 'get_comment_form' ':annotation_guid' %}"
var vm = new Vue({
el: '.annotation-navigator',
@@ -95,7 +96,7 @@
var revision = $el.data('revision-id');
// Load the form for selected annotation via AJAX
- $.get('/comments/annotation/' + annotation + '/comment-form', { next: currentPath + '#' + annotation })
+ $.get(getCommentFormURL.replace(':annotation_guid', annotation), { next: currentPath + '#' + annotation })
.then(function(form) {
$('.list-group a[data-annotation-id]').removeClass('active');