Get URL from router.
authorAlexandre Segura <mex.zktk@gmail.com>
Wed, 22 Feb 2017 16:46:29 +0100
changeset 346 ff784774b131
parent 345 4bf0f6ff748d
child 347 796545cbe7b7
Get URL from router.
src/iconolab/templates/iconolab/detail_image.html
--- 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');