diff --git a/src/lib/ae_stores.ts b/src/lib/ae_stores.ts index d1a014a2..80dbb7af 100644 --- a/src/lib/ae_stores.ts +++ b/src/lib/ae_stores.ts @@ -116,6 +116,8 @@ export let ae_app_local_data_struct: key_val = { show_list__sponsorship_obj_li: true, show_view__sponsorship_obj: false, + show_question__accommodations: false, + submit_status: null, // 'saving', 'created', 'updated' }, diff --git a/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte b/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte index 9dc5d859..98ac1c47 100644 --- a/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte +++ b/src/routes/sponsorships/10_edit_modal__sponsorship_obj.svelte @@ -78,6 +78,7 @@ if ($slct.sponsorship_id) { media_li_json: null, questions_li_json: { + accommodations: null, accommodations_text: null, public_recognition: null, social_email: null, @@ -146,11 +147,24 @@ onMount(() => { }); +let show_question__accommodations = false; $: if ($slct.sponsorship_obj) { + + if ($slct.sponsorship_obj.questions_li_json && $slct.sponsorship_obj.questions_li_json.accommodations_text) { + console.log('Set q_accodomations to true.'); + // $ae_loc.mod.sponsorships.show_question__accommodations = true; + // show_question__accommodations = true; + // $slct.sponsorship_obj.q_accommodations = true; + // $slct.sponsorship_obj.questions_li_json.accommodations + } + + // Logo related if ($slct.sponsorship_obj.logo_li_json) { if ($slct.sponsorship_obj.logo_li_json.primary && $slct.sponsorship_obj.logo_li_json.primary.hosted_file_id_random) { placeholder_li.file_logo_primary = ae_util.create_img_element({ + account_id: $ae_loc.account_id, + base_url: $ae_api.base_url, hosted_file_id: $slct.sponsorship_obj.logo_li_json.primary.hosted_file_id_random, filename: `${$slct.sponsorship_obj.name} [logo_primary].${$slct.sponsorship_obj.logo_li_json.primary.extension}`, inc_link: true, @@ -160,6 +174,8 @@ $: if ($slct.sponsorship_obj) { } if ($slct.sponsorship_obj.logo_li_json.light && $slct.sponsorship_obj.logo_li_json.light.hosted_file_id_random) { placeholder_li.file_logo_light = ae_util.create_img_element({ + account_id: $ae_loc.account_id, + base_url: $ae_api.base_url, hosted_file_id: $slct.sponsorship_obj.logo_li_json.light.hosted_file_id_random, filename: `${$slct.sponsorship_obj.name} [logo_light].${$slct.sponsorship_obj.logo_li_json.light.extension}`, inc_link: true, @@ -169,6 +185,8 @@ $: if ($slct.sponsorship_obj) { } if ($slct.sponsorship_obj.logo_li_json.dark && $slct.sponsorship_obj.logo_li_json.dark.hosted_file_id_random) { placeholder_li.file_logo_dark = ae_util.create_img_element({ + account_id: $ae_loc.account_id, + base_url: $ae_api.base_url, hosted_file_id: $slct.sponsorship_obj.logo_li_json.dark.hosted_file_id_random, filename: `${$slct.sponsorship_obj.name} [logo_dark].${$slct.sponsorship_obj.logo_li_json.dark.extension}`, inc_link: true, @@ -181,6 +199,8 @@ $: if ($slct.sponsorship_obj) { if ($slct.sponsorship_obj.media_li_json) { if ($slct.sponsorship_obj.media_li_json.promo_video && $slct.sponsorship_obj.media_li_json.promo_video.hosted_file_id_random) { placeholder_li.file_media_promo_video = ae_util.create_video_element({ + account_id: $ae_loc.account_id, + base_url: $ae_api.base_url, hosted_file_id: $slct.sponsorship_obj.media_li_json.promo_video.hosted_file_id_random, filename: `${$slct.sponsorship_obj.name} [promo_video].${$slct.sponsorship_obj.media_li_json.promo_video.extension}`, inc_link: true, @@ -191,41 +211,41 @@ $: if ($slct.sponsorship_obj) { } } -function create_a_element({hosted_file_id, filename=null, extension=null, text="Download", class_li='text-blue-500'}) { - return `${text}`; -} +// function create_a_element({hosted_file_id, filename=null, extension=null, text="Download", class_li='text-blue-500'}) { +// return `${text}`; +// } -function create_img_element({hosted_file_id, filename=null, extension=null, class_li='max-w-64', inc_link=false}) { - let img_html = ''; - if (filename) { - img_html = ``; - } else { - img_html = ``; - } +// function create_img_element({hosted_file_id, filename=null, extension=null, class_li='max-w-64', inc_link=false}) { +// let img_html = ''; +// if (filename) { +// img_html = ``; +// } else { +// img_html = ``; +// } - if (inc_link) { - let a_html = create_a_element({hosted_file_id: hosted_file_id, filename: filename, extension: extension}); - img_html = `
${img_html}${a_html}
`; - } +// if (inc_link) { +// let a_html = create_a_element({hosted_file_id: hosted_file_id, filename: filename, extension: extension}); +// img_html = `
${img_html}${a_html}
`; +// } - return img_html; -} +// return img_html; +// } -function create_video_element({hosted_file_id, filename=null, extension=null, class_li='max-w-64', inc_link=false}) { - let video_html = ''; - if (filename) { - video_html = ``; - } else { - video_html = ``; - } +// function create_video_element({hosted_file_id, filename=null, extension=null, class_li='max-w-64', inc_link=false}) { +// let video_html = ''; +// if (filename) { +// video_html = ``; +// } else { +// video_html = ``; +// } - if (inc_link) { - let a_html = create_a_element({hosted_file_id: hosted_file_id, filename: filename, extension: extension}); - video_html = `
${video_html}${a_html}
`; - } +// if (inc_link) { +// let a_html = create_a_element({hosted_file_id: hosted_file_id, filename: filename, extension: extension}); +// video_html = `
${video_html}${a_html}
`; +// } - return video_html; -} +// return video_html; +// } async function handle_submit_form(event) { console.log('*** handle_submit_form() ***'); @@ -340,6 +360,11 @@ async function handle_submit_form(event) { // These questions are coming in from multiple forms. We need to make sure we do not clear out any existing question responses. let temp_questions = $slct.sponsorship_obj.questions_li_json; // q_accomodations + + if (typeof sponsorship_di.q_accommodations !== 'undefined') { + temp_questions['accommodations'] = Number(sponsorship_di.q_accommodations); + } + if (typeof sponsorship_di.accommodations_text !== 'undefined') { temp_questions['accommodations_text'] = sponsorship_di.accommodations_text; @@ -986,7 +1011,7 @@ async function handle_delete_sponsorship_obj({sponsorship_id, hosted_file_id=nul General Info - + Marketing - + {#if $slct.sponsorship_obj.level_num >= 2} - @@ -1015,8 +1044,15 @@ async function handle_delete_sponsorship_obj({sponsorship_id, hosted_file_id=nul Exhibitor Info {/if} + {#if $slct.sponsorship_obj.level_num >= 3} - + {#if $slct.sponsorship_obj.questions_li_json && ($slct.sponsorship_obj.questions_li_json.virtual_session || $slct.sponsorship_obj.questions_li_json.virtual_session === 0)} @@ -1468,24 +1504,27 @@ async function handle_delete_sponsorship_obj({sponsorship_id, hosted_file_id=nul /> + + - {#if ($ae_loc.mod.sponsorships.show_question__accommodations == 'show')} + + {#if ($slct.sponsorship_obj.questions_li_json.accommodations == true)}

If you require any special accommodations in order to enhance/enable your involvement with CHOW please provide details in the text box below. A member of the CHOW team will reach out to assist.