diff --git a/assets/images/utils/client.svg b/assets/images/utils/client.svg new file mode 100644 index 00000000..1ae3485f --- /dev/null +++ b/assets/images/utils/client.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/utils/file-text.svg b/assets/images/utils/file-text.svg new file mode 100644 index 00000000..4197ddd4 --- /dev/null +++ b/assets/images/utils/file-text.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/utils/server.svg b/assets/images/utils/server.svg new file mode 100644 index 00000000..ba104f30 --- /dev/null +++ b/assets/images/utils/server.svg @@ -0,0 +1 @@ + diff --git a/assets/styles/components.scss b/assets/styles/components.scss index e36763a7..6381f392 100644 --- a/assets/styles/components.scss +++ b/assets/styles/components.scss @@ -216,8 +216,7 @@ user-select: none; display: flex; align-items: center; - padding: 0.5rem 0.25rem; - padding-bottom: 0.2rem; + padding: 0.5rem 0.25rem 0.2rem; margin: auto 0.5rem; border-bottom: 3px solid transparent; diff --git a/assets/styles/injected.scss b/assets/styles/injected.scss index 83ec81f7..485f8288 100644 --- a/assets/styles/injected.scss +++ b/assets/styles/injected.scss @@ -83,5 +83,8 @@ margin: 0; color: var(--color-text-dark); } + .capitalize { + text-transform: capitalize; + } } } diff --git a/components/ModPage.vue b/components/ModPage.vue index bbe2b601..e9d242d2 100644 --- a/components/ModPage.vue +++ b/components/ModPage.vue @@ -37,6 +37,13 @@ > Versions + + Settings + Wiki @@ -59,13 +66,10 @@ Source - - Settings - + + + Discord +
@@ -129,6 +133,41 @@

+
+ +
+

Client Side

+

{{ mod.client_side }}

+
+
+
+ +
+

Server Side

+

{{ mod.server_side }}

+
+
+
+ +
+

License

+

+ + {{ mod.license.name }} +

+
+
+
+ +
+

Project ID

+

{{ mod.id }}

+
+
@@ -211,6 +250,22 @@
+
+

Donation Links

+ +
@@ -228,6 +283,10 @@ import CalendarIcon from '~/assets/images/utils/calendar.svg?inline' import DownloadIcon from '~/assets/images/utils/download.svg?inline' import EditIcon from '~/assets/images/utils/edit.svg?inline' import TagIcon from '~/assets/images/utils/tag.svg?inline' +import ClientIcon from '~/assets/images/utils/client.svg?inline' +import ServerIcon from '~/assets/images/utils/server.svg?inline' +import FileTextIcon from '~/assets/images/utils/file-text.svg?inline' +import CodeIcon from '~/assets/images/sidebar/mod.svg?inline' import ExternalIcon from '~/assets/images/utils/external.svg?inline' @@ -247,6 +306,10 @@ export default { CalendarIcon, EditIcon, TagIcon, + ClientIcon, + ServerIcon, + FileTextIcon, + CodeIcon, }, props: { mod: { @@ -361,6 +424,10 @@ export default { margin-top: 0; margin-left: 5px; p { + max-width: 6rem; + overflow: hidden; + white-space: nowrap; + text-overflow: ''; margin: 3px; } .stat { @@ -439,6 +506,29 @@ export default { } } } + + .links { + padding: 0.5rem 1rem; + + .link { + display: flex; + align-items: center; + padding: 0.25rem 0; + + svg { + width: 1rem; + height: 1rem; + margin-right: 0.3rem; + } + + &:hover, + &:focus { + padding-bottom: calc(0.25rem - 3px); + border-bottom: 3px solid var(--color-brand-disabled); + color: var(--color-text-medium); + } + } + } } .limit-text-width { diff --git a/nuxt.config.js b/nuxt.config.js index 93c46f20..9fff3212 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -172,6 +172,12 @@ export default { styleResources: { scss: './assets/styles/injected.scss', }, + html: { + minify: { + collapseWhitespace: true, // as @dario30186 mentioned + removeComments: true, // 👈 add this line + }, + }, }, loading: { color: 'green', diff --git a/pages/mod/_id/edit.vue b/pages/mod/_id/edit.vue index 4f02ddaa..940f758a 100644 --- a/pages/mod/_id/edit.vue +++ b/pages/mod/_id/edit.vue @@ -251,14 +251,55 @@ - @@ -295,7 +336,7 @@ export default { availableLoaders, availableGameVersions, availableLicenses, - // availableDonationPlatforms, + availableDonationPlatforms, ] = ( await Promise.all([ axios.get( @@ -306,19 +347,33 @@ export default { axios.get(`https://api.modrinth.com/api/v1/tag/loader`), axios.get(`https://api.modrinth.com/api/v1/tag/game_version`), axios.get(`https://api.modrinth.com/api/v1/tag/license`), - // axios.get(`https://api.modrinth.com/api/v1/tag/donation_platform`), + axios.get(`https://api.modrinth.com/api/v1/tag/donation_platform`), ]) ).map((it) => it.data) mod.license = { short: mod.license.id, name: mod.license.name, + url: mod.license.url, } if (mod.body_url && !mod.body) { mod.body = (await axios.get(mod.body_url)).data } + const donationPlatforms = [] + const donationLinks = [] + + if (mod.donation_urls) { + for (const platform of mod.donation_urls) { + donationPlatforms.push({ + short: platform.id, + name: platform.platform, + }) + donationLinks.push(platform.url) + } + } + return { mod, clientSideType: { @@ -338,7 +393,9 @@ export default { name: mod.license.name, }, license_url: mod.license.url, - // availableDonationPlatforms, + availableDonationPlatforms, + donationPlatforms, + donationLinks, } } catch { data.error({ @@ -408,6 +465,14 @@ export default { client_side: this.clientSideType.id, server_side: this.serverSideType.id, slug: this.mod.slug, + license: this.license.short, + donation_urls: this.donationPlatforms.map((it, index) => { + return { + id: it.short, + platform: it.name, + url: this.donationLinks[index], + } + }), } if (this.isProcessing) { @@ -444,7 +509,6 @@ export default { this.$nuxt.$loading.finish() }, - showPreviewImage(files) { const reader = new FileReader() this.iconChanged = true @@ -464,6 +528,9 @@ export default { * { display: inline; } + .button { + margin-left: 1rem; + } } label { @@ -622,6 +689,15 @@ section.license { section.donations { grid-area: donations; + + label { + align-items: center; + margin-top: var(--spacing-card-sm); + + span { + flex: 1; + } + } } .footer { diff --git a/pages/mod/create.vue b/pages/mod/create.vue index ac9e2c5a..a6b280b1 100644 --- a/pages/mod/create.vue +++ b/pages/mod/create.vue @@ -443,14 +443,56 @@ - @@ -482,14 +524,14 @@ export default { availableLoaders, availableGameVersions, availableLicenses, - // availableDonationPlatforms, + availableDonationPlatforms, ] = ( await Promise.all([ axios.get(`https://api.modrinth.com/api/v1/tag/category`), axios.get(`https://api.modrinth.com/api/v1/tag/loader`), axios.get(`https://api.modrinth.com/api/v1/tag/game_version`), axios.get(`https://api.modrinth.com/api/v1/tag/license`), - // axios.get(`https://api.modrinth.com/api/v1/tag/donation_platform`), + axios.get(`https://api.modrinth.com/api/v1/tag/donation_platform`), ]) ).map((it) => it.data) @@ -498,7 +540,7 @@ export default { availableLoaders, availableGameVersions, availableLicenses, - // availableDonationPlatforms, + availableDonationPlatforms, } }, data() { @@ -530,6 +572,9 @@ export default { ], clientSideType: { label: 'Required', id: 'required' }, serverSideType: { label: 'Required', id: 'required' }, + + donationLinks: [], + donationPlatforms: [], } }, watch: { @@ -587,9 +632,16 @@ export default { discord_url: this.discord_url, client_side: this.clientSideType.id, server_side: this.serverSideType.id, - license_id: this.license ? this.license.short : null, + license_id: this.license ? this.license.short : 'arr', license_url: this.license_url, is_draft: this.draft, + donation_urls: this.donationPlatforms.map((it, index) => { + return { + id: it.short, + platform: it.name, + url: this.donationLinks[index], + } + }), }) ) @@ -620,10 +672,16 @@ export default { await this.$router.replace('/dashboard/projects') } catch (err) { + let description = err.response.data.description + + if (description.includes('JSON')) { + description = 'Please fill in missing required fields.' + } + this.$notify({ group: 'main', title: 'An Error Occurred', - text: err.response.data.description, + text: description, type: 'error', }) @@ -684,6 +742,9 @@ export default { * { display: inline; } + .button { + margin-left: 1rem; + } } label { @@ -947,6 +1008,15 @@ section.license { section.donations { grid-area: donations; + + label { + align-items: center; + margin-top: var(--spacing-card-sm); + + span { + flex: 1; + } + } } .footer {