<commit_before><template>
    <div class="box">
        <div class="columns">
            <div class="column is-three-quarters">
                <router-link :to="`/~${board}/${thread.key}/${thread.slug}/`">
                    <h2 class="title">{{ thread.title }}</h2>
                </router-link>
                <h3 class="subtitle">Posted by {{ thread.author }} {{ thread.created | timeElapsed }}</h3>
            </div>
            <div class="column is-clearfix">
                <div class="is-pulled-right">
                    <button class="button">
                        <span class="icon">
                            <i class="fa fa-bookmark">
                                <span class="is-accessible">Bookmark</span>
                            </i>
                        </span>
                    </button>
                    <button class="button">
                        <span class="icon">
                            <i class="fa fa-link">
                                <span class="is-accessible">Copy Link</span>
                            </i>
                        </span>
                    </button>
                    <button @click="open = !open" class="button">
                        <span class="icon">
                            <i class="fa" v-bind:class="{'fa-plus' : !open, 'fa-minus' : open}">
                                <span class="is-accessible" v-if="!open">Open</span>
                                <span class="is-accessible" v-else>Close</span>
                            </i>
                        </span>
                    </button>
                </div>
            </div>
        </div>
        <transition name="slide-down">
            <div v-show="open" class="content">
                <p>{{ thread.content }}</p>
            </div>
        </transition>
    </div>
</template>

<script>
export default Vue.component('thread-preview', {
    props: {
        board: {
            type: String,
            required: true
        },
        thread: {
            type: Object,
            required: true
        }
    },
    data() {
        return {
            open: false
        }
    }
})
</script><commit_msg>add controls for threads belonging to user.<commit_after><template>
    <div class="box">
        <div class="columns">
            <div class="column is-three-quarters">
                <router-link :to="`/~${board}/${thread.key}/${thread.slug}/`">
                    <h2 class="title">{{ thread.title }}</h2>
                </router-link>
                <h3 class="subtitle">Posted by {{ thread.author }} {{ thread.created | timeElapsed }}</h3>
            </div>
            <div class="column is-clearfix">
                <div class="is-pulled-right">
                    <button class="button">
                        <span class="icon">
                            <i class="fa fa-bookmark">
                                <span class="is-accessible">Bookmark</span>
                            </i>
                        </span>
                    </button>
                    <button class="button">
                        <span class="icon">
                            <i class="fa fa-link">
                                <span class="is-accessible">Copy Link</span>
                            </i>
                        </span>
                    </button>
                    <button @click="open = !open" class="button">
                        <span class="icon">
                            <i class="fa" v-bind:class="{'fa-plus' : !open, 'fa-minus' : open}">
                                <span class="is-accessible" v-if="!open">Open</span>
                                <span class="is-accessible" v-else>Close</span>
                            </i>
                        </span>
                    </button>
                </div>
                <div v-if="thread.author === username" class="is-pulled-right">
                    <button class="button">
                        <span class="icon">
                            <i class="fa fa-pencil">
                                <span class="is-accessible">Edit</span>
                            </i>
                        </span>
                    </button>
                    <button class="button">
                        <span class="icon">
                            <i class="fa fa-archive">
                                <span class="is-accessible">Archive</span>
                            </i>
                        </span>
                    </button>
                    <button class="button">
                        <span class="icon">
                            <i class="fa fa-trash">
                                <span class="is-accessible">Delete</span>
                            </i>
                        </span>
                    </button>
                </div>
            </div>
        </div>
        <transition name="slide-down">
            <div v-show="open" class="content">
                <p>{{ thread.content }}</p>
            </div>
        </transition>
    </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default Vue.component('thread-preview', {
    props: {
        board: {
            type: String,
            required: true
        },
        thread: {
            type: Object,
            required: true
        }
    },
    data() {
        return {
            open: false
        }
    },
    computed: mapGetters('user', {
        username: 'GET_USERNAME'
    }),
    methods: {
        delete(){
            this.$store.dispatch('thread/delete')
        }
    }
})
</script>
{'fraction_non_alphanumeric': 0.14063878595376741, 'fraction_numerical': 0.0014116816657843657, 'mean_word_length': 0.95246296934206, 'pattern_counts': {'":': 0, '<': 133, '<?xml version=': 0, '>': 133, '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': '5310323', 'n_tokens_mistral': 1448, 'n_tokens_neox': 1369, 'n_words': 275}