Skip to content

Commit 367f420

Browse files
committed
feat: [#617] new static page with terms
http://localhost:3000/terms It also add a link on the footer. Page content is laoded in markdown format from the API (settings->website).
1 parent c1bb16d commit 367f420

File tree

4 files changed

+52
-13
lines changed

4 files changed

+52
-13
lines changed

app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="flex-grow" />
1313
<footer class="p-4 footer footer-center text-base-content">
1414
<div>
15-
<p><a target="_blank" href="https://torrust.com" class="link link-hover"> Powered by Torrust </a> ⚡ <a target="_self" href="/license" class="link link-hover">Copyright © 2024</a></p>
15+
<p><a target="_blank" href="https://torrust.com" class="link link-hover"> Powered by Torrust </a> ⚡ <a target="_self" href="/license" class="link link-hover">Copyright © 2024</a> &nbsp; <a target="_self" href="/terms" class="link link-hover">Terms</a></p>
1616
</div>
1717
</footer>
1818
</div>

package-lock.json

Lines changed: 15 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"dompurify": "^3.1.4",
4949
"marked": "^12.0.2",
5050
"notiwind-ts": "^2.0.2",
51-
"torrust-index-api-lib": "^3.0.0-beta",
52-
"torrust-index-types-lib": "^3.0.0-beta",
51+
"torrust-index-api-lib": "^3.0.0-beta.2",
52+
"torrust-index-types-lib": "^3.0.0-beta.2",
5353
"uuid": "^9.0.1"
5454
}
5555
}

pages/terms.vue

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<template>
2+
<div>
3+
<Markdown :source="pageContent" class="px-40 pt-2 pb-5 prose-h1:text-center max-w-none" />
4+
</div>
5+
</template>
6+
7+
<script setup lang="ts">
8+
import { ref, watch } from "vue";
9+
import { useSettings, useSeoMeta } from "#imports";
10+
11+
const settings = useSettings();
12+
13+
const pageTitle = ref("");
14+
const pageContent = ref("");
15+
16+
watch(
17+
() => settings.value,
18+
(newSettings) => {
19+
if (newSettings?.website?.terms?.page) {
20+
pageTitle.value = newSettings.website.terms.page.title;
21+
pageContent.value = newSettings.website.terms.page.content;
22+
}
23+
},
24+
{ immediate: true }
25+
);
26+
27+
useSeoMeta({
28+
title: () => `${pageTitle.value} - Torrent`
29+
});
30+
</script>
31+
32+
<style scoped>
33+
34+
</style>

0 commit comments

Comments
 (0)