<commit_before><template>
  <tr>
    <td>{{ formatDateTime(mission.startTime) }}</td>
    <td :class="{'text-primary': isMissionEditor}">
      <b-popover v-if="isMissionEditor" :content="$t('mission.list.isMissionEditor')" :triggers="['hover']">
        {{ mission.title }}
      </b-popover>
      <span v-else>{{ mission.title }}</span>
      </td>
    <td>
      <router-link :to="{name: 'userDetails', params: {userUid: mission.creator.uid}}">{{ formatUserWithTag(mission.creator) }}</router-link>
    </td>
    <td class="text-center">
      <b-popover :content="$t('mission.list.slot.counts.popover', mission.slotCounts)" :triggers="['hover']">
        {{ mission.slotCounts.assigned + mission.slotCounts.unassigned }}/{{ mission.slotCounts.total }}
      </b-popover>
    </td>
    <td class="text-center">
      <b-popover v-if="mission.isAssignedToAnySlot" :content="$t('mission.list.slot.status.assigned')" :triggers="['hover']">
        <i class="fa fa-check fa-lg text-success" aria-hidden="true"></i>
      </b-popover>
      <b-popover v-if="!mission.isAssignedToAnySlot && mission.isRegisteredForAnySlot" :content="$t('mission.list.slot.status.registered')" :triggers="['hover']">
        <i class="fa fa-question-circle fa-lg text-muted" aria-hidden="true"></i>
      </b-popover>
      <b-popover v-if="!mission.isAssignedToAnySlot && !mission.isRegisteredForAnySlot" :content="isUserInCommunity ? $t('mission.list.slot.counts.available.popover.community', {open: mission.slotCounts.open}) : $t('mission.list.slot.counts.available.popover', {open: mission.slotCounts.open})" :triggers="['hover']">
        {{ mission.slotCounts.open }}
      </b-popover>
    </td>
    <td class="text-center">
      <b-btn variant="primary" size="sm" :to="{name: 'missionDetails', params: {missionSlug: mission.slug}}">
        <i class="fa fa-info" aria-hidden="true"></i> {{ $t('button.details') }}
      </b-btn>
    </td>
  </tr>
</template>

<script>
import * as _ from 'lodash'

export default {
  props: [
    'mission'
  ],
  computed: {
    isMissionEditor() {
      return this.$acl.can([`mission.${this.mission.slug}.creator`, `mission.${this.mission.slug}.editor`], false, true)
    },
    isUserInCommunity() {
      const user = this.$store.getters.user
      if (_.isNil(user)) {
        return false
      }

      return !_.isNil(user.community)
    }
  }
}
</script><commit_msg>Fixed mission editor permission check in mission list formatting<commit_after><template>
  <tr>
    <td>{{ formatDateTime(mission.startTime) }}</td>
    <td :class="{'text-primary': isMissionEditor}">
      <b-popover v-if="isMissionEditor" :content="$t('mission.list.isMissionEditor')" :triggers="['hover']">
        {{ mission.title }}
      </b-popover>
      <span v-else>{{ mission.title }}</span>
      </td>
    <td>
      <router-link :to="{name: 'userDetails', params: {userUid: mission.creator.uid}}">{{ formatUserWithTag(mission.creator) }}</router-link>
    </td>
    <td class="text-center">
      <b-popover :content="$t('mission.list.slot.counts.popover', mission.slotCounts)" :triggers="['hover']">
        {{ mission.slotCounts.assigned + mission.slotCounts.unassigned }}/{{ mission.slotCounts.total }}
      </b-popover>
    </td>
    <td class="text-center">
      <b-popover v-if="mission.isAssignedToAnySlot" :content="$t('mission.list.slot.status.assigned')" :triggers="['hover']">
        <i class="fa fa-check fa-lg text-success" aria-hidden="true"></i>
      </b-popover>
      <b-popover v-if="!mission.isAssignedToAnySlot && mission.isRegisteredForAnySlot" :content="$t('mission.list.slot.status.registered')" :triggers="['hover']">
        <i class="fa fa-question-circle fa-lg text-muted" aria-hidden="true"></i>
      </b-popover>
      <b-popover v-if="!mission.isAssignedToAnySlot && !mission.isRegisteredForAnySlot" :content="isUserInCommunity ? $t('mission.list.slot.counts.available.popover.community', {open: mission.slotCounts.open}) : $t('mission.list.slot.counts.available.popover', {open: mission.slotCounts.open})" :triggers="['hover']">
        {{ mission.slotCounts.open }}
      </b-popover>
    </td>
    <td class="text-center">
      <b-btn variant="primary" size="sm" :to="{name: 'missionDetails', params: {missionSlug: mission.slug}}">
        <i class="fa fa-info" aria-hidden="true"></i> {{ $t('button.details') }}
      </b-btn>
    </td>
  </tr>
</template>

<script>
import * as _ from 'lodash'

export default {
  props: [
    'mission'
  ],
  computed: {
    isMissionEditor() {
      return this.$acl.can([`mission.${this.mission.slug}.creator`, `mission.${this.mission.slug}.editor`], false, false)
    },
    isUserInCommunity() {
      const user = this.$store.getters.user
      if (_.isNil(user)) {
        return false
      }

      return !_.isNil(user.community)
    }
  }
}
</script>
{'fraction_non_alphanumeric': 0.20173267326732675, 'fraction_numerical': 0.0, 'mean_word_length': 3.570216776625825, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, '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': '6949129', 'n_tokens_mistral': 1687, 'n_tokens_neox': 1671, 'n_words': 257}