You've already forked AstralRinth
forked from didirus/AstralRinth
Add TailwindCSS (#1252)
* Setup TailwindCSS * Fully setup configuration * Refactor some tailwind variables
This commit is contained in:
@@ -253,7 +253,7 @@
|
||||
>
|
||||
<div
|
||||
v-for="(option, index) in selectedOptions[steps[currentStepIndex].id].filter(
|
||||
(x) => x.fillers && x.fillers.length > 0
|
||||
(x) => x.fillers && x.fillers.length > 0,
|
||||
)"
|
||||
:key="index"
|
||||
>
|
||||
@@ -339,9 +339,9 @@ import {
|
||||
XIcon as CrossIcon,
|
||||
EyeOffIcon,
|
||||
ExitIcon,
|
||||
} from '@modrinth/assets'
|
||||
import { MarkdownEditor, OverflowMenu } from '@modrinth/ui'
|
||||
import Categories from '~/components/ui/search/Categories.vue'
|
||||
} from "@modrinth/assets";
|
||||
import { MarkdownEditor, OverflowMenu } from "@modrinth/ui";
|
||||
import Categories from "~/components/ui/search/Categories.vue";
|
||||
|
||||
const props = defineProps({
|
||||
project: {
|
||||
@@ -357,72 +357,72 @@ const props = defineProps({
|
||||
required: true,
|
||||
default: () => {},
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
const steps = computed(() =>
|
||||
[
|
||||
{
|
||||
id: 'title',
|
||||
question: 'Is this title free of useless information?',
|
||||
id: "title",
|
||||
question: "Is this title free of useless information?",
|
||||
shown: true,
|
||||
rules: [
|
||||
'No unnecessary data (mod loaders, game versions, etc)',
|
||||
'No emojis / useless text decorators',
|
||||
"No unnecessary data (mod loaders, game versions, etc)",
|
||||
"No emojis / useless text decorators",
|
||||
],
|
||||
examples: [
|
||||
'✅ NoobMod [1.8+] • Kill all noobs in your world!',
|
||||
'[FABRIC] My Optimization Pack',
|
||||
'[1.17-1.20.4] LagFixer ⚡️ Best Performance Solution! ⭕ Well optimized ✅ Folia supported! (BETA)',
|
||||
"✅ NoobMod [1.8+] • Kill all noobs in your world!",
|
||||
"[FABRIC] My Optimization Pack",
|
||||
"[1.17-1.20.4] LagFixer ⚡️ Best Performance Solution! ⭕ Well optimized ✅ Folia supported! (BETA)",
|
||||
],
|
||||
exceptions: [
|
||||
'Loaders and/or game versions allowed if this project is a port of another mod. (ex: Gravestones for 1.20)',
|
||||
'Loaders allowed if they choose to separate their project into Forge and Fabric variants (discouraged)',
|
||||
"Loaders and/or game versions allowed if this project is a port of another mod. (ex: Gravestones for 1.20)",
|
||||
"Loaders allowed if they choose to separate their project into Forge and Fabric variants (discouraged)",
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'Contains useless info',
|
||||
name: "Contains useless info",
|
||||
resultingMessage: `## Misuse of Title
|
||||
Per section 5.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) we ask that you limit the title to just the name of your project. Additional information, such as themes, tags, supported versions or loaders, etc. should be saved for the Summary or Description. When changing your project title, remember to also ensure that your project slug (URL) matches and accurately represents your project.`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'slug',
|
||||
question: 'Is the slug accurate and appropriate?',
|
||||
id: "slug",
|
||||
question: "Is the slug accurate and appropriate?",
|
||||
shown: true,
|
||||
rules: ['Matches title / not misleading (acronyms are OK)'],
|
||||
rules: ["Matches title / not misleading (acronyms are OK)"],
|
||||
options: [
|
||||
{
|
||||
name: 'Misused',
|
||||
name: "Misused",
|
||||
resultingMessage: `## Misuse of Slug
|
||||
Per section 5.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) your project slug (URL) must accurately represent your project. `,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'summary',
|
||||
id: "summary",
|
||||
question: `Is the project's summary sufficient?`,
|
||||
shown: true,
|
||||
rules: [
|
||||
'The summary should provide a brief overview of your project that informs and entices users.',
|
||||
"The summary should provide a brief overview of your project that informs and entices users.",
|
||||
`Should not be the exact same as the project's title`,
|
||||
'Should not include any markdown formatting.',
|
||||
"Should not include any markdown formatting.",
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'Insufficient',
|
||||
name: "Insufficient",
|
||||
resultingMessage: `## Insufficient Summary
|
||||
Per section 5.3 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) Your project summary should provide a brief overview of your project that informs and entices users.
|
||||
This is the first thing most people will see about your mod other than the Logo, so it's important it be accurate, reasonably detailed, and exciting.`,
|
||||
},
|
||||
{
|
||||
name: 'Repeat of title',
|
||||
name: "Repeat of title",
|
||||
resultingMessage: `## Insufficient Summary
|
||||
Per section 5.3 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) your Summary can not be the same as your project's Title. Your project summary should provide a brief overview of your project that informs and entices users.
|
||||
This is the first thing most people will see about your mod other than the Logo, so it's important it be accurate, reasonably detailed, and exciting.`,
|
||||
},
|
||||
{
|
||||
name: 'Formatting',
|
||||
name: "Formatting",
|
||||
resultingMessage: `## Insufficient Summary
|
||||
Per section 5.3 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) your Summary can not include any extra formatting such as lists, or links. Your project summary should provide a brief overview of your project that informs and entices users.
|
||||
This is the first thing most people will see about your mod other than the Logo, so it's important it be accurate, reasonably detailed, and exciting.`,
|
||||
@@ -430,33 +430,33 @@ This is the first thing most people will see about your mod other than the Logo,
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'description',
|
||||
id: "description",
|
||||
question: `Is the project's description sufficient?`,
|
||||
navigate: `/${props.project.project_type}/${props.project.slug}`,
|
||||
shown: true,
|
||||
rules: [
|
||||
'Should answer what the project specifically does or adds ',
|
||||
'Should answer why someone should want to download the project ',
|
||||
'Should indicate any other critical information the user must know before downloading',
|
||||
'Should be accessible (no fancy characters / non-standard text, no image-only descriptions, must have English component, etc)',
|
||||
"Should answer what the project specifically does or adds ",
|
||||
"Should answer why someone should want to download the project ",
|
||||
"Should indicate any other critical information the user must know before downloading",
|
||||
"Should be accessible (no fancy characters / non-standard text, no image-only descriptions, must have English component, etc)",
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'Insufficient',
|
||||
name: "Insufficient",
|
||||
resultingMessage: `## Insufficient Description
|
||||
Per section 2.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#general-expectations) your project's Description should clearly inform the reader of the content, purpose, and appeal of your project.
|
||||
Currently, it looks like there are some missing details.
|
||||
%EXPLAINER%`,
|
||||
fillers: [
|
||||
{
|
||||
id: 'EXPLAINER',
|
||||
question: 'Please elaborate on how the author can improve their description.',
|
||||
id: "EXPLAINER",
|
||||
question: "Please elaborate on how the author can improve their description.",
|
||||
large: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Insufficient (default packs)',
|
||||
name: "Insufficient (default packs)",
|
||||
resultingMessage: `## Insufficient Description
|
||||
Per section 2.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#general-expectations) your project's Description should clearly inform the reader of the content, purpose, and appeal of your project.
|
||||
Currently, it looks like there are some missing details.
|
||||
@@ -465,7 +465,7 @@ See descriptions like [Simply Optimized](https://modrinth.com/modpack/sop) or [A
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'Insufficient (default projects)',
|
||||
name: "Insufficient (default projects)",
|
||||
resultingMessage: `## Insufficient Description
|
||||
Per section 2.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#general-expectations) your project's Description should clearly inform the reader of the content, purpose, and appeal of your project.
|
||||
Currently, it looks like there are some missing details.
|
||||
@@ -474,35 +474,35 @@ See descriptions like [Sodium](https://modrinth.com/mod/sodium) or [LambDynamicL
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: 'Non-english',
|
||||
name: "Non-english",
|
||||
resultingMessage: `## No English Description
|
||||
Per section 2.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#accessibility) a project's Summary and Description must be in English, unless meant exclusively for non-English use, such as translations. You may include your non-English Description if you would like but we ask that you also add an English translation of the Description to your Description page, if you would like to use an online translator to do this, we recommend [DeepL](https://www.deepl.com/translator).`,
|
||||
},
|
||||
{
|
||||
name: 'Unfinished',
|
||||
name: "Unfinished",
|
||||
resultingMessage: `## Unfinished Description
|
||||
It looks like your project Description is still a WIP seeing as %REASON%. Please remember to submit only when ready, as it is important your project meets the requirements of Section 2.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#general-expectations), if you have any questions on this feel free to reach out!`,
|
||||
},
|
||||
{
|
||||
name: 'Headers as body text',
|
||||
name: "Headers as body text",
|
||||
resultingMessage: `## Description Accessibility
|
||||
In accordance with section 2.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules) we request that \`# header\`s not be used as body text. Headers are interpreted differently by screen-readers and thus should generally only be used for things like separating sections of your Description. If you would like to emphasize a particular sentence or paragraph, instead consider using \`**bold**\` text using the **B** button above the text editor.`,
|
||||
},
|
||||
{
|
||||
name: 'Image-only',
|
||||
name: "Image-only",
|
||||
resultingMessage: `## Image Descriptions
|
||||
In accordance with section 2.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules) we ask that you provide a text alternative to your current Description. It is important that your Description contains enough detail about your project that a user can have a full understanding of it from text alone. A text-based transcription allows for those using screen readers, and users with slow internet connections unable to load images to be able to access the contents of your Description. This also acts as a backup in case the image in your Description ever goes offline for some reason.
|
||||
We appreciate how much effort you put into your Description, but accessibility is important to us at Modrinth, if you would like you could put the transcription of your Description entirely in a \`details\` tag, so as to not spoil the visuals of your Description.`,
|
||||
},
|
||||
{
|
||||
name: 'Non-standard text',
|
||||
name: "Non-standard text",
|
||||
resultingMessage: `## Description Accessibility
|
||||
Per section 2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#clear-and-honest-function) your description must be plainly readable and accessible. Using non-standard text characters like Zalgo or "fancy text" in place of text anywhere in your project, including the Description, Summary, or Title can make your project pages inaccessible. This is important for users who rely on Screen Readers and for search engines in order to provide relevant results to users. Please remove any instances of this type of text.`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'links',
|
||||
id: "links",
|
||||
question: `Are the project's links accessible and not misleading?`,
|
||||
shown:
|
||||
props.project.issues_url ||
|
||||
@@ -516,49 +516,49 @@ Per section 2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#cle
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'Links are misused',
|
||||
name: "Links are misused",
|
||||
resultingMessage: `## Misuse of External Resources
|
||||
Per section 5.4 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) all links must lead to correctly labeled publicly available resources that are directly related to your project.`,
|
||||
},
|
||||
{
|
||||
name: 'Not accessible (source)',
|
||||
name: "Not accessible (source)",
|
||||
resultingMessage: `## Unreachable Links
|
||||
Per section 5.4 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) all links must lead to correctly labeled publicly available resources that are directly related to your project.
|
||||
Currently, your Source link directs to a Page Not Found error, likely because your repository is private, make sure to make your repository public before resubmitting your project!`,
|
||||
},
|
||||
{
|
||||
name: 'Not accessible (other)',
|
||||
name: "Not accessible (other)",
|
||||
resultingMessage: `## Unreachable Links
|
||||
Per section 5.4 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) all links must lead to correctly labeled publicly available resources that are directly related to your project.
|
||||
Currently, your %LINK% link is inaccessible!`,
|
||||
fillers: [
|
||||
{
|
||||
id: 'LINK',
|
||||
question: 'Please specify the link type that is inaccessible.',
|
||||
id: "LINK",
|
||||
question: "Please specify the link type that is inaccessible.",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'categories',
|
||||
id: "categories",
|
||||
question: `Are the project's tags/categories accurate?`,
|
||||
shown: props.project.categories.length > 0 || props.project.additional_categories.length > 0,
|
||||
options: [
|
||||
{
|
||||
name: 'Inaccurate',
|
||||
name: "Inaccurate",
|
||||
resultingMessage: `## Misuse of Tags
|
||||
Per section 5.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous), it is important that the metadata of your projects is accurate. Including that selected tags honestly represent your project.`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'side-types',
|
||||
id: "side-types",
|
||||
question: `Is the project's environment information accurate?`,
|
||||
shown: ['mod', 'modpack'].includes(props.project.project_type),
|
||||
shown: ["mod", "modpack"].includes(props.project.project_type),
|
||||
options: [
|
||||
{
|
||||
name: 'Inaccurate (modpack)',
|
||||
name: "Inaccurate (modpack)",
|
||||
resultingMessage: `## Incorrect Environment Information
|
||||
Per section 5.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous), it is important that the metadata of your projects is accurate, including whether the project runs on the client or server side.
|
||||
For a brief rundown of how this works:
|
||||
@@ -567,7 +567,7 @@ Most other modpacks that change how the game is played are going to be required
|
||||
When in doubt, test for yourself or check the requirements of the mods in your pack.`,
|
||||
},
|
||||
{
|
||||
name: 'Inaccurate (mod)',
|
||||
name: "Inaccurate (mod)",
|
||||
resultingMessage: `## Environment Information
|
||||
Per section 5.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous), it is important that the metadata of your projects is accurate, including whether the project runs on the client or server side.
|
||||
For a brief rundown of how this works:
|
||||
@@ -578,48 +578,48 @@ A mod that adds features, entities, or new blocks and items, generally will be r
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'gallery',
|
||||
id: "gallery",
|
||||
navigate: `/${props.project.project_type}/${props.project.slug}/gallery`,
|
||||
question: `Are the project's gallery images relevant?`,
|
||||
shown: props.project.gallery.length > 0,
|
||||
options: [
|
||||
{
|
||||
name: 'Not relevant',
|
||||
name: "Not relevant",
|
||||
resultingMessage: `## Unrelated Gallery Images
|
||||
Per section 5.5 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) any images in your project's Gallery must be relevant to the project and also include a Title.`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'versions',
|
||||
id: "versions",
|
||||
navigate: `/${props.project.project_type}/${props.project.slug}/versions`,
|
||||
question: `Are these project's files correct?`,
|
||||
shown: !['modpack'].includes(props.project.project_type),
|
||||
shown: !["modpack"].includes(props.project.project_type),
|
||||
rules: [
|
||||
'A multi-loader project should not use additional files for more loaders',
|
||||
'Modpacks must be uploaded as MRPACK files. Be sure to check the project type is modpack (if not their file is malformed)',
|
||||
"A multi-loader project should not use additional files for more loaders",
|
||||
"Modpacks must be uploaded as MRPACK files. Be sure to check the project type is modpack (if not their file is malformed)",
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'Incorrect additional files',
|
||||
name: "Incorrect additional files",
|
||||
resultingMessage: `## Incorrect Use of Additional Files
|
||||
It looks like you've uploaded multiple \`mod.jar\` files to one Version as Additional Files. Per section 5.7 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) each Version of your project must include only one \`mod.jar\` that corresponds to its respective Minecraft and loader versions. This allows users to easily find and download the file they need for the version they're on with ease. The Additional Files feature can be used for things like a \`Sources.jar\`.
|
||||
Please upload each version of your mod separately, thank you.`,
|
||||
},
|
||||
{
|
||||
name: 'Invalid file type (modpacks)',
|
||||
name: "Invalid file type (modpacks)",
|
||||
resultingMessage: `## Modpacks on Modrinth
|
||||
It looks like you've uploaded your Modpack as a \`.zip\`, unfortunately, this is invalid and is why your project type is "Mod". I recommend taking a look at our support page about [Modrinth Modpacks](https://support.modrinth.com/en/articles/8802250-modpacks-on-modrinth), and once you're ready feel free to resubmit your project as a \`.mrpack\`. Don't forget to delete the old files from your Versions!`,
|
||||
},
|
||||
{
|
||||
name: 'Invalid file type (resourcepacks)',
|
||||
name: "Invalid file type (resourcepacks)",
|
||||
resultingMessage: `## Resource Packs on Modrinth
|
||||
It looks like you've selected loaders for your Resource Pack that are causing it to be marked as a different project type. Resource Packs must only be uploaded with the "Resource Pack" loader selected. Please re-upload all versions of your resource pack and make sure to only select "Resource Pack" as the loader.`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'copyright',
|
||||
id: "copyright",
|
||||
question: `Does the author have proper permissions to post this project?`,
|
||||
shown: true,
|
||||
rules: [
|
||||
@@ -628,20 +628,20 @@ It looks like you've selected loaders for your Resource Pack that are causing it
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'Re-upload',
|
||||
name: "Re-upload",
|
||||
resultingMessage: `## Reuploads are forbidden
|
||||
This project appears to contain content from %ORIGINAL_PROJECT% by %ORIGINAL_AUTHOR%.
|
||||
Per section 4 of [Modrinth's Content Rules](https://modrinth.com/legal/rules) this is strictly forbidden.
|
||||
If you believe this is an error, or you can verify you are the creator and rightful owner of this content please let us know. Otherwise, we ask that you **do not resubmit this project**.`,
|
||||
fillers: [
|
||||
{
|
||||
id: 'ORIGINAL_PROJECT',
|
||||
question: 'What is the title of the original project?',
|
||||
id: "ORIGINAL_PROJECT",
|
||||
question: "What is the title of the original project?",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
id: 'ORIGINAL_AUTHOR',
|
||||
question: 'What is the author of the original project?',
|
||||
id: "ORIGINAL_AUTHOR",
|
||||
question: "What is the author of the original project?",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
@@ -649,25 +649,25 @@ If you believe this is an error, or you can verify you are the creator and right
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'rule-following',
|
||||
id: "rule-following",
|
||||
question: `Does this project follow our content rules?`,
|
||||
navigate: `/${props.project.project_type}/${props.project.slug}`,
|
||||
shown: true,
|
||||
rules: [
|
||||
'Should not be a cheat/hack (without a server-side opt-out)',
|
||||
'Should not contain sexually explicit / inappropriate content',
|
||||
'Should not be excessively profane',
|
||||
'Should not promote any illegal activity (including illicit drugs + substances)',
|
||||
'Anything else infringing of our content rules (see 1.1-12, 3.1-3)',
|
||||
"Should not be a cheat/hack (without a server-side opt-out)",
|
||||
"Should not contain sexually explicit / inappropriate content",
|
||||
"Should not be excessively profane",
|
||||
"Should not promote any illegal activity (including illicit drugs + substances)",
|
||||
"Anything else infringing of our content rules (see 1.1-12, 3.1-3)",
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'No',
|
||||
name: "No",
|
||||
resultingMessage: `%MESSAGE%`,
|
||||
fillers: [
|
||||
{
|
||||
id: 'MESSAGE',
|
||||
question: 'Please explain to the user how it infringes on our content rules.',
|
||||
id: "MESSAGE",
|
||||
question: "Please explain to the user how it infringes on our content rules.",
|
||||
large: true,
|
||||
},
|
||||
],
|
||||
@@ -675,88 +675,88 @@ If you believe this is an error, or you can verify you are the creator and right
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'modpack-permissions',
|
||||
question: 'Modpack permissions',
|
||||
shown: ['modpack'].includes(props.project.project_type),
|
||||
id: "modpack-permissions",
|
||||
question: "Modpack permissions",
|
||||
shown: ["modpack"].includes(props.project.project_type),
|
||||
options: [],
|
||||
},
|
||||
{
|
||||
id: 'private-server',
|
||||
id: "private-server",
|
||||
question: `Is this pack for a private server?`,
|
||||
shown: ['modpack'].includes(props.project.project_type),
|
||||
shown: ["modpack"].includes(props.project.project_type),
|
||||
rules: [
|
||||
'Select this if you are withholding this pack since it is for a private server (for circumstances you would normally reject for).',
|
||||
"Select this if you are withholding this pack since it is for a private server (for circumstances you would normally reject for).",
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'Private server (withhold)',
|
||||
name: "Private server (withhold)",
|
||||
resultingMessage: `## Private Server
|
||||
Under normal circumstances, your project would be rejected due to the issues listed above. However, since your project is intended for a specific server and not for general use, these requirements will be waived and your project will be withheld. This means it will be unlisted and accessible only through a direct link, without appearing in public search results. If you're fine with this, no further action is needed. Otherwise, feel free to resubmit once all issues have been addressed. `,
|
||||
},
|
||||
],
|
||||
},
|
||||
].filter((x) => x.shown)
|
||||
)
|
||||
].filter((x) => x.shown),
|
||||
);
|
||||
|
||||
const currentStepIndex = ref(0)
|
||||
const selectedOptions = ref({})
|
||||
const currentStepIndex = ref(0);
|
||||
const selectedOptions = ref({});
|
||||
|
||||
function toggleOption(stepId, option) {
|
||||
if (!selectedOptions.value[stepId]) {
|
||||
selectedOptions.value[stepId] = []
|
||||
selectedOptions.value[stepId] = [];
|
||||
}
|
||||
|
||||
const index = selectedOptions.value[stepId].findIndex((x) => x.name === option.name)
|
||||
const index = selectedOptions.value[stepId].findIndex((x) => x.name === option.name);
|
||||
if (index === -1) {
|
||||
selectedOptions.value[stepId].push(option)
|
||||
selectedOptions.value[stepId].push(option);
|
||||
} else {
|
||||
selectedOptions.value[stepId].splice(index, 1)
|
||||
selectedOptions.value[stepId].splice(index, 1);
|
||||
}
|
||||
|
||||
const instance = getCurrentInstance()
|
||||
instance?.proxy?.$forceUpdate()
|
||||
const instance = getCurrentInstance();
|
||||
instance?.proxy?.$forceUpdate();
|
||||
}
|
||||
|
||||
function previousPage() {
|
||||
currentStepIndex.value -= 1
|
||||
generatedMessage.value = false
|
||||
currentStepIndex.value -= 1;
|
||||
generatedMessage.value = false;
|
||||
|
||||
if (steps.value[currentStepIndex.value].navigate) {
|
||||
navigateTo(steps.value[currentStepIndex.value].navigate)
|
||||
navigateTo(steps.value[currentStepIndex.value].navigate);
|
||||
}
|
||||
}
|
||||
|
||||
async function nextPage() {
|
||||
currentStepIndex.value += 1
|
||||
currentStepIndex.value += 1;
|
||||
|
||||
if (steps.value[currentStepIndex.value].navigate) {
|
||||
navigateTo(steps.value[currentStepIndex.value].navigate)
|
||||
navigateTo(steps.value[currentStepIndex.value].navigate);
|
||||
}
|
||||
|
||||
if (steps.value[currentStepIndex.value].id === 'modpack-permissions') {
|
||||
await initializeModPackData()
|
||||
if (steps.value[currentStepIndex.value].id === "modpack-permissions") {
|
||||
await initializeModPackData();
|
||||
}
|
||||
}
|
||||
|
||||
async function initializeModPackData() {
|
||||
startLoading()
|
||||
startLoading();
|
||||
try {
|
||||
const raw = await useBaseFetch(`moderation/project/${props.project.id}`, { internal: true })
|
||||
const projects = []
|
||||
const raw = await useBaseFetch(`moderation/project/${props.project.id}`, { internal: true });
|
||||
const projects = [];
|
||||
|
||||
for (const [hash, fileName] of Object.entries(raw.unknown_files)) {
|
||||
projects.push({
|
||||
type: 'unknown',
|
||||
type: "unknown",
|
||||
hash,
|
||||
file_name: fileName,
|
||||
status: null,
|
||||
approved: null,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
for (const [hash, file] of Object.entries(raw.flame_files)) {
|
||||
projects.push({
|
||||
type: 'flame',
|
||||
type: "flame",
|
||||
hash,
|
||||
file_name: file.file_name,
|
||||
status: null,
|
||||
@@ -764,130 +764,130 @@ async function initializeModPackData() {
|
||||
id: file.id,
|
||||
url: file.url,
|
||||
approved: null,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
for (const [hash, file] of Object.entries(raw.identified)) {
|
||||
if (file.status !== 'yes' && file.status !== 'with-attribution-and-source') {
|
||||
if (file.status !== "yes" && file.status !== "with-attribution-and-source") {
|
||||
projects.push({
|
||||
type: 'identified',
|
||||
type: "identified",
|
||||
hash,
|
||||
file_name: file.file_name,
|
||||
status: file.status,
|
||||
approved: null,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
modPackData.value = projects
|
||||
modPackData.value = projects;
|
||||
} catch (err) {
|
||||
const app = useNuxtApp()
|
||||
const app = useNuxtApp();
|
||||
app.$notify({
|
||||
group: 'main',
|
||||
title: 'An error occurred',
|
||||
group: "main",
|
||||
title: "An error occurred",
|
||||
text: err.data ? err.data.description : err,
|
||||
type: 'error',
|
||||
})
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
stopLoading()
|
||||
stopLoading();
|
||||
}
|
||||
|
||||
const modPackData = ref(null)
|
||||
const modPackIndex = ref(0)
|
||||
const modPackData = ref(null);
|
||||
const modPackIndex = ref(0);
|
||||
|
||||
const fileApprovalTypes = ref([
|
||||
{
|
||||
id: 'yes',
|
||||
name: 'Yes',
|
||||
id: "yes",
|
||||
name: "Yes",
|
||||
},
|
||||
{
|
||||
id: 'with-attribution-and-source',
|
||||
name: 'With attribution and source',
|
||||
id: "with-attribution-and-source",
|
||||
name: "With attribution and source",
|
||||
},
|
||||
{
|
||||
id: 'with-attribution',
|
||||
name: 'With attribution',
|
||||
id: "with-attribution",
|
||||
name: "With attribution",
|
||||
},
|
||||
{
|
||||
id: 'no',
|
||||
name: 'No',
|
||||
id: "no",
|
||||
name: "No",
|
||||
},
|
||||
{
|
||||
id: 'permanent-no',
|
||||
name: 'Permanent no',
|
||||
id: "permanent-no",
|
||||
name: "Permanent no",
|
||||
},
|
||||
{
|
||||
id: 'unidentified',
|
||||
name: 'Unidentified',
|
||||
id: "unidentified",
|
||||
name: "Unidentified",
|
||||
},
|
||||
])
|
||||
]);
|
||||
const filePermissionTypes = ref([
|
||||
{
|
||||
id: true,
|
||||
name: 'Yes',
|
||||
name: "Yes",
|
||||
},
|
||||
{
|
||||
id: false,
|
||||
name: 'No',
|
||||
name: "No",
|
||||
},
|
||||
])
|
||||
]);
|
||||
|
||||
const message = ref('')
|
||||
const generatedMessage = ref(false)
|
||||
const loadingMessage = ref(false)
|
||||
const message = ref("");
|
||||
const generatedMessage = ref(false);
|
||||
const loadingMessage = ref(false);
|
||||
async function generateMessage() {
|
||||
message.value = ''
|
||||
loadingMessage.value = true
|
||||
message.value = "";
|
||||
loadingMessage.value = true;
|
||||
function printMods(mods, msg) {
|
||||
if (mods.length === 0) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
message.value += msg
|
||||
message.value += '\n\n'
|
||||
message.value += msg;
|
||||
message.value += "\n\n";
|
||||
|
||||
for (const mod of mods) {
|
||||
message.value += `- ${mod}\n`
|
||||
message.value += `- ${mod}\n`;
|
||||
}
|
||||
}
|
||||
|
||||
if (modPackData.value && modPackData.value.length > 0) {
|
||||
const updateProjects = {}
|
||||
const updateProjects = {};
|
||||
|
||||
const attributeMods = []
|
||||
const noMods = []
|
||||
const permanentNoMods = []
|
||||
const unidentifiedMods = []
|
||||
const attributeMods = [];
|
||||
const noMods = [];
|
||||
const permanentNoMods = [];
|
||||
const unidentifiedMods = [];
|
||||
|
||||
for (const project of modPackData.value) {
|
||||
if (project.type === 'unknown') {
|
||||
if (project.type === "unknown") {
|
||||
updateProjects[project.hash] = {
|
||||
type: 'unknown',
|
||||
type: "unknown",
|
||||
status: project.status,
|
||||
proof: project.proof,
|
||||
title: project.title,
|
||||
link: project.url,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (project.type === 'flame') {
|
||||
if (project.type === "flame") {
|
||||
updateProjects[project.hash] = {
|
||||
type: 'flame',
|
||||
type: "flame",
|
||||
status: project.status,
|
||||
id: project.id,
|
||||
link: project.url,
|
||||
title: project.title,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (project.status === 'with-attribution' && !project.approved) {
|
||||
attributeMods.push(project.file_name)
|
||||
} else if (project.status === 'unidentified' && !project.approved) {
|
||||
unidentifiedMods.push(project.file_name)
|
||||
} else if (project.status === 'no' && !project.approved) {
|
||||
noMods.push(project.file_name)
|
||||
} else if (project.status === 'permanent-no') {
|
||||
permanentNoMods.push(project.file_name)
|
||||
if (project.status === "with-attribution" && !project.approved) {
|
||||
attributeMods.push(project.file_name);
|
||||
} else if (project.status === "unidentified" && !project.approved) {
|
||||
unidentifiedMods.push(project.file_name);
|
||||
} else if (project.status === "no" && !project.approved) {
|
||||
noMods.push(project.file_name);
|
||||
} else if (project.status === "permanent-no") {
|
||||
permanentNoMods.push(project.file_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -895,17 +895,17 @@ async function generateMessage() {
|
||||
try {
|
||||
await useBaseFetch(`moderation/project`, {
|
||||
internal: true,
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
body: updateProjects,
|
||||
})
|
||||
});
|
||||
} catch (err) {
|
||||
const app = useNuxtApp()
|
||||
const app = useNuxtApp();
|
||||
app.$notify({
|
||||
group: 'main',
|
||||
title: 'An error occurred',
|
||||
group: "main",
|
||||
title: "An error occurred",
|
||||
text: err.data ? err.data.description : err,
|
||||
type: 'error',
|
||||
})
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -915,106 +915,109 @@ async function generateMessage() {
|
||||
permanentNoMods.length > 0 ||
|
||||
unidentifiedMods.length > 0
|
||||
) {
|
||||
message.value += '## Copyrighted Content \n'
|
||||
message.value += "## Copyrighted Content \n";
|
||||
|
||||
printMods(
|
||||
attributeMods,
|
||||
"The following content has attribution requirements, meaning that you must link back to the page where you originally found this content in your modpack description or version changelog (e.g. linking a mod's CurseForge page if you got it from CurseForge):"
|
||||
)
|
||||
"The following content has attribution requirements, meaning that you must link back to the page where you originally found this content in your modpack description or version changelog (e.g. linking a mod's CurseForge page if you got it from CurseForge):",
|
||||
);
|
||||
printMods(
|
||||
noMods,
|
||||
'The following content is not allowed in Modrinth modpacks due to licensing restrictions. Please contact the author(s) directly for permission or remove the content from your modpack:'
|
||||
)
|
||||
"The following content is not allowed in Modrinth modpacks due to licensing restrictions. Please contact the author(s) directly for permission or remove the content from your modpack:",
|
||||
);
|
||||
printMods(
|
||||
permanentNoMods,
|
||||
"The following content is not allowed in Modrinth modpacks, regardless of permission obtained. This may be because it breaks Modrinth's content rules or because the authors, upon being contacted for permission, have declined. Please remove the content from your modpack:"
|
||||
)
|
||||
"The following content is not allowed in Modrinth modpacks, regardless of permission obtained. This may be because it breaks Modrinth's content rules or because the authors, upon being contacted for permission, have declined. Please remove the content from your modpack:",
|
||||
);
|
||||
printMods(
|
||||
unidentifiedMods,
|
||||
'The following content could not be identified. Please provide proof of its origin along with proof that you have permission to include it:'
|
||||
)
|
||||
"The following content could not be identified. Please provide proof of its origin along with proof that you have permission to include it:",
|
||||
);
|
||||
|
||||
message.value += '\n\n'
|
||||
message.value += "\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
for (const options of Object.values(selectedOptions.value)) {
|
||||
for (const option of options) {
|
||||
let addonMessage = option.resultingMessage
|
||||
let addonMessage = option.resultingMessage;
|
||||
|
||||
if (option.fillers && option.fillers.length > 0) {
|
||||
for (const filler of option.fillers) {
|
||||
addonMessage = addonMessage.replace(new RegExp(`%${filler.id}%`, 'g'), filler.value ?? '')
|
||||
addonMessage = addonMessage.replace(
|
||||
new RegExp(`%${filler.id}%`, "g"),
|
||||
filler.value ?? "",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
message.value += addonMessage
|
||||
message.value += '\n\n'
|
||||
message.value += addonMessage;
|
||||
message.value += "\n\n";
|
||||
}
|
||||
}
|
||||
generatedMessage.value = true
|
||||
loadingMessage.value = false
|
||||
currentStepIndex.value += 1
|
||||
await navigateTo(`/${props.project.project_type}/${props.project.slug}/moderation`)
|
||||
generatedMessage.value = true;
|
||||
loadingMessage.value = false;
|
||||
currentStepIndex.value += 1;
|
||||
await navigateTo(`/${props.project.project_type}/${props.project.slug}/moderation`);
|
||||
}
|
||||
|
||||
const done = ref(false)
|
||||
const done = ref(false);
|
||||
async function sendMessage(status) {
|
||||
startLoading()
|
||||
startLoading();
|
||||
try {
|
||||
await useBaseFetch(`project/${props.project.id}`, {
|
||||
method: 'PATCH',
|
||||
method: "PATCH",
|
||||
body: {
|
||||
status,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
if (message.value) {
|
||||
await useBaseFetch(`thread/${props.project.thread_id}`, {
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
body: {
|
||||
body: {
|
||||
type: 'text',
|
||||
type: "text",
|
||||
body: message.value,
|
||||
},
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
await props.resetProject()
|
||||
done.value = true
|
||||
await props.resetProject();
|
||||
done.value = true;
|
||||
} catch (err) {
|
||||
const app = useNuxtApp()
|
||||
const app = useNuxtApp();
|
||||
app.$notify({
|
||||
group: 'main',
|
||||
title: 'An error occurred',
|
||||
group: "main",
|
||||
title: "An error occurred",
|
||||
text: err.data ? err.data.description : err,
|
||||
type: 'error',
|
||||
})
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
stopLoading()
|
||||
stopLoading();
|
||||
}
|
||||
|
||||
const router = useNativeRouter()
|
||||
const router = useNativeRouter();
|
||||
|
||||
async function goToNextProject() {
|
||||
const project = props.futureProjects[0]
|
||||
const project = props.futureProjects[0];
|
||||
|
||||
if (!project) {
|
||||
await navigateTo('/moderation/review')
|
||||
await navigateTo("/moderation/review");
|
||||
}
|
||||
|
||||
await router.push({
|
||||
name: 'type-id',
|
||||
name: "type-id",
|
||||
params: {
|
||||
type: 'project',
|
||||
type: "project",
|
||||
id: project,
|
||||
},
|
||||
state: {
|
||||
showChecklist: true,
|
||||
projects: props.futureProjects.slice(1),
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1042,7 +1045,9 @@ async function goToNextProject() {
|
||||
.option-selected {
|
||||
color: var(--color-contrast);
|
||||
background-color: var(--color-brand-highlight);
|
||||
box-shadow: inset 0 0 0 transparent, 0 0 0 2px var(--color-brand);
|
||||
box-shadow:
|
||||
inset 0 0 0 transparent,
|
||||
0 0 0 2px var(--color-brand);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user