# HG changeset patch # User Alexandre Segura # Date 1487945727 -3600 # Node ID d0465086d8d2dadfedf9922b9d6b94c15b7d5f90 # Parent 04500e5914f9cbce41cbb60c7597561cd78edb99 Allow editing/commenting only for authenticated users. diff -r 04500e5914f9 -r d0465086d8d2 src/iconolab/templates/iconolab/detail_image.html --- a/src/iconolab/templates/iconolab/detail_image.html Fri Feb 24 14:54:06 2017 +0100 +++ b/src/iconolab/templates/iconolab/detail_image.html Fri Feb 24 15:15:27 2017 +0100 @@ -80,12 +80,14 @@ var currentPath = "{{ request.path }}"; var getCommentFormURL = "{% url 'get_comment_form' ':annotation_guid' %}" + var isAuthenticated = {% if user.is_authenticated %}true{% else %}false{% endif %}; var vm = new Vue({ el: '.annotation-navigator', data: function() { return { - annotation: null + annotation: null, + isAuthenticated: isAuthenticated }; } }); @@ -109,7 +111,9 @@ $('.list-group a[data-annotation-id]').removeClass('active'); $el.addClass('active'); - $('#form-comment form').replaceWith(form).show(); + if (isAuthenticated) { + $('#form-comment form').replaceWith(form).show(); + } vm.annotation = annotations[revision]; diff -r 04500e5914f9 -r d0465086d8d2 src_js/iconolab-bundle/src/components/editor/AnnotationForm.vue --- a/src_js/iconolab-bundle/src/components/editor/AnnotationForm.vue Fri Feb 24 14:54:06 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/editor/AnnotationForm.vue Fri Feb 24 15:15:27 2017 +0100 @@ -1,6 +1,6 @@