refactor: reorganize components into domain subfolders and replace relative imports
Move components from flat src/lib/components/ into recipes/, faith/, and cospend/ subdirectories. Replace ~144 relative imports across API routes and lib files with $models, $utils, $types, and $lib aliases. Add $types alias to svelte.config.js. Remove unused EditRecipe.svelte.
This commit is contained in:
@@ -1,326 +0,0 @@
|
|||||||
<script lang='ts'>
|
|
||||||
import Check from '$lib/assets/icons/Check.svelte';
|
|
||||||
import Cross from '$lib/assets/icons/Cross.svelte';
|
|
||||||
import SeasonSelect from '$lib/components/SeasonSelect.svelte';
|
|
||||||
import '$lib/css/action_button.css'
|
|
||||||
import '$lib/css/nordtheme.css'
|
|
||||||
import '$lib/css/shake.css'
|
|
||||||
import { redirect } from '@sveltejs/kit';
|
|
||||||
import { RecipeModelType } from '../../types/types';
|
|
||||||
import type { PageData } from './$types';
|
|
||||||
import CardAdd from '$lib/components/CardAdd.svelte';
|
|
||||||
import CreateIngredientList from '$lib/components/CreateIngredientList.svelte';
|
|
||||||
import CreateStepList from '$lib/components/CreateStepList.svelte';
|
|
||||||
|
|
||||||
let {
|
|
||||||
data,
|
|
||||||
actions,
|
|
||||||
title,
|
|
||||||
card_data = $bindable({
|
|
||||||
icon: data.icon,
|
|
||||||
category: data.category,
|
|
||||||
name: data.name,
|
|
||||||
description: data.description,
|
|
||||||
tags: data.tags,
|
|
||||||
}),
|
|
||||||
add_info = $bindable({
|
|
||||||
preparation: data.preparation,
|
|
||||||
fermentation: {
|
|
||||||
bulk: data.fermentation.bulk,
|
|
||||||
final: data.fermentation.final,
|
|
||||||
},
|
|
||||||
baking: {
|
|
||||||
length: data.baking.length,
|
|
||||||
temperature: data.baking.temperature,
|
|
||||||
mode: data.baking.mode,
|
|
||||||
},
|
|
||||||
total_time: data.total_time,
|
|
||||||
}),
|
|
||||||
portions = $bindable(data.portions),
|
|
||||||
ingredients = $bindable(data.ingredients),
|
|
||||||
instructions = $bindable(data.instructions)
|
|
||||||
}: {
|
|
||||||
data: PageData,
|
|
||||||
actions: [String],
|
|
||||||
title: string,
|
|
||||||
card_data?: any,
|
|
||||||
add_info?: any,
|
|
||||||
portions?: any,
|
|
||||||
ingredients?: any,
|
|
||||||
instructions?: any
|
|
||||||
} = $props();
|
|
||||||
|
|
||||||
let preamble = $state(data.preamble);
|
|
||||||
let addendum = $state(data.addendum);
|
|
||||||
|
|
||||||
import { season } from '$lib/js/season_store';
|
|
||||||
season.update(() => data.season)
|
|
||||||
let season_local = $state();
|
|
||||||
season.subscribe((s) => {
|
|
||||||
season_local = s
|
|
||||||
});
|
|
||||||
|
|
||||||
let old_short_name = $state(data.short_name);
|
|
||||||
let images = $state(data.images);
|
|
||||||
let short_name = $state(data.short_name);
|
|
||||||
let password = $state();
|
|
||||||
let datecreated = $state(data.datecreated);
|
|
||||||
let datemodified = $state(new Date());
|
|
||||||
|
|
||||||
|
|
||||||
function get_season(){
|
|
||||||
let season = []
|
|
||||||
const el = document.getElementById("labels");
|
|
||||||
for(var i = 0; i < el.children.length; i++){
|
|
||||||
if(el.children[i].children[0].children[0].checked){
|
|
||||||
season.push(i+1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return season
|
|
||||||
}
|
|
||||||
function write_season(season){
|
|
||||||
const el = document.getElementById("labels");
|
|
||||||
for(var i = 0; i < season.length; i++){
|
|
||||||
el.children[i].children[0].children[0].checked = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function doDelete(){
|
|
||||||
const response = confirm("Bist du dir sicher, dass du das Rezept löschen willst?")
|
|
||||||
if(!response){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const res = await fetch('/api/delete', {
|
|
||||||
method: 'POST',
|
|
||||||
body: JSON.stringify({
|
|
||||||
old_short_name,
|
|
||||||
headers: {
|
|
||||||
'content-type': 'application/json',
|
|
||||||
bearer: password,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
async function doEdit() {
|
|
||||||
const res = await fetch('/api/edit', {
|
|
||||||
method: 'POST',
|
|
||||||
body: JSON.stringify({
|
|
||||||
: {
|
|
||||||
...card_data,
|
|
||||||
...add_info,
|
|
||||||
images, // TODO
|
|
||||||
season: season_local,
|
|
||||||
short_name,
|
|
||||||
datecreated,
|
|
||||||
datemodified,
|
|
||||||
instructions,
|
|
||||||
ingredients,
|
|
||||||
addendum,
|
|
||||||
preamble
|
|
||||||
},
|
|
||||||
old_short_name,
|
|
||||||
headers: {
|
|
||||||
'content-type': 'application/json',
|
|
||||||
bearer: password,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
const item = await res.json();
|
|
||||||
}
|
|
||||||
async function doAdd () {
|
|
||||||
const res = await fetch('/api/add', {
|
|
||||||
method: 'POST',
|
|
||||||
body: JSON.stringify({
|
|
||||||
recipe: {
|
|
||||||
...card_data,
|
|
||||||
...add_info,
|
|
||||||
images: {mediapath: short_name + '.webp', alt: "", caption: ""}, // TODO
|
|
||||||
season: season_local,
|
|
||||||
short_name,
|
|
||||||
datecreated,
|
|
||||||
datemodified,
|
|
||||||
instructions,
|
|
||||||
ingredients,
|
|
||||||
preamble,
|
|
||||||
addendum,
|
|
||||||
},
|
|
||||||
headers: {
|
|
||||||
'content-type': 'application/json',
|
|
||||||
bearer: password,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
input{
|
|
||||||
display: block;
|
|
||||||
border: unset;
|
|
||||||
margin: 1rem auto;
|
|
||||||
padding: 0.5em 1em;
|
|
||||||
border-radius: 1000px;
|
|
||||||
background-color: var(--nord4);
|
|
||||||
font-size: 1.1rem;
|
|
||||||
transition: 100ms;
|
|
||||||
|
|
||||||
}
|
|
||||||
input:hover,
|
|
||||||
input:focus-visible
|
|
||||||
{
|
|
||||||
scale: 1.05 1.05;
|
|
||||||
}
|
|
||||||
.list_wrapper{
|
|
||||||
margin-inline: auto;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
max-width: 1000px;
|
|
||||||
gap: 2rem;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 700px){
|
|
||||||
.list_wrapper{
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
input[type=password]{
|
|
||||||
box-sizing: border-box;
|
|
||||||
font-size: 1.5rem;
|
|
||||||
padding-block: 0.5em;
|
|
||||||
display: inline;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.submit_wrapper{
|
|
||||||
position: relative;
|
|
||||||
margin-inline: auto;
|
|
||||||
width: max(300px, 50vw)
|
|
||||||
}
|
|
||||||
.submit_wrapper button{
|
|
||||||
position: absolute;
|
|
||||||
right:-1em;
|
|
||||||
bottom: -0.5em;
|
|
||||||
}
|
|
||||||
.submit_wrapper h2{
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
h1{
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
|
||||||
.title_container{
|
|
||||||
max-width: 1000px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
margin-inline: auto;
|
|
||||||
}
|
|
||||||
.title{
|
|
||||||
position: relative;
|
|
||||||
width: min(800px, 80vw);
|
|
||||||
margin-block: 2rem;
|
|
||||||
margin-inline: auto;
|
|
||||||
background-color: var(--nord6);
|
|
||||||
background-color: red;
|
|
||||||
padding: 1rem 2rem;
|
|
||||||
}
|
|
||||||
.title p{
|
|
||||||
border: 2px solid var(--nord1);
|
|
||||||
border-radius: 10000px;
|
|
||||||
padding: 0.5em 1em;
|
|
||||||
font-size: 1.1rem;
|
|
||||||
transition: 200ms;
|
|
||||||
}
|
|
||||||
.title p:hover,
|
|
||||||
.title p:focus-within{
|
|
||||||
scale: 1.02 1.02;
|
|
||||||
}
|
|
||||||
.addendum{
|
|
||||||
font-size: 1.1rem;
|
|
||||||
max-width: 90%;
|
|
||||||
margin-inline: auto;
|
|
||||||
border: 2px solid var(--nord1);
|
|
||||||
border-radius: 45px;
|
|
||||||
padding: 1em 1em;
|
|
||||||
transition: 100ms;
|
|
||||||
}
|
|
||||||
.addendum:hover,
|
|
||||||
.addendum:focus-within
|
|
||||||
{
|
|
||||||
scale: 1.02 1.02;
|
|
||||||
}
|
|
||||||
.addendum_wrapper{
|
|
||||||
max-width: 1000px;
|
|
||||||
margin-inline: auto;
|
|
||||||
}
|
|
||||||
h3{
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.delete{
|
|
||||||
position: fixed;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
margin: 2rem;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark){
|
|
||||||
.title{
|
|
||||||
background-color: var(--nord6-dark);
|
|
||||||
background-color: green;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<h1>{title}</h1>
|
|
||||||
|
|
||||||
<CardAdd {card_data}></CardAdd>
|
|
||||||
|
|
||||||
<h3>Kurzname (für URL):</h3>
|
|
||||||
<input bind:value={short_name} placeholder="Kurzname"/>
|
|
||||||
|
|
||||||
<div class=title_container>
|
|
||||||
<div class=title>
|
|
||||||
<h4>Eine etwas längere Beschreibung:</h4>
|
|
||||||
<p bind:innerText={preamble} contenteditable></p>
|
|
||||||
<div class=tags>
|
|
||||||
<h4>Saison:</h4>
|
|
||||||
<SeasonSelect></SeasonSelect>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class=list_wrapper>
|
|
||||||
<div>
|
|
||||||
<CreateIngredientList {ingredients} {portions}></CreateIngredientList>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<CreateStepList {instructions} {add_info}></CreateStepList>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class=addendum_wrapper>
|
|
||||||
<h3>Nachtrag:</h3>
|
|
||||||
<div class=addendum bind:innerText={addendum} contenteditable></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{#if actions.includes('add')}
|
|
||||||
<div class=submit_wrapper>
|
|
||||||
<h2>Neues Rezept hinzufügen:</h2>
|
|
||||||
<input type="password" placeholder=Passwort bind:value={password}>
|
|
||||||
<button class=action_button onclick={doAdd}><Check fill=white width=2rem height=2rem></Check></button>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{#if actions.includes('edit')}
|
|
||||||
<div class=submit_wrapper>
|
|
||||||
<h2>Editiertes Rezept abspeichern:</h2>
|
|
||||||
<input type="password" placeholder=Passwort bind:value={password}>
|
|
||||||
<button class=action_button onclick={doEdit}><Check fill=white width=2rem height=2rem></Check></button>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if actions.includes('delete')}
|
|
||||||
<div class=submit_wrapper>
|
|
||||||
<h2>Rezept löschen:</h2>
|
|
||||||
<input type="password" placeholder=Passwort bind:value={password}>
|
|
||||||
<button class=action_button onclick={doDelete}><Cross fill=white width=2rem height=2rem></Cross></button>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import ProfilePicture from './ProfilePicture.svelte';
|
import ProfilePicture from './ProfilePicture.svelte';
|
||||||
import EditButton from './EditButton.svelte';
|
import EditButton from '$lib/components/EditButton.svelte';
|
||||||
import { getCategoryEmoji, getCategoryName } from '$lib/utils/categories';
|
import { getCategoryEmoji, getCategoryName } from '$lib/utils/categories';
|
||||||
import { formatCurrency as formatCurrencyUtil } from '$lib/utils/formatters';
|
import { formatCurrency as formatCurrencyUtil } from '$lib/utils/formatters';
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { getLanguageContext } from '$lib/contexts/languageContext.js';
|
import { getLanguageContext } from '$lib/contexts/languageContext.js';
|
||||||
import Toggle from './Toggle.svelte';
|
import Toggle from '$lib/components/Toggle.svelte';
|
||||||
|
|
||||||
export let initialLatin = undefined;
|
export let initialLatin = undefined;
|
||||||
export let hasUrlLatin = false;
|
export let hasUrlLatin = false;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { createPip } from '$lib/js/pip.svelte';
|
import { createPip } from '$lib/js/pip.svelte';
|
||||||
import PipImage from '$lib/components/PipImage.svelte';
|
import PipImage from '$lib/components/faith/PipImage.svelte';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {'layout' | 'overlay'} mode
|
* @param {'layout' | 'overlay'} mode
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import { getRosaryStreak } from '$lib/stores/rosaryStreak.svelte';
|
import { getRosaryStreak } from '$lib/stores/rosaryStreak.svelte';
|
||||||
import StreakAura from '$lib/components/StreakAura.svelte';
|
import StreakAura from '$lib/components/faith/StreakAura.svelte';
|
||||||
import { tick, onMount } from 'svelte';
|
import { tick, onMount } from 'svelte';
|
||||||
|
|
||||||
let burst = $state(false);
|
let burst = $state(false);
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import { do_on_key } from '$lib/components/do_on_key.js'
|
import { do_on_key } from '$lib/components/recipes/do_on_key.js'
|
||||||
import Check from '$lib/assets/icons/Check.svelte'
|
import Check from '$lib/assets/icons/Check.svelte'
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import "$lib/css/nordtheme.css";
|
import "$lib/css/nordtheme.css";
|
||||||
import TagChip from './TagChip.svelte';
|
import TagChip from '$lib/components/recipes/TagChip.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
categories = [],
|
categories = [],
|
||||||
@@ -8,9 +8,9 @@ import Check from '$lib/assets/icons/Check.svelte'
|
|||||||
|
|
||||||
import "$lib/css/action_button.css"
|
import "$lib/css/action_button.css"
|
||||||
|
|
||||||
import { do_on_key } from '$lib/components/do_on_key.js'
|
import { do_on_key } from '$lib/components/recipes/do_on_key.js'
|
||||||
import { portions } from '$lib/js/portions_store.js'
|
import { portions } from '$lib/js/portions_store.js'
|
||||||
import BaseRecipeSelector from '$lib/components/BaseRecipeSelector.svelte'
|
import BaseRecipeSelector from '$lib/components/recipes/BaseRecipeSelector.svelte'
|
||||||
|
|
||||||
let portions_local = $state()
|
let portions_local = $state()
|
||||||
portions.subscribe((p) => {
|
portions.subscribe((p) => {
|
||||||
@@ -8,8 +8,8 @@ import Check from '$lib/assets/icons/Check.svelte'
|
|||||||
import '$lib/css/nordtheme.css'
|
import '$lib/css/nordtheme.css'
|
||||||
import "$lib/css/action_button.css"
|
import "$lib/css/action_button.css"
|
||||||
|
|
||||||
import { do_on_key } from '$lib/components/do_on_key.js'
|
import { do_on_key } from '$lib/components/recipes/do_on_key.js'
|
||||||
import BaseRecipeSelector from '$lib/components/BaseRecipeSelector.svelte'
|
import BaseRecipeSelector from '$lib/components/recipes/BaseRecipeSelector.svelte'
|
||||||
|
|
||||||
let { lang = 'de' as 'de' | 'en', instructions = $bindable(), add_info = $bindable() } = $props<{ lang?: 'de' | 'en', instructions: any, add_info: any }>();
|
let { lang = 'de' as 'de' | 'en', instructions = $bindable(), add_info = $bindable() } = $props<{ lang?: 'de' | 'en', instructions: any, add_info: any }>();
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import "$lib/css/nordtheme.css";
|
import "$lib/css/nordtheme.css";
|
||||||
import Toggle from './Toggle.svelte';
|
import Toggle from '$lib/components/Toggle.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import "$lib/css/nordtheme.css";
|
import "$lib/css/nordtheme.css";
|
||||||
import TagChip from './TagChip.svelte';
|
import TagChip from '$lib/components/recipes/TagChip.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
availableIcons = [],
|
availableIcons = [],
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Snippet } from 'svelte';
|
import type { Snippet } from 'svelte';
|
||||||
import '$lib/css/nordtheme.css';
|
import '$lib/css/nordtheme.css';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import Search from './Search.svelte';
|
import Search from './Search.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import CardAdd from '$lib/components/CardAdd.svelte';
|
import CardAdd from '$lib/components/recipes/CardAdd.svelte';
|
||||||
import MediaScroller from '$lib/components/MediaScroller.svelte';
|
import MediaScroller from '$lib/components/recipes/MediaScroller.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
import SeasonSelect from '$lib/components/SeasonSelect.svelte';
|
import SeasonSelect from '$lib/components/recipes/SeasonSelect.svelte';
|
||||||
import CreateIngredientList from '$lib/components/CreateIngredientList.svelte';
|
import CreateIngredientList from '$lib/components/recipes/CreateIngredientList.svelte';
|
||||||
import CreateStepList from '$lib/components/CreateStepList.svelte';
|
import CreateStepList from '$lib/components/recipes/CreateStepList.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
card_data = $bindable({}),
|
card_data = $bindable({}),
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import "$lib/css/nordtheme.css";
|
import "$lib/css/nordtheme.css";
|
||||||
import TagChip from './TagChip.svelte';
|
import TagChip from '$lib/components/recipes/TagChip.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
selectedSeasons = [],
|
selectedSeasons = [],
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Snippet } from 'svelte';
|
import type { Snippet } from 'svelte';
|
||||||
import '$lib/css/nordtheme.css';
|
import '$lib/css/nordtheme.css';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import Search from './Search.svelte';
|
import Search from './Search.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import "$lib/css/nordtheme.css";
|
import "$lib/css/nordtheme.css";
|
||||||
import TagChip from './TagChip.svelte';
|
import TagChip from '$lib/components/recipes/TagChip.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
availableTags = [],
|
availableTags = [],
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
import Cross from "$lib/assets/icons/Cross.svelte";
|
import Cross from "$lib/assets/icons/Cross.svelte";
|
||||||
import "$lib/css/action_button.css";
|
import "$lib/css/action_button.css";
|
||||||
import "$lib/css/shake.css";
|
import "$lib/css/shake.css";
|
||||||
import { do_on_key } from "./do_on_key";
|
import { do_on_key } from "$lib/components/recipes/do_on_key";
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { TranslatedRecipeType } from '$types/types';
|
import type { TranslatedRecipeType } from '$types/types';
|
||||||
import TranslationFieldComparison from './TranslationFieldComparison.svelte';
|
import TranslationFieldComparison from './TranslationFieldComparison.svelte';
|
||||||
import CreateIngredientList from './CreateIngredientList.svelte';
|
import CreateIngredientList from '$lib/components/recipes/CreateIngredientList.svelte';
|
||||||
import CreateStepList from './CreateStepList.svelte';
|
import CreateStepList from '$lib/components/recipes/CreateStepList.svelte';
|
||||||
import GenerateAltTextButton from './GenerateAltTextButton.svelte';
|
import GenerateAltTextButton from './GenerateAltTextButton.svelte';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { BriefRecipeType, RecipeModelType } from '../../types/types';
|
import type { BriefRecipeType, RecipeModelType } from '$types/types';
|
||||||
|
|
||||||
const DB_NAME = 'bocken-recipes';
|
const DB_NAME = 'bocken-recipes';
|
||||||
const DB_VERSION = 2; // Bumped to force recreation of stores
|
const DB_VERSION = 2; // Bumped to force recreation of stores
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { saveAllRecipes } from './db';
|
import { saveAllRecipes } from './db';
|
||||||
import type { BriefRecipeType, RecipeModelType } from '../../types/types';
|
import type { BriefRecipeType, RecipeModelType } from '$types/types';
|
||||||
|
|
||||||
// Discover glaube routes at build time using Vite's glob import
|
// Discover glaube routes at build time using Vite's glob import
|
||||||
const glaubePageModules = import.meta.glob('/src/routes/glaube/**/+page.svelte');
|
const glaubePageModules = import.meta.glob('/src/routes/glaube/**/+page.svelte');
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import cron from 'node-cron';
|
import cron from 'node-cron';
|
||||||
import { RecurringPayment } from '../../models/RecurringPayment';
|
import { RecurringPayment } from '$models/RecurringPayment';
|
||||||
import { Payment } from '../../models/Payment';
|
import { Payment } from '$models/Payment';
|
||||||
import { PaymentSplit } from '../../models/PaymentSplit';
|
import { PaymentSplit } from '$models/PaymentSplit';
|
||||||
import { dbConnect, dbDisconnect } from '../../utils/db';
|
import { dbConnect, dbDisconnect } from '$utils/db';
|
||||||
import { calculateNextExecutionDate } from '../utils/recurring';
|
import { calculateNextExecutionDate } from '$lib/utils/recurring';
|
||||||
|
|
||||||
class RecurringPaymentScheduler {
|
class RecurringPaymentScheduler {
|
||||||
private isRunning = false;
|
private isRunning = false;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ExchangeRate } from '../../models/ExchangeRate';
|
import { ExchangeRate } from '$models/ExchangeRate';
|
||||||
import { dbConnect, dbDisconnect } from '../../utils/db';
|
import { dbConnect, dbDisconnect } from '$utils/db';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert amount from foreign currency to CHF using direct database/API access
|
* Convert amount from foreign currency to CHF using direct database/API access
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { IRecurringPayment } from '../../models/RecurringPayment';
|
import type { IRecurringPayment } from '$models/RecurringPayment';
|
||||||
|
|
||||||
export interface CronJobFields {
|
export interface CronJobFields {
|
||||||
minute: string;
|
minute: string;
|
||||||
|
|||||||
@@ -5,22 +5,22 @@
|
|||||||
import "$lib/css/christ.css";
|
import "$lib/css/christ.css";
|
||||||
import "$lib/css/nordtheme.css";
|
import "$lib/css/nordtheme.css";
|
||||||
import Gebet from "./Gebet.svelte";
|
import Gebet from "./Gebet.svelte";
|
||||||
import LanguageToggle from "$lib/components/LanguageToggle.svelte";
|
import LanguageToggle from "$lib/components/faith/LanguageToggle.svelte";
|
||||||
import SearchInput from "$lib/components/SearchInput.svelte";
|
import SearchInput from "$lib/components/SearchInput.svelte";
|
||||||
import Kreuzzeichen from "$lib/components/prayers/Kreuzzeichen.svelte";
|
import Kreuzzeichen from "$lib/components/faith/prayers/Kreuzzeichen.svelte";
|
||||||
import GloriaPatri from "$lib/components/prayers/GloriaPatri.svelte";
|
import GloriaPatri from "$lib/components/faith/prayers/GloriaPatri.svelte";
|
||||||
import Paternoster from "$lib/components/prayers/Paternoster.svelte";
|
import Paternoster from "$lib/components/faith/prayers/Paternoster.svelte";
|
||||||
import Credo from "$lib/components/prayers/Credo.svelte";
|
import Credo from "$lib/components/faith/prayers/Credo.svelte";
|
||||||
import AveMaria from "$lib/components/prayers/AveMaria.svelte";
|
import AveMaria from "$lib/components/faith/prayers/AveMaria.svelte";
|
||||||
import SalveRegina from "$lib/components/prayers/SalveRegina.svelte";
|
import SalveRegina from "$lib/components/faith/prayers/SalveRegina.svelte";
|
||||||
import FatimaGebet from "$lib/components/prayers/FatimaGebet.svelte";
|
import FatimaGebet from "$lib/components/faith/prayers/FatimaGebet.svelte";
|
||||||
import Gloria from "$lib/components/prayers/Gloria.svelte";
|
import Gloria from "$lib/components/faith/prayers/Gloria.svelte";
|
||||||
import MichaelGebet from "$lib/components/prayers/MichaelGebet.svelte";
|
import MichaelGebet from "$lib/components/faith/prayers/MichaelGebet.svelte";
|
||||||
import BruderKlausGebet from "$lib/components/prayers/BruderKlausGebet.svelte";
|
import BruderKlausGebet from "$lib/components/faith/prayers/BruderKlausGebet.svelte";
|
||||||
import JosephGebet from "$lib/components/prayers/JosephGebet.svelte";
|
import JosephGebet from "$lib/components/faith/prayers/JosephGebet.svelte";
|
||||||
import Confiteor from "$lib/components/prayers/Confiteor.svelte";
|
import Confiteor from "$lib/components/faith/prayers/Confiteor.svelte";
|
||||||
import AblassGebete from "$lib/components/prayers/AblassGebete.svelte";
|
import AblassGebete from "$lib/components/faith/prayers/AblassGebete.svelte";
|
||||||
import Prayer from "$lib/components/prayers/Prayer.svelte";
|
import Prayer from "$lib/components/faith/prayers/Prayer.svelte";
|
||||||
|
|
||||||
let { data } = $props();
|
let { data } = $props();
|
||||||
|
|
||||||
|
|||||||
@@ -3,21 +3,21 @@
|
|||||||
import { createLanguageContext } from "$lib/contexts/languageContext.js";
|
import { createLanguageContext } from "$lib/contexts/languageContext.js";
|
||||||
import "$lib/css/christ.css";
|
import "$lib/css/christ.css";
|
||||||
import "$lib/css/nordtheme.css";
|
import "$lib/css/nordtheme.css";
|
||||||
import LanguageToggle from "$lib/components/LanguageToggle.svelte";
|
import LanguageToggle from "$lib/components/faith/LanguageToggle.svelte";
|
||||||
import Kreuzzeichen from "$lib/components/prayers/Kreuzzeichen.svelte";
|
import Kreuzzeichen from "$lib/components/faith/prayers/Kreuzzeichen.svelte";
|
||||||
import GloriaPatri from "$lib/components/prayers/GloriaPatri.svelte";
|
import GloriaPatri from "$lib/components/faith/prayers/GloriaPatri.svelte";
|
||||||
import Paternoster from "$lib/components/prayers/Paternoster.svelte";
|
import Paternoster from "$lib/components/faith/prayers/Paternoster.svelte";
|
||||||
import Credo from "$lib/components/prayers/Credo.svelte";
|
import Credo from "$lib/components/faith/prayers/Credo.svelte";
|
||||||
import AveMaria from "$lib/components/prayers/AveMaria.svelte";
|
import AveMaria from "$lib/components/faith/prayers/AveMaria.svelte";
|
||||||
import SalveRegina from "$lib/components/prayers/SalveRegina.svelte";
|
import SalveRegina from "$lib/components/faith/prayers/SalveRegina.svelte";
|
||||||
import FatimaGebet from "$lib/components/prayers/FatimaGebet.svelte";
|
import FatimaGebet from "$lib/components/faith/prayers/FatimaGebet.svelte";
|
||||||
import Gloria from "$lib/components/prayers/Gloria.svelte";
|
import Gloria from "$lib/components/faith/prayers/Gloria.svelte";
|
||||||
import MichaelGebet from "$lib/components/prayers/MichaelGebet.svelte";
|
import MichaelGebet from "$lib/components/faith/prayers/MichaelGebet.svelte";
|
||||||
import BruderKlausGebet from "$lib/components/prayers/BruderKlausGebet.svelte";
|
import BruderKlausGebet from "$lib/components/faith/prayers/BruderKlausGebet.svelte";
|
||||||
import JosephGebet from "$lib/components/prayers/JosephGebet.svelte";
|
import JosephGebet from "$lib/components/faith/prayers/JosephGebet.svelte";
|
||||||
import Confiteor from "$lib/components/prayers/Confiteor.svelte";
|
import Confiteor from "$lib/components/faith/prayers/Confiteor.svelte";
|
||||||
import AblassGebete from "$lib/components/prayers/AblassGebete.svelte";
|
import AblassGebete from "$lib/components/faith/prayers/AblassGebete.svelte";
|
||||||
import StickyImage from "$lib/components/StickyImage.svelte";
|
import StickyImage from "$lib/components/faith/StickyImage.svelte";
|
||||||
|
|
||||||
let { data } = $props();
|
let { data } = $props();
|
||||||
|
|
||||||
|
|||||||
@@ -2,24 +2,24 @@
|
|||||||
import { onMount, tick } from "svelte";
|
import { onMount, tick } from "svelte";
|
||||||
import { createLanguageContext } from "$lib/contexts/languageContext.js";
|
import { createLanguageContext } from "$lib/contexts/languageContext.js";
|
||||||
import { createPip } from "$lib/js/pip.svelte";
|
import { createPip } from "$lib/js/pip.svelte";
|
||||||
import PipImage from "$lib/components/PipImage.svelte";
|
import PipImage from "$lib/components/faith/PipImage.svelte";
|
||||||
import "$lib/css/christ.css";
|
import "$lib/css/christ.css";
|
||||||
import "$lib/css/action_button.css";
|
import "$lib/css/action_button.css";
|
||||||
import Kreuzzeichen from "$lib/components/prayers/Kreuzzeichen.svelte";
|
import Kreuzzeichen from "$lib/components/faith/prayers/Kreuzzeichen.svelte";
|
||||||
import Credo from "$lib/components/prayers/Credo.svelte";
|
import Credo from "$lib/components/faith/prayers/Credo.svelte";
|
||||||
import Paternoster from "$lib/components/prayers/Paternoster.svelte";
|
import Paternoster from "$lib/components/faith/prayers/Paternoster.svelte";
|
||||||
import AveMaria from "$lib/components/prayers/AveMaria.svelte";
|
import AveMaria from "$lib/components/faith/prayers/AveMaria.svelte";
|
||||||
import GloriaPatri from "$lib/components/prayers/GloriaPatri.svelte";
|
import GloriaPatri from "$lib/components/faith/prayers/GloriaPatri.svelte";
|
||||||
import FatimaGebet from "$lib/components/prayers/FatimaGebet.svelte";
|
import FatimaGebet from "$lib/components/faith/prayers/FatimaGebet.svelte";
|
||||||
import SalveRegina from "$lib/components/prayers/SalveRegina.svelte";
|
import SalveRegina from "$lib/components/faith/prayers/SalveRegina.svelte";
|
||||||
import RosaryFinalPrayer from "$lib/components/prayers/RosaryFinalPrayer.svelte";
|
import RosaryFinalPrayer from "$lib/components/faith/prayers/RosaryFinalPrayer.svelte";
|
||||||
import MichaelGebet from "$lib/components/prayers/MichaelGebet.svelte";
|
import MichaelGebet from "$lib/components/faith/prayers/MichaelGebet.svelte";
|
||||||
import CounterButton from "$lib/components/CounterButton.svelte";
|
import CounterButton from "$lib/components/CounterButton.svelte";
|
||||||
import BibleModal from "$lib/components/BibleModal.svelte";
|
import BibleModal from "$lib/components/faith/BibleModal.svelte";
|
||||||
import Toggle from "$lib/components/Toggle.svelte";
|
import Toggle from "$lib/components/Toggle.svelte";
|
||||||
import LanguageToggle from "$lib/components/LanguageToggle.svelte";
|
import LanguageToggle from "$lib/components/faith/LanguageToggle.svelte";
|
||||||
import StreakCounter from "$lib/components/StreakCounter.svelte";
|
import StreakCounter from "$lib/components/faith/StreakCounter.svelte";
|
||||||
import MysteryIcon from "$lib/components/MysteryIcon.svelte";
|
import MysteryIcon from "$lib/components/faith/MysteryIcon.svelte";
|
||||||
let { data } = $props();
|
let { data } = $props();
|
||||||
|
|
||||||
// Mystery variations for each type of rosary
|
// Mystery variations for each type of rosary
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { createLanguageContext } from "$lib/contexts/languageContext.js";
|
import { createLanguageContext } from "$lib/contexts/languageContext.js";
|
||||||
import LanguageToggle from "$lib/components/LanguageToggle.svelte";
|
import LanguageToggle from "$lib/components/faith/LanguageToggle.svelte";
|
||||||
import Prayer from '$lib/components/prayers/Prayer.svelte';
|
import Prayer from '$lib/components/faith/prayers/Prayer.svelte';
|
||||||
import AveMaria from '$lib/components/prayers/AveMaria.svelte';
|
import AveMaria from '$lib/components/faith/prayers/AveMaria.svelte';
|
||||||
import "$lib/css/christ.css";
|
import "$lib/css/christ.css";
|
||||||
import "$lib/css/rosenkranz.css";
|
import "$lib/css/rosenkranz.css";
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import MediaScroller from '$lib/components/MediaScroller.svelte';
|
import MediaScroller from '$lib/components/recipes/MediaScroller.svelte';
|
||||||
import AddButton from '$lib/components/AddButton.svelte';
|
import AddButton from '$lib/components/AddButton.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
import LazyCategory from '$lib/components/LazyCategory.svelte';
|
import LazyCategory from '$lib/components/LazyCategory.svelte';
|
||||||
import { getCategories } from '$lib/js/categories';
|
import { getCategories } from '$lib/js/categories';
|
||||||
let { data } = $props<{ data: PageData }>();
|
let { data } = $props<{ data: PageData }>();
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import "$lib/css/nordtheme.css"
|
import "$lib/css/nordtheme.css"
|
||||||
import EditButton from '$lib/components/EditButton.svelte';
|
import EditButton from '$lib/components/EditButton.svelte';
|
||||||
import InstructionsPage from '$lib/components/InstructionsPage.svelte';
|
import InstructionsPage from '$lib/components/recipes/InstructionsPage.svelte';
|
||||||
import IngredientsPage from '$lib/components/IngredientsPage.svelte';
|
import IngredientsPage from '$lib/components/recipes/IngredientsPage.svelte';
|
||||||
import TitleImgParallax from '$lib/components/TitleImgParallax.svelte';
|
import TitleImgParallax from '$lib/components/recipes/TitleImgParallax.svelte';
|
||||||
import { afterNavigate } from '$app/navigation';
|
import { afterNavigate } from '$app/navigation';
|
||||||
import {season} from '$lib/js/season_store';
|
import {season} from '$lib/js/season_store';
|
||||||
import RecipeNote from '$lib/components/RecipeNote.svelte';
|
import RecipeNote from '$lib/components/recipes/RecipeNote.svelte';
|
||||||
import FavoriteButton from '$lib/components/FavoriteButton.svelte';
|
import FavoriteButton from '$lib/components/FavoriteButton.svelte';
|
||||||
import { onDestroy } from 'svelte';
|
import { onDestroy } from 'svelte';
|
||||||
import { recipeTranslationStore } from '$lib/stores/recipeTranslation';
|
import { recipeTranslationStore } from '$lib/stores/recipeTranslation';
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
import { tick } from 'svelte';
|
import { tick } from 'svelte';
|
||||||
import type { ActionData, PageData } from './$types';
|
import type { ActionData, PageData } from './$types';
|
||||||
import Check from '$lib/assets/icons/Check.svelte';
|
import Check from '$lib/assets/icons/Check.svelte';
|
||||||
import SeasonSelect from '$lib/components/SeasonSelect.svelte';
|
import SeasonSelect from '$lib/components/recipes/SeasonSelect.svelte';
|
||||||
import TranslationApproval from '$lib/components/TranslationApproval.svelte';
|
import TranslationApproval from '$lib/components/recipes/TranslationApproval.svelte';
|
||||||
import CardAdd from '$lib/components/CardAdd.svelte';
|
import CardAdd from '$lib/components/recipes/CardAdd.svelte';
|
||||||
import CreateIngredientList from '$lib/components/CreateIngredientList.svelte';
|
import CreateIngredientList from '$lib/components/recipes/CreateIngredientList.svelte';
|
||||||
import CreateStepList from '$lib/components/CreateStepList.svelte';
|
import CreateStepList from '$lib/components/recipes/CreateStepList.svelte';
|
||||||
import Toggle from '$lib/components/Toggle.svelte';
|
import Toggle from '$lib/components/Toggle.svelte';
|
||||||
import '$lib/css/action_button.css';
|
import '$lib/css/action_button.css';
|
||||||
import '$lib/css/nordtheme.css';
|
import '$lib/css/nordtheme.css';
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import '$lib/css/nordtheme.css';
|
import '$lib/css/nordtheme.css';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
|
|
||||||
let { data } = $props<{ data: PageData }>();
|
let { data } = $props<{ data: PageData }>();
|
||||||
let current_month = new Date().getMonth() + 1;
|
let current_month = new Date().getMonth() + 1;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import { rand_array } from '$lib/js/randomize';
|
import { rand_array } from '$lib/js/randomize';
|
||||||
import { createSearchFilter } from '$lib/js/searchFilter.svelte';
|
import { createSearchFilter } from '$lib/js/searchFilter.svelte';
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
import type { ActionData, PageData } from './$types';
|
import type { ActionData, PageData } from './$types';
|
||||||
import Check from '$lib/assets/icons/Check.svelte';
|
import Check from '$lib/assets/icons/Check.svelte';
|
||||||
import Cross from '$lib/assets/icons/Cross.svelte';
|
import Cross from '$lib/assets/icons/Cross.svelte';
|
||||||
import SeasonSelect from '$lib/components/SeasonSelect.svelte';
|
import SeasonSelect from '$lib/components/recipes/SeasonSelect.svelte';
|
||||||
import TranslationApproval from '$lib/components/TranslationApproval.svelte';
|
import TranslationApproval from '$lib/components/recipes/TranslationApproval.svelte';
|
||||||
import GenerateAltTextButton from '$lib/components/GenerateAltTextButton.svelte';
|
import GenerateAltTextButton from '$lib/components/recipes/GenerateAltTextButton.svelte';
|
||||||
import EditRecipeNote from '$lib/components/EditRecipeNote.svelte';
|
import EditRecipeNote from '$lib/components/recipes/EditRecipeNote.svelte';
|
||||||
import CardAdd from '$lib/components/CardAdd.svelte';
|
import CardAdd from '$lib/components/recipes/CardAdd.svelte';
|
||||||
import CreateIngredientList from '$lib/components/CreateIngredientList.svelte';
|
import CreateIngredientList from '$lib/components/recipes/CreateIngredientList.svelte';
|
||||||
import CreateStepList from '$lib/components/CreateStepList.svelte';
|
import CreateStepList from '$lib/components/recipes/CreateStepList.svelte';
|
||||||
import Toggle from '$lib/components/Toggle.svelte';
|
import Toggle from '$lib/components/Toggle.svelte';
|
||||||
import { season } from '$lib/js/season_store';
|
import { season } from '$lib/js/season_store';
|
||||||
import { portions } from '$lib/js/portions_store';
|
import { portions } from '$lib/js/portions_store';
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import '$lib/css/nordtheme.css';
|
import '$lib/css/nordtheme.css';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
import { createSearchFilter } from '$lib/js/searchFilter.svelte';
|
import { createSearchFilter } from '$lib/js/searchFilter.svelte';
|
||||||
|
|
||||||
let { data } = $props<{ data: PageData }>();
|
let { data } = $props<{ data: PageData }>();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import '$lib/css/nordtheme.css';
|
import '$lib/css/nordtheme.css';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import MediaScroller from '$lib/components/MediaScroller.svelte';
|
import MediaScroller from '$lib/components/recipes/MediaScroller.svelte';
|
||||||
import SeasonLayout from '$lib/components/SeasonLayout.svelte'
|
import SeasonLayout from '$lib/components/recipes/SeasonLayout.svelte'
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
let { data } = $props<{ data: PageData }>();
|
let { data } = $props<{ data: PageData }>();
|
||||||
|
|
||||||
const isEnglish = $derived(data.lang === 'en');
|
const isEnglish = $derived(data.lang === 'en');
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import IconLayout from '$lib/components/IconLayout.svelte';
|
import IconLayout from '$lib/components/recipes/IconLayout.svelte';
|
||||||
import MediaScroller from '$lib/components/MediaScroller.svelte';
|
import MediaScroller from '$lib/components/recipes/MediaScroller.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
let { data } = $props<{ data: PageData }>();
|
let { data } = $props<{ data: PageData }>();
|
||||||
import { rand_array } from '$lib/js/randomize';
|
import { rand_array } from '$lib/js/randomize';
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
let { data } = $props<{ data: PageData }>();
|
let { data } = $props<{ data: PageData }>();
|
||||||
let current_month = new Date().getMonth() + 1;
|
let current_month = new Date().getMonth() + 1;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import '$lib/css/nordtheme.css';
|
import '$lib/css/nordtheme.css';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import MediaScroller from '$lib/components/MediaScroller.svelte';
|
import MediaScroller from '$lib/components/recipes/MediaScroller.svelte';
|
||||||
import SeasonLayout from '$lib/components/SeasonLayout.svelte'
|
import SeasonLayout from '$lib/components/recipes/SeasonLayout.svelte'
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
let { data } = $props<{ data: PageData }>();
|
let { data } = $props<{ data: PageData }>();
|
||||||
let current_month = new Date().getMonth() + 1
|
let current_month = new Date().getMonth() + 1
|
||||||
import { rand_array } from '$lib/js/randomize';
|
import { rand_array } from '$lib/js/randomize';
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import SeasonLayout from '$lib/components/SeasonLayout.svelte';
|
import SeasonLayout from '$lib/components/recipes/SeasonLayout.svelte';
|
||||||
import MediaScroller from '$lib/components/MediaScroller.svelte';
|
import MediaScroller from '$lib/components/recipes/MediaScroller.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
let { data } = $props<{ data: PageData }>();
|
let { data } = $props<{ data: PageData }>();
|
||||||
|
|
||||||
const isEnglish = $derived(data.lang === 'en');
|
const isEnglish = $derived(data.lang === 'en');
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import Recipes from '$lib/components/Recipes.svelte';
|
import Recipes from '$lib/components/recipes/Recipes.svelte';
|
||||||
import Card from '$lib/components/Card.svelte';
|
import Card from '$lib/components/recipes/Card.svelte';
|
||||||
import Search from '$lib/components/Search.svelte';
|
import Search from '$lib/components/recipes/Search.svelte';
|
||||||
import { rand_array } from '$lib/js/randomize';
|
import { rand_array } from '$lib/js/randomize';
|
||||||
import { createSearchFilter } from '$lib/js/searchFilter.svelte';
|
import { createSearchFilter } from '$lib/js/searchFilter.svelte';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { PaymentSplit } from '../../../../models/PaymentSplit';
|
import { PaymentSplit } from '$models/PaymentSplit';
|
||||||
import { Payment } from '../../../../models/Payment'; // Need to import Payment for populate to work
|
import { Payment } from '$models/Payment'; // Need to import Payment for populate to work
|
||||||
import { dbConnect } from '../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import cache from '$lib/server/cache';
|
import cache from '$lib/server/cache';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { PaymentSplit } from '../../../../models/PaymentSplit';
|
import { PaymentSplit } from '$models/PaymentSplit';
|
||||||
import { Payment } from '../../../../models/Payment';
|
import { Payment } from '$models/Payment';
|
||||||
import { dbConnect } from '../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import cache from '$lib/server/cache';
|
import cache from '$lib/server/cache';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { ExchangeRate } from '../../../../models/ExchangeRate';
|
import { ExchangeRate } from '$models/ExchangeRate';
|
||||||
import { dbConnect } from '../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
|
|
||||||
export const GET: RequestHandler = async ({ locals, url }) => {
|
export const GET: RequestHandler = async ({ locals, url }) => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { json } from '@sveltejs/kit';
|
import { json } from '@sveltejs/kit';
|
||||||
import type { RequestHandler } from './$types';
|
import type { RequestHandler } from './$types';
|
||||||
import { Payment } from '../../../../models/Payment';
|
import { Payment } from '$models/Payment';
|
||||||
import { dbConnect } from '../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
|
|
||||||
export const GET: RequestHandler = async ({ url, locals }) => {
|
export const GET: RequestHandler = async ({ url, locals }) => {
|
||||||
const session = await locals.auth();
|
const session = await locals.auth();
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { Payment } from '../../../../models/Payment';
|
import { Payment } from '$models/Payment';
|
||||||
import { PaymentSplit } from '../../../../models/PaymentSplit';
|
import { PaymentSplit } from '$models/PaymentSplit';
|
||||||
import { dbConnect } from '../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { convertToCHF, isValidCurrencyCode } from '../../../../lib/utils/currency';
|
import { convertToCHF, isValidCurrencyCode } from '$lib/utils/currency';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import cache, { invalidateCospendCaches } from '$lib/server/cache';
|
import cache, { invalidateCospendCaches } from '$lib/server/cache';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { Payment } from '../../../../../models/Payment';
|
import { Payment } from '$models/Payment';
|
||||||
import { PaymentSplit } from '../../../../../models/PaymentSplit';
|
import { PaymentSplit } from '$models/PaymentSplit';
|
||||||
import { dbConnect } from '../../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import cache, { invalidateCospendCaches } from '$lib/server/cache';
|
import cache, { invalidateCospendCaches } from '$lib/server/cache';
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { RecurringPayment } from '../../../../models/RecurringPayment';
|
import { RecurringPayment } from '$models/RecurringPayment';
|
||||||
import { dbConnect } from '../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import { calculateNextExecutionDate, validateCronExpression } from '../../../../lib/utils/recurring';
|
import { calculateNextExecutionDate, validateCronExpression } from '$lib/utils/recurring';
|
||||||
|
|
||||||
export const GET: RequestHandler = async ({ locals, url }) => {
|
export const GET: RequestHandler = async ({ locals, url }) => {
|
||||||
const auth = await locals.auth();
|
const auth = await locals.auth();
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { RecurringPayment } from '../../../../../models/RecurringPayment';
|
import { RecurringPayment } from '$models/RecurringPayment';
|
||||||
import { dbConnect } from '../../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import { calculateNextExecutionDate, validateCronExpression } from '../../../../../lib/utils/recurring';
|
import { calculateNextExecutionDate, validateCronExpression } from '$lib/utils/recurring';
|
||||||
import mongoose from 'mongoose';
|
import mongoose from 'mongoose';
|
||||||
|
|
||||||
export const GET: RequestHandler = async ({ params, locals }) => {
|
export const GET: RequestHandler = async ({ params, locals }) => {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { RecurringPayment } from '../../../../../models/RecurringPayment';
|
import { RecurringPayment } from '$models/RecurringPayment';
|
||||||
import { Payment } from '../../../../../models/Payment';
|
import { Payment } from '$models/Payment';
|
||||||
import { PaymentSplit } from '../../../../../models/PaymentSplit';
|
import { PaymentSplit } from '$models/PaymentSplit';
|
||||||
import { dbConnect } from '../../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import { calculateNextExecutionDate } from '../../../../../lib/utils/recurring';
|
import { calculateNextExecutionDate } from '$lib/utils/recurring';
|
||||||
import { invalidateCospendCaches } from '$lib/server/cache';
|
import { invalidateCospendCaches } from '$lib/server/cache';
|
||||||
|
|
||||||
// This endpoint is designed to be called by a cron job or external scheduler
|
// This endpoint is designed to be called by a cron job or external scheduler
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { RecurringPayment } from '../../../../../models/RecurringPayment';
|
import { RecurringPayment } from '$models/RecurringPayment';
|
||||||
import { Payment } from '../../../../../models/Payment';
|
import { Payment } from '$models/Payment';
|
||||||
import { PaymentSplit } from '../../../../../models/PaymentSplit';
|
import { PaymentSplit } from '$models/PaymentSplit';
|
||||||
import { dbConnect } from '../../../../../utils/db';
|
import { dbConnect } from '$utils/db';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import { calculateNextExecutionDate } from '../../../../../lib/utils/recurring';
|
import { calculateNextExecutionDate } from '$lib/utils/recurring';
|
||||||
import { convertToCHF } from '../../../../../lib/utils/currency';
|
import { convertToCHF } from '$lib/utils/currency';
|
||||||
import { invalidateCospendCaches } from '$lib/server/cache';
|
import { invalidateCospendCaches } from '$lib/server/cache';
|
||||||
|
|
||||||
export const POST: RequestHandler = async ({ locals }) => {
|
export const POST: RequestHandler = async ({ locals }) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { error, json } from '@sveltejs/kit';
|
import { error, json } from '@sveltejs/kit';
|
||||||
import { recurringPaymentScheduler } from '../../../../../lib/server/scheduler';
|
import { recurringPaymentScheduler } from '$lib/server/scheduler';
|
||||||
|
|
||||||
export const GET: RequestHandler = async ({ locals }) => {
|
export const GET: RequestHandler = async ({ locals }) => {
|
||||||
const auth = await locals.auth();
|
const auth = await locals.auth();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user