2023-03-24 15:15:34 -04:00
|
|
|
|
<template>
|
2023-06-19 22:15:45 -07:00
|
|
|
|
<Modal ref="modal" :header="`Report ${props.itemType}`" :noblur="noblur">
|
2023-03-24 15:15:34 -04:00
|
|
|
|
<div class="modal-report">
|
|
|
|
|
|
<div class="markdown-body">
|
|
|
|
|
|
<p>
|
|
|
|
|
|
Modding should be safe for everyone, so we take abuse and malicious intent seriously at
|
|
|
|
|
|
Modrinth. We want to hear about harmful content on the site that violates our
|
|
|
|
|
|
<router-link to="/legal/terms">ToS</router-link>
|
|
|
|
|
|
and
|
|
|
|
|
|
<router-link to="/legal/rules">Rules</router-link>
|
|
|
|
|
|
. Rest assured, we’ll keep your identifying information private.
|
|
|
|
|
|
</p>
|
2023-05-28 16:36:49 -04:00
|
|
|
|
<p v-if="props.itemType === 'project' || props.itemType === 'version'">
|
2023-03-24 15:15:34 -04:00
|
|
|
|
Please <strong>do not</strong> use this to report bugs with the project itself. This form
|
|
|
|
|
|
is only for submitting a report to Modrinth staff. If the project has an Issues link or a
|
|
|
|
|
|
Discord invite, consider reporting it there.
|
|
|
|
|
|
</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label class="report-label" for="report-type">
|
|
|
|
|
|
<span>
|
|
|
|
|
|
<strong>Reason</strong>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<DropdownSelect
|
|
|
|
|
|
id="report-type"
|
|
|
|
|
|
v-model="reportType"
|
2023-05-28 16:36:49 -04:00
|
|
|
|
:options="props.reportTypes"
|
2023-03-24 15:15:34 -04:00
|
|
|
|
default-value="Choose report type"
|
|
|
|
|
|
class="multiselect"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<label class="report-label" for="additional-information">
|
|
|
|
|
|
<strong>Additional information</strong>
|
|
|
|
|
|
<span> Include links and images if possible. Markdown formatting is supported. </span>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div v-if="bodyViewType === 'source'" class="text-input textarea-wrapper">
|
|
|
|
|
|
<Chips v-model="bodyViewType" class="separator" :items="['source', 'preview']" />
|
|
|
|
|
|
<textarea id="body" v-model="body" spellcheck="true" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div v-else class="preview" v-html="renderString(body)"></div>
|
|
|
|
|
|
</div>
|
2023-05-28 16:36:49 -04:00
|
|
|
|
<div class="input-group push-right">
|
2023-03-24 15:15:34 -04:00
|
|
|
|
<Button @click="cancel">
|
|
|
|
|
|
<XIcon />
|
|
|
|
|
|
Cancel
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button color="primary" @click="submitReport">
|
|
|
|
|
|
<CheckIcon />
|
|
|
|
|
|
Report
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { Modal, Chips, XIcon, CheckIcon, DropdownSelect } from '@/components'
|
2023-03-28 10:34:48 -07:00
|
|
|
|
import { renderString } from '@/helpers/parse.js'
|
2023-03-24 15:15:34 -04:00
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
2023-05-28 16:36:49 -04:00
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
itemType: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: '',
|
2023-03-24 15:15:34 -04:00
|
|
|
|
},
|
2023-05-28 16:36:49 -04:00
|
|
|
|
itemId: {
|
|
|
|
|
|
type: String,
|
|
|
|
|
|
default: '',
|
2023-03-24 15:15:34 -04:00
|
|
|
|
},
|
2023-05-28 16:36:49 -04:00
|
|
|
|
reportTypes: {
|
|
|
|
|
|
type: Array,
|
|
|
|
|
|
default: () => [],
|
|
|
|
|
|
},
|
|
|
|
|
|
submitReport: {
|
|
|
|
|
|
type: Function,
|
|
|
|
|
|
default: () => {},
|
2023-03-24 15:15:34 -04:00
|
|
|
|
},
|
2023-06-19 22:15:45 -07:00
|
|
|
|
noblur: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: false,
|
|
|
|
|
|
},
|
2023-05-28 16:36:49 -04:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const reportType = ref('')
|
|
|
|
|
|
const body = ref('')
|
|
|
|
|
|
const bodyViewType = ref('source')
|
|
|
|
|
|
|
|
|
|
|
|
const modal = ref(null)
|
|
|
|
|
|
|
|
|
|
|
|
function cancel() {
|
|
|
|
|
|
reportType.value = ''
|
|
|
|
|
|
body.value = ''
|
|
|
|
|
|
bodyViewType.value = 'source'
|
|
|
|
|
|
|
|
|
|
|
|
modal.value.hide()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function show() {
|
|
|
|
|
|
modal.value.show()
|
2023-03-24 15:15:34 -04:00
|
|
|
|
}
|
2023-05-28 16:36:49 -04:00
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
|
show,
|
|
|
|
|
|
})
|
2023-03-24 15:15:34 -04:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
.modal-report {
|
|
|
|
|
|
padding: var(--gap-lg);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.markdown-body {
|
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.report-label {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.text-input {
|
|
|
|
|
|
height: 12rem;
|
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
|
|
|
|
|
|
|
textarea {
|
|
|
|
|
|
// here due to a bug in safari
|
|
|
|
|
|
max-height: 9rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.preview {
|
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|