mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
fix(groups): many, mostly style, fixes
This commit is contained in:
@@ -64,30 +64,10 @@
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.diamond-btn {
|
|
||||||
margin-left: 8px;
|
|
||||||
background: $white;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
border-radius: 2px;
|
|
||||||
box-shadow: 0 1px 3px 0 rgba(26, 24, 29, 0.12), 0 1px 2px 0 rgba(26, 24, 29, 0.24);
|
|
||||||
cursor: pointer;
|
|
||||||
color: $gray-200;
|
|
||||||
|
|
||||||
&:hover:not(.create-btn) {
|
|
||||||
color: $purple-400;
|
|
||||||
box-shadow: 0 1px 8px 0 rgba($black, 0.12), 0 4px 4px 0 rgba($black, 0.16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-btn {
|
.create-btn {
|
||||||
color: $white;
|
color: $white;
|
||||||
background-color: $purple-200;
|
background-color: $purple-200;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 112px;
|
|
||||||
|
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
color: $purple-500;
|
color: $purple-500;
|
||||||
|
|||||||
@@ -258,7 +258,7 @@
|
|||||||
|
|
||||||
&-modal {
|
&-modal {
|
||||||
&-bg { background: $purple-300 !important; }
|
&-bg { background: $purple-300 !important; }
|
||||||
&-headings { color: $white; }
|
&-headings { color: $white !important; }
|
||||||
&-icon { color: $purple-300 !important; }
|
&-icon { color: $purple-300 !important; }
|
||||||
&-text { color: $black !important; }
|
&-text { color: $black !important; }
|
||||||
&-content {
|
&-content {
|
||||||
|
|||||||
@@ -44,26 +44,26 @@
|
|||||||
@change="changeMirrorPreference"
|
@change="changeMirrorPreference"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="day-start d-flex align-items-center"
|
class="day-start d-flex align-items-center mr-2"
|
||||||
v-html="$t('dayStart', { startTime: groupStartTime } )"
|
v-html="$t('dayStart', { startTime: groupStartTime } )"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<button
|
||||||
id="create-task-btn"
|
id="create-task-btn"
|
||||||
v-if="canCreateTasks"
|
v-if="canCreateTasks"
|
||||||
class="create-btn ml-2 btn-primary diamond-btn btn"
|
class="btn btn-primary create-btn d-flex align-items-center"
|
||||||
:class="{open: openCreateBtn}"
|
:class="{open: openCreateBtn}"
|
||||||
@click.stop.prevent="openCreateBtn = !openCreateBtn"
|
@click.stop.prevent="openCreateBtn = !openCreateBtn"
|
||||||
@keypress.enter="openCreateBtn = !openCreateBtn"
|
@keypress.enter="openCreateBtn = !openCreateBtn"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="svg-icon"
|
class="svg-icon icon-10 color"
|
||||||
v-html="icons.positive"
|
v-html="icons.positive"
|
||||||
></div>
|
></div>
|
||||||
<div class="ml-2"> {{ $t('addTask') }} </div>
|
<div class="ml-75 mr-1"> {{ $t('addTask') }} </div>
|
||||||
</div>
|
</button>
|
||||||
<div
|
<div
|
||||||
v-if="openCreateBtn"
|
v-if="openCreateBtn"
|
||||||
class="dropdown"
|
class="dropdown"
|
||||||
|
|||||||
@@ -42,19 +42,19 @@
|
|||||||
<div
|
<div
|
||||||
class="claim-bottom-message d-flex align-items-center"
|
class="claim-bottom-message d-flex align-items-center"
|
||||||
>
|
>
|
||||||
<span
|
<div
|
||||||
v-if="assignedUsersCount > 0"
|
v-if="assignedUsersCount > 0"
|
||||||
class="users-icon ml-2 mt-n1"
|
class="svg-icon icon-16 ml-2 users-icon"
|
||||||
:class="{'green-50': completionsCount === assignedUsersCount}"
|
:class="{'green-50': completionsCount === assignedUsersCount}"
|
||||||
v-html="icons.users"
|
v-html="icons.users"
|
||||||
></span>
|
></div>
|
||||||
<div
|
<div
|
||||||
class="mr-auto ml-1"
|
class="mr-auto ml-1 my-auto"
|
||||||
:class="{'green-10': showGreen}"
|
:class="{'green-10': showGreen}"
|
||||||
v-html="message"
|
v-html="message"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
class="ml-auto mr-2 text-right"
|
class="ml-auto mr-1 my-auto"
|
||||||
v-if="task.group.assignedUsers && ['daily','todo'].indexOf(task.type) !== -1"
|
v-if="task.group.assignedUsers && ['daily','todo'].indexOf(task.type) !== -1"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@@ -62,13 +62,13 @@
|
|||||||
class="mr-1 d-inline-flex align-items-center"
|
class="mr-1 d-inline-flex align-items-center"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="small-check my-auto"
|
class="small-check"
|
||||||
v-if="!showStatus && completionsCount"
|
v-if="!showStatus && completionsCount"
|
||||||
:class="{'green-50': completionsCount === assignedUsersCount}"
|
:class="{'green-50': completionsCount === assignedUsersCount}"
|
||||||
v-html="icons.check"
|
v-html="icons.check"
|
||||||
></span>
|
></span>
|
||||||
<span
|
<span
|
||||||
class="my-auto ml-1 mr-2"
|
class="ml-1 mr-2"
|
||||||
v-if="!showStatus && completionsCount"
|
v-if="!showStatus && completionsCount"
|
||||||
>
|
>
|
||||||
{{ completionsCount }}/{{ assignedUsersCount }}
|
{{ completionsCount }}/{{ assignedUsersCount }}
|
||||||
@@ -95,12 +95,11 @@
|
|||||||
<span
|
<span
|
||||||
v-html="icons.lastComplete"
|
v-html="icons.lastComplete"
|
||||||
v-b-tooltip.hover.bottom="$t('lastCompleted')"
|
v-b-tooltip.hover.bottom="$t('lastCompleted')"
|
||||||
class="last-completed mr-1"
|
class="last-completed"
|
||||||
:class="{'gray-200': !showGreen}"
|
:class="{'gray-200': !showGreen}"
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="my-auto"
|
|
||||||
:class="{'green-10': showGreen}"
|
:class="{'green-10': showGreen}"
|
||||||
>
|
>
|
||||||
{{ formattedCompletionTime }}
|
{{ formattedCompletionTime }}
|
||||||
@@ -126,6 +125,7 @@
|
|||||||
height: 16px;
|
height: 16px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding-left: 2px;
|
padding-left: 2px;
|
||||||
|
padding-top: 1px;
|
||||||
background-color: #e1e0e3;
|
background-color: #e1e0e3;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
@@ -150,6 +150,7 @@
|
|||||||
border-bottom-left-radius: 4px;
|
border-bottom-left-radius: 4px;
|
||||||
border-bottom-right-radius: 4px;
|
border-bottom-right-radius: 4px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
line-height: 1.334;
|
||||||
padding-bottom: 0.25rem;
|
padding-bottom: 0.25rem;
|
||||||
padding-top: 0.25rem;
|
padding-top: 0.25rem;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
@@ -222,8 +223,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.users-icon {
|
.users-icon {
|
||||||
width: 16px;
|
margin-top: -1px;
|
||||||
height: 16px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -323,13 +323,14 @@ export default {
|
|||||||
return this.$t('error'); // task is open, or the other conditions aren't hitting right
|
return this.$t('error'); // task is open, or the other conditions aren't hitting right
|
||||||
},
|
},
|
||||||
singleAssignLastDone () {
|
singleAssignLastDone () {
|
||||||
const userId = this.task.group.assignedUsers[0];
|
const completion = this.task?.group?.assignedUsersDetail[this.user._id];
|
||||||
const completion = this.task.group.assignedUsersDetail[userId];
|
if (completion) return completion.completedDate;
|
||||||
return completion.completedDate;
|
return null;
|
||||||
},
|
},
|
||||||
showGreen () {
|
showGreen () {
|
||||||
if (this.assignedUsersCount !== 1) return false;
|
if (this.assignedUsersCount !== 1) return false;
|
||||||
return this.singleAssignLastDone && moment().diff(this.singleAssignLastDone, 'days') < 1;
|
return this.singleAssignLastDone
|
||||||
|
&& this.task?.group?.assignedUsersDetail[this.user._id].completed;
|
||||||
},
|
},
|
||||||
formattedCompletionTime () {
|
formattedCompletionTime () {
|
||||||
if (!this.singleAssignLastDone) return '';
|
if (!this.singleAssignLastDone) return '';
|
||||||
|
|||||||
@@ -592,7 +592,7 @@
|
|||||||
@import '~@/assets/scss/colors.scss';
|
@import '~@/assets/scss/colors.scss';
|
||||||
|
|
||||||
#task-modal {
|
#task-modal {
|
||||||
a {
|
a:not(.dropdown-item) {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.33;
|
line-height: 1.33;
|
||||||
color: $blue-10;
|
color: $blue-10;
|
||||||
|
|||||||
@@ -75,7 +75,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="task && task.group.assignedUsersDetail && task.group.assignedUsersDetail[user._id]"
|
v-if="task && task.group && task.group.assignedUsersDetail
|
||||||
|
&& task.group.assignedUsersDetail[user._id]"
|
||||||
class="assignment-footer text-center py-2"
|
class="assignment-footer text-center py-2"
|
||||||
v-html="$t('assignedDateAndUser', {
|
v-html="$t('assignedDateAndUser', {
|
||||||
username: task.group.assignedUsersDetail[user._id].assigningUsername,
|
username: task.group.assignedUsersDetail[user._id].assigningUsername,
|
||||||
|
|||||||
@@ -171,17 +171,17 @@
|
|||||||
<div class="create-task-area">
|
<div class="create-task-area">
|
||||||
<div
|
<div
|
||||||
id="create-task-btn"
|
id="create-task-btn"
|
||||||
class="create-btn ml-auto btn-primary diamond-btn btn"
|
class="btn btn-primary create-btn d-flex align-items-center"
|
||||||
:class="{open: openCreateBtn}"
|
:class="{open: openCreateBtn}"
|
||||||
@click.stop.prevent="openCreateBtn = !openCreateBtn"
|
@click.stop.prevent="openCreateBtn = !openCreateBtn"
|
||||||
@keypress.enter="openCreateBtn = !openCreateBtn"
|
@keypress.enter="openCreateBtn = !openCreateBtn"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="svg-icon"
|
class="svg-icon icon-10 color"
|
||||||
v-html="icons.positive"
|
v-html="icons.positive"
|
||||||
></div>
|
></div>
|
||||||
<div class="ml-2"> {{ $t('addTask') }} </div>
|
<div class="ml-75 mr-1"> {{ $t('addTask') }} </div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="openCreateBtn"
|
v-if="openCreateBtn"
|
||||||
|
|||||||
@@ -1448,8 +1448,7 @@ schema.methods.syncTask = async function groupSyncTask (taskToSync, users, assig
|
|||||||
const assignmentData = {
|
const assignmentData = {
|
||||||
assignedDate: new Date(),
|
assignedDate: new Date(),
|
||||||
assignedUsername: user.auth.local.username,
|
assignedUsername: user.auth.local.username,
|
||||||
assigningUsername: assigningUser && assigningUser._id !== user._id
|
assigningUsername: assigningUser.auth.local.username,
|
||||||
? assigningUser.auth.local.username : null,
|
|
||||||
completed: false,
|
completed: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1500,9 +1499,6 @@ schema.methods.unlinkTask = async function groupUnlinkTask (
|
|||||||
delete unlinkingTask.group.assignedUsersDetail[user._id];
|
delete unlinkingTask.group.assignedUsersDetail[user._id];
|
||||||
const assignedUserIndex = unlinkingTask.group.assignedUsers.indexOf(user._id);
|
const assignedUserIndex = unlinkingTask.group.assignedUsers.indexOf(user._id);
|
||||||
unlinkingTask.group.assignedUsers.splice(assignedUserIndex, 1);
|
unlinkingTask.group.assignedUsers.splice(assignedUserIndex, 1);
|
||||||
if (unlinkingTask.group.assignedUsers.length === 0) {
|
|
||||||
unlinkingTask.group.assignedUsers = undefined;
|
|
||||||
}
|
|
||||||
unlinkingTask.markModified('group');
|
unlinkingTask.markModified('group');
|
||||||
|
|
||||||
const promises = [unlinkingTask.save()];
|
const promises = [unlinkingTask.save()];
|
||||||
|
|||||||
Reference in New Issue
Block a user