Skip to content

Commit

Permalink
feat: [#622] force accept agreetment before uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Sep 15, 2024
1 parent cf18f58 commit 49d3cd5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pages/upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
</div>
</template>
</div>

<template v-if="categories?.length > 0">
<div>
<label for="category" class="px-2">Category</label>
Expand All @@ -53,6 +54,7 @@
</select>
</div>
</template>
<template v-if="tags?.length > 0">
<div>
<label for="tags" class="px-2">Tags</label>
Expand All @@ -67,14 +69,25 @@
<div>
<UploadFile sub-title="Only .torrent files allowed. BitTorrent v2 files are NOT supported." accept=".torrent" @on-change="setFile" />
</div>
<!-- Checkbox for Terms and Conditions Agreement -->
<div>
<label for="agree-to-terms" class="px-2">Agreement</label>
<div class="mt-1">
<input v-model="agreeToTerms" name="agree-to-terms" type="checkbox" class="max-w-5" data-cy="upload-form-agree-terms">
<span class="px-2">I confirm that the content I am uploading is authorized, and I have read and agree to the <NuxtLink to="/terms" target="_blank">terms</NuxtLink>.</span>
</div>
</div>
<template v-if="user?.username">
<TorrustButton
label="submit"
data-cy="upload-form-submit"
:disabled="!formValid() || uploading"
:disabled="!formValid() || !agreeToTerms || uploading"
@click="submitForm"
/>
</template>
<template v-else>
<div class="relative flex justify-center text-sm">
<NuxtLink to="/signin">
Expand Down Expand Up @@ -116,6 +129,7 @@ const tags = useTags();
const user = useUser();
const rest = useRestApi();
const agreeToTerms: Ref<boolean> = ref(false);
const uploading: Ref<boolean> = ref(false);
const descriptionView = ref("edit");
const form: Ref<FormUploadTorrent> = ref({
Expand Down

0 comments on commit 49d3cd5

Please sign in to comment.