src_js/iconolab-bundle/src/components/editor/Comment.vue
changeset 405 6b8a1ae18e91
parent 396 0a4743126d74
child 406 733be8cac793
equal deleted inserted replaced
404:38dfe91ee69a 405:6b8a1ae18e91
     1 <template>
     1 <template>
     2     <div class="comment" v-bind:style="{ marginLeft: (level * 15) + 'px' }">
     2     <div v-on:mouseover="hover = true" v-on:mouseleave="hover = false" class="comment" v-bind:style="{ marginLeft: (level * 15) + 'px' }">
     3         <div class="comment-body">
     3         <div class="comment-body">
     4             <strong class="comment-author">{{ username }}</strong>
     4             <strong class="comment-author">{{ username }}</strong>
     5             <div class="comment-content" v-html="commentFormatted"></div>
     5             <div class="comment-content" v-html="commentFormatted"></div>
     6         </div>
     6         </div>
     7         <div class="comment-footer">
     7         <div class="comment-footer">
     8             <a v-if="allowThread" href="#" v-on:click.prevent="showForm = !showForm">Répondre</a>
     8             <span v-show="!hover || !allowThread" class="comment-date">{{ dateFormatted }}</span>
     9             <span class="comment-date">{{ dateFormatted }}</span>
     9             <comment-form v-show="hover"
    10             <comment-form v-bind:reply-to="id" v-if="allowThread" v-show="showForm">
    10                 v-if="allowThread"
    11                 <button slot="submit" type="submit" class="btn btn-xs btn-primary">Valider</button>
    11                 v-bind:annotation="annotation"
    12                 <a slot="submit" href="#" v-on:click.prevent="showForm = false" class="text-muted" style="margin-left: 5px;">Annuler</a>
    12                 v-bind:reply-to="id"></comment-form>
    13             </comment-form>
       
    14         </div>
    13         </div>
    15     </div>
    14     </div>
    16 </template>
    15 </template>
    17 
    16 
    18 <script>
    17 <script>
    34             'date',
    33             'date',
    35             'allowThread'
    34             'allowThread'
    36         ],
    35         ],
    37         data() {
    36         data() {
    38             return {
    37             return {
    39                 showForm: false
    38                 showForm: false,
       
    39                 hover: false
    40             }
    40             }
    41         },
    41         },
    42         computed: {
    42         computed: {
    43             dateFormatted: function () {
    43             dateFormatted: function () {
    44 
    44