Fix duplicate version nums + etc (#831)

* Fix duplicate version nums + etc

* Update link info

* Remove useless loading conditions

* Update pages/legal/privacy.vue

Co-authored-by: triphora <emmaffle@modrinth.com>

* Update plugins/xss.js

Co-authored-by: triphora <emmaffle@modrinth.com>

Co-authored-by: triphora <emmaffle@modrinth.com>
This commit is contained in:
Geometrically
2023-01-03 19:06:30 -07:00
committed by GitHub
parent d2b1404907
commit b4236b9a95
21 changed files with 243 additions and 263 deletions

View File

@@ -165,11 +165,19 @@
</button>
</template>
<template v-else>
<a class="iconified-button" :href="authUrl">
<a
class="iconified-button"
:href="authUrl"
rel="noopener noreferrer nofollow"
>
<ReportIcon aria-hidden="true" />
Report
</a>
<a class="iconified-button" :href="authUrl">
<a
class="iconified-button"
:href="authUrl"
rel="noopener noreferrer nofollow"
>
<HeartIcon aria-hidden="true" />
Follow
</a>
@@ -307,6 +315,7 @@
:href="project.issues_url"
class="title"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<IssuesIcon aria-hidden="true" />
<span>Issues</span>
@@ -316,6 +325,7 @@
:href="project.source_url"
class="title"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<CodeIcon aria-hidden="true" />
<span>Source</span>
@@ -325,6 +335,7 @@
:href="project.wiki_url"
class="title"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<WikiIcon aria-hidden="true" />
<span>Wiki</span>
@@ -333,6 +344,7 @@
v-if="project.discord_url"
:href="project.discord_url"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<DiscordIcon class="shrink" aria-hidden="true" />
<span>Discord</span>
@@ -342,6 +354,7 @@
:key="index"
:href="donation.url"
:target="$external()"
rel="noopener noreferrer nofollow ugc"
>
<BuyMeACoffeeLogo
v-if="donation.id === 'bmac'"
@@ -579,11 +592,24 @@
>our documentation</a
>
which provides instructions on using
<a href="https://atlauncher.com/about" :target="$external()">
<a
href="https://atlauncher.com/about"
:target="$external()"
rel="noopener noreferrer nofollow"
>
ATLauncher</a
>, <a href="https://multimc.org/" :target="$external()">MultiMC</a>,
and
<a href="https://prismlauncher.org" :target="$external()">
>,
<a
href="https://multimc.org/"
:target="$external()"
rel="noopener noreferrer nofollow"
>MultiMC</a
>, and
<a
href="https://prismlauncher.org"
:target="$external()"
rel="noopener noreferrer nofollow"
>
Prism Launcher</a
>.
</div>

View File

@@ -105,19 +105,6 @@ export default {
fetch() {
if (this.$route.query.page)
this.currentPage = parseInt(this.$route.query.page)
this.filteredVersions = this.versions.map((version, index) => {
const nextVersion = this.versions[index + 1]
if (
nextVersion &&
version.changelog &&
nextVersion.changelog === version.changelog
) {
return { duplicate: true, ...version }
} else {
return { duplicate: false, ...version }
}
})
},
head() {
const title = `${this.project.title} - Changelog`

View File

@@ -16,7 +16,6 @@
<button
title="Save"
class="iconified-button brand-button column"
:disabled="!$nuxt.$loading"
@click="saveProject"
>
<SaveIcon />
@@ -275,7 +274,7 @@
class="text-link"
href="https://guides.github.com/features/mastering-markdown/"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer nofollow"
>Markdown</a
>. HTML can also be used inside your description, not including styles,
scripts, and iframes (though YouTube iframes are allowed).
@@ -385,7 +384,7 @@
<a
href="https://spdx.org/licenses/"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer nofollow"
class="text-link"
>SPDX license identifier</a
>
@@ -399,7 +398,7 @@
<a
href="https://blog.modrinth.com/licensing-guide/"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer nofollow"
class="text-link"
>
licensing guide</a

View File

@@ -104,7 +104,6 @@
<button
v-if="editIndex === -1"
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="createGalleryItem"
>
<PlusIcon />
@@ -113,7 +112,6 @@
<button
v-else
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="editGalleryItem"
>
<SaveIcon />

View File

@@ -58,7 +58,6 @@
</button>
<button
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="createDataPackVersion"
>
<RightArrowIcon />
@@ -120,11 +119,7 @@
</ul>
</div>
<div v-if="isCreating" class="input-group">
<button
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="createVersion"
>
<button class="iconified-button brand-button" @click="createVersion">
<PlusIcon aria-hidden="true" />
Create
</button>
@@ -142,7 +137,6 @@
<div v-else-if="isEditing" class="input-group">
<button
class="iconified-button brand-button"
:disabled="!$nuxt.$loading"
@click="saveEditedVersion"
>
<SaveIcon aria-hidden="true" />
@@ -249,7 +243,7 @@
class="text-link"
href="https://guides.github.com/features/mastering-markdown/"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer nofollow"
>Markdown</a
>. HTML can also be used inside your changelog, not including styles,
scripts, and iframes.
@@ -1081,6 +1075,22 @@ export default {
(x) => x.displayUrlEnding === this.$route.params.version
)
// LEGACY- to support old duplicate version URLs
const dashIndex = this.$route.params.version.indexOf('-')
if (!this.version && dashIndex !== -1) {
const version = this.versions.find(
(x) =>
x.displayUrlEnding ===
this.$route.params.version.substring(0, dashIndex)
)
this.$nuxt.context.redirect(
301,
`/${this.project.project_type}/${this.project.slug}/version/${version.version_number}`
)
return
}
if (!this.version) {
this.$nuxt.context.error({
statusCode: 404,