Skip to content

Commit 855aefb

Browse files
committed
Merge #77: Format the world
c3ad66d chore: format the world (Jose Celano) Pull request description: Fix the format and linter warnings that can be fixed automatically. Top commit has no ACKs. Tree-SHA512: 8d54ec56a770bfb433f3b42590bc55b35d5b5907f7c214ccbf8ec8b39e11fd6d67abf90c8c73624e4e931e6e84a92d81edc8c7eb52236d1ee8f7fedb37f261ef
2 parents 0449122 + c3ad66d commit 855aefb

File tree

10 files changed

+91
-72
lines changed

10 files changed

+91
-72
lines changed

.gitignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
.idea
1+
.cache
2+
.env
23
.env*
3-
node_modules
4-
*.log*
5-
.nuxt
4+
.idea
65
.nitro
7-
.cache
6+
.nuxt
87
.output
9-
.env
10-
dist
8+
*.log*
9+
/temp-package/
1110
/temp-package/api/
12-
vue-2
11+
dist
12+
node_modules
1313
temp-package/types
14-
/temp-package/
14+
vue-2

components/Pagination.vue

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<div class="py-6 flex items-center justify-between">
3-
<div class="flex-1 flex flex-col md:flex-row items-center sm:justify-between justify-end gap-3">
2+
<div class="flex items-center justify-between py-6">
3+
<div class="flex flex-col items-center justify-end flex-1 gap-3 md:flex-row sm:justify-between">
44
<div class="flex items-center gap-3">
55
<div>
66
<select :value="pageSize" class="px-2 py-1 bg-base-100" @change="(e) => updatePageSize(parseInt(e.target.value, 10))">
@@ -18,7 +18,7 @@
1818
<div>
1919
<p class="text-sm text-base-content/50">
2020
Showing
21-
<span class="font-medium">{{ (currentPage * pageSize) - pageSize + 1}}</span>
21+
<span class="font-medium">{{ (currentPage * pageSize) - pageSize + 1 }}</span>
2222
to
2323
<span class="font-medium">{{ Math.min(currentPage * pageSize, totalResults) }}</span>
2424
of
@@ -30,7 +30,7 @@
3030
<div>
3131
<nav class="relative z-0 inline-flex -space-x-px" aria-label="Pagination">
3232
<a
33-
class="page-button rounded-l-lg"
33+
class="rounded-l-lg page-button"
3434
@click="goToFirstPage"
3535
>
3636
<span class="sr-only">Previous</span>
@@ -48,7 +48,7 @@
4848
>
4949
<span class="sr-only">Previous</span>
5050
<svg
51-
class="h-5 w-5"
51+
class="w-5 h-5"
5252
xmlns="http://www.w3.org/2000/svg"
5353
viewBox="0 0 20 20"
5454
fill="currentColor"
@@ -148,7 +148,7 @@
148148
>
149149
<span class="sr-only">Next</span>
150150
<svg
151-
class="h-5 w-5"
151+
class="w-5 h-5"
152152
xmlns="http://www.w3.org/2000/svg"
153153
viewBox="0 0 20 20"
154154
fill="currentColor"
@@ -162,7 +162,7 @@
162162
</svg>
163163
</button>
164164
<button
165-
class="page-button rounded-r-lg"
165+
class="rounded-r-lg page-button"
166166
@click="goToLastPage"
167167
>
168168
<span class="sr-only">Next</span>
@@ -228,9 +228,6 @@ function goToPage (pageNum: number) {
228228
if (pageNum > totalPages() || pageNum < 1) {
229229
return;
230230
}
231-
232-
console.log(pageNum);
233-
234231
emit("update:currentPage", pageNum);
235232
}
236233

components/TorrustSelect.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<template>
22
<div class="group dropdown" :class="dropdownAlignment">
3-
<label tabindex="0" class="select select-bordered group-hover:border-amber-500 items-center duration-200" :class="{ 'h-[3.5rem]': !!label }">
4-
<div class="mr-1 flex flex-col flex-nowrap text-left capitalize">
3+
<label tabindex="0" class="items-center duration-200 select select-bordered group-hover:border-amber-500" :class="{ 'h-[3.5rem]': !!label }">
4+
<div class="flex flex-col mr-1 text-left capitalize flex-nowrap">
55
<span v-if="label" class="text-xs text-primary">{{ label }}</span>
6-
<div class="text-sm flex flex-row flex-nowrap">
6+
<div class="flex flex-row text-sm flex-nowrap">
77
<span v-if="props.selected.length === 0">None</span>
88
<span v-else-if="props.selected.length > 1">Multiple</span>
99
<span v-else>{{ getOptionNameByValue(props.selected[0]) }}</span>
1010
</div>
1111
</div>
1212
</label>
13-
<div tabindex="0" class="mt-3 flex flex-col gap-2 dropdown-content border border-base-content/20 p-2 shadow bg-base-100 rounded-lg" ref="dropdownContent">
13+
<div ref="dropdownContent" tabindex="0" class="flex flex-col gap-2 p-2 mt-3 border rounded-lg shadow dropdown-content border-base-content/20 bg-base-100">
1414
<template v-if="props.search">
1515
<div class="">
1616
<input
1717
v-model="searchText"
18-
class="input border-2 placeholder-base-content text-sm input-bordered rounded-2xl"
18+
class="text-sm border-2 input placeholder-base-content input-bordered rounded-2xl"
1919
placeholder="Search"
2020
>
2121
</div>
@@ -25,31 +25,31 @@
2525
<li
2626
v-for="(option) in filteredOptions()"
2727
:key="option.value"
28-
class="text-base-content text-sm"
28+
class="text-sm text-base-content"
2929
@click="toggleOption(option)"
3030
>
3131
<div class="flex flex-row w-full rounded-lg">
3232
<div class="font-bold text-neutral-content">
3333
{{ option.name }}
3434
</div>
35-
<div v-if="props.multiple" class="ml-auto flex flex-col items-center">
35+
<div v-if="props.multiple" class="flex flex-col items-center ml-auto">
3636
<span
3737
v-if="isSelectedOption(option)"
3838
class="relative inline-flex"
3939
>
4040
<input
4141
type="checkbox"
42-
class="h-6 w-6 appearance-none bg-primary border-2 border-primary rounded-md"
42+
class="w-6 h-6 border-2 rounded-md appearance-none bg-primary border-primary"
4343
>
4444
<CheckIcon
45-
class="absolute text-neutral-content w-5"
45+
class="absolute w-5 text-neutral-content"
4646
style="top: 50%;left: 50%;transform: translate(-50%, -50%);"
4747
/>
4848
</span>
4949
<input
5050
v-else
5151
type="checkbox"
52-
class="h-6 w-6 appearance-none border-2 border-base-content/20 rounded-md duration-200"
52+
class="w-6 h-6 duration-200 border-2 rounded-md appearance-none border-base-content/20"
5353
>
5454
</div>
5555
</div>
@@ -62,7 +62,9 @@
6262
</div>
6363
</template>
6464
<template v-if="props.selected.length > 1">
65-
<button class="p-2 bg-primary/10 text-primary text-sm w-full rounded-lg" @click="emit('update:selected', [])">Clear all</button>
65+
<button class="w-full p-2 text-sm rounded-lg bg-primary/10 text-primary" @click="emit('update:selected', [])">
66+
Clear all
67+
</button>
6668
</template>
6769
</div>
6870
</div>
@@ -135,8 +137,6 @@ function toggleOption (option: TorrustSelectOption) {
135137
value = [option.value];
136138
}
137139
138-
console.log(value);
139-
140140
emit("update:selected", value);
141141
}
142142

components/torrent/TorrentActionCard.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
<template v-if="torrent.tags?.length">
99
<div class="flex flex-wrap space-x-2">
1010
<template v-for="tag in torrent.tags">
11-
<NuxtLink :to="`/torrents?tagFilters=${tag.name}`" class="px-2 py-1 bg-base-content/25 hover:bg-base-content/50 font-semibold capitalize text-xs rounded-lg cursor-pointer">{{ tag.name }}</NuxtLink>
11+
<NuxtLink :to="`/torrents?tagFilters=${tag.name}`" class="px-2 py-1 bg-base-content/25 hover:bg-base-content/50 font-semibold capitalize text-xs rounded-lg cursor-pointer">
12+
{{ tag.name }}
13+
</NuxtLink>
1214
</template>
1315
</div>
1416
</template>

components/torrent/TorrentList.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ import { ArrowDownTrayIcon, LinkIcon } from "@heroicons/vue/24/outline";
5454
import { ChevronRightIcon, ChevronDownIcon } from "@heroicons/vue/20/solid";
5555
import { PropType } from "vue";
5656
import { TorrentCompact } from "torrust-index-types-lib";
57-
import { fileSize, timeSince, ref } from "#imports";
58-
import { downloadTorrent } from "#imports";
57+
import { fileSize, timeSince, ref, downloadTorrent } from "#imports";
5958
6059
const props = defineProps({
6160
torrents: Array as PropType<Array<TorrentCompact>>

components/torrent/TorrentTable.vue

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,47 @@
33
<div class="flex flex-col overflow-x-auto whitespace-nowrap">
44
<table class="table-auto text-center bg-base-200">
55
<thead>
6-
<tr class="text-sm text-base-content/75">
7-
<th class="py-2">Name</th>
8-
<th>Size</th>
9-
<th>Date</th>
10-
<th>Uploader</th>
11-
<th>Seeders</th>
12-
<th>Leechers</th>
13-
<th>Actions</th>
14-
</tr>
6+
<tr class="text-sm text-base-content/75">
7+
<th class="py-2">
8+
Name
9+
</th>
10+
<th>Size</th>
11+
<th>Date</th>
12+
<th>Uploader</th>
13+
<th>Seeders</th>
14+
<th>Leechers</th>
15+
<th>Actions</th>
16+
</tr>
1517
</thead>
1618
<tbody>
17-
<tr v-for="(torrent, index) in torrents" :key="index" class="bg-base-100 text-sm">
18-
<td class="pl-6 text-left font-bold"><span @click.stop="$router.push(`/torrent/${torrent.info_hash}`)" class="cursor-pointer hover:text-amber-500 duration-200">{{ torrent.title }}</span></td>
19-
<td class="px-2">{{ fileSize(torrent.file_size) }}</td>
20-
<td>{{ timeSince(new Date(torrent.date_uploaded)) }} ago ({{ new Date(torrent.date_uploaded).toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }) }})</td>
21-
<td>{{ torrent.uploader }}</td>
22-
<td class="text-green-500">{{ torrent.seeders }}</td>
23-
<td class="text-red-500">{{ torrent.leechers }}</td>
24-
<td>
25-
<div class="flex flex-row flex-nowrap items-center justify-center font-semibold">
26-
<div class="ml-2 w-10 h-10 text-base-content/50 hover:text-base-content flex flex-col shrink-0 items-center justify-center duration-500 cursor-pointer" @click.stop="downloadTorrent(torrent.info_hash, torrent.title)">
27-
<ArrowDownTrayIcon class="w-5" />
19+
<tr v-for="(torrent, index) in torrents" :key="index" class="bg-base-100 text-sm">
20+
<td class="pl-6 text-left font-bold">
21+
<span class="cursor-pointer hover:text-amber-500 duration-200" @click.stop="$router.push(`/torrent/${torrent.info_hash}`)">{{ torrent.title }}</span>
22+
</td>
23+
<td class="px-2">
24+
{{ fileSize(torrent.file_size) }}
25+
</td>
26+
<td>{{ timeSince(new Date(torrent.date_uploaded)) }} ago ({{ new Date(torrent.date_uploaded).toLocaleDateString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }) }})</td>
27+
<td>{{ torrent.uploader }}</td>
28+
<td class="text-green-500">
29+
{{ torrent.seeders }}
30+
</td>
31+
<td class="text-red-500">
32+
{{ torrent.leechers }}
33+
</td>
34+
<td>
35+
<div class="flex flex-row flex-nowrap items-center justify-center font-semibold">
36+
<div class="ml-2 w-10 h-10 text-base-content/50 hover:text-base-content flex flex-col shrink-0 items-center justify-center duration-500 cursor-pointer" @click.stop="downloadTorrent(torrent.info_hash, torrent.title)">
37+
<ArrowDownTrayIcon class="w-5" />
38+
</div>
39+
<div class="ml-2 w-10 h-10 text-base-content/50 hover:text-base-content flex flex-col shrink-0 items-center justify-center duration-500 cursor-pointer">
40+
<a class="flex items-center" :href="`magnet:?xt=urn:btih:${torrent.info_hash}`">
41+
<LinkIcon class="w-5" />
42+
</a>
43+
</div>
2844
</div>
29-
<div class="ml-2 w-10 h-10 text-base-content/50 hover:text-base-content flex flex-col shrink-0 items-center justify-center duration-500 cursor-pointer">
30-
<a class="flex items-center" :href="`magnet:?xt=urn:btih:${torrent.info_hash}`">
31-
<LinkIcon class="w-5" />
32-
</a>
33-
</div>
34-
</div>
35-
</td>
36-
</tr>
45+
</td>
46+
</tr>
3747
</tbody>
3848
</table>
3949
</div>
@@ -44,8 +54,7 @@
4454
import { ArrowDownTrayIcon, LinkIcon } from "@heroicons/vue/24/outline";
4555
import { PropType } from "vue";
4656
import { TorrentCompact } from "torrust-index-types-lib";
47-
import { fileSize, timeSince, ref } from "#imports";
48-
import { downloadTorrent } from "#imports";
57+
import { fileSize, timeSince, ref, downloadTorrent } from "#imports";
4958
5059
const props = defineProps({
5160
torrents: Array as PropType<Array<TorrentCompact>>

pages/torrent/edit/[infoHash].vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111
<div>
1212
<label for="description" class="px-2">Description</label>
1313
<div class="my-2 tabs tabs-boxed w-fit border border-base-content/20">
14-
<button class="tab" :class="{ 'tab-active': descriptionView === 'edit' }" @click="descriptionView = 'edit'">Edit</button>
15-
<button class="tab" :class="{ 'tab-active': descriptionView === 'preview' }" @click="descriptionView = 'preview'">Preview</button>
14+
<button class="tab" :class="{ 'tab-active': descriptionView === 'edit' }" @click="descriptionView = 'edit'">
15+
Edit
16+
</button>
17+
<button class="tab" :class="{ 'tab-active': descriptionView === 'preview' }" @click="descriptionView = 'preview'">
18+
Preview
19+
</button>
1620
</div>
1721
<template v-if="descriptionView === 'edit'">
1822
<textarea

pages/torrents.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@
3030
</div>
3131
<div class="flex">
3232
<div class="my-2 tabs tabs-boxed w-fit border border-base-content/20">
33-
<button class="tab" :class="{ 'tab-active': layout === 'default' }" @click="layout = 'default'">Default</button>
34-
<button class="tab" :class="{ 'tab-active': layout === 'table' }" @click="layout = 'table'">Table</button>
33+
<button class="tab" :class="{ 'tab-active': layout === 'default' }" @click="layout = 'default'">
34+
Default
35+
</button>
36+
<button class="tab" :class="{ 'tab-active': layout === 'table' }" @click="layout = 'table'">
37+
Table
38+
</button>
3539
</div>
3640
</div>
3741
<div class="flex flex-col">

pages/upload.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111
<div>
1212
<label for="description" class="px-2">Description</label>
1313
<div class="my-2 tabs tabs-boxed w-fit border border-base-content/20">
14-
<button class="tab" :class="{ 'tab-active': descriptionView === 'edit' }" @click="descriptionView = 'edit'">Edit</button>
15-
<button class="tab" :class="{ 'tab-active': descriptionView === 'preview' }" @click="descriptionView = 'preview'">Preview</button>
14+
<button class="tab" :class="{ 'tab-active': descriptionView === 'edit' }" @click="descriptionView = 'edit'">
15+
Edit
16+
</button>
17+
<button class="tab" :class="{ 'tab-active': descriptionView === 'preview' }" @click="descriptionView = 'preview'">
18+
Preview
19+
</button>
1620
</div>
1721
<template v-if="descriptionView === 'edit'">
1822
<textarea

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ module.exports = {
3535
},
3636
plugins: [
3737
require("daisyui"),
38-
require('@tailwindcss/typography')
38+
require("@tailwindcss/typography")
3939
]
4040
};

0 commit comments

Comments
 (0)