Skip to content

Commit

Permalink
Notes and dates (#133)
Browse files Browse the repository at this point in the history
sadly the issues this resolves have not been created ;_;

---------

Co-authored-by: kaggl <[email protected]>
  • Loading branch information
kaggl and kaggl authored May 28, 2024
1 parent 4e36958 commit b4e33d7
Show file tree
Hide file tree
Showing 7 changed files with 1,378 additions and 290 deletions.
7 changes: 4 additions & 3 deletions components/detail-disclosure.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ const changeSort = (col: string) => {
const currentRels = computed(() => {
let retRels = [...props.rels];
if (sortBy.value.includes(":rev")) {
const adjValue = sortBy.value.replace(/((?:start|end)_date)/g, "$1_iso");
if (adjValue.includes(":rev")) {
retRels = retRels.sort((a, b) =>
String(a[sortBy.value.split(":")[0]]) < String(b[sortBy.value.split(":")[0]]) ? 1 : -1,
String(a[adjValue.split(":")[0]]) < String(b[adjValue.split(":")[0]]) ? 1 : -1,
);
} else {
retRels = retRels.sort((a, b) => (String(a[sortBy.value]) < String(b[sortBy.value]) ? -1 : 1));
retRels = retRels.sort((a, b) => (String(a[adjValue]) < String(b[adjValue]) ? -1 : 1));
}
return retRels.slice(page.value * limit, (page.value + 1) * limit);
});
Expand Down
3 changes: 2 additions & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
"institutions": "Institution",
"allowance": "Zahlungen",
"same_as": "Onlineressourcen",
"confession": "Konfession"
"confession": "Konfession",
"no-notes": "Keine Notizen vorhanden."
},
"viecpro_courts": {
"model": "Modell",
Expand Down
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@
"institutions": "Institution",
"allowance": "Allowance",
"same_as": "Online resources",
"confession": "Confession"
"confession": "Confession",
"no-notes": "No notes provided."
},
"viecpro_courts": {
"model": "Model",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@headlessui-float/vue": "^0.13.3",
"@headlessui/vue": "^1.7.16",
"@nuxt/content": "^2.8.5",
"@nuxt/image": "npm:@nuxt/image-edge",
"@nuxt/image": "npm:@nuxt/image-edge@1.1.0-28344124.5284548",
"@nuxtjs/i18n": "^8.0.0",
"@tanstack/vue-query": "^5.17.2",
"@vueuse/core": "^10.7.1",
Expand Down
20 changes: 13 additions & 7 deletions pages/detail/persons/[id].vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useQuery, useQueryClient } from "@tanstack/vue-query";
import { isEmpty } from "lodash-es";
import { BookOpenText, ExternalLink, Info } from "lucide-vue-next";
import { ExternalLink, Info, StickyNote } from "lucide-vue-next";
import type { SearchResponse } from "typesense/lib/Typesense/Documents";
import { useRoute } from "vue-router";
Expand Down Expand Up @@ -67,7 +67,7 @@ definePageMeta({
});
const title = computed(() => {
if (data.value.entity.data?.name) return `${data.value.entity.data.fullname} - Person`;
if (!loading.value.entity) return `${data.value.entity.data.fullname} - Person`;
return "Person";
});
Expand Down Expand Up @@ -124,16 +124,22 @@ useHead({
</template>
</InfoMenu>

<BookOpenText class="m-2 h-6 w-6 shrink-0 cursor-not-allowed opacity-50" />
<!-- <InfoMenu>
<InfoMenu class="text-base font-normal">
<template #button>
<button class="rounded-full transition hover:bg-slate-200 active:bg-slate-300">
<span class="sr-only">{{ t("collection-keys.viecpro_courts.sources") }}</span>
<BookOpenText class="m-2 h-6 w-6 shrink-0" />
<StickyNote class="m-2 h-6 w-6 shrink-0" />
</button>
</template>
<template #content> hehehehe </template>
</InfoMenu> -->
<template #content>
<div v-if="data.details.data.notes">
{{ data.details.data.notes }}
</div>
<div v-else class="italic">
{{ t("collection-keys.viecpro_persons.no-notes") }}
</div>
</template>
</InfoMenu>
<DownloadMenu detail :data="data" :collection="collection" />
</div>
</div>
Expand Down
Loading

0 comments on commit b4e33d7

Please sign in to comment.