Skip to content

Commit

Permalink
Merge pull request #751 from CorrelAid/747-projects-db-make-all-cards…
Browse files Browse the repository at this point in the history
…-clickable-remove-sub-page-field-etc

close #747
  • Loading branch information
jstet authored Jul 4, 2024
2 parents dd46dd3 + 2cd981f commit e65aaf6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 28 deletions.
24 changes: 7 additions & 17 deletions src/lib/components/ProjectsCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import ProjectLinks from '$lib/components/ProjectLinks.svelte';
import Tag from './Tag.svelte';
import Html from '$lib/components/Html.svelte';
import {t} from '$lib/stores/i18n';
import Cursor from '$lib/svg/Cursor.svelte';
export let title;
export let dataTypes;
Expand All @@ -26,7 +24,7 @@
class="absolute inset-x-0 bottom-0 h-2 bg-gradient-to-r from-primary to-secondary opacity-75"
/>

{#if href}
<!-- {#if href}
<a
check
{href}
Expand All @@ -38,7 +36,7 @@
<Cursor width={29} height={29} /></span
>
</a>
{/if}
{/if} -->

<div class="px-4 pb-6 pt-6">
<div class="mb-2 flex items-center pb-2">
Expand All @@ -54,19 +52,11 @@
</h4>
</div>

{#if href}
<a
{href}
class="mt-2 text-xl font-semibold text-base-content transition hover:text-primary"
>{title}</a
>
{:else}
<h3
class=" mt-2 line-clamp-3 block text-xl font-semibold text-base-content transition"
>
{title}
</h3>
{/if}
<a
{href}
class="mt-2 text-xl font-semibold text-base-content transition hover:text-primary"
>{title}</a
>

<div class="mb-4 mt-3">
{#each projectTypes as tag}
Expand Down
11 changes: 4 additions & 7 deletions src/lib/js/parsing/processing/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,10 @@ export function processEvents(event, locale) {
export function processProjects(project, locale) {
const lang = getLang(locale);

let href;
if (project.subpage === true) {
href = genWebsiteUrl(
translate(locale, 'navbar.using_data.project_database', {}).url,
project.project_id,
);
} else href = void 0;
const href = genWebsiteUrl(
translate(locale, 'navbar.using_data.project_database', {}).url,
project.project_id,
);

let sector = void 0;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/js/parsing/schemas/cards.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const projectsSchema = yup.object({
summary: yup.string().required(),
procLocalChapters: yup.array().of(localChaptersSchema),
localChapterNames: yup.array().of(yup.string()),
href: yup.string().nullable(),
href: yup.string().required(),
endDate: yup.date().required(),
organization: yup.string().required(),
projectOutputs: yup.array().of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export const projectOverviewQuery = `
query ProjectOverview($language: String = "de-DE", $status: [String] = ["published"]) {
Projects(filter: { status: { _in: $status } } ) {
status
subpage
project_id
is_internal
end_date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ query LocalChapterDetails($slug: String, $language: String = "de-DE", $status: [
is_internal
end_date
end_date_predicted
subpage
project_id
Podcast {
language
Expand Down
2 changes: 1 addition & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const queries = {
`,
projects: `
query ProjectSlugs($status: [String] = ["published"]) {
Projects (filter : {_and: [{subpage : {_eq:true}}, {status: {_in: $status}}]}) {
Projects (filter : {status: {_in: $status}}) {
slug: project_id
}
}
Expand Down

0 comments on commit e65aaf6

Please sign in to comment.