You've already forked AstralRinth
forked from didirus/AstralRinth
This commit is contained in:
@@ -443,14 +443,56 @@
|
||||
</div>
|
||||
</label>
|
||||
</section>
|
||||
<!--
|
||||
<section class="donations">
|
||||
<div class="title">
|
||||
<h3>Donation links</h3>
|
||||
<i>— this section is optional</i>
|
||||
<button
|
||||
title="Add a link"
|
||||
class="button"
|
||||
:disabled="false"
|
||||
@click="
|
||||
donationPlatforms.push({})
|
||||
donationLinks.push('')
|
||||
"
|
||||
>
|
||||
Add a link
|
||||
</button>
|
||||
</div>
|
||||
<div v-for="(item, index) in donationPlatforms" :key="index">
|
||||
<label title="The donation link.">
|
||||
<span>Donation Link</span>
|
||||
<input
|
||||
v-model="donationLinks[index]"
|
||||
type="url"
|
||||
placeholder="Enter a valid URL"
|
||||
/>
|
||||
</label>
|
||||
<label title="The donation platform of the link.">
|
||||
<span>Donation Platform</span>
|
||||
<Multiselect
|
||||
v-model="donationPlatforms[index]"
|
||||
placeholder="Select one"
|
||||
track-by="short"
|
||||
label="name"
|
||||
:options="availableDonationPlatforms"
|
||||
:searchable="false"
|
||||
:close-on-select="true"
|
||||
:show-labels="false"
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
class="button"
|
||||
@click="
|
||||
donationPlatforms.splice(index, 1)
|
||||
donationLinks.splice(index, 1)
|
||||
"
|
||||
>
|
||||
Remove Link
|
||||
</button>
|
||||
<hr />
|
||||
</div>
|
||||
</section>
|
||||
-->
|
||||
<m-footer class="footer" centered />
|
||||
</div>
|
||||
</div>
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user