Skip to content

Commit

Permalink
Remove old code
Browse files Browse the repository at this point in the history
  • Loading branch information
scmmmh committed Nov 24, 2023
1 parent 98c210b commit 00b1bb3
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 456 deletions.
96 changes: 50 additions & 46 deletions museum_map/server/frontend/src/components/Footer.svelte
Original file line number Diff line number Diff line change
@@ -1,53 +1,57 @@
<script lang="ts">
import { config } from "../store";
import { createQuery } from "@tanstack/svelte-query";
import { apiRequest } from "../util";
const config = createQuery({
queryKey: ["/config/"],
queryFn: apiRequest<Config>,
});
</script>

<footer class="bg-inherit shadow-even shadow-black text-sm py-1 z-10">
<nav>
<ul class="flex flex-row flex-wrap gap-y-1">
<li class="flex-none w-full md:w-1/3 px-2 text-center md:text-left">
<a
href="https://www.room3b.eu/pages/projects/digital-museum-map.html"
target="_blank"
rel="noopener"
class="underline decoration-dotted hover:decoration-solid focus:decoration-solid"
>Find out more about how this works</a
>
</li>
<li
class="flex-none w-full md:w-1/3 pt-1 md:pt-0 md:py-0 text-center"
<nav>
<ul class="flex flex-row flex-wrap gap-y-1">
<li class="flex-none w-full md:w-1/3 px-2 text-center md:text-left">
<a
href="https://www.room3b.eu/pages/projects/digital-museum-map.html"
target="_blank"
rel="noopener"
class="underline decoration-dotted hover:decoration-solid focus:decoration-solid"
>Find out more about how this works</a
>
</li>
<li class="flex-none w-full md:w-1/3 pt-1 md:pt-0 md:py-0 text-center">
{#if $config.isSuccess && $config.data.footer && $config.data.footer.center}
{#if $config.data.footer.center.url}
<a
href={$config.data.footer.center.url}
target="_blank"
rel="noopener"
class="underline decoration-dotted hover:decoration-solid focus:decoration-solid"
>{@html $config.data.footer.center.label}</a
>
{#if $config && $config.footer && $config.footer.center}
{#if $config.footer.center.url}
<a
href={$config.footer.center.url}
target="_blank"
rel="noopener"
class="underline decoration-dotted hover:decoration-solid focus:decoration-solid"
>{@html $config.footer.center.label}</a
>
{:else}
<span>{@html $config.footer.center.label}</span>
{/if}
{/if}
</li>
<li
class="flex-none w-full md:w-1/3 px-2 pt-1 md:pt-0 text-center md:text-right"
{:else}
<span>{@html $config.data.footer.center.label}</span>
{/if}
{/if}
</li>
<li
class="flex-none w-full md:w-1/3 px-2 pt-1 md:pt-0 text-center md:text-right"
>
{#if $config.isSuccess && $config.data.footer && $config.data.footer.right}
{#if $config.data.footer.right.url}
<a
href={$config.data.footer.right.url}
target="_blank"
rel="noopener"
class="underline decoration-dotted hover:decoration-solid focus:decoration-solid"
>{@html $config.data.footer.right.label}</a
>
{#if $config && $config.footer && $config.footer.right}
{#if $config.footer.right.url}
<a
href={$config.footer.right.url}
target="_blank"
rel="noopener"
class="underline decoration-dotted hover:decoration-solid focus:decoration-solid"
>{@html $config.footer.right.label}</a
>
{:else}
<span>{@html $config.footer.right.label}</span>
{/if}
{/if}
</li>
</ul>
</nav>
{:else}
<span>{@html $config.data.footer.right.label}</span>
{/if}
{/if}
</li>
</ul>
</nav>
</footer>
15 changes: 11 additions & 4 deletions museum_map/server/frontend/src/components/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script lang="ts">
import { afterUpdate, onDestroy, onMount, tick } from "svelte";
import { location } from "../simple-svelte-router";
import { useIsFetching } from "@tanstack/svelte-query";
import { createQuery, useIsFetching } from "@tanstack/svelte-query";
import { searchTerm, searchRoom, floors, tracker } from "../store";
import { searchTerm, searchRoom, tracker } from "../store";
import { apiRequest } from "../util";
export let title: string;
export let nav: { path: string; label: string }[];
Expand All @@ -13,6 +14,11 @@
let showSearch = false;
let searchElement: HTMLElement | null = null;
const floors = createQuery({
queryKey: ["/floors/"],
queryFn: apiRequest<Floor[]>,
});
const unsubscribeLocation = location.subscribe((location) => {
if (location.pathname.startsWith("/room")) {
const parts = location.pathname.split("/");
Expand All @@ -26,9 +32,10 @@
if (
searchTerm.trim() !== "" &&
$location.pathname === "/" &&
$floors.length > 0
$floors.isSuccess &&
$floors.data.length > 0
) {
location.push("/floor/" + $floors[0].id + "?search");
location.push("/floor/" + $floors.data[0].id + "?search");
}
if (searchTerm.trim() !== "") {
showSearch = true;
Expand Down
22 changes: 0 additions & 22 deletions museum_map/server/frontend/src/store/busy.ts

This file was deleted.

27 changes: 0 additions & 27 deletions museum_map/server/frontend/src/store/config.ts

This file was deleted.

93 changes: 0 additions & 93 deletions museum_map/server/frontend/src/store/floors.ts

This file was deleted.

46 changes: 1 addition & 45 deletions museum_map/server/frontend/src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,16 @@
import { busyCounter, isBusy } from './busy';
import { itemOfTheDay, randomItemsSelection } from './picks';
import { floorTopics, majorCollections, floors, currentFloor } from './floors';
import { rooms, currentRooms, currentRoom } from './rooms';
import { items, currentItems, currentItem } from './items';
import { config } from './config';
import { cachedTopics, loadTopics } from './topics';
import { localPreferences } from './preferences';
import { searchTerm, searchRoom, matchingFloors, matchingRooms, matchingItems } from './search';
import { searchTerm, searchRoom } from './search';
import { consent, ageBand } from './consent';
import { tracker } from './tracking';
import { status, isConnected, isUpdatable, isReady } from "./status";
import { loadingProgress, isLoaded } from './loading';

export {
busyCounter,
isBusy,

itemOfTheDay,
randomItemsSelection,

floorTopics,
majorCollections,
floors,
currentFloor,

currentRoom,
currentRooms,
rooms,

items,
currentItems,
currentItem,

cachedTopics,
loadTopics,

config,

localPreferences,

searchTerm,
searchRoom,
matchingFloors,
matchingRooms,
matchingItems,

consent,
ageBand,

tracker,

status,
isConnected,
isUpdatable,
isReady,

loadingProgress,
isLoaded,
};
41 changes: 0 additions & 41 deletions museum_map/server/frontend/src/store/items.ts

This file was deleted.

Loading

0 comments on commit 00b1bb3

Please sign in to comment.