|
|
|
@ -9,6 +9,8 @@ export default {
|
|
|
|
|
const currentSort = ref("date");
|
|
|
|
|
const currentSortDir = ref("desc");
|
|
|
|
|
|
|
|
|
|
const tags = ref([]);
|
|
|
|
|
|
|
|
|
|
const sortedPads = computed(() => {
|
|
|
|
|
return pads.value.sort((a, b) => {
|
|
|
|
|
let modifier = 1;
|
|
|
|
@ -46,6 +48,17 @@ export default {
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
pads.value = data.pads;
|
|
|
|
|
|
|
|
|
|
pads.value.map(
|
|
|
|
|
(pad) =>
|
|
|
|
|
(pad.categories = pad.categories
|
|
|
|
|
.split(",")
|
|
|
|
|
.map((category) => category.trim()))
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
tags.value = Array.from(
|
|
|
|
|
new Set([...pads.value.map((pad) => pad.categories)].flat())
|
|
|
|
|
).sort();
|
|
|
|
|
currentPage.value = data.page;
|
|
|
|
|
loaded.value = true;
|
|
|
|
|
});
|
|
|
|
@ -58,38 +71,53 @@ export default {
|
|
|
|
|
currentSort,
|
|
|
|
|
currentSortDir,
|
|
|
|
|
loaded,
|
|
|
|
|
tags,
|
|
|
|
|
sort,
|
|
|
|
|
formatDate,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
template: `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-if="!loaded" class='loading grow'>
|
|
|
|
|
Loading loading loading loading loading loading loading loading loading loading loading loading loading loading loading loading loading loading etc
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-else>
|
|
|
|
|
<div class="filter">
|
|
|
|
|
<h2>Filter Categories</h2>
|
|
|
|
|
<ul>
|
|
|
|
|
<li v-for="tag in tags" :key="tag">{{tag}}</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<p class="from">Fetching pads from <a :href="'https://pzwiki.wdka.nl/mediadesign/' + currentPage">
|
|
|
|
|
{{currentPage}}
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<p class="from">
|
|
|
|
|
Fetching pads from
|
|
|
|
|
<a :href="'https://pzwiki.wdka.nl/mediadesign/' + currentPage">{{currentPage}}</a>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
<tr class="header">
|
|
|
|
|
<th v-for="column in columns" @click='sort(column)'>
|
|
|
|
|
<th v-for="column in columns" :class="column" @click='sort(column)'>
|
|
|
|
|
{{column }}
|
|
|
|
|
<span v-if='column == currentSort'> {{ currentSortDir == 'asc' ? '▼' : '▲'}}</span>
|
|
|
|
|
|
|
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr v-for="(pad, index) in sortedPads" key="pad.title, index" :class="pad.category">
|
|
|
|
|
<td class="title">
|
|
|
|
|
<a :href="pad.link" class='stretched' target="_blank"> {{pad.title}} </a>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="overview">{{pad.overview}}</td>
|
|
|
|
|
<td class="categories">{{pad.categories}}</td>
|
|
|
|
|
<td class="overview">
|
|
|
|
|
<p>
|
|
|
|
|
{{pad.overview}}
|
|
|
|
|
</p>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="categories">
|
|
|
|
|
<span class="category" v-for="category in pad.categories" :key="category">{{category}}</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="date">{{formatDate(pad.date)}}</td>
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|