<commit_before><script lang="coffee">
import ThreadService from '@/shared/services/thread_service'
import AbilityService from '@/shared/services/ability_service'
import { pick, some } from 'lodash'

export default
  props:
    thread: Object

    groupPage:
      type: Boolean
      default: false

    showGroupName:
      type: Boolean
      default: true

  computed:
    dockActions: ->
      pick(ThreadService.actions(@thread, @), ['dismiss_thread'])

    menuActions: ->
      actions = if @groupPage
        if @$vuetify.breakpoint.smAndDown
          ['dismiss_thread','pin_thread', 'unpin_thread', 'move_thread', 'close_thread', 'reopen_thread', 'discard_thread']
        else
          ['pin_thread', 'unpin_thread', 'move_thread', 'close_thread', 'reopen_thread', 'discard_thread']
      else
        if @$vuetify.breakpoint.smAndDown
          ['dismiss_thread', 'close_thread', 'reopen_thread']
        else
          ['close_thread', 'reopen_thread']
      pick(ThreadService.actions(@thread, @), actions)

    canPerformAny: ->
      some @menuActions, (action) -> action.canPerform()

</script>

<template lang="pug">
v-list-item.thread-preview.thread-preview__link(:class="{'thread-preview--unread-border': thread.isUnread()}" :to='urlFor(thread)')
  v-list-item-avatar
    user-avatar(:user='thread.author()' :size='40' no-link)
  v-list-item-content
    v-list-item-title(style="align-items: center")
      span(v-if='thread.pinnedAt' :title="$t('context_panel.thread_status.pinned')")
        v-icon(small) mdi-pin-outline<commit_msg>ThreadPreview: Add make a copy action to dropdown menu<commit_after><script lang="coffee">
import ThreadService from '@/shared/services/thread_service'
import AbilityService from '@/shared/services/ability_service'
import { pick, some } from 'lodash'

export default
  props:
    thread: Object

    groupPage:
      type: Boolean
      default: false

    showGroupName:
      type: Boolean
      default: true

  computed:
    dockActions: ->
      pick(ThreadService.actions(@thread, @), ['dismiss_thread'])

    menuActions: ->
      actions = if @groupPage
        if @$vuetify.breakpoint.smAndDown
          ['dismiss_thread','pin_thread', 'unpin_thread', 'make_a_copy', 'move_thread', 'close_thread', 'reopen_thread', 'discard_thread']
        else
          ['pin_thread', 'unpin_thread', 'make_a_copy', 'move_thread', 'close_thread', 'reopen_thread', 'discard_thread']
      else
        if @$vuetify.breakpoint.smAndDown
          ['dismiss_thread', 'make_a_copy', 'close_thread', 'reopen_thread']
        else
          ['close_thread', 'make_a_copy', 'reopen_thread']
      pick(ThreadService.actions(@thread, @), actions)

    canPerformAny: ->
      some @menuActions, (action) -> action.canPerform()

</script>

<template lang="pug">
v-list-item.thread-preview.thread-preview__link(:class="{'thread-preview--unread-border': thread.isUnread()}" :to='urlFor(thread)')
  v-list-item-avatar
    user-avatar(:user='thread.author()' :size='40' no-link)
  v-list-item-content
    v-list-item-title(style="align-items: center")
      span(v-if='thread.pinnedAt' :title="$t('context_panel.thread_status.pinned')")
        v-icon(small) mdi-pin-outline
{'fraction_non_alphanumeric': 0.14970432617491441, 'fraction_numerical': 0.0012449424214130097, 'mean_word_length': 3.7614814814814816, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6186124', 'n_tokens_mistral': 1048, 'n_tokens_neox': 1022, 'n_words': 183}