Files
habitica/website/client/components/tasks/approvalHeader.vue
Matteo Pagliazzi a208ba4aba Tasks v2 Part 2 (#9236)
* start updating colors for tasks controls

* finish updating controls colors

* change hoevr behavior

* change transition duration

* update color with transition

* refactor menu wip

* wip

* upgrade vue deps

* fix warnings

* fix menu

* misc fixes

* more fixes

* fix badge

* fix margins in menu

* wip tooltips

* tooltips

* fix checklist colors

* add badges

* fix quick add input

* add transition to task controls too

* add batch add

* fix task filtering

* finish tasks badges

* fix menu

* upgrade deps

* fix shop items using all the same image

* fix animation

* disable client tests until we remove phantomjs

* revert changes to tasks colors

* fix opacity in task modal inputs

* remove client unit tests from travis

* wip task dropdown

* fix z-index for task footer/header

* fixes and add files

* fixes

* bigger clickable area

* more space to open task dropdown

* droddown position

* fix menu position

* make sure other dropdowns get closed correctly

* fixes

* start to fix z-index

* draggable = false for task dropdown

* fix for dropdown position

* implement move to top / bottom

* fix push to bottom

* typo

* fix drag and drop

* use standard code

* wider click area for dropdown

* unify badge look

* fix padding

* misc fixes

* more fixes

* make dropdown scrollable

* misc fixes

* fix padding for notes

* use existing code instead of new props
2017-11-02 21:07:38 +01:00

43 lines
1.1 KiB
Vue

<template lang="pug">
.claim-bottom-message.col-12.text-center(v-if='task.approvals && task.approvals.length > 0', :class="{approval: userIsAdmin}")
.task-unclaimed
| {{ message }}
</template>
<style lang="scss" scoped>
.claim-bottom-message {
z-index: 9;
}
.approval {
background: #24cc8f;
color: #fff;
}
</style>
<script>
import { mapState } from 'client/libs/store';
export default {
props: ['task', 'group'],
computed: {
...mapState({user: 'user.data'}),
message () {
let approvals = this.task.approvals;
let approvalsLength = approvals.length;
let userIsRequesting = this.task.group.approvals && this.task.group.approvals.indexOf(this.user._id) !== -1;
if (approvalsLength === 1 && !userIsRequesting) {
return `${approvals[0].userId.profile.name} requests approval`;
} else if (approvalsLength > 1 && !userIsRequesting) {
return `${approvalsLength} request approval`;
} else if (approvalsLength === 1 && userIsRequesting) {
return 'You are requesting approval';
}
},
userIsAdmin () {
return this.group.leader.id === this.user._id;
},
},
};
</script>