Commit 685ced23 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

0.21.0

parent b2fc6fdb
.svelte-kit/**
build/**
dist/**
node_modules/**
static/**
......@@ -61,46 +61,52 @@ npm run configure
## Usage
### Updating database when drop-box directory change
```bash
node --experimental-specifier-resolution=node -- dist/scripts/update_ddis_on_directory_changes.mjs --output ../public_data/ --verbose adisp
```
### Fetching DDI Files
#### Fetching DDI Files from OAI-PMH Servers
```bash
# ADISP (OAI-PMH): Contains every french DDIs
node --experimental-specifier-resolution=node -- dist/scripts/retrieve_oai-pmh_ddis.js --url http://www.progedo-adisp.fr/oai/oai2.php ../public_data/adisp-oai-pmh-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/retrieve_oai-pmh_ddis.mjs --url http://www.progedo-adisp.fr/oai/oai2.php ../public_data/adisp-oai-pmh-ddi/
```
#### Fetching DDI Files from Dataverse Servers
```bash
# data.sciencespo
node --experimental-specifier-resolution=node -- dist/scripts/retrieve_dataverse_ddis.js --tree cdsp --url https://data.sciencespo.fr/ --verbose ../public_data/sciencespo-dataverse-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/retrieve_dataverse_ddis.mjs --tree cdsp --url https://data.sciencespo.fr/ --verbose ../public_data/sciencespo-dataverse-ddi/
```
#### Fetching DDI Files from Nesstar Servers
```bash
# ADISP (public Nesstar) : Contains some French & English DDIs
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.js --url http://nesstar.progedo-adisp.fr/ ../public_data/adisp-nesstar-ddi/
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nesstar.progedo-adisp.fr/ ../public_data/adisp-nesstar-ddi/
# CDSP Sciences Po (obsolete & closed)
# node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.js --url http://nesstar.sciences-po.fr/ ../public_data/cdsp-nesstar-ddi/
# node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nesstar.sciences-po.fr/ ../public_data/cdsp-nesstar-ddi/
# INED
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.js --url http://nesstar.ined.fr/ ../public_data/ined-nesstar-ddi/
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nesstar.ined.fr/ ../public_data/ined-nesstar-ddi/
# INED - Generations and Gender Survey
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.js --url http://ggpsurvey.ined.fr/ ../public_data/ined-gpgsurvey-nesstar-ddi/
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://ggpsurvey.ined.fr/ ../public_data/ined-gpgsurvey-nesstar-ddi/
# UK Data Service
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.js --url http://nesstar.ukdataservice.ac.uk/ ../public_data/ukdataservice-nesstar-ddi/
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nesstar.ukdataservice.ac.uk/ ../public_data/ukdataservice-nesstar-ddi/
# Norwegian Centre for Research Data
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.js --url http://nsddata.nsd.uib.no ../public_data/nsddata-nesstar-ddi/
node --experimental-specifier-resolution=node dist/scripts/retrieve_nesstar_ddis.mjs --url http://nsddata.nsd.uib.no ../public_data/nsddata-nesstar-ddi/
```
### Repairing DDI Files
```bash
# ADISP
node --experimental-specifier-resolution=node dist/scripts/repair_adisp_oai-pmh_ddis.js --source=../public_data/adisp-oai-pmh-ddi/ ../public_data/adisp-oai-pmh-ddi-repaired/
node --experimental-specifier-resolution=node dist/scripts/repair_adisp_nesstar_ddis.js --source=../public_data/adisp-nesstar-ddi/ ../public_data/adisp-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node dist/scripts/repair_ined_nesstar_ddis.js --source=../public_data/ined-nesstar-ddi/ ../public_data/ined-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node dist/scripts/repair_adisp_oai-pmh_ddis.mjs --source=../public_data/adisp-oai-pmh-ddi/ ../public_data/adisp-oai-pmh-ddi-repaired/
node --experimental-specifier-resolution=node dist/scripts/repair_adisp_nesstar_ddis.mjs --source=../public_data/adisp-nesstar-ddi/ ../public_data/adisp-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node dist/scripts/repair_ined_nesstar_ddis.mjs --source=../public_data/ined-nesstar-ddi/ ../public_data/ined-nesstar-ddi-repaired/
```
### Indexing DDI files
......@@ -108,28 +114,28 @@ node --experimental-specifier-resolution=node dist/scripts/repair_ined_nesstar_d
#### Indexing Progedo DDI Files
```bash
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=fr --path=adisp ../public_data/adisp-oai-pmh-ddi-repaired/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=fr --path=cdsp ../public_data/sciencespo-dataverse-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=fr --path=ined ../public_data/ined-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=adisp ../public_data/adisp-oai-pmh-ddi-repaired/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=cdsp ../public_data/sciencespo-dataverse-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=ined ../public_data/ined-nesstar-ddi-repaired/
```
#### Indexing Other (non Progedo-related) DDI Files
```bash
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=fr --path=adisp-nesstar ../public_data/adisp-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=fr --path=cdsp ../public_data/sciencespo-dataverse-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=adisp-nesstar ../public_data/adisp-nesstar-ddi-repaired/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=cdsp ../public_data/sciencespo-dataverse-ddi/
# Obsolete
# node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=fr --path=cdsp-obsolete ../public_data/cdsp-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=fr --path=ined/gpgsurvey ../public_data/ined-gpgsurvey-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=en --path=ukdataservice ../public_data/ukdataservice-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.js --language=no --path=nsddata ../public_data/nsddata-nesstar-ddi/
# node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=cdsp-obsolete ../public_data/cdsp-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=fr --path=ined/gpgsurvey ../public_data/ined-gpgsurvey-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=en --path=ukdataservice ../public_data/ukdataservice-nesstar-ddi/
node --experimental-specifier-resolution=node -- dist/scripts/index_codebooks.mjs --language=no --path=nsddata ../public_data/nsddata-nesstar-ddi/
```
### Extracting Words from CodeBooks for Autocompletion
```bash
node --experimental-specifier-resolution=node -- dist/scripts/index_words.js
node --experimental-specifier-resolution=node -- dist/scripts/index_words.mjs
```
## Development
......@@ -139,11 +145,11 @@ node --experimental-specifier-resolution=node -- dist/scripts/index_words.js
#### Extracting TypeScript Raw Types from Progedo DDI Files
```bash
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.js ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.js ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=1.2.2
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.js ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=1.3
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.js ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=2.5
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=1.2.2
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=1.3
node --experimental-specifier-resolution=node --max-old-space-size=10240 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-oai-pmh-ddi-repaired/ ../public_data/sciencespo-dataverse-ddi/ ../public_data/ined-nesstar-ddi/ --version=2.5
# Prettify generated TypeScript file:
npm run prettier
......@@ -152,10 +158,10 @@ npm run prettier
#### Extracting TypeScript Raw Types for Other Tests
```bash
node --experimental-specifier-resolution=node --max-old-space-size=8192 -- dist/scripts/raw_types_from_ddi_files.js ../public_data/adisp-manual-ddi/ --target=src/raw_types/codebooks_adisp_manual.ts
node --experimental-specifier-resolution=node --max-old-space-size=8192 -- dist/scripts/raw_types_from_ddi_files.js ../public_data/adisp-nesstar-ddi/ --target=src/raw_types/codebooks_adisp_nesstar.ts
node --experimental-specifier-resolution=node -- dist/scripts/raw_types_from_ddi_files.js ../public_data/sciencespo-dataverse-ddi/ --target=src/raw_types/codebooks_sciencespo_dataverse.ts
node --experimental-specifier-resolution=node -- dist/scripts/raw_types_from_ddi_files.js ../public_data/ined-nesstar-ddi/ --target=src/raw_types/codebooks_ined_nesstar.ts
node --experimental-specifier-resolution=node --max-old-space-size=8192 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-manual-ddi/ --target=src/raw_types/codebooks_adisp_manual.ts
node --experimental-specifier-resolution=node --max-old-space-size=8192 -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/adisp-nesstar-ddi/ --target=src/raw_types/codebooks_adisp_nesstar.ts
node --experimental-specifier-resolution=node -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/sciencespo-dataverse-ddi/ --target=src/raw_types/codebooks_sciencespo_dataverse.ts
node --experimental-specifier-resolution=node -- dist/scripts/raw_types_from_ddi_files.mjs ../public_data/ined-nesstar-ddi/ --target=src/raw_types/codebooks_ined_nesstar.ts
# Prettify generated TypeScript files:
npm run prettier
......
# To use this file, rename it to `.env`.
# A single email address to join the administrators of the web site
ADMIN_EMAIL="someone@example.com"
# Allow authentication & demands?
AUTHENTICATE=true
......@@ -13,8 +16,24 @@ DB_USER="data_catalogue"
# Change value of DB_PASSWORD!
DB_PASSWORD="data_catalogue"
# Add debugging menu?
DEBUG_MENU=true
DEV_AUTHENTICATION='{"email": "john.doe@example.com", "family_name": "Doe", "given_name": "John"}'
# Credential required to register DOIs
# The ":" separated login & password required to register the DOIs on datacite.org
# Optional: when missing, DOIs are not registered.
# DOI_REGISTRATION_CREDENTIAL="username:password"
# Matomo analytics configuration
# MATOMO_SITE_ID=123
# MATOMO_URL="https://MATOMO_SERVER/"
# Prepend the site domain to the page title when tracking (optional, default = false).
# MATOMO_PREPEND_DOMAIN=true
# Track visitors accross a domain (for example, example.com & its subdomains (optional).
# MATOMO_SUBDOMAINS="*.DOMAIN"
# OpenID Connect configuration
# OPENID_CONNECT_CLIENT_ID="OPENID_CONNECT_CLIENT_ID"
# OPENID_CONNECT_CLIENT_SECRET="OPENID_CONNECT_CLIENT_SECRET"
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
"type": "git",
"url": "https://git.nomics.world/progedo/data-catalogue.git"
},
"version": "0.17.0",
"version": "0.21.0",
"author": "DBnomics Team",
"scripts": {
"build": "node --experimental-specifier-resolution=node node_modules/.bin/svelte-kit build",
......@@ -14,9 +14,11 @@
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"configure": "node --experimental-specifier-resolution=node dist/scripts/configure.js",
"dev": "node --experimental-specifier-resolution=node node_modules/.bin/svelte-kit dev",
"dist": "npm run dist:lib && npm run dist:tsc",
"dist": "npm run dist:lib && npm run dist:tsc ; npm run dist:mjs ; npm run dist:mjs-map",
"dist:lib": "mkdir -p node_modules && cd node_modules/ && rm -f '$lib' && ln -s ../dist/lib/ '$lib'",
"dist:tsc": "tsc --declaration --outDir dist --rootDir src",
"dist:mjs": "find dist/ -name \"*.js\" -exec bash -c 'mv \"$1\" \"${1%.js}\".mjs' - '{}' \\;",
"dist:mjs-map": "find dist/ -name \"*.js.map\" -exec bash -c 'mv \"$1\" \"${1%.js.map}\".mjs.map' - '{}' \\;",
"format": "prettier --write --plugin-search-dir=. .",
"lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"postinstall": "patch-package && npm run dist:lib",
......@@ -26,29 +28,29 @@
"command-line-args": "^5.2.0",
"fast-xml-parser": "^4.0.1",
"he": "^1.2.0",
"node-fetch": "^3.2.0",
"node-stream-zip": "^1.14.0",
"on-headers": "^1.0.2",
"quicktype-core": "^6.0.70",
"slug": "^5.0.1",
"xmldom": "^0.6.0"
"xmldom": "^0.6.0",
"yzx": "^6.0.3"
},
"devDependencies": {
"@auditors/core": "^0.2.0",
"@auditors/json5": "^0.2.0",
"@auditors/core": "^0.3.0",
"@auditors/json5": "^0.3.0",
"@fluent/bundle": "^0.17.0",
"@fluent/langneg": "^0.6.0",
"@fluent/sequence": "^0.7.0",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@iconify/json": "^1.1.443",
"@sveltejs/adapter-node": "^1.0.0-next.60",
"@sveltejs/kit": "^1.0.0-next.215",
"@iconify/svelte": "^2.1.2",
"@sveltejs/adapter-node": "^1.0.0-next.70",
"@sveltejs/kit": "^1.0.0-next.288",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/typography": "^0.5.0",
"@types/command-line-args": "^5.2.0",
"@types/compression": "^1.7.2",
"@types/fs-extra": "^9.0.12",
"@types/he": "^1.1.2",
"@types/node-fetch": "^2.5.12",
"@types/passport": "^1.0.7",
"@types/passport-local": "^1.0.34",
"@types/slug": "^5.0.2",
......@@ -59,21 +61,18 @@
"autoprefixer": "^10.2.5",
"cached-iterable": "^0.3.0",
"connect-pg-simple": "^7.0.0",
"cssnano": "^5.0.1",
"dedent-js": "^1.0.1",
"dotenv": "^14.2.0",
"dotenv": "^16.0.0",
"eslint": "^8.1.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-svelte3": "^3.2.0",
"express-session": "^1.17.2",
"fa-svelte": "^3.1.0",
"front-matter": "^4.0.2",
"fs-extra": "^10.0.0",
"mdast-util-from-markdown": "^1.0.0",
"mdast-util-gfm-table": "^1.0.1",
"micromark-extension-gfm-table": "^1.0.0",
"morgan": "^1.10.0",
"node-fetch": "^2.6.6",
"openid-client": "^5.0.2",
"passport": "^0.5.0",
"passport-local": "^1.0.0",
......@@ -97,7 +96,6 @@
"tippy.js": "^6.3.1",
"tslib": "^2.0.0",
"typescript": "^4.0.0",
"unplugin-icons": "^0.13.0",
"ws": "^8.2.0"
},
"type": "module"
......
const tailwindcss = require("tailwindcss")
const autoprefixer = require("autoprefixer")
const cssnano = require("cssnano")
const mode = process.env.NODE_ENV
const dev = mode === "development"
const config = {
plugins: [
......@@ -11,10 +7,6 @@ const config = {
tailwindcss(),
// But others, like autoprefixer, need to run after.
autoprefixer(),
!dev &&
cssnano({
preset: "default",
}),
],
}
......
/// <reference types="@sveltejs/kit" />
// import type { Session as ExpressSession } from "express-session"
declare namespace App {
interface Locals {
user?: ZammadUser
}
// interface Platform {}
interface Session /* extends ExpressSession */ {
authenticate: boolean
baseUrl: string
branch: string
cart: string[]
commit: string
debugMenu: boolean
language?: string
matomo?: {
prependDomain?: boolean
siteId: number
subdomains?: string
url: string
}
redirectUrl?: string
title: string
user?: ZammadUser
webSocketBaseUrl: string
}
// interface Stuff {}
interface ZammadTicket {
customer_id?: number // TODO: Is it optional?
demand?: string
id: number
state: string
state_id: number
title: string
updated_at: string
// TODO: Add missing attributes.
}
interface ZammadTicketArticle {
attachments: unknown[]
body: string
cc: string | null
content_type: string // "text/html" | "text/plain" | TODO
created_at: string
created_by: string // email
created_by_id: number
from: string
id: number
in_reply_to: string | null
internal: boolean
message_id: string | null
message_id_md5: string | null
origin_by: string // email
origin_by_id: number
preference: { [key: string]: unknown } // TODO
references: null // TODO: Type unknown yet
reply_to: string | null
sender: string // "Customer" | other user types
sender_id: number
subject: string
ticket_id: number
updated_at: string
updated_by: string // email
updated_by_id: number
to: string | null
type: string // "web" | TODO
type_id: number
}
interface ZammadUser {
city?: string
country?: string
created_at: string
created_by_id: number
discipline?: string
email: string
entite_code?: string
entite_nom?: string
entite_type?: string
firstname: string
lastname: string
id: number
idToken?: string
phone?: string
preferences?: { locale?: string }
roles: string[]
statut?: string
statut_autre?: string
street?: string
updated_at: string
updated_by_id: number
zip?: string
}
}
......@@ -7,6 +7,6 @@
%svelte.head%
</head>
<body>
<div id="svelte">%svelte.body%</div>
<div>%svelte.body%</div>
</body>
</html>
......@@ -2,13 +2,11 @@
import { goto } from "$app/navigation"
import { page, session } from "$app/stores"
import type { ZammadUser } from "$lib/server/zammad"
$: loginUrl = `auth/login?redirect=${encodeURIComponent(
new URL($page.url.pathname, $session.baseUrl).toString(),
)}`
$: user = $session.user as ZammadUser | undefined
$: user = $session.user
$: roles = user?.roles
......
......@@ -8,13 +8,13 @@
$: datafileBody = {
//"Label du fichier : ": datafile.fileName,
"Contenu du fichier : ": datafile.fileCont,
//"Contenu du fichier : ": datafile.fileCont,
"Nombre d'enregistrements : ": datafile.caseQnty,
"Nombre de variables : ": datafile.varQnty,
"Données manquantes : ": datafile.dataMsng,
"Notes : ": datafile.notes,
"URL : ": datafile.url,
"Format du fichier : ": datafile.fileType,
//"URL : ": datafile.url,
//"Format du fichier : ": datafile.fileType,
}
</script>
......
<script lang="ts">
import { faChevronDown, faChevronUp } from "@fortawesome/free-solid-svg-icons"
import Icon from "fa-svelte"
import Icon from "@iconify/svelte"
import { createEventDispatcher } from "svelte"
export let open = false
......@@ -30,9 +29,9 @@
<!-- Chevron icon in head-->
<span class="text-lg text-gray-300 ml-4 hover:text-gray-400 font-bold">
{#if open}
<Icon icon={faChevronUp} />
<Icon icon="fa-solid:chevron-up" />
{:else}
<Icon icon={faChevronDown} />
<Icon icon="fa-solid:chevron-down" />
{/if}
</span>
</button>
......
<script lang="ts">
import { createEventDispatcher } from "svelte"
import { localize } from "$lib/stores"
export let expanded: boolean
export let countGetter: (item: unknown) => number
export let expandedComparison: (a: unknown, b: unknown) => number
export let items: unknown[]
export let shrunkenComparison: (a: unknown, b: unknown) => number
const dispatch = createEventDispatcher()
let state: "all" | "less" | "more" = "less"
$: _ = $localize
function toggle() {
expanded = !expanded
dispatch("toggle", expanded)
}
$: hasMore =
items.length > 5 && items.filter((item) => countGetter(item) > 1).length > 5
$: hasAll = items.length > 5
$: realState =
state === "all"
? hasAll
? "all"
: "less"
: state === "more"
? hasMore
? "more"
: hasAll
? "all"
: "less"
: "less"
</script>
{#if expanded && items.length > 5}
{#if realState === "all"}
<ul class="list-inside max-h-64 overflow-y-auto text-xs text-gray-700">
{#each [...items].sort(expandedComparison) as item}
<li>
......@@ -26,6 +37,28 @@
</li>
{/each}
</ul>
<button
class="w-full text-xs text-red-400 mt-2 text-right "
on:click={() => (state = "less")}>-- {_("Show_less")} --</button
>
{:else if realState === "more"}
<ul class="list-inside max-h-64 overflow-y-auto text-xs text-gray-700">
{#each items
.filter((item) => countGetter(item) > 1)
.sort(expandedComparison) as item}
<li>
<slot {item} />
</li>
{/each}
</ul>
<div class="flex justify-between mt-2">
<button class="text-xs text-red-400" on:click={() => (state = "all")}
>-- {_("Show_all")} --</button
>
<button class="text-xs text-red-400" on:click={() => (state = "less")}
>-- {_("Show_less")} --</button
>
</div>
{:else}
<ul class="list-inside text-sm text-gray-700">
{#each [...items].sort(shrunkenComparison).slice(0, 5) as item}
......@@ -34,18 +67,15 @@
</li>
{/each}
</ul>
{/if}
{#if items.length > 5}
{#if expanded}
{#if hasMore}
<button
class="w-full text-xs text-red-400 mt-2 text-right"
on:click={() => toggle()}
>-- {_("Show_less")}--
</button>
{:else}
class="w-full text-xs text-red-400 mt-2 text-right "
on:click={() => (state = "more")}>-- {_("Show_more")} --</button
>
{:else if hasAll}
<button
class="w-full text-xs text-red-400 mt-2 text-right "
on:click={() => toggle()}>-- {_("Show_more")} --</button
on:click={() => (state = "all")}>-- {_("Show_all")} --</button
>
{/if}
{/if}
<script lang="ts">
$: logotypes = [
const leftLogos = [
{
name: "CNRS",
title: "Centre National de le Recherche Scientfique",
......@@ -17,7 +17,7 @@
name: "Ined",
title: "L'Institut national d'études démographiques",
href: "https://datalab.site.ined.fr/",
image: "img/logo_ined.jpg",
image: "img/logo_ined_Hc_CMJN_simple.svg",
text: "",
},
{
......@@ -27,48 +27,53 @@
image: "img/logo_SciencesPO.png",
text: "",
},
{
name: "",
title: "",
href: "",
image: "",
text: "",
},
{
name: "",
title: "",
href: "",
image: "",
text: "membre de",
},
]
const rightLogos = [
{
name: "CESSDA",
title: "Consortium of European Social Science Data Archives",
href: "https://www.cessda.eu",
image: "img/logo_cessda.png",
text: "",
image: "img/logo_CESSDA.png",
text: "a member of",
},
]
</script>
<!-- LOGOTYPES -->
<!-- LOGOS - HAUTEUR FIXE -->
<section
class="container -mx-6 -mt-6 mb-12 text-slate-600 text-xs sm:text-base max-w-full bg-transparent"
class="w-full max-w-xl mb-4 text-slate-600 bg-transparent flex justify-between mx-auto"
>
<div class="flex flex-wrap text-center mx-auto">
{#each logotypes as logotype}
<div class="p-1 h-auto lg:w-1/6 md:w-1/6 sm:w-1/6 w-1/6">
<div>
<p class="text-right">
<a title={logotype.title} href={logotype.href}
><img
src={logotype.image}
title={logotype.title}
alt={logotype.name}
/>
</a>{logotype.text}
</p>
</div>
<div class="flex flex-row p-1 h-auto">
{#each leftLogos as logo, index}
<div class="flex-col mr-4">
{#if logo.text}
<div class="h-5 text-center text-xs sm:text-sm">{logo.text}</div>
{/if}
<a title={logo.title} href={logo.href}
><img
src={logo.image}
title={logo.title}