Account for new statuses (#853)

* Account for new statuses

More work is going to be needed for scheduling projects, but this is a stopgap measure to fix #852

* Fix lint

* Why, Prettier, why?
This commit is contained in:
triphora 2023-01-09 15:03:57 -05:00 committed by GitHub
parent e45f0f0299
commit 6e5d1fb613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 17 deletions

View File

@ -3,6 +3,8 @@
<template v-if="color"> <template v-if="color">
<span class="circle" /> {{ $capitalizeString(type) }} <span class="circle" /> {{ $capitalizeString(type) }}
</template> </template>
<!-- User roles -->
<template v-else-if="type === 'admin'"> <template v-else-if="type === 'admin'">
<ModrinthIcon /> Modrinth Team <ModrinthIcon /> Modrinth Team
</template> </template>
@ -10,8 +12,15 @@
<ModeratorIcon /> Moderator <ModeratorIcon /> Moderator
</template> </template>
<template v-else-if="type === 'creator'"><CreatorIcon /> Creator</template> <template v-else-if="type === 'creator'"><CreatorIcon /> Creator</template>
<!-- Project statuses -->
<template v-else-if="type === 'approved'"><ListIcon /> Listed</template> <template v-else-if="type === 'approved'"><ListIcon /> Listed</template>
<template v-else-if="type === 'withheld'"><EyeOffIcon /> Withheld</template>
<template v-else-if="type === 'unlisted'"><EyeOffIcon /> Unlisted</template> <template v-else-if="type === 'unlisted'"><EyeOffIcon /> Unlisted</template>
<template v-else-if="type === 'private'"><LockIcon /> Private</template>
<template v-else-if="type === 'scheduled'">
<CalendarIcon /> Scheduled
</template>
<template v-else-if="type === 'draft'"><DraftIcon /> Draft</template> <template v-else-if="type === 'draft'"><DraftIcon /> Draft</template>
<template v-else-if="type === 'archived'"> <template v-else-if="type === 'archived'">
<ArchiveIcon /> Archived <ArchiveIcon /> Archived
@ -20,6 +29,8 @@
<template v-else-if="type === 'processing'"> <template v-else-if="type === 'processing'">
<ProcessingIcon /> Under review <ProcessingIcon /> Under review
</template> </template>
<!-- Team members -->
<template v-else-if="type === 'accepted'"><CheckIcon /> Accepted</template> <template v-else-if="type === 'accepted'"><CheckIcon /> Accepted</template>
<template v-else-if="type === 'pending'"> <template v-else-if="type === 'pending'">
<ProcessingIcon /> Pending <ProcessingIcon /> Pending
@ -41,6 +52,8 @@ import CrossIcon from '~/assets/images/utils/x.svg?inline'
import ArchiveIcon from '~/assets/images/utils/archive.svg?inline' import ArchiveIcon from '~/assets/images/utils/archive.svg?inline'
import ProcessingIcon from '~/assets/images/utils/updated.svg?inline' import ProcessingIcon from '~/assets/images/utils/updated.svg?inline'
import CheckIcon from '~/assets/images/utils/check.svg?inline' import CheckIcon from '~/assets/images/utils/check.svg?inline'
import LockIcon from '~/assets/images/utils/lock.svg?inline'
import CalendarIcon from '~/assets/images/utils/calendar.svg?inline'
export default { export default {
name: 'Badge', name: 'Badge',
@ -55,6 +68,8 @@ export default {
ArchiveIcon, ArchiveIcon,
ProcessingIcon, ProcessingIcon,
CheckIcon, CheckIcon,
LockIcon,
CalendarIcon,
}, },
props: { props: {
type: { type: {
@ -99,6 +114,7 @@ export default {
&.type--pending, &.type--pending,
&.type--moderator, &.type--moderator,
&.type--processing, &.type--processing,
&.type--scheduled,
&.orange { &.orange {
--badge-color: var(--color-special-orange); --badge-color: var(--color-special-orange);
} }
@ -115,11 +131,13 @@ export default {
color: var(--color-special-blue); color: var(--color-special-blue);
} }
&.type--withheld,
&.type--unlisted, &.type--unlisted,
&.purple { &.purple {
color: var(--color-special-purple); color: var(--color-special-purple);
} }
&.type--private,
&.gray { &.gray {
--badge-color: var(--color-special-gray); --badge-color: var(--color-special-gray);
} }

View File

@ -326,9 +326,7 @@
<div class="buttons status-buttons"> <div class="buttons status-buttons">
<button <button
v-if=" v-if="
project.status === 'rejected' || project.status === 'rejected' || project.status === 'withheld'
project.status === 'unlisted' ||
project.status === 'abandoned'
" "
class="iconified-button brand-button" class="iconified-button brand-button"
@click="submitForReview" @click="submitForReview"
@ -629,13 +627,12 @@
:toggle-collapsed="toggleChecklistCollapse" :toggle-collapsed="toggleChecklistCollapse"
/> />
<div <div
v-if="project.status === 'unlisted'" v-if="project.status === 'withheld'"
class="card warning" class="card warning"
aria-label="Warning" aria-label="Warning"
> >
{{ project.title }} is not viewable in search either because the {{ project.title }} is not viewable in search because it has been
author has marked it as such or because it has been found to be in found to be in violation of one of
violation of one of
<nuxt-link to="/legal/rules">Modrinth's content rules</nuxt-link>. <nuxt-link to="/legal/rules">Modrinth's content rules</nuxt-link>.
Modrinth makes no guarantees as to whether {{ project.title }} is safe Modrinth makes no guarantees as to whether {{ project.title }} is safe
for use in a multiplayer context. for use in a multiplayer context.
@ -649,15 +646,6 @@
{{ project.title }} will not receive any further updates unless the {{ project.title }} will not receive any further updates unless the
author decides to unarchive the project. author decides to unarchive the project.
</div> </div>
<div
v-if="project.status === 'abandoned'"
class="card warning"
aria-label="Warning"
>
{{ project.title }} has been marked as abandoned by Modrinth's
moderators. {{ project.title }} will not receive any further updates
unless the author decides to return.
</div>
<div <div
v-if="project.project_type === 'modpack'" v-if="project.project_type === 'modpack'"
class="card warning" class="card warning"
@ -692,7 +680,11 @@
>. >.
</div> </div>
<Advertisement <Advertisement
v-if="project.status === 'approved' || project.status === 'unlisted'" v-if="
['approved', 'unlisted', 'archived', 'private'].includes(
project.status
)
"
type="banner" type="banner"
small-screen="square" small-screen="square"
/> />