<commit_before><!-- Copyright 2017 <NAME> <<EMAIL>>. All rights
     reserved. Use of this source code is governed by the AGPLv3 license that
     can be found in the LICENSE file. -->

<template>
  <div class="card">
    <h2 class="card-header" >
      Details
    </h2>
    <div class="card-block" >
      <div class="container">
        <p>
          <span class="field-name">Status:</span>
        </p>
        <status-pill :status="ticket.status" />
        <br />

        <p>
          <span class="field-name">Reporter:</span>
          <user-stub :username="ticket.reporter" />
        </p>

        <p>
          <span class="field-name">Assignee:</span>
          <user-stub :username="ticket.assignee" />
        </p>

        <p>
          <span class="field-name">Created:</span>
          {{ dateFormat(ticket.createdDate) }}
        </p>

        <p>
          <span class="field-name">Updated:</span>
          {{ dateFormat(ticket.updatedDate) }}
        </p>

        <p>
          <span class="field-name">Type:</span>
          {{ ticket.type }}
        </p>

        <template v-if="ticket.labels.length !== 0">
          <p>
            <span class="field-name">Labels:</span>
          </p>
          <div class="label" v-for="label in ticket.labels">
            {{ label }}
          </div>
        </template>
      </div>
    </div>
  </div>
</template>

<script>
 import UserStub from '@/components/Users/Stub'
 import StatusPill from '@/components/Status/Pill'
 import dateUtils from '@/lib/dates'

 export default {
   name: 'ticket-details',

   components: {
     'user-stub': UserStub,
     'status-pill': StatusPill
   },

   methods: {
     dateFormat: dateUtils.dateFormat
   },

   props: {
     ticket: {
       name: 'ticket',
       default: {
         'labels': []
       }
     }
   }
 }
</script>


<style>
 .label {
   background-color: #eee;
   color: blue;
   border-radius: 5px;
   margin-left: 0.5rem;
   margin-bottom: 0.5rem;
   padding: 0.2rem;
   text-align: center;
   display: inline-block;
 }

 .field-name {
   font-weight: bold;<commit_msg>Make details better resemble the Custom Fields section<commit_after><!-- Copyright 2017 <NAME> <<EMAIL>>. All rights
     reserved. Use of this source code is governed by the AGPLv3 license that
     can be found in the LICENSE file. -->

<template>
  <div class="card">
    <h2 class="card-header" >
      Details
    </h2>
    <div class="card-block" >
      <div class="container">
        <div class="field-name">
          Status:
        </div>
        <div class="field-value">
          <status-pill :status="ticket.status" />
        </div>

        <div class="field-name">
          Reporter:
        </div>
        <div class="field-value">
          <user-stub :username="ticket.reporter" />
        </div>

        <div class="field-name">
          Assignee:
        </div>
        <div class="field-value">
          <user-stub :username="ticket.assignee" />
        </div>

        <div class="field-name">
          Created:
        </div>
        <div class="field-value">
          {{ dateFormat(ticket.createdDate) }}
        </div>

        <div class="field-name">
          Updated:
        </div>
        <div class="field-value">
          {{ dateFormat(ticket.updatedDate) }}
        </div>

        <div class="field-name">
          Type:
        </div>
        <div class="field-value">
          {{ ticket.type }}
        </div>

        <template v-if="ticket.labels.length !== 0">
          <div class="field-name">
            Labels:
          </div>
          <div class="field-value">
            <div class="label" v-for="label in ticket.labels">
              <router-link :to="{ path: '/queries',
                                query: { q: labelQuery(label)} }">
                {{ label }}
              </router-link>
            </div>
          </div>
        </template>
      </div>
    </div>
  </div>
</template>

<script>
 import UserStub from '@/components/Users/Stub'
 import StatusPill from '@/components/Status/Pill'
 import dateUtils from '@/lib/dates'

 export default {
   name: 'ticket-details',

   components: {
     'user-stub': UserStub,
     'status-pill': StatusPill
   },

   methods: {
     dateFormat: dateUtils.dateFormat,

     labelQuery: function (label) {
       return 'labels = "' + label + '"'
     }
   },

   props: {
     ticket: {
       name: 'ticket',
       default: {
         'labels': []
       }
     }
   }
 }
</script>


<style>
 .label {
   background-color: #eee;
   color: blue;
   border-radius: 5px;
   margin-left: 0.5rem;
   margin-bottom: 0.5rem;
   padding: 0.2rem;
   text-align: center;
   display: inline-block;
 }

 .field-name {
   font-weight: bold;
{'fraction_non_alphanumeric': 0.1591578947368421, 'fraction_numerical': 0.00631578947368421, 'mean_word_length': 1.7622093023255814, 'pattern_counts': {'":': 0, '<': 110, '<?xml version=': 0, '>': 110, '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': '3951717', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1482, 'n_words': 328}