You've already forked AstralRinth
forked from didirus/AstralRinth
Merge
This commit is contained in:
|
Before Width: | Height: | Size: 921 B After Width: | Height: | Size: 921 B |
@@ -1,59 +1,59 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="categories">
|
<div class="categories">
|
||||||
<p v-if="categories.includes('fabric')">
|
<p v-if="categories.includes('fabric')">
|
||||||
<FabricLoader />
|
<FabricLoader aria-hidden="true" />
|
||||||
Fabric
|
Fabric
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('forge')">
|
<p v-if="categories.includes('forge')">
|
||||||
<ForgeLoader />
|
<ForgeLoader aria-hidden="true" />
|
||||||
Forge
|
Forge
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('technology')">
|
<p v-if="categories.includes('technology')">
|
||||||
<TechCategory />
|
<TechCategory aria-hidden="true" />
|
||||||
Technology
|
Technology
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('adventure')">
|
<p v-if="categories.includes('adventure')">
|
||||||
<AdventureCategory />
|
<AdventureCategory aria-hidden="true" />
|
||||||
Adventure
|
Adventure
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('magic')">
|
<p v-if="categories.includes('magic')">
|
||||||
<MagicCategory />
|
<MagicCategory aria-hidden="true" />
|
||||||
Magic
|
Magic
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('utility')">
|
<p v-if="categories.includes('utility')">
|
||||||
<UtilityCategory />
|
<UtilityCategory aria-hidden="true" />
|
||||||
Utility
|
Utility
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('decoration')">
|
<p v-if="categories.includes('decoration')">
|
||||||
<DecorationCategory />
|
<DecorationCategory aria-hidden="true" />
|
||||||
Decoration
|
Decoration
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('library')">
|
<p v-if="categories.includes('library')">
|
||||||
<LibraryCategory />
|
<LibraryCategory aria-hidden="true" />
|
||||||
Library
|
Library
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('cursed')">
|
<p v-if="categories.includes('cursed')">
|
||||||
<CursedCategory />
|
<CursedCategory aria-hidden="true" />
|
||||||
Cursed
|
Cursed
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('worldgen')">
|
<p v-if="categories.includes('worldgen')">
|
||||||
<WorldGenCategory />
|
<WorldGenCategory aria-hidden="true" />
|
||||||
Worldgen
|
Worldgen
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('storage')">
|
<p v-if="categories.includes('storage')">
|
||||||
<StorageCategory />
|
<StorageCategory aria-hidden="true" />
|
||||||
Storage
|
Storage
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('food')">
|
<p v-if="categories.includes('food')">
|
||||||
<FoodCategory />
|
<FoodCategory aria-hidden="true" />
|
||||||
Food
|
Food
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('equipment')">
|
<p v-if="categories.includes('equipment')">
|
||||||
<EquipmentCategory />
|
<EquipmentCategory aria-hidden="true" />
|
||||||
Equipment
|
Equipment
|
||||||
</p>
|
</p>
|
||||||
<p v-if="categories.includes('misc')">
|
<p v-if="categories.includes('misc')">
|
||||||
<MiscCategory />
|
<MiscCategory aria-hidden="true" />
|
||||||
Misc
|
Misc
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
62
components/DashboardPage.vue
Normal file
62
components/DashboardPage.vue
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<template>
|
||||||
|
<div class="page-container">
|
||||||
|
<div class="page-contents">
|
||||||
|
<div class="sidebar-l">
|
||||||
|
<div class="card page-nav">
|
||||||
|
<nuxt-link :to="'/dashboard/projects'" class="tab last">
|
||||||
|
<ModIcon />
|
||||||
|
My mods
|
||||||
|
</nuxt-link>
|
||||||
|
<nuxt-link
|
||||||
|
v-if="
|
||||||
|
$auth.user.role === 'admin' || $auth.user.role === 'moderator'
|
||||||
|
"
|
||||||
|
:to="'/dashboard/moderation'"
|
||||||
|
class="tab last"
|
||||||
|
>
|
||||||
|
<ModerationIcon />
|
||||||
|
Moderation
|
||||||
|
</nuxt-link>
|
||||||
|
<nuxt-link :to="'/dashboard/settings'" class="tab last">
|
||||||
|
<SettingsIcon />
|
||||||
|
Settings
|
||||||
|
</nuxt-link>
|
||||||
|
</div>
|
||||||
|
<m-footer class="footer" />
|
||||||
|
<client-only>
|
||||||
|
<EthicalAd type="image" />
|
||||||
|
</client-only>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import ModIcon from '~/assets/images/sidebar/mod.svg?inline'
|
||||||
|
import ModerationIcon from '~/assets/images/sidebar/admin.svg?inline'
|
||||||
|
import SettingsIcon from '~/assets/images/sidebar/settings.svg?inline'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DashboardPage',
|
||||||
|
components: {
|
||||||
|
ModIcon,
|
||||||
|
ModerationIcon,
|
||||||
|
SettingsIcon,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.section-header {
|
||||||
|
@extend %card;
|
||||||
|
padding: var(--spacing-card-md) var(--spacing-card-lg);
|
||||||
|
margin-bottom: var(--spacing-card-md);
|
||||||
|
h3 {
|
||||||
|
margin: auto 0;
|
||||||
|
color: var(--color-text-dark);
|
||||||
|
font-weight: var(--font-weight-extrabold);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
:class="{ disabled: currentPage === 1 }"
|
:class="{ disabled: currentPage === 1 }"
|
||||||
class="paginate has-icon"
|
class="paginate has-icon"
|
||||||
@click="currentPage !== 1 ? switchPage(currentPage - 1) : null"
|
@click="currentPage !== 1 ? switchPage(currentPage - 1) : null"
|
||||||
|
aria-label="Previous Page"
|
||||||
>
|
>
|
||||||
<LeftArrowIcon />
|
<LeftArrowIcon />
|
||||||
</button>
|
</button>
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
? switchPage(currentPage + 1)
|
? switchPage(currentPage + 1)
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
|
aria-label="Next Page"
|
||||||
>
|
>
|
||||||
<RightArrowIcon />
|
<RightArrowIcon />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="project-card">
|
<article class="project-card">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<img
|
<img
|
||||||
:src="iconUrl ? iconUrl : 'https://cdn.modrinth.com/placeholder.svg'"
|
:src="iconUrl ? iconUrl : 'https://cdn.modrinth.com/placeholder.svg'"
|
||||||
@@ -43,14 +43,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat">
|
<div class="stat">
|
||||||
<DownloadIcon />
|
<DownloadIcon aria-hidden="true" />
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<h4>Downloads</h4>
|
<h4>Downloads</h4>
|
||||||
<p class="value">{{ formatNumber(downloads) }}</p>
|
<p class="value">{{ formatNumber(downloads) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat">
|
<div class="stat">
|
||||||
<CalendarIcon />
|
<CalendarIcon aria-hidden="true" />
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<h4>Created</h4>
|
<h4>Created</h4>
|
||||||
<p
|
<p
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat">
|
<div class="stat">
|
||||||
<EditIcon />
|
<EditIcon aria-hidden="true" />
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<h4>Updated</h4>
|
<h4>Updated</h4>
|
||||||
<p
|
<p
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="latestVersion" class="stat">
|
<div v-if="latestVersion" class="stat">
|
||||||
<TagIcon />
|
<TagIcon aria-hidden="true" />
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<h4>Available For</h4>
|
<h4>Available For</h4>
|
||||||
<p class="value">
|
<p class="value">
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<div v-if="editMode" class="buttons">
|
<div v-if="editMode" class="buttons">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<aside>
|
<header>
|
||||||
<section class="navbar columns">
|
<section class="navbar columns">
|
||||||
<section class="logo column">
|
<section class="logo column">
|
||||||
<NuxtLink to="/">
|
<NuxtLink to="/">
|
||||||
<ModrinthLogo v-if="$colorMode.value === 'light'" />
|
<ModrinthLogo
|
||||||
<ModrinthLogoWhite v-else />
|
v-if="$colorMode.value === 'light'"
|
||||||
|
aria-label="modrinth"
|
||||||
|
/>
|
||||||
|
<ModrinthLogoWhite v-else aria-label="modrinth" />
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<span class="badge yellow">Beta</span>
|
<span class="badge yellow">Beta</span>
|
||||||
</section>
|
</section>
|
||||||
@@ -60,12 +63,6 @@
|
|||||||
<span v-else>Light Mode</span>
|
<span v-else>Light Mode</span>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li v-tooltip="'Not implemented yet'" class="hidden">
|
|
||||||
<NuxtLink to="/settings" disabled>
|
|
||||||
<SettingsIcon />
|
|
||||||
<span>Settings</span>
|
|
||||||
</NuxtLink>
|
|
||||||
</li>
|
|
||||||
<hr />
|
<hr />
|
||||||
<li>
|
<li>
|
||||||
<button @click="logout">
|
<button @click="logout">
|
||||||
@@ -81,7 +78,7 @@
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<section class="auth-prompt">
|
<section class="auth-prompt">
|
||||||
<a :href="authUrl" class="log-in-button"
|
<a :href="authUrl" class="log-in-button"
|
||||||
><GitHubIcon />Sign In with GitHub</a
|
><GitHubIcon aria-hidden="true" />Sign In with GitHub</a
|
||||||
>
|
>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@@ -97,13 +94,6 @@
|
|||||||
<AnalyticsIcon />
|
<AnalyticsIcon />
|
||||||
<span>Analytics</span>
|
<span>Analytics</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<!-- <NuxtLink
|
|
||||||
v-if="this.$auth.user.role === 'admin'"
|
|
||||||
to="/dashboard/admin"
|
|
||||||
>
|
|
||||||
<AdminIcon />
|
|
||||||
<span>Admin</span>
|
|
||||||
</NuxtLink> -->
|
|
||||||
</section>
|
</section>
|
||||||
<div>
|
<div>
|
||||||
<button class="hamburger" @click="toggleNav">
|
<button class="hamburger" @click="toggleNav">
|
||||||
@@ -144,7 +134,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</nav>
|
</nav>
|
||||||
</section>
|
</section>
|
||||||
</aside>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<notifications group="main" position="bottom right" />
|
<notifications group="main" position="bottom right" />
|
||||||
<!--<notifications
|
<!--<notifications
|
||||||
@@ -167,7 +157,6 @@ import ModrinthLogoWhite from '~/assets/images/text-logo-white.svg?inline'
|
|||||||
import ModpackIcon from '~/assets/images/sidebar/modpack.svg?inline'
|
import ModpackIcon from '~/assets/images/sidebar/modpack.svg?inline'
|
||||||
import ProjectsIcon from '~/assets/images/sidebar/projects.svg?inline'
|
import ProjectsIcon from '~/assets/images/sidebar/projects.svg?inline'
|
||||||
import AnalyticsIcon from '~/assets/images/sidebar/analytics.svg?inline'
|
import AnalyticsIcon from '~/assets/images/sidebar/analytics.svg?inline'
|
||||||
// import AdminIcon from '~/assets/images/sidebar/admin.svg?inline'
|
|
||||||
|
|
||||||
import DropdownIcon from '~/assets/images/utils/dropdown.svg?inline'
|
import DropdownIcon from '~/assets/images/utils/dropdown.svg?inline'
|
||||||
import HamburgerIcon from '~/assets/images/utils/hamburger.svg?inline'
|
import HamburgerIcon from '~/assets/images/utils/hamburger.svg?inline'
|
||||||
@@ -177,7 +166,6 @@ import SunIcon from '~/assets/images/utils/sun.svg?inline'
|
|||||||
|
|
||||||
import UserIcon from '~/assets/images/utils/user.svg?inline'
|
import UserIcon from '~/assets/images/utils/user.svg?inline'
|
||||||
import UsersIcon from '~/assets/images/utils/users.svg?inline'
|
import UsersIcon from '~/assets/images/utils/users.svg?inline'
|
||||||
import SettingsIcon from '~/assets/images/utils/settings.svg?inline'
|
|
||||||
import LogOutIcon from '~/assets/images/utils/log-out.svg?inline'
|
import LogOutIcon from '~/assets/images/utils/log-out.svg?inline'
|
||||||
import GitHubIcon from '~/assets/images/utils/github.svg?inline'
|
import GitHubIcon from '~/assets/images/utils/github.svg?inline'
|
||||||
|
|
||||||
@@ -188,7 +176,6 @@ export default {
|
|||||||
ModpackIcon,
|
ModpackIcon,
|
||||||
ProjectsIcon,
|
ProjectsIcon,
|
||||||
AnalyticsIcon,
|
AnalyticsIcon,
|
||||||
// AdminIcon,
|
|
||||||
DropdownIcon,
|
DropdownIcon,
|
||||||
HamburgerIcon,
|
HamburgerIcon,
|
||||||
ExitIcon,
|
ExitIcon,
|
||||||
@@ -196,7 +183,6 @@ export default {
|
|||||||
SunIcon,
|
SunIcon,
|
||||||
UserIcon,
|
UserIcon,
|
||||||
UsersIcon,
|
UsersIcon,
|
||||||
SettingsIcon,
|
|
||||||
LogOutIcon,
|
LogOutIcon,
|
||||||
GitHubIcon,
|
GitHubIcon,
|
||||||
},
|
},
|
||||||
@@ -264,7 +250,7 @@ export default {
|
|||||||
display: block;
|
display: block;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
||||||
aside {
|
header {
|
||||||
height: var(--size-navbar-height);
|
height: var(--size-navbar-height);
|
||||||
background-color: var(--color-raised-bg);
|
background-color: var(--color-raised-bg);
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
@@ -464,7 +450,7 @@ export default {
|
|||||||
|
|
||||||
@media (min-width: 1024px) {
|
@media (min-width: 1024px) {
|
||||||
.layout {
|
.layout {
|
||||||
aside {
|
header {
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
@@ -481,7 +467,7 @@ export default {
|
|||||||
|
|
||||||
@media (min-width: 1280px) {
|
@media (min-width: 1280px) {
|
||||||
.layout {
|
.layout {
|
||||||
aside {
|
header {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,86 +1,56 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<DashboardPage>
|
||||||
<div class="page-contents">
|
<div class="section-header">
|
||||||
<div class="sidebar-l">
|
<h3 class="column-grow-1">Mods</h3>
|
||||||
<div class="card page-nav">
|
|
||||||
<nuxt-link :to="'/dashboard/projects'" class="tab last">
|
|
||||||
<ModIcon />
|
|
||||||
My mods
|
|
||||||
</nuxt-link>
|
|
||||||
<nuxt-link
|
|
||||||
v-if="
|
|
||||||
$auth.user.role === 'admin' || $auth.user.role === 'moderator'
|
|
||||||
"
|
|
||||||
:to="'/dashboard/moderation'"
|
|
||||||
class="tab last"
|
|
||||||
>
|
|
||||||
<ModerationIcon />
|
|
||||||
Moderation
|
|
||||||
</nuxt-link>
|
|
||||||
</div>
|
|
||||||
<m-footer class="footer" />
|
|
||||||
<client-only>
|
|
||||||
<EthicalAd type="image" />
|
|
||||||
</client-only>
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
<div class="section-header">
|
|
||||||
<h3 class="column-grow-1">Mods</h3>
|
|
||||||
</div>
|
|
||||||
<ModCard
|
|
||||||
v-for="mod in mods"
|
|
||||||
:id="mod.id"
|
|
||||||
:key="mod.id"
|
|
||||||
:author="mod.author"
|
|
||||||
:name="mod.title"
|
|
||||||
:description="mod.description"
|
|
||||||
:latest-version="mod.latest_version"
|
|
||||||
:created-at="mod.published"
|
|
||||||
:updated-at="mod.updated"
|
|
||||||
:downloads="mod.downloads.toString()"
|
|
||||||
:icon-url="mod.icon_url"
|
|
||||||
:author-url="mod.author_url"
|
|
||||||
:page-url="mod.page_url"
|
|
||||||
:categories="mod.categories"
|
|
||||||
:edit-mode="true"
|
|
||||||
:status="mod.status"
|
|
||||||
:is-modrinth="true"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="button column approve"
|
|
||||||
@click="changeModStatus(mod.id, 'approved')"
|
|
||||||
>
|
|
||||||
Approve
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="button column reject"
|
|
||||||
@click="changeModStatus(mod.id, 'rejected')"
|
|
||||||
>
|
|
||||||
Reject
|
|
||||||
</button>
|
|
||||||
</ModCard>
|
|
||||||
<div class="section-header">
|
|
||||||
<h3 class="column-grow-1">Versions</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<ModCard
|
||||||
|
v-for="mod in mods"
|
||||||
|
:id="mod.id"
|
||||||
|
:key="mod.id"
|
||||||
|
:author="mod.author"
|
||||||
|
:name="mod.title"
|
||||||
|
:description="mod.description"
|
||||||
|
:latest-version="mod.latest_version"
|
||||||
|
:created-at="mod.published"
|
||||||
|
:updated-at="mod.updated"
|
||||||
|
:downloads="mod.downloads.toString()"
|
||||||
|
:icon-url="mod.icon_url"
|
||||||
|
:author-url="mod.author_url"
|
||||||
|
:page-url="mod.page_url"
|
||||||
|
:categories="mod.categories"
|
||||||
|
:edit-mode="true"
|
||||||
|
:status="mod.status"
|
||||||
|
:is-modrinth="true"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class="button column approve"
|
||||||
|
@click="changeModStatus(mod.id, 'approved')"
|
||||||
|
>
|
||||||
|
Approve
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="button column reject"
|
||||||
|
@click="changeModStatus(mod.id, 'rejected')"
|
||||||
|
>
|
||||||
|
Reject
|
||||||
|
</button>
|
||||||
|
</ModCard>
|
||||||
|
<div class="section-header">
|
||||||
|
<h3 class="column-grow-1">Versions</h3>
|
||||||
|
</div>
|
||||||
|
</DashboardPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import EthicalAd from '@/components/EthicalAd'
|
|
||||||
import ModCard from '@/components/ProjectCard'
|
|
||||||
|
|
||||||
import ModIcon from '~/assets/images/sidebar/mod.svg?inline'
|
import ModCard from '@/components/ProjectCard'
|
||||||
import ModerationIcon from '~/assets/images/sidebar/admin.svg?inline'
|
import DashboardPage from '@/components/DashboardPage'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
EthicalAd,
|
DashboardPage,
|
||||||
ModCard,
|
ModCard,
|
||||||
ModIcon,
|
|
||||||
ModerationIcon,
|
|
||||||
},
|
},
|
||||||
async asyncData(data) {
|
async asyncData(data) {
|
||||||
const config = {
|
const config = {
|
||||||
@@ -133,17 +103,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.section-header {
|
|
||||||
@extend %card;
|
|
||||||
padding: var(--spacing-card-md) var(--spacing-card-lg);
|
|
||||||
margin-bottom: var(--spacing-card-md);
|
|
||||||
h3 {
|
|
||||||
margin: auto 0;
|
|
||||||
color: var(--color-text-dark);
|
|
||||||
font-weight: var(--font-weight-extrabold);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
margin: 0.25rem 0;
|
margin: 0.25rem 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,79 +1,46 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<DashboardPage>
|
||||||
<div class="page-contents">
|
<div class="section-header columns">
|
||||||
<div class="sidebar-l">
|
<h3 class="column-grow-1">My mods</h3>
|
||||||
<div class="card page-nav">
|
<nuxt-link class="brand-button column" to="/mod/create">
|
||||||
<nuxt-link :to="'/dashboard/projects'" class="tab last">
|
Create a mod
|
||||||
<ModIcon />
|
</nuxt-link>
|
||||||
My mods
|
|
||||||
</nuxt-link>
|
|
||||||
<nuxt-link
|
|
||||||
v-if="
|
|
||||||
$auth.user.role === 'admin' || $auth.user.role === 'moderator'
|
|
||||||
"
|
|
||||||
:to="'/dashboard/moderation'"
|
|
||||||
class="tab last"
|
|
||||||
>
|
|
||||||
<ModerationIcon />
|
|
||||||
Moderation
|
|
||||||
</nuxt-link>
|
|
||||||
</div>
|
|
||||||
<m-footer class="footer" />
|
|
||||||
<client-only>
|
|
||||||
<EthicalAd type="image" />
|
|
||||||
</client-only>
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
<div class="section-header columns">
|
|
||||||
<h3 class="column-grow-1">My mods</h3>
|
|
||||||
<nuxt-link class="brand-button column" to="/mod/create">
|
|
||||||
Create a mod
|
|
||||||
</nuxt-link>
|
|
||||||
</div>
|
|
||||||
<ModCard
|
|
||||||
v-for="mod in mods"
|
|
||||||
:id="mod.slug ? mod.slug : mod.id"
|
|
||||||
:key="mod.id"
|
|
||||||
:author="mod.author"
|
|
||||||
:name="mod.title"
|
|
||||||
:description="mod.description"
|
|
||||||
:latest-version="mod.latest_version"
|
|
||||||
:created-at="mod.published"
|
|
||||||
:updated-at="mod.updated"
|
|
||||||
:downloads="mod.downloads.toString()"
|
|
||||||
:icon-url="mod.icon_url"
|
|
||||||
:author-url="mod.author_url"
|
|
||||||
:page-url="mod.page_url"
|
|
||||||
:categories="mod.categories"
|
|
||||||
:edit-mode="true"
|
|
||||||
:status="mod.status"
|
|
||||||
:is-modrinth="true"
|
|
||||||
>
|
|
||||||
<nuxt-link class="button column" :to="'/mod/' + mod.id + '/edit'">
|
|
||||||
Edit
|
|
||||||
</nuxt-link>
|
|
||||||
</ModCard>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<ModCard
|
||||||
|
v-for="mod in mods"
|
||||||
|
:id="mod.slug ? mod.slug : mod.id"
|
||||||
|
:key="mod.id"
|
||||||
|
:author="mod.author"
|
||||||
|
:name="mod.title"
|
||||||
|
:description="mod.description"
|
||||||
|
:latest-version="mod.latest_version"
|
||||||
|
:created-at="mod.published"
|
||||||
|
:updated-at="mod.updated"
|
||||||
|
:downloads="mod.downloads.toString()"
|
||||||
|
:icon-url="mod.icon_url"
|
||||||
|
:author-url="mod.author_url"
|
||||||
|
:page-url="mod.page_url"
|
||||||
|
:categories="mod.categories"
|
||||||
|
:edit-mode="true"
|
||||||
|
:status="mod.status"
|
||||||
|
:is-modrinth="true"
|
||||||
|
>
|
||||||
|
<nuxt-link class="button column" :to="'/mod/' + mod.id + '/edit'">
|
||||||
|
Edit
|
||||||
|
</nuxt-link>
|
||||||
|
</ModCard>
|
||||||
|
</DashboardPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import EthicalAd from '@/components/EthicalAd'
|
|
||||||
import ModCard from '@/components/ProjectCard'
|
import ModCard from '@/components/ProjectCard'
|
||||||
import MFooter from '@/components/MFooter'
|
import DashboardPage from '@/components/DashboardPage'
|
||||||
|
|
||||||
import ModIcon from '~/assets/images/sidebar/mod.svg?inline'
|
|
||||||
import ModerationIcon from '~/assets/images/sidebar/admin.svg?inline'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
EthicalAd,
|
DashboardPage,
|
||||||
ModCard,
|
ModCard,
|
||||||
ModIcon,
|
|
||||||
ModerationIcon,
|
|
||||||
MFooter,
|
|
||||||
},
|
},
|
||||||
async asyncData(data) {
|
async asyncData(data) {
|
||||||
const config = {
|
const config = {
|
||||||
@@ -102,17 +69,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.section-header {
|
|
||||||
@extend %card;
|
|
||||||
padding: var(--spacing-card-md) var(--spacing-card-lg);
|
|
||||||
margin-bottom: var(--spacing-card-md);
|
|
||||||
h3 {
|
|
||||||
margin: auto 0;
|
|
||||||
color: var(--color-text-dark);
|
|
||||||
font-weight: var(--font-weight-extrabold);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mod-name {
|
.mod-name {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|||||||
127
pages/dashboard/settings.vue
Normal file
127
pages/dashboard/settings.vue
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<DashboardPage>
|
||||||
|
<div class="section-header columns">
|
||||||
|
<h3 class="column-grow-1">Settings</h3>
|
||||||
|
<button class="brand-button column" @click="editProfile">Save</button>
|
||||||
|
</div>
|
||||||
|
<section class="essentials">
|
||||||
|
<h3>Username</h3>
|
||||||
|
<label>
|
||||||
|
<span>
|
||||||
|
The username used on the modrinth site to identify yourself. This must
|
||||||
|
be unique.
|
||||||
|
</span>
|
||||||
|
<input
|
||||||
|
v-model="username"
|
||||||
|
type="text"
|
||||||
|
placeholder="Enter your username"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<h3>Name</h3>
|
||||||
|
<label>
|
||||||
|
<span>
|
||||||
|
Your display name on your Modrinth profile. This does not have to be
|
||||||
|
unique, can be set to anything, and is optional.
|
||||||
|
</span>
|
||||||
|
<input v-model="name" type="text" placeholder="Enter your name" />
|
||||||
|
</label>
|
||||||
|
<h3>Email</h3>
|
||||||
|
<label>
|
||||||
|
<span>
|
||||||
|
The email for your account. This is private information which is not
|
||||||
|
displayed in any API routes or your profile. It is also optional.
|
||||||
|
</span>
|
||||||
|
<input v-model="email" type="email" placeholder="Enter your email" />
|
||||||
|
</label>
|
||||||
|
<h3>Bio</h3>
|
||||||
|
<label>
|
||||||
|
<span>
|
||||||
|
Give a quick description to your mod. It will appear in the search
|
||||||
|
</span>
|
||||||
|
<input v-model="bio" type="text" placeholder="Enter your bio" />
|
||||||
|
</label>
|
||||||
|
</section>
|
||||||
|
</DashboardPage>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import DashboardPage from '@/components/DashboardPage'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
DashboardPage,
|
||||||
|
},
|
||||||
|
fetch() {
|
||||||
|
this.username = this.$auth.user.username
|
||||||
|
this.name = this.$auth.user.name
|
||||||
|
this.email = this.$auth.user.email
|
||||||
|
this.bio = this.$auth.user.bio
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
username: '',
|
||||||
|
name: '',
|
||||||
|
email: '',
|
||||||
|
bio: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async editProfile() {
|
||||||
|
const config = {
|
||||||
|
headers: {
|
||||||
|
Authorization: this.$auth.getToken('local'),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$nuxt.$loading.start()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = {
|
||||||
|
username: this.username,
|
||||||
|
name: this.name,
|
||||||
|
email: this.email,
|
||||||
|
bio: this.bio,
|
||||||
|
}
|
||||||
|
|
||||||
|
await axios.patch(
|
||||||
|
`https://api.modrinth.com/api/v1/user/${this.$auth.user.id}`,
|
||||||
|
data,
|
||||||
|
config
|
||||||
|
)
|
||||||
|
} catch (err) {
|
||||||
|
this.$notify({
|
||||||
|
group: 'main',
|
||||||
|
title: 'An Error Occurred',
|
||||||
|
text: err.response.data.description,
|
||||||
|
type: 'error',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$nuxt.$loading.finish()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
section {
|
||||||
|
@extend %card;
|
||||||
|
|
||||||
|
padding: var(--spacing-card-md) var(--spacing-card-lg);
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
span {
|
||||||
|
flex: 2;
|
||||||
|
padding-right: var(--spacing-card-lg);
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
flex: 3;
|
||||||
|
height: fit-content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
a worldwide, non-exclusive, royalty-free, and unrestricted license to
|
a worldwide, non-exclusive, royalty-free, and unrestricted license to
|
||||||
use, reproduce, distribute copies, prepare derivative works of, or
|
use, reproduce, distribute copies, prepare derivative works of, or
|
||||||
display Content in connection with Modrinth in any medium and for any
|
display Content in connection with Modrinth in any medium and for any
|
||||||
purpose (including commercial purposes), which is irrevocable.
|
purpose (including commercial purposes).
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ import ModPage from '@/components/ModPage'
|
|||||||
export default {
|
export default {
|
||||||
components: { ModPage },
|
components: { ModPage },
|
||||||
auth: false,
|
auth: false,
|
||||||
|
async fetch() {
|
||||||
|
this.body = (await axios.get(this.mod.body_url)).data
|
||||||
|
},
|
||||||
async asyncData(data) {
|
async asyncData(data) {
|
||||||
const config = {
|
const config = {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -27,38 +30,43 @@ export default {
|
|||||||
)
|
)
|
||||||
).data
|
).data
|
||||||
|
|
||||||
const [members, versions, body] = (
|
const [members, versions] = (
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
axios.get(
|
axios.get(`https://api.modrinth.com/api/v1/team/${mod.team}/members`),
|
||||||
`https://api.modrinth.com/api/v1/team/${mod.team}/members`,
|
|
||||||
config
|
|
||||||
),
|
|
||||||
axios.get(
|
axios.get(
|
||||||
`https://api.modrinth.com/api/v1/versions?ids=${JSON.stringify(
|
`https://api.modrinth.com/api/v1/versions?ids=${JSON.stringify(
|
||||||
mod.versions
|
mod.versions
|
||||||
)}`,
|
)}`,
|
||||||
config
|
config
|
||||||
),
|
),
|
||||||
axios.get(mod.body_url),
|
|
||||||
])
|
])
|
||||||
).map((it) => it.data)
|
).map((it) => it.data)
|
||||||
|
|
||||||
const users = await Promise.all(
|
const users = (
|
||||||
members.map((it) =>
|
await axios.get(
|
||||||
axios.get(`https://api.modrinth.com/api/v1/user/${it.user_id}`, config)
|
`https://api.modrinth.com/api/v1/users?ids=${JSON.stringify(
|
||||||
|
members.map((it) => it.user_id)
|
||||||
|
)}`,
|
||||||
|
config
|
||||||
)
|
)
|
||||||
)
|
).data
|
||||||
users.forEach(
|
|
||||||
(it, index) => (members[index].avatar_url = it.data.avatar_url)
|
users.forEach((it, index) => {
|
||||||
)
|
members[index].avatar_url = it.avatar_url
|
||||||
|
members[index].name = it.username
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mod,
|
mod,
|
||||||
body,
|
|
||||||
versions: versions.reverse(),
|
versions: versions.reverse(),
|
||||||
members,
|
members,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
body: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
head() {
|
head() {
|
||||||
return {
|
return {
|
||||||
title: this.mod.title + ' - Modrinth',
|
title: this.mod.title + ' - Modrinth',
|
||||||
|
|||||||
@@ -118,6 +118,11 @@ export default {
|
|||||||
TagIcon,
|
TagIcon,
|
||||||
},
|
},
|
||||||
auth: false,
|
auth: false,
|
||||||
|
async fetch() {
|
||||||
|
if (this.version.changelog_url) {
|
||||||
|
this.changelog = (await axios.get(this.version.changelog_url)).data
|
||||||
|
}
|
||||||
|
},
|
||||||
async asyncData(data) {
|
async asyncData(data) {
|
||||||
const config = {
|
const config = {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -136,10 +141,7 @@ export default {
|
|||||||
|
|
||||||
const [members, versions] = (
|
const [members, versions] = (
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
axios.get(
|
axios.get(`https://api.modrinth.com/api/v1/team/${mod.team}/members`),
|
||||||
`https://api.modrinth.com/api/v1/team/${mod.team}/members`,
|
|
||||||
config
|
|
||||||
),
|
|
||||||
axios.get(
|
axios.get(
|
||||||
`https://api.modrinth.com/api/v1/versions?ids=${JSON.stringify(
|
`https://api.modrinth.com/api/v1/versions?ids=${JSON.stringify(
|
||||||
mod.versions
|
mod.versions
|
||||||
@@ -149,24 +151,24 @@ export default {
|
|||||||
])
|
])
|
||||||
).map((it) => it.data)
|
).map((it) => it.data)
|
||||||
|
|
||||||
const users = await Promise.all(
|
const users = (
|
||||||
members.map((it) =>
|
await axios.get(
|
||||||
axios.get(`https://api.modrinth.com/api/v1/user/${it.user_id}`, config)
|
`https://api.modrinth.com/api/v1/users?ids=${JSON.stringify(
|
||||||
|
members.map((it) => it.user_id)
|
||||||
|
)}`,
|
||||||
|
config
|
||||||
)
|
)
|
||||||
)
|
).data
|
||||||
users.forEach(
|
|
||||||
(it, index) => (members[index].avatar_url = it.data.avatar_url)
|
users.forEach((it, index) => {
|
||||||
)
|
members[index].avatar_url = it.avatar_url
|
||||||
|
members[index].name = it.username
|
||||||
|
})
|
||||||
|
|
||||||
const version = versions.find((x) => x.id === data.params.version)
|
const version = versions.find((x) => x.id === data.params.version)
|
||||||
|
|
||||||
version.author = members.find((x) => x.user_id === version.author_id)
|
version.author = members.find((x) => x.user_id === version.author_id)
|
||||||
|
|
||||||
let changelog = ''
|
|
||||||
if (version.changelog_url) {
|
|
||||||
changelog = (await axios.get(version.changelog_url)).data
|
|
||||||
}
|
|
||||||
|
|
||||||
let primaryFile = version.files.find((file) => file.primary)
|
let primaryFile = version.files.find((file) => file.primary)
|
||||||
|
|
||||||
if (!primaryFile) {
|
if (!primaryFile) {
|
||||||
@@ -178,12 +180,12 @@ export default {
|
|||||||
versions,
|
versions,
|
||||||
members,
|
members,
|
||||||
version,
|
version,
|
||||||
changelog,
|
|
||||||
primaryFile,
|
primaryFile,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
changelog: '',
|
||||||
filesToUpload: [],
|
filesToUpload: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -358,6 +360,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.markdown-body {
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
.files {
|
.files {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
@@ -434,6 +440,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.file-input {
|
.file-input {
|
||||||
margin-top: 2rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -235,10 +235,7 @@ export default {
|
|||||||
|
|
||||||
const [members, versions, selectableLoaders, selectableVersions] = (
|
const [members, versions, selectableLoaders, selectableVersions] = (
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
axios.get(
|
axios.get(`https://api.modrinth.com/api/v1/team/${mod.team}/members`),
|
||||||
`https://api.modrinth.com/api/v1/team/${mod.team}/members`,
|
|
||||||
config
|
|
||||||
),
|
|
||||||
axios.get(
|
axios.get(
|
||||||
`https://api.modrinth.com/api/v1/versions?ids=${JSON.stringify(
|
`https://api.modrinth.com/api/v1/versions?ids=${JSON.stringify(
|
||||||
mod.versions
|
mod.versions
|
||||||
@@ -250,14 +247,19 @@ export default {
|
|||||||
])
|
])
|
||||||
).map((it) => it.data)
|
).map((it) => it.data)
|
||||||
|
|
||||||
const users = await Promise.all(
|
const users = (
|
||||||
members.map((it) =>
|
await axios.get(
|
||||||
axios.get(`https://api.modrinth.com/api/v1/user/${it.user_id}`, config)
|
`https://api.modrinth.com/api/v1/users?ids=${JSON.stringify(
|
||||||
|
members.map((it) => it.user_id)
|
||||||
|
)}`,
|
||||||
|
config
|
||||||
)
|
)
|
||||||
)
|
).data
|
||||||
users.forEach(
|
|
||||||
(it, index) => (members[index].avatar_url = it.data.avatar_url)
|
users.forEach((it, index) => {
|
||||||
)
|
members[index].avatar_url = it.avatar_url
|
||||||
|
members[index].name = it.username
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mod,
|
mod,
|
||||||
|
|||||||
Reference in New Issue
Block a user