# HG changeset patch # User Alexandre Segura # Date 1489493265 -3600 # Node ID 729e51dd282e3badc23851e931203638921c2c28 # Parent 0f59a0f980216859c2b1b80ae800bd0c337ad0f8 Do not display comment box when not authenticated. diff -r 0f59a0f98021 -r 729e51dd282e src/iconolab/templates/iconolab/detail_image.html --- a/src/iconolab/templates/iconolab/detail_image.html Tue Mar 14 12:54:51 2017 +0100 +++ b/src/iconolab/templates/iconolab/detail_image.html Tue Mar 14 13:07:45 2017 +0100 @@ -48,11 +48,12 @@ {% csrf_token %}
- +
diff -r 0f59a0f98021 -r 729e51dd282e src_js/iconolab-bundle/src/components/editor/Comment.vue --- a/src_js/iconolab-bundle/src/components/editor/Comment.vue Tue Mar 14 12:54:51 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/editor/Comment.vue Tue Mar 14 13:07:45 2017 +0100 @@ -7,9 +7,8 @@ - @@ -34,7 +33,8 @@ 'username', 'email', 'date', - 'allowThread' + 'allow-thread', + 'is-authenticated' ], data() { return { diff -r 0f59a0f98021 -r 729e51dd282e src_js/iconolab-bundle/src/components/editor/CommentList.vue --- a/src_js/iconolab-bundle/src/components/editor/CommentList.vue Tue Mar 14 12:54:51 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/editor/CommentList.vue Tue Mar 14 13:07:45 2017 +0100 @@ -8,7 +8,8 @@ v-bind:comment="comment.comment" v-bind:username="comment.user_name" v-bind:date="comment.submit_date" - v-bind:allowThread="comment.allow_thread"> + v-bind:allow-thread="comment.allow_thread" + v-bind:is-authenticated="isAuthenticated"> @@ -17,7 +18,7 @@ import Comment from './Comment.vue' export default { - props: ['annotation', 'fetch'], + props: ['annotation', 'fetch', 'is-authenticated'], components: { Comment }, @@ -39,6 +40,11 @@ this.comments = []; } } + }, + mounted() { + if (this.annotation) { + $.getJSON(this.commentsURL).then((comments) => this.comments = comments); + } } } @@ -46,9 +52,9 @@