Navigation fixes (#1095)

* Navigation fixes

* remove console log

* Fix prettier

* Fix legal pages as well
This commit is contained in:
Geometrically
2023-04-15 18:07:20 -07:00
committed by GitHub
parent fd28da2a3b
commit e56974f4b2
7 changed files with 109 additions and 107 deletions

View File

@@ -139,10 +139,15 @@
<div>Visit your profile</div> <div>Visit your profile</div>
</div> </div>
</NuxtLink> </NuxtLink>
<NuxtLink v-else class="iconified-button brand-button" :to="getAuthUrl()"> <a
v-else
class="iconified-button brand-button"
:href="getAuthUrl()"
rel="nofollow noopener"
>
<GitHubIcon aria-hidden="true" /> <GitHubIcon aria-hidden="true" />
Sign in with GitHub Sign in with GitHub
</NuxtLink> </a>
</div> </div>
<div class="links"> <div class="links">
<template v-if="auth.user"> <template v-if="auth.user">

View File

@@ -116,6 +116,7 @@
:patch-project="patchProject" :patch-project="patchProject"
:patch-icon="patchIcon" :patch-icon="patchIcon"
:update-icon="resetProject" :update-icon="resetProject"
:route="route"
/> />
</div> </div>
</div> </div>
@@ -389,6 +390,95 @@
</div> </div>
</div> </div>
</div> </div>
<section class="normal-page__content">
<ProjectPublishingChecklist
v-if="currentMember"
:project="project"
:versions="versions"
:current-member="currentMember"
:is-settings="$route.name.startsWith('type-id-settings')"
:route-name="$route.name"
:set-processing="setProcessing"
:collapsed="collapsedChecklist"
:toggle-collapsed="() => (collapsedChecklist = !collapsedChecklist)"
/>
<div v-if="project.status === 'withheld'" class="card warning" aria-label="Warning">
{{ project.title }} is not viewable in search because it has been found to be in violation
of one of <nuxt-link to="/legal/rules"> Modrinth's content rules </nuxt-link>. Modrinth
makes no guarantees as to whether {{ project.title }} is safe for use in a multiplayer
context.
</div>
<div v-if="project.status === 'archived'" class="card warning" aria-label="Warning">
{{ project.title }} has been archived. {{ project.title }} will not receive any further
updates unless the author decides to unarchive the project.
</div>
<div
v-if="project.project_type === 'modpack'"
class="card information"
aria-label="Information"
>
To install {{ project.title }}, visit
<a href="https://docs.modrinth.com/docs/modpacks/playing_modpacks/" :target="$external()"
>our documentation</a
>
which provides instructions on using
<a href="https://atlauncher.com/about" :target="$external()" rel="noopener"> ATLauncher</a
>, <a href="https://multimc.org/" :target="$external()" rel="noopener">MultiMC</a>, and
<a href="https://prismlauncher.org" :target="$external()" rel="noopener">
Prism Launcher</a
>.
</div>
<Promotion v-if="$tag.approvedStatuses.includes(project.status)" />
<div class="navigation-card">
<NavRow
:links="[
{
label: 'Description',
href: `/${project.project_type}/${project.slug ? project.slug : project.id}`,
},
{
label: 'Gallery',
href: `/${project.project_type}/${
project.slug ? project.slug : project.id
}/gallery`,
shown: project.gallery.length > 0 || !!currentMember,
},
{
label: 'Changelog',
href: `/${project.project_type}/${
project.slug ? project.slug : project.id
}/changelog`,
shown: versions.length > 0,
},
{
label: 'Versions',
href: `/${project.project_type}/${
project.slug ? project.slug : project.id
}/versions`,
shown: versions.length > 0 || !!currentMember,
},
]"
/>
<div v-if="$auth.user && currentMember" class="input-group">
<nuxt-link
:to="`/${project.project_type}/${project.slug ? project.slug : project.id}/settings`"
class="iconified-button"
>
<SettingsIcon /> Settings
</nuxt-link>
</div>
</div>
<NuxtPage
v-model:project="project"
v-model:versions="versions"
v-model:featured-versions="featuredVersions"
v-model:members="members"
v-model:all-members="allMembers"
v-model:dependencies="dependencies"
:current-member="currentMember"
:route="route"
/>
</section>
<div class="card normal-page__info"> <div class="card normal-page__info">
<template <template
v-if=" v-if="
@@ -603,94 +693,6 @@
</div> </div>
</div> </div>
</div> </div>
<section class="normal-page__content">
<ProjectPublishingChecklist
v-if="currentMember"
:project="project"
:versions="versions"
:current-member="currentMember"
:is-settings="$route.name.startsWith('type-id-settings')"
:route-name="$route.name"
:set-processing="setProcessing"
:collapsed="collapsedChecklist"
:toggle-collapsed="() => (collapsedChecklist = !collapsedChecklist)"
/>
<div v-if="project.status === 'withheld'" class="card warning" aria-label="Warning">
{{ project.title }} is not viewable in search because it has been found to be in violation
of one of <nuxt-link to="/legal/rules"> Modrinth's content rules </nuxt-link>. Modrinth
makes no guarantees as to whether {{ project.title }} is safe for use in a multiplayer
context.
</div>
<div v-if="project.status === 'archived'" class="card warning" aria-label="Warning">
{{ project.title }} has been archived. {{ project.title }} will not receive any further
updates unless the author decides to unarchive the project.
</div>
<div
v-if="project.project_type === 'modpack'"
class="card information"
aria-label="Information"
>
To install {{ project.title }}, visit
<a href="https://docs.modrinth.com/docs/modpacks/playing_modpacks/" :target="$external()"
>our documentation</a
>
which provides instructions on using
<a href="https://atlauncher.com/about" :target="$external()" rel="noopener"> ATLauncher</a
>, <a href="https://multimc.org/" :target="$external()" rel="noopener">MultiMC</a>, and
<a href="https://prismlauncher.org" :target="$external()" rel="noopener">
Prism Launcher</a
>.
</div>
<Promotion v-if="$tag.approvedStatuses.includes(project.status)" />
<div class="navigation-card">
<NavRow
:links="[
{
label: 'Description',
href: `/${project.project_type}/${project.slug ? project.slug : project.id}`,
},
{
label: 'Gallery',
href: `/${project.project_type}/${
project.slug ? project.slug : project.id
}/gallery`,
shown: project.gallery.length > 0 || !!currentMember,
},
{
label: 'Changelog',
href: `/${project.project_type}/${
project.slug ? project.slug : project.id
}/changelog`,
shown: versions.length > 0,
},
{
label: 'Versions',
href: `/${project.project_type}/${
project.slug ? project.slug : project.id
}/versions`,
shown: versions.length > 0 || !!currentMember,
},
]"
/>
<div v-if="$auth.user && currentMember" class="input-group">
<nuxt-link
:to="`/${project.project_type}/${project.slug ? project.slug : project.id}/settings`"
class="iconified-button"
>
<SettingsIcon /> Settings
</nuxt-link>
</div>
</div>
<NuxtPage
v-model:project="project"
v-model:versions="versions"
v-model:featured-versions="featuredVersions"
v-model:members="members"
v-model:all-members="allMembers"
v-model:dependencies="dependencies"
:current-member="currentMember"
/>
</section>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -20,7 +20,7 @@
</aside> </aside>
</div> </div>
<div class="normal-page__content"> <div class="normal-page__content">
<NuxtPage /> <NuxtPage :route="route" />
</div> </div>
</div> </div>
</template> </template>
@@ -35,5 +35,7 @@ import ListIcon from '~/assets/images/utils/list.svg'
definePageMeta({ definePageMeta({
middleware: 'auth', middleware: 'auth',
}) })
const route = useRoute()
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@@ -20,12 +20,12 @@
</aside> </aside>
</div> </div>
<div class="normal-page__content"> <div class="normal-page__content">
<NuxtPage class="universal-card" /> <NuxtPage class="universal-card" :route="route" />
</div> </div>
</div> </div>
</template> </template>
<script> <script setup>
import NavStack from '~/components/ui/NavStack' import NavStack from '~/components/ui/NavStack'
import NavStackItem from '~/components/ui/NavStackItem' import NavStackItem from '~/components/ui/NavStackItem'
@@ -34,16 +34,7 @@ import PrivacyIcon from '~/assets/images/utils/lock.svg'
import RulesIcon from '~/assets/images/sidebar/admin.svg' import RulesIcon from '~/assets/images/sidebar/admin.svg'
import ShieldIcon from '~/assets/images/utils/shield.svg' import ShieldIcon from '~/assets/images/utils/shield.svg'
export default defineNuxtComponent({ const route = useRoute()
components: {
NavStack,
NavStackItem,
TermsIcon,
PrivacyIcon,
RulesIcon,
ShieldIcon,
},
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -627,7 +627,7 @@ export default defineNuxtComponent({
} }
if (offset > 0) { if (offset > 0) {
queryItems.push(`o=${offset}`) queryItems.push(`o=${offset}`)
obj.offset = offset obj.o = offset
} }
if (facets.value.length > 0) { if (facets.value.length > 0) {
queryItems.push(`f=${encodeURIComponent(facets.value)}`) queryItems.push(`f=${encodeURIComponent(facets.value)}`)

View File

@@ -23,7 +23,7 @@
</aside> </aside>
</div> </div>
<div class="normal-page__content"> <div class="normal-page__content">
<NuxtPage /> <NuxtPage :route="route" />
</div> </div>
</div> </div>
</template> </template>
@@ -35,6 +35,8 @@ import PaintbrushIcon from '~/assets/images/utils/paintbrush.svg'
import UserIcon from '~/assets/images/utils/user.svg' import UserIcon from '~/assets/images/utils/user.svg'
import HeartIcon from '~/assets/images/utils/heart.svg' import HeartIcon from '~/assets/images/utils/heart.svg'
import CurrencyIcon from '~/assets/images/utils/currency.svg' import CurrencyIcon from '~/assets/images/utils/currency.svg'
const route = useRoute()
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@@ -186,11 +186,11 @@
:class="'display-mode--' + $cosmetics.searchDisplayMode.user" :class="'display-mode--' + $cosmetics.searchDisplayMode.user"
> >
<ProjectCard <ProjectCard
v-for="project in ($route.params.projectType !== undefined v-for="project in (route.params.projectType !== undefined
? projects.filter( ? projects.filter(
(x) => (x) =>
x.project_type === x.project_type ===
$route.params.projectType.substr(0, $route.params.projectType.length - 1) route.params.projectType.substr(0, route.params.projectType.length - 1)
) )
: projects : projects
) )