New client more updates (#8934)
* Added api token to page * Fixed wiki link * Added categoires * Removed extra create challenge button. Add prize model and user balance deduction * Added pending filter * Added member sort * Added confirmation for leaving * Filtered tavern * Added redirect to newly created guild * Made guild links routerlinks * Fixed wiki link and added fetch recent messages * Show backgrounds only on edit. Fixed glasses equip * Added link to register page * Added yesterdailies * Added achievement footer * Update guild badges * Added avatar to achievement avatar component * More guild crests updates * Achievement footer and avatar added * Added notification read * Removed duplicate string
1
website/client/assets/svg/bronze-guild-badge-large.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><title>Bronze_Large</title><path d="M20,36.26C8,30.71,5.67,23.8,5.51,10.23L20,3.74l14.49,6.49C34.33,23.8,32,30.71,20,36.26Z" transform="translate(-1 -1)" fill="#ea8c31"/><path d="M20,6.48l12,5.36c-0.31,11.64-2.58,17-12,21.65-9.38-4.61-11.65-10-12-21.65L20,6.48M20,1L3,8.62C3,23.85,5.07,32.47,20,39,34.93,32.47,37,23.85,37,8.62L20,1h0Z" transform="translate(-1 -1)" fill="#b36213"/><path d="M20,4.29l14,6.27c-0.2,13.64-2.66,19.87-14,25.15C8.68,30.43,6.21,24.19,6,10.55L20,4.29M20,1L3,8.62C3,23.85,5.07,32.47,20,39,34.93,32.47,37,23.85,37,8.62L20,1h0Z" transform="translate(-1 -1)" fill="#d77a20"/><path d="M20,8a2.14,2.14,0,1,0,2.14,2.14A2.14,2.14,0,0,0,20,8m0,5.72c-1.67,0-5,.83-5,2.5V18H25V16.22c0-1.67-3.33-2.5-5-2.5" transform="translate(-1 -1)" fill="#b36213" fill-rule="evenodd"/><path d="M2,27.5A7.5,7.5,0,0,1,9.5,20h21a7.5,7.5,0,1,1,0,15H9.5A7.51,7.51,0,0,1,2,27.5Z" transform="translate(-1 -1)" fill="none" fill-rule="evenodd"/><path d="M2,27.5A7.5,7.5,0,0,1,9.5,20h21a7.5,7.5,0,1,1,0,15H9.5A7.51,7.51,0,0,1,2,27.5Z" transform="translate(-1 -1)" fill="#fff" stroke="#b36213" stroke-miterlimit="10" stroke-width="2"/></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
1
website/client/assets/svg/bronze-guild-badge-small.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 38"><title>Bronze_Small</title><path d="M20,36.28C7.18,30.61,5.6,24.69,5.5,10.42L20,3.75l14.5,6.67C34.4,24.69,32.82,30.61,20,36.28Z" transform="translate(-3 -1)" fill="#ea8c31"/><path d="M20,6.5L32,12c-0.15,11.56-1.51,16.62-12,21.51C9.53,28.64,8.17,23.58,8,12L20,6.5M20,1L3,8.82C3,24.47,4.13,32.29,20,39,35.87,32.29,37,24.47,37,8.82L20,1h0Z" transform="translate(-3 -1)" fill="#b36213"/><path d="M20,4.3l14,6.44c-0.12,13.72-1.72,19.51-14,25C7.73,30.25,6.12,24.46,6,10.74L20,4.3M20,1L3,8.82C3,24.47,4.13,32.29,20,39,35.87,32.29,37,24.47,37,8.82L20,1h0Z" transform="translate(-3 -1)" fill="#d77a20"/></svg>
|
||||
|
After Width: | Height: | Size: 693 B |
|
|
@ -1,18 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="78" height="76" viewBox="0 0 78 76">
|
||||
<defs>
|
||||
<path id="a" d="M35 0L0 15.235C0 45.705 4.255 62.941 35 76c30.745-13.059 35-30.294 35-60.765L35 0z"/>
|
||||
<rect id="b" width="70" height="24" y="42" rx="12"/>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(4)">
|
||||
<use fill="#EA8C31" xlink:href="#a"/>
|
||||
<path stroke="#B36213" stroke-width="10" d="M35 5.453L5.02 18.503c.182 14.831 1.675 23.961 5.417 31.396C14.674 58.32 22.197 64.81 35 70.545 47.803 64.81 55.326 58.32 59.563 49.9c3.742-7.435 5.235-16.565 5.418-31.395l-2.445-1.065L38.473 6.965l-4.442-1.934.969.422z"/>
|
||||
<path stroke="#D77A20" stroke-width="6" d="M35 3.272L3.007 17.198c.111 15.9 1.621 25.609 5.643 33.6C13.205 59.848 21.31 66.734 35 72.733c13.691-6 21.795-12.885 26.35-21.935 4.022-7.991 5.532-17.7 5.643-33.6l-3.66-1.593L39.272 5.131l-4.85-2.111.579.252z"/>
|
||||
</g>
|
||||
<g transform="translate(4)">
|
||||
<use fill="#FFF" xlink:href="#b"/>
|
||||
<rect width="74" height="28" x="-2" y="40" stroke="#B36213" stroke-width="4" rx="14"/>
|
||||
</g>
|
||||
<path fill="#B36213" d="M31 30.667V34h16v-3.333C47 27.557 41.668 26 39 26c-2.666 0-8 1.556-8 4.667zM39.006 16A4.005 4.005 0 0 0 35 20c0 2.208 1.795 4 4.006 4A3.993 3.993 0 0 0 43 20c0-2.207-1.781-4-3.994-4"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
1
website/client/assets/svg/gold-guild-badge-large.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><title>Gold_Large</title><path d="M20,36.26C8,30.71,5.67,23.8,5.51,10.23L20,3.74l14.49,6.49C34.33,23.8,32,30.71,20,36.26Z" transform="translate(-1 -1)" fill="#fdbb5a"/><path d="M20,6.48l12,5.36c-0.31,11.64-2.58,17-12,21.65-9.38-4.61-11.65-10-12-21.65L20,6.48M20,1L3,8.62C3,23.85,5.07,32.47,20,39,34.93,32.47,37,23.85,37,8.62L20,1h0Z" transform="translate(-1 -1)" fill="#df911e"/><path d="M20,4.29l14,6.27c-0.2,13.64-2.66,19.87-14,25.15C8.68,30.43,6.21,24.19,6,10.55L20,4.29M20,1L3,8.62C3,23.85,5.07,32.47,20,39,34.93,32.47,37,23.85,37,8.62L20,1h0Z" transform="translate(-1 -1)" fill="#ffa623"/><path d="M20,8a2.14,2.14,0,1,0,2.14,2.14A2.14,2.14,0,0,0,20,8m0,5.72c-1.67,0-5,.83-5,2.5V18H25V16.22c0-1.67-3.33-2.5-5-2.5" transform="translate(-1 -1)" fill="#df911e" fill-rule="evenodd"/><path d="M2,27.5A7.5,7.5,0,0,1,9.5,20h21a7.5,7.5,0,1,1,0,15H9.5A7.51,7.51,0,0,1,2,27.5Z" transform="translate(-1 -1)" fill="none" fill-rule="evenodd"/><path d="M2,27.5A7.5,7.5,0,0,1,9.5,20h21a7.5,7.5,0,1,1,0,15H9.5A7.51,7.51,0,0,1,2,27.5Z" transform="translate(-1 -1)" fill="#fff" stroke="#df911e" stroke-miterlimit="10" stroke-width="2"/></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
1
website/client/assets/svg/gold-guild-badge-small.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 38"><title>Gold_Small</title><path d="M20,36.28C7.18,30.61,5.6,24.69,5.5,10.42L20,3.75l14.5,6.67C34.4,24.69,32.82,30.61,20,36.28Z" transform="translate(-3 -1)" fill="#fdbb5a"/><path d="M20,6.5L32,12c-0.15,11.56-1.51,16.62-12,21.51C9.53,28.64,8.17,23.58,8,12L20,6.5M20,1L3,8.82C3,24.47,4.13,32.29,20,39,35.87,32.29,37,24.47,37,8.82L20,1h0Z" transform="translate(-3 -1)" fill="#df911e"/><path d="M20,4.3l14,6.44c-0.12,13.72-1.72,19.51-14,25C7.73,30.25,6.12,24.46,6,10.74L20,4.3M20,1L3,8.82C3,24.47,4.13,32.29,20,39,35.87,32.29,37,24.47,37,8.82L20,1h0Z" transform="translate(-3 -1)" fill="#ffa623"/></svg>
|
||||
|
After Width: | Height: | Size: 691 B |
|
|
@ -1,10 +0,0 @@
|
|||
<!-- Generated by IcoMoon.io -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="33" height="32" viewBox="0 0 33 32">
|
||||
<title>gold-guild-badge</title>
|
||||
<path fill="#ffbc5a" d="M16.421 0l-14.737 6.415c0 12.829 1.792 20.087 14.737 25.585 12.945-5.499 14.737-12.755 14.737-25.585l-14.737-6.415z"></path>
|
||||
<path fill="none" stroke="#df911e" stroke-width="4.2105" stroke-miterlimit="4" stroke-linecap="butt" stroke-linejoin="miter" d="M16.013 2.118l13.032 5.673c-0.077 6.244-0.706 10.088-2.281 13.219-1.784 3.546-4.952 6.278-10.342 8.693-5.391-2.415-8.558-5.147-10.342-8.693-1.576-3.131-2.204-6.975-2.281-13.219l12.624-5.495-0.408-0.178z"></path>
|
||||
<path fill="none" stroke="#ffa623" stroke-width="2.5263" stroke-miterlimit="4" stroke-linecap="butt" stroke-linejoin="miter" d="M16.177 1.272c-76071129.935-33717654.139-128176134.231-108564304.818-128176134.231-195580731.325 0-117804502.285 95499418.059-213303920.343 213303920.343-213303920.343s213303920.343 95499418.058 213303920.343 213303920.343l-298431692.74 195580737.294c-0.047 6.695-0.683 10.783-2.376 14.147-1.918 3.811-5.331 6.71-11.095 9.236-5.765-2.526-9.177-5.425-11.095-9.236-1.693-3.365-2.329-7.453-2.376-14.147l13.471-5.864-0.244-0.106z"></path>
|
||||
<path fill="#fff" d="M6.737 17.684h19.368c2.791 0 5.053 2.262 5.053 5.053s-2.262 5.053-5.053 5.053h-19.368c-2.791 0-5.053-2.262-5.053-5.053s2.262-5.053 5.053-5.053z"></path>
|
||||
<path fill="none" stroke="#df911e" stroke-width="1.6842" stroke-miterlimit="4" stroke-linecap="butt" stroke-linejoin="miter" d="M6.737 16.842h19.368c3.256 0 5.895 2.639 5.895 5.895s-2.639 5.895-5.895 5.895h-19.368c-3.256 0-5.895-2.639-5.895-5.895s2.639-5.895 5.895-5.895z"></path>
|
||||
<path fill="#df911e" d="M13.053 12.912v1.403h6.737v-1.403c0-1.309-2.245-1.965-3.368-1.965s-3.368 0.655-3.368 1.965zM16.424 6.737c-0 0-0 0-0 0-0.931 0-1.685 0.754-1.686 1.684 0 0.93 0.756 1.684 1.687 1.684 0 0 0 0 0 0 0.929 0 1.681-0.753 1.681-1.681 0-0.001 0-0.002 0-0.003 0-0.929-0.75-1.684-1.682-1.684z"></path>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
1
website/client/assets/svg/silver-guild-badge-large.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><title>Silver_Large</title><path d="M20,36.26C8,30.71,5.67,23.8,5.51,10.23L20,3.74l14.49,6.49C34.33,23.8,32,30.71,20,36.26Z" transform="translate(-1 -1)" fill="#c2c2c2"/><path d="M20,6.48l12,5.36c-0.31,11.64-2.58,17-12,21.65-9.38-4.61-11.65-10-12-21.65L20,6.48M20,1L3,8.62C3,23.85,5.07,32.47,20,39,34.93,32.47,37,23.85,37,8.62L20,1h0Z" transform="translate(-1 -1)" fill="#8d8d8d"/><path d="M20,4.29l14,6.27c-0.2,13.64-2.66,19.87-14,25.15C8.68,30.43,6.21,24.19,6,10.55L20,4.29M20,1L3,8.62C3,23.85,5.07,32.47,20,39,34.93,32.47,37,23.85,37,8.62L20,1h0Z" transform="translate(-1 -1)" fill="#afafaf"/><path d="M20,8a2.14,2.14,0,1,0,2.14,2.14A2.14,2.14,0,0,0,20,8m0,5.72c-1.67,0-5,.83-5,2.5V18H25V16.22c0-1.67-3.33-2.5-5-2.5" transform="translate(-1 -1)" fill="#8d8d8d" fill-rule="evenodd"/><path d="M2,27.5A7.5,7.5,0,0,1,9.5,20h21a7.5,7.5,0,1,1,0,15H9.5A7.51,7.51,0,0,1,2,27.5Z" transform="translate(-1 -1)" fill="none" fill-rule="evenodd"/><path d="M2,27.5A7.5,7.5,0,0,1,9.5,20h21a7.5,7.5,0,1,1,0,15H9.5A7.51,7.51,0,0,1,2,27.5Z" transform="translate(-1 -1)" fill="#fff" stroke="#8d8d8d" stroke-miterlimit="10" stroke-width="2"/></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
1
website/client/assets/svg/silver-guild-badge-small.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 38"><title>Silver_Small</title><path d="M20,36.28C7.18,30.61,5.6,24.69,5.5,10.42L20,3.75l14.5,6.67C34.4,24.69,32.82,30.61,20,36.28Z" transform="translate(-3 -1)" fill="#c2c2c2"/><path d="M20,6.5L32,12c-0.15,11.56-1.51,16.62-12,21.51C9.53,28.64,8.17,23.58,8,12L20,6.5M20,1L3,8.82C3,24.47,4.13,32.29,20,39,35.87,32.29,37,24.47,37,8.82L20,1h0Z" transform="translate(-3 -1)" fill="#8d8d8d"/><path d="M20,4.3l14,6.44c-0.12,13.72-1.72,19.51-14,25C7.73,30.25,6.12,24.46,6,10.74L20,4.3M20,1L3,8.82C3,24.47,4.13,32.29,20,39,35.87,32.29,37,24.47,37,8.82L20,1h0Z" transform="translate(-3 -1)" fill="#afafaf"/></svg>
|
||||
|
After Width: | Height: | Size: 693 B |
|
|
@ -1,18 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="78" height="76" viewBox="0 0 78 76">
|
||||
<defs>
|
||||
<path id="a" d="M35 0L0 15.235C0 45.705 4.255 62.941 35 76c30.745-13.059 35-30.294 35-60.765L35 0z"/>
|
||||
<rect id="b" width="70" height="24" y="42" rx="12"/>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(4)">
|
||||
<use fill="#E1E0E3" xlink:href="#a"/>
|
||||
<path stroke="#A5A1AC" stroke-width="10" d="M35 5.453L5.02 18.503c.182 14.831 1.675 23.961 5.417 31.396C14.674 58.32 22.197 64.81 35 70.545 47.803 64.81 55.326 58.32 59.563 49.9c3.742-7.435 5.235-16.565 5.418-31.395l-2.445-1.065L38.473 6.965l-4.442-1.934.969.422z"/>
|
||||
<path stroke="#C3C0C7" stroke-width="6" d="M35 3.272L3.007 17.198c.111 15.9 1.621 25.609 5.643 33.6C13.205 59.848 21.31 66.734 35 72.733c13.691-6 21.795-12.885 26.35-21.935 4.022-7.991 5.532-17.7 5.643-33.6l-3.66-1.593L39.272 5.131l-4.85-2.111.579.252z"/>
|
||||
</g>
|
||||
<g transform="translate(4)">
|
||||
<use fill="#FFF" xlink:href="#b"/>
|
||||
<rect width="74" height="28" x="-2" y="40" stroke="#A5A1AC" stroke-width="4" rx="14"/>
|
||||
</g>
|
||||
<path fill="#A5A1AC" d="M31 30.667V34h16v-3.333C47 27.557 41.668 26 39 26c-2.666 0-8 1.556-8 4.667zM39.006 16A4.005 4.005 0 0 0 35 20c0 2.208 1.795 4 4.006 4A3.993 3.993 0 0 0 43 20c0-2.207-1.781-4-3.994-4"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
35
website/client/components/achievements/achievementAvatar.vue
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<template lang="pug">
|
||||
.container-fluid
|
||||
.row
|
||||
.col-4(style='padding:0')
|
||||
div(:class='achievementClass')
|
||||
.col-4(style='padding:0')
|
||||
.herobox(:style="`${margin}em`")
|
||||
.character-sprites
|
||||
//- +generatedAvatar({sleep: false})
|
||||
avatar(:member='user')
|
||||
.col-4
|
||||
div(:class='achievementClass' style='margin: 2em auto')
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'client/libs/store';
|
||||
import Avatar from '../avatar';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Avatar,
|
||||
},
|
||||
props: ['badge', 'margin'],
|
||||
data () {
|
||||
return {
|
||||
achievementClass: `achievement-${this.badge}2x`,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
user: 'user.data',
|
||||
}),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
28
website/client/components/achievements/achievementFooter.vue
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<template lang="pug">
|
||||
.modal-footer(style='margin-top:0', ng-init='loadWidgets()')
|
||||
.container-fluid
|
||||
.row.text-center
|
||||
.col-4
|
||||
a.twitter-share-button(:href='twitterLink') {{ $t('tweet') }}
|
||||
.col-4
|
||||
.fb-share-button(:data-href='achievementLink', data-layout='button')
|
||||
.col-4
|
||||
a.tumblr-share-button(:data-href='achievementLink', data-notes='none')
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// @TODO:
|
||||
let BASE_URL = 'https://habitica.com';
|
||||
|
||||
export default {
|
||||
data () {
|
||||
let tweet = this.$t('achievementShare');
|
||||
|
||||
return {
|
||||
tweet,
|
||||
achievementLink: `${BASE_URL}/social/achievement`,
|
||||
twitterLink: `https://twitter.com/intent/tweet?text=${tweet}&via=habitica&url=${BASE_URL}/social/achievement&count=none`,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,14 +1,15 @@
|
|||
<template lang="pug">
|
||||
b-modal#testing(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
b-modal#contributor(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
.modal-content(style='min-width:28em')
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom:0') {{ $t('modalContribAchievement') }}
|
||||
// @TODO: +achievementAvatar('boot',0)
|
||||
achievement-avatar
|
||||
| {{ $t('contribModal', {name: user.profile.name, level: user.contributor.level}) }}
|
||||
a(:href="$t('conRewardsURL')", target='_blank') {{ $t('contribLink') }}
|
||||
br
|
||||
button.btn.btn-primary(style='margin-top:1em' @click='close()') {{ $t('huzzah') }}
|
||||
// @TODO: +achievementFooter
|
||||
achievement-footer
|
||||
</template>
|
||||
|
||||
<style scope>
|
||||
|
|
@ -19,19 +20,23 @@
|
|||
|
||||
<script>
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import achievementFooter from './achievementFooter';
|
||||
import achievementAvatar from './achievementAvatar';
|
||||
|
||||
import { mapState } from 'client/libs/store';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
bModal,
|
||||
achievementFooter,
|
||||
achievementAvatar,
|
||||
},
|
||||
computed: {
|
||||
...mapState({user: 'user.data'}),
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$root.$emit('hide::modal', 'testing');
|
||||
this.$root.$emit('hide::modal', 'contributor');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
<template lang="pug">
|
||||
b-modal#testing(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
b-modal#invite-friend(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
.modal-content(style='min-width:28em')
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom:0') {{ $t('modalAchievement') }}
|
||||
// @TODO: +achievementAvatar('friends',0)
|
||||
achievement-avatar
|
||||
p {{ $t('invitedFriendText') }}
|
||||
br
|
||||
button.btn.btn-primary(@click='close()') {{ $t('huzzah') }}
|
||||
// @TODO: +achievementFooter
|
||||
achievement-footer
|
||||
</template>
|
||||
|
||||
<style scope>
|
||||
|
|
@ -18,14 +19,18 @@
|
|||
|
||||
<script>
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import achievementFooter from './achievementFooter';
|
||||
import achievementAvatar from './achievementAvatar';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
bModal,
|
||||
achievementFooter,
|
||||
achievementAvatar,
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$root.$emit('hide::modal', 'testing');
|
||||
this.$root.$emit('hide::modal', 'invite-friend');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
<template lang="pug">
|
||||
b-modal#testing(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
b-modal#join-challenge(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
.modal-content(style='min-width:28em')
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom:0') {{ $t('modalAchievement') }}
|
||||
// @TODO: +achievementAvatar('challenge',0)
|
||||
achievement-avatar
|
||||
p {{ $t('joinedChallengeText') }}
|
||||
br
|
||||
button.btn.btn-primary(@click='close()') {{ $t('huzzah') }}
|
||||
// @TODO: +achievementFooter
|
||||
achievement-footer
|
||||
</template>
|
||||
|
||||
<style scope>
|
||||
|
|
@ -18,14 +19,18 @@
|
|||
|
||||
<script>
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import achievementFooter from './achievementFooter';
|
||||
import achievementAvatar from './achievementAvatar';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
bModal,
|
||||
achievementFooter,
|
||||
achievementAvatar,
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$root.$emit('hide::modal', 'testing');
|
||||
this.$root.$emit('hide::modal', 'join-challenge');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<template lang="pug">
|
||||
b-modal#testing(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
.modal-content(style='min-width:28em')
|
||||
b-modal#joined-guild(:title="$t('modalAchievement')", size='lg', :hide-footer="true")
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom:0') {{ $t('modalAchievement') }}
|
||||
// @TODO: +achievementAvatar('guild',0)
|
||||
achievement-avatar
|
||||
p {{ $t('joinedGuildText') }}
|
||||
br
|
||||
button.btn.btn-primary(@click='close()') {{ $t('huzzah') }}
|
||||
// @TODO: +achievementFooter
|
||||
achievement-footer
|
||||
</template>
|
||||
|
||||
<style scope>
|
||||
|
|
@ -18,14 +18,18 @@
|
|||
|
||||
<script>
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import achievementFooter from './achievementFooter';
|
||||
import achievementAvatar from './achievementAvatar';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
bModal,
|
||||
achievementFooter,
|
||||
achievementAvatar,
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$root.$emit('hide::modal', 'testing');
|
||||
this.$root.$emit('hide::modal', 'joined-guild');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
<template lang="pug">
|
||||
b-modal#testing(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
b-modal#rebirth(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
.modal-content(style='min-width:28em')
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom:0') {{ $t('modalAchievement') }}
|
||||
// @TODO: +achievementAvatar('sun',0)
|
||||
achievement-avatar
|
||||
div(ng-if='user.achievements.rebirthLevel < 100')
|
||||
| {{ $t('rebirthAchievement', {number: user.achievements.rebirths, level: user.achievements.rebirthLevel}) }}
|
||||
div(ng-if='user.achievements.rebirthLevel >= 100')
|
||||
| {{ $t('rebirthAchievement100', {number: user.achievements.rebirths}) }}
|
||||
br
|
||||
button.btn.btn-primary(@click='close()') {{ $t('huzzah') }}
|
||||
// @TODO: +achievementFooter
|
||||
achievement-footer
|
||||
</template>
|
||||
|
||||
<style scope>
|
||||
|
|
@ -21,19 +22,23 @@
|
|||
|
||||
<script>
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import achievementFooter from './achievementFooter';
|
||||
import achievementAvatar from './achievementAvatar';
|
||||
|
||||
import { mapState } from 'client/libs/store';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
bModal,
|
||||
achievementFooter,
|
||||
achievementAvatar,
|
||||
},
|
||||
computed: {
|
||||
...mapState({user: 'user.data'}),
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$root.$emit('hide::modal', 'testing');
|
||||
this.$root.$emit('hide::modal', 'rebirth');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<template lang="pug">
|
||||
b-modal#testing(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
b-modal#streak(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
.modal-content(style='min-width:28em')
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom: 0') {{ $t('streakAchievement') }}
|
||||
// @TODO: +achievementAvatar('thermometer',2.5)
|
||||
achievement-avatar
|
||||
h4(ng-if='user.achievements.streak === 1') {{ $t('firstStreakAchievement') }}
|
||||
h4(ng-if='user.achievements.streak > 1') {{ $t('streakAchievementCount', {streaks: user.achievements.streak}) }}
|
||||
p {{ $t('twentyOneDays') }}
|
||||
|
|
@ -13,7 +14,7 @@
|
|||
.checkbox
|
||||
label(style='display:inline-block') {{ $t('dontShowAgain') }}
|
||||
input(type='checkbox', ng-model='user.preferences.suppressModals.streak', ng-change='set({"preferences.suppressModals.streak": user.preferences.suppressModals.streak?true: false})')
|
||||
// @TOOD: +achievementFooter
|
||||
achievement-footer
|
||||
</template>
|
||||
|
||||
<style scope>
|
||||
|
|
@ -24,19 +25,23 @@
|
|||
|
||||
<script>
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import achievementFooter from './achievementFooter';
|
||||
import achievementAvatar from './achievementAvatar';
|
||||
|
||||
import { mapState } from 'client/libs/store';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
bModal,
|
||||
achievementFooter,
|
||||
achievementAvatar,
|
||||
},
|
||||
computed: {
|
||||
...mapState({user: 'user.data'}),
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$root.$emit('hide::modal', 'testing');
|
||||
this.$root.$emit('hide::modal', 'streak');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<template lang="pug">
|
||||
b-modal#testing(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
b-modal#ultimate-gear(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
.modal-content(style='min-width:28em')
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom:0') {{ $t('modalAchievement') }}
|
||||
// @TODO: +achievementAvatar('armor',2.5)
|
||||
achievement-avatar
|
||||
p {{ $t('gearAchievement') }}
|
||||
br
|
||||
table.multi-achievement
|
||||
|
|
@ -28,7 +29,7 @@
|
|||
p {{ $t("armoireUnlocked") }}
|
||||
br
|
||||
button.btn.btn-primary(@click='close()') {{ $t('huzzah') }}
|
||||
// @TODO: +achievementFooter
|
||||
achievement-footer
|
||||
</template>
|
||||
|
||||
<style scope>
|
||||
|
|
@ -39,14 +40,18 @@
|
|||
|
||||
<script>
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import achievementFooter from './achievementFooter';
|
||||
import achievementAvatar from './achievementAvatar';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
bModal,
|
||||
achievementFooter,
|
||||
achievementAvatar,
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$root.$emit('hide::modal', 'testing');
|
||||
this.$root.$emit('hide::modal', 'ultimate-gear');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
<template lang="pug">
|
||||
b-modal#testing(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
b-modal#won-challenge(:title="$t('guildReminderTitle')", size='lg', :hide-footer="true")
|
||||
.modal-content(style='min-width:28em')
|
||||
.modal-body.text-center
|
||||
h3(style='margin-bottom: 0') {{ $t('wonChallenge') }}
|
||||
h4(v-markdown='user.achievements.challenges[user.achievements.challenges.length - 1]')
|
||||
.container-fluid
|
||||
.row(style='margin-bottom:1em')
|
||||
.col-xs-4(style='padding:0')
|
||||
.col-4(style='padding:0')
|
||||
.container-fluid
|
||||
.row
|
||||
.col-xs-4(style='padding:0')
|
||||
.col-xs-4(style='padding:0')
|
||||
.col-4(style='padding:0')
|
||||
.col-4(style='padding:0')
|
||||
.achievement-karaoke-2x(style='margin-top: 2em')
|
||||
.col-xs-4(style='padding:0')
|
||||
.col-4(style='padding:0')
|
||||
.herobox(style='padding:0; width:0; height:7em')
|
||||
.character-sprites(style='width:0')
|
||||
// @TODO: +generatedAvatar({sleep: false})
|
||||
.col-xs-4(style='padding:0')
|
||||
avatar(:member='user')
|
||||
.col-4(style='padding:0')
|
||||
.container-fluid
|
||||
.row
|
||||
.col-xs-4(style='padding:0')
|
||||
.col-xs-4(style='padding:0')
|
||||
.col-4(style='padding:0')
|
||||
.col-4(style='padding:0')
|
||||
.achievement-karaoke-2x(style='margin-top: 2em')
|
||||
p {{ $t('congratulations') }}
|
||||
br
|
||||
|
|
@ -28,11 +29,11 @@
|
|||
.modal-footer(style='margin-top:0', ng-init='loadWidgets()')
|
||||
.container-fluid
|
||||
.row
|
||||
.col-xs-3
|
||||
.col-3
|
||||
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/won-challenge&count=none') {{ $t('tweet') }}
|
||||
.col-xs-4(style='margin-left:.8em')
|
||||
.col-4(style='margin-left:.8em')
|
||||
.fb-share-button(data-href='#{env.BASE_URL}/social/won-challenge', data-layout='button')
|
||||
.col-xs-4(style='margin-left:.8em')
|
||||
.col-4(style='margin-left:.8em')
|
||||
a.tumblr-share-button(data-href='#{env.BASE_URL}/social/won-challenge', data-notes='none')
|
||||
</template>
|
||||
|
||||
|
|
@ -46,10 +47,12 @@
|
|||
import { mapState } from 'client/libs/store';
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import markdownDirective from 'client/directives/markdown';
|
||||
import Avatar from '../avatar';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
bModal,
|
||||
Avatar,
|
||||
},
|
||||
directives: {
|
||||
markdown: markdownDirective,
|
||||
|
|
@ -65,7 +68,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.$root.$emit('hide::modal', 'testing');
|
||||
this.$root.$emit('hide::modal', 'won-challenge');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template lang="pug">
|
||||
#app-header.row
|
||||
create-party-modal
|
||||
members-modal(v-if="user.party._id", :group='user.party', :hide-badge="true")
|
||||
members-modal(:group='user.party', :hide-badge="true")
|
||||
member-details(:member="user", @click="$router.push({name: 'avatar'})")
|
||||
.view-party(v-if="user.party && user.party._id")
|
||||
// TODO button should open the party members modal
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ div
|
|||
router-link.dropdown-item(to="/groups/guild/5481ccf3-5d2d-48a9-a871-70a7380cee5a") {{ $t('askAQuestion') }}
|
||||
a.dropdown-item(href="https://trello.com/c/odmhIqyW/440-read-first-table-of-contents", target='_blank') {{ $t('requestAF') }}
|
||||
a.dropdown-item(href="http://habitica.wikia.com/wiki/Contributing_to_Habitica", target='_blank') {{ $t('contributing') }}
|
||||
a.dropdown-item(href="http://habitica.wikia.com/wiki", target='_blank') {{ $t('wiki') }}
|
||||
a.dropdown-item(href="http://habitica.wikia.com/wiki/Habitica_Wiki", target='_blank') {{ $t('wiki') }}
|
||||
.item-with-icon
|
||||
.svg-icon(v-html="icons.gem")
|
||||
span {{userGems | roundBigNumber}}
|
||||
|
|
|
|||
|
|
@ -45,48 +45,48 @@
|
|||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '~client/assets/scss/colors.scss';
|
||||
@import '~client/assets/scss/colors.scss';
|
||||
|
||||
.avatar {
|
||||
width: 140px;
|
||||
height: 147px;
|
||||
image-rendering: pixelated;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.character-sprites {
|
||||
margin: 0 auto;
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.character-sprites span {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.current-pet {
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.class-badge {
|
||||
$badge-size: 32px;
|
||||
position: absolute;
|
||||
left: calc(50% - (16px));
|
||||
bottom: -($badge-size / 2);
|
||||
|
||||
width: $badge-size;
|
||||
height: $badge-size;
|
||||
background: $white;
|
||||
box-shadow: 0 2px 2px 0 rgba($black, 0.16), 0 1px 4px 0 rgba($black, 0.12);
|
||||
border-radius: 100px;
|
||||
|
||||
.svg-icon {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
.avatar {
|
||||
width: 140px;
|
||||
height: 147px;
|
||||
image-rendering: pixelated;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.character-sprites {
|
||||
margin: 0 auto;
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.character-sprites span {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.current-pet {
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.class-badge {
|
||||
$badge-size: 32px;
|
||||
position: absolute;
|
||||
left: calc(50% - (16px));
|
||||
bottom: -($badge-size / 2);
|
||||
|
||||
width: $badge-size;
|
||||
height: $badge-size;
|
||||
background: $white;
|
||||
box-shadow: 0 2px 2px 0 rgba($black, 0.16), 0 1px 4px 0 rgba($black, 0.12);
|
||||
border-radius: 100px;
|
||||
|
||||
.svg-icon {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
.form-group
|
||||
label
|
||||
strong(v-once) {{$t('prize')}}
|
||||
input(type='number', min='1', :max='maxPrize')
|
||||
input(type='number', min='1', :max='maxPrize', v-model="workingChallenge.prize")
|
||||
.row.footer-wrap
|
||||
.col-12.text-center.submit-button-wrapper
|
||||
.alert.alert-warning(v-if='insufficientGemsForTavernChallenge')
|
||||
|
|
@ -136,99 +136,59 @@ export default {
|
|||
data () {
|
||||
let categoryOptions = [
|
||||
{
|
||||
label: 'Habitica Official',
|
||||
label: 'habitica_official',
|
||||
key: 'habitica_official',
|
||||
},
|
||||
{
|
||||
label: 'Academic',
|
||||
key: 'academic',
|
||||
label: 'academics',
|
||||
key: 'academics',
|
||||
},
|
||||
{
|
||||
label: 'Accountability',
|
||||
key: 'accountability',
|
||||
},
|
||||
{
|
||||
label: 'Advocacy & Causes',
|
||||
label: 'advocacy_causes',
|
||||
key: 'advocacy_causes',
|
||||
},
|
||||
{
|
||||
label: 'animals',
|
||||
key: 'animals',
|
||||
},
|
||||
{
|
||||
label: 'Creativity',
|
||||
label: 'creativity',
|
||||
key: 'creativity',
|
||||
},
|
||||
{
|
||||
label: 'Entertainment & Fandom',
|
||||
key: 'entertainment_fandom',
|
||||
label: 'entertainment',
|
||||
key: 'entertainment',
|
||||
},
|
||||
{
|
||||
label: 'Finance',
|
||||
label: 'finance',
|
||||
key: 'finance',
|
||||
},
|
||||
{
|
||||
label: 'Food & Cooking',
|
||||
key: 'food_cooking',
|
||||
},
|
||||
{
|
||||
label: 'Games & Gaming',
|
||||
key: 'games_gaming',
|
||||
},
|
||||
{
|
||||
label: 'Health + Fitness',
|
||||
label: 'health_fitness',
|
||||
key: 'health_fitness',
|
||||
},
|
||||
{
|
||||
label: 'Hobbies',
|
||||
key: 'hobbies',
|
||||
label: 'hobbies_occupations',
|
||||
key: 'hobbies_occupations',
|
||||
},
|
||||
{
|
||||
label: 'Language & Literature',
|
||||
key: 'language_literature',
|
||||
},
|
||||
{
|
||||
label: 'Location-based',
|
||||
label: 'location_based',
|
||||
key: 'location_based',
|
||||
},
|
||||
{
|
||||
label: 'Mental Health',
|
||||
label: 'mental_health',
|
||||
key: 'mental_health ',
|
||||
},
|
||||
{
|
||||
label: 'Occupations',
|
||||
key: 'occupations ',
|
||||
},
|
||||
{
|
||||
label: 'Online Communities',
|
||||
key: 'online_communities ',
|
||||
},
|
||||
{
|
||||
label: 'Getting Organized',
|
||||
label: 'getting_organized',
|
||||
key: 'getting_organized ',
|
||||
},
|
||||
{
|
||||
label: 'Recovery',
|
||||
key: 'recovery ',
|
||||
},
|
||||
{
|
||||
label: 'Role-Play',
|
||||
key: 'role_play ',
|
||||
},
|
||||
{
|
||||
label: 'Self-Care',
|
||||
key: 'self_care ',
|
||||
},
|
||||
{
|
||||
label: 'Self-Improvement',
|
||||
label: 'self_improvement',
|
||||
key: 'self_improvement ',
|
||||
},
|
||||
{
|
||||
label: 'Spirituality',
|
||||
label: 'spirituality',
|
||||
key: 'spirituality ',
|
||||
},
|
||||
{
|
||||
label: 'Time-Management',
|
||||
label: 'time_management',
|
||||
key: 'time_management',
|
||||
},
|
||||
];
|
||||
|
|
@ -330,6 +290,9 @@ export default {
|
|||
this.workingChallenge.timestamp = new Date().getTime();
|
||||
|
||||
let challenge = await this.$store.dispatch('challenges:createChallenge', {challenge: this.workingChallenge});
|
||||
// @TODO: When to remove from guild instead?
|
||||
this.user.balance -= this.workingChallenge.prize / 4;
|
||||
|
||||
this.$emit('createChallenge', challenge);
|
||||
this.ressetWorkingChallenge();
|
||||
this.$root.$emit('hide::modal', 'challenge-modal');
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ div
|
|||
.svg-icon.challenge-icon(v-html="icons.challengeIcon")
|
||||
h4(v-once) {{ $t('haveNoChallenges') }}
|
||||
p(v-once) {{ $t('challengeDescription') }}
|
||||
button.btn.btn-secondary(v-once, @click='createChallenge()') {{ $t('createChallenge') }}
|
||||
router-link.title(:to="{ name: 'challenge', params: { challengeId: challenge._id } }", v-for='challenge in challenges',:key='challenge._id')
|
||||
.col-12.challenge-item
|
||||
.row
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export default {
|
|||
],
|
||||
search: '',
|
||||
filters: {
|
||||
roles: ['member'], // This is required for my challenges
|
||||
roles: ['participating'], // This is required for my challenges
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
@ -129,6 +129,10 @@ export default {
|
|||
let search = this.search;
|
||||
let filters = this.filters;
|
||||
let user = this.$store.state.user.data;
|
||||
|
||||
// Always filter by member on this page:
|
||||
filters.roles = ['participating'];
|
||||
|
||||
// @TODO: Move this to the server
|
||||
return this.challenges.filter((challenge) => {
|
||||
return this.filterChallenge(challenge, filters, search, user);
|
||||
|
|
|
|||
|
|
@ -46,99 +46,59 @@ export default {
|
|||
categoryFilters: [],
|
||||
categoryOptions: [
|
||||
{
|
||||
label: 'Habitica Official',
|
||||
label: 'habitica_official',
|
||||
key: 'habitica_official',
|
||||
},
|
||||
{
|
||||
label: 'Academic',
|
||||
key: 'academic',
|
||||
label: 'academics',
|
||||
key: 'academics',
|
||||
},
|
||||
{
|
||||
label: 'Accountability',
|
||||
key: 'accountability',
|
||||
},
|
||||
{
|
||||
label: 'Advocacy & Causes',
|
||||
label: 'advocacy_causes',
|
||||
key: 'advocacy_causes',
|
||||
},
|
||||
{
|
||||
label: 'animals',
|
||||
key: 'animals',
|
||||
},
|
||||
{
|
||||
label: 'Creativity',
|
||||
label: 'creativity',
|
||||
key: 'creativity',
|
||||
},
|
||||
{
|
||||
label: 'Entertainment & Fandom',
|
||||
key: 'entertainment_fandom',
|
||||
label: 'entertainment',
|
||||
key: 'entertainment',
|
||||
},
|
||||
{
|
||||
label: 'Finance',
|
||||
label: 'finance',
|
||||
key: 'finance',
|
||||
},
|
||||
{
|
||||
label: 'Food & Cooking',
|
||||
key: 'food_cooking',
|
||||
},
|
||||
{
|
||||
label: 'Games & Gaming',
|
||||
key: 'games_gaming',
|
||||
},
|
||||
{
|
||||
label: 'Health + Fitness',
|
||||
label: 'health_fitness',
|
||||
key: 'health_fitness',
|
||||
},
|
||||
{
|
||||
label: 'Hobbies',
|
||||
key: 'hobbies',
|
||||
label: 'hobbies_occupations',
|
||||
key: 'hobbies_occupations',
|
||||
},
|
||||
{
|
||||
label: 'Language & Literature',
|
||||
key: 'language_literature',
|
||||
},
|
||||
{
|
||||
label: 'Location-based',
|
||||
label: 'location_based',
|
||||
key: 'location_based',
|
||||
},
|
||||
{
|
||||
label: 'Mental Health',
|
||||
label: 'mental_health',
|
||||
key: 'mental_health ',
|
||||
},
|
||||
{
|
||||
label: 'Occupations',
|
||||
key: 'occupations ',
|
||||
},
|
||||
{
|
||||
label: 'Online Communities',
|
||||
key: 'online_communities ',
|
||||
},
|
||||
{
|
||||
label: 'Getting Organized',
|
||||
label: 'getting_organized',
|
||||
key: 'getting_organized ',
|
||||
},
|
||||
{
|
||||
label: 'Recovery',
|
||||
key: 'recovery ',
|
||||
},
|
||||
{
|
||||
label: 'Role-Play',
|
||||
key: 'role_play ',
|
||||
},
|
||||
{
|
||||
label: 'Self-Care',
|
||||
key: 'self_care ',
|
||||
},
|
||||
{
|
||||
label: 'Self-Improvement',
|
||||
label: 'self_improvement',
|
||||
key: 'self_improvement ',
|
||||
},
|
||||
{
|
||||
label: 'Spirituality',
|
||||
label: 'spirituality',
|
||||
key: 'spirituality ',
|
||||
},
|
||||
{
|
||||
label: 'Time-Management',
|
||||
label: 'time_management',
|
||||
key: 'time_management',
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ b-modal#avatar-modal(title="", size='md', :hide-header='true', :hide-footer='tru
|
|||
.menu-item(@click='changeTopPage("extra", "glasses")')
|
||||
.svg-icon(v-html='icons.accessoriesIcon')
|
||||
strong(v-once) {{$t('extra')}}
|
||||
.col-3
|
||||
.col-3(v-if='editing')
|
||||
.menu-item(@click='changeTopPage("backgrounds", "2017")')
|
||||
.svg-icon(v-html='icons.backgroundsIcon')
|
||||
strong(v-once) {{$t('backgrounds')}}
|
||||
|
|
@ -515,7 +515,8 @@ export default {
|
|||
this.$store.dispatch('user:set', settings);
|
||||
},
|
||||
equip (key) {
|
||||
this.$store.dispatch('common:equip', {key, type: 'costume'});
|
||||
this.$store.dispatch('common:equip', {key, type: 'equipped'});
|
||||
this.user.items.gear.equipped[key] = !this.user.items.gear.equipped[key];
|
||||
},
|
||||
done () {
|
||||
this.$root.$emit('hide::modal', 'avatar-modal');
|
||||
|
|
|
|||
|
|
@ -191,48 +191,60 @@ export default {
|
|||
},
|
||||
categoryOptions: [
|
||||
{
|
||||
label: 'animals',
|
||||
key: 'animals',
|
||||
label: 'habitica_official',
|
||||
key: 'habitica_official',
|
||||
},
|
||||
{
|
||||
label: 'artDesign',
|
||||
key: 'art_design',
|
||||
label: 'academics',
|
||||
key: 'academics',
|
||||
},
|
||||
{
|
||||
label: 'booksWriting',
|
||||
key: 'books_writing',
|
||||
label: 'advocacy_causes',
|
||||
key: 'advocacy_causes',
|
||||
},
|
||||
{
|
||||
label: 'comicsHobbies',
|
||||
key: 'comics_hobbies',
|
||||
label: 'creativity',
|
||||
key: 'creativity',
|
||||
},
|
||||
{
|
||||
label: 'diyCrafts',
|
||||
key: 'diy_crafts',
|
||||
label: 'entertainment',
|
||||
key: 'entertainment',
|
||||
},
|
||||
{
|
||||
label: 'education',
|
||||
key: 'education',
|
||||
label: 'finance',
|
||||
key: 'finance',
|
||||
},
|
||||
{
|
||||
label: 'foodCooking',
|
||||
key: 'food_cooking',
|
||||
},
|
||||
{
|
||||
label: 'healthFitness',
|
||||
label: 'health_fitness',
|
||||
key: 'health_fitness',
|
||||
},
|
||||
{
|
||||
label: 'music',
|
||||
key: 'music',
|
||||
label: 'hobbies_occupations',
|
||||
key: 'hobbies_occupations',
|
||||
},
|
||||
{
|
||||
label: 'relationship',
|
||||
key: 'relationship',
|
||||
label: 'location_based',
|
||||
key: 'location_based',
|
||||
},
|
||||
{
|
||||
label: 'scienceTech',
|
||||
key: 'science_tech ',
|
||||
label: 'mental_health',
|
||||
key: 'mental_health ',
|
||||
},
|
||||
{
|
||||
label: 'organization',
|
||||
key: 'organization ',
|
||||
},
|
||||
{
|
||||
label: 'Recovery + Support Groups',
|
||||
key: 'recovery_support_groups ',
|
||||
},
|
||||
{
|
||||
label: 'spirituality',
|
||||
key: 'spirituality ',
|
||||
},
|
||||
{
|
||||
label: 'time_management',
|
||||
key: 'time_management',
|
||||
},
|
||||
],
|
||||
showCategorySelect: false,
|
||||
|
|
@ -341,13 +353,15 @@ export default {
|
|||
};
|
||||
}
|
||||
|
||||
let newgroup;
|
||||
|
||||
if (this.workingGuild.id) {
|
||||
await this.$store.dispatch('guilds:update', {group: this.workingGuild});
|
||||
// @TODO: this doesn't work because of the async resource
|
||||
// if (updatedGroup.type === 'party') this.$store.state.party = {data: updatedGroup};
|
||||
} else {
|
||||
await this.$store.dispatch('guilds:create', {group: this.workingGuild});
|
||||
this.$store.state.user.balance -= 1;
|
||||
newgroup = await this.$store.dispatch('guilds:create', {group: this.workingGuild});
|
||||
this.$store.state.user.data.balance -= 1;
|
||||
}
|
||||
|
||||
this.$store.state.editingGroup = {};
|
||||
|
|
@ -364,6 +378,9 @@ export default {
|
|||
allowGuildInvationsFromNonMembers: true,
|
||||
};
|
||||
|
||||
if (newgroup && newgroup._id) {
|
||||
this.$router.push(`/groups/guild/${newgroup._id}`);
|
||||
}
|
||||
this.$root.$emit('hide::modal', 'guild-form');
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -13,13 +13,15 @@
|
|||
.row.icon-row
|
||||
.col-4.offset-4(v-bind:class="{ 'offset-8': isParty }")
|
||||
.item-with-icon(@click="showMemberModal()")
|
||||
.svg-icon.shield(v-html="icons.goldGuildBadgeIcon")
|
||||
.svg-icon.shield(v-html="icons.goldGuildBadgeIcon", v-if='group.memberCount > 1000')
|
||||
.svg-icon.shield(v-html="icons.silverGuildBadgeIcon", v-if='group.memberCount > 100 && group.memberCount < 999')
|
||||
.svg-icon.shield(v-html="icons.bronzeGuildBadgeIcon", v-if='group.memberCount < 100')
|
||||
span.number {{group.memberCount}}
|
||||
div(v-once) {{ $t('members') }}
|
||||
.col-4(v-if='!isParty')
|
||||
.item-with-icon
|
||||
.svg-icon.gem(v-html="icons.gem")
|
||||
span.number {{group.balance}}
|
||||
span.number {{group.balance * 4}}
|
||||
div(v-once) {{ $t('guildBank') }}
|
||||
.row.chat-row
|
||||
.col-12
|
||||
|
|
@ -41,7 +43,7 @@
|
|||
.button-container
|
||||
button.btn.btn-primary(b-btn, @click="updateGuild", v-once, v-if='isLeader') {{ $t('edit') }}
|
||||
.button-container
|
||||
button.btn.btn-success(class='btn-success', v-if='!isMember') {{ $t('join') }}
|
||||
button.btn.btn-success(class='btn-success', v-if='!isMember', @click='join()') {{ $t('join') }}
|
||||
.button-container
|
||||
button.btn.btn-primary(v-once, @click='showInviteModal()') {{$t('invite')}}
|
||||
.button-container
|
||||
|
|
@ -392,7 +394,9 @@ import informationIcon from 'assets/svg/information.svg';
|
|||
import questBackground from 'assets/svg/quest-background-border.svg';
|
||||
import upIcon from 'assets/svg/up.svg';
|
||||
import downIcon from 'assets/svg/down.svg';
|
||||
import goldGuildBadgeIcon from 'assets/svg/gold-guild-badge.svg';
|
||||
import goldGuildBadgeIcon from 'assets/svg/gold-guild-badge-small.svg';
|
||||
import silverGuildBadgeIcon from 'assets/svg/silver-guild-badge-small.svg';
|
||||
import bronzeGuildBadgeIcon from 'assets/svg/bronze-guild-badge-small.svg';
|
||||
|
||||
export default {
|
||||
mixins: [groupUtilities, styleHelper],
|
||||
|
|
@ -429,6 +433,8 @@ export default {
|
|||
upIcon,
|
||||
downIcon,
|
||||
goldGuildBadgeIcon,
|
||||
silverGuildBadgeIcon,
|
||||
bronzeGuildBadgeIcon,
|
||||
}),
|
||||
selectedQuest: {},
|
||||
sections: {
|
||||
|
|
@ -625,22 +631,18 @@ export default {
|
|||
// Achievement.displayAchievement('partyOn');
|
||||
}
|
||||
},
|
||||
// @TODO: This should be moved to notifications component
|
||||
async join () {
|
||||
if (this.group.cancelledPlan && !confirm(this.$t('aboutToJoinCancelledGroupPlan'))) {
|
||||
// @TODO: This needs to be in the notifications where users will now accept invites
|
||||
if (this.group.cancelledPlan && !confirm(window.env.t('aboutToJoinCancelledGroupPlan'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.$store.dispatch('guilds:join', {groupId: this.group._id});
|
||||
|
||||
// @TODO: Implement
|
||||
// User.sync();
|
||||
// Analytics.updateUser({'partyID': party.id});
|
||||
// $rootScope.hardRedirect('/#/options/groups/party');
|
||||
await this.$store.dispatch('guilds:join', {guildId: this.group._id, type: 'myGuilds'});
|
||||
this.user.guilds.push(this.group._id);
|
||||
},
|
||||
clickLeave () {
|
||||
// Analytics.track({'hitType':'event','eventCategory':'button','eventAction':'click','eventLabel':'Leave Party'});
|
||||
// @TODO: Get challenges and ask to keep or remove
|
||||
if (!confirm('Are you sure you want to leave?')) return;
|
||||
let keep = true;
|
||||
this.leave(keep);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ div
|
|||
span.dropdown-label {{ $t('sortBy') }}
|
||||
b-dropdown(:text="$t('sort')", right=true)
|
||||
b-dropdown-item(v-for='sortOption in sortOptions', @click='sort(sortOption.value)', :key='sortOption.value') {{sortOption.text}}
|
||||
.row(v-for='member in members')
|
||||
.row(v-for='member in sortedMembers')
|
||||
.col-8.offset-1
|
||||
member-details(:member='member')
|
||||
.col-3.actions
|
||||
|
|
@ -105,6 +105,7 @@ div
|
|||
|
||||
<script>
|
||||
// @TODO: Move this under members directory
|
||||
import sortBy from 'lodash/sortBy';
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import bDropdown from 'bootstrap-vue/lib/components/dropdown';
|
||||
import bDropdownItem from 'bootstrap-vue/lib/components/dropdown-item';
|
||||
|
|
@ -113,7 +114,6 @@ import MemberDetails from '../memberDetails';
|
|||
import removeIcon from 'assets/members/remove.svg';
|
||||
import messageIcon from 'assets/members/message.svg';
|
||||
import starIcon from 'assets/members/star.svg';
|
||||
import goldGuildBadgeIcon from 'assets/svg/gold-guild-badge.svg';
|
||||
|
||||
export default {
|
||||
props: ['group', 'hideBadge'],
|
||||
|
|
@ -130,11 +130,12 @@ export default {
|
|||
},
|
||||
data () {
|
||||
return {
|
||||
sortOption: '',
|
||||
members: [],
|
||||
memberToRemove: '',
|
||||
sortOptions: [
|
||||
{
|
||||
value: 'tier',
|
||||
value: 'level',
|
||||
text: this.$t('tier'),
|
||||
},
|
||||
{
|
||||
|
|
@ -142,7 +143,7 @@ export default {
|
|||
text: this.$t('name'),
|
||||
},
|
||||
{
|
||||
value: 'level',
|
||||
value: 'lvl',
|
||||
text: this.$t('level'),
|
||||
},
|
||||
{
|
||||
|
|
@ -155,10 +156,30 @@ export default {
|
|||
removeIcon,
|
||||
messageIcon,
|
||||
starIcon,
|
||||
goldGuildBadgeIcon,
|
||||
}),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
sortedMembers () {
|
||||
let sortedMembers = this.members;
|
||||
if (!this.sortOption) return sortedMembers;
|
||||
|
||||
sortedMembers = sortBy(this.members, [(member) => {
|
||||
if (this.sortOption === 'tier') {
|
||||
if (!member.contributor) return;
|
||||
return member.contributor.level;
|
||||
} else if (this.sortOption === 'name') {
|
||||
return member.profile.name;
|
||||
} else if (this.sortOption === 'lvl') {
|
||||
return member.stats.lvl;
|
||||
} else if (this.sortOption === 'class') {
|
||||
return member.stats.class;
|
||||
}
|
||||
}]);
|
||||
|
||||
return this.members;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async getMembers () {
|
||||
let groupId = this.$store.state.groupId || this.group._id;
|
||||
|
|
@ -232,6 +253,9 @@ export default {
|
|||
close () {
|
||||
this.$root.$emit('hide::modal', 'members-modal');
|
||||
},
|
||||
sort (option) {
|
||||
this.sortOption = option;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -112,9 +112,9 @@ import { mapState } from 'client/libs/store';
|
|||
import groupUtilities from 'client/mixins/groupsUtilities';
|
||||
import findIndex from 'lodash/findIndex';
|
||||
import gemIcon from 'assets/svg/gem.svg';
|
||||
import goldGuildBadgeIcon from 'assets/svg/gold-guild-badge.svg';
|
||||
import silverGuildBadgeIcon from 'assets/svg/silver-guild-badge.svg';
|
||||
import bronzeGuildBadgeIcon from 'assets/svg/bronze-guild-badge.svg';
|
||||
import goldGuildBadgeIcon from 'assets/svg/gold-guild-badge-large.svg';
|
||||
import silverGuildBadgeIcon from 'assets/svg/silver-guild-badge-large.svg';
|
||||
import bronzeGuildBadgeIcon from 'assets/svg/bronze-guild-badge-large.svg';
|
||||
|
||||
export default {
|
||||
mixins: [groupUtilities],
|
||||
|
|
|
|||
|
|
@ -46,52 +46,60 @@ export default {
|
|||
categoryFilters: [],
|
||||
categoryOptions: [
|
||||
{
|
||||
label: 'habiticaOfficial',
|
||||
key: 'official',
|
||||
label: 'habitica_official',
|
||||
key: 'habitica_official',
|
||||
},
|
||||
{
|
||||
label: 'animals',
|
||||
key: 'animals',
|
||||
label: 'academics',
|
||||
key: 'academics',
|
||||
},
|
||||
{
|
||||
label: 'artDesign',
|
||||
key: 'art_design',
|
||||
label: 'advocacy_causes',
|
||||
key: 'advocacy_causes',
|
||||
},
|
||||
{
|
||||
label: 'booksWriting',
|
||||
key: 'books_writing',
|
||||
label: 'creativity',
|
||||
key: 'creativity',
|
||||
},
|
||||
{
|
||||
label: 'comicsHobbies',
|
||||
key: 'comics_hobbies',
|
||||
label: 'entertainment',
|
||||
key: 'entertainment',
|
||||
},
|
||||
{
|
||||
label: 'diyCrafts',
|
||||
key: 'diy_crafts',
|
||||
label: 'finance',
|
||||
key: 'finance',
|
||||
},
|
||||
{
|
||||
label: 'education',
|
||||
key: 'education',
|
||||
},
|
||||
{
|
||||
label: 'foodCooking',
|
||||
key: 'food_cooking',
|
||||
},
|
||||
{
|
||||
label: 'healthFitness',
|
||||
label: 'health_fitness',
|
||||
key: 'health_fitness',
|
||||
},
|
||||
{
|
||||
label: 'music',
|
||||
key: 'music',
|
||||
label: 'hobbies_occupations',
|
||||
key: 'hobbies_occupations',
|
||||
},
|
||||
{
|
||||
label: 'relationship',
|
||||
key: 'relationship',
|
||||
label: 'location_based',
|
||||
key: 'location_based',
|
||||
},
|
||||
{
|
||||
label: 'scienceTech',
|
||||
key: 'science_tech ',
|
||||
label: 'mental_health',
|
||||
key: 'mental_health ',
|
||||
},
|
||||
{
|
||||
label: 'organization',
|
||||
key: 'organization ',
|
||||
},
|
||||
{
|
||||
label: 'Recovery + Support Groups',
|
||||
key: 'recovery_support_groups ',
|
||||
},
|
||||
{
|
||||
label: 'spirituality',
|
||||
key: 'spirituality ',
|
||||
},
|
||||
{
|
||||
label: 'time_management',
|
||||
key: 'time_management',
|
||||
},
|
||||
],
|
||||
roleFilters: [],
|
||||
|
|
|
|||
|
|
@ -10,9 +10,10 @@
|
|||
h3(v-once) {{ $t('tavernChat') }}
|
||||
|
||||
.row
|
||||
textarea(placeholder="Type a message to Habiticans here", v-model='newMessage', @keydown='updateCarretPosition')
|
||||
textarea(placeholder="Friendly reminder: this is an all-ages chat, so please keep content and language appropriate! Consult the Community Guidelines in the sidebar if you have questions.", v-model='newMessage', @keydown='updateCarretPosition')
|
||||
autocomplete(:text='newMessage', v-on:select="selectedAutocomplete", :coords='coords', :groupId='groupId')
|
||||
button.btn.btn-secondary.send-chat.float-right(v-once, @click='sendMessage()') {{ $t('send') }}
|
||||
button.btn.btn-secondary.float-left(v-once, @click='fetchRecentMessages()') {{ $t('fetchRecentMessages') }}
|
||||
|
||||
.row.community-guidelines(v-if='!communityGuidelinesAccepted')
|
||||
div.col-8(v-once) {{ $t('communityGuidelinesIntro') }}
|
||||
|
|
@ -66,23 +67,23 @@
|
|||
li
|
||||
a(href='/static/community-guidelines', v-once) {{ $t('communityGuidelinesLink') }}
|
||||
li
|
||||
a(href='/groups/guilds/f2db2a7f-13c5-454d-b3ee-ea1f5089e601', v-once) {{ $t('lookingForGroup') }}
|
||||
router-link(to="/groups/guild/f2db2a7f-13c5-454d-b3ee-ea1f5089e601") {{ $t('lookingForGroup') }}
|
||||
li
|
||||
a(href='/static/faq', v-once) {{ $t('faq') }}
|
||||
li
|
||||
a(href='', v-html="$t('glossary')")
|
||||
li
|
||||
a(href='http://habitica.wikia.com/wiki/Wiki', v-once) {{ $t('wiki') }}
|
||||
a(href='http://habitica.wikia.com/wiki/Habitica_Wiki', v-once) {{ $t('wiki') }}
|
||||
li
|
||||
a(href='https://oldgods.net/habitrpg/habitrpg_user_data_display.html', v-once) {{ $t('dataDisplayTool') }}
|
||||
li
|
||||
a(href='/groups/guilds/a29da26b-37de-4a71-b0c6-48e72a900dac', v-once) {{ $t('reportProblem') }}
|
||||
router-link(to="/groups/guild/a29da26b-37de-4a71-b0c6-48e72a900dac") {{ $t('reportProblem') }}
|
||||
li
|
||||
a(href='https://trello.com/c/odmhIqyW/440-read-first-table-of-contents', v-once) {{ $t('requestFeature') }}
|
||||
li
|
||||
a(href='', v-html="$t('communityForum')")
|
||||
li
|
||||
a(href='/groups/guilds/5481ccf3-5d2d-48a9-a871-70a7380cee5a', v-once) {{ $t('askQuestionGuild') }}
|
||||
router-link(to="/groups/guild/5481ccf3-5d2d-48a9-a871-70a7380cee5a") {{ $t('askQuestionGuild') }}
|
||||
|
||||
.section-header
|
||||
.row
|
||||
|
|
@ -478,6 +479,9 @@ export default {
|
|||
this.group.chat.unshift(response.message);
|
||||
this.newMessage = '';
|
||||
},
|
||||
async fetchRecentMessages () {
|
||||
this.group = await this.$store.dispatch('guilds:getGroup', {groupId: TAVERN_ID});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<template lang="pug">
|
||||
div
|
||||
yesterdaily-model(:yesterDailies='yesterDailies')
|
||||
new-stuff
|
||||
death
|
||||
low-health
|
||||
|
|
@ -20,12 +21,15 @@ div
|
|||
</template>
|
||||
|
||||
<script>
|
||||
// import moment from 'moment';
|
||||
import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
|
||||
import { shouldDo } from '../../common/script/cron';
|
||||
import { mapState } from 'client/libs/store';
|
||||
import notifications from 'client/mixins/notifications';
|
||||
import guide from 'client/mixins/guide';
|
||||
|
||||
import yesterdailyModel from './yesterdailyModel';
|
||||
import welcomeModal from './achievements/welcome';
|
||||
import newStuff from './achievements/newStuff';
|
||||
import death from './achievements/death';
|
||||
|
|
@ -51,6 +55,7 @@ import wonChallenge from './achievements/wonChallenge';
|
|||
export default {
|
||||
mixins: [notifications, guide],
|
||||
components: {
|
||||
yesterdailyModel,
|
||||
wonChallenge,
|
||||
ultimateGear,
|
||||
streak,
|
||||
|
|
@ -86,6 +91,7 @@ export default {
|
|||
let alreadyReadNotification = [];
|
||||
|
||||
return {
|
||||
yesterDailies: [],
|
||||
unlockLevels,
|
||||
lastShownNotifications,
|
||||
alreadyReadNotification,
|
||||
|
|
@ -243,83 +249,39 @@ export default {
|
|||
playSound () {
|
||||
// @TODO:
|
||||
},
|
||||
runYesterDailies () {
|
||||
async runYesterDailies () {
|
||||
// @TODO: Hopefully we don't need this even we load correctly
|
||||
if (this.isRunningYesterdailies) return;
|
||||
|
||||
// let userLastCron = moment(this.user.lastCron).local();
|
||||
// let userDayStart = moment().startOf('day').add({ hours: this.user.preferences.dayStart });
|
||||
|
||||
if (!this.user.needsCron) return;
|
||||
|
||||
let dailys = this.$store.state.tasks.data.dailys;
|
||||
|
||||
// @TODO: How do we check this now? if (!this.appLoaded) return;
|
||||
|
||||
this.isRunningYesterdailies = true;
|
||||
|
||||
// let yesterDay = moment().subtract('1', 'day').startOf('day').add({ hours: this.user.preferences.dayStart });
|
||||
let yesterDailies = [];
|
||||
dailys.forEach((task) => {
|
||||
if (task && task.group.approval && task.group.approval.requested) return;
|
||||
if (task.completed) return;
|
||||
// @TODO: let shouldDo = Shared.shouldDo(yesterDay, task);
|
||||
let shouldDo = false;
|
||||
|
||||
if (task.yesterDaily && shouldDo) yesterDailies.push(task);
|
||||
});
|
||||
|
||||
if (yesterDailies.length === 0) {
|
||||
// @TODO:
|
||||
// User.runCron().then(function () {
|
||||
// isRunningYesterdailies = false;
|
||||
// handleUserNotifications(this.user);
|
||||
// });
|
||||
if (!this.user.needsCron) {
|
||||
this.handleUserNotifications(this.user.notifications);
|
||||
return;
|
||||
}
|
||||
|
||||
// @TODO:
|
||||
// let modalScope = this.$new();
|
||||
// modalScope.obj = this.user;
|
||||
// modalScope.taskList = yesterDailies;
|
||||
// modalScope.list = {
|
||||
// showCompleted: false,
|
||||
// type: 'daily',
|
||||
// };
|
||||
// modalScope.processingYesterdailies = true;
|
||||
//
|
||||
// $scope.yesterDailiesModalOpen = true;
|
||||
// $modal.open({
|
||||
// templateUrl: 'modals/yesterDailies.html',
|
||||
// scope: modalScope,
|
||||
// backdrop: 'static',
|
||||
// controller: ['$scope', 'Tasks', 'User', '$rootScope', function ($scope, Tasks, User, $rootScope) {
|
||||
// this.$on('task:scored', function (event, data) {
|
||||
// let task = data.task;
|
||||
// let indexOfTask = _.findIndex($scope.taskList, function (taskInList) {
|
||||
// return taskInList._id === task._id;
|
||||
// });
|
||||
// if (!$scope.taskList[indexOfTask]) return;
|
||||
// $scope.taskList[indexOfTask].group.approval.requested = task.group.approval.requested;
|
||||
// if ($scope.taskList[indexOfTask].group.approval.requested) return;
|
||||
// $scope.taskList[indexOfTask].completed = task.completed;
|
||||
// });
|
||||
//
|
||||
// $scope.ageDailies = function () {
|
||||
// User.runCron()
|
||||
// .then(function () {
|
||||
// isRunningYesterdailies = false;
|
||||
// handleUserNotifications(this.user);
|
||||
// });
|
||||
// };
|
||||
// }],
|
||||
// });
|
||||
let dailys = this.$store.state.tasks.data.dailys;
|
||||
this.isRunningYesterdailies = true;
|
||||
|
||||
let yesterDay = moment().subtract('1', 'day').startOf('day').add({ hours: this.user.preferences.dayStart });
|
||||
dailys.forEach((task) => {
|
||||
if (task && task.group.approval && task.group.approval.requested) return;
|
||||
if (task.completed) return;
|
||||
let due = shouldDo(yesterDay, task);
|
||||
if (task.yesterDaily && due) this.yesterDailies.push(task);
|
||||
});
|
||||
|
||||
if (this.yesterDailies.length === 0) {
|
||||
this.isRunningYesterdailies = false;
|
||||
await axios.post('/api/v3/cron');
|
||||
this.handleUserNotifications(this.user);
|
||||
return;
|
||||
}
|
||||
|
||||
this.$root.$emit('show::modal', 'yesterdaily');
|
||||
},
|
||||
transferGroupNotification (notification) {
|
||||
if (!this.user.groupNotifications) this.user.groupNotifications = [];
|
||||
this.user.groupNotifications.push(notification);
|
||||
},
|
||||
handleUserNotifications (after) {
|
||||
async handleUserNotifications (after) {
|
||||
if (!after || after.length === 0) return;
|
||||
|
||||
let notificationsToRead = [];
|
||||
|
|
@ -442,7 +404,12 @@ export default {
|
|||
});
|
||||
|
||||
let userReadNotifsPromise = false;
|
||||
// @TODO: User.readNotifications(notificationsToRead);
|
||||
|
||||
if (notificationsToRead.length >= 0) {
|
||||
await axios.post('/api/v3/notifications/read', {
|
||||
notificationIds: notificationsToRead,
|
||||
});
|
||||
}
|
||||
|
||||
if (userReadNotifsPromise) {
|
||||
userReadNotifsPromise.then(() => {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
h6 {{ $t('userId') }}
|
||||
pre.prettyprint {{user.id}}
|
||||
h6 {{ $t('APIToken') }}
|
||||
pre.prettyprint {{user.apiToken}}
|
||||
pre.prettyprint {{apiToken}}
|
||||
small(v-html='$t("APITokenWarning", { hrefTechAssistanceEmail })')
|
||||
|
||||
.section
|
||||
|
|
@ -70,6 +70,8 @@ import { mapState } from 'client/libs/store';
|
|||
import uuid from '../../../common/script/libs/uuid';
|
||||
// @TODO: env.EMAILS.TECH_ASSISTANCE_EMAIL
|
||||
const TECH_ASSISTANCE_EMAIL = 'admin@habitica.com';
|
||||
let AUTH_SETTINGS = localStorage.getItem('habit-mobile-settings');
|
||||
AUTH_SETTINGS = JSON.parse(AUTH_SETTINGS);
|
||||
|
||||
export default {
|
||||
data () {
|
||||
|
|
@ -82,6 +84,9 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
...mapState({user: 'user.data'}),
|
||||
apiToken () {
|
||||
return AUTH_SETTINGS.auth.apiToken;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async addWebhook (url) {
|
||||
|
|
|
|||
|
|
@ -645,7 +645,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
playButtonClick () {
|
||||
this.$router.push('/login');
|
||||
this.$router.push('/register');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
<template lang="pug">
|
||||
nav
|
||||
router-link(:to="{name: 'login'}") Login
|
||||
router-link(:to="{name: 'register'}") Register
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
play () {
|
||||
// @TODO:
|
||||
// Auth play click
|
||||
},
|
||||
// passwordReset (email) {
|
||||
// if(email == null || email.length == 0) {
|
||||
// alert(window.env.t('invalidEmail'));
|
||||
// } else {
|
||||
// $http.post(ApiUrl.get() + '/api/v3/user/reset-password', {email:email})
|
||||
// .success(function(){
|
||||
// alert(window.env.t('newPassSent'));
|
||||
// })
|
||||
// .error(function(data){
|
||||
// alert(data.err);
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
46
website/client/components/yesterdailyModel.vue
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<template lang="pug">
|
||||
b-modal#yesterdaily(:title="$t('armoireText')", size='lg', :hide-footer="true")
|
||||
.modal-header
|
||||
.shop_armoire.pull-right
|
||||
.modal-body
|
||||
task-column.col-6.offset-3(
|
||||
v-if='tasksByType && tasksByType[column]'
|
||||
v-for="column in ['daily']",
|
||||
:type="column",
|
||||
:key="column",
|
||||
:taskListOverride='tasksByType[column]',
|
||||
:isUser='true')
|
||||
.modal-footer.text-center
|
||||
button.btn.btn-primary(@click='close()') Start My Day
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import { mapState } from 'client/libs/store';
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import Column from './tasks/column';
|
||||
|
||||
export default {
|
||||
props: ['yesterDailies'],
|
||||
components: {
|
||||
bModal,
|
||||
TaskColumn: Column,
|
||||
},
|
||||
computed: {
|
||||
...mapState({user: 'user.data'}),
|
||||
tasksByType () {
|
||||
return {
|
||||
daily: this.yesterDailies,
|
||||
};
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async close () {
|
||||
await axios.post('/api/v3/cron');
|
||||
// @TODO: Better way to sync user?
|
||||
window.location.href = '/';
|
||||
this.$root.$emit('hide::modal', 'yesterdaily');
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -28,6 +28,8 @@ export default {
|
|||
let isLeader = true;
|
||||
let correctSize = true;
|
||||
|
||||
if (group._id === this.$store.state.constants.TAVERN_ID) return false;
|
||||
|
||||
if (search) {
|
||||
passedSearch = group.name.toLowerCase().indexOf(search.toLowerCase()) >= 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,5 +259,20 @@
|
|||
"onward": "Onward!",
|
||||
"tavernChat": "Tavern Chat",
|
||||
"partyChatPlaceholder": "Type message to Party members here",
|
||||
"done": "Done"
|
||||
"done": "Done",
|
||||
"habitica_official": "Habitica Official",
|
||||
"academics": "Academics",
|
||||
"advocacy_causes": "Advocacy & Causes",
|
||||
"creativity": "Creativity",
|
||||
"entertainment": "Entertainment",
|
||||
"finance": "Finance",
|
||||
"health_fitness": "Health + Fitness",
|
||||
"hobbies_occupations": "Hobbies + Occupations",
|
||||
"location_based": "Location-based",
|
||||
"mental_health": "Mental Health + Self-Care",
|
||||
"getting_organized": "Getting Organized",
|
||||
"self_improvement": "Self-Improvement",
|
||||
"spirituality": "Spirituality",
|
||||
"time_management": "Time-Management + Accountability",
|
||||
"recovery_support_groups": "Recovery + Support Groups"
|
||||
}
|
||||
|
|
|
|||