Add theme toggle for templates

This commit is contained in:
thiloho
2024-10-03 18:51:30 +02:00
parent 6c314970bd
commit f2d114dac4
22 changed files with 366 additions and 123 deletions

View File

@@ -14,7 +14,7 @@ export const load: PageServerLoad = async ({ fetch, url, locals }) => {
const baseFetchUrl = `${API_BASE_PREFIX}/website?order=last_modified_at.desc,created_at.desc`;
if (searchQuery) {
params.append("title_search", `wfts(english).${searchQuery}`);
params.append("title", `wfts.${searchQuery}`);
}
switch (filterBy) {

View File

@@ -21,7 +21,7 @@ export const load: PageServerLoad = async ({ params, fetch, url, parent, locals
const parameters = new URLSearchParams();
if (searchQuery) {
parameters.append("title_description_search", `wfts(english).${searchQuery}`);
parameters.append("title", `wfts.${searchQuery}`);
}
switch (filterBy) {

View File

@@ -7,7 +7,7 @@
import { page } from "$app/stores";
import { tables } from "$lib/db-schema";
import { previewContent } from "$lib/runes.svelte";
import { sanitize } from "isomorphic-dompurify";
import DOMPurify from "isomorphic-dompurify";
const { data }: { data: PageServerData } = $props();
@@ -156,9 +156,12 @@
<p>{table_name} &mdash; {operation}</p>
</hgroup>
<pre style="white-space: pre-wrap">{@html sanitize(htmlDiff(oldValue, newValue), {
ALLOWED_TAGS: ["ins", "del"]
})}</pre>
<pre style="white-space: pre-wrap">{@html DOMPurify.sanitize(
htmlDiff(oldValue, newValue),
{
ALLOWED_TAGS: ["ins", "del"]
}
)}</pre>
</Modal>
</td>
</tr>