mirror of
https://github.com/catdevnull/transicion-desordenada-diablo
synced 2024-11-26 19:26:18 +00:00
Compare commits
No commits in common. "d01d197bde166f811f6684dcd57f208dc4c72886" and "b9fabe6d8db3620c9676b612a2a80e8cd81af63f" have entirely different histories.
d01d197bde
...
b9fabe6d8d
14 changed files with 172 additions and 179 deletions
|
@ -5,7 +5,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Transicion Desordenada Diablo (ver dataset)</title>
|
<title>Transicion Desordenada Diablo (ver dataset)</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-gray-50 dark:bg-gray-900 dark:text-white">
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@poppanator/sveltekit-svg": "^4.1.3",
|
|
||||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||||
"@tailwindcss/typography": "^0.5.10",
|
"@tailwindcss/typography": "^0.5.10",
|
||||||
"@tsconfig/svelte": "^5.0.2",
|
"@tsconfig/svelte": "^5.0.2",
|
||||||
|
@ -25,7 +24,8 @@
|
||||||
"tailwindcss": "^3.3.6",
|
"tailwindcss": "^3.3.6",
|
||||||
"tslib": "^2.6.2",
|
"tslib": "^2.6.2",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"vite": "^5.0.0"
|
"vite": "^5.0.0",
|
||||||
|
"vite-plugin-svelte-svg": "^2.3.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"eva-icons": "^1.1.3",
|
"eva-icons": "^1.1.3",
|
||||||
|
@ -36,16 +36,7 @@
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"prettier-plugin-svelte",
|
|
||||||
"prettier-plugin-tailwindcss"
|
"prettier-plugin-tailwindcss"
|
||||||
],
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": "*.svelte",
|
|
||||||
"options": {
|
|
||||||
"parser": "svelte"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
body {
|
||||||
|
@apply bg-gray-50;
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
<div
|
|
||||||
class="rounded-lg border dark:border-gray-700 bg-white dark:bg-gray-800 m-2"
|
|
||||||
>
|
|
||||||
<slot />
|
|
||||||
</div>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<script lang="ts">
|
|
||||||
import ExternalLink from "eva-icons/outline/svg/external-link-outline.svg?component";
|
|
||||||
|
|
||||||
export let href: string;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<a
|
|
||||||
class="flex items-center leading-none text-gray-600 dark:text-gray-300 gap-1 pt-2"
|
|
||||||
{href}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
>
|
|
||||||
<ExternalLink fill="currentColor" class="h-4" />
|
|
||||||
<span class="underline">Fuente</span>
|
|
||||||
</a>
|
|
|
@ -1,47 +1,55 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { inject } from "regexparam";
|
import { inject } from "regexparam";
|
||||||
import ChevronRight from "eva-icons/outline/svg/chevron-right-outline.svg?component";
|
import ChevronRight from "eva-icons/outline/svg/chevron-right-outline.svg?component";
|
||||||
import { generateDumpName, routes } from "../router";
|
import { routes } from "../router";
|
||||||
import NavItem from "./NavItem.svelte";
|
import Portal from "../routes/Portal.svelte";
|
||||||
|
|
||||||
export let params:
|
export let params:
|
||||||
| { dumpUrl: string }
|
| { dumpUrl: string }
|
||||||
| { dumpUrl: string; portal: string }
|
| { dumpUrl: string; portal: string }
|
||||||
| { dumpUrl: string; portal: string; id: string };
|
| { dumpUrl: string; portal: string; id: string };
|
||||||
|
|
||||||
$: kind = "id" in params ? "dataset" : "portal" in params ? "portal" : "dump";
|
function generateDumpName(dumpUrl: string) {
|
||||||
|
const clean = decodeURIComponent(dumpUrl).replace(/\/+$/, "");
|
||||||
|
return clean.slice(clean.lastIndexOf("/") + 1);
|
||||||
|
}
|
||||||
|
|
||||||
$: dumpName = generateDumpName(params.dumpUrl);
|
$: dumpName = generateDumpName(params.dumpUrl);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav class="m-2 flex justify-between">
|
<nav class="flex justify-between m-2">
|
||||||
<ol
|
<ol
|
||||||
class="mb-3 flex items-center overflow-x-hidden text-sm text-neutral-500 dark:text-neutral-300 sm:mb-0 [&_.active-breadcrumb]:font-bold [&_.active-breadcrumb]:text-neutral-600 dark:[&_.active-breadcrumb]:text-neutral-200"
|
class="flex items-center mb-3 text-sm text-neutral-500 [&_.active-breadcrumb]:text-neutral-600 [&_.active-breadcrumb]:font-medium sm:mb-0"
|
||||||
class:active-breadcrumb={kind === "dump"}
|
|
||||||
>
|
>
|
||||||
<NavItem href={inject(routes.Dump, params)} active={kind === "dump"}
|
<li class="flex items-center h-full">
|
||||||
>{dumpName}</NavItem
|
<a
|
||||||
|
href={inject(routes.Dump, params)}
|
||||||
|
class="inline-flex items-center px-2 py-1.5 space-x-1.5 rounded-md hover:text-neutral-900 hover:bg-neutral-100"
|
||||||
>
|
>
|
||||||
|
<span>{dumpName}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
{#if "portal" in params}
|
{#if "portal" in params}
|
||||||
<ChevronRight
|
<ChevronRight class="w-5 h-5 text-gray-400" fill="currentColor" />
|
||||||
class="h-5 w-5 shrink-0 text-neutral-400"
|
<li>
|
||||||
fill="currentColor"
|
<a
|
||||||
/>
|
href={inject(routes.Portal, params)}
|
||||||
<NavItem href={inject(routes.Portal, params)} active={kind === "portal"}>
|
class="inline-flex items-center px-2 py-1.5 space-x-1.5 font-normal rounded-md hover:bg-neutral-100 hover:text-neutral-900"
|
||||||
{params.portal}
|
>
|
||||||
</NavItem>
|
<span>{params.portal}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
{#if "id" in params}
|
{#if "id" in params}
|
||||||
<ChevronRight
|
<ChevronRight class="w-5 h-5 text-gray-400" fill="currentColor" />
|
||||||
class="h-5 w-5 shrink-0 text-neutral-400"
|
<li>
|
||||||
fill="currentColor"
|
<a
|
||||||
/>
|
|
||||||
<NavItem
|
|
||||||
href={inject(routes.Dataset, params)}
|
href={inject(routes.Dataset, params)}
|
||||||
active={kind === "dataset"}
|
class="inline-flex items-center px-2 py-1.5 space-x-1.5 font-normal rounded-md hover:bg-neutral-100 hover:text-neutral-900"
|
||||||
>
|
>
|
||||||
{params.id}
|
<span>{params.id}</span>
|
||||||
</NavItem>
|
</a>
|
||||||
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
<script lang="ts">
|
|
||||||
export let active: boolean = false;
|
|
||||||
export let href: string;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<li class="min-w-0">
|
|
||||||
<a
|
|
||||||
{href}
|
|
||||||
class="block w-full space-x-1.5 overflow-hidden text-ellipsis whitespace-nowrap rounded-md px-2 py-1.5 hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-gray-800 dark:hover:text-gray-100"
|
|
||||||
class:active-breadcrumb={active}
|
|
||||||
>
|
|
||||||
<slot />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
|
@ -8,30 +8,13 @@ export const routes = {
|
||||||
Dataset: "/dump/:dumpUrl/:portal/dataset/:id",
|
Dataset: "/dump/:dumpUrl/:portal/dataset/:id",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function generateDumpName(dumpUrl: string) {
|
|
||||||
const clean = decodeURIComponent(dumpUrl).replace(/\/+$/, "");
|
|
||||||
return clean.slice(clean.lastIndexOf("/") + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
const title = "Archivo de portales de datos de Argentina";
|
|
||||||
const titles: { [key in ComponentType]: (params: Params) => string } = {
|
|
||||||
Home: () => title,
|
|
||||||
NotFound: () => title,
|
|
||||||
Dump: (params) => `${generateDumpName(params.dumpUrl)} - ${title}`,
|
|
||||||
Portal: (params) => `${params.portal} - ${title}`,
|
|
||||||
Dataset: (params) => `${params.id} - ${title}`,
|
|
||||||
};
|
|
||||||
|
|
||||||
export type ComponentType = "NotFound" | keyof typeof routes;
|
export type ComponentType = "NotFound" | keyof typeof routes;
|
||||||
|
|
||||||
type Route = {
|
type Route = {
|
||||||
component: ComponentType;
|
component: ComponentType;
|
||||||
params?: Params;
|
params?: Params;
|
||||||
};
|
};
|
||||||
export const currentRoute = writable<Route>({ component: "Home" });
|
export const currentRoute = writable<Route>();
|
||||||
currentRoute.subscribe(
|
|
||||||
(route) => (document.title = titles[route.component](route.params!)),
|
|
||||||
);
|
|
||||||
|
|
||||||
export const router = navaid(undefined, () =>
|
export const router = navaid(undefined, () =>
|
||||||
currentRoute.set({ component: "NotFound" }),
|
currentRoute.set({ component: "NotFound" }),
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import ArrowBack from "eva-icons/outline/svg/arrow-back-outline.svg?component";
|
import ArrowBack from "eva-icons/outline/svg/arrow-back-outline.svg?component";
|
||||||
|
import ExternalLink from "eva-icons/outline/svg/external-link-outline.svg?component";
|
||||||
import { downloadFile, fetchData, fetchErrors } from "../fetch";
|
import { downloadFile, fetchData, fetchErrors } from "../fetch";
|
||||||
import NotFound from "./NotFound.svelte";
|
import NotFound from "./NotFound.svelte";
|
||||||
import { inject } from "regexparam";
|
import { inject } from "regexparam";
|
||||||
import { routes } from "../router";
|
import { routes } from "../router";
|
||||||
import Nav from "../nav/Nav.svelte";
|
import Nav from "../nav/Nav.svelte";
|
||||||
import SourceLink from "../components/SourceLink.svelte";
|
|
||||||
import Container from "../components/Container.svelte";
|
|
||||||
|
|
||||||
export let params: { dumpUrl: string; portal: string; id: string };
|
export let params: { dumpUrl: string; portal: string; id: string };
|
||||||
$: url = decodeURIComponent(params.dumpUrl) + "/" + params.portal;
|
$: url = decodeURIComponent(params.dumpUrl) + "/" + params.portal;
|
||||||
|
@ -19,7 +18,7 @@
|
||||||
<main class="mx-auto max-w-3xl">
|
<main class="mx-auto max-w-3xl">
|
||||||
<Nav {params} />
|
<Nav {params} />
|
||||||
|
|
||||||
<Container>
|
<div class="rounded-lg border bg-white m-2">
|
||||||
{#await data}
|
{#await data}
|
||||||
<p class="p-6">Cargando dataset...</p>
|
<p class="p-6">Cargando dataset...</p>
|
||||||
{:then { data, errors }}
|
{:then { data, errors }}
|
||||||
|
@ -27,9 +26,18 @@
|
||||||
{#if !dataset}
|
{#if !dataset}
|
||||||
<NotFound />
|
<NotFound />
|
||||||
{:else}
|
{:else}
|
||||||
<header
|
<header class="py-5 px-6 border-b border-b-gray-200">
|
||||||
class="py-5 px-6 border-b border-b-gray-200 dark:border-b-gray-700"
|
<small>
|
||||||
|
<a
|
||||||
|
class="flex text-blue-500 leading-none gap-1 items-center"
|
||||||
|
href={inject(routes.Portal, {
|
||||||
|
dumpUrl: params.dumpUrl,
|
||||||
|
portal: params.portal,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
|
<ArrowBack fill="currentColor" class="h-[1.25em]" /> Viendo {data.title}
|
||||||
|
</a>
|
||||||
|
</small>
|
||||||
<h1 class="font-bold text-3xl">{dataset.title}</h1>
|
<h1 class="font-bold text-3xl">{dataset.title}</h1>
|
||||||
<p class="text-xl">{dataset.description}</p>
|
<p class="text-xl">{dataset.description}</p>
|
||||||
<!--
|
<!--
|
||||||
|
@ -47,7 +55,7 @@
|
||||||
</a>
|
</a>
|
||||||
{/if} -->
|
{/if} -->
|
||||||
</header>
|
</header>
|
||||||
<ul class="divide-y divide-gray-100 dark:divide-gray-700">
|
<ul class="divide-y divide-gray-100">
|
||||||
{#each dataset.distribution as dist}
|
{#each dataset.distribution as dist}
|
||||||
{@const error = errors.find(
|
{@const error = errors.find(
|
||||||
(e) =>
|
(e) =>
|
||||||
|
@ -60,7 +68,7 @@
|
||||||
{dist.title}
|
{dist.title}
|
||||||
{#if dist.format}
|
{#if dist.format}
|
||||||
<span
|
<span
|
||||||
class="border border-current text-blue-800 dark:text-blue-400 relative inline-flex items-center text-xs font-semibold px-2 py-1 rounded-full ml-1"
|
class="border border-current text-blue-800 relative inline-flex items-center text-xs font-semibold px-2 py-1 rounded-full ml-1"
|
||||||
>
|
>
|
||||||
<span>{dist.format}</span>
|
<span>{dist.format}</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -91,7 +99,15 @@
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
{#if dist.downloadURL}
|
{#if dist.downloadURL}
|
||||||
<SourceLink href={dist.downloadURL} />
|
<a
|
||||||
|
class="flex items-center leading-none text-gray-600 gap-1 pt-2"
|
||||||
|
href={dist.downloadURL}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
>
|
||||||
|
<ExternalLink fill="currentColor" class="h-4" />
|
||||||
|
Fuente
|
||||||
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -99,5 +115,5 @@
|
||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
</Container>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { inject } from "regexparam";
|
import { inject } from "regexparam";
|
||||||
|
import ExternalLink from "eva-icons/outline/svg/external-link-outline.svg?component";
|
||||||
import { fetchDumpMetadata } from "../fetch";
|
import { fetchDumpMetadata } from "../fetch";
|
||||||
import { routes } from "../router";
|
import { routes } from "../router";
|
||||||
import SourceLink from "../components/SourceLink.svelte";
|
|
||||||
import Container from "../components/Container.svelte";
|
|
||||||
|
|
||||||
export let params: { dumpUrl: string };
|
export let params: { dumpUrl: string };
|
||||||
$: url = decodeURIComponent(params.dumpUrl);
|
$: url = decodeURIComponent(params.dumpUrl);
|
||||||
|
@ -12,25 +11,36 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="mx-auto max-w-3xl">
|
<main class="mx-auto max-w-3xl">
|
||||||
<Container>
|
<div class="rounded-lg border bg-white m-2">
|
||||||
{#await metadataPromise}
|
{#await metadataPromise}
|
||||||
<p class="p-6">Cargando..</p>
|
<p class="p-6">Cargando..</p>
|
||||||
{:then metadata}
|
{:then metadata}
|
||||||
<header
|
<header class="py-5 px-6 border-b border-b-gray-200 leading-none">
|
||||||
class="py-5 px-6 border-b border-b-gray-200 dark:border-b-gray-700 leading-none"
|
|
||||||
>
|
|
||||||
<small>
|
<small>
|
||||||
Viendo archivo en
|
Viendo archivo en
|
||||||
<a
|
<a
|
||||||
class="underline text-blue-500 dark:text-blue-300"
|
class="underline text-blue-500"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
href={url}>{url}</a
|
href={url}>{url}</a
|
||||||
>
|
>
|
||||||
</small>
|
</small>
|
||||||
|
<!-- <h1 class="font-bold text-3xl">{data.title}</h1>
|
||||||
|
<p class="text-xl">{data.description}</p>
|
||||||
|
{#if data.homepage}
|
||||||
|
<a
|
||||||
|
class="flex items-center leading-none text-gray-600 gap-1 pt-2"
|
||||||
|
href={arreglarHomepageUrl(data.homepage)}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
>
|
||||||
|
<ExternalLink fill="currentColor" class="h-4" />
|
||||||
|
Fuente
|
||||||
|
</a>
|
||||||
|
{/if} -->
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<ul class="divide-y divide-gray-100 dark:divide-gray-700">
|
<ul class="divide-y divide-gray-100">
|
||||||
{#each metadata.sites as site}
|
{#each metadata.sites as site}
|
||||||
{@const portalLink = inject(routes.Portal, {
|
{@const portalLink = inject(routes.Portal, {
|
||||||
dumpUrl: params.dumpUrl,
|
dumpUrl: params.dumpUrl,
|
||||||
|
@ -48,7 +58,15 @@
|
||||||
class="inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 bg-blue-600 rounded-md hover:bg-blue-700 focus:ring-2 focus:ring-offset-2 focus:ring-blue-700 focus:shadow-outline focus:outline-none"
|
class="inline-flex items-center justify-center px-4 py-2 text-sm font-medium tracking-wide text-white transition-colors duration-200 bg-blue-600 rounded-md hover:bg-blue-700 focus:ring-2 focus:ring-offset-2 focus:ring-blue-700 focus:shadow-outline focus:outline-none"
|
||||||
>Ver portal</a
|
>Ver portal</a
|
||||||
>
|
>
|
||||||
<SourceLink href={site.url} />
|
<a
|
||||||
|
class="flex items-center leading-none text-gray-600 gap-1 pt-2"
|
||||||
|
href={site.url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
>
|
||||||
|
<ExternalLink fill="currentColor" class="h-4" />
|
||||||
|
Fuente
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -57,5 +75,5 @@
|
||||||
{:catch error}
|
{:catch error}
|
||||||
Hubo un error intenando cargar este archivo. <pre>{error}</pre>
|
Hubo un error intenando cargar este archivo. <pre>{error}</pre>
|
||||||
{/await}
|
{/await}
|
||||||
</Container>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { inject } from "regexparam";
|
import { inject } from "regexparam";
|
||||||
import { routes } from "../router";
|
import { routes } from "../router";
|
||||||
import Container from "../components/Container.svelte";
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="mx-auto prose dark:prose-invert">
|
<main class="p-2">
|
||||||
<Container>
|
<div class="mx-auto rounded-lg border bg-white py-5 px-6 prose">
|
||||||
<div class="py-5 px-6">
|
|
||||||
<h1>Archivo de portales de datos abiertos</h1>
|
<h1>Archivo de portales de datos abiertos</h1>
|
||||||
<p>
|
<p>
|
||||||
Esta herramienta permite ver datos en archivos de portales de datos
|
Esta herramienta permite ver datos en archivos de portales de datos
|
||||||
|
@ -35,13 +33,12 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Los archivos y las herramientas fueron creados por
|
Los archivos y las herramientas fueron creados por
|
||||||
<a href="https://nulo.ar">Nulo</a> con ayuda de varias personas. El
|
<a href="https://nulo.ar">Nulo</a> con ayuda de varias personas. El código
|
||||||
código está disponible
|
está disponible
|
||||||
<a
|
<a
|
||||||
href="https://github.com/catdevnull/transicion-desordenada-diablo/"
|
href="https://github.com/catdevnull/transicion-desordenada-diablo/"
|
||||||
rel="noopener">en GitHub</a
|
rel="noopener">en GitHub</a
|
||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</Container>
|
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { inject } from "regexparam";
|
import { inject } from "regexparam";
|
||||||
import ArrowForward from "eva-icons/outline/svg/arrow-forward-outline.svg?component";
|
import ArrowForward from "eva-icons/outline/svg/arrow-forward-outline.svg?component";
|
||||||
|
import ExternalLink from "eva-icons/outline/svg/external-link-outline.svg?component";
|
||||||
import { fetchData, fetchErrors } from "../fetch";
|
import { fetchData, fetchErrors } from "../fetch";
|
||||||
import { routes } from "../router";
|
import { routes } from "../router";
|
||||||
import type { Dataset } from "common/schema";
|
import type { Dataset } from "common/schema";
|
||||||
import Nav from "../nav/Nav.svelte";
|
import Nav from "../nav/Nav.svelte";
|
||||||
import SourceLink from "../components/SourceLink.svelte";
|
|
||||||
import Container from "../components/Container.svelte";
|
|
||||||
|
|
||||||
export let params: { dumpUrl: string; portal: string };
|
export let params: { dumpUrl: string; portal: string };
|
||||||
$: url = `${decodeURIComponent(params.dumpUrl)}/${params.portal}`;
|
$: url = `${decodeURIComponent(params.dumpUrl)}/${params.portal}`;
|
||||||
|
@ -46,17 +45,15 @@
|
||||||
<main class="mx-auto max-w-3xl">
|
<main class="mx-auto max-w-3xl">
|
||||||
<Nav {params} />
|
<Nav {params} />
|
||||||
|
|
||||||
<Container>
|
<div class="rounded-lg border bg-white m-2">
|
||||||
{#await data}
|
{#await data}
|
||||||
<p class="p-6">Cargando..</p>
|
<p class="p-6">Cargando..</p>
|
||||||
{:then { data, errors }}
|
{:then { data, errors }}
|
||||||
<header
|
<header class="py-5 px-6 border-b border-b-gray-200 leading-none">
|
||||||
class="py-5 px-6 border-b border-b-gray-200 dark:border-b-gray-700 leading-none"
|
|
||||||
>
|
|
||||||
<small>
|
<small>
|
||||||
Viendo portal archivado de
|
Viendo portal archivado de
|
||||||
<a
|
<a
|
||||||
class="underline text-blue-500 dark:text-blue-300"
|
class="underline text-blue-500"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
href={url}>{url}</a
|
href={url}>{url}</a
|
||||||
|
@ -65,7 +62,15 @@
|
||||||
<h1 class="font-bold text-3xl">{data.title}</h1>
|
<h1 class="font-bold text-3xl">{data.title}</h1>
|
||||||
<p class="text-xl">{data.description}</p>
|
<p class="text-xl">{data.description}</p>
|
||||||
{#if data.homepage}
|
{#if data.homepage}
|
||||||
<SourceLink href={arreglarHomepageUrl(data.homepage)} />
|
<a
|
||||||
|
class="flex items-center leading-none text-gray-600 gap-1 pt-2"
|
||||||
|
href={arreglarHomepageUrl(data.homepage)}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener"
|
||||||
|
>
|
||||||
|
<ExternalLink fill="currentColor" class="h-4" />
|
||||||
|
Fuente
|
||||||
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
@ -73,12 +78,12 @@
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Buscar..."
|
placeholder="Buscar..."
|
||||||
class="flex w-full h-10 px-3 py-2 text-sm bg-white dark:bg-gray-800 border rounded-md border-neutral-300 dark:border-gray-700 ring-offset-background placeholder:text-neutral-500 dark:placeholder:text-gray-500 focus:border-neutral-300 dark:focus:border-gray-700 focus:outline-none focus:ring-2 focus:ring-neutral-400 dark:focus:ring-gray-600 disabled:cursor-not-allowed disabled:opacity-50"
|
class="flex w-full h-10 px-3 py-2 text-sm bg-white border rounded-md border-neutral-300 ring-offset-background placeholder:text-neutral-500 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-400 disabled:cursor-not-allowed disabled:opacity-50"
|
||||||
bind:value={query}
|
bind:value={query}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="divide-y divide-gray-100 dark:divide-gray-700">
|
<ul class="divide-y divide-gray-100">
|
||||||
{#each filterDatasets(data.dataset, query) as dataset}
|
{#each filterDatasets(data.dataset, query) as dataset}
|
||||||
{@const datasetLink = inject(routes.Dataset, {
|
{@const datasetLink = inject(routes.Dataset, {
|
||||||
dumpUrl: params.dumpUrl,
|
dumpUrl: params.dumpUrl,
|
||||||
|
@ -87,7 +92,7 @@
|
||||||
})}
|
})}
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
class="flex px-6 py-5 hover:bg-gray-50 dark:hover:bg-gray-700 justify-between"
|
class="flex px-6 py-5 hover:bg-gray-50 justify-between"
|
||||||
href={datasetLink}
|
href={datasetLink}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
|
@ -97,7 +102,7 @@
|
||||||
<ArrowForward
|
<ArrowForward
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="w-6 shrink-0 text-gray-600 dark:text-gray-400 "
|
class="w-6 shrink-0 text-gray-600"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -106,5 +111,5 @@
|
||||||
{:catch error}
|
{:catch error}
|
||||||
Hubo un error intenando cargar este portal archivado. <pre>{error}</pre>
|
Hubo un error intenando cargar este portal archivado. <pre>{error}</pre>
|
||||||
{/await}
|
{/await}
|
||||||
</Container>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||||
import svg from "@poppanator/sveltekit-svg";
|
import svelteSVG from "vite-plugin-svelte-svg";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
},
|
},
|
||||||
plugins: [svelte(), svg()],
|
plugins: [
|
||||||
|
svelte(),
|
||||||
|
svelteSVG({
|
||||||
|
svgoConfig: {}, // See https://github.com/svg/svgo#configuration
|
||||||
|
requireSuffix: true, // Set false to accept '.svg' without the '?component'
|
||||||
|
}),
|
||||||
|
],
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,9 +49,6 @@ importers:
|
||||||
specifier: ^3.22.4
|
specifier: ^3.22.4
|
||||||
version: 3.22.4
|
version: 3.22.4
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@poppanator/sveltekit-svg':
|
|
||||||
specifier: ^4.1.3
|
|
||||||
version: 4.1.3(svelte@4.2.8)(svgo@3.0.5)(vite@5.0.7)
|
|
||||||
'@sveltejs/vite-plugin-svelte':
|
'@sveltejs/vite-plugin-svelte':
|
||||||
specifier: ^3.0.0
|
specifier: ^3.0.0
|
||||||
version: 3.0.1(svelte@4.2.8)(vite@5.0.7)
|
version: 3.0.1(svelte@4.2.8)(vite@5.0.7)
|
||||||
|
@ -97,6 +94,9 @@ importers:
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.0.0
|
specifier: ^5.0.0
|
||||||
version: 5.0.7
|
version: 5.0.7
|
||||||
|
vite-plugin-svelte-svg:
|
||||||
|
specifier: ^2.3.0
|
||||||
|
version: 2.3.0(svelte@4.2.8)(vite@5.0.7)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
|
@ -367,18 +367,6 @@ packages:
|
||||||
fastq: 1.15.0
|
fastq: 1.15.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@poppanator/sveltekit-svg@4.1.3(svelte@4.2.8)(svgo@3.0.5)(vite@5.0.7):
|
|
||||||
resolution: {integrity: sha512-cKdFxFPPzS470xy2XFQ2m/URa9On4fw7n5wvBqAwVO4sY8dmski+2N3GKFELt4tvzM3JPjAqz76Ex7U5IpKeIg==}
|
|
||||||
peerDependencies:
|
|
||||||
svelte: '>=4.x'
|
|
||||||
svgo: '>=3.x'
|
|
||||||
vite: '>=4.x'
|
|
||||||
dependencies:
|
|
||||||
svelte: 4.2.8
|
|
||||||
svgo: 3.0.5
|
|
||||||
vite: 5.0.7
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@rollup/rollup-android-arm-eabi@4.7.0:
|
/@rollup/rollup-android-arm-eabi@4.7.0:
|
||||||
resolution: {integrity: sha512-rGku10pL1StFlFvXX5pEv88KdGW6DHUghsxyP/aRYb9eH+74jTGJ3U0S/rtlsQ4yYq1Hcc7AMkoJOb1xu29Fxw==}
|
resolution: {integrity: sha512-rGku10pL1StFlFvXX5pEv88KdGW6DHUghsxyP/aRYb9eH+74jTGJ3U0S/rtlsQ4yYq1Hcc7AMkoJOb1xu29Fxw==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
|
@ -1715,6 +1703,17 @@ packages:
|
||||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/vite-plugin-svelte-svg@2.3.0(svelte@4.2.8)(vite@5.0.7):
|
||||||
|
resolution: {integrity: sha512-Bzo62u9Fj9PDldSvPrUgCzIFc9MmNbhxAUdBCofPyPyuVtoKaQxtsI01JXLk35x8/OQFHfxoTShEgPxtd4+c9Q==}
|
||||||
|
peerDependencies:
|
||||||
|
svelte: '>= 3.0.0 < 5.0.0'
|
||||||
|
vite: < 5.0.0
|
||||||
|
dependencies:
|
||||||
|
svelte: 4.2.8
|
||||||
|
svgo: 3.0.5
|
||||||
|
vite: 5.0.7
|
||||||
|
dev: true
|
||||||
|
|
||||||
/vite@5.0.7:
|
/vite@5.0.7:
|
||||||
resolution: {integrity: sha512-B4T4rJCDPihrQo2B+h1MbeGL/k/GMAHzhQ8S0LjQ142s6/+l3hHTT095ORvsshj4QCkoWu3Xtmob5mazvakaOw==}
|
resolution: {integrity: sha512-B4T4rJCDPihrQo2B+h1MbeGL/k/GMAHzhQ8S0LjQ142s6/+l3hHTT095ORvsshj4QCkoWu3Xtmob5mazvakaOw==}
|
||||||
engines: {node: ^18.0.0 || >=20.0.0}
|
engines: {node: ^18.0.0 || >=20.0.0}
|
||||||
|
|
Loading…
Reference in a new issue