|
|
|
@@ -2,26 +2,27 @@ import './eventoverview-stage.scss'; |
|
|
|
import {createElement, createImage} from "../../_global/scripts/helpers"; |
|
|
|
import {createProgressBar} from "../../atoms/progress-bar/ProgressBarComponent"; |
|
|
|
import {createButton} from "../../atoms/button/ButtonComponent"; |
|
|
|
import {eventOverviewStageData} from "./EventOverviewStageData"; |
|
|
|
import {createSearchInput} from "../../atoms/search-input/SearchInputComponent"; |
|
|
|
import {createSearchButton} from "../../atoms/search-button/SearchButtonComponent"; |
|
|
|
import IHKSearchTypeahead from "../../sections/search/search-typeahead"; |
|
|
|
import {createTopicTeaser} from "../../components/topic-teaser/TopicTeaserComponent"; |
|
|
|
import IHKTopicTeasers from "./topic-teasers"; |
|
|
|
|
|
|
|
|
|
|
|
export const createEventOverviewStage = ({ |
|
|
|
imageSrc = 'https://source.unsplash.com/2vCqH34PqWs/1080x648', |
|
|
|
kicker = 'Noch 7 Tage offen', |
|
|
|
headline = 'Jetzt und digital mitreden', |
|
|
|
copy = 'Mit der digitalen Beteiligung erhalten Mitgliedsunternehmen die Möglichkeit, sich einfach und schnell über laufende Verfahren und Abstimmungen zu informieren und sich aktiv daran zu beteiligen.', |
|
|
|
moreCta = { |
|
|
|
label: 'Mehr Infos', |
|
|
|
link: '#', |
|
|
|
target: '_self', |
|
|
|
}, |
|
|
|
buttonCta = { |
|
|
|
label: 'Jetzt beteiligen', |
|
|
|
link: '#', |
|
|
|
target: '_self', |
|
|
|
}, |
|
|
|
maxItems = 6, |
|
|
|
showProgress = true, |
|
|
|
progress = 60, |
|
|
|
backgroundImage = null, |
|
|
|
isFirstElement = false, |
|
|
|
placeholder = 'Veranstaltungssuche, z.B. „Existenzgründung”', |
|
|
|
api = 'services/search/{SEARCHTERM}.json', |
|
|
|
tiles = eventOverviewStageData, |
|
|
|
}) => { |
|
|
|
const hasImage = imageSrc && imageSrc.length > 0; |
|
|
|
const section = createElement('section', ['eventoverview', 'eventoverview-stage']); |
|
|
|
@@ -48,28 +49,37 @@ export const createEventOverviewStage = ({ |
|
|
|
} |
|
|
|
createElement('h1', ['like-h2'], headline, tb); |
|
|
|
createElement('p', [], copy, tb); |
|
|
|
if (moreCta) { |
|
|
|
const more = createElement('a', [], moreCta.label, tb); |
|
|
|
more.href = moreCta.link; |
|
|
|
more.target = moreCta.target; |
|
|
|
} |
|
|
|
if (buttonCta) { |
|
|
|
const button = createButton({ |
|
|
|
elementType: 'a', |
|
|
|
link: buttonCta.link, |
|
|
|
color: 'white', |
|
|
|
label: buttonCta.label, |
|
|
|
iconPosition: 'icon-right', |
|
|
|
icon: 'small-arrow-right-simple', |
|
|
|
}); |
|
|
|
tb.appendChild(button); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (hasImage) { |
|
|
|
section.classList.add('image-stage'); |
|
|
|
const ib = createElement('div', ['image-box'], null, col); |
|
|
|
createImage(imageSrc, 1080, 648, 'Beteiligung', [], ib); |
|
|
|
} |
|
|
|
|
|
|
|
const form = createElement('form', [], null, col); |
|
|
|
|
|
|
|
const label = createElement('label', ['visually-hidden'], 'IHK durchsuchen', form); |
|
|
|
label.for = 'search-term'; |
|
|
|
|
|
|
|
form.appendChild(createSearchInput({api: api, placeholder: placeholder})); |
|
|
|
form.appendChild(createSearchButton({})); |
|
|
|
|
|
|
|
form.action = '#'; |
|
|
|
|
|
|
|
const tilesContainer = createElement('div', ['tiles', 'row'], null, col); |
|
|
|
tiles.map((topic, i) => { |
|
|
|
if (i < maxItems) { |
|
|
|
const col = createElement('div', ['col'], null, tilesContainer); |
|
|
|
const teaser = createTopicTeaser({...topic}); |
|
|
|
col.appendChild(teaser); |
|
|
|
} |
|
|
|
}) |
|
|
|
new IHKTopicTeasers($(section)); |
|
|
|
if (api) { |
|
|
|
new IHKSearchTypeahead($(form).find('input.typeahead')); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return section; |
|
|
|
} |