vikunja-frontend/src/components/tasks/partials/priorityLabel.vue

66 lines
1.6 KiB
Vue
Raw Normal View History

2019-11-24 14:16:24 +01:00
<template>
<span
:class="{'not-so-high': priority === priorities.HIGH, 'high-priority': priority >= priorities.HIGH}"
class="priority-label"
v-if="showAll || priority >= priorities.HIGH">
<span class="icon" v-if="priority >= priorities.HIGH">
2019-11-24 14:16:24 +01:00
<icon icon="exclamation"/>
</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>
2019-11-24 14:16:24 +01:00
<span class="icon" v-if="priority === priorities.DO_NOW">
<icon icon="exclamation"/>
</span>
</span>
</template>
<script>
import priorites from '../../../models/priorities'
2019-11-24 14:16:24 +01:00
export default {
name: 'priorityLabel',
data() {
return {
priorities: priorites,
2019-11-24 14:16:24 +01:00
}
},
props: {
priority: {
default: 0,
type: Number,
},
showAll: {
type: Boolean,
default: false,
},
},
}
2019-11-24 14:16:24 +01:00
</script>
2019-12-18 22:38:26 +01:00
<style lang="scss" scoped>
.priority-label {
2021-01-10 21:46:41 +01:00
display: inline-flex;
align-items: center;
}
span.high-priority {
color: $red;
width: auto !important; // To override the width set in tasks
2019-12-18 22:38:26 +01:00
.icon {
vertical-align: middle;
width: auto !important;
padding: 0 .5rem;
}
2019-12-18 22:38:26 +01:00
&.not-so-high {
color: $orange;
2019-12-18 22:38:26 +01:00
}
}
2019-12-18 22:38:26 +01:00
</style>