diff --git a/src/routes/idaa/(idaa)/+layout.svelte b/src/routes/idaa/(idaa)/+layout.svelte new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/idaa/(idaa)/+page.svelte b/src/routes/idaa/(idaa)/+page.svelte new file mode 100644 index 00000000..e69de29b diff --git a/src/routes/idaa/(idaa)/app.pcss b/src/routes/idaa/(idaa)/app.pcss new file mode 100644 index 00000000..f71bc7c0 --- /dev/null +++ b/src/routes/idaa/(idaa)/app.pcss @@ -0,0 +1,587 @@ +/* Write your global styles here, in PostCSS syntax */ + +/* @tailwind base; */ + +:root { + font-family: system-ui, Helvetica, Arial, sans-serif; + /* line-height: 1.5; */ + /* font-weight: 400; */ + + color-scheme: light dark; + /* color: rgba(255, 255, 255, 0.87); */ + /* background-color: #242424; */ + + /* font-synthesis: none; */ + /* text-rendering: optimizeLegibility; */ + /* -webkit-font-smoothing: antialiased; */ + /* -moz-osx-font-smoothing: grayscale; */ + /* -webkit-text-size-adjust: 100%; */ +} + +body { + /* margin: 0; */ + /* display: flex; + place-items: center; */ + /* min-width: 320px; */ + + min-height: 100vh; + /* min-height: fit-content; */ + /* height: 100%; */ + + min-width: 100vw; + /* width: 100%; */ + + /* contain: layout; */ + /* contain: size; */ +} + +address { + margin-bottom: 0.25em; + padding-left: 0.5em; + font-style: italic; +} + +pre { + white-space: pre-wrap; + word-break: normal; + word-wrap: normal; + + border: none; +} + +textarea { + /* width: calc(fit-content - 1em); */ + width: 100%; + max-width: calc(fit-content - 0.5em); +} + +button.ae_normal, +.btn.ae_normal { + /* font: normal 1em sans-serif; */ + font-size: 1rem; +} + +button.ae_smaller, +.btn.ae_smaller { + font-size: 0.8rem; +} + +button.ae_smallest, +.btn.ae_smallest { + font-size: 0.65rem; +} + +/* h1 { + font-size: 3.2em; + line-height: 1.1; +} */ + +/* .card { + padding: 2em; +} */ + +/* #app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} */ + +/* button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} */ + +/* @media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} */ + +/* BEGIN: Novi and Bootstrap specific fixes */ +/* .ae_btn .btn_xs, .btn .btn-xs { + font-size: .65rem; +} */ + +.ae_btn.btn-danger, +.ae_btn.btn-info, +.ae_btn.btn-warning { + border-radius: 60px; +} + +/* END: Novi and Bootstrap specific fixes */ + +.ae_main { + /* min-height: fit-content; */ + /* min-height: 100vh; */ + /* height: 100%; */ + + /* min-width: 100vw; */ + /* width: 100%; */ + + /* contain: layout; */ + /* contain: content; */ + /* contain: size; */ +} + +.ae_dev_in_progress { + background-color: hsla(300, 80%, 50%, 1); +} + +.c_idaa_bb, +.c_idaa_recovery_meetings { + display: flex; + flex-direction: column; + /* align-items: center; */ + /* justify-content: center; */ + /* min-height: 100vh; */ + + gap: 1em; +} + +.c_idaa_archives > .ae_meta, +.c_idaa_bb > .ae_meta, +.c_idaa_recovery_meetings > .ae_meta { + background-color: lightgray; +} + +.ae_list.archive_obj_li { + /* border: solid thin gray; */ + + display: flex; + flex-direction: column; + /* align-items: stretch; */ + /* justify-content: stretch; */ + gap: 0.5em; +} + +.ae_list.archive_obj_li .ae_object.archive_obj, +.ae_list.archive_content_obj_li .ae_object.archive_content_obj { + border-top: solid medium hsla(0, 0%, 90%, 1); + /* border-bottom: solid thin hsla(0,0%,90%,1); */ + /* margin: 1em .5em; */ + padding: 0.5em 0.5em; + + width: 100%; + + /* flex-grow: 1; */ +} + +.c_idaa_recovery_meetings section.ae_options fieldset { + display: flex; + flex-direction: row; +} + +.c_idaa_recovery_meetings section.ae_options fieldset legend { + display: inline; + /* border: none; */ + margin: 0; + + width: auto; +} + +.ae_list.event_obj_li { + /* border: solid thin gray; */ + + display: flex; + flex-direction: column; + /* align-items: stretch; */ + /* justify-content: stretch; */ + gap: 0.5em; +} + +.ae_list.event_obj_li .ae_object.event_obj { + border-top: solid medium hsla(0, 0%, 90%, 1); + /* border-bottom: solid thin hsla(0,0%,90%,1); */ + /* margin: 1em .5em; */ + padding: 0.5em 0.5em; + + width: 100%; + + /* flex-grow: 1; */ +} + +/* For now this only affects the IDAA Recovery Meetings when viewing a specific meeting. */ +.view__event_obj a, +.view__event_obj a.ae_link { + /* color: #007bff; */ + color: #82b6e1; + /* text-decoration: underline; */ + /* background-color: transparent; */ +} +.view__event_obj a:hover, +.view__event_obj a:focus, +.view__event_obj a.ae_link:hover, +.view__event_obj a.ae_link:focus { + color: #0056b3; + text-decoration: underline; + /* background-color: transparent; */ + + /* scale: 1.1; */ +} + +.svelte_component { + margin: 0em; + padding: 0em; +} + +.ae_section { + display: flex; + flex-direction: column; +} + +.ae_warning { + color: red; +} + +.ae_highlight { + background-color: hsla(60, 100%, 50%, 1); +} + +.ae_d_none, +.d-none { + display: none; +} + +.ae_group { + /* display: flex; */ + /* flex-direction: row; */ + /* align-items: center; */ + /* justify-content: space-between; */ + /* justify-content: space-evenly; */ +} + +.ae_column { + display: flex; + flex-direction: column; + /* align-items: center; */ + /* justify-content: space-between; */ + justify-content: space-evenly; +} + +.ae_row { + display: flex; + flex-direction: row; + + align-items: center; + /* justify-content: space-between; */ + justify-content: space-evenly; +} + +.ae_flex_justify_around { + justify-content: space-around; +} + +.ae_flex_justify_center { + justify-content: center; +} + + +.ae_width_25 { + width: 25%; + /* max-width: 25%; */ +} +.ae_width_30 { + width: 30%; + /* max-width: 30%; */ +} +.ae_width_50 { + width: 50%; + /* max-width: 50%; */ +} +.ae_width_100 { + width: 100%; + /* max-width: 100%; */ +} + +.ae_width_md { + min-width: 16em; + width: 16em; + max-width: 16em; +} + +.ae_width_lg { + min-width: 20em; + width: 22em; + max-width: 24em; +} + +.ae_margin_xs { + margin: 0.25em; +} +.ae_margin_sm { + margin: 0.5em; +} +.ae_margin_md { + margin: 0.75em; +} +.ae_margin_lg { + margin: 1em; +} +.ae_margin_lg { + margin: 1.25em; +} + +.ae_padding_md { + padding: 0.75em; +} + +.ae_float_right { + float: right; + align-self: flex-end; +} + +.ae_options { + padding: 1em; +} + +.ae_fade_in { + /* animation: fadein 1s; */ + opacity: 1; + /* height: initial; */ + /* max-height: 100%; */ + /* width: initial; */ + /* max-width: 100%; */ + transition: + opacity, + height, + width, + 0.25s ease-in; + + /* transition: height 1s ease-in; */ + /* width: initial; */ + /* transition: opacity, height, width 1s ease-in 1s; */ +} +.ae_fade_out { + /* animation: fadeout 1s; */ + opacity: 0; + height: 0; + max-height: 0; + width: 0; + max-width: 0; + transition: + opacity, + height, + width, + 0.25s ease-out; +} + +/* .ae_section.ae_options { + border: solid thin hsla(0,0%,90%,.75); */ + +/* Display options using flex (row, wrap, space elements equally) */ +/* display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: center; */ +/* justify-content: space-evenly; */ +/* align-content: center; + align-items: center; +} */ + +.ae_section.ae_meta { + font-size: smaller; + color: hsla(0, 0%, 50%, 1); +} + +.svelte_component.ae_edit { + /* outline: dashed thin pink; */ + border: solid medium hsla(220, 100%, 50%, 0.1); +} + +.svelte_component.ae_create { + border: solid medium hsla(0, 100%, 50%, 0.1); +} + +/* element_ae_modal ae_modal_showing_container ae_modal modal_cover_body */ +.ae_modal { + position: fixed; + top: 0; + left: 0; + z-index: 1000; + + min-height: 100vh; + height: 100%; + /* max-height: 100vh; */ + + min-width: 100vw; + width: 100%; + max-width: 100vw; + + /* background-color: hsla(180,75%,90%,.75); */ + background-color: hsla(180, 0%, 90%, 0.75); + + display: flex; + flex-direction: column; + + align-items: center; + /* align-items: flex-start; */ + /* justify-content: center; */ + /* justify-content: flex-start; */ + + /* contain: layout; */ + contain: strict; + /* contain: size; */ + + /* Margin should stay 0 and padding can be used to create space within the modal for the actual content. */ + margin: 0; + padding: 1em; + + /* pointer-events: auto; */ +} + +.ae_modal .modal_content { + z-index: 1001; + position: relative; + + box-sizing: content-box; + + background-color: white; + /* margin: 1em; + padding: .25em .5em; */ + margin: 0em; + padding: 0em; + + border: solid thin lightgray; + border-radius: 0.5em; + + /* box-shadow: .5em .5em 1.5em .5em hsla(0, 0%, 0%, .9); */ + box-shadow: 0em 0em 1.5em 0.5em hsla(0, 0%, 0%, 0.9); + + /* min-height: 50vh; */ + max-height: calc(100vh - 2em); + /* max-height: fit-content; */ + + /* min-width: 50vw; */ + max-width: calc(100vw - 2em); + /* max-width: 100vw; */ + + /* scroll-behavior: auto; */ + /* overflow: scroll; */ + /* overflow: auto; */ + /* contain: content; */ + /* contain: strict; */ + /* overflow: auto; */ + + display: flex; + flex-direction: column; + align-items: stretch; +} + +.ae_modal .modal_header { + background-color: hsla(0, 0%, 90%, 0.5); + border-bottom: solid thin lightgray; + + margin: 0em; + padding: 0.25em 0.25em; + + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +.ae_modal .modal_body { + /* outline: dashed medium pink; */ + + margin: 0em; + padding: 0.25em 0.25em; + + /* height: 100vh; */ + + /* contain: content; */ + /* pointer-events: auto; */ + overflow: scroll; + /* overflow-x: auto; */ + /* overflow-y: scroll; */ +} + +.ae_modal .modal_footer { + background-color: hsla(0, 0%, 90%, 0.5); + border-top: solid thin lightgray; + + margin: 0em; + padding: 0.25em 0.25em; + + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +/* body.modal_cover_body { + pointer-events: none; + overflow-y: hidden; + height: fit-content; + contain: size; +} */ + +body.modal_cover_body .ae_modal { + margin: 0em; + padding: 0em; + /* max-width: 100vw; */ + + align-items: stretch; +} + +body.modal_cover_body .ae_modal .modal_content { + /* outline: dashed thin pink; */ + + border: none; + border-radius: 0; + + box-shadow: none; + + max-height: calc(100vh - 0.5em); + + max-width: calc(100vw); +} + +body.modal_cover_body .ae_modal .modal_body { + /* outline: dashed medium pink; */ +} + +form { + display: flex; + flex-direction: column; + /* justify-content: flex-start; */ + /* align-items: center; */ + + padding: 0.75em; +} + +form fieldset { + display: flex; + flex-direction: column; + /* justify-content: flex-start; */ + /* align-items: center; */ +} + +/* Make readonly input fields grayed out and hide border*/ +form input:read-only { + /* background-color: hsla(0,0%,90%,1); */ + border: none; +} +/* @tailwind components; */ +@tailwind utilities; diff --git a/src/routes/idaa/(idaa)/archives/0_archives__main.svelte b/src/routes/idaa/(idaa)/archives/0_archives__main.svelte new file mode 100644 index 00000000..bb569254 --- /dev/null +++ b/src/routes/idaa/(idaa)/archives/0_archives__main.svelte @@ -0,0 +1,617 @@ + + + +
+ + +
+

+ Novi: {$ae_app.novi_full_name} + + ( + {$ae_app.novi_email} + {#if $ae_app.administrator_access} + Administrator + {:else if $ae_app.trusted_access} + Trusted + {/if} + UUID: {$ae_app.novi_uuid} + ) + +

+ +
+ +{#if $ae_app.archives.show_main__options} +
+ + + + + + +
+ {#if $slct.archive_id} + + {/if} + {#if $ae_app.trusted_access} + + {/if} +
+ +
+{/if} + + +{#if $ae_app.archives.show_list__archive_obj_li} + +{/if} + + +{#if $ae_app.archives.show_view__archive_obj && $slct.archive_obj} + +{/if} + + +
+ + +{#if $ae_app.archives.show_edit__archive_obj} + { + $ae_app.archives.show_main__options = true; + $ae_app.archives.show_list__archive_obj_li = true; + $ae_app.archives.show_edit__archive_obj = false; + $ae_app.archives.show_view__archive_obj = false; + + const url = new URL(location); + url.searchParams.delete('archive_id'); + history.pushState({}, '', url); + + let message = {'archive_id': null}; + window.parent.postMessage(message, "*"); + }} + on:report__modal_dimensions={ (event) => { + console.log('*** on:report__modal_dimensions ***'); + console.log(event.detail); + + $ae_app.modal_dimensions = event.detail.modal_dimensions; + }} + > + {@html ($slct.archive_obj.name ? $slct.archive_obj.name : 'New Archive Group')} + + + + + + + +{/if} + + + + + + diff --git a/src/routes/idaa/(idaa)/archives/10_edit__archive_content_obj.svelte b/src/routes/idaa/(idaa)/archives/10_edit__archive_content_obj.svelte new file mode 100644 index 00000000..348e9e4c --- /dev/null +++ b/src/routes/idaa/(idaa)/archives/10_edit__archive_content_obj.svelte @@ -0,0 +1,706 @@ + + + +
+ + +
+ + {#await update_archive_content_obj_promise} +
Saving...
+ {:then} + {#if update_archive_content_obj_promise} +
Finished saving
+ {:else} + + {/if} + {/await} + +

Archive Content

+ + + + + + + + + +
+ Public Access with Rotating Access Key/Passcode + + +
+ + +

File?

+ {#if !$slct.archive_content_id} + + + {/if} + + + + + + + +

Original

+ + +
+ +
+ + + + + + + {#if $ae_app.trusted_access} +
+ +

+ Admin Options + +

+ + + + + + + + + + + {#if $ae_app.administrator_access} + + {/if} + + + + + +
+ {/if} + + +
+ + + {#if $slct.archive_content_id} + + {/if} +
+ + + +
+ + + diff --git a/src/routes/idaa/(idaa)/archives/10_edit__archive_obj.svelte b/src/routes/idaa/(idaa)/archives/10_edit__archive_obj.svelte new file mode 100644 index 00000000..c8f30870 --- /dev/null +++ b/src/routes/idaa/(idaa)/archives/10_edit__archive_obj.svelte @@ -0,0 +1,588 @@ + + + +
+ +
+ + {#await update_archive_obj_promise} +
Saving...
+ {:then} + {#if update_archive_obj_promise} +
Finished saving
+ {:else} + + {/if} + {/await} + +

Archive

+ + + + + + + +

Original

+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + {#if $ae_app.trusted_access} +
+ +

+ Admin Options + +

+ + + + + + + + + + + {#if $ae_app.administrator_access} + + {/if} + + + + + +
+ {/if} + + +
+ + + {#if $slct.archive_id} + + {/if} +
+ +
+ +
+ + + diff --git a/src/routes/idaa/(idaa)/archives/10_list__archive_content_obj.svelte b/src/routes/idaa/(idaa)/archives/10_list__archive_content_obj.svelte new file mode 100644 index 00000000..befdb469 --- /dev/null +++ b/src/routes/idaa/(idaa)/archives/10_list__archive_content_obj.svelte @@ -0,0 +1,489 @@ + + + +
+{#if $slct.archive_content_obj_li} + +{#each $slct.archive_content_obj_li as idaa_archive_content_obj, index} + +{#if idaa_archive_content_obj.group && idaa_archive_content_obj.group != $slct.archive_content_obj_li[index - 1]?.group} +
+ +
+{/if} +{#if $ae_app.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group} + +
+ +
+

+ {idaa_archive_content_obj.name} + + {#if idaa_archive_content_obj.type} {idaa_archive_content_obj.type}{/if} + + {#if $ae_app.trusted_access && idaa_archive_content_obj.hide} Hidden{/if} + {#if $ae_app.administrator_access && !idaa_archive_content_obj.enable} Not enabled{/if} +

+
+ +
+ {#if idaa_archive_content_obj.archive_content_id_random != $ae_app.archives.show_view__archive_content_media} + + {:else} + + {/if} + + {#if $ae_app.trusted_access} + + + Download + + {#if file_icons[idaa_archive_content_obj.file_extension]} + + {:else} + + {/if} + .{idaa_archive_content_obj.file_extension} + + {/if} + + {#if $ae_app.trusted_access} + + + {/if} +
+ + + + {#if idaa_archive_content_obj.archive_content_id_random == $ae_app.archives.show_view__archive_content_media} + + {/if} + + +
+ {#if idaa_archive_content_obj.description} +
+
Description:
+
+ {idaa_archive_content_obj.description} +
+
+ {/if} + + {#if idaa_archive_content_obj.content_html} +
+
Content:
+
+ {@html idaa_archive_content_obj.content_html} +
+
+ {/if} + +
+ Original date/time: + {#if idaa_archive_content_obj.original_datetime} + {ae.util.iso_datetime_formatter(idaa_archive_content_obj.original_datetime, 'datetime_long')} + {/if} + {#if idaa_archive_content_obj.original_timezone} + Timezone: + {idaa_archive_content_obj.original_timezone} + {/if} +
+ +
+ + + +
+{/if} +{/each} + +{:else} +
No archives avalible to show at this time
+{/if} +
+ + +{#if $ae_app.archives.show_edit__archive_content_id} + + { + $slct.archive_content_id = null; + $slct.archive_content_obj = {}; + + // $ae_app.archives.show_main__options = true; + // $ae_app.archives.show_list__archive_content_li = true; + $ae_app.archives.show_view__archive_content_media = false; + $ae_app.archives.show_edit__archive_content_id = false; + // $ae_app.archives.show_view__archive_content_id = false; + + const url = new URL(location); + url.searchParams.delete('archive_content_id'); + history.pushState({}, '', url); + + let message = {'archive_content_id': null}; + window.parent.postMessage(message, "*"); + }} + > + {@html ($slct.archive_content_obj.name ? $slct.archive_content_obj.name : 'New Archive Content')} + + + + + + + + +{/if} + + + diff --git a/src/routes/idaa/(idaa)/archives/10_list__archive_obj.svelte b/src/routes/idaa/(idaa)/archives/10_list__archive_obj.svelte new file mode 100644 index 00000000..bc2f5eb5 --- /dev/null +++ b/src/routes/idaa/(idaa)/archives/10_list__archive_obj.svelte @@ -0,0 +1,151 @@ + + + +
+{#if $slct.archive_obj_li} + +{#each $slct.archive_obj_li as idaa_archive_obj, index} +
+ +
+ {idaa_archive_obj.name} + {#if idaa_archive_obj.original_location} + ( + + {idaa_archive_obj.original_location} + ) + + {/if} + + {#if $ae_app.trusted_access && idaa_archive_obj.hide} Hidden{/if} + {#if $ae_app.administrator_access && !idaa_archive_obj.enable} Not enabled{/if} +
+ +
+ + + {#if $ae_app.trusted_access} + + {/if} +
+ + +
+
+ +
+ {@html idaa_archive_obj.description} +
+
+
+ + + +
+{/each} + +{:else} +
No archives avalible to show at this time
+{/if} +
+ + + diff --git a/src/routes/idaa/(idaa)/archives/10_player__archive_content_obj.svelte b/src/routes/idaa/(idaa)/archives/10_player__archive_content_obj.svelte new file mode 100644 index 00000000..93a0b43a --- /dev/null +++ b/src/routes/idaa/(idaa)/archives/10_player__archive_content_obj.svelte @@ -0,0 +1,78 @@ + + + + +
+ {#if file_icons[$slct.archive_content_obj.file_extension] == 'file-audio'} + + + {:else if file_icons[$slct.archive_content_obj.file_extension] == 'file-video'} + + + {:else if file_icons[$slct.archive_content_obj.file_extension] == 'file-image'} + {$slct.archive_content_obj.name} + {:else} + {$slct.archive_content_obj.filename} + {/if} + + {#if $slct.archive_content_obj.description} +
+ {$slct.archive_content_obj.description} +
+ {/if} + + {#if $slct.archive_content_obj.content_html} +
+ {@html $slct.archive_content_obj.content_html} +
+ {/if} + +
\ No newline at end of file diff --git a/src/routes/idaa/(idaa)/archives/10_view__archive_obj.svelte b/src/routes/idaa/(idaa)/archives/10_view__archive_obj.svelte new file mode 100644 index 00000000..c505b036 --- /dev/null +++ b/src/routes/idaa/(idaa)/archives/10_view__archive_obj.svelte @@ -0,0 +1,244 @@ + + + +
+ +
+

{@html $slct.archive_obj.name}

+
+ +
+ {#if $slct.archive_obj.description}
{@html $slct.archive_obj.description}
{/if} + {#if $slct.archive_obj.content_html}
{@html $slct.archive_obj.content_html}
{/if} + {#if $slct.archive_obj.original_url} +
+ URL: + {$slct.archive_obj.original_url} +
+ {/if} + {#if $slct.archive_obj.original_datetime} +
+ Start Date: + {ae.util.iso_datetime_formatter($slct.archive_obj.original_datetime, 'datetime_long')} +
+ {/if} + {#if $slct.archive_obj.original_timezone} + Timezone: + {$slct.archive_obj.original_timezone} + {/if} + {#if $slct.archive_obj.original_location} +
+ Location: + {$slct.archive_obj.original_location} +
+ {/if} +
+ +
+
+
+ Created on: + {ae.util.iso_datetime_formatter($slct.archive_obj.created_on, 'datetime_iso_no_seconds')} + {#if $slct.archive_obj.updated_on} + Updated on: + {ae.util.iso_datetime_formatter($slct.archive_obj.updated_on, 'datetime_iso_no_seconds')} + {/if} +
+
+ + {#if $ae_app.trusted_access} +
+ {#if $ae_app.trusted_access || $slct.archive_obj.external_person_id === $ae_app.novi_uuid} + + + + {/if} +
+ {/if} +
+ +{#if $slct.archive_obj} + + + +{/if} + + + + + + + +
+ + + diff --git a/src/routes/idaa/(idaa)/main.ts b/src/routes/idaa/(idaa)/main.ts new file mode 100644 index 00000000..f8cae26c --- /dev/null +++ b/src/routes/idaa/(idaa)/main.ts @@ -0,0 +1,73 @@ +import { ae } from "aether_npm_lib"; +import "./app.pcss"; +import App from "./App.svelte"; +import Archives from "./0_archives__main.svelte"; +import Events from "./0_events__main.svelte"; +import Posts from "./0_posts__main.svelte"; + +let url_params = ae.util.get_url_params(); +// console.log(url_params); +// IMPORTANT: The URL paramater 'uuid' is used to determine if the user is logged in or not. If the user is logged in, the uuid will be passed in as a url param. If the user is not logged in, the uuid will not be passed in as a url param. + +if (document.getElementById("app")) { + const app = new App({ + target: document.getElementById("app"), + }); +} + +if (document.querySelector(".svelte_target.idaa_archives_main")) { + const archives_main_app = new Archives({ + target: document.querySelector(".svelte_target.idaa_archives_main"), + props: { + archive_id: url_params.archive_id, + novi_uuid: url_params.uuid ? url_params.uuid : false, + novi_email: decodeURIComponent(url_params.email), // decodeURIComponent() is needed because the email is passed in as a url param. Should this be takenc are of by the ae.util.get_url_params() function? + novi_full_name: decodeURIComponent(url_params.full_name), + novi_admin_li: ["2b078deb-b4e7-4203-99da-9f7cd62159a5"], + novi_trusted_li: [ + "c9ea07b5-06b0-4a43-a2d0-8d06558c8a82", + "58db22ee-4b0a-49a7-9f34-53d2ba85a84b", + ], + results_limit_administrator: 200, + results_limit_trusted: 75, + results_limit_authenticated: 50, + }, + }); +} + +if (document.querySelector(".svelte_target.idaa_events_main")) { + const events_main_app = new Events({ + target: document.querySelector(".svelte_target.idaa_events_main"), + props: { + event_id: url_params.event_id, + novi_uuid: url_params.uuid ? url_params.uuid : false, + novi_email: decodeURIComponent(url_params.email), // decodeURIComponent() is needed because the email is passed in as a url param. Should this be takenc are of by the ae.util.get_url_params() function? + novi_full_name: decodeURIComponent(url_params.full_name), + novi_admin_li: ["2b078deb-b4e7-4203-99da-9f7cd62159a5"], + novi_trusted_li: [ + "c9ea07b5-06b0-4a43-a2d0-8d06558c8a82", + "58db22ee-4b0a-49a7-9f34-53d2ba85a84b", + ], + results_limit_administrator: 200, + results_limit_trusted: 200, + results_limit_authenticated: 50, + }, + }); +} + +if (document.querySelector(".svelte_target.idaa_posts_main")) { + const posts_main_app = new Posts({ + target: document.querySelector(".svelte_target.idaa_posts_main"), + props: { + post_id: url_params.post_id, + novi_uuid: url_params.uuid ? url_params.uuid : false, + novi_email: url_params.email, + novi_full_name: url_params.full_name, + novi_admin_li: ["2b078deb-b4e7-4203-99da-9f7cd62159a5"], + novi_trusted_li: [ + "c9ea07b5-06b0-4a43-a2d0-8d06558c8a82", + "58db22ee-4b0a-49a7-9f34-53d2ba85a84b", + ], + }, + }); +} diff --git a/src/routes/idaa/(idaa)/posts/0_posts__main.svelte b/src/routes/idaa/(idaa)/posts/0_posts__main.svelte new file mode 100644 index 00000000..a3fbf85f --- /dev/null +++ b/src/routes/idaa/(idaa)/posts/0_posts__main.svelte @@ -0,0 +1,698 @@ + + + +
+ + +
+

+ Novi: {$ae_app.novi_full_name} + + ( + {$ae_app.novi_email} + {#if $ae_app.administrator_access} + Administrator + {:else if $ae_app.trusted_access} + Trusted + {/if} + UUID: {$ae_app.novi_uuid} + ) + +

+ +
+ +{#if $ae_app.posts.show_main__options} +
+ + {#if $ae_app.trusted_access && $ae_app.posts.hidden == 'not_hidden'} + + {:else if $ae_app.trusted_access && $ae_app.posts.hidden == 'all'} + + {/if} + + {#if $ae_app.administrator_access} + {#if $ae_app.posts.enabled == 'enabled'} + + {:else} + + {/if} + {/if} + + + +
+{/if} + +{#if $ae_app.posts.show_list__post_obj_li} +
+{#if $slct.post_obj_li} + +{#each $slct.post_obj_li as idaa_post_obj, index} +
+
+

+ {@html idaa_post_obj.title} + {#if idaa_post_obj.topic_id} {idaa_post_obj.topic_name}{/if} +

+
+ + {#if idaa_post_obj.content}
{@html idaa_post_obj.content}
{/if} + +
+ + + {#if $ae_app.trusted_access || idaa_post_obj.external_person_id === $ae_app.novi_uuid || idaa_post_obj.email === $ae_app.novi_email} + + {/if} + + + +
+ + + +
+{/each} + +{:else} + No posts found at this time +{/if} +
+{/if} + + +{#if $ae_app.posts.show_edit__post_id} + { + $ae_app.posts.show_main__options = true; + $ae_app.posts.show_list__post_obj_li = true; + $ae_app.posts.show_edit__post_id = false; + // $ae_app.posts.show_view__post_id = false; + + const url = new URL(location); + url.searchParams.delete('post_id'); + history.pushState({}, '', url); + + let message = {'post_id': null}; + window.parent.postMessage(message, "*"); + }} + on:report__modal_dimensions={ (event) => { + console.log('*** on:report__modal_dimensions ***'); + console.log(event.detail); + + $ae_app.modal_dimensions = event.detail.modal_dimensions; + }} + > + {@html ($slct.post_obj.title ? $slct.post_obj.title : 'New BB Post')} + + +
+ +
+
+
+{/if} + + +{#if $ae_app.posts.show_view__post_id && $slct.post_obj} + { + $slct.post_comment_id = null; // NOTE: Reset in case the post comment was being edited. + $slct.post_comment_obj = {}; // NOTE: Reset in case the post comment was being edited. + $slct.post_comment_obj_li = []; + + $ae_app.posts.show_main__options = true; + $ae_app.posts.show_list__post_obj_li = true; + // $ae_app.posts.show_edit__post_id = false; + $ae_app.posts.show_view__post_id = false; + $ae_app.posts.show_edit__post_comment = false; + + const url = new URL(location); + url.searchParams.delete('post_id'); + history.pushState({}, '', url); + + let message = {'post_id': null}; + window.parent.postMessage(message, "*"); + }} + on:report__modal_dimensions={ (event) => { + console.log('*** on:report__modal_dimensions ***'); + console.log(event.detail); + + $ae_app.modal_dimensions = event.detail.modal_dimensions; + }} + > + {$slct.post_obj.title} + + + + + + + +{/if} + +
+ + + diff --git a/src/routes/idaa/(idaa)/posts/10_edit__post_comment_obj.svelte b/src/routes/idaa/(idaa)/posts/10_edit__post_comment_obj.svelte new file mode 100644 index 00000000..d5c918c8 --- /dev/null +++ b/src/routes/idaa/(idaa)/posts/10_edit__post_comment_obj.svelte @@ -0,0 +1,476 @@ + + + +
+ +
+ + {#await update_post_comment_obj_promise} +
Saving...
+ {:then} + {#if update_post_comment_obj_promise} +
Finished saving
+ {:else} + + {/if} + {/await} + +

Post Comment

+ + + + + +

Poster's Information

+
+ Post as Anonymous +
+ + +
+
+ + +
+
+ + + + + + {#if $ae_app.trusted_access} + + {/if} + + + {#if $ae_app.trusted_access} +
+ +

+ Admin Options + +

+ + + + + + + + + + + {#if $ae_app.administrator_access} + + {/if} + + + + + +
+ {/if} + + +
+ + + {#if $slct.post_comment_id} + {#if $ae_app.administrator_access} + + {:else if $ae_app.trusted_access} + + {:else} + + {/if} + {/if} +
+ +
+ + + +
+ + + diff --git a/src/routes/idaa/(idaa)/posts/10_edit__post_obj.svelte b/src/routes/idaa/(idaa)/posts/10_edit__post_obj.svelte new file mode 100644 index 00000000..9fe472b0 --- /dev/null +++ b/src/routes/idaa/(idaa)/posts/10_edit__post_obj.svelte @@ -0,0 +1,598 @@ + + + +
+ +
+ + {#await update_post_obj_promise} +
Saving...
+ {:then} + {#if update_post_obj_promise} +
Finished saving
+ {:else} + + {/if} + {/await} + +

Post

+ + + + + + + +

Poster's Information

+
+ Post as Anonymous +
+ + +
+
+ + +
+
+ + + + + + {#if $ae_app.trusted_access} + + {/if} + + + + + + + + + {#if $ae_app.trusted_access} +
+ +

+ Admin Options + +

+ + + + + + + + + + + {#if $ae_app.administrator_access} + + {/if} + + {#if $ae_app.trusted_access} + + {/if} + + + +
+ {/if} + + +
+ + + {#if $slct.post_id} + {#if $ae_app.administrator_access} + + {:else if $ae_app.trusted_access} + + {:else} + + {/if} + {/if} +
+ +
+ +
+ + + diff --git a/src/routes/idaa/(idaa)/posts/10_view__post_obj.svelte b/src/routes/idaa/(idaa)/posts/10_view__post_obj.svelte new file mode 100644 index 00000000..680c3b26 --- /dev/null +++ b/src/routes/idaa/(idaa)/posts/10_view__post_obj.svelte @@ -0,0 +1,261 @@ + + + +
+ +
+

+ {@html $slct.post_obj.title} + {#if $slct.post_obj.topic_id} {$slct.post_obj.topic_name}{/if} +

+
+ +
{@html $slct.post_obj.content}
+ +
+
+ {#if ($slct.post_obj.anonymous)} +
+ Posted by: Anonymous +
+ {:else if ($slct.post_obj.full_name)} +
+ Posted by: {$slct.post_obj.full_name} + {#if $ae_app.trusted_access && $slct.post_obj.email} + {$slct.post_obj.email} + {/if} +
+ {/if} + +
+ {#if !$slct.post_obj.updated_on} + Created on: + {ae.util.iso_datetime_formatter($slct.post_obj.created_on, 'datetime_iso_no_seconds')} + {:else} + Updated on: + + {ae.util.iso_datetime_formatter($slct.post_obj.updated_on, 'datetime_iso_no_seconds')} + {/if} + + Archive on: + {ae.util.iso_datetime_formatter($slct.post_obj.archive_on, 'datetime_iso_no_seconds')} + +
+
+ +
+ {#if $slct.post_obj.post_comment_count} + + {($slct.post_obj.post_comment_count == 1 ? `${$slct.post_obj.post_comment_count} comment` : `${$slct.post_obj.post_comment_count} comments` )} + + {/if} + + + {#if $ae_app.trusted_access || $slct.post_obj.external_person_id === $ae_app.novi_uuid || $slct.post_obj.email === $ae_app.novi_email} + + {/if} +
+
+ + + +{#if $ae_app.posts.show_edit__post_comment} +
+ + { + $slct.post_comment_id = null; + $slct.post_comment_obj = {}; + + // $ae_app.posts.show_post_list = true; + // $ae_app.posts.show_edit__post_id = false; + // $ae_app.posts.show_view__post_id = false; + $ae_app.posts.show_edit__post_comment = false; + }} + > + Comment on: {($slct.post_obj.title ? $slct.post_obj.title : '')} + + +
+ +
+
+
+
+{/if} + +{#if $slct.post_comment_obj_li.length} +{#each $slct.post_comment_obj_li as idaa_post_comment_obj, index} +
+
{@html idaa_post_comment_obj.content}
+ + +
+
+ + Comment by: + {#if idaa_post_comment_obj.anonymous} + + Anonymous + {:else} + + {idaa_post_comment_obj.full_name} + + {/if} +
+ Created on: + {ae.util.iso_datetime_formatter(idaa_post_comment_obj.created_on, 'datetime_iso_no_seconds')} + {#if idaa_post_comment_obj.updated_on} + Updated on: + {ae.util.iso_datetime_formatter(idaa_post_comment_obj.updated_on, 'datetime_iso_no_seconds')} + {/if} +
+
+ + {#if $ae_app.trusted_access || idaa_post_comment_obj.external_person_id === $ae_app.novi_uuid} +
+ +
+ {/if} +
+ +{/each} +{/if} + +
+ + + diff --git a/src/routes/idaa/(idaa)/recovery_meetings/0_events__main.svelte b/src/routes/idaa/(idaa)/recovery_meetings/0_events__main.svelte new file mode 100644 index 00000000..1c224913 --- /dev/null +++ b/src/routes/idaa/(idaa)/recovery_meetings/0_events__main.svelte @@ -0,0 +1,835 @@ + + + + + +
+ + +
+

+ Novi: {$ae_app.novi_full_name} + + ( + {$ae_app.novi_email} + {#if $ae_app.administrator_access} + Administrator + {:else if $ae_app.trusted_access} + Trusted + {/if} + UUID: {$ae_app.novi_uuid} + ) + +

+ +
+ + + +{#if $ae_app.events.show_main__options} +
+ + + +
+{/if} + + +{#if $ae_app.events.show_list__event_obj_li} + +{/if} + + +{#if $ae_app.events.show_edit__event_obj} + + { + $ae_app.events.show_main__options = true; + $ae_app.events.show_list__event_obj_li = true; + $ae_app.events.show_edit__event_obj = false; + $ae_app.events.show_view__event_obj = false; + + const url = new URL(location); + url.searchParams.delete('event_id'); + history.pushState({}, '', url); + + let message = {'event_id': null}; + window.parent.postMessage(message, "*"); + }} + on:report__modal_dimensions={ (event) => { + console.log('*** on:report__modal_dimensions ***'); + console.log(event.detail); + + $ae_app.modal_dimensions = event.detail.modal_dimensions; + }} + > + {@html ($slct.event_obj.name ? $slct.event_obj.name : 'New Recovery Meeting')} + + + + + + + + +{/if} + + +{#if $ae_app.events.show_view__event_obj && $slct.event_obj} + + { + $slct.event_id = null; + $slct.event_obj = {}; + + $ae_app.events.show_main__options = true; + $ae_app.events.show_list__event_obj_li = true; + $ae_app.events.show_view__event_obj = false; + $ae_app.events.show_edit__event_obj = false; + + const url = new URL(location); + url.searchParams.delete('event_id'); + history.pushState({}, '', url); + + let message = {'event_id': null}; + window.parent.postMessage(message, "*"); + }} + on:report__modal_dimensions={ (event) => { + console.log('*** on:report__modal_dimensions ***'); + console.log(event.detail); + + $ae_app.modal_dimensions = event.detail.modal_dimensions; + }} + > + {@html $slct.event_obj.name} + + + + + + + + +{/if} + +
+ + + diff --git a/src/routes/idaa/(idaa)/recovery_meetings/10_edit__event_obj.svelte b/src/routes/idaa/(idaa)/recovery_meetings/10_edit__event_obj.svelte new file mode 100644 index 00000000..80ac562e --- /dev/null +++ b/src/routes/idaa/(idaa)/recovery_meetings/10_edit__event_obj.svelte @@ -0,0 +1,1207 @@ + + + +
+ +
+ + {#await update_event_obj_promise} +
Saving...
+ {:then} + {#if update_event_obj_promise} +
Finished saving
+ {:else} + + {/if} + {/await} + + + + + +
+ + + + + + + +
+ +
+ +
+

How to Attended

+ +
+ Face-to-Face or Virtual +

Is this a face-to-face/in person meeting, a virtual/online meeting, or both?

+
+ + +
+
+ +
+ + Address + + + + + + + + + + + +
+ +
+ + + + {#if $ae_app.lu_country_subdivision_list} + + {:else} + + {/if} + + + + {#if $ae_app.lu_country_list} + + {:else} + + {/if} + +
+ + + +
+ Virtual/Online + + + + + + + +
+ + + +
+ +
+ +
+

Recurring and When

+ +
+ Recurring +
+ + +
+
+ +
+ + Recurring + +
+ +
+ + + + + + + +
+ +
+ + + +
+ + {#if ( $ae_app.administrator_access || $slct.event_obj && ($slct.event_obj.show_recurring_text || ($slct.event_obj.recurring_text && !$slct.event_obj.recurring_text.includes('*gen*'))) )} +

Please only use the text box for additional information if the options above do not cover your needs. This may affect how this meeting shows up in search results.

+ + {/if} + {#if ( $ae_app.administrator_access || $slct.event_obj && ($slct.event_obj.show_recurring_text || ($slct.event_obj.recurring_text && !$slct.event_obj.recurring_text.includes('*gen*'))) )} + + {:else} + + {/if} + + +
+ +
+ +
+

Contacts

+ + + + + +
+ Contact 1 +
Contact 1 is the primary contact for this meeting.
+ + + + {#if !($ae_app.trusted_access || $slct.event_obj.contact_li_json[0].unlock)} + + {:else} + + {/if} + + + + + + + + + +
+ +
+ Contact 2 + + + + + + + + + +
+
+ +
+ +
+ +

+ Admin Options + +

+ + + + + + + + + + + {#if $ae_app.administrator_access} + + {/if} + + {#if $ae_app.trusted_access} + + {/if} + + + +
+ + +
+ {#if $slct.event_id} + + {:else} + + {/if} + + {#if $slct.event_id} + {#if $ae_app.administrator_access} + + {:else if $ae_app.trusted_access} + + {:else} + + {/if} + {/if} +
+ +
+ +
+ + + diff --git a/src/routes/idaa/(idaa)/recovery_meetings/10_list__event_obj.svelte b/src/routes/idaa/(idaa)/recovery_meetings/10_list__event_obj.svelte new file mode 100644 index 00000000..2e50b27f --- /dev/null +++ b/src/routes/idaa/(idaa)/recovery_meetings/10_list__event_obj.svelte @@ -0,0 +1,303 @@ + + + +
+{#if $slct.event_obj_li && $slct.event_obj_li.length} + +{#each $slct.event_obj_li as idaa_event_obj, index} +
+ +
+

+ {idaa_event_obj.name} + {#if idaa_event_obj.physical && idaa_event_obj.virtual} F2F and Virtual{:else if idaa_event_obj.physical} F2F{:else if idaa_event_obj.virtual} Virtual{/if} + {#if idaa_event_obj.type} {idaa_event_obj.type}{/if} + + {#if $ae_app.trusted_access && idaa_event_obj.hide} Hidden{/if} + {#if $ae_app.administrator_access && !idaa_event_obj.enable} Not enabled{/if} +

+
+ +
+ + + + {#if $ae_app.trusted_access || idaa_event_obj.external_person_id === $ae_app.novi_uuid || idaa_event_obj.contact_li_json[0].email === $ae_app.novi_email} + + + {/if} +
+ + +
+ + +
+ Type of Recovery Meeting: + {idaa_event_obj.type} +
+ +
+ + + When: + + + {#if idaa_event_obj.weekday_sunday || idaa_event_obj.weekday_monday || idaa_event_obj.weekday_tuesday || idaa_event_obj.weekday_wednesday || idaa_event_obj.weekday_thursday || idaa_event_obj.weekday_friday || idaa_event_obj.weekday_saturday} + + + {#if idaa_event_obj.weekday_sunday}Sunday{/if} + {#if idaa_event_obj.weekday_monday}Monday{/if} + {#if idaa_event_obj.weekday_tuesday}Tuesday{/if} + {#if idaa_event_obj.weekday_wednesday}Wednesday{/if} + {#if idaa_event_obj.weekday_thursday}Thursday{/if} + {#if idaa_event_obj.weekday_friday}Friday{/if} + {#if idaa_event_obj.weekday_saturday}Saturday{/if} + + {/if} + + {#if idaa_event_obj.recurring_start_time} + + {ae.util.iso_datetime_formatter(`2023-01-01 ${idaa_event_obj.recurring_start_time}`, 'time_short')} + {/if} + {#if idaa_event_obj.timezone} + + ({idaa_event_obj.timezone}) + {:else} +
Required: No timezone was given!
+ {/if} +
+ +
+ + {#if idaa_event_obj.contact_li_json && idaa_event_obj.contact_li_json.length && idaa_event_obj.contact_li_json[0].full_name} +
+ + Contact: + + {idaa_event_obj.contact_li_json[0].full_name} + {#if idaa_event_obj.contact_li_json[0].email} + | {idaa_event_obj.contact_li_json[0].email} + {/if} + {#if idaa_event_obj.contact_li_json[0].phone_mobile} + | Mobile: + {idaa_event_obj.contact_li_json[0].phone_mobile} + {/if} + {#if idaa_event_obj.contact_li_json[0].phone_home} + | Home: + {idaa_event_obj.contact_li_json[0].phone_home} + {/if} + {#if idaa_event_obj.contact_li_json[0].phone_office} + | Office: + {idaa_event_obj.contact_li_json[0].phone_office} + {/if} + {#if idaa_event_obj.contact_li_json[0].other_text}| {idaa_event_obj.contact_li_json[0].other_text}{/if} +
+ {:else} + {#if $ae_app.trusted_access} +
+ ALERT: The primary contact information may be missing? This meeting should be checked and updated. Please Edit and Save to use the new format. + +
+ {/if} + {/if} + + {#if idaa_event_obj.contact_li_json && idaa_event_obj.contact_li_json.length && idaa_event_obj.contact_li_json[1].full_name} +
+ + Contact: + + {idaa_event_obj.contact_li_json[1].full_name} + {#if idaa_event_obj.contact_li_json[1].email} + | {idaa_event_obj.contact_li_json[1].email} + {/if} + {#if idaa_event_obj.contact_li_json[1].phone_mobile} + | Mobile: + {idaa_event_obj.contact_li_json[1].phone_mobile} + {/if} + {#if idaa_event_obj.contact_li_json[1].phone_home} + | Home: + {idaa_event_obj.contact_li_json[1].phone_home} + {/if} + {#if idaa_event_obj.contact_li_json[1].phone_office} + | Office: + {idaa_event_obj.contact_li_json[1].phone_office} + {/if} + {#if idaa_event_obj.contact_li_json[0].other_text}| {idaa_event_obj.contact_li_json[0].other_text}{/if} +
+ {/if} + {#if $ae_app.trusted_access} + {#if (idaa_event_obj.contact_li_json && idaa_event_obj.contact_li_json.length && !idaa_event_obj.contact_li_json[0].full_name)} +
Required: No primary contact information was found!
+ {/if} + {#if !idaa_event_obj.external_person_id} +
Warning: Not linked to a Novi record!
+ {/if} + {/if} +
+ +
+ + + {#if $ae_app.administrator_access} + + {/if} +
+{/each} + +{:else} + {#if $ae_app.events.qry_status === 'loading'} +
Loading...
+ {:else} +
No recovery meetings avalible to show. The search may need to be changed.
+ {/if} +{/if} +
+ + + diff --git a/src/routes/idaa/(idaa)/recovery_meetings/10_view__event_obj.svelte b/src/routes/idaa/(idaa)/recovery_meetings/10_view__event_obj.svelte new file mode 100644 index 00000000..d18ff01d --- /dev/null +++ b/src/routes/idaa/(idaa)/recovery_meetings/10_view__event_obj.svelte @@ -0,0 +1,392 @@ + + + +
+ + + +
+
+
Description:
+
{@html $slct.event_obj.description}
+
+ +
+ Type of Recovery Meeting: + {$slct.event_obj.type} +
+ +
+ +
+
+ Address: +
+ {#if $slct.event_obj.location_address_json} + + {#if $slct.event_obj.physical} + {#if $slct.event_obj.location_address_json.name}{$slct.event_obj.location_address_json.name}
{/if} + {#if $slct.event_obj.location_address_json.line_1}{$slct.event_obj.location_address_json.line_1}
{/if} + {#if $slct.event_obj.location_address_json.line_2}{$slct.event_obj.location_address_json.line_2}
{/if} + {#if $slct.event_obj.location_address_json.line_3}{$slct.event_obj.location_address_json.line_3}
{/if} + {/if} + {#if $slct.event_obj.location_address_json.city}{$slct.event_obj.location_address_json.city}, {/if} + {#if $slct.event_obj.location_address_json.state_province}{$slct.event_obj.location_address_json.state_province}{/if} + {#if $slct.event_obj.physical} + {#if $slct.event_obj.location_address_json.postal_code}{$slct.event_obj.location_address_json.postal_code}{/if} + {/if} + {#if $slct.event_obj.location_address_json.country} +
+ {$slct.event_obj.location_address_json.country} + {/if} + + {:else} + + {#if $slct.event_obj.physical} + {#if $slct.event_obj.address_name}{$slct.event_obj.address_name}
{/if} + {#if $slct.event_obj.address_line_1}{$slct.event_obj.address_line_1}
{/if} + {#if $slct.event_obj.address_line_2}{$slct.event_obj.address_line_2}
{/if} + {#if $slct.event_obj.address_line_3}{$slct.event_obj.address_line_3}
{/if} + {/if} + {#if $slct.event_obj.address_city}{$slct.event_obj.address_city}, {/if} + {#if $slct.event_obj.address_country_subdivision_name}{$slct.event_obj.address_country_subdivision_name}{/if} + {#if $slct.event_obj.physical} + {#if $slct.event_obj.address_postal_code}{$slct.event_obj.address_postal_code}{/if} + {/if} + {#if $slct.event_obj.address_country_name} +
+ {$slct.event_obj.address_country_name} + {/if} + + {/if} +
+ {#if $slct.event_obj.physical} +
+ Additional information: {@html $slct.event_obj.location_text} +
+ {/if} +
+
+ +
+
+ + + URL: + + + {$slct.event_obj.attend_url} + + + + Passcode: + + + {$slct.event_obj.attend_url_passcode} + +
+
+ + + Phone: + + + {$slct.event_obj.attend_phone} + + + + Passcode: + + + {$slct.event_obj.attend_phone_passcode} + +
+
+ Additional information: {@html $slct.event_obj.attend_text} +
+
+ +
+ +
+ +
+
+ + + Frequency: + + {#if $slct.event_obj.recurring_pattern == 'weekly'}Weekly + {:else if $slct.event_obj.recurring_pattern == 'monthly'}Monthly + {:else if $slct.event_obj.recurring_pattern == 'every other week'}Every Other Week + {:else if $slct.event_obj.recurring_pattern == 'other'}Other + {/if} + {#if $slct.event_obj.recurring_text && $slct.event_obj.recurring_text.length > 0} + {#if $slct.event_obj.recurring_text.includes('*gen*') && $ae_app.administrator_access} + {@html $slct.event_obj.recurring_text} + {:else if (!$slct.event_obj.recurring_text.includes('*gen*'))} + {@html $slct.event_obj.recurring_text} + {/if} + + {/if} +
+
+ + + Days of week: + + {#if $slct.event_obj.weekday_sunday}Sunday{/if} + {#if $slct.event_obj.weekday_monday}Monday{/if} + {#if $slct.event_obj.weekday_tuesday}Tuesday{/if} + {#if $slct.event_obj.weekday_wednesday}Wednesday{/if} + {#if $slct.event_obj.weekday_thursday}Thursday{/if} + {#if $slct.event_obj.weekday_friday}Friday{/if} + {#if $slct.event_obj.weekday_saturday}Saturday{/if} +
+
+ {#if $slct.event_obj.recurring_start_time} + + + Start time: + + {ae.util.iso_datetime_formatter(`2024-01-01 ${$slct.event_obj.recurring_start_time}`, 'time_short')} + + + - + End time: + {ae.util.iso_datetime_formatter(`2024-01-01 ${$slct.event_obj.recurring_end_time}`, 'time_short')} + + + + + - + Timezone: + {$slct.event_obj.timezone} + + + {#if $slct.event_obj.timezone} + + ( + Your TZ: + + {dayjs.tz(`${$ae_app.current_date_str} ${$slct.event_obj.recurring_start_time}`, $slct.event_obj.timezone).tz($ae_app.current_timezone).format('hh:mm A')} {$ae_app.current_timezone} + + ) + + {/if} + {:else} + No times set + {/if} + + + + +
+
+ +
+ + +
+ + {#if $slct.event_obj.contact_li_json && $slct.event_obj.contact_li_json.length && $slct.event_obj.contact_li_json[0].full_name} +
+ + Contact: + + {$slct.event_obj.contact_li_json[0].full_name} + {#if $slct.event_obj.contact_li_json[0].email} + | {$slct.event_obj.contact_li_json[0].email} + {/if} + {#if $slct.event_obj.contact_li_json[0].phone_mobile} + | Mobile: + {$slct.event_obj.contact_li_json[0].phone_mobile} + {/if} + {#if $slct.event_obj.contact_li_json[0].phone_home} + | Home: + {$slct.event_obj.contact_li_json[0].phone_home} + {/if} + {#if $slct.event_obj.contact_li_json[0].phone_office} + | Office: + {$slct.event_obj.contact_li_json[0].phone_office} + {/if} + {#if $slct.event_obj.contact_li_json[0].other_text}| {$slct.event_obj.contact_li_json[0].other_text}{/if} +
+ {/if} + + {#if $slct.event_obj.contact_li_json && $slct.event_obj.contact_li_json.length && $slct.event_obj.contact_li_json[1].full_name} +
+ + Contact: + + {$slct.event_obj.contact_li_json[1].full_name} + {#if $slct.event_obj.contact_li_json[1].email} + | {$slct.event_obj.contact_li_json[1].email} + {/if} + {#if $slct.event_obj.contact_li_json[1].phone_mobile} + | Mobile: + {$slct.event_obj.contact_li_json[1].phone_mobile} + {/if} + {#if $slct.event_obj.contact_li_json[1].phone_home} + | Home: + {$slct.event_obj.contact_li_json[1].phone_home} + {/if} + {#if $slct.event_obj.contact_li_json[1].phone_office} + | Office: + {$slct.event_obj.contact_li_json[1].phone_office} + {/if} + {#if $slct.event_obj.contact_li_json[1].other_text}| {$slct.event_obj.contact_li_json[1].other_text}{/if} +
+ {/if} + +
+ +
+
+ + ID: + {$slct.event_obj.event_id_random} + + + Created on: {ae.util.iso_datetime_formatter($slct.event_obj.created_on, 'datetime_short')} + + + Updated on: {ae.util.iso_datetime_formatter($slct.event_obj.updated_on, 'datetime_short')} + +
+ + {#if $ae_app.trusted_access || $slct.event_obj.external_person_id === $ae_app.novi_uuid || $slct.event_obj.contact_li_json[0].email === $ae_app.novi_email} +
+ +
+ {/if} +
+ +
+ +
+ + + diff --git a/src/routes/idaa/(idaa)/stores.ts b/src/routes/idaa/(idaa)/stores.ts new file mode 100644 index 00000000..d85c514c --- /dev/null +++ b/src/routes/idaa/(idaa)/stores.ts @@ -0,0 +1,196 @@ +import { readable, writable } from 'svelte/store'; +// console.log('*** stores.ts ***'); + +/* FAKE TESTING DATA */ + +let fake_app_base_url = 'https://dev-app.oneskyit.com'; +let fake_app_base_url_backup = 'https://bak-app.oneskyit.com'; +let fake_api_base_url = 'https://dev-api.oneskyit.com'; +let fake_api_base_url_backup = 'https://bak-api.oneskyit.com'; +let fake_api_secret_key = 'dFP6J9DVj9hUgIMn-fNIqg'; +let fake_ae_account_id = 'Q8lR8Ai8hx2FjbQ3C_EH1Q'; // IDAA Q8lR8Ai8hx2FjbQ3C_EH1Q (13) +let fake_ae_api_jwt_key="EHmSXZFKfMEW65E8kxCKmQ" // 22 characters; super secret Aether JWT signing key + +let fake_api_temporary_token = ''; + +let fake_access_type = 'anonymous'; +let fake_administrator_access: boolean = false; +let fake_trusted_access: boolean = false; + +/* FAKE TESTING DATA */ + +type key_val = { + [key: string]: any; // variable key + // name: string; +}; + +export const account_id = fake_ae_account_id; + +let ae_cfg_data: key_val = {}; + +// NOTE: This API CRUD super key thing being here should be short term! -2023-05-02 + +ae_cfg_data['api'] = {}; +ae_cfg_data['app'] = {}; + +// ae_cfg_data['api']['api_crud_super_key'] = 'zp5PtX4zUsI'; + +let ae_api_cfg_data: key_val = {}; +if (api_base_url) { + ae_api_cfg_data['base_url'] = api_base_url; +} else { + console.log(`WARNING: api_base_url not set. Using fake_api_base_url: ${fake_api_base_url}`); + ae_api_cfg_data['base_url'] = fake_api_base_url; +} +if (api_base_url_backup) { + ae_api_cfg_data['base_url_backup'] = api_base_url_backup; +} else { + console.log(`WARNING: api_base_url_backup not set. Using fake_api_base_url_backup: ${fake_api_base_url_backup}`); + ae_api_cfg_data['base_url_backup'] = fake_api_base_url_backup; +} + +ae_api_cfg_data['api_crud_super_key'] = 'zp5PtX4zUsI'; + +ae_api_cfg_data['headers'] = {}; +ae_api_cfg_data['headers']['Access-Control-Allow-Origin'] = '*'; +ae_api_cfg_data['headers']['content-type'] = 'application/json'; +ae_api_cfg_data['headers']['x-aether-api-key'] = fake_api_secret_key; +ae_api_cfg_data['headers']['x-aether-api-token'] = 'fake-temp-token'; +ae_api_cfg_data['headers']['x-aether-api-expire-on'] = ''; +ae_api_cfg_data['headers']['x-account-id'] = fake_ae_account_id; + +console.log(`Aether API Config Data:`, ae_api_cfg_data); + +ae_cfg_data['api']['headers'] = ae_api_cfg_data['headers']; + +let ae_app_cfg_data: key_val = {}; +if (app_base_url) { + ae_app_cfg_data['base_url'] = app_base_url; +} else { + console.log(`WARNING: app_base_url not set. Using fake_app_base_url: ${fake_app_base_url}`); + ae_app_cfg_data['base_url'] = fake_app_base_url; +} +ae_cfg_data['app'] = ae_app_cfg_data; + +console.log(`All Aether App and API Config Data:`, ae_cfg_data); +window.localStorage.setItem('ae_cfg', JSON.stringify(ae_cfg_data)); // Also set in main HTML template files +export const ae_cfg = readable(ae_cfg_data); + + + +/* *** BEGIN *** Initialize slct variable */ +// Updated 2023-11-01 +export let slct_trigger: any = writable(null); +let slct_obj_template: key_val = { 'event_id': null, 'event_obj': {}, 'post_id': null, 'post_obj': {}, 'post_obj_li': [], 'post_comment_id': null, 'post_comment_obj': {}, 'post_comment_obj_li': [] }; +export let slct = writable(slct_obj_template); + +let novi_api_cfg_data: key_val = {}; + + +/* *** BEGIN *** Initialize IDAA app structure variable (JS object) */ +// Updated 2023-11-01 +let ae_app_data_version = .5; + +let ae_app_struct: key_val = { + 'ver': ae_app_data_version, + 'app': ae_cfg_data.app, // Includes AE app base_url {'base_url': ae_cfg_data.app.base_url}, + 'ae_api': ae_api_cfg_data, // Includes the AE API headers + 'novi_api': novi_api_cfg_data, // Includes the Novi API headers + + 'access_type': fake_access_type, + 'administrator_access': fake_administrator_access, + 'trusted_access': fake_trusted_access, + + 'account_id': account_id, + + // YYYY-MM-DD string of the current date + 'current_date_str': new Date().toISOString().slice(0, 10), + + 'novi_uuid': null, + 'novi_email': null, + 'novi_full_name': null, + 'novi_admin_li': [], + + // Module - Archives (IDAA Archives) + 'archives':{ + // 'show_start_new_view_help': true, // getting ready to start new submission + // 'show_active_submission_view_help': true, // started in progress submission + // 'show_grant_list': false, + + 'show_archive_new_form': false, + 'show_archive_content_new_form': false, + 'show_archive_content_view': false, + 'show_archive_content_crud': false, + 'show_archive_content_crud_new': false, + 'show_list__archive_content_li_group': null, + + // all, disabled, enabled + 'enabled': 'enabled', // all or nothing... easier for now + + // all, hidden, not_hidden + 'hidden': 'not_hidden', // all or nothing... easier for now + + 'limit': 250, // all or nothing... easier for now + 'offset': 0, // all or nothing... easier for now + 'archive_group_sort': 'ASC', // ASC or DESC + 'content_group_sort': 'ASC', // ASC or DESC + + 'archive_id': null, + 'archive_content_id': null, + + 'ds':{}, + }, + + // Module - Events (IDAA Recovery Meetings) + 'events':{ + 'show_event_id_view': false, + 'show_event_id_edit': false, + + 'filter_meeting_type': 'all', // all, idaa, al-anon + 'filter_meeting_group': 'all', // all, in-person, virtual + 'filter_location': 'all', // all, something something + + // all, disabled, enabled + 'enabled': 'enabled', // all or nothing... easier for now + + // all, hidden, not_hidden + 'hidden': 'not_hidden', // all or nothing... easier for now + + 'limit': 250, // all or nothing... easier for now + 'offset': 0, // all or nothing... easier for now + + 'event_id': null, + + 'ds':{}, + }, + + // Module - Posts (IDAA Support BB) + 'posts':{ + 'show_post_new_form': false, + 'show_post_comment_new_form': false, + 'show_view__post_id': false, + 'show_post_comment_crud': false, + + 'show_post_comment_list': true, + + // all, disabled, enabled + 'enabled': 'enabled', // all or nothing... easier for now + + // all, hidden, not_hidden + 'hidden': 'not_hidden', // all or nothing... easier for now + + 'limit': 250, // all or nothing... easier for now + 'offset': 0, // all or nothing... easier for now + + 'post_id': null, + 'post_comment_id': null, + + 'ds':{}, + }, + + 'ds':{}, + + 'testing': null +} +export let ae_app = writable(ae_app_struct); +console.log(ae_app); diff --git a/src/routes/idaa/(idaa)/stores_ae_api.js b/src/routes/idaa/(idaa)/stores_ae_api.js new file mode 100644 index 00000000..4a0da48e --- /dev/null +++ b/src/routes/idaa/(idaa)/stores_ae_api.js @@ -0,0 +1,40 @@ +console.log('*** stores_data_store_api.js Stores ***'); +import { get } from 'svelte/store'; +import { ae_app } from './stores'; +import { api } from 'aether_npm_lib'; + + +/* BEGIN: IDAA Recover Meetings Related */ +export let get_account_event_obj_list = async function get_account_event_obj_list({account_id, enabled='enabled', hidden='not_hidden', limit=100, params={}, timeout=50000, log_lvl=0}) { + console.log('*** stores_meetings_api.js: get_account_event_obj_list() ***'); + + const endpoint = `/account/${account_id}/event/meeting_list_flat`; + + let allowed_enabled_list = ['all', 'enabled', 'not_enabled'] + if (allowed_enabled_list.includes(enabled) ) { + params['enabled'] = enabled; + } + + let allowed_hidden_list = ['all', 'hidden', 'not_hidden']; + if (allowed_hidden_list.includes(hidden) ) { + params['hidden'] = hidden; + } + + if (limit) { + params['limit'] = limit; + } + + let event_obj_list_get_promise = await api.get_object({api_cfg: get(ae_app).ae_api, endpoint: endpoint, params: params, timeout: timeout, log_lvl: log_lvl}); + + // if (event_obj_list_get_promise === false) { + // console.log('Event - RUN AGAIN WITH BACKUP'); + + // let temp_api = get(cfg).api; + // temp_api['base_url'] = temp_api['base_url_backup'] + + // event_obj_list_get_promise = await api.get_object({api_cfg: temp_api, endpoint: endpoint, params: params, timeout: timeout, log_lvl: log_lvl}); + // } + + let event_obj_list = event_obj_list_get_promise; + return event_obj_list; +}