This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/components/tasks/partials/priorityLabel.vue

64 lines
1.5 KiB
Vue
Raw Normal View History

2019-11-24 13:16:24 +00:00
<template>
<span
2024-02-07 11:18:19 +00:00
v-if="!done && (showAll || priority >= priorities.HIGH)"
:class="{'not-so-high': priority === priorities.HIGH, 'high-priority': priority >= priorities.HIGH}"
class="priority-label"
2024-02-07 11:18:19 +00:00
>
<span
v-if="priority >= priorities.HIGH"
class="icon"
>
<icon icon="exclamation" />
2019-11-24 13:16:24 +00:00
</span>
<span>
<template v-if="priority === priorities.UNSET">{{ $t('task.priority.unset') }}</template>
<template v-if="priority === priorities.LOW">{{ $t('task.priority.low') }}</template>
<template v-if="priority === priorities.MEDIUM">{{ $t('task.priority.medium') }}</template>
<template v-if="priority === priorities.HIGH">{{ $t('task.priority.high') }}</template>
<template v-if="priority === priorities.URGENT">{{ $t('task.priority.urgent') }}</template>
<template v-if="priority === priorities.DO_NOW">{{ $t('task.priority.doNow') }}</template>
</span>
2024-02-07 11:18:19 +00:00
<span
v-if="priority === priorities.DO_NOW"
class="icon pr-0"
>
<icon icon="exclamation" />
2019-11-24 13:16:24 +00:00
</span>
</span>
</template>
2022-02-15 12:07:59 +00:00
<script setup lang="ts">
2022-08-13 13:26:57 +00:00
import {PRIORITIES as priorities} from '@/constants/priorities'
2022-02-15 12:07:59 +00:00
defineProps({
priority: {
default: 0,
type: Number,
},
2022-02-15 12:07:59 +00:00
showAll: {
type: Boolean,
default: false,
},
2022-02-15 12:07:59 +00:00
done: {
type: Boolean,
default: false,
},
})
2019-11-24 13:16:24 +00:00
</script>
2019-12-18 21:38:26 +00:00
<style lang="scss" scoped>
span.high-priority {
color: var(--danger);
width: auto !important; // To override the width set in tasks
2019-12-18 21:38:26 +00:00
.icon {
vertical-align: top;
width: auto !important;
padding: 0 .5rem;
}
2019-12-18 21:38:26 +00:00
&.not-so-high {
color: var(--warning);
2019-12-18 21:38:26 +00:00
}
}
2019-12-18 21:38:26 +00:00
</style>