-
+
+
+
+
https://modrinth.com/organization/
+
+
+
+
+
+
+
+
-
-
+
-
+
+async function clearFilters() {
+ selectedFilters.value = {};
+
+ await router.replace({
+ query: {
+ ...route.query,
+ type: undefined,
+ gameVersion: undefined,
+ platform: undefined,
+ },
+ });
+
+ emit("switch-page", 1);
+}
+
+defineExpose({
+ toggleFilter,
+ toggleFilters,
+});
+
diff --git a/apps/frontend/src/components/ui/VersionSummary.vue b/apps/frontend/src/components/ui/VersionSummary.vue
new file mode 100644
index 000000000..364b67565
--- /dev/null
+++ b/apps/frontend/src/components/ui/VersionSummary.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+ {{ version.name }}
+
+
+
+
+ Download
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/frontend/src/components/ui/modrinth-loading-indicator.ts b/apps/frontend/src/components/ui/modrinth-loading-indicator.ts
index 688a162b7..041c51ef3 100644
--- a/apps/frontend/src/components/ui/modrinth-loading-indicator.ts
+++ b/apps/frontend/src/components/ui/modrinth-loading-indicator.ts
@@ -19,7 +19,7 @@ export default defineComponent({
color: {
type: [String, Boolean],
default:
- "repeating-linear-gradient(to right, var(--color-brand-green) 0%, var(--landing-green-label) 100%)",
+ "repeating-linear-gradient(to right, var(--color-green) 0%, var(--landing-green-label) 100%)",
},
},
setup(props, { slots }) {
diff --git a/apps/frontend/src/components/ui/thread/ConversationThread.vue b/apps/frontend/src/components/ui/thread/ConversationThread.vue
index a5a17b1f8..b018558bb 100644
--- a/apps/frontend/src/components/ui/thread/ConversationThread.vue
+++ b/apps/frontend/src/components/ui/thread/ConversationThread.vue
@@ -154,8 +154,6 @@
x.id === project.id)) {
+ user.follows = user.follows.filter((x) => x.id !== project.id);
+ project.followers--;
+
+ setTimeout(() => {
+ useBaseFetch(`project/${project.id}/follow`, {
+ method: "DELETE",
+ });
});
- });
-};
-
-export const userUnfollowProject = async (project) => {
- const user = (await useUser()).value;
-
- user.follows = user.follows.filter((x) => x.id !== project.id);
- project.followers--;
-
- setTimeout(() => {
- useBaseFetch(`project/${project.id}/follow`, {
- method: "DELETE",
+ } else {
+ user.follows = user.follows.concat(project);
+ project.followers++;
+
+ setTimeout(() => {
+ useBaseFetch(`project/${project.id}/follow`, {
+ method: "POST",
+ });
});
- });
+ }
};
-
export const resendVerifyEmail = async () => {
const app = useNuxtApp();
diff --git a/apps/frontend/src/helpers/projects.js b/apps/frontend/src/helpers/projects.js
index 26de17772..5591b1b23 100644
--- a/apps/frontend/src/helpers/projects.js
+++ b/apps/frontend/src/helpers/projects.js
@@ -82,10 +82,14 @@ export const REJECTED_PROJECT_STATUSES = ["rejected", "withheld"];
export const UNDER_REVIEW_PROJECT_STATUSES = ["processing"];
export const DRAFT_PROJECT_STATUSES = ["draft"];
-export function getVersionsToDisplay(project, overrideTags) {
+export function getVersionsToDisplay(project) {
+ return formatVersionsForDisplay(project.game_versions.slice());
+}
+
+export function formatVersionsForDisplay(gameVersions, overrideTags) {
const tags = overrideTags ?? useTags().value;
- const projectVersions = project.game_versions.slice();
+ const inputVersions = gameVersions.slice();
const allVersions = tags.gameVersions.slice();
const allSnapshots = allVersions.filter((version) => version.version_type === "snapshot");
@@ -99,17 +103,17 @@ export function getVersionsToDisplay(project, overrideTags) {
map[gameVersion.version] = index;
return map;
}, {});
- projectVersions.sort((a, b) => indices[a] - indices[b]);
+ inputVersions.sort((a, b) => indices[a] - indices[b]);
}
- const releaseVersions = projectVersions.filter((projVer) =>
+ const releaseVersions = inputVersions.filter((projVer) =>
allReleases.some((gameVer) => gameVer.version === projVer),
);
const latestReleaseVersionDate = Date.parse(
allReleases.find((version) => version.version === releaseVersions[0])?.date,
);
- const latestSnapshot = projectVersions.find((projVer) =>
+ const latestSnapshot = inputVersions.find((projVer) =>
allSnapshots.some(
(gameVer) =>
gameVer.version === projVer &&
@@ -140,7 +144,7 @@ export function getVersionsToDisplay(project, overrideTags) {
});
const legacyVersionsAsRanges = groupConsecutiveIndices(
- projectVersions.filter((projVer) => allLegacy.some((gameVer) => gameVer.version === projVer)),
+ inputVersions.filter((projVer) => allLegacy.some((gameVer) => gameVer.version === projVer)),
allLegacy,
);
@@ -149,7 +153,7 @@ export function getVersionsToDisplay(project, overrideTags) {
// show all snapshots if there's no release versions
if (releaseVersionsAsRanges.length === 0) {
const snapshotVersionsAsRanges = groupConsecutiveIndices(
- projectVersions.filter((projVer) =>
+ inputVersions.filter((projVer) =>
allSnapshots.some((gameVer) => gameVer.version === projVer),
),
allSnapshots,
@@ -159,7 +163,7 @@ export function getVersionsToDisplay(project, overrideTags) {
output = [...releaseVersionsAsRanges, ...output];
}
- if (latestSnapshot) {
+ if (latestSnapshot && !output.includes(latestSnapshot)) {
output = [latestSnapshot, ...output];
}
return output;
diff --git a/apps/frontend/src/layouts/default.vue b/apps/frontend/src/layouts/default.vue
index 65d14a1c3..64db2b94c 100644
--- a/apps/frontend/src/layouts/default.vue
+++ b/apps/frontend/src/layouts/default.vue
@@ -51,292 +51,313 @@