Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Move extra loaders and change RP Resolutions to use OR (#1398)
Browse files Browse the repository at this point in the history
* Put extra loaders at bottom of the list

* Added hidden loaders to a tag

* Made RP Resolutions use OR

* fixed lint
  • Loading branch information
Minenash authored Jun 12, 2024
1 parent 547135f commit 5b2d36e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 20 deletions.
1 change: 1 addition & 0 deletions composables/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const useTags = () =>
],
dataPackLoaders: ['datapack'],
modLoaders: ['forge', 'fabric', 'quilt', 'liteloader', 'modloader', 'rift', 'neoforge'],
hiddenModLoaders: ['liteloader', 'modloader', 'rift'],
},
projectViewModes: ['list', 'grid', 'gallery'],
approvedStatuses: ['approved', 'archived', 'unlisted', 'private'],
Expand Down
68 changes: 48 additions & 20 deletions pages/search/[searchProjectType].vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,32 @@
{{ $formatCategoryHeader(header) }}
</h3>

<SearchFilter
v-for="category in categories.filter((x) => x.project_type === projectType.actual)"
:key="category.name"
:active-filters="facets"
:display-name="$formatCategory(category.name)"
:facet-name="`categories:'${encodeURIComponent(category.name)}'`"
:icon="header === 'resolutions' ? null : category.icon"
@toggle="toggleFacet"
/>
<template v-if="header === 'resolutions'">
<SearchFilter
v-for="category in categories.filter(
(x) => x.project_type === projectType.actual
)"
:key="category.name"
:active-filters="orFacets"
:display-name="$formatCategory(category.name)"
:facet-name="`categories:'${encodeURIComponent(category.name)}'`"
:icon="null"
@toggle="toggleOrFacet"
/>
</template>
<template v-else>
<SearchFilter
v-for="category in categories.filter(
(x) => x.project_type === projectType.actual
)"
:key="category.name"
:active-filters="facets"
:display-name="$formatCategory(category.name)"
:facet-name="`categories:'${encodeURIComponent(category.name)}'`"
:icon="category.icon"
@toggle="toggleFacet"
/>
</template>
</div>
</section>
<section
Expand All @@ -67,17 +84,11 @@
</h3>
<SearchFilter
v-for="loader in tags.loaders.filter((x) => {
if (
projectType.id === 'mod' &&
!showAllLoaders &&
x.name !== 'forge' &&
x.name !== 'fabric' &&
x.name !== 'quilt' &&
x.name !== 'neoforge'
) {
return false
} else if (projectType.id === 'mod' && showAllLoaders) {
return tags.loaderData.modLoaders.includes(x.name)
if (projectType.id === 'mod') {
return (
tags.loaderData.modLoaders.includes(x.name) &&
!tags.loaderData.hiddenModLoaders.includes(x.name)
)
} else if (projectType.id === 'plugin') {
return tags.loaderData.pluginLoaders.includes(x.name)
} else if (projectType.id === 'datapack') {
Expand All @@ -94,6 +105,23 @@
:icon="loader.icon"
@toggle="toggleOrFacet"
/>
<template v-if="projectType.id === 'mod' && showAllLoaders">
<SearchFilter
v-for="loader in tags.loaders.filter((x) => {
return (
tags.loaderData.modLoaders.includes(x.name) &&
tags.loaderData.hiddenModLoaders.includes(x.name)
)
})"
:key="loader.name"
ref="loaderFilters"
:active-filters="orFacets"
:display-name="$formatCategory(loader.name)"
:facet-name="`categories:'${encodeURIComponent(loader.name)}'`"
:icon="loader.icon"
@toggle="toggleOrFacet"
/>
</template>
<Checkbox
v-if="projectType.id === 'mod'"
v-model="showAllLoaders"
Expand Down

0 comments on commit 5b2d36e

Please sign in to comment.