diff --git a/components.198185.json b/components.198185.json index 32a6aab7..0cb3e162 100644 --- a/components.198185.json +++ b/components.198185.json @@ -2526,7 +2526,7 @@ "name": "proposal-department", "display_name": null, "created_at": "2023-09-11T15:40:29.996Z", - "updated_at": "2023-09-11T15:40:38.569Z", + "updated_at": "2023-09-21T09:46:47.753Z", "id": 4555221, "schema": { "title": { @@ -2539,9 +2539,9 @@ }, "image": null, "preview_field": null, - "is_root": false, + "is_root": true, "preview_tmpl": null, - "is_nestable": true, + "is_nestable": false, "all_presets": [ { "id": 1897410, @@ -2845,7 +2845,7 @@ "name": "proposal-team-entry", "display_name": null, "created_at": "2023-09-11T15:39:52.162Z", - "updated_at": "2023-09-13T16:08:55.251Z", + "updated_at": "2023-09-21T09:47:12.652Z", "id": 4555220, "schema": { "team_member": { @@ -2855,7 +2855,7 @@ "options": [] }, "department": { - "type": "bloks", + "type": "option", "restrict_type": "", "restrict_components": true, "component_whitelist": ["proposal-department"], @@ -2863,7 +2863,10 @@ "maximum": 1, "required": true, "pos": 1, - "key": "department" + "key": "department", + "use_uuid": true, + "source": "internal_stories", + "filter_content_type": ["proposal-department"] }, "role": { "type": "bloks", diff --git a/src/components/awards-entry.svelte b/src/components/awards-entry.svelte new file mode 100644 index 00000000..29a785b2 --- /dev/null +++ b/src/components/awards-entry.svelte @@ -0,0 +1,41 @@ + + +
+
+ {#if image?.filename} + {@const { alt, src, width, height } = getImageAttributes(image, { + size: [120, 0] + })} + + {/if} +
+

+ {label} +

+

{name}

+
+
+
+

{project}

+
+
+
+ {#if linkHref} +
+ +
+ {/if} +
diff --git a/src/components/clients.svelte b/src/components/clients.svelte new file mode 100644 index 00000000..125cebd9 --- /dev/null +++ b/src/components/clients.svelte @@ -0,0 +1,21 @@ + + +
+ {#each clients as client} + {#if client.light_mode?.filename && $theme === 'light'} + {@const { src, alt, width, height } = getImageAttributes(client.light_mode)} + + {/if} + + {#if client.dark_mode?.filename && $theme === 'dark'} + {@const { src, alt, width, height } = getImageAttributes(client.dark_mode)} + + {/if} + {/each} +
diff --git a/src/components/pages/services.svelte b/src/components/pages/services.svelte index aa4378ea..a4ae9fa3 100644 --- a/src/components/pages/services.svelte +++ b/src/components/pages/services.svelte @@ -1,5 +1,4 @@ @@ -70,40 +70,14 @@ }} class="container mx-auto flex flex-col justify-between px-container py-5 lg:flex-row" > -
-
- {#if award.image?.filename} - {@const { alt, src, width, height } = getImageAttributes(award.image, { - size: [120, 0] - })} - - {/if} -
-

- {award.label} -

-

{award.name}

-
-
-
-

{award.project}

-
-
-
- {#if href} -
- -
- {/if} -
+ {/each} @@ -205,19 +179,7 @@

{data.clients_title}

{#if data.clients} -
- {#each data.clients as client} - {#if client.light_mode?.filename && $theme === 'light'} - {@const { src, alt, width, height } = getImageAttributes(client.light_mode)} - - {/if} - - {#if client.dark_mode?.filename && $theme === 'dark'} - {@const { src, alt, width, height } = getImageAttributes(client.dark_mode)} - - {/if} - {/each} -
+ {/if}
diff --git a/src/components/testimonials.svelte b/src/components/testimonials.svelte index 525bf773..0e3ff84f 100644 --- a/src/components/testimonials.svelte +++ b/src/components/testimonials.svelte @@ -20,6 +20,7 @@ export let ctaLink: MultilinkStoryblok | undefined = undefined; export let ctaLabel: string | undefined = undefined; export let testimonials: RichtextTestimonialStoryblok[] | undefined = undefined; + export let hasBorder: boolean | undefined = true; let scroll: number; let testimonialsSection: HTMLElement; @@ -31,7 +32,7 @@ -
+
{ } let res; + let services; + let home; try { res = await storyblok.get('cdn/stories/' + url.pathname, { - version + version, + resolve_relations: ['proposal-team-entry.department'] }); } catch (error) { if (isStatusError(error) && error.status === 404) { @@ -47,7 +51,31 @@ export const load = async ({ cookies, fetch, params, url }) => { return failAuthentication(); } - return { story }; + try { + services = await fetchPage({ + slug: 'services', + version: cookies.get(PREVIEW_COOKIE_KEY) ? 'draft' : 'published', + fetch, + url + }); + } catch (err) { + console.error('Fetching services for proposals: ' + err); + throw err; + } + + try { + home = await fetchPage({ + slug: '', + version: cookies.get(PREVIEW_COOKIE_KEY) ? 'draft' : 'published', + fetch, + url + }); + } catch (err) { + console.error('Fetching home for proposals: ' + err); + throw err; + } + + return { story, services, home }; }; export const actions = { diff --git a/src/routes/(proposals)/proposal/[slug]/+page.svelte b/src/routes/(proposals)/proposal/[slug]/+page.svelte index 1823aa74..554ddac2 100644 --- a/src/routes/(proposals)/proposal/[slug]/+page.svelte +++ b/src/routes/(proposals)/proposal/[slug]/+page.svelte @@ -5,10 +5,12 @@ export let data; const proposal = data?.story?.content; + const services = data?.services?.story?.content?.page[0]; + const home = data?.home?.story.content.page[0]; {#if data?.story && proposal} - + {:else} {/if} diff --git a/src/routes/(proposals)/proposal/[slug]/hero.svelte b/src/routes/(proposals)/proposal/[slug]/hero.svelte index 12846cf8..a50e1ff0 100644 --- a/src/routes/(proposals)/proposal/[slug]/hero.svelte +++ b/src/routes/(proposals)/proposal/[slug]/hero.svelte @@ -8,7 +8,7 @@ export let date: string | undefined; -
+

{proposal.title}

{proposal.description}

diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-awards.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-awards.svelte new file mode 100644 index 00000000..311a8ca6 --- /dev/null +++ b/src/routes/(proposals)/proposal/[slug]/proposal-awards.svelte @@ -0,0 +1,53 @@ + + +
+
+
+

{t('proposals.awards')}.

+

{t('proposals.awards.description')}

+
+
+ +
+
+
+
    + {#each awards as award} + {@const { href, target, rel } = getAnchorFromCmsLink(award.link)} +
  • + + + +
  • + {/each} +
+
+
+
+
diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-clients.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-clients.svelte new file mode 100644 index 00000000..7cc5323c --- /dev/null +++ b/src/routes/(proposals)/proposal/[slug]/proposal-clients.svelte @@ -0,0 +1,15 @@ + + +
+

+ {t('proposals.clients.description')} +

+ + +
diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-estimates.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-estimates.svelte new file mode 100644 index 00000000..69e11ea5 --- /dev/null +++ b/src/routes/(proposals)/proposal/[slug]/proposal-estimates.svelte @@ -0,0 +1,364 @@ + + +
+ + + + + + + + + + + + + + + + + + + {#each data as entry, i} + {@const areaInfo = areaInfoMap.get(entry.title)} + {#each entry.phases as phase, j} + {#each phase.team as team, k} + {@const teamMemberInfo = teamInfoMap.get(team.team_member.member.name)} + + + {#if k == 0 && j == 0} + + {/if} + + {#if k == 0} + + {/if} + + + + + + + + {#if k == 0 && j == 0} + + {/if} + + {/each} + {/each} + + + + + + + + + + + + {/each} + + + + + + + + + + + + + + {#if discount} + + + + + + + + + {/if} + + + + + + + + + +
+

+ {t('proposals.estimates.area')} +

+

+ {t('proposals.estimates.phases')} +

+
+

+ {t('proposals.estimates.team')} +

+
+

+ {t('proposals.estimates.duration')} +

+
+
+

+ {t('proposals.estimates.predicted-cost')} +

+
+
+ +

+ {entry.title}. +

+

+ {entry.description} +

+
+

+ {phase.title}. +

+

+ {phase.description} +

+
+ {#if teamMemberInfo} + {teamMemberInfo.role} + {/if} + + {team.duration} + +
+ {#if teamMemberInfo} + {#if teamMemberInfo.rate_type === 'percentage' && teamMemberInfo.rate_value} +

+ {teamMemberInfo.rate_value} % +

+ {:else if teamMemberInfo.rate_type === 'value' && teamMemberInfo.rate_value} +

+ {formatter.format(+team.duration * +teamMemberInfo.rate_value)} +

+ {:else if teamMemberInfo.rate_type === 'free'} +

{t('proposals.included')}

+ {/if} + {/if} +
+ {areaInfo.phases} + {#if areaInfo.phases == 1} + {t('proposals.estimates.phases')} + {:else} + {t('proposals.estimates.phase')} + {/if} + + {areaInfo.team} + {#if areaInfo.team == 1} + {t('proposals.estimates.person')} + {:else} + {t('proposals.estimates.people')} + {/if} + + {areaInfo.duration} + +
+ {formatter.format(areaInfo.cost)} +
+ {t('proposals.estimates.subtotal')} + + {totalDuration} + +
+ {formatter.format(subtotal)} +
+
+

{t('proposals.estimates.discount')}

+ +
+
- +
+ {formatter.format(discountedValue)} +
+ {t('proposals.estimates.gran-total')} + + {totalDuration} + +
+ {formatter.format(granTotal)} +
+
diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-navigation.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-navigation.svelte index 1650e34e..54e1be0e 100644 --- a/src/routes/(proposals)/proposal/[slug]/proposal-navigation.svelte +++ b/src/routes/(proposals)/proposal/[slug]/proposal-navigation.svelte @@ -111,7 +111,7 @@
{#if versions.length > 1} -
+

{t('proposals.nav.versions')}

diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-page.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-page.svelte index 2151ff4a..12e22623 100644 --- a/src/routes/(proposals)/proposal/[slug]/proposal-page.svelte +++ b/src/routes/(proposals)/proposal/[slug]/proposal-page.svelte @@ -1,44 +1,92 @@ +
+
+ version.version_name)} bind:version /> -
- - {#each content?.body || [] as section} -
-
-

{section.title}

- -
- -
-
+ +{#each content?.body || [] as section} +
+
+

{section.title}.

+
+ +
+
+
{#if section.data === 'scope' && content?.scope} - - {:else if section.data === 'team' && content?.estimates} - + + {:else if section.data === 'team' && content?.team} + {:else if section.data === 'estimates' && content?.estimates} - - {:else if section.data === 'timeline' && content?.estimates} - + + + {/if} -
- {/each} -
+
+
+{/each} + + + + +{#if services.awards?.length} + +{/if} + + +{#if home.projects?.length} + +{/if} + + +{#if services.testimonials?.length} + +{/if} + + +{#if services.clients?.length} + +{/if} diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-projects.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-projects.svelte new file mode 100644 index 00000000..21679304 --- /dev/null +++ b/src/routes/(proposals)/proposal/[slug]/proposal-projects.svelte @@ -0,0 +1,21 @@ + + +
+
+
+

{t('proposals.projects')}.

+
+
+
+ {#each projects as project} + + {/each} +
+
diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-reply-block.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-reply-block.svelte new file mode 100644 index 00000000..79a8a7b4 --- /dev/null +++ b/src/routes/(proposals)/proposal/[slug]/proposal-reply-block.svelte @@ -0,0 +1,17 @@ + + +
+
+
+
+

{t('proposals.reply.description')}

+
+ + +
+ +
+
diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-scope.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-scope.svelte new file mode 100644 index 00000000..f43ea6bb --- /dev/null +++ b/src/routes/(proposals)/proposal/[slug]/proposal-scope.svelte @@ -0,0 +1,152 @@ + + +
+ + + + + + + + + + + + + + + {#each data as entry, i} + {@const features = entry.features?.split('\n').filter(Boolean) || []} + + + + + + + + + + + {/each} + +

+ {t('proposals.scope.delivarable')} +

+ {t('proposals.scope.service')} +

+ {t('proposals.scope.features')} +

+

+ {entry.title}. +

+

+ {entry.description} +

+ +
+
+ {#each entry.services || [] as service} + + {/each} +
+
+

+ {t('proposals.scope.multiple-features')} +

+ {#if isShowingFeatures[i]} +
+ {#each features as feature} +

+ {feature} +

+ {/each} +
+ {/if} +
+
diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-team.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-team.svelte new file mode 100644 index 00000000..72a27c57 --- /dev/null +++ b/src/routes/(proposals)/proposal/[slug]/proposal-team.svelte @@ -0,0 +1,160 @@ + + +
+ + + + + + + + + + + + {#each departmentsInfo as department, j} + {#each dataMap.get(department.name) as entry, i} + + {#if i == 0} + + {/if} + + + + + + + {#if i == 0} + + {/if} + + {/each} + {/each} + +

+ {t('proposals.team.department')} +

+ {t('proposals.team.team-member')} +

{t('proposals.team.role')}

+

{t('proposals.team.rate')}

+

+ {department.content.title}. +

+

+ {department.content.description} +

+
+
+ + {entry.team_member.member.name} + +
+
+
+

+ {entry.role[0].title} +

+

+ {entry.role[0].description} +

+
+
+ {#if entry.rate_type === 'percentage' && entry.rate_value} +

{entry.rate_value} %

+ {:else if entry.rate_type === 'value' && entry.rate_value} +

{formatter.format(+entry.rate_value)}

+ {:else if entry.rate_type === 'free'} +

{t('proposals.included')}

+ {/if} +
+
diff --git a/src/routes/(proposals)/proposal/[slug]/proposal-testimonials.svelte b/src/routes/(proposals)/proposal/[slug]/proposal-testimonials.svelte new file mode 100644 index 00000000..8c5bf50a --- /dev/null +++ b/src/routes/(proposals)/proposal/[slug]/proposal-testimonials.svelte @@ -0,0 +1,19 @@ + + +
+
+
+

{t('proposals.testimonials')}.

+

+ {t('proposals.testimonials.description')} +

+
+
+ +
diff --git a/src/types/bloks.d.ts b/src/types/bloks.d.ts index ca4a613d..b101a310 100644 --- a/src/types/bloks.d.ts +++ b/src/types/bloks.d.ts @@ -705,7 +705,7 @@ export interface ProposalSectionStoryblok { } export interface ProposalTeamEntryStoryblok { - department: ProposalDepartmentStoryblok[]; + department: StoryblokStory | string; role: ProposalRoleStoryblok[]; rate_type?: '' | 'value' | 'percentage' | 'free'; rate_value?: string;