Starting a new template using Svelte, SvelteKit, Tailwind, and Skeleton.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[Dolphin]
|
||||
Timestamp=2024,2,6,18,10,21.847
|
||||
Timestamp=2024,2,15,9,41,31.242
|
||||
Version=4
|
||||
ViewMode=1
|
||||
|
||||
|
||||
13
.eslintignore
Normal file
13
.eslintignore
Normal file
@@ -0,0 +1,13 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Ignore files for PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
31
.eslintrc.cjs
Normal file
31
.eslintrc.cjs
Normal file
@@ -0,0 +1,31 @@
|
||||
/** @type { import("eslint").Linter.Config } */
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:svelte/recommended',
|
||||
'prettier'
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint'],
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 2020,
|
||||
extraFileExtensions: ['.svelte']
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
es2017: true,
|
||||
node: true
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.svelte'],
|
||||
parser: 'svelte-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
35
.gitignore
vendored
35
.gitignore
vendored
@@ -1,27 +1,10 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.bak
|
||||
*.tar.gz
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
|
||||
4
.prettierignore
Normal file
4
.prettierignore
Normal file
@@ -0,0 +1,4 @@
|
||||
# Ignore files for PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
8
.prettierrc
Normal file
8
.prettierrc
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"useTabs": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100,
|
||||
"plugins": ["prettier-plugin-svelte"],
|
||||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||
}
|
||||
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"recommendations": ["svelte.svelte-vscode"]
|
||||
}
|
||||
120
.vscode/settings.json
vendored
Normal file
120
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
{
|
||||
"prettier.documentSelectors": [
|
||||
"**/*.svelte"
|
||||
],
|
||||
"tailwindCSS.classAttributes": [
|
||||
"class",
|
||||
"accent",
|
||||
"active",
|
||||
"animIndeterminate",
|
||||
"aspectRatio",
|
||||
"background",
|
||||
"badge",
|
||||
"bgBackdrop",
|
||||
"bgDark",
|
||||
"bgDrawer",
|
||||
"bgLight",
|
||||
"blur",
|
||||
"border",
|
||||
"button",
|
||||
"buttonAction",
|
||||
"buttonBack",
|
||||
"buttonClasses",
|
||||
"buttonComplete",
|
||||
"buttonDismiss",
|
||||
"buttonNeutral",
|
||||
"buttonNext",
|
||||
"buttonPositive",
|
||||
"buttonTextCancel",
|
||||
"buttonTextConfirm",
|
||||
"buttonTextFirst",
|
||||
"buttonTextLast",
|
||||
"buttonTextNext",
|
||||
"buttonTextPrevious",
|
||||
"buttonTextSubmit",
|
||||
"caretClosed",
|
||||
"caretOpen",
|
||||
"chips",
|
||||
"color",
|
||||
"controlSeparator",
|
||||
"controlVariant",
|
||||
"cursor",
|
||||
"display",
|
||||
"element",
|
||||
"fill",
|
||||
"fillDark",
|
||||
"fillLight",
|
||||
"flex",
|
||||
"flexDirection",
|
||||
"gap",
|
||||
"gridColumns",
|
||||
"height",
|
||||
"hover",
|
||||
"inactive",
|
||||
"indent",
|
||||
"justify",
|
||||
"meter",
|
||||
"padding",
|
||||
"position",
|
||||
"regionAnchor",
|
||||
"regionBackdrop",
|
||||
"regionBody",
|
||||
"regionCaption",
|
||||
"regionCaret",
|
||||
"regionCell",
|
||||
"regionChildren",
|
||||
"regionChipList",
|
||||
"regionChipWrapper",
|
||||
"regionCone",
|
||||
"regionContent",
|
||||
"regionControl",
|
||||
"regionDefault",
|
||||
"regionDrawer",
|
||||
"regionFoot",
|
||||
"regionFootCell",
|
||||
"regionFooter",
|
||||
"regionHead",
|
||||
"regionHeadCell",
|
||||
"regionHeader",
|
||||
"regionIcon",
|
||||
"regionInput",
|
||||
"regionInterface",
|
||||
"regionInterfaceText",
|
||||
"regionLabel",
|
||||
"regionLead",
|
||||
"regionLegend",
|
||||
"regionList",
|
||||
"regionListItem",
|
||||
"regionNavigation",
|
||||
"regionPage",
|
||||
"regionPanel",
|
||||
"regionRowHeadline",
|
||||
"regionRowMain",
|
||||
"regionSummary",
|
||||
"regionSymbol",
|
||||
"regionTab",
|
||||
"regionTrail",
|
||||
"ring",
|
||||
"rounded",
|
||||
"select",
|
||||
"shadow",
|
||||
"slotDefault",
|
||||
"slotFooter",
|
||||
"slotHeader",
|
||||
"slotLead",
|
||||
"slotMessage",
|
||||
"slotMeta",
|
||||
"slotPageContent",
|
||||
"slotPageFooter",
|
||||
"slotPageHeader",
|
||||
"slotSidebarLeft",
|
||||
"slotSidebarRight",
|
||||
"slotTrail",
|
||||
"spacing",
|
||||
"text",
|
||||
"track",
|
||||
"transition",
|
||||
"width",
|
||||
"zIndex"
|
||||
]
|
||||
}
|
||||
40
README.md
40
README.md
@@ -1,2 +1,38 @@
|
||||
# OSIT AE - Sponsorships App (Svelte)
|
||||
This was created for One Sky IT's Aether system.
|
||||
# create-svelte
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
|
||||
|
||||
## Creating a project
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
|
||||
```bash
|
||||
# create a new project in the current directory
|
||||
npm create svelte@latest
|
||||
|
||||
# create a new project in my-app
|
||||
npm create svelte@latest my-app
|
||||
```
|
||||
|
||||
## Developing
|
||||
|
||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
|
||||
# or start the server and open the app in a new browser tab
|
||||
npm run dev -- --open
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To create a production version of your app:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
49
index.html
49
index.html
@@ -1,49 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<!-- Load dayjs library: https://cdnjs.com/libraries/dayjs -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.11.10/dayjs.min.js" integrity="sha512-FwNWaxyfy2XlEINoSnZh1JQ5TRRtGow0D6XcmAWmYCRgvqOUTnzCxPc9uF35u5ZEpirk1uhlPVA19tflhvnW1g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.11.10/plugin/utc.min.js" integrity="sha512-z84O912dDT9nKqvpBnl1tri5IN0j/OEgMzLN1GlkpKLMscs5ZHVu+G2CYtA6dkS0YnOGi3cODt3BOPnYc8Agjg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.11.10/plugin/timezone.min.js" integrity="sha512-jmsGNYDezdyZ+W3bVeZy83kZp/2n5BgWe/0solkveG0vSSrP9XIVTD1tNiM1OqImc4H3OxHfs1uSfVclOU3mWw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://static.oneskyit.com/js/tinymce/tinymce.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<!-- <link rel="stylesheet" href="/src/main.css" /> -->
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Æ AE App (The Hub) - Sponsorships - Vite + Svelte + TS</title>
|
||||
<script>
|
||||
let api_base_url = 'https://dev-api.oneskyit.com';
|
||||
let api_base_url_backup = 'https://bak-api.oneskyit.com';
|
||||
let app_base_url = 'https://dev-demo.oneskyit.com';
|
||||
let app_base_url_backup = 'https://bak-demo.oneskyit.com';
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section id="Site-Header">Site-Header</section>
|
||||
<section id="Site-Nav-Menu"></section>
|
||||
<!-- <section id="Notifications">Notifications</section> -->
|
||||
|
||||
<div class="svelte_target ae_svelte_app ae_sponsorships_main"></div>
|
||||
|
||||
<section id="Site-Set-Access-Type" class="svelte_target set_access_type"></section>
|
||||
|
||||
<section id="Site-Footer">Site-Footer</section>
|
||||
|
||||
<section id="Site-Modals"><!-- Site-Modals --></section>
|
||||
|
||||
<div class="svelte_target ae_svelte_app_hub"></div>
|
||||
|
||||
<!-- The ae_bridge_init.js and main.ts should be run back to back -->
|
||||
<script src="/ae_bridge_init.js"></script>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
3560
package-lock.json
generated
3560
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
53
package.json
53
package.json
@@ -1,26 +1,51 @@
|
||||
{
|
||||
"name": "ae_sponsorships_app_svelte",
|
||||
"private": true,
|
||||
"name": "ae-app-svelte-tailwind-skeleton",
|
||||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||
"test": "npm run test:integration && npm run test:unit",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"lint": "prettier --check . && eslint .",
|
||||
"format": "prettier --write .",
|
||||
"test:integration": "playwright test",
|
||||
"test:unit": "vitest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-static": "^3.0.1",
|
||||
"@playwright/test": "^1.28.1",
|
||||
"@sveltejs/adapter-auto": "^3.0.0",
|
||||
"@sveltejs/kit": "^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
||||
"@tsconfig/svelte": "^5.0.0",
|
||||
"svelte": "^4.2.8",
|
||||
"@types/eslint": "8.56.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-svelte": "^2.35.1",
|
||||
"prettier": "^3.1.1",
|
||||
"prettier-plugin-svelte": "^3.1.2",
|
||||
"svelte": "^4.2.7",
|
||||
"svelte-check": "^3.6.0",
|
||||
"tslib": "^2.6.0",
|
||||
"typescript": "^5.3.0",
|
||||
"vite": "^5.0.0"
|
||||
"tslib": "^2.4.1",
|
||||
"typescript": "^5.0.0",
|
||||
"vite": "^5.0.3",
|
||||
"vitest": "^1.2.0",
|
||||
"postcss": "8.4.35",
|
||||
"autoprefixer": "10.4.17",
|
||||
"tailwindcss": "3.4.1",
|
||||
"@skeletonlabs/skeleton": "2.8.0",
|
||||
"@skeletonlabs/tw-plugin": "0.3.1",
|
||||
"vite-plugin-tailwind-purgecss": "0.2.0",
|
||||
"@tailwindcss/typography": "0.5.10",
|
||||
"@tailwindcss/forms": "0.5.7",
|
||||
"@types/node": "20.11.18"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"aether_npm_lib": "bitbucket:oneskyit/one-sky-it-npm-library",
|
||||
"axios": "^1.6.0"
|
||||
"highlight.js": "11.9.0",
|
||||
"@floating-ui/dom": "1.6.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
12
playwright.config.ts
Normal file
12
playwright.config.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||
|
||||
const config: PlaywrightTestConfig = {
|
||||
webServer: {
|
||||
command: 'npm run build && npm run preview',
|
||||
port: 4173
|
||||
},
|
||||
testDir: 'tests',
|
||||
testMatch: /(.+\.)?(test|spec)\.[jt]s/
|
||||
};
|
||||
|
||||
export default config;
|
||||
6
postcss.config.cjs
Normal file
6
postcss.config.cjs
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
|
||||
// These localStorage values were created when generating the HTML
|
||||
|
||||
// let ae_local = window.localStorage.getItem('ae'); // Includes: cfg, client, page, other
|
||||
// let ae_session = window.sessionStorage.getItem('ae'); // Includes: cfg, client, page, other
|
||||
// let ae_com_local = window.localStorage.getItem('ae_com');
|
||||
// let ae_com_session = window.sessionStorage.getItem('ae_com');
|
||||
|
||||
if (window.localStorage.getItem('ae') === null) {
|
||||
window.localStorage.setItem('ae', JSON.stringify({ 'cfg': {}, 'client': {}, 'page': {}, 'other': {}, 'test': {} }));
|
||||
}
|
||||
|
||||
if (window.sessionStorage.getItem('ae') === null) {
|
||||
window.sessionStorage.setItem('ae', JSON.stringify({ 'cfg': {}, 'client': {}, 'page': {}, 'other': {}, 'test': {} }));
|
||||
}
|
||||
// JSON.parse(window.sessionStorage.getItem('ae'))
|
||||
|
||||
// export let ae_bridge = {
|
||||
const ae_bridge = {
|
||||
// example_var: 'Example Default Value',
|
||||
// get example() {
|
||||
// return this.example_var;
|
||||
// },
|
||||
// set example(new_value) {
|
||||
// this.example_var = new_value;
|
||||
// this.example_var_listener(new_value);
|
||||
// this.example_var_core_listener(new_value);
|
||||
// this.example_var_mods_listener(new_value);
|
||||
// },
|
||||
|
||||
// example_var_listener: function (new_value) {},
|
||||
// registerNewListener: function (external_listener_function) {
|
||||
// this.example_var_listener = external_listener_function;
|
||||
// },
|
||||
|
||||
// example_var_core_listener: function (new_value) {},
|
||||
// registerNewCoreListener: function (external_core_listener_function) {
|
||||
// this.example_var_core_listener = external_core_listener_function;
|
||||
// },
|
||||
|
||||
// example_var_mods_listener: function (new_value) {},
|
||||
// registerNewModsListener: function (external_mods_listener_function) {
|
||||
// this.example_var_mods_listener = external_mods_listener_function;
|
||||
// },
|
||||
|
||||
|
||||
// Monitor change in **local** storage AE
|
||||
// Created and set when generating and then rendering the inital HTML and JS
|
||||
// ae_local_var: true,
|
||||
ae_local_var: JSON.parse(window.localStorage.getItem('ae')),
|
||||
get ae_local() {
|
||||
return this.ae_local_var;
|
||||
},
|
||||
set ae_local(new_value) {
|
||||
console.log('ae_local_var: new_value: ', new_value);
|
||||
this.ae_local_var = new_value;
|
||||
this.ae_local_listener(new_value);
|
||||
window.localStorage.setItem('ae', new_value);
|
||||
},
|
||||
|
||||
ae_local_listener: function (new_value) {},
|
||||
register_ae_local_listener: function (external_listener_function) {
|
||||
this.ae_local_listener = external_listener_function;
|
||||
},
|
||||
|
||||
|
||||
// Monitor change in **session* storage AE
|
||||
// Created and set when generating and then rendering the inital HTML and JS
|
||||
// ae_session_var: true,
|
||||
// ae_session_var: JSON.parse((window.sessionStorage.getItem('ae') ? window.sessionStorage.getItem('ae') : {'cfg': true, 'client': true, 'page': true, 'other': true})),
|
||||
// ae_session_var: {'example': 'This is just an example from init.js!'},
|
||||
ae_session_var: JSON.parse(window.sessionStorage.getItem('ae')),
|
||||
get ae_session() {
|
||||
return this.ae_session_var;
|
||||
},
|
||||
set ae_session(new_value) {
|
||||
console.log('ae_session_var: new_value: ', new_value);
|
||||
this.ae_session_var = new_value;
|
||||
this.ae_session_listener(new_value);
|
||||
window.sessionStorage.setItem('ae', new_value);
|
||||
},
|
||||
|
||||
ae_session_listener: function (new_value) {},
|
||||
register_ae_session_listener: function (external_listener_function) {
|
||||
this.ae_session_listener = external_listener_function;
|
||||
},
|
||||
|
||||
|
||||
// Monitor change in Access Type
|
||||
access_type_var: 'anonymous',
|
||||
get access_type() {
|
||||
return this.access_type_var;
|
||||
},
|
||||
set access_type(new_value) {
|
||||
this.access_type_var = new_value;
|
||||
this.access_type_var_core_listener(new_value);
|
||||
this.access_type_var_mods_listener(new_value);
|
||||
},
|
||||
|
||||
access_type_var_core_listener: function (new_value) {},
|
||||
register_core_access_type_listener: function (external_core_listener_function) {
|
||||
this.access_type_var_core_listener = external_core_listener_function;
|
||||
},
|
||||
|
||||
access_type_var_mods_listener: function (new_value) {},
|
||||
register_mods_access_type_listener: function (external_mods_listener_function) {
|
||||
this.access_type_var_mods_listener = external_mods_listener_function;
|
||||
},
|
||||
|
||||
|
||||
// Monitor change in AE Common
|
||||
// ae_com_var: true,
|
||||
ae_com_var: JSON.parse(window.localStorage.getItem('ae_com')),
|
||||
get ae_com() {
|
||||
return this.ae_com_var;
|
||||
},
|
||||
set ae_com(new_value) {
|
||||
this.ae_com_var = new_value;
|
||||
this.ae_com_var_core_listener(new_value);
|
||||
this.ae_com_var_mods_listener(new_value);
|
||||
},
|
||||
|
||||
ae_com_var_core_listener: function (new_value) {},
|
||||
register_core_ae_com_listener: function (external_core_listener_function) {
|
||||
this.ae_com_var_core_listener = external_core_listener_function;
|
||||
},
|
||||
|
||||
ae_com_var_mods_listener: function (new_value) {},
|
||||
register_mods_ae_com_listener: function (external_mods_listener_function) {
|
||||
this.ae_com_var_mods_listener = external_mods_listener_function;
|
||||
},
|
||||
|
||||
|
||||
// Monitor change in Client
|
||||
client_var: true,
|
||||
get client() {
|
||||
return this.client_var;
|
||||
},
|
||||
set client(new_value) {
|
||||
this.client_var = new_value;
|
||||
this.client_var_core_listener(new_value);
|
||||
this.client_var_mods_listener(new_value);
|
||||
},
|
||||
|
||||
client_var_core_listener: function (new_value) {},
|
||||
register_core_client_listener: function (external_core_listener_function) {
|
||||
this.client_var_core_listener = external_core_listener_function;
|
||||
},
|
||||
|
||||
client_var_mods_listener: function (new_value) {},
|
||||
register_mods_client_listener: function (external_mods_listener_function) {
|
||||
this.client_var_mods_listener = external_mods_listener_function;
|
||||
},
|
||||
|
||||
};
|
||||
console.log('ae_bridge_init.js loaded');
|
||||
|
||||
|
||||
// Updated: 2024-02-09
|
||||
/* BEGIN: Add this to the stores.ts */
|
||||
// This adds a listener to the ae_bridge object. This can then be exported and used in the Svelte components.
|
||||
// export let ae_example = writable(ae_bridge.ae_example);
|
||||
// ae_bridge.register_ae_example_listener((new_value) => {
|
||||
// console.log(`AE Bridge: AE Example: ${new_value}`);
|
||||
// console.log(new_value);
|
||||
|
||||
// ae_example.set(new_value);
|
||||
// console.log(ae_example);
|
||||
// });
|
||||
/* END: Add this to the stores.ts */
|
||||
|
||||
|
||||
/* BEGIN: Add this to the Svelte components */
|
||||
// import { ae_example } from './stores';
|
||||
/* END: Add this to the Svelte components */
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,617 +0,0 @@
|
||||
<script lang="ts">
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
// *** Import Svelte core
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
import { ae, api, Element_modal_v3 } from 'aether_npm_lib';
|
||||
|
||||
import { slct, slct_trigger, ae_app } from './stores';
|
||||
|
||||
// *** Import Aether core components
|
||||
// import { get_data_store_obj_w_code } from '../data_store/stores_data_store_api.js';
|
||||
|
||||
// *** Import Aether module variables and functions
|
||||
// import { get_account_archive_obj_list } from './stores_ae_api.js';
|
||||
|
||||
// *** Import Aether module components
|
||||
import Edit_archive_obj from './10_edit__archive_obj.svelte';
|
||||
import List_archive_obj from './10_list__archive_obj.svelte';
|
||||
import View_archive_obj from './10_view__archive_obj.svelte';
|
||||
|
||||
// *** Export/Exposed variables and functions for component
|
||||
// export let account_id: string = $page['page_for']['account_id'];
|
||||
export let account_id: string = $ae_app.account_id;
|
||||
export let archive_id: string = $ae_app.archives.archive_id;
|
||||
|
||||
export let novi_uuid: string = $ae_app.novi_uuid;
|
||||
export let novi_email: string = $ae_app.novi_email;
|
||||
export let novi_full_name: string = $ae_app.novi_full_name;
|
||||
export let novi_admin_li: string = $ae_app.novi_admin_li;
|
||||
export let novi_trusted_li: string = $ae_app.novi_trusted_li;
|
||||
|
||||
// *** Set initial variables
|
||||
$ae_app.novi_uuid = novi_uuid;
|
||||
$ae_app.novi_email = decodeURIComponent(novi_email);
|
||||
$ae_app.novi_full_name = decodeURIComponent(novi_full_name);
|
||||
$ae_app.novi_admin_li = novi_admin_li;
|
||||
$ae_app.novi_trusted_li = novi_trusted_li;
|
||||
|
||||
$ae_app.current_timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
if (!$ae_app.lu_timezone_list) {
|
||||
$ae_app.lu_timezone_list = [];
|
||||
}
|
||||
|
||||
$ae_app.archives.show_main__options = true; // Section for: buttons for creating new archives, show/hide archives, and search archives
|
||||
// $ae_app.archives.show_list__archive_obj_li = true;
|
||||
// $ae_app.archives.show_view__archive_obj = $ae_app.archives.show_view__archive_obj;
|
||||
$ae_app.archives.fulltext_search_qry_str = '';
|
||||
$ae_app.archives.qry_type = false
|
||||
|
||||
// NOTE: Check if the novi_uuid is in the novi_admin_li list
|
||||
if ($ae_app.novi_uuid && $ae_app.novi_admin_li) {
|
||||
if ($ae_app.novi_admin_li.includes($ae_app.novi_uuid)) {
|
||||
$ae_app.access_type = 'administrator';
|
||||
$ae_app.administrator_access = true;
|
||||
$ae_app.trusted_access = true;
|
||||
}
|
||||
}
|
||||
// NOTE: Check if the novi_uuid is in the novi_trusted_li list
|
||||
if ($ae_app.novi_uuid && $ae_app.novi_trusted_li) {
|
||||
if ($ae_app.novi_trusted_li.includes($ae_app.novi_uuid)) {
|
||||
$ae_app.access_type = 'trusted';
|
||||
$ae_app.trusted_access = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($ae_app.administrator_access) {
|
||||
$ae_app.archives.enabled = 'enabled';
|
||||
$ae_app.archives.hidden = 'not_hidden';
|
||||
$ae_app.archives.limit = 150;
|
||||
} else if ($ae_app.trusted_access) {
|
||||
$ae_app.archives.enabled = 'enabled';
|
||||
$ae_app.archives.hidden = 'not_hidden';
|
||||
$ae_app.archives.limit = 75;
|
||||
} else {
|
||||
$ae_app.archives.enabled = 'enabled';
|
||||
$ae_app.archives.hidden = 'not_hidden';
|
||||
$ae_app.archives.limit = 75;
|
||||
}
|
||||
|
||||
let idaa_archive_obj_li_get_promise;
|
||||
let idaa_archive_obj_get_promise;
|
||||
|
||||
if (account_id) {
|
||||
$slct.account_id = account_id;
|
||||
handle_load_archive_obj_li({account_id: $slct.account_id, try_cache: false});
|
||||
}
|
||||
|
||||
if (archive_id) {
|
||||
console.log(`Selected Archive ID: ${archive_id}`);
|
||||
$slct.archive_id = archive_id;
|
||||
$slct_trigger = 'load__archive_obj';
|
||||
|
||||
// $ae_app.archives.show_main__options = true;
|
||||
$ae_app.archives.show_list__archive_obj_li = false;
|
||||
$ae_app.archives.show_view__archive_obj = true;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
} else {
|
||||
// $ae_app.archives.show_main__options = true;
|
||||
$ae_app.archives.show_list__archive_obj_li = true;
|
||||
$ae_app.archives.show_view__archive_obj = false;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
}
|
||||
|
||||
if (!$ae_app.client_content) {
|
||||
$ae_app.client_content = {};
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** IDAA Archives - AE Archives: Main');
|
||||
});
|
||||
|
||||
|
||||
$: if ($ae_app.iframe_height && $ae_app.iframe_height_modal_body) {
|
||||
console.log('getting new dimensions for iframe:', $ae_app.iframe_height, $ae_app.iframe_height_modal_body);
|
||||
|
||||
let iframe_height = 0;
|
||||
|
||||
if ($ae_app.iframe_height > $ae_app.iframe_height_modal_body) {
|
||||
iframe_height = $ae_app.iframe_height;
|
||||
} else {
|
||||
iframe_height = $ae_app.iframe_height_modal_body;
|
||||
|
||||
// console.log($ae_app.modal_dimensions);
|
||||
|
||||
if ($ae_app.modal_dimensions && $ae_app.modal_dimensions.header_height) {
|
||||
iframe_height = iframe_height + $ae_app.modal_dimensions.header_height;
|
||||
}
|
||||
if ($ae_app.modal_dimensions && $ae_app.modal_dimensions.footer_height) {
|
||||
iframe_height = iframe_height + $ae_app.modal_dimensions.footer_height;
|
||||
}
|
||||
// iframe_height = iframe_height + 50; // Just in case
|
||||
}
|
||||
|
||||
console.log(`Suggested new iframe_height: ${iframe_height}`);
|
||||
window.parent.postMessage({'iframe_height': iframe_height}, "*"); // This should be in pixels
|
||||
} else if ($ae_app.iframe_height) {
|
||||
console.log('setting new iframe_height:', $ae_app.iframe_height);
|
||||
|
||||
// let iframe_height = $ae_app.iframe_height;
|
||||
|
||||
window.parent.postMessage({'iframe_height': $ae_app.iframe_height}, "*"); // This should be in pixels
|
||||
}
|
||||
|
||||
$: if ($slct_trigger == 'load__archive_obj' && $slct.archive_id) {
|
||||
console.log('*** $slct_trigger == load__archive_obj ***');
|
||||
$slct_trigger = null;
|
||||
|
||||
handle_load_archive_obj({archive_id: $slct.archive_id, try_cache: false});
|
||||
|
||||
// Auto show the selected Archive ID
|
||||
// Is this pushState needed here?
|
||||
// Set the URL param "archive_id" to the current Archive ID. This is a just in case.
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('archive_id', $slct.archive_id);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// Is this postMessage needed here?
|
||||
let message = {'archive_id': $slct.archive_id};
|
||||
window.parent.postMessage(message, "*");
|
||||
|
||||
// $ae_app.archives.show_main__options = false;
|
||||
// $ae_app.archives.show_list__archive_obj_li = false;
|
||||
// $ae_app.archives.show_view__archive_obj = true;
|
||||
// $ae_app.archives.show_edit__archive_obj = false;
|
||||
}
|
||||
|
||||
$: if ($slct_trigger == 'load__archive_obj_li' && $slct.account_id) {
|
||||
console.log('*** $slct_trigger == load__archive_obj_li ***');
|
||||
$slct_trigger = null;
|
||||
|
||||
handle_load_archive_obj_li({account_id: $slct.account_id, try_cache: false});
|
||||
}
|
||||
|
||||
async function handle_load_archive_obj_li({account_id, try_cache=true}) {
|
||||
console.log('*** handle_load_archive_obj_li() ***');
|
||||
console.log($ae_app.archives);
|
||||
|
||||
let enabled = $ae_app.archives.enabled;
|
||||
let hidden = $ae_app.archives.hidden;
|
||||
let limit = $ae_app.archives.limit;
|
||||
let offset = $ae_app.archives.offset;
|
||||
|
||||
let params = {};
|
||||
|
||||
let params_json: key_val = {};
|
||||
if ($ae_app.archives.fulltext_search_qry_str && $ae_app.archives.fulltext_search_qry_str.length > 2) {
|
||||
params_json['ft_qry'] = {
|
||||
'default_qry_str': $ae_app.archives.fulltext_search_qry_str,
|
||||
};
|
||||
}
|
||||
|
||||
if ($ae_app.archives.qry_audio || $ae_app.archives.qry_video || $ae_app.archives.qry_other) {
|
||||
params_json['and_qry'] = {};
|
||||
if ($ae_app.archives.qry_audio) params_json['and_qry']['audio'] = true;
|
||||
if ($ae_app.archives.qry_video) params_json['and_qry']['video'] = true;
|
||||
if ($ae_app.archives.qry_other) params_json['and_qry']['other'] = $ae_app.archives.qry_other;
|
||||
}
|
||||
|
||||
console.log('params_json:', params_json);
|
||||
|
||||
idaa_archive_obj_li_get_promise = api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive', // Archive in this case is an IDAA archive.
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: account_id,
|
||||
use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value in the API config.
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'created_on': 'DESC', 'updated_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
params: params,
|
||||
log_lvl: 1
|
||||
})
|
||||
|
||||
.then(function (archive_obj_li_get_result) {
|
||||
if (archive_obj_li_get_result) {
|
||||
$slct.archive_obj_li = archive_obj_li_get_result;
|
||||
console.log(`Archive list:`, $slct.archive_obj_li);
|
||||
} else {
|
||||
$slct.archive_obj_li = [];
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return idaa_archive_obj_li_get_promise;
|
||||
}
|
||||
|
||||
async function handle_load_archive_obj({archive_id, try_cache=false}) {
|
||||
console.log('*** handle_load_archive_obj() ***');
|
||||
|
||||
// let enabled = $ae_app.archives.enabled;
|
||||
// let hidden = $ae_app.archives.hidden;
|
||||
// let limit = $ae_app.archives.limit;
|
||||
// let offset = $ae_app.archives.offset;
|
||||
|
||||
let params = {};
|
||||
|
||||
idaa_archive_obj_get_promise = api.get_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive',
|
||||
obj_id: archive_id,
|
||||
use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value in the API config.
|
||||
params: params,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (archive_obj_get_result) {
|
||||
if (archive_obj_get_result) {
|
||||
$slct.archive_obj = archive_obj_get_result;
|
||||
// console.log($slct.archive_obj.cfg_json.content_group_sort);
|
||||
$ae_app.archives.content_group_sort = $slct.archive_obj.cfg_json.content_group_sort;
|
||||
console.log(`Archive object:`, $slct.archive_obj);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return idaa_archive_obj_get_promise;
|
||||
}
|
||||
|
||||
function handle_created_archive_obj(event) {
|
||||
console.log('*** handle_created_archive_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
handle_load_archive_obj({archive_id: $slct.archive_id, try_cache: false});
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('archive_id', $slct.archive_id);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'archive_id': $slct.archive_id};
|
||||
window.parent.postMessage(message, "*");
|
||||
|
||||
// $slct_trigger = 'load__archive_obj';
|
||||
$slct_trigger = 'load__archive_obj_li';
|
||||
|
||||
// $ae_app.archives.show_main__options = false;
|
||||
$ae_app.archives.show_list__archive_obj_li = false;
|
||||
$ae_app.archives.show_view__archive_obj = true;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
}
|
||||
|
||||
function handle_updated_archive_obj(event) {
|
||||
console.log('*** handle_updated_archive_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct_trigger = 'load__archive_obj';
|
||||
// NOTE: If the next trigger is set too quickly it will cause the one above to be missed.
|
||||
// $slct_trigger = 'load__archive_obj_li';
|
||||
|
||||
// $ae_app.archives.show_main__options = false;
|
||||
$ae_app.archives.show_list__archive_obj_li = false;
|
||||
$ae_app.archives.show_view__archive_obj = true;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
}
|
||||
|
||||
function handle_deleted_archive_obj(event) {
|
||||
console.log('*** handle_deleted_archive_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('archive_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'archive_id': null};
|
||||
window.parent.postMessage(message, "*");
|
||||
|
||||
$slct_trigger = 'load__archive_obj_li';
|
||||
|
||||
$ae_app.archives.show_main__options = true;
|
||||
$ae_app.archives.show_list__archive_obj_li = true;
|
||||
$ae_app.archives.show_view__archive_obj = false;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section id="osit_idaa_archives" class="osit_archives ae_main c_idaa c_idaa_archives" bind:clientHeight={$ae_app.iframe_height}>
|
||||
<!-- <header>
|
||||
<h1>IDAA Archives</h1>
|
||||
</header> -->
|
||||
|
||||
<section class="ae_section ae_meta">
|
||||
<p>
|
||||
Novi: {$ae_app.novi_full_name}
|
||||
<span class="details">
|
||||
(
|
||||
{$ae_app.novi_email}
|
||||
{#if $ae_app.administrator_access}
|
||||
<span class="access_type administrator_access">Administrator</span>
|
||||
{:else if $ae_app.trusted_access}
|
||||
<span class="access_type trusted_access">Trusted</span>
|
||||
{/if}
|
||||
<span class="novi_uuid">UUID: {$ae_app.novi_uuid}</span>
|
||||
)
|
||||
</span>
|
||||
</p>
|
||||
<!-- <p>Page height: {window.innerHeight}</p> -->
|
||||
</section>
|
||||
|
||||
{#if $ae_app.archives.show_main__options}
|
||||
<section class="ae_section ae_options ae_column archive_obj__options">
|
||||
|
||||
<!-- <div class="note">A comment about the IDAA archives in general can go here.</div> -->
|
||||
|
||||
<div class="filters_and_search ae_group ae_row">
|
||||
|
||||
<!-- Show/hide hidden content -->
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
{#if $ae_app.archives.hidden == 'not_hidden'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.archives.hidden = 'all';
|
||||
$ae_app.archives.limit = 150;
|
||||
$slct_trigger = 'load__archive_obj_li';
|
||||
}}
|
||||
class="btn_new_bb_post ae_btn btn_xs ae_smallest btn btn-xs btn-info"
|
||||
>
|
||||
<span class="fas fa-eye"></span> Show Hidden Archives
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.archives.hidden = 'not_hidden';
|
||||
$slct_trigger = 'load__archive_obj_li';
|
||||
}}
|
||||
class="btn_new_bb_post ae_btn btn_xs btn btn-xs btn-info"
|
||||
>
|
||||
<span class="fas fa-eye-slash"></span> Hide Hidden Archives
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<!-- We only want these options to show if a specific archive is showing. -->
|
||||
{#if $ae_app.archives.show_view__archive_obj}
|
||||
{#if $ae_app.archives.hidden == 'not_hidden'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.archives.hidden = 'all';
|
||||
$ae_app.archives.limit = 150;
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
}}
|
||||
class="btn_new_bb_post ae_btn btn_xs ae_smallest btn btn-xs btn-info"
|
||||
>
|
||||
<span class="fas fa-eye"></span> Show Hidden Content
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.archives.hidden = 'not_hidden';
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
}}
|
||||
class="btn_new_bb_post ae_btn btn_xs btn btn-xs btn-info"
|
||||
>
|
||||
<span class="fas fa-eye-slash"></span> Hide Hidden Content
|
||||
</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<!-- For administrator access: Show/hide disabled content -->
|
||||
|
||||
{#if $ae_app.administrator_access}
|
||||
{#if $ae_app.archives.enabled == 'enabled'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.archives.hidden = 'all';
|
||||
$ae_app.archives.enabled = 'all';
|
||||
$ae_app.archives.limit = 500;
|
||||
$slct_trigger = 'load__archive_obj_li';
|
||||
}}
|
||||
class="ae_btn btn_xs ae_smallest btn btn-xs btn-warning"
|
||||
>
|
||||
<span class="fas fa-eye"></span> Show Disabled Archives
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.archives.enabled = 'enabled';
|
||||
$slct_trigger = 'load__archive_obj_li';
|
||||
}}
|
||||
class="ae_btn btn_xs ae_smallest btn btn-xs btn-warning"
|
||||
>
|
||||
<span class="fas fa-eye-slash"></span> Hide Disabled Archives
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if $ae_app.archives.enabled == 'enabled'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.archives.hidden = 'all';
|
||||
$ae_app.archives.enabled = 'all';
|
||||
$ae_app.archives.limit = 500;
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
}}
|
||||
class="ae_btn btn_xs ae_smallest btn btn-xs btn-warning"
|
||||
>
|
||||
<span class="fas fa-eye"></span> Show Disabled Content
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.archives.enabled = 'enabled';
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
}}
|
||||
class="ae_btn btn_xs btn btn-xs btn-warning"
|
||||
>
|
||||
<span class="fas fa-eye-slash"></span> Hide Disabled Content
|
||||
</button>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
<!-- END: div filters_and_search -->
|
||||
|
||||
<div class="view_archvies_create_archive ae_group ae_row">
|
||||
{#if $slct.archive_id}
|
||||
<button
|
||||
on:click={ () => {
|
||||
|
||||
$slct.archive_id = null;
|
||||
$slct.archive_obj = {};
|
||||
|
||||
$ae_app.archives.show_main__options = true;
|
||||
$ae_app.archives.show_list__archive_obj_li = true;
|
||||
$ae_app.archives.show_view__archive_obj = false;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
// $ae_app.iframe_height_modal_body = 0;
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('archive_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'archive_id': null};
|
||||
window.parent.postMessage(message, "*");
|
||||
}}
|
||||
class="btn_new_archive ae_btn btn btn-secondary"
|
||||
>
|
||||
<span class="fas fa-times"></span> View Other Archives
|
||||
</button>
|
||||
{/if}
|
||||
{#if $ae_app.trusted_access}
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.archive_id = null;
|
||||
$slct.archive_obj = {};
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('archive_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
$ae_app.archives.show_main__options = true;
|
||||
$ae_app.archives.show_list__archive_obj_li = false;
|
||||
$ae_app.archives.show_view__archive_obj = false;
|
||||
$ae_app.archives.show_edit__archive_obj = true;
|
||||
}}
|
||||
class="ae_btn ae_smallest btn_new_archive ae_btn btn btn-warning"
|
||||
>
|
||||
<span class="fas fa-plus"></span> Create new Archive
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
|
||||
{#if $ae_app.archives.show_list__archive_obj_li}
|
||||
<List_archive_obj
|
||||
on:created__archive_obj={handle_created_archive_obj}
|
||||
on:updated__archive_obj={handle_updated_archive_obj}
|
||||
on:deleted__archive_obj={handle_deleted_archive_obj}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
|
||||
{#if $ae_app.archives.show_view__archive_obj && $slct.archive_obj}
|
||||
<View_archive_obj />
|
||||
{/if}
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
{#if $ae_app.archives.show_edit__archive_obj}
|
||||
<Element_modal_v3
|
||||
show = { true }
|
||||
modal_cover_body = { false }
|
||||
report_client_dimensions = { true }
|
||||
on:close={ () => {
|
||||
$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;
|
||||
}}
|
||||
>
|
||||
<span slot="header_title">{@html ($slct.archive_obj.name ? $slct.archive_obj.name : 'New Archive Group')}</span>
|
||||
|
||||
<span slot="body">
|
||||
|
||||
<Edit_archive_obj
|
||||
on:created__archive_obj={handle_created_archive_obj}
|
||||
on:updated__archive_obj={handle_updated_archive_obj}
|
||||
on:deleted__archive_obj={handle_deleted_archive_obj}
|
||||
/>
|
||||
|
||||
</span>
|
||||
</Element_modal_v3>
|
||||
{/if}
|
||||
|
||||
|
||||
<!-- {#if $ae_app.archives.show_view__archive_obj && $slct.archive_obj}
|
||||
<Element_modal_v3
|
||||
show = { true }
|
||||
modal_cover_body = { true }
|
||||
report_modal_dimensions = { true }
|
||||
on:close={ () => {
|
||||
|
||||
$slct.archive_id = null;
|
||||
$slct.archive_obj = {};
|
||||
|
||||
$ae_app.archives.show_main__options = true;
|
||||
$ae_app.archives.show_list__archive_obj_li = true;
|
||||
$ae_app.archives.show_view__archive_obj = false;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
$ae_app.iframe_height_modal_body = 0;
|
||||
|
||||
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;
|
||||
}}
|
||||
>
|
||||
<span slot="header_title">{@html $slct.archive_obj.name}</span>
|
||||
|
||||
<span slot="body">
|
||||
|
||||
<View_archive_obj />
|
||||
|
||||
</span>
|
||||
</Element_modal_v3>
|
||||
{/if} -->
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,239 +0,0 @@
|
||||
<script lang="ts">
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
|
||||
// *** Import Svelte core
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
import { ae, api, Element_modal_v3 } from 'aether_npm_lib';
|
||||
|
||||
import { slct, slct_trigger, ae_app, ae_session, ae_local } from './stores';
|
||||
|
||||
export let ae_obj_type: string = 'example';
|
||||
export let ae_obj_id: string = 'abc123';
|
||||
|
||||
|
||||
// let data_store_obj_get_promise: Promise<any>;
|
||||
let data_store_obj_get_promises: key_val = {};
|
||||
let get_ds_hub_site_header_promise = handle_get_data_store_obj_w_code({code: 'hub_site_header'});
|
||||
let get_ds_hub_site_footer_promise = handle_get_data_store_obj_w_code({code: 'hub_site_footer'});
|
||||
|
||||
handle_build_site_nav_menu();
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** OSIT - AE Hub: Main');
|
||||
$ae_session.test.hub = 'Hello World!';
|
||||
$ae_session.test.general = 'Hello world from The Hub!';
|
||||
console.log('ae_session:', $ae_session);
|
||||
});
|
||||
|
||||
|
||||
async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
|
||||
console.log('*** handle_get_data_store_obj_w_code() ***');
|
||||
|
||||
let get_item_result = window.localStorage.getItem(code);
|
||||
if (get_item_result) {
|
||||
$ae_app.hub.ds[code] = get_item_result;
|
||||
} else {
|
||||
console.log('Get local storage item miss.');
|
||||
}
|
||||
|
||||
data_store_obj_get_promises[code] = api.get_data_store_obj_w_code({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
data_store_code: code,
|
||||
data_type: data_type,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (get_data_store_result) {
|
||||
if (get_data_store_result) {
|
||||
|
||||
if (data_type == 'text') {
|
||||
// console.log(get_data_store_result.text);
|
||||
$ae_app.hub.ds[code] = get_data_store_result.text;
|
||||
} else if (data_type == 'json') {
|
||||
// console.log(get_data_store_result.json);
|
||||
$ae_app.hub.ds[code] = get_data_store_result.json;
|
||||
}
|
||||
|
||||
// console.log(`Code: ${$ae_app.hub.ds[code]}`);
|
||||
// console.log(`Code:`, $ae_app.hub.ds[code]);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
}
|
||||
|
||||
// In most cases we are just inserting HTML into the DOM. The Svelte module apps can update the ID's of the elements within if needed.
|
||||
$: if ($ae_app.hub.ds['hub_site_header']) {
|
||||
console.log('Hub Site Header:', $ae_app.hub.ds['hub_site_header']);
|
||||
const site_header_element = document.getElementById('Site-Header');
|
||||
if (site_header_element) {
|
||||
site_header_element.innerHTML = $ae_app.hub.ds['hub_site_header'];
|
||||
}
|
||||
}
|
||||
|
||||
$: if ($ae_app.hub.ds['hub_site_footer']) {
|
||||
console.log('Hub Site Footer:', $ae_app.hub.ds['hub_site_footer']);
|
||||
const site_footer_element = document.getElementById('Site-Footer');
|
||||
if (site_footer_element) {
|
||||
site_footer_element.innerHTML = $ae_app.hub.ds['hub_site_footer'];
|
||||
}
|
||||
}
|
||||
|
||||
// $: if ($ae_app.hub.ds['hub_site_nav_menu']) {
|
||||
// console.log('Hub Site Nav Menu:', $ae_app.hub.ds['hub_site_nav_menu']);
|
||||
// const site_menu_element = document.getElementById('Site-Nav-Menu');
|
||||
// if (site_menu_element) {
|
||||
// /* Add the HTML to the site_menu_element DOM element */
|
||||
// // site_menu_element.innerHTML = $ae_app.hub.ds['hub_site_nav_menu'];
|
||||
// }
|
||||
// }
|
||||
|
||||
$: if ($ae_app.hub.ds['hub_notifications']) {
|
||||
console.log('Hub Notifications:', $ae_app.hub.ds['hub_notifications']);
|
||||
const site_notifications_element = document.getElementById('Notifications');
|
||||
if (site_notifications_element) {
|
||||
site_notifications_element.innerHTML = $ae_app.hub.ds['hub_notifications'];
|
||||
}
|
||||
}
|
||||
|
||||
// if $ae_app.hub.ds['hub_site_header'] {
|
||||
// console.log('Hub Site Header:', $ae_app.hub.ds['hub_site_header']);
|
||||
// document.getElementById('Site-Header').innerHTML = $ae_app.hub.ds['hub_site_header'];
|
||||
// }
|
||||
|
||||
function handle_build_site_nav_menu() {
|
||||
$ae_session.site_nav_menu = {};
|
||||
|
||||
// let menu_item_tmp = {};
|
||||
|
||||
|
||||
// Navigation button group
|
||||
// $ae_session.site_nav_menu['options'] = []; // group
|
||||
|
||||
$ae_session.site_nav_menu['home'] = {
|
||||
'access_level': 'all',
|
||||
'state': 'active', // active, inactive, disabled
|
||||
'text': '<span class="fas fa-home"></span> Home',
|
||||
'href': '/',
|
||||
'action': 'navigate', // navigate, modal, action
|
||||
'class_li': ['ae_btn', 'btn_outline_primary']
|
||||
};
|
||||
|
||||
$ae_session.site_nav_menu['reports_exports'] = {
|
||||
'access_level': 'trusted',
|
||||
'state': 'active', // active, inactive, disabled
|
||||
'text': 'Reports & Exports',
|
||||
'href': '/',
|
||||
'action': 'navigate', // navigate, modal, action
|
||||
'class_li': ['ae_btn', 'btn_outline_secondary']
|
||||
};
|
||||
|
||||
$ae_session.site_nav_menu['manage'] = {
|
||||
'access_level': 'administrator',
|
||||
'state': 'active', // active, inactive, disabled
|
||||
'text': 'Manage',
|
||||
'href': '/manage',
|
||||
'action': 'navigate', // navigate, modal, action
|
||||
'class_li': ['ae_btn', 'btn_outline_secondary']
|
||||
};
|
||||
|
||||
$ae_session.site_nav_menu['help'] = {
|
||||
'access_level': 'all',
|
||||
'state': 'active', // active, inactive, disabled
|
||||
'text': 'Help',
|
||||
'href': '/',
|
||||
'class_li': ['ae_btn', 'btn_outline_secondary']
|
||||
};
|
||||
|
||||
|
||||
// // Trusted button group
|
||||
// $ae_session.site_nav_menu['trusted'] = []; // group
|
||||
|
||||
// menu_item_tmp = $event_defaults.event_manage_btn;
|
||||
// menu_item_tmp['href'] = `/event/${$slct.event_id}/manage`;
|
||||
// menu_item_tmp['class_li'].push('btn_sm', 'btn_outline_warning');
|
||||
// $ae_session.site_nav_menu['trusted'].push(menu_item_tmp);
|
||||
|
||||
// menu_item_tmp = $event_defaults.event_location_view_li_btn;
|
||||
// menu_item_tmp['href'] = `/event/${$slct.event_id}/locations`;
|
||||
// menu_item_tmp['class_li'].push('btn_sm', 'btn_outline_secondary');
|
||||
// $ae_session.site_nav_menu['trusted'].push(menu_item_tmp);
|
||||
|
||||
// // Admin button group
|
||||
// $ae_session.site_nav_menu['admin'] = []; // group
|
||||
|
||||
// menu_item_tmp = $event_defaults.event_edit_btn;
|
||||
// menu_item_tmp['href'] = `/event/${$slct.event_id}/edit`;
|
||||
// menu_item_tmp['class_li'].push('btn_sm', 'btn_outline_warning');
|
||||
// $ae_session.site_nav_menu['admin'].push(menu_item_tmp);
|
||||
}
|
||||
</script>
|
||||
|
||||
<section class="ae_hub ae_debug">
|
||||
|
||||
The Hub!
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_session.site_nav_menu['home'].text = '<span class="fas fa-house-damage"></span> Home';
|
||||
// console.log('ae_session:', $ae_session);
|
||||
|
||||
$ae_local.testing = 'Hello World!';
|
||||
$ae_local.test = 'Hello World!';
|
||||
// $ae_local.set('Hello World!');
|
||||
console.log('ae_local:', $ae_local);
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-biohazard"></span> Test
|
||||
</button>
|
||||
|
||||
{#if $ae_app.administrator_access}
|
||||
<span class="access_type administrator_access">Administrator</span>
|
||||
{:else if $ae_app.trusted_access}
|
||||
<span class="access_type trusted_access">Trusted</span>
|
||||
{/if}
|
||||
|
||||
<div>
|
||||
<!-- {$ae_session.test.example} -->
|
||||
<!-- {$ae_session.test.general} -->
|
||||
<!-- {$ae_session.test.hub} -->
|
||||
<!-- {$ae_session.test.sponsorships} -->
|
||||
</div>
|
||||
|
||||
{#await data_store_obj_get_promises['hub_site_header']}
|
||||
<p>Loading site header...</p>
|
||||
{:then}
|
||||
<p>Site header loaded.</p>
|
||||
<!-- <div class="">{@html $ae_app.hub.ds['hub_site_header']}</div> -->
|
||||
<!-- <pre>
|
||||
{$ae_app.hub.ds['hub_site_header']}
|
||||
</pre> -->
|
||||
{:catch error}
|
||||
<p style="color: red">{error.message}</p>
|
||||
{/await}
|
||||
|
||||
{#await data_store_obj_get_promises['hub_site_footer']}
|
||||
<p>Loading site footer...</p>
|
||||
{:then}
|
||||
<p>Site footer loaded.</p>
|
||||
<!-- <div class="">{@html $ae_app.hub.ds['hub_site_footer']}</div> -->
|
||||
<!-- <pre>
|
||||
{$ae_app.hub.ds['hub_site_footer']}
|
||||
</pre> -->
|
||||
{:catch error}
|
||||
<p style="color: red">{error.message}</p>
|
||||
{/await}
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
/* .ae_hub.ae_debug {
|
||||
|
||||
} */
|
||||
</style>
|
||||
@@ -1,711 +0,0 @@
|
||||
<script lang="ts">
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
// *** Import Svelte core
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
import { ae, api, Element_modal_v3 } from 'aether_npm_lib';
|
||||
|
||||
import { slct, slct_trigger, ae_app } from './stores';
|
||||
|
||||
// *** Import Aether core components
|
||||
|
||||
// *** Import Aether module variables and functions
|
||||
|
||||
// *** Import Aether module components
|
||||
import Edit_post_obj from './10_edit__post_obj.svelte';
|
||||
import View_post_obj from './10_view__post_obj.svelte';
|
||||
|
||||
// *** Export/Exposed variables and functions for component
|
||||
export let account_id: string = $ae_app.account_id;
|
||||
export let post_id: string = $ae_app.posts.post_id;
|
||||
|
||||
export let novi_uuid: string = $ae_app.novi_uuid;
|
||||
export let novi_email: string = $ae_app.novi_email;
|
||||
export let novi_full_name: string = $ae_app.novi_full_name;
|
||||
export let novi_admin_li: string = $ae_app.novi_admin_li;
|
||||
export let novi_trusted_li: string = $ae_app.novi_trusted_li;
|
||||
|
||||
// *** Set initial variables
|
||||
$ae_app.novi_uuid = novi_uuid;
|
||||
$ae_app.novi_email = decodeURIComponent(novi_email);
|
||||
$ae_app.novi_full_name = decodeURIComponent(novi_full_name);
|
||||
$ae_app.novi_admin_li = novi_admin_li;
|
||||
$ae_app.novi_trusted_li = novi_trusted_li;
|
||||
|
||||
$ae_app.posts.show_main__options = true;
|
||||
$ae_app.posts.show_list__post_obj_li = true;
|
||||
|
||||
// NOTE: Check if the novi_uuid is in the novi_admin_li list
|
||||
if ($ae_app.novi_uuid && $ae_app.novi_admin_li) {
|
||||
if ($ae_app.novi_admin_li.includes($ae_app.novi_uuid)) {
|
||||
$ae_app.access_type = 'administrator';
|
||||
$ae_app.administrator_access = true;
|
||||
$ae_app.trusted_access = true;
|
||||
}
|
||||
}
|
||||
// NOTE: Check if the novi_uuid is in the novi_trusted_li list
|
||||
if ($ae_app.novi_uuid && $ae_app.novi_trusted_li) {
|
||||
if ($ae_app.novi_trusted_li.includes($ae_app.novi_uuid)) {
|
||||
$ae_app.access_type = 'trusted';
|
||||
$ae_app.trusted_access = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($ae_app.administrator_access) {
|
||||
$ae_app.posts.enabled = 'enabled';
|
||||
$ae_app.posts.hidden = 'not_hidden';
|
||||
$ae_app.events.limit = 150;
|
||||
} else if ($ae_app.trusted_access) {
|
||||
$ae_app.posts.enabled = 'enabled';
|
||||
$ae_app.posts.hidden = 'not_hidden';
|
||||
$ae_app.events.limit = 75;
|
||||
} else {
|
||||
$ae_app.posts.enabled = 'enabled';
|
||||
$ae_app.posts.hidden = 'not_hidden';
|
||||
$ae_app.events.limit = 50;
|
||||
}
|
||||
|
||||
let idaa_post_obj_li_get_promise;
|
||||
let idaa_post_obj_get_promise;
|
||||
let idaa_post_comment_obj_li_get_promise;
|
||||
|
||||
if (account_id) {
|
||||
$slct.account_id = account_id;
|
||||
handle_load_idaa_post_obj_li({account_id: $slct.account_id, try_cache: false});
|
||||
}
|
||||
|
||||
// NOTE: This if post_id is not fully ready yet -2023-09-08
|
||||
if (post_id) {
|
||||
console.log(`Selected Post ID: ${post_id}`);
|
||||
$slct.post_id = post_id;
|
||||
$slct_trigger = 'load__post_obj';
|
||||
$slct_trigger = 'load__post_comment_obj_li';
|
||||
// handle_load_post_id_obj({post_id: $slct.post_id, try_cache: false});
|
||||
// handle_load_post_comment_obj_li({post_id: $slct.post_id, try_cache: false});
|
||||
|
||||
// Auto show the selected Post ID
|
||||
// Is this pushState needed here?
|
||||
// Set the URL param "post_id" to the current Post ID. This is a just in case.
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('post_id', $slct.post_id);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
$ae_app.events.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 = true;
|
||||
}
|
||||
|
||||
if (!$ae_app.client_content) {
|
||||
$ae_app.client_content = {};
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** IDAA Bulletin Board - AE Posts: Main');
|
||||
});
|
||||
|
||||
|
||||
$: if ($ae_app.iframe_height && $ae_app.iframe_height_modal_body) {
|
||||
console.log('getting new dimensions for iframe:', $ae_app.iframe_height, $ae_app.iframe_height_modal_body);
|
||||
|
||||
let iframe_height = 0;
|
||||
|
||||
if ($ae_app.iframe_height > $ae_app.iframe_height_modal_body) {
|
||||
iframe_height = $ae_app.iframe_height;
|
||||
} else {
|
||||
iframe_height = $ae_app.iframe_height_modal_body;
|
||||
|
||||
// console.log($ae_app.modal_dimensions);
|
||||
|
||||
if ($ae_app.modal_dimensions && $ae_app.modal_dimensions.header_height) {
|
||||
iframe_height = iframe_height + $ae_app.modal_dimensions.header_height;
|
||||
}
|
||||
if ($ae_app.modal_dimensions && $ae_app.modal_dimensions.footer_height) {
|
||||
iframe_height = iframe_height + $ae_app.modal_dimensions.footer_height;
|
||||
}
|
||||
// iframe_height = iframe_height + 50; // Just in case
|
||||
}
|
||||
|
||||
console.log(`Suggested new iframe_height: ${iframe_height}`);
|
||||
window.parent.postMessage({'iframe_height': iframe_height}, "*"); // This should be in pixels
|
||||
} else if ($ae_app.iframe_height) {
|
||||
console.log('setting new iframe_height:', $ae_app.iframe_height);
|
||||
|
||||
// let iframe_height = $ae_app.iframe_height;
|
||||
|
||||
window.parent.postMessage({'iframe_height': $ae_app.iframe_height}, "*"); // This should be in pixels
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct_trigger == 'load__post_obj_li' && $slct.account_id) {
|
||||
$slct_trigger = null;
|
||||
|
||||
handle_load_idaa_post_obj_li({account_id: $slct.account_id, try_cache: false});
|
||||
}
|
||||
|
||||
async function handle_load_idaa_post_obj_li({account_id, try_cache=false}) {
|
||||
console.log('*** handle_load_idaa_post_obj_li() ***');
|
||||
|
||||
let enabled = $ae_app.posts.enabled;
|
||||
let hidden = $ae_app.posts.hidden;
|
||||
let limit = $ae_app.posts.limit;
|
||||
let offset = $ae_app.posts.offset;
|
||||
|
||||
let params = {};
|
||||
|
||||
// params['json_str'] = encodeURIComponent(JSON.stringify($ae_app.posts));
|
||||
// let json_test_obj = {
|
||||
// 'default_qry_str': 'Testing',
|
||||
// 'address_default_qry_str': 'New York',
|
||||
// 'contact_1_default_qry_str': 'Scott',
|
||||
// };
|
||||
|
||||
// let json_test_obj = {
|
||||
// 'name': {'comp': 'LIKE', 'val': '%test%'},
|
||||
// 'priority': {'comp': '>=', 'val': 0},
|
||||
// 'created_on': {'comp': '>=', 'val': '2021-01-01 00:00:00'},
|
||||
// };
|
||||
|
||||
idaa_post_obj_li_get_promise = api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post', // Post in this case is a person's bulletin board post.
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: account_id,
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'created_on': 'DESC', 'updated_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: null,
|
||||
params: params,
|
||||
log_lvl: 2
|
||||
})
|
||||
.then(function (post_obj_li_get_result) {
|
||||
if (post_obj_li_get_result) {
|
||||
$slct.post_obj_li = post_obj_li_get_result;
|
||||
console.log(`Post list:`, $slct.post_obj_li);
|
||||
} else {
|
||||
$slct.post_obj_li = [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return idaa_post_obj_li_get_promise;
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct_trigger == 'load__post_obj' && $slct.post_id) {
|
||||
$slct_trigger = null;
|
||||
|
||||
handle_load_post_id_obj({post_id: $slct.post_id, try_cache: false});
|
||||
|
||||
// // Auto show the selected Event ID
|
||||
// // Set the URL param "post_id" to the current Event ID. This is a just in case.
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('post_id', $slct.post_id);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// let message = {'post_id': $slct.post_id};
|
||||
// window.parent.postMessage(message, "*");
|
||||
|
||||
// $ae_app.posts.show_main__options = false;
|
||||
// $ae_app.posts.show_list__post_li = false;
|
||||
// $ae_app.posts.show_view__post_id = true;
|
||||
// $ae_app.posts.show_edit__post_id = false;
|
||||
}
|
||||
|
||||
async function handle_load_post_id_obj({post_id, try_cache=false}) {
|
||||
console.log('*** handle_load_post_id_obj() ***');
|
||||
|
||||
// let enabled = $ae_app.posts.enabled;
|
||||
// let hidden = $ae_app.posts.hidden;
|
||||
// let limit = $ae_app.posts.limit;
|
||||
// let offset = $ae_app.posts.offset;
|
||||
|
||||
let params = {};
|
||||
|
||||
idaa_post_obj_get_promise = api.get_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post',
|
||||
obj_id: post_id,
|
||||
params: params,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (post_obj_get_result) {
|
||||
if (post_obj_get_result) {
|
||||
$slct.post_obj = post_obj_get_result;
|
||||
console.log(`Post object:`, $slct.post_obj);
|
||||
}
|
||||
|
||||
// Auto show the selected Post ID
|
||||
// Set the URL param "post_id" to the current Post ID.
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('post_id', $slct.post_id);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'post_id': $slct.post_id};
|
||||
window.parent.postMessage(message, "*");
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return idaa_post_obj_get_promise;
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct_trigger == 'load__post_comment_obj_li' && $slct.post_id) {
|
||||
$slct_trigger = null;
|
||||
|
||||
handle_load_post_comment_obj_li({post_id: $slct.post_id, try_cache: false});
|
||||
}
|
||||
|
||||
async function handle_load_post_comment_obj_li({post_id, try_cache=false}) {
|
||||
console.log('*** handle_load_post_comment_obj_li() ***');
|
||||
|
||||
let enabled = $ae_app.posts.enabled;
|
||||
let hidden = $ae_app.posts.hidden;
|
||||
let limit = $ae_app.posts.limit;
|
||||
let offset = $ae_app.posts.offset;
|
||||
|
||||
let params = {};
|
||||
|
||||
idaa_post_comment_obj_li_get_promise = api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post_comment', // Post comment in this case is a person's bulletin board post comment.
|
||||
for_obj_type: 'post',
|
||||
for_obj_id: post_id,
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'created_on': 'DESC', 'updated_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: null,
|
||||
params: params,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (post_comment_obj_li_get_result) {
|
||||
if (post_comment_obj_li_get_result) {
|
||||
$slct.post_comment_obj_li = post_comment_obj_li_get_result;
|
||||
console.log(`Post Comment list:`, $slct.post_comment_obj_li);
|
||||
} else {
|
||||
$slct.post_comment_obj_li = [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return idaa_post_comment_obj_li_get_promise;
|
||||
}
|
||||
|
||||
function handle_post_obj_created(event) {
|
||||
console.log('*** handle_post_obj_created() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
// $slct.post_id = event.detail.post_id_random;
|
||||
// $slct.post_obj = event.detail;
|
||||
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
function handle_post_obj_updated(event) {
|
||||
console.log('*** handle_post_obj_updated() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
// $slct.post_id = event.detail.post_id_random;
|
||||
// $slct.post_obj = event.detail;
|
||||
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
function handle_post_obj_deleted(event) {
|
||||
console.log('*** handle_post_obj_deleted() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
// $slct.post_id = null;
|
||||
// $slct.post_obj = {};
|
||||
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
|
||||
$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;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section id="osit_idaa_bb" class="osit_posts ae_main c_idaa c_idaa_bb" bind:clientHeight={$ae_app.iframe_height}>
|
||||
<!-- <header>
|
||||
<h1>IDAA BB Posts</h1>
|
||||
</header> -->
|
||||
|
||||
<section class="ae_section ae_meta">
|
||||
<p>
|
||||
Novi: {$ae_app.novi_full_name}
|
||||
<span class="details">
|
||||
(
|
||||
{$ae_app.novi_email}
|
||||
{#if $ae_app.administrator_access}
|
||||
<span class="access_type administrator_access">Administrator</span>
|
||||
{:else if $ae_app.trusted_access}
|
||||
<span class="access_type trusted_access">Trusted</span>
|
||||
{/if}
|
||||
<span class="novi_uuid">UUID: {$ae_app.novi_uuid}</span>
|
||||
)
|
||||
</span>
|
||||
</p>
|
||||
<!-- <p>Page height: {window.innerHeight}</p> -->
|
||||
</section>
|
||||
|
||||
{#if $ae_app.posts.show_main__options}
|
||||
<section class="ae_section ae_options ae_row post_obj__options">
|
||||
|
||||
{#if $ae_app.trusted_access && $ae_app.posts.hidden == 'not_hidden'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.posts.hidden = 'all';
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-info"
|
||||
>
|
||||
<span class="fas fa-eye"></span> Show Hidden Posts
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.posts.hidden = 'not_hidden';
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-info"
|
||||
>
|
||||
<span class="fas fa-eye-slash"></span> Hide Hidden Posts
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if $ae_app.administrator_access}
|
||||
{#if $ae_app.posts.enabled == 'enabled'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.posts.hidden = 'all';
|
||||
$ae_app.posts.enabled = 'all';
|
||||
$ae_app.posts.limit = 500;
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
}}
|
||||
class="ae_btn btn_xs ae_smallest btn btn-xs btn-warning"
|
||||
>
|
||||
<span class="fas fa-eye"></span> Show Disabled Posts
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.posts.enabled = 'enabled';
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
}}
|
||||
class="ae_btn btn_xs ae_smallest btn btn-xs btn-warning"
|
||||
>
|
||||
<span class="fas fa-eye-slash"></span> Hide Disabled Posts
|
||||
</button>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.post_id = null;
|
||||
$slct.post_obj = {};
|
||||
$slct.post_comment_obj_li = [];
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('post_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
$ae_app.posts.show_main__options = true;
|
||||
$ae_app.posts.show_list__post_obj_li = true;
|
||||
$ae_app.posts.show_edit__post_id = true;
|
||||
$ae_app.posts.show_view__post_id = false;
|
||||
}}
|
||||
class="btn_new_bb_post btn btn-secondary"
|
||||
>
|
||||
<span class="fas fa-plus"></span> Create new BB post
|
||||
</button>
|
||||
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{#if $ae_app.posts.show_list__post_obj_li}
|
||||
<section class="bb_post_list">
|
||||
{#if $slct.post_obj_li}
|
||||
<!-- <ul> -->
|
||||
{#each $slct.post_obj_li as idaa_post_obj, index}
|
||||
<div
|
||||
id={`idaa_bb_post_id__${idaa_post_obj.post_id_random}`}
|
||||
class="container bb_post post_obj"
|
||||
class:post__hide={idaa_post_obj.hide}
|
||||
class:post__priority={idaa_post_obj.priority}
|
||||
class:post__group={idaa_post_obj.group}
|
||||
>
|
||||
<header class="ae_header post__header">
|
||||
<h3 class="post__title">
|
||||
{@html idaa_post_obj.title}
|
||||
{#if idaa_post_obj.topic_id}<span class="badge badge-info bg-info"><span class="fas fa-user-md"></span> {idaa_post_obj.topic_name}</span>{/if}
|
||||
</h3>
|
||||
</header>
|
||||
|
||||
{#if idaa_post_obj.content}<div class="post__content">{@html idaa_post_obj.content}</div>{/if}
|
||||
|
||||
<div class="ae_options post_obj__options">
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.post_id = idaa_post_obj.post_id_random;
|
||||
$slct.post_obj = idaa_post_obj;
|
||||
|
||||
handle_load_post_comment_obj_li({post_id: $slct.post_id, try_cache: false});
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('post_id', idaa_post_obj.post_id_random);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'post_id': idaa_post_obj.post_id_random};
|
||||
window.parent.postMessage(message, "*");
|
||||
|
||||
$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 = true;
|
||||
}}
|
||||
class="btn btn-primary"
|
||||
title={`View: ${idaa_post_obj.title}`}
|
||||
>
|
||||
<span class="fas fa-envelope-open"></span> Open
|
||||
|
||||
{#if idaa_post_obj.post_comment_count}
|
||||
<span class="ae_badge ae_info post__post_comment_count">
|
||||
<span class="fas fa-comment"></span> {(idaa_post_obj.post_comment_count == 1 ? `${idaa_post_obj.post_comment_count} comment` : `${idaa_post_obj.post_comment_count} comments` )}
|
||||
</span>
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
{#if $ae_app.trusted_access || idaa_post_obj.external_person_id === $ae_app.novi_uuid || idaa_post_obj.email === $ae_app.novi_email}
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.post_id = idaa_post_obj.post_id_random;
|
||||
$slct.post_obj = idaa_post_obj;
|
||||
$slct_trigger = 'load__post_obj';
|
||||
|
||||
$ae_app.posts.show_main__options = true;
|
||||
$ae_app.posts.show_list__post_obj_li = true;
|
||||
$ae_app.posts.show_edit__post_id = true;
|
||||
// $ae_app.posts.show_view__post_id = false;
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-secondary"
|
||||
title={`Edit post: ${idaa_post_obj.title}`}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit Post
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<!-- <button
|
||||
on:click={() => {
|
||||
$slct.post_id = idaa_post_obj.post_id_random;
|
||||
$slct.post_obj = idaa_post_obj;
|
||||
|
||||
$ae_app.posts.show_post_comment_crud = true;
|
||||
}}
|
||||
class="ae_btn btn_md btn_outline_warning"
|
||||
title={`New comment on: ${idaa_post_obj.title}`}
|
||||
>
|
||||
<span class="fas fa-plus"></span> New Comment
|
||||
</button> -->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ae_section ae_footer ae_meta post__meta">
|
||||
{#if (idaa_post_obj.anonymous)}
|
||||
<div class="post__posted_by">
|
||||
Posted by: <span class="fas fa-user-secret"></span> <span class="post__full_name">Anonymous</span>
|
||||
</div>
|
||||
{:else if (idaa_post_obj.full_name)}
|
||||
<div class="post__posted_by">
|
||||
Posted by: <span class="fas fa-user"></span> <span class="post__full_name">{idaa_post_obj.full_name}
|
||||
{#if $ae_app.trusted_access && idaa_post_obj.email}
|
||||
(<a href="mailto:{idaa_post_obj.email}?subject=IDAA BB Post">{idaa_post_obj.email}</a>)
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if idaa_post_obj.created_on}
|
||||
<div class="post__created_on_updated_on">
|
||||
{#if !idaa_post_obj.updated_on}
|
||||
<span
|
||||
class="post__created_on"
|
||||
>
|
||||
<span class="ae_label">Created on:</span>
|
||||
<span class="ae_value">{ae.util.iso_datetime_formatter(idaa_post_obj.created_on, 'datetime_iso_no_seconds')}</span>
|
||||
</span>
|
||||
{:else}
|
||||
<span
|
||||
class="post__updated_on"
|
||||
>
|
||||
<span class="ae_label">Updated on:</span>
|
||||
<span class="ae_value">{ae.util.iso_datetime_formatter(idaa_post_obj.updated_on, 'datetime_iso_no_seconds')}</span>
|
||||
</span>
|
||||
{/if}
|
||||
{#if idaa_post_obj.archive_on}
|
||||
<span class="post__archive_on">Archive on: {ae.util.iso_datetime_formatter(idaa_post_obj.archive_on, 'datetime_iso_no_seconds')}</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<!-- <div style="font-size: smaller">json={encodeURIComponent(JSON.stringify({idaa_post_obj}))}</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/each}
|
||||
<!-- </ul> -->
|
||||
{:else}
|
||||
No posts found at this time
|
||||
{/if}
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
|
||||
{#if $ae_app.posts.show_edit__post_id}
|
||||
<Element_modal_v3
|
||||
show = { true }
|
||||
modal_cover_body = { false }
|
||||
report_client_dimensions = { true }
|
||||
on:close={ () => {
|
||||
$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;
|
||||
}}
|
||||
>
|
||||
<span slot="header_title">{@html ($slct.post_obj.title ? $slct.post_obj.title : 'New BB Post')}</span>
|
||||
|
||||
<span slot="body">
|
||||
<section class="post_obj_view">
|
||||
<Edit_post_obj on:created__post_obj={handle_post_obj_created} on:updated__post_obj={handle_post_obj_updated} on:deleted__post_obj={handle_post_obj_deleted} />
|
||||
</section>
|
||||
</span>
|
||||
</Element_modal_v3>
|
||||
{/if}
|
||||
|
||||
|
||||
{#if $ae_app.posts.show_view__post_id && $slct.post_obj}
|
||||
<Element_modal_v3
|
||||
show = { true }
|
||||
modal_cover_body = { false }
|
||||
report_client_dimensions = { true }
|
||||
on:close={ () => {
|
||||
$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;
|
||||
}}
|
||||
>
|
||||
<span slot="header_title">{$slct.post_obj.title}</span>
|
||||
|
||||
<span slot="body">
|
||||
|
||||
<View_post_obj />
|
||||
|
||||
</span>
|
||||
</Element_modal_v3>
|
||||
{/if}
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
.ae_header h3 {
|
||||
font-size: 1.2em;
|
||||
margin: 0;
|
||||
/* padding: 0; */
|
||||
}
|
||||
|
||||
.post_obj .ae_meta {
|
||||
font-size: smaller;
|
||||
color: hsla(0,0%,50%,1);
|
||||
}
|
||||
|
||||
.post_obj {
|
||||
border: solid thin hsla(0,0%,90%,1);
|
||||
margin: 1em .5em;
|
||||
padding: .5em .5em;
|
||||
}
|
||||
|
||||
.post__header {
|
||||
background-color: hsla(0,0%,90%,1);
|
||||
}
|
||||
|
||||
/* .ae_meta.post_obj {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
} */
|
||||
|
||||
/* :global(.bb_post_crud .element_ae_modal) {
|
||||
border: dashed thin hsla(0,0%,70%,1);
|
||||
|
||||
margin: .5em .25em;
|
||||
padding: .5em .25em;
|
||||
|
||||
background-color: hsla(0,0%,90%,1);
|
||||
} */
|
||||
|
||||
/* :global(.bb_post_id_view .element_ae_modal) {
|
||||
border: dashed thin blue;
|
||||
} */
|
||||
|
||||
/* :global(.bb_post_comment_crud .element_ae_modal) {
|
||||
border: dashed thin hsla(0,0%,70%,1);
|
||||
|
||||
margin: .5em .25em;
|
||||
padding: .5em .25em;
|
||||
|
||||
background-color: hsla(0,0%,90%,1);
|
||||
} */
|
||||
</style>
|
||||
@@ -1,847 +0,0 @@
|
||||
<script lang="ts">
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
// *** Import Svelte core
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
import { ae, api, Element_modal_v3 } from 'aether_npm_lib';
|
||||
|
||||
import { slct, slct_trigger, ae_app, ae_local, ae_session } from './stores';
|
||||
|
||||
// *** Import Aether core components
|
||||
// import { get_data_store_obj_w_code } from '../data_store/stores_data_store_api.js';
|
||||
|
||||
// *** Import Aether module variables and functions
|
||||
|
||||
// *** Import Aether module components
|
||||
import Edit_sponsorship_obj from './10_edit__sponsorship_obj.svelte';
|
||||
import List_sponsorship_obj from './10_list__sponsorship_obj.svelte';
|
||||
import View_sponsorship_obj from './10_view__sponsorship_obj.svelte';
|
||||
|
||||
// *** Export/Exposed variables and functions for component
|
||||
// export let account_id: string = $page['page_for']['account_id'];
|
||||
export let account_id: string = $ae_app.account_id;
|
||||
export let sponsorship_id: string = $ae_app.sponsorships.sponsorship_id;
|
||||
|
||||
export let user: string = $ae_app.user;
|
||||
export let key: string = $ae_app.key;
|
||||
export let full_name: string = $ae_app.full_name;
|
||||
export let ae_admin_li: string = $ae_app.ae_admin_li;
|
||||
export let ae_trusted_li: string = $ae_app.ae_trusted_li;
|
||||
|
||||
// *** Set initial variables
|
||||
$ae_app.user = decodeURIComponent(user);
|
||||
$ae_app.key = decodeURIComponent(key);
|
||||
// $ae_app.ae_admin_li = ae_admin_li;
|
||||
// $ae_app.ae_trusted_li = ae_trusted_li;
|
||||
|
||||
$ae_app.current_timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
if (!$ae_app.lu_country_subdivision_list) {
|
||||
$ae_app.lu_country_subdivision_list = [];
|
||||
}
|
||||
if (!$ae_app.lu_country_list ) {
|
||||
$ae_app.lu_country_list = [];
|
||||
}
|
||||
if (!$ae_app.lu_timezone_list) {
|
||||
$ae_app.lu_timezone_list = [];
|
||||
}
|
||||
|
||||
$ae_app.sponsorships.show_main__options = true; // Section for: search area, buttons for filtering sponsorships, create new sponsorship.
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = true;
|
||||
$ae_app.sponsorships.fulltext_search_qry_str = '';
|
||||
$ae_app.sponsorships.qry_virtual = false;
|
||||
$ae_app.sponsorships.qry_physical = false;
|
||||
$ae_app.sponsorships.qry_type = '';
|
||||
|
||||
// NOTE: Check if the ae_user is in the ae_admin_li list
|
||||
if ($ae_app.ae_user && $ae_app.ae_admin_li) {
|
||||
if ($ae_app.ae_admin_li.includes($ae_app.ae_user)) {
|
||||
$ae_app.access_type = 'administrator';
|
||||
$ae_app.administrator_access = true;
|
||||
$ae_app.trusted_access = true;
|
||||
}
|
||||
}
|
||||
// NOTE: Check if the ae_user is in the ae_trusted_li list
|
||||
if ($ae_app.ae_user && $ae_app.ae_trusted_li) {
|
||||
if ($ae_app.ae_trusted_li.includes($ae_app.ae_user)) {
|
||||
$ae_app.access_type = 'trusted';
|
||||
$ae_app.trusted_access = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($ae_app.administrator_access) {
|
||||
$ae_app.sponsorships.enabled = 'enabled';
|
||||
$ae_app.sponsorships.hidden = 'not_hidden';
|
||||
$ae_app.sponsorships.limit = 150;
|
||||
} else if ($ae_app.trusted_access) {
|
||||
$ae_app.sponsorships.enabled = 'enabled';
|
||||
$ae_app.sponsorships.hidden = 'not_hidden';
|
||||
$ae_app.sponsorships.limit = 75;
|
||||
} else {
|
||||
$ae_app.sponsorships.enabled = 'enabled';
|
||||
$ae_app.sponsorships.hidden = 'not_hidden';
|
||||
$ae_app.sponsorships.limit = 25;
|
||||
}
|
||||
|
||||
let ae_sponsorship_obj_li_get_promise;
|
||||
let ae_sponsorship_obj_get_promise;
|
||||
let data_store_obj_get_promise;
|
||||
let get_ds_sponsorships_info_promise = handle_get_data_store_obj_w_code({code: 'sponsorships_info'});
|
||||
let get_ds_sponsorships_options_promise = handle_get_data_store_obj_w_code({code: 'sponsorships_options'});
|
||||
|
||||
if (account_id) {
|
||||
$slct.account_id = account_id;
|
||||
handle_load_ae_sponsorship_obj_li({account_id: $slct.account_id, try_cache: false});
|
||||
}
|
||||
|
||||
// NOTE: This if sponsorship_id is not fully ready yet -2023-09-08
|
||||
if (sponsorship_id) {
|
||||
console.log(`Selected Sponsorship ID: ${sponsorship_id}`);
|
||||
$slct.sponsorship_id = sponsorship_id;
|
||||
$slct_trigger = 'load__sponsorship_obj';
|
||||
|
||||
// handle_load_sponsorship_id_obj({sponsorship_id: $slct.sponsorship_id, try_cache: false});
|
||||
|
||||
// // Auto show the selected Sponsorship ID
|
||||
// // Set the URL param "sponsorship_id" to the current Sponsorship ID. This is a just in case.
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('sponsorship_id', $slct.sponsorship_id);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// let message = {'sponsorship_id': $slct.sponsorship_id};
|
||||
// window.parent.postMessage(message, "*");
|
||||
|
||||
$ae_app.sponsorships.show_main__options = true;
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = true;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = true;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = false;
|
||||
}
|
||||
|
||||
if (!$ae_app.client_content) {
|
||||
$ae_app.client_content = {};
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** OSIT - AE Sponsorships: Main');
|
||||
|
||||
document.getElementById('meeting_fulltext_search_qry_str').focus();
|
||||
|
||||
$ae_session.test.sponsorships = 'Hello World!';
|
||||
$ae_session.test.general = 'Hello world from Sponsorships!';
|
||||
console.log('ae_session:', $ae_session);
|
||||
});
|
||||
|
||||
|
||||
$: if ($ae_app.iframe_height && $ae_app.iframe_height_modal_body) {
|
||||
console.log('getting new dimensions for iframe:', $ae_app.iframe_height, $ae_app.iframe_height_modal_body);
|
||||
|
||||
let iframe_height = 0;
|
||||
|
||||
if ($ae_app.iframe_height > $ae_app.iframe_height_modal_body) {
|
||||
iframe_height = $ae_app.iframe_height;
|
||||
} else {
|
||||
iframe_height = $ae_app.iframe_height_modal_body;
|
||||
|
||||
// console.log($ae_app.modal_dimensions);
|
||||
|
||||
if ($ae_app.modal_dimensions && $ae_app.modal_dimensions.header_height) {
|
||||
iframe_height = iframe_height + $ae_app.modal_dimensions.header_height;
|
||||
}
|
||||
if ($ae_app.modal_dimensions && $ae_app.modal_dimensions.footer_height) {
|
||||
iframe_height = iframe_height + $ae_app.modal_dimensions.footer_height;
|
||||
}
|
||||
// iframe_height = iframe_height + 50; // Just in case
|
||||
}
|
||||
|
||||
console.log(`Suggested new iframe_height: ${iframe_height}`);
|
||||
window.parent.postMessage({'iframe_height': iframe_height}, "*"); // This should be in pixels
|
||||
} else if ($ae_app.iframe_height) {
|
||||
console.log('setting new iframe_height:', $ae_app.iframe_height);
|
||||
|
||||
// let iframe_height = $ae_app.iframe_height;
|
||||
|
||||
window.parent.postMessage({'iframe_height': $ae_app.iframe_height}, "*"); // This should be in pixels
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct_trigger == 'load__sponsorship_obj_li' && $slct.account_id) {
|
||||
if ($ae_app.sponsorships.qry_status == 'loading') {
|
||||
console.log('*** $ae_app.sponsorships.qry_status == loading ***');
|
||||
|
||||
setTimeout(() => {
|
||||
console.log("Delayed for X second.");
|
||||
$slct_trigger = null;
|
||||
handle_load_ae_sponsorship_obj_li({account_id: $slct.account_id, try_cache: false});
|
||||
}, 250);
|
||||
} else {
|
||||
console.log('*** $ae_app.sponsorships.qry_status != loading ***');
|
||||
$slct_trigger = null;
|
||||
handle_load_ae_sponsorship_obj_li({account_id: $slct.account_id, try_cache: false});
|
||||
}
|
||||
}
|
||||
|
||||
async function handle_load_ae_sponsorship_obj_li({account_id, try_cache=true}) {
|
||||
console.log('*** handle_load_ae_sponsorship_obj_li() ***');
|
||||
console.log($ae_app.sponsorships);
|
||||
|
||||
let fulltext_search_qry_str = $ae_app.sponsorships.fulltext_search_qry_str;
|
||||
let qry_virtual = $ae_app.sponsorships.qry_virtual;
|
||||
let qry_physical = $ae_app.sponsorships.qry_physical;
|
||||
let qry_type = $ae_app.sponsorships.qry_type;
|
||||
|
||||
let enabled = $ae_app.sponsorships.enabled;
|
||||
let hidden = $ae_app.sponsorships.hidden;
|
||||
let limit = $ae_app.sponsorships.limit;
|
||||
let offset = $ae_app.sponsorships.offset;
|
||||
|
||||
let params = {};
|
||||
// params['archived'] = 'all';
|
||||
// params['conference'] = false;
|
||||
// params['inc_address'] = true;
|
||||
// params['inc_contact'] = true;
|
||||
|
||||
let params_json: key_val = {};
|
||||
// if (fulltext_search_qry_str && fulltext_search_qry_str.length > 2) {
|
||||
// params_json['ft_qry'] = {
|
||||
// 'default_qry_str': fulltext_search_qry_str,
|
||||
// 'location_address_json': fulltext_search_qry_str,
|
||||
// 'contact_li_json': fulltext_search_qry_str,
|
||||
// 'address_default_qry_str': fulltext_search_qry_str, // NOTE: Remove after going live with OSIT ae?
|
||||
// 'contact_1_default_qry_str': fulltext_search_qry_str, // NOTE: Remove after going live with OSIT ae?
|
||||
// };
|
||||
// }
|
||||
|
||||
// if (qry_virtual || qry_physical || qry_type) {
|
||||
// params_json['and_qry'] = {};
|
||||
// if (qry_virtual) params_json['and_qry']['virtual'] = true;
|
||||
// if (qry_physical) params_json['and_qry']['physical'] = true;
|
||||
// if (qry_type) params_json['and_qry']['type'] = qry_type;
|
||||
// }
|
||||
|
||||
// console.log('params_json:', params_json);
|
||||
// console.log(params_json);
|
||||
|
||||
// NOTE: I am not sure if this is actually needed. It may save a little space in the URL.
|
||||
// if (JSON.stringify(params_json) == JSON.stringify({})) {
|
||||
// params_json = null;
|
||||
// }
|
||||
$ae_app.sponsorships.qry_status = 'loading';
|
||||
ae_sponsorship_obj_li_get_promise = api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'sponsorship',
|
||||
for_obj_type: 'account',
|
||||
for_obj_id: account_id,
|
||||
use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value in the API config.
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
// order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'created_on': 'DESC', 'updated_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
params: params,
|
||||
log_lvl: 2
|
||||
})
|
||||
|
||||
.then(function (sponsorship_obj_li_get_result) {
|
||||
if (sponsorship_obj_li_get_result) {
|
||||
$slct.sponsorship_obj_li = sponsorship_obj_li_get_result;
|
||||
console.log(`Sponsorship list:`, $slct.sponsorship_obj_li);
|
||||
} else {
|
||||
$slct.sponsorship_obj_li = [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
})
|
||||
.finally(function () {
|
||||
$ae_app.sponsorships.qry_status = 'done';
|
||||
});
|
||||
|
||||
return ae_sponsorship_obj_li_get_promise;
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct_trigger == 'load__sponsorship_obj' && $slct.sponsorship_id) {
|
||||
$slct_trigger = null;
|
||||
|
||||
handle_load_sponsorship_id_obj({sponsorship_id: $slct.sponsorship_id, try_cache: false});
|
||||
|
||||
// Auto show the selected Sponsorship ID
|
||||
// Is this pushState needed here?
|
||||
// Set the URL param "sponsorship_id" to the current Sponsorship ID. This is a just in case.
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('sponsorship_id', $slct.sponsorship_id);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// Is this postMessage needed here?
|
||||
// let message = {'sponsorship_id': $slct.sponsorship_id};
|
||||
// window.parent.postMessage(message, "*");
|
||||
|
||||
// $ae_app.sponsorships.show_main__options = false;
|
||||
// $ae_app.sponsorships.show_list__sponsorship_obj_li = false;
|
||||
// $ae_app.sponsorships.show_view__sponsorship_obj = true;
|
||||
// $ae_app.sponsorships.show_edit__sponsorship_obj = false;
|
||||
}
|
||||
|
||||
async function handle_load_sponsorship_id_obj({sponsorship_id, try_cache=false}) {
|
||||
console.log('*** handle_load_sponsorship_id_obj() ***');
|
||||
|
||||
// let enabled = $ae_app.sponsorships.enabled;
|
||||
// let hidden = $ae_app.sponsorships.hidden;
|
||||
// let limit = $ae_app.sponsorships.limit;
|
||||
// let offset = $ae_app.sponsorships.offset;
|
||||
|
||||
let params = {};
|
||||
|
||||
ae_sponsorship_obj_get_promise = api.get_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'event',
|
||||
obj_id: sponsorship_id,
|
||||
use_alt_table: true, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
use_alt_base: true, // NOTE: This will use the base_name_alt value instead of the base_name value in the API config.
|
||||
params: params,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (sponsorship_obj_get_result) {
|
||||
if (sponsorship_obj_get_result) {
|
||||
$slct.sponsorship_obj = sponsorship_obj_get_result;
|
||||
console.log(`Sponsorship object:`, $slct.sponsorship_obj);
|
||||
}
|
||||
|
||||
// Auto show the selected Sponsorship ID
|
||||
// Is this pushState needed here?
|
||||
// Set the URL param "sponsorship_id" to the current Sponsorship ID.
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('sponsorship_id', $slct.sponsorship_id);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
// Is this postMessage needed here?
|
||||
let message = {'sponsorship_id': $slct.sponsorship_id};
|
||||
window.parent.postMessage(message, "*");
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return ae_sponsorship_obj_get_promise;
|
||||
}
|
||||
|
||||
function handle_created_sponsorship_obj(event) {
|
||||
console.log('*** handle_created_sponsorship_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
handle_load_sponsorship_id_obj({sponsorship_id: $slct.sponsorship_id, try_cache: false});
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('sponsorship_id', $slct.sponsorship_id);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'sponsorship_id': $slct.sponsorship_id};
|
||||
window.parent.postMessage(message, "*");
|
||||
|
||||
// $slct_trigger = 'load__sponsorship_obj';
|
||||
$slct_trigger = 'load__sponsorship_obj_li';
|
||||
|
||||
$ae_app.sponsorships.show_main__options = false;
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = false;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = true;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = false;
|
||||
}
|
||||
|
||||
function handle_updated_sponsorship_obj(event) {
|
||||
console.log('*** handle_updated_sponsorship_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
// $slct_trigger = 'load__sponsorship_obj';
|
||||
$slct_trigger = 'load__sponsorship_obj_li';
|
||||
|
||||
$ae_app.sponsorships.show_main__options = false;
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = false;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = true;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = false;
|
||||
}
|
||||
|
||||
function handle_deleted_sponsorship_obj(event) {
|
||||
console.log('*** handle_deleted_sponsorship_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('sponsorship_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'sponsorship_id': null};
|
||||
window.parent.postMessage(message, "*");
|
||||
|
||||
$slct_trigger = 'load__sponsorship_obj_li';
|
||||
|
||||
$ae_app.sponsorships.show_main__options = true;
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = true;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = false;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = false;
|
||||
}
|
||||
|
||||
|
||||
function handle_submit_form(event) {
|
||||
console.log('*** handle_submit_form() ***');
|
||||
console.log(event);
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
return false;
|
||||
}
|
||||
function handle_cancel_form(event) {
|
||||
console.log('*** handle_cancel_form() ***');
|
||||
console.log(event);
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function handle_oninput_fulltext_search_qry_str(event) {
|
||||
console.log('*** handle_oninput_fulltext_search_qry_str() ***');
|
||||
console.log(event);
|
||||
|
||||
// Check if this variable is a promise. The last query may still be being processed.
|
||||
// if (!ae_sponsorship_obj_li_get_promise.promise) {
|
||||
// console.log('*** handle_oninput_fulltext_search_qry_str() ***');
|
||||
// console.log('*** Promise is still processing. ***');
|
||||
// console.log(ae_sponsorship_obj_li_get_promise);
|
||||
// ae_sponsorship_obj_li_get_promise.promise.finally(() => { ae_sponsorship_obj_li_get_promise.promise.done = true; });
|
||||
// } else {
|
||||
// $slct_trigger = 'load__sponsorship_obj_li';
|
||||
// }
|
||||
// if (ae_sponsorship_obj_li_get_promise && ae_sponsorship_obj_li_get_promise.then) {
|
||||
// console.log('*** handle_oninput_fulltext_search_qry_str() ***');
|
||||
// console.log('*** Promise is still processing. ***');
|
||||
// console.log(ae_sponsorship_obj_li_get_promise);
|
||||
// $slct_trigger = 'load__sponsorship_obj_li';
|
||||
// return;
|
||||
// }
|
||||
|
||||
// fulltext_search_qry_str = event.target.value;
|
||||
|
||||
// if ($ae_app.sponsorships.fulltext_search_qry_str.length > 2) {
|
||||
// } else {
|
||||
// $ae_app.sponsorships.fulltext_search_qry_str = '';
|
||||
// }
|
||||
$slct_trigger = 'load__sponsorship_obj_li';
|
||||
}
|
||||
|
||||
async function handle_get_data_store_obj_w_code({code, data_type='text'}) {
|
||||
console.log('*** handle_get_data_store_obj_w_code() ***');
|
||||
|
||||
let get_item_result = window.localStorage.getItem(code);
|
||||
if (get_item_result) {
|
||||
$ae_app.sponsorships.ds[code] = get_item_result;
|
||||
} else {
|
||||
console.log('Get local storage item miss.');
|
||||
}
|
||||
|
||||
data_store_obj_get_promise = api.get_data_store_obj_w_code({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
data_store_code: code,
|
||||
data_type: data_type,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (get_data_store_result) {
|
||||
if (get_data_store_result) {
|
||||
|
||||
if (data_type == 'text') {
|
||||
// console.log(get_data_store_result.text);
|
||||
$ae_app.sponsorships.ds[code] = get_data_store_result.text;
|
||||
} else if (data_type == 'json') {
|
||||
// console.log(get_data_store_result.json);
|
||||
$ae_app.sponsorships.ds[code] = get_data_store_result.json;
|
||||
}
|
||||
|
||||
// console.log(`Code: ${$ae_app.sponsorships.ds[code]}`);
|
||||
// console.log(`Code:`, $ae_app.sponsorships.ds[code]);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- <svelte:window
|
||||
bind:outerHeight={ae_iframe_height}
|
||||
/> -->
|
||||
|
||||
|
||||
<section id="osit_ae_sponsorships" class="osit_sponsorships ae_main c_ae c_ae_sponsorships ae_main" bind:clientHeight={$ae_app.iframe_height}>
|
||||
<header>
|
||||
<h1>Sponsorships for One Sky IT Demo</h1>
|
||||
</header>
|
||||
|
||||
<section class="ae_section ae_meta">
|
||||
<p>
|
||||
ae: {($ae_app.ae_full_name ? $ae_app.ae_full_name : 'Name not set')}
|
||||
<span class="details">
|
||||
(
|
||||
{($ae_app.ae_email ? $ae_app.ae_email : 'Email not set')}
|
||||
{#if $ae_app.administrator_access}
|
||||
<span class="access_type administrator_access">Administrator</span>
|
||||
{:else if $ae_app.trusted_access}
|
||||
<span class="access_type trusted_access">Trusted</span>
|
||||
{/if}
|
||||
<span class="ae_user">{$ae_app.ae_user ? $ae_app.ae_user : 'User not set'}</span>
|
||||
)
|
||||
</span>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<div class="ae_overview">
|
||||
<div class="ae_info ds__sponsorships_info ">
|
||||
{@html $ae_app.sponsorships.ds.sponsorships_info}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if $ae_app.sponsorships.show_main__options}
|
||||
<section class="ae_section ae_options ae_column sponsorship_obj__options">
|
||||
<div class="ae_note ds__sponsorships_options ">
|
||||
{@html $ae_app.sponsorships.ds.sponsorships_options}
|
||||
</div>
|
||||
|
||||
<div class="filters_and_search">
|
||||
|
||||
|
||||
|
||||
<form on:submit|preventDefault={handle_submit_form} on:keydown={e => e.key === 'Escape' && handle_cancel_form} class="search_form">
|
||||
<div class="ae_group">
|
||||
<input
|
||||
type="search"
|
||||
placeholder="Search (name, description, etc.)"
|
||||
id="meeting_fulltext_search_qry_str"
|
||||
name="fulltext_search_qry_str"
|
||||
bind:value={$ae_app.sponsorships.fulltext_search_qry_str}
|
||||
style="width: 50%;"
|
||||
class="bs-input"
|
||||
>
|
||||
<button
|
||||
on:click={handle_oninput_fulltext_search_qry_str}
|
||||
>
|
||||
<span class="fas fa-search"></span> Search
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
<legend>Filter on?</legend>
|
||||
<div class="ae_row ae_flex_justify_around ae_width_md">
|
||||
<label>Paid
|
||||
<input
|
||||
name="qry_paid"
|
||||
type="checkbox"
|
||||
bind:checked={$ae_app.sponsorships.qry_paid}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
>
|
||||
</label>
|
||||
<label>Guests
|
||||
<input
|
||||
name="qry_guest_li"
|
||||
type="checkbox"
|
||||
bind:checked={$ae_app.sponsorships.qry_guest_li}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Select level?</legend>
|
||||
<div class="ae_row ae_flex_justify_around ae_width_100">
|
||||
<label>All
|
||||
<input
|
||||
name="qry_type"
|
||||
type="radio"
|
||||
value=""
|
||||
bind:group={$ae_app.sponsorships.qry_type}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
title="Show all meeting types"
|
||||
>
|
||||
</label>
|
||||
<label>Friend ($5,000)
|
||||
<input
|
||||
name="qry_type"
|
||||
type="radio"
|
||||
value="Friend"
|
||||
bind:group={$ae_app.sponsorships.qry_type}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
title="Friend ($5,000)"
|
||||
>
|
||||
</label>
|
||||
<label>Supporter ($7,500)
|
||||
<input
|
||||
name="qry_type"
|
||||
type="radio"
|
||||
value="Supporter"
|
||||
bind:group={$ae_app.sponsorships.qry_type}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
title="Supporter ($7,500)"
|
||||
>
|
||||
</label>
|
||||
<label>Champion ($12,500)
|
||||
<input
|
||||
name="qry_type"
|
||||
type="radio"
|
||||
value="Champion"
|
||||
bind:group={$ae_app.sponsorships.qry_type}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
title="Champion ($12,500)"
|
||||
>
|
||||
</label>
|
||||
<label>Advocate ($20,000)
|
||||
<input
|
||||
name="qry_type"
|
||||
type="radio"
|
||||
value="Advocate"
|
||||
bind:group={$ae_app.sponsorships.qry_type}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
title="Advocate ($20,000)"
|
||||
>
|
||||
</label>
|
||||
<label>Presenting Partner ($30,000)
|
||||
<input
|
||||
name="qry_type"
|
||||
type="radio"
|
||||
value="Presenting Partner"
|
||||
bind:group={$ae_app.sponsorships.qry_type}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
title="Presenting Partner ($30,000)"
|
||||
>
|
||||
</label>
|
||||
<label>Signature Partner ($50,000)
|
||||
<input
|
||||
name="qry_type"
|
||||
type="radio"
|
||||
value="Signature Partner"
|
||||
bind:group={$ae_app.sponsorships.qry_type}
|
||||
on:change={() => {$slct_trigger = 'load__sponsorship_obj_li';}}
|
||||
title="Signature Partner ($50,000)"
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
|
||||
{#await ae_sponsorship_obj_li_get_promise}
|
||||
<div><span class="fas fa-spinner"></span>
|
||||
Loading sponsorships...</div>
|
||||
{:then ae_sponsorship_obj_li_get_result}
|
||||
<!-- <p>Sponsorship list: {ae_sponsorship_obj_li_get_result}</p> -->
|
||||
{:catch error}
|
||||
<div>Error: {error.message}</div>
|
||||
{/await}
|
||||
|
||||
<div class="ae_group ae_row">
|
||||
|
||||
{#if $ae_app.trusted_access && $ae_app.sponsorships.hidden == 'not_hidden'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.sponsorships.hidden = 'all';
|
||||
$ae_app.sponsorships.limit = 150;
|
||||
$slct_trigger = 'load__sponsorship_obj_li';
|
||||
}}
|
||||
class="btn_show_bb_post ae_btn btn btn-info"
|
||||
>
|
||||
<span class="fas fa-eye"></span> Show Hidden Sponsorships
|
||||
</button>
|
||||
{:else if $ae_app.trusted_access && $ae_app.sponsorships.hidden == 'all'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.sponsorships.hidden = 'not_hidden';
|
||||
$slct_trigger = 'load__sponsorship_obj_li';
|
||||
}}
|
||||
class="btn_hide_bb_post ae_btn btn btn-info"
|
||||
>
|
||||
<span class="fas fa-eye-slash"></span> Hide Hidden Sponsorships
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if $ae_app.administrator_access && $ae_app.sponsorships.enabled == 'enabled'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.sponsorships.hidden = 'all';
|
||||
$ae_app.sponsorships.enabled = 'all';
|
||||
$ae_app.sponsorships.limit = 500;
|
||||
$slct_trigger = 'load__sponsorship_obj_li';
|
||||
}}
|
||||
class="btn_show_bb_post ae_btn btn btn-warning"
|
||||
>
|
||||
<span class="fas fa-eye"></span> Show Disabled Sponsorships
|
||||
</button>
|
||||
{:else if $ae_app.administrator_access && $ae_app.sponsorships.enabled == 'all'}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.sponsorships.enabled = 'enabled';
|
||||
$slct_trigger = 'load__sponsorship_obj_li';
|
||||
}}
|
||||
class="btn_hide_bb_post ae_btn btn btn-warning"
|
||||
>
|
||||
<span class="fas fa-eye-slash"></span> Hide Disabled Sponsorships
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.sponsorship_id = null;
|
||||
$slct.sponsorship_obj = {};
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('sponsorship_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
$ae_app.sponsorships.show_main__options = false;
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = false;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = false;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = true;
|
||||
|
||||
$ae_session.test.sponsorships = 'Hello World! Create new Sponsorship was clicked!';
|
||||
$ae_session.test_xyz.sponsorships = 'Hello World! Create new Sponsorship was clicked!';
|
||||
}}
|
||||
class="btn_new_recovery_meeting ae_btn btn btn-secondary"
|
||||
>
|
||||
<span class="fas fa-plus"></span> Create new Sponsorship
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div> <!-- END: div filters_and_search -->
|
||||
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
|
||||
{#if $slct.sponsorship_obj_li && $ae_app.sponsorships.show_list__sponsorship_obj_li}
|
||||
<List_sponsorship_obj />
|
||||
{/if}
|
||||
|
||||
|
||||
{#if $ae_app.sponsorships.show_edit__sponsorship_obj}
|
||||
<!-- <section class="ae_edit sponsorship_obj sponsorship_id ae_sponsorship_id_edit"> -->
|
||||
<Element_modal_v3
|
||||
show = { true }
|
||||
modal_cover_body = { false }
|
||||
report_client_dimensions = { true }
|
||||
on:close={ () => {
|
||||
$ae_app.sponsorships.show_main__options = true;
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = true;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = false;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = false;
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('sponsorship_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'sponsorship_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;
|
||||
}}
|
||||
>
|
||||
<span slot="header_title">{@html ($slct.sponsorship_obj.name ? $slct.sponsorship_obj.name : 'New Sponsorship')}</span>
|
||||
|
||||
<span slot="body">
|
||||
|
||||
<Edit_sponsorship_obj
|
||||
on:created__meeting_obj={handle_created_sponsorship_obj}
|
||||
on:updated__meeting_obj={handle_updated_sponsorship_obj}
|
||||
on:deleted__meeting_obj={handle_deleted_sponsorship_obj}
|
||||
/>
|
||||
|
||||
</span>
|
||||
</Element_modal_v3>
|
||||
<!-- </section> -->
|
||||
{/if}
|
||||
|
||||
|
||||
{#if $ae_app.sponsorships.show_view__sponsorship_obj && $slct.sponsorship_obj}
|
||||
<!-- <section class="ae_view sponsorship_obj sponsorship_id ae_sponsorship_id_view"> -->
|
||||
<Element_modal_v3
|
||||
show = { true }
|
||||
modal_cover_body = { false }
|
||||
report_client_dimensions = { true }
|
||||
on:close={ () => {
|
||||
$slct.sponsorship_id = null;
|
||||
$slct.sponsorship_obj = {};
|
||||
|
||||
$ae_app.sponsorships.show_main__options = true;
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = true;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = false;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = false;
|
||||
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('sponsorship_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'sponsorship_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;
|
||||
}}
|
||||
>
|
||||
<span slot="header_title">{@html $slct.sponsorship_obj.name}</span>
|
||||
|
||||
<span slot="body">
|
||||
|
||||
<View_sponsorship_obj />
|
||||
|
||||
</span>
|
||||
</Element_modal_v3>
|
||||
<!-- </section> -->
|
||||
{/if}
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
/* .ae_meta {
|
||||
font-size: smaller;
|
||||
color: hsla(0,0%,50%,1);
|
||||
} */
|
||||
|
||||
/* .ae_edit.sponsorship_obj {
|
||||
border: dashed thin hsla(0,0%,70%,1);
|
||||
|
||||
margin: .5em .25em;
|
||||
padding: .5em .25em;
|
||||
|
||||
background-color: hsla(0,0%,90%,1);
|
||||
} */
|
||||
|
||||
/* .ae_view.sponsorship_obj {
|
||||
border: dashed thin hsla(0,0%,70%,1);
|
||||
|
||||
margin: .5em .25em;
|
||||
padding: .5em .25em;
|
||||
|
||||
background-color: hsla(0,0%,90%,1);
|
||||
} */
|
||||
|
||||
/* :global(.ae_edit.sponsorship_id .element_ae_modal) {
|
||||
border: dashed thin hsla(0,0%,70%,1);
|
||||
|
||||
margin: .5em .25em;
|
||||
padding: .5em .25em;
|
||||
|
||||
background-color: hsla(0,0%,90%,1);
|
||||
} */
|
||||
|
||||
</style>
|
||||
@@ -1,706 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { ae, api, Element_input, Element_input_file_hashing } from 'aether_npm_lib';
|
||||
import { slct, ae_app } from './stores';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
$ae_app.archives.input_file_list = []
|
||||
|
||||
let create_archive_content_obj_promise: any;
|
||||
let delete_archive_content_obj_promise: any;
|
||||
let update_archive_content_obj_promise: any;
|
||||
let upload__hosted_file_obj_promise: any;
|
||||
|
||||
let disable_submit_btn = true;
|
||||
|
||||
if ($slct.archive_content_id) {
|
||||
console.log(`Archive Content ID selected: ${$slct.archive_content_id}`);
|
||||
console.log(`Archive Content Object selected: ${$slct.archive_content_obj}`)
|
||||
} else {
|
||||
$slct.archive_content_id = null;
|
||||
$slct.archive_content_obj = {
|
||||
archive_id_random: null,
|
||||
// archive_content_id_random: null,
|
||||
archive_content_type: null,
|
||||
name: null,
|
||||
description: null,
|
||||
content_html: null,
|
||||
// hosted_file_id_random: null,
|
||||
file_path: null,
|
||||
filename: null,
|
||||
file_extension: null,
|
||||
original_datetime: null,
|
||||
original_timezone: null,
|
||||
original_location: null,
|
||||
original_url: null,
|
||||
original_url_text: null,
|
||||
access_key: null, // or passcode?
|
||||
|
||||
enable: true,
|
||||
hide: false,
|
||||
priority: null,
|
||||
sort: null,
|
||||
notes: null,
|
||||
};
|
||||
console.log(`Archive Content Object started: ${$slct.archive_content_obj}`)
|
||||
}
|
||||
|
||||
|
||||
if ($slct.archive_content_obj) {
|
||||
|
||||
} else {
|
||||
console.log(`Archive Content Object started: ${$slct.archive_content_obj}`)
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** Edit - Archive Content Obj');
|
||||
|
||||
tinymce_remove(); // This seems to fix rendering issues
|
||||
tinymce_init();
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
console.log('** Component Destroyed: ** Edit - Event Obj');
|
||||
tinymce_remove(); // This seems like the right thing to do
|
||||
});
|
||||
|
||||
|
||||
// let ae_iframe_height = window.outerHeight;
|
||||
let ae_iframe_height = window.innerHeight;
|
||||
console.log(`ae_iframe_height: ${ae_iframe_height}`);
|
||||
$: if (ae_iframe_height) {
|
||||
console.log('ae_iframe_height changed:', ae_iframe_height);
|
||||
|
||||
let iframe_height = ae_iframe_height; // TESTING!!!
|
||||
|
||||
// window.parent.postMessage({'iframe_height': `${iframe_height}px`}, "*");
|
||||
window.parent.postMessage({'iframe_height': iframe_height}, "*");
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct.archive_content_obj) {
|
||||
console.log('Selected archive_content object changed?');
|
||||
console.log($slct.archive_content_obj);
|
||||
|
||||
if ($slct.archive_content_obj == null) {
|
||||
$slct.archive_content_obj = {title: null, content: null, name: null, description: null, notes: null, created_on: null, updated_on: null};
|
||||
} else {
|
||||
disable_submit_btn = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function handle_submit_form(event) {
|
||||
console.log('*** handle_submit_form() ***');
|
||||
|
||||
disable_submit_btn = true;
|
||||
|
||||
let form_data = new FormData(event.target);
|
||||
console.log(form_data);
|
||||
|
||||
let form_archive_content_data = ae.util.extract_prefixed_form_data({prefix: null, form_data: form_data, trim_values: true, bool_tf_str: true, log_lvl: 0});
|
||||
console.log(form_archive_content_data);
|
||||
|
||||
let archive_content_data: key_val = {};
|
||||
|
||||
if (!$slct.archive_content_id) {
|
||||
archive_content_data['account_id_random'] = $ae_app.account_id;
|
||||
archive_content_data['archive_id_random'] = $slct.archive_id;
|
||||
// archive_content_data['enable'] = true;
|
||||
}
|
||||
|
||||
archive_content_data['name'] = form_archive_content_data.name;
|
||||
if (tinyMCE.get('description')) {
|
||||
archive_content_data['description'] = tinyMCE.get('description').getContent();
|
||||
} else {
|
||||
archive_content_data['description'] = form_archive_content_data.description;
|
||||
}
|
||||
|
||||
if (tinyMCE.get('content_html')) {
|
||||
archive_content_data['content_html'] = tinyMCE.get('content_html').getContent();
|
||||
} else {
|
||||
archive_content_data['content_html'] = form_archive_content_data.content_html;
|
||||
}
|
||||
|
||||
if (form_archive_content_data.archive_content_type) {
|
||||
archive_content_data['archive_content_type'] = form_archive_content_data.archive_content_type;
|
||||
} else {
|
||||
archive_content_data['archive_content_type'] = null;
|
||||
}
|
||||
|
||||
archive_content_data['enable_for_public'] = !!!form_archive_content_data.enable_for_public;
|
||||
|
||||
archive_content_data['file_path'] = form_archive_content_data.file_path;
|
||||
archive_content_data['filename'] = form_archive_content_data.filename.trim();
|
||||
archive_content_data['file_extension'] = form_archive_content_data.file_extension.trim();
|
||||
|
||||
let date_time_str = null;
|
||||
let date_part = form_archive_content_data.original_datetime_date.trim();
|
||||
let time_part = form_archive_content_data.original_datetime_time.trim();
|
||||
if (date_part && time_part) {
|
||||
date_time_str = `${date_part} ${time_part}`;
|
||||
} else if (date_part) {
|
||||
date_time_str = `${date_part}T00:00:00`;
|
||||
} else if (time_part) {
|
||||
// date_time_str = `${time_part}`;
|
||||
date_time_str = false;
|
||||
}
|
||||
archive_content_data['original_datetime'] = date_time_str;
|
||||
|
||||
archive_content_data['original_timezone'] = form_archive_content_data.original_timezone;
|
||||
|
||||
archive_content_data['original_location'] = form_archive_content_data.original_location;
|
||||
|
||||
archive_content_data['hide'] = !!form_archive_content_data.hide;
|
||||
archive_content_data['priority'] = !!form_archive_content_data.priority;
|
||||
if (form_archive_content_data.sort) {
|
||||
// Change this to a number type
|
||||
archive_content_data['sort'] = Number(form_archive_content_data.sort);
|
||||
} else {
|
||||
archive_content_data['sort'] = null;
|
||||
}
|
||||
if (form_archive_content_data.group) {
|
||||
archive_content_data['group'] = form_archive_content_data.group;
|
||||
} else {
|
||||
archive_content_data['group'] = null;
|
||||
}
|
||||
if (archive_content_data['enable']) {
|
||||
archive_content_data['enable'] = !!form_archive_content_data.enable;
|
||||
}
|
||||
|
||||
if (tinyMCE.get('notes')) {
|
||||
archive_content_data['notes'] = tinyMCE.get('notes').getContent();
|
||||
} else {
|
||||
archive_content_data['notes'] = form_archive_content_data.notes;
|
||||
}
|
||||
|
||||
console.log(archive_content_data);
|
||||
|
||||
if (!$slct.archive_content_id) {
|
||||
create_archive_content_obj_promise = api.create_ae_obj_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive_content',
|
||||
fields: archive_content_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(async function (archive_content_obj_create_result) {
|
||||
if (!archive_content_obj_create_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$slct.archive_content_id = archive_content_obj_create_result.obj_id_random;
|
||||
|
||||
// Get ready to upload the file now that we have a new archive_content_id.
|
||||
const form_data = new FormData();
|
||||
|
||||
form_data.append('account_id', $ae_app.account_id);
|
||||
form_data.append('link_to_type', 'archive_content');
|
||||
form_data.append('link_to_id', $slct.archive_content_id);
|
||||
|
||||
for (let i = 0; i < event.target.file_list.files.length; i++) {
|
||||
form_data.append(`file_list`, event.target.archive_content_file_upload_list.files[i]);
|
||||
}
|
||||
|
||||
let params = null;
|
||||
|
||||
let endpoint = '/hosted_file/upload_files';
|
||||
|
||||
console.log(form_data);
|
||||
|
||||
params = null;
|
||||
|
||||
// Uncomment and the post_promise is not seen by the "await" below
|
||||
// post_promise = await api.post_object({api_cfg: $cfg.api, endpoint: endpoint, params: params, data:form_data});
|
||||
// Uncomment so that the post_promise is not seen by the "await" below
|
||||
upload__hosted_file_obj_promise = await api.post_object({api_cfg: $ae_app.ae_api, endpoint: endpoint, params: params, form_data: form_data});
|
||||
console.log(upload__hosted_file_obj_promise);
|
||||
let hosted_file_id = upload__hosted_file_obj_promise[0].hosted_file_id_random;
|
||||
|
||||
archive_content_data = {};
|
||||
archive_content_data['hosted_file_id_random'] = hosted_file_id;
|
||||
archive_content_data['file_path'] = `/hosted_file/download/${hosted_file_id}?filename=${form_archive_content_data.filename.trim()}`;
|
||||
archive_content_data['archive_content_type'] = 'hosted_file';
|
||||
|
||||
update_archive_content_obj_promise = await api.update_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive_content',
|
||||
obj_id: $slct.archive_content_id,
|
||||
fields: archive_content_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (archive_content_obj_update_result) {
|
||||
if (!archive_content_obj_update_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
return archive_content_obj_update_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
// update_archive_content_obj_promise = await update_archive_content_obj({archive_content_id: $slct.archive_content_id, data: archive_content_data})
|
||||
// console.log(update_archive_content_obj_promise);
|
||||
return update_archive_content_obj_promise
|
||||
})
|
||||
.then(function (archive_content_obj_create_result) {
|
||||
|
||||
dispatch(
|
||||
'created__archive_content_obj',
|
||||
{
|
||||
archive_content_id: $slct.archive_content_id,
|
||||
}
|
||||
);
|
||||
|
||||
return archive_content_obj_create_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
return create_archive_content_obj_promise;
|
||||
|
||||
} else {
|
||||
update_archive_content_obj_promise = api.update_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive_content',
|
||||
obj_id: $slct.archive_content_id,
|
||||
fields: archive_content_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (archive_content_obj_update_result) {
|
||||
if (!archive_content_obj_update_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
|
||||
dispatch(
|
||||
'updated__archive_content_obj',
|
||||
{
|
||||
archive_content_id: $slct.archive_content_id,
|
||||
}
|
||||
);
|
||||
|
||||
return archive_content_obj_update_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
return update_archive_content_obj_promise;
|
||||
}
|
||||
}
|
||||
|
||||
function handle_input_file_list_updated(event) {
|
||||
console.log(event.detail.element_id);
|
||||
console.log(event.detail.input_file_list);
|
||||
console.log(event.detail.input_file_list_processed);
|
||||
|
||||
// This now needs be reviewed and possibly updated with additional information. Check if any files have already been uploaded in the past and ignore.
|
||||
let new_upload_list = event.detail.input_file_list_processed;
|
||||
$ae_app.archives.input_file_list = new_upload_list;
|
||||
// Setting the first file as the default. For now other files are ignored?
|
||||
if (new_upload_list.length) {
|
||||
$ae_app.archives.input_filename = new_upload_list[0].filename;
|
||||
$ae_app.archives.input_file_extension = new_upload_list[0].guessed_extension;
|
||||
} else {
|
||||
$ae_app.archives.input_filename = '';
|
||||
$ae_app.archives.input_file_extension = '';
|
||||
}
|
||||
|
||||
// for (let file_upload_item of new_upload_list) {
|
||||
// console.log(file_upload_item);
|
||||
|
||||
// filename = file_upload_item.filename;
|
||||
// file_extension = file_upload_item.guessed_extension;
|
||||
// }
|
||||
}
|
||||
|
||||
$ae_app.archives.form_file_upload_list = [];
|
||||
|
||||
async function handle_delete_archive_content_obj({archive_content_id, hosted_file_id=null, method='delete'}) {
|
||||
console.log('*** handle_delete_archive_content_obj() ***');
|
||||
|
||||
if (hosted_file_id) {
|
||||
let delete_hosted_file_obj_promise = api.delete_hosted_file({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
hosted_file_id: hosted_file_id,
|
||||
link_to_type: 'archive_content',
|
||||
link_to_id: archive_content_id,
|
||||
rm_orphan: true,
|
||||
// params: params,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 2
|
||||
})
|
||||
.then(function (hosted_file_obj_delete_result) {
|
||||
if (hosted_file_obj_delete_result) {
|
||||
// console.log(`Result:`, hosted_file_obj_delete_result);
|
||||
|
||||
dispatch(
|
||||
'deleted__hosted_file_obj',
|
||||
{
|
||||
hosted_file_id: hosted_file_id,
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('The result was null or false when trying to delete.', error);
|
||||
});
|
||||
}
|
||||
|
||||
delete_archive_content_obj_promise = api.delete_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive_content',
|
||||
obj_id: archive_content_id,
|
||||
method: method,
|
||||
// params: params,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (archive_content_obj_delete_result) {
|
||||
if (archive_content_obj_delete_result) {
|
||||
// console.log(`Result:`, archive_content_obj_delete_result);
|
||||
|
||||
dispatch(
|
||||
'deleted__archive_content_obj',
|
||||
{
|
||||
archive_content_id: archive_content_id,
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('The result was null or false when trying to delete.', error);
|
||||
});
|
||||
|
||||
return delete_archive_content_obj_promise;
|
||||
}
|
||||
|
||||
function tinymce_init() {
|
||||
// REFERENCE: https://www.tiny.cloud/docs/tinymce/6/basic-setup/
|
||||
// plugins: [
|
||||
// 'advlist', 'autolink', 'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak',
|
||||
// 'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime',
|
||||
// 'media', 'table', 'emoticons', 'template', 'help'
|
||||
// ],
|
||||
// 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent'
|
||||
|
||||
// NOTE: Regular version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_regular',
|
||||
// width: 600,
|
||||
height: 400,
|
||||
plugins: [ 'advlist', 'autolink', 'link', 'lists', 'anchor', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: 'undo redo | styles | bold italic | alignleft aligncenter alignright | bullist numlist outdent indent | link | code | help',
|
||||
});
|
||||
|
||||
// NOTE: Basic version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_basic',
|
||||
// width: 600,
|
||||
height: 400,
|
||||
plugins: [ 'lists', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: 'undo redo | styles | bold italic | alignleft aligncenter | bullist numlist outdent indent | code | help',
|
||||
});
|
||||
|
||||
// NOTE: Minimal version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_basic_200',
|
||||
// width: 600,
|
||||
height: 200,
|
||||
plugins: [ 'lists', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: 'undo redo | styles | bold italic | alignleft aligncenter | bullist numlist outdent indent | code | help',
|
||||
});
|
||||
|
||||
// NOTE: Less is more version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_less_100',
|
||||
// width: 600,
|
||||
height: 100,
|
||||
// plugins: [ 'lists', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: false,
|
||||
statusbar: false,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function tinymce_remove() {
|
||||
tinymce.remove('.tinymce_editor.editor_regular');
|
||||
tinymce.remove('.tinymce_editor.editor_basic');
|
||||
tinymce.remove('.tinymce_editor.editor_basic_200');
|
||||
tinymce.remove('.tinymce_editor.editor_less_100');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section
|
||||
class="svelte_component ae_edit archive_content_obj"
|
||||
class:ae_create={!$slct.archive_content_id}
|
||||
>
|
||||
<!-- bind:clientHeight={ae_iframe_height} -->
|
||||
|
||||
<form on:submit|preventDefault={handle_submit_form} class="">
|
||||
|
||||
{#await update_archive_content_obj_promise}
|
||||
<div class="awaiting alert_msg_pulse" out:fade={{ duration: 2000 }}>Saving...</div>
|
||||
{:then}
|
||||
{#if update_archive_content_obj_promise}
|
||||
<div class="awaiting" out:fade={{ duration: 2000 }}>Finished saving</div>
|
||||
{:else}
|
||||
<!-- <div class="awaiting" out:fade={{ duration: 2000 }}>Nothing here yet</div> -->
|
||||
{/if}
|
||||
{/await}
|
||||
|
||||
<h3>Archive Content</h3>
|
||||
|
||||
<label for="title">Name of Content
|
||||
<input type="text" id="name" name="name" required max="200" value={$slct.archive_content_obj.name ? $slct.archive_content_obj.name : '' } placeholder="Content name">
|
||||
</label>
|
||||
|
||||
<label for="description">Description
|
||||
<textarea id="description" name="description" rows="6" cols="80" value={$slct.archive_content_obj.description ? $slct.archive_content_obj.description : ''} class="ae_value archive_content__description tinymce_editor editor_basic_200"></textarea>
|
||||
</label>
|
||||
|
||||
<label for="content_html">Content (HTML)
|
||||
<textarea id="content_html" name="content_html" rows="6" cols="80" value={$slct.archive_content_obj.content_html ? $slct.archive_content_obj.content_html : ''} class="ae_value archive_content__content_html tinymce_editor editor_regular"></textarea>
|
||||
</label>
|
||||
|
||||
<label for="archive_content_type">Type
|
||||
<select id="archive_content_type" name="archive_content_type" value={$slct.archive_content_obj.archive_content_type}>
|
||||
<option value="">-- None --</option>
|
||||
<option value="hosted_file">Hosted File in Æ</option>
|
||||
<option value="html">Hosted HTML in Æ</option>
|
||||
<option value="json">Hosted JSON in Æ</option>
|
||||
<option value="url">External URL</option>
|
||||
<option value="other">Other</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<fieldset class="">
|
||||
<legend class="">Public Access with Rotating Access Key/Passcode</legend>
|
||||
<label for="enable_for_public_no" class="">No, disable public access
|
||||
<input
|
||||
type="radio"
|
||||
class=""
|
||||
id="enable_for_public_no"
|
||||
name="enable_for_public"
|
||||
value={false}
|
||||
bind:group={$slct.archive_content_obj.enable_for_public}
|
||||
>
|
||||
<!-- <input type="radio" class="" id="enable_for_public_no" name="enable_for_public" value="0" checked={(!$slct.archive_content_obj.enable_for_public)} required> -->
|
||||
</label>
|
||||
<label for="enable_for_public_yes" class="">Yes, allow public access
|
||||
<input
|
||||
type="radio"
|
||||
class=""
|
||||
id="enable_for_public_yes"
|
||||
name="enable_for_public"
|
||||
value={true}
|
||||
bind:group={$slct.archive_content_obj.enable_for_public}
|
||||
>
|
||||
<!-- <input type="radio" class="" id="enable_for_public_yes" name="enable_for_public" value="1" checked={($slct.archive_content_obj.enable_for_public)} required > -->
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<h3>File?</h3>
|
||||
{#if !$slct.archive_content_id}
|
||||
<Element_input_file_hashing
|
||||
multiple = {false}
|
||||
required = {true}
|
||||
accept = {''}
|
||||
element_id = {'archive_content_file_upload_list'}
|
||||
|
||||
on:input_file_list_updated = {handle_input_file_list_updated}
|
||||
use_selected_file_table={true}
|
||||
/>
|
||||
<!-- bind:input_file_list = {$ae_app.archives.form_file_upload_list} -->
|
||||
{/if}
|
||||
|
||||
<label for="file_path">File Path
|
||||
{#if !$ae_app.administrator_access}
|
||||
<span class="fas fa-lock" title="Field is locked"></span>
|
||||
{:else}
|
||||
<span class="fas fa-unlock" title="Field is unlocked"></span>
|
||||
{/if}
|
||||
<input
|
||||
type="text"
|
||||
id="file_path"
|
||||
name="file_path"
|
||||
value={($slct.archive_content_obj.file_path ? $slct.archive_content_obj.file_path : '')}
|
||||
readonly={!$ae_app.administrator_access}
|
||||
>
|
||||
</label>
|
||||
|
||||
<label for="filename">Filename
|
||||
<input type="text" id="filename" name="filename" value={($slct.archive_content_obj.filename ? $slct.archive_content_obj.filename : $ae_app.archives.input_filename)}>
|
||||
</label>
|
||||
|
||||
<label for="file_extension">File Extension
|
||||
{#if !$ae_app.administrator_access}
|
||||
<span class="fas fa-lock" title="Field is locked"></span>
|
||||
{:else}
|
||||
<span class="fas fa-unlock" title="Field is unlocked"></span>
|
||||
{/if}
|
||||
<input
|
||||
type="text"
|
||||
id="file_extension"
|
||||
name="file_extension"
|
||||
value={($slct.archive_content_obj.file_extension ? $slct.archive_content_obj.file_extension : $ae_app.archives.input_file_extension)}
|
||||
readonly={!$ae_app.administrator_access}
|
||||
>
|
||||
</label>
|
||||
|
||||
<h3>Original</h3>
|
||||
<label for="original_datetime">Original Date/Time
|
||||
<input type="date" id="original_datetime_date" name="original_datetime_date" value={($slct.archive_content_obj.original_datetime ? ae.util.iso_datetime_formatter($slct.archive_content_obj.original_datetime,'date_iso') : '')} placeholder="YYYY-MM-DD">
|
||||
<input type="time" id="original_datetime_time" name="original_datetime_time" value={($slct.archive_content_obj.original_datetime ? ae.util.iso_datetime_formatter($slct.archive_content_obj.original_datetime,'time_iso') : '')} placeholder="HH:MM AM/PM">
|
||||
</label>
|
||||
|
||||
<fieldset class="flex_row flex_gap_md flex_justify_around">
|
||||
<label for="original_timezone">Original Timezone
|
||||
{#if $ae_app.lu_time_zone_list}
|
||||
<select name="original_timezone" id="original_timezone" required>
|
||||
{#each $ae_app.lu_time_zone_list as lu_timezone}
|
||||
<option value="{lu_timezone.name}" selected={((($slct.archive_content_obj.original_timezone && lu_timezone.name == $slct.archive_content_obj.original_timezone) || lu_timezone.name == $ae_app.current_timezone) ? 'selected' : '')}>{lu_timezone.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
{:else}
|
||||
<input type="text" name="timezone" value={($slct.archive_content_obj.original_timezone ? $slct.archive_content_obj.original_timezone : $ae_app.current_timezone)} />
|
||||
{/if}
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<!-- <label for="original_timezone">Original Timezone
|
||||
<input type="text" id="original_timezone" name="original_timezone" value={$slct.archive_content_obj.original_timezone} list="timezones">
|
||||
<datalist id="timezones">
|
||||
<option value="UTC">UTC</option>
|
||||
<option value="America/New_York">America/New York</option>
|
||||
<option value="America/Chicago">America/Chicago</option>
|
||||
<option value="America/Denver">America/Denver</option>
|
||||
<option value="America/Phoenix">America/Phoenix</option>
|
||||
<option value="America/Los_Angeles">America/Los Angeles</option>
|
||||
<option value="America/Anchorage">America/Anchorage</option>
|
||||
<option value="America/Adak">America/Adak</option>
|
||||
<option value="Pacific/Honolulu">Pacific/Honolulu</option>
|
||||
<option value="Pacific/Midway">Pacific/Midway</option>
|
||||
<option value="US/Eastern">US/Eastern</option>
|
||||
<option value="US/Central">US/Central</option>
|
||||
<option value="US/Mountain">US/Mountain</option>
|
||||
<option value="US/Pacific">US/Pacific</option>
|
||||
<option value="US/Alaska">US/Alaska</option>
|
||||
<option value="US/Hawaii">US/Hawaii</option>
|
||||
<option value="US/Samoa">US/Samoa</option>
|
||||
<option value="US/Aleutian">US/Aleutian</option>
|
||||
<option value="US/Arizona">US/Arizona</option>
|
||||
<option value="US/Michigan">US/Michigan</option>
|
||||
</datalist>
|
||||
</label> -->
|
||||
|
||||
<label for="original_location">Original Location
|
||||
<input type="text" id="original_location" name="original_location" value={$slct.archive_content_obj.original_location}>
|
||||
</label>
|
||||
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<section class="ae_section archive_content__admin_options"> <!-- BEGIN: section archive_content__admin_options -->
|
||||
|
||||
<h3>
|
||||
Admin Options
|
||||
<button type="button" class="ae_btn ae_smallest ae_d_none_toggle ae_float_right btn btn-xs btn-info" on:click={() => {document.querySelector('.ae_d_none_content').classList.toggle('ae_d_none');}}><span class="fas fa-eye"></span> Show/Hide Admin</button>
|
||||
</h3>
|
||||
|
||||
<span class="ae_d_none_content ae_d_none">
|
||||
<label>Hide
|
||||
<input
|
||||
type="checkbox"
|
||||
name="hide"
|
||||
id="hide"
|
||||
bind:checked={$slct.archive_content_obj.hide}
|
||||
>
|
||||
<!-- <input type="checkbox" name="hide" value={$slct.archive_content_obj.hide} /> -->
|
||||
</label>
|
||||
|
||||
<label>Priority
|
||||
<input
|
||||
type="checkbox"
|
||||
name="priority"
|
||||
id="priority"
|
||||
bind:checked={$slct.archive_content_obj.priority}
|
||||
>
|
||||
<!-- <input type="checkbox" name="priority" value={$slct.archive_content_obj.priority} /> -->
|
||||
</label>
|
||||
|
||||
<label>Sort <input type="number" name="sort" value={$slct.archive_content_obj.sort} /></label>
|
||||
|
||||
<label>Group <input type="text" name="group" value={$slct.archive_content_obj.group} max="100" /></label>
|
||||
|
||||
{#if $ae_app.administrator_access}
|
||||
<label>Enable
|
||||
<input
|
||||
type="checkbox"
|
||||
name="enable"
|
||||
id="enable"
|
||||
bind:checked={$slct.archive_content_obj.enable}
|
||||
>
|
||||
<!-- <input type="checkbox" name="enable" value={$slct.archive_content_obj.enable} checked={$slct.archive_content_obj.enable} /> -->
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
<label>Internal Staff Notes
|
||||
<textarea id="notes" name="notes" class="ae_value archive_content__notes tinymce_editor editor_basic_200" rows="2" cols="70" value={$slct.archive_content_obj.notes}></textarea>
|
||||
</label>
|
||||
|
||||
</span> <!-- END: span ae_show_hide_content -->
|
||||
|
||||
</section> <!-- END: section archive_content__admin_options -->
|
||||
{/if}
|
||||
|
||||
|
||||
<section class="ae_section ae_options ae_row">
|
||||
<button type="submit" class="ae_btn btn btn-primary"><span class="fas fa-check"></span> Save Archive Content</button>
|
||||
|
||||
{#if $slct.archive_content_id}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to delete this archive content?')) {return false;}
|
||||
handle_delete_archive_content_obj({archive_content_id: $slct.archive_content_id, hosted_file_id: $slct.archive_content_obj.hosted_file_id_random});
|
||||
|
||||
$slct.archive_content_id = null;
|
||||
$slct.archive_content_obj = {};
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-danger" type="button">
|
||||
<span class="fas fa-minus"></span> Delete
|
||||
</button>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,588 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { ae, api, Element_input } from 'aether_npm_lib';
|
||||
import { slct, ae_app } from './stores';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
let create_archive_obj_promise: any;
|
||||
let delete_archive_obj_promise: any;
|
||||
let update_archive_obj_promise: any;
|
||||
|
||||
let disable_submit_btn = true;
|
||||
|
||||
if ($slct.archive_id) {
|
||||
console.log(`Archive ID selected: ${$slct.archive_id}`);
|
||||
console.log(`Archive Object selected: ${$slct.archive_obj}`)
|
||||
} else {
|
||||
$slct.archive_id = null;
|
||||
$slct.archive_obj = {
|
||||
title: null,
|
||||
content: null,
|
||||
topic_id: null,
|
||||
anonymous: false,
|
||||
external_person_id: $ae_app.novi_uuid,
|
||||
full_name: $ae_app.novi_full_name,
|
||||
email: $ae_app.novi_email,
|
||||
|
||||
sort: null,
|
||||
notes: null,
|
||||
};
|
||||
console.log(`Archive Object started: ${$slct.archive_obj}`)
|
||||
}
|
||||
|
||||
|
||||
if ($slct.archive_obj) {
|
||||
|
||||
} else {
|
||||
// $slct.archive_obj = {name: 'null', description: 'null'};
|
||||
console.log(`Archive Object started: ${$slct.archive_obj}`)
|
||||
}
|
||||
|
||||
if ($ae_app.lu_time_zone_list && $ae_app.lu_time_zone_list.length > 0) {
|
||||
// console.log('Already have time zone list!', $ae_app.lu_time_zone_list);
|
||||
} else {
|
||||
console.log('No time zone list');
|
||||
|
||||
let lu_time_zone_li_get_promise = api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'lu', // "lu" = a lookup table
|
||||
for_obj_type: 'time_zone',
|
||||
enabled: null,
|
||||
hidden: null,
|
||||
// order_by_li: {'name': 'ASC'},
|
||||
log_lvl: 1
|
||||
})
|
||||
|
||||
.then(function (lu_time_zone_li_get_result) {
|
||||
if (lu_time_zone_li_get_result) {
|
||||
$ae_app.lu_time_zone_list = lu_time_zone_li_get_result;
|
||||
console.log(`Time zone list:`, $ae_app.lu_time_zone_list);
|
||||
console.log($ae_app.lu_time_zone_list[0]);
|
||||
console.log($ae_app.lu_time_zone_list[10]);
|
||||
} else {
|
||||
console.log(`No time zones returned!`);
|
||||
$ae_app.lu_time_zone_list = [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** Edit - Event Obj');
|
||||
|
||||
tinymce_remove(); // This seems to fix rendering issues
|
||||
tinymce_init();
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
console.log('** Component Destroyed: ** Edit - Event Obj');
|
||||
tinymce_remove(); // This seems like the right thing to do
|
||||
});
|
||||
|
||||
|
||||
// let ae_iframe_height = window.outerHeight;
|
||||
let ae_iframe_height = window.innerHeight;
|
||||
console.log(`ae_iframe_height: ${ae_iframe_height}`);
|
||||
$: if (ae_iframe_height) {
|
||||
console.log('ae_iframe_height changed:', ae_iframe_height);
|
||||
|
||||
let iframe_height = ae_iframe_height; // TESTING!!!
|
||||
|
||||
// window.parent.postMessage({'iframe_height': `${iframe_height}px`}, "*");
|
||||
window.parent.postMessage({'iframe_height': iframe_height}, "*");
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct.archive_obj) {
|
||||
console.log('Selected archive object changed?');
|
||||
console.log($slct.archive_obj);
|
||||
|
||||
if ($slct.archive_obj == null) {
|
||||
$slct.archive_obj = {title: null, content: null, name: null, description: null, notes: null, created_on: null, updated_on: null};
|
||||
} else {
|
||||
disable_submit_btn = false;
|
||||
}
|
||||
|
||||
// ae.input_template['event']['timezone'] = 'EDT';
|
||||
}
|
||||
|
||||
|
||||
async function handle_submit_form(event) {
|
||||
console.log('*** handle_submit_form() ***');
|
||||
|
||||
disable_submit_btn = true;
|
||||
|
||||
let form_data = new FormData(event.target);
|
||||
console.log(form_data);
|
||||
|
||||
let form_archive_data = ae.util.extract_prefixed_form_data({prefix: null, form_data: form_data, trim_values: true, bool_tf_str: true, log_lvl: 0});
|
||||
console.log(form_archive_data);
|
||||
|
||||
let archive_data: key_val = {};
|
||||
|
||||
if (!$slct.archive_id) {
|
||||
archive_data['account_id_random'] = $ae_app.account_id;
|
||||
archive_data['enable'] = true;
|
||||
}
|
||||
|
||||
archive_data['name'] = form_archive_data.name;
|
||||
if (tinyMCE.get('description')) {
|
||||
archive_data['description'] = tinyMCE.get('description').getContent();
|
||||
} else {
|
||||
archive_data['description'] = form_archive_data.description;
|
||||
}
|
||||
|
||||
if (tinyMCE.get('content_html')) {
|
||||
archive_data['content_html'] = tinyMCE.get('content_html').getContent();
|
||||
} else {
|
||||
archive_data['content_html'] = form_archive_data.content_html;
|
||||
}
|
||||
|
||||
let date_time_str = null;
|
||||
let date_part = form_archive_data.original_datetime_date.trim();
|
||||
let time_part = form_archive_data.original_datetime_time.trim();
|
||||
if (date_part && time_part) {
|
||||
date_time_str = `${date_part} ${time_part}`;
|
||||
} else if (date_part) {
|
||||
date_time_str = `${date_part}T00:00:00`;
|
||||
} else if (time_part) {
|
||||
// date_time_str = `${time_part}`;
|
||||
date_time_str = false;
|
||||
}
|
||||
archive_data['original_datetime'] = date_time_str;
|
||||
|
||||
archive_data['original_timezone'] = form_archive_data.original_timezone;
|
||||
|
||||
archive_data['original_location'] = form_archive_data.original_location;
|
||||
|
||||
archive_data['original_url'] = form_archive_data.original_url;
|
||||
archive_data['original_url_text'] = form_archive_data.original_url_text;
|
||||
|
||||
archive_data['hide'] = !!form_archive_data.hide;
|
||||
archive_data['priority'] = !!form_archive_data.priority;
|
||||
if (form_archive_data.sort) {
|
||||
archive_data['sort'] = Number(form_archive_data.sort);
|
||||
} else {
|
||||
archive_data['sort'] = null;
|
||||
}
|
||||
if (form_archive_data.group) {
|
||||
archive_data['group'] = form_archive_data.group;
|
||||
} else {
|
||||
archive_data['group'] = null;
|
||||
}
|
||||
|
||||
if (form_archive_data.enable) {
|
||||
archive_data['enable'] = !!form_archive_data.enable;
|
||||
}
|
||||
|
||||
if (tinyMCE.get('notes')) {
|
||||
archive_data['notes'] = tinyMCE.get('notes').getContent();
|
||||
} else {
|
||||
archive_data['notes'] = form_archive_data.notes;
|
||||
}
|
||||
|
||||
console.log(archive_data);
|
||||
|
||||
if (!$slct.archive_id) {
|
||||
create_archive_obj_promise = api.create_ae_obj_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive',
|
||||
fields: archive_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (archive_obj_create_result) {
|
||||
if (!archive_obj_create_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$slct.archive_id = archive_obj_create_result.obj_id_random;
|
||||
|
||||
dispatch(
|
||||
'created__archive_obj',
|
||||
{
|
||||
archive_id: $slct.archive_id,
|
||||
}
|
||||
);
|
||||
|
||||
return archive_obj_create_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
return create_archive_obj_promise;
|
||||
|
||||
} else {
|
||||
update_archive_obj_promise = api.update_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive',
|
||||
obj_id: $slct.archive_id,
|
||||
fields: archive_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (archive_obj_update_result) {
|
||||
if (!archive_obj_update_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
|
||||
dispatch(
|
||||
'updated__archive_obj',
|
||||
{
|
||||
archive_id: $slct.archive_id,
|
||||
}
|
||||
);
|
||||
|
||||
return archive_obj_update_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
return update_archive_obj_promise;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function handle_delete_archive_obj({archive_id, method='delete'}) {
|
||||
console.log('*** handle_delete_archive_obj() ***');
|
||||
|
||||
delete_archive_obj_promise = api.delete_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive',
|
||||
obj_id: archive_id,
|
||||
method: method,
|
||||
// params: params,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (archive_obj_delete_result) {
|
||||
if (archive_obj_delete_result) {
|
||||
// console.log(`Result:`, archive_obj_delete_result);
|
||||
|
||||
dispatch(
|
||||
'deleted__archive_obj',
|
||||
{
|
||||
archive_id: archive_id,
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('The result was null or false when trying to delete.', error);
|
||||
});
|
||||
|
||||
return delete_archive_obj_promise;
|
||||
}
|
||||
|
||||
function tinymce_init() {
|
||||
// REFERENCE: https://www.tiny.cloud/docs/tinymce/6/basic-setup/
|
||||
// plugins: [
|
||||
// 'advlist', 'autolink', 'link', 'image', 'lists', 'charmap', 'preview', 'anchor', 'pagebreak',
|
||||
// 'searchreplace', 'wordcount', 'visualblocks', 'visualchars', 'code', 'fullscreen', 'insertdatetime',
|
||||
// 'media', 'table', 'emoticons', 'template', 'help'
|
||||
// ],
|
||||
// 'undo redo | styles | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent'
|
||||
|
||||
// NOTE: Regular version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_regular',
|
||||
// width: 600,
|
||||
height: 400,
|
||||
plugins: [ 'advlist', 'autolink', 'link', 'lists', 'anchor', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: 'undo redo | styles | bold italic | alignleft aligncenter alignright | bullist numlist outdent indent | link | code | help',
|
||||
});
|
||||
|
||||
// NOTE: Basic version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_basic',
|
||||
// width: 600,
|
||||
height: 400,
|
||||
plugins: [ 'lists', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: 'undo redo | styles | bold italic | alignleft aligncenter | bullist numlist outdent indent | code | help',
|
||||
});
|
||||
|
||||
// NOTE: Minimal version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_basic_200',
|
||||
// width: 600,
|
||||
height: 200,
|
||||
plugins: [ 'lists', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: 'undo redo | styles | bold italic | alignleft aligncenter | bullist numlist outdent indent | code | help',
|
||||
});
|
||||
|
||||
// NOTE: Less is more version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_less_100',
|
||||
// width: 600,
|
||||
height: 100,
|
||||
// plugins: [ 'lists', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: false,
|
||||
statusbar: false,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function tinymce_remove() {
|
||||
tinymce.remove('.tinymce_editor.editor_regular');
|
||||
tinymce.remove('.tinymce_editor.editor_basic');
|
||||
tinymce.remove('.tinymce_editor.editor_basic_200');
|
||||
tinymce.remove('.tinymce_editor.editor_less_100');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section
|
||||
class="svelte_component ae_edit archive_obj"
|
||||
class:ae_create={!$slct.archive_id}
|
||||
bind:clientHeight={$ae_app.iframe_height_modal_body}
|
||||
>
|
||||
|
||||
<form on:submit|preventDefault={handle_submit_form} class="">
|
||||
|
||||
{#await update_archive_obj_promise}
|
||||
<div class="awaiting alert_msg_pulse" out:fade={{ duration: 2000 }}>Saving...</div>
|
||||
{:then}
|
||||
{#if update_archive_obj_promise}
|
||||
<div class="awaiting" out:fade={{ duration: 2000 }}>Finished saving</div>
|
||||
{:else}
|
||||
<!-- <div class="awaiting" out:fade={{ duration: 2000 }}>Nothing here yet</div> -->
|
||||
{/if}
|
||||
{/await}
|
||||
|
||||
<h3>Archive</h3>
|
||||
|
||||
<label for="name">Name of Archive
|
||||
<input type="text" id="name" name="name" required max="20" value={$slct.archive_obj.name ? $slct.archive_obj.name : 'Testing!' } placeholder="Name of Archive">
|
||||
</label>
|
||||
|
||||
<label for="description">Description
|
||||
<textarea id="description" name="description" rows="6" cols="80" value={$slct.archive_obj.description ? $slct.archive_obj.description : ''} class="ae_value archive__description tinymce_editor editor_basic_200"></textarea>
|
||||
</label>
|
||||
|
||||
<label for="content_html">Content (HTML)
|
||||
<textarea id="content_html" name="content_html" rows="6" cols="80" value={$slct.archive_obj.content_html ? $slct.archive_obj.content_html : ''} class="ae_value archive__content_html tinymce_editor editor_regular"></textarea>
|
||||
</label>
|
||||
|
||||
<h3>Original</h3>
|
||||
<label for="original_datetime">Original Date/Time
|
||||
<input type="date" id="original_datetime_date" name="original_datetime_date" value={($slct.archive_obj.original_datetime ? ae.util.iso_datetime_formatter($slct.archive_obj.original_datetime,'date_iso') : '')} placeholder="YYYY-MM-DD">
|
||||
<input type="time" id="original_datetime_time" name="original_datetime_time" value={($slct.archive_obj.original_datetime ? ae.util.iso_datetime_formatter($slct.archive_obj.original_datetime,'time_iso') : '')} placeholder="HH:MM AM/PM">
|
||||
</label>
|
||||
|
||||
<fieldset class="flex_row flex_gap_md flex_justify_around">
|
||||
<label for="original_timezone">Original Timezone
|
||||
{#if $ae_app.lu_time_zone_list}
|
||||
<select name="original_timezone" id="original_timezone" required>
|
||||
{#each $ae_app.lu_time_zone_list as lu_timezone}
|
||||
<option value="{lu_timezone.name}" selected={((($slct.archive_obj.original_timezone && lu_timezone.name == $slct.archive_obj.original_timezone) || lu_timezone.name == $ae_app.current_timezone) ? 'selected' : '')}>{lu_timezone.name}</option>
|
||||
{/each}
|
||||
</select>
|
||||
{:else}
|
||||
<input type="text" name="timezone" value={($slct.archive_obj.original_timezone ? $slct.archive_obj.original_timezone : $ae_app.current_timezone)} />
|
||||
{/if}
|
||||
</label>
|
||||
</fieldset>
|
||||
|
||||
<!-- <label for="original_timezone">Original Timezone
|
||||
<input type="text" id="original_timezone" name="original_timezone" value={($slct.archive_obj.original_timezone ? $slct.archive_obj.original_timezone : $ae_app.current_timezone)} placeholder="Timezone" list="timezones">
|
||||
<datalist id="timezones">
|
||||
<option value="UTC">UTC</option>
|
||||
<option value="America/New_York">America/New York</option>
|
||||
<option value="America/Chicago">America/Chicago</option>
|
||||
<option value="America/Denver">America/Denver</option>
|
||||
<option value="America/Phoenix">America/Phoenix</option>
|
||||
<option value="America/Los_Angeles">America/Los Angeles</option>
|
||||
<option value="America/Anchorage">America/Anchorage</option>
|
||||
<option value="America/Adak">America/Adak</option>
|
||||
<option value="Pacific/Honolulu">Pacific/Honolulu</option>
|
||||
<option value="Pacific/Midway">Pacific/Midway</option>
|
||||
<option value="US/Eastern">US/Eastern</option>
|
||||
<option value="US/Central">US/Central</option>
|
||||
<option value="US/Mountain">US/Mountain</option>
|
||||
<option value="US/Pacific">US/Pacific</option>
|
||||
<option value="US/Alaska">US/Alaska</option>
|
||||
<option value="US/Hawaii">US/Hawaii</option>
|
||||
<option value="US/Samoa">US/Samoa</option>
|
||||
<option value="US/Aleutian">US/Aleutian</option>
|
||||
<option value="US/Arizona">US/Arizona</option>
|
||||
<option value="US/Michigan">US/Michigan</option>
|
||||
</datalist>
|
||||
</label> -->
|
||||
|
||||
<label for="original_location">Original Location
|
||||
<input type="text" id="original_location" name="original_location" value={($slct.archive_obj.original_location ? $slct.archive_obj.original_location : '')} placeholder="Location">
|
||||
</label>
|
||||
|
||||
<label for="original_url">Original URL
|
||||
<input type="text" id="original_url" name="original_url" max="255" value={$slct.archive_obj.original_url ? $slct.archive_obj.original_url : '' } placeholder="URL">
|
||||
</label>
|
||||
|
||||
<label for="original_url_text">Original URL Text/Title
|
||||
<input type="text" id="original_url_text" name="original_url_text" max="255" value={$slct.archive_obj.original_url_text ? $slct.archive_obj.original_url_text : '' } placeholder="URL text or title">
|
||||
</label>
|
||||
|
||||
|
||||
<!-- <label for="topic_id">BB post topic
|
||||
<select id="topic_id" name="topic_id">
|
||||
<option value="">-- None --</option>
|
||||
<option value="16">Licensing/ monitoring/ credentialing issues</option>
|
||||
<option value="17">Return to practice</option>
|
||||
<option value="18">Contacts/ sponsorship in my area</option>
|
||||
<option value="19">Professional positions</option>
|
||||
<option value="21">Announcement</option>
|
||||
</select>
|
||||
</label> -->
|
||||
|
||||
<!-- <h3>Archiveer's Information</h3>
|
||||
<fieldset class="">
|
||||
<legend class="">Archive as Anonymous</legend>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="anonymous_no" name="anonymous" value="0" checked={(!$slct.archive_obj.anonymous)} required>
|
||||
<label for="anonymous_no" class="">No, include my name and email address</label>
|
||||
</div>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="anonymous_yes" name="anonymous" value="1" checked={($slct.archive_obj.anonymous)} required >
|
||||
<label for="anonymous_yes" class="">Yes, the post will be listed as Anonymous</label>
|
||||
</div>
|
||||
</fieldset> -->
|
||||
|
||||
<!-- <label for="external_person_id">Your ID
|
||||
<input type="text" id="external_person_id" name="external_person_id" value={$slct.archive_obj.external_person_id} readonly>
|
||||
</label>
|
||||
|
||||
<label for="full_name">Your name
|
||||
<input type="text" id="full_name" name="full_name" value={$slct.archive_obj.full_name}>
|
||||
</label>
|
||||
|
||||
<label for="email">Your email
|
||||
<input type="text" name="email" value={$slct.archive_obj.email} readonly>
|
||||
</label> -->
|
||||
|
||||
<!-- <h3>Archiveer's Options</h3> -->
|
||||
|
||||
<!-- <fieldset class="">
|
||||
<legend class="">Official or Member Archive</legend>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="group_official" name="group" value="official">
|
||||
<label for="group_official" class="">Archive as Official/Leadership</label>
|
||||
</div>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="group_member" name="group" value="member" checked="">
|
||||
<label for="group_member" class="">Archive as Member</label>
|
||||
</div>
|
||||
</fieldset> -->
|
||||
|
||||
<!-- <fieldset class="">
|
||||
<legend class="">Enable Comments</legend>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="enable_comments_no" name="enable_comments" value="0">
|
||||
<label for="enable_comments_no" class="">No, do not allow comments</label>
|
||||
</div>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="enable_comments_yes" name="enable_comments" value="1" checked>
|
||||
<label for="enable_comments_yes" class="">Yes, allow comments</label>
|
||||
</div>
|
||||
</fieldset> -->
|
||||
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<section class="ae_section archive__admin_options"> <!-- BEGIN: section archive__admin_options -->
|
||||
|
||||
<h3>
|
||||
Admin Options
|
||||
<button type="button" class="ae_btn ae_d_none_toggle ae_float_right ae_smallest btn btn-xs btn-info" on:click={() => {document.querySelector('.ae_d_none_content').classList.toggle('ae_fade_out'); document.querySelector('.ae_d_none_content').classList.toggle('ae_fade_in');}}><span class="fas fa-eye"></span> Show/Hide Admin</button>
|
||||
</h3>
|
||||
|
||||
<span class="ae_d_none_content ae_fade_out">
|
||||
<label>Hide
|
||||
<input
|
||||
type="checkbox"
|
||||
name="hide"
|
||||
id="hide"
|
||||
bind:checked={$slct.archive_obj.hide}
|
||||
>
|
||||
<!-- <input type="checkbox" name="hide" value={$slct.archive_obj.hide} /> -->
|
||||
</label>
|
||||
|
||||
<label>Priority
|
||||
<input
|
||||
type="checkbox"
|
||||
name="priority"
|
||||
id="priority"
|
||||
bind:checked={$slct.archive_obj.priority}
|
||||
>
|
||||
<!-- <input type="checkbox" name="priority" value={$slct.archive_obj.priority} /> -->
|
||||
</label>
|
||||
|
||||
<label>Sort <input type="number" name="sort" value={$slct.archive_obj.sort} /></label>
|
||||
|
||||
<label>Group <input type="text" name="group" value={$slct.archive_obj.group} max="100" /></label>
|
||||
|
||||
{#if $ae_app.administrator_access}
|
||||
<label>Enable
|
||||
<input
|
||||
type="checkbox"
|
||||
name="enable"
|
||||
id="enable"
|
||||
bind:checked={$slct.archive_obj.enable}
|
||||
>
|
||||
<!-- <input type="checkbox" name="enable" value={$slct.archive_obj.enable} checked={$slct.archive_obj.enable} /> -->
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
<label>Internal Staff Notes
|
||||
<textarea id="notes" name="notes" class="ae_value archive__notes tinymce_editor editor_basic_200" rows="2" cols="70" value={$slct.archive_obj.notes}></textarea>
|
||||
</label>
|
||||
|
||||
</span> <!-- END: span ae_show_hide_content -->
|
||||
|
||||
</section> <!-- END: section archive__admin_options -->
|
||||
{/if}
|
||||
|
||||
|
||||
<section class="ae_section ae_options ae_row">
|
||||
<button type="submit" class="ae_btn btn btn-primary"><span class="fas fa-check"></span> Save Archive</button>
|
||||
|
||||
{#if $slct.archive_id}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to delete this archive?')) {return false;}
|
||||
handle_delete_archive_obj({archive_id: $slct.archive_id});
|
||||
|
||||
$slct.archive_id = null;
|
||||
$slct.archive_obj = {};
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-danger" type="button">
|
||||
<span class="fas fa-minus"></span> Delete
|
||||
</button>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,384 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { ae, api, Element_input } from 'aether_npm_lib';
|
||||
import { slct, ae_app } from './stores';
|
||||
|
||||
export let container_class_li = [];
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
let create_post_comment_obj_promise: any;
|
||||
let delete_post_comment_obj_promise: any;
|
||||
let update_post_comment_obj_promise: any;
|
||||
|
||||
let disable_submit_btn = true;
|
||||
|
||||
if ($slct.post_comment_id) {
|
||||
console.log(`Post Comment ID selected: ${$slct.post_comment_id}`);
|
||||
console.log(`Post Comment Object selected: ${$slct.post_comment_obj}`);
|
||||
} else {
|
||||
$slct.post_comment_id = null;
|
||||
$slct.post_comment_obj = {
|
||||
title: null,
|
||||
content: null,
|
||||
anonymous: false,
|
||||
external_person_id: $ae_app.novi_uuid,
|
||||
full_name: $ae_app.novi_full_name,
|
||||
email: $ae_app.novi_email,
|
||||
|
||||
sort: null,
|
||||
// notes: null,
|
||||
};
|
||||
console.log(`Post Comment Object started: ${$slct.post_comment_obj}`);
|
||||
}
|
||||
|
||||
|
||||
if ($slct.post_comment_obj) {
|
||||
|
||||
} else {
|
||||
// $slct.post_comment_obj = {name: 'null', description: 'null'};
|
||||
console.log(`Post Comment Object started: ${$slct.post_comment_obj}`)
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** Edit - Posts Comment Obj');
|
||||
});
|
||||
|
||||
|
||||
$: if ($slct.post_comment_obj) {
|
||||
console.log('Selected post comment object changed?');
|
||||
console.log($slct.post_comment_obj);
|
||||
|
||||
if ($slct.post_comment_obj == null) {
|
||||
$slct.post_comment_obj = {title: null, content: null, name: null, description: null, notes: null, created_on: null, updated_on: null};
|
||||
} else {
|
||||
disable_submit_btn = false;
|
||||
}
|
||||
|
||||
// ae.input_template['event']['timezone'] = 'EDT';
|
||||
}
|
||||
|
||||
|
||||
async function handle_submit_form(event) {
|
||||
console.log('*** handle_submit_form() ***');
|
||||
|
||||
disable_submit_btn = true;
|
||||
|
||||
let form_data = new FormData(event.target);
|
||||
console.log(form_data);
|
||||
|
||||
let post_comment_data = ae.util.extract_prefixed_form_data({prefix: null, form_data: form_data, trim_values: true, bool_tf_str: true, log_lvl: 0});
|
||||
|
||||
if (!$slct.post_comment_id) {
|
||||
post_comment_data['post_id_random'] = $slct.post_id;
|
||||
post_comment_data['enable'] = true;
|
||||
}
|
||||
|
||||
console.log(post_comment_data);
|
||||
|
||||
if (!$slct.post_comment_id) {
|
||||
create_post_comment_obj_promise = api.create_ae_obj_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post_comment',
|
||||
fields: post_comment_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (post_comment_obj_create_result) {
|
||||
if (!post_comment_obj_create_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$slct.post_comment_id = post_comment_obj_create_result;
|
||||
|
||||
dispatch(
|
||||
'post_comment_obj_created',
|
||||
{
|
||||
post_comment_id: $slct.post_comment_id,
|
||||
}
|
||||
);
|
||||
|
||||
return post_comment_obj_create_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
return create_post_comment_obj_promise;
|
||||
|
||||
} else {
|
||||
update_post_comment_obj_promise = api.update_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post_comment',
|
||||
obj_id: $slct.post_comment_id,
|
||||
fields: post_comment_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (post_comment_obj_update_result) {
|
||||
if (!post_comment_obj_update_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
|
||||
dispatch(
|
||||
'post_comment_obj_updated',
|
||||
{
|
||||
post_comment_id: $slct.post_comment_id,
|
||||
}
|
||||
);
|
||||
|
||||
return post_comment_obj_update_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
return update_post_comment_obj_promise;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function handle_delete_post_comment_obj({post_comment_id, method='disable'}) {
|
||||
console.log('*** handle_delete_post_comment_obj() ***');
|
||||
|
||||
delete_post_comment_obj_promise = api.delete_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post_comment',
|
||||
obj_id: post_comment_id,
|
||||
method: method,
|
||||
// params: params,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (post_comment_obj_delete_result) {
|
||||
if (post_comment_obj_delete_result) {
|
||||
// console.log(`Result:`, post_comment_obj_delete_result);
|
||||
|
||||
dispatch(
|
||||
'post_comment_obj_deleted',
|
||||
{
|
||||
post_comment_id: post_comment_id,
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('The result was null or false when trying to delete.', error);
|
||||
});
|
||||
|
||||
return delete_post_comment_obj_promise;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section class="svelte_component ae_edit post_comment_obj {container_class_li.join(' ')}">
|
||||
|
||||
<form on:submit|preventDefault={handle_submit_form} class="">
|
||||
|
||||
{#await update_post_comment_obj_promise}
|
||||
<div class="awaiting alert_msg_pulse" out:fade={{ duration: 2000 }}>Saving...</div>
|
||||
{:then}
|
||||
{#if update_post_comment_obj_promise}
|
||||
<div class="awaiting" out:fade={{ duration: 2000 }}>Finished saving</div>
|
||||
{:else}
|
||||
<!-- <div class="awaiting" out:fade={{ duration: 2000 }}>Nothing here yet</div> -->
|
||||
{/if}
|
||||
{/await}
|
||||
|
||||
<h3>Post Comment</h3>
|
||||
|
||||
<!-- <label for="title">Title of BB post
|
||||
<input type="text" id="title" name="title" required max="20" value={$slct.post_comment_obj.title ? $slct.post_comment_obj.title : '' } placeholder="BB post title">
|
||||
</label> -->
|
||||
|
||||
<label for="content">Content (post comment body)
|
||||
<textarea id="content" name="content" required rows="6" cols="70" value={$slct.post_comment_obj.content ? $slct.post_comment_obj.content : ''} class="ae__post_comment__content"></textarea>
|
||||
</label>
|
||||
|
||||
<h3>Poster's Information</h3>
|
||||
<fieldset class="">
|
||||
<legend class="">Post as Anonymous</legend>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="anonymous_no" name="anonymous" value="0" checked={(!$slct.post_comment_obj.anonymous)} required>
|
||||
<label for="anonymous_no" class="">No, include my name and email address</label>
|
||||
</div>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="anonymous_yes" name="anonymous" value="1" checked={($slct.post_comment_obj.anonymous)} required >
|
||||
<label for="anonymous_yes" class="">Yes, the post will be listed as Anonymous</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<label for="external_person_id">Your ID
|
||||
{#if !$ae_app.trusted_access}
|
||||
<span class="fas fa-lock" title="Field is locked"></span>
|
||||
{:else}
|
||||
<span class="fas fa-unlock" title="Field is unlocked"></span>
|
||||
{/if}
|
||||
<input
|
||||
type="text"
|
||||
id="external_person_id"
|
||||
name="external_person_id"
|
||||
value={($slct.post_comment_obj.external_person_id ? $slct.post_comment_obj.external_person_id : $ae_app.novi_uuid)}
|
||||
readonly={!$ae_app.trusted_access}
|
||||
>
|
||||
<span class="ae_highlight">Primary link using the Novi API UUID</span>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
<label for="full_name">Your name
|
||||
{#if !$ae_app.trusted_access}
|
||||
<span class="fas fa-lock" title="Field is locked"></span>
|
||||
{:else}
|
||||
<span class="fas fa-unlock" title="Field is unlocked"></span>
|
||||
{/if}
|
||||
<input
|
||||
type="text"
|
||||
id="full_name"
|
||||
name="full_name"
|
||||
value={($slct.post_comment_obj.full_name ? $slct.post_comment_obj.full_name : $ae_app.novi_full_name)}
|
||||
>
|
||||
</label>
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<label for="email">Your email
|
||||
{#if !$ae_app.trusted_access}
|
||||
<span class="fas fa-lock" title="Field is locked"></span>
|
||||
{:else}
|
||||
<span class="fas fa-unlock" title="Field is unlocked"></span>
|
||||
{/if}
|
||||
<input
|
||||
type="text"
|
||||
name="email"
|
||||
value={($slct.post_comment_obj.email ? $slct.post_comment_obj.email : $ae_app.novi_email)}
|
||||
readonly={!$ae_app.trusted_access}
|
||||
>
|
||||
<span class="ae_highlight">Secondary link using the Novi email address</span>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<section class="ae_section post_comment__admin_options"> <!-- BEGIN: section post_comment__admin_options -->
|
||||
|
||||
<h3>
|
||||
Admin Options
|
||||
<button type="button" class="ae_btn ae_d_none_toggle ae_float_right ae_smallest btn btn-xs btn-info" on:click={() => {document.querySelector('.ae_d_none_content').classList.toggle('ae_fade_out'); document.querySelector('.ae_d_none_content').classList.toggle('ae_fade_in');}}><span class="fas fa-eye"></span> Show/Hide Admin</button>
|
||||
</h3>
|
||||
|
||||
<span class="ae_d_none_content ae_fade_out">
|
||||
<label>Hide
|
||||
<input
|
||||
type="checkbox"
|
||||
name="hide"
|
||||
id="hide"
|
||||
bind:checked={$slct.post_comment_obj.hide}
|
||||
>
|
||||
</label>
|
||||
|
||||
<!-- <label>Priority
|
||||
<input
|
||||
type="checkbox"
|
||||
name="priority"
|
||||
id="priority"
|
||||
bind:checked={$slct.post_comment_obj.priority}
|
||||
>
|
||||
</label> -->
|
||||
|
||||
<!-- <label>Sort <input type="number" name="sort" value={$slct.post_comment_obj.sort} /></label> -->
|
||||
|
||||
<!-- <label>Group <input type="text" name="group" value={$slct.post_comment_obj.group} max="100" /></label> -->
|
||||
|
||||
{#if $ae_app.administrator_access}
|
||||
<label>Enable
|
||||
<input
|
||||
type="checkbox"
|
||||
name="enable"
|
||||
id="enable"
|
||||
bind:checked={$slct.post_comment_obj.enable}
|
||||
>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
<!-- {#if $ae_app.trusted_access}
|
||||
<label>Internal Staff Notes
|
||||
<textarea id="notes" name="notes" class="ae_value post__notes tinymce_editor editor_basic_200" rows="2" cols="70" value={$slct.post_comment_obj.notes}></textarea>
|
||||
</label>
|
||||
{/if} -->
|
||||
|
||||
</span> <!-- END: span ae_show_hide_content -->
|
||||
|
||||
</section> <!-- END: section post_comment__admin_options -->
|
||||
{/if}
|
||||
|
||||
|
||||
<section class="ae_section ae_options ae_row">
|
||||
<button type="submit" class="ae_btn btn btn-primary"><span class="fas fa-check"></span> Save Post Comment</button>
|
||||
|
||||
{#if $slct.post_comment_id}
|
||||
{#if $ae_app.administrator_access}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to delete this post comment?')) {return false;}
|
||||
handle_delete_post_comment_obj({post_comment_id: $slct.post_comment_id, method: 'delete'});
|
||||
|
||||
$slct.post_comment_id = null;
|
||||
$slct.post_comment_obj = {};
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-danger" type="button"
|
||||
title="Delete record permanently"
|
||||
>
|
||||
<span class="fas fa-minus"></span> Delete
|
||||
</button>
|
||||
{:else if $ae_app.trusted_access}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to disable this post comment?')) {return false;}
|
||||
handle_delete_post_comment_obj({post_comment_id: $slct.post_comment_id, method: 'disable'});
|
||||
|
||||
$slct.post_comment_id = null;
|
||||
$slct.post_comment_obj = {};
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-danger" type="button"
|
||||
title="Disable record to delete"
|
||||
>
|
||||
<span class="fas fa-minus"></span> Delete
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to hide this post comment?')) {return false;}
|
||||
handle_delete_post_comment_obj({post_comment_id: $slct.post_comment_id, method: 'hide'});
|
||||
|
||||
$slct.post_comment_id = null;
|
||||
$slct.post_comment_obj = {};
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-danger" type="button"
|
||||
title="Hide record to delete"
|
||||
>
|
||||
<span class="fas fa-comment-slash"></span> Delete
|
||||
</button>
|
||||
{/if}
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
.svelte_component.ae_edit {
|
||||
/* outline: dashed thin pink; */
|
||||
}
|
||||
</style>
|
||||
@@ -1,536 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { ae, api, Element_input } from 'aether_npm_lib';
|
||||
import { slct, ae_app } from './stores';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
let create_post_obj_promise: any;
|
||||
let delete_post_obj_promise: any;
|
||||
let update_post_obj_promise: any;
|
||||
|
||||
let disable_submit_btn = true;
|
||||
|
||||
if ($slct.post_id) {
|
||||
console.log(`Post ID selected: ${$slct.post_id}`);
|
||||
console.log(`Post Object selected: ${$slct.post_obj}`);
|
||||
|
||||
if ($slct.post_obj) {
|
||||
// if (!$slct.post_obj.external_person_id) {
|
||||
// $slct.post_obj['external_person_id'] = $ae_app.novi_uuid;
|
||||
// }
|
||||
// if (!$slct.post_obj.full_name) {
|
||||
// $slct.post_obj['full_name'] = $ae_app.novi_full_name;
|
||||
// }
|
||||
// if (!$slct.post_obj.email) {
|
||||
// $slct.post_obj['email'] = $ae_app.novi_email;
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
$slct.post_id = null;
|
||||
$slct.post_obj = {
|
||||
title: null,
|
||||
content: null,
|
||||
topic_id: null,
|
||||
anonymous: false,
|
||||
external_person_id: $ae_app.novi_uuid,
|
||||
full_name: $ae_app.novi_full_name,
|
||||
email: $ae_app.novi_email,
|
||||
|
||||
sort: null,
|
||||
notes: null,
|
||||
};
|
||||
console.log(`Post Object started: ${$slct.post_obj}`);
|
||||
}
|
||||
|
||||
|
||||
if ($slct.post_obj) {
|
||||
|
||||
} else {
|
||||
// $slct.post_obj = {name: 'null', description: 'null'};
|
||||
console.log(`Post Object started: ${$slct.post_obj}`)
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** Edit - Post Obj');
|
||||
|
||||
// NOTE: Minimal version of the TinyMCE editor
|
||||
tinymce.init({
|
||||
selector: '.tinymce_editor.editor_basic_200',
|
||||
// width: 600,
|
||||
height: 200,
|
||||
plugins: [ 'lists', 'code', 'help' ],
|
||||
menubar: false,
|
||||
toolbar: 'undo redo | styles | bold italic | alignleft aligncenter | bullist numlist outdent indent | code | help',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// let ae_iframe_height = window.outerHeight;
|
||||
let ae_iframe_height = window.innerHeight;
|
||||
console.log(`ae_iframe_height: ${ae_iframe_height}`);
|
||||
$: if (ae_iframe_height) {
|
||||
console.log('ae_iframe_height changed:', ae_iframe_height);
|
||||
|
||||
let iframe_height = ae_iframe_height; // TESTING!!!
|
||||
|
||||
// window.parent.postMessage({'iframe_height': `${iframe_height}px`}, "*");
|
||||
window.parent.postMessage({'iframe_height': iframe_height}, "*");
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct.post_obj) {
|
||||
console.log('Selected post object changed?');
|
||||
console.log($slct.post_obj);
|
||||
|
||||
if ($slct.post_obj == null) {
|
||||
$slct.post_obj = {title: null, content: null, name: null, description: null, notes: null, created_on: null, updated_on: null};
|
||||
} else {
|
||||
disable_submit_btn = false;
|
||||
}
|
||||
|
||||
// ae.input_template['event']['timezone'] = 'EDT';
|
||||
}
|
||||
|
||||
|
||||
async function handle_submit_form(event) {
|
||||
console.log('*** handle_submit_form() ***');
|
||||
// console.log(event.target);
|
||||
|
||||
disable_submit_btn = true;
|
||||
|
||||
let form_data = new FormData(event.target);
|
||||
// console.log(form_data);
|
||||
|
||||
let form_post_data = ae.util.extract_prefixed_form_data({prefix: null, form_data: form_data, trim_values: true, bool_tf_str: true, log_lvl: 2});
|
||||
// console.log(form_post_data);
|
||||
|
||||
let post_data: key_val = {};
|
||||
|
||||
if (!$slct.post_id) {
|
||||
post_data['account_id_random'] = $ae_app.account_id;
|
||||
post_data['enable'] = true;
|
||||
}
|
||||
|
||||
post_data['title'] = form_post_data.title;
|
||||
if (tinyMCE.get('content')) {
|
||||
post_data['content'] = tinyMCE.get('content').getContent();
|
||||
} else {
|
||||
post_data['content'] = form_post_data.content;
|
||||
}
|
||||
|
||||
if (form_post_data.topic_id) {
|
||||
post_data['topic_id'] = Number(form_post_data.topic_id);
|
||||
// post_data['topic_id'] = form_post_data.topic_id;
|
||||
} else {
|
||||
post_data['topic_id'] = null;
|
||||
}
|
||||
|
||||
console.log(form_post_data.anonymous);
|
||||
console.log(typeof form_post_data.anonymous);
|
||||
|
||||
// console.log(Boolean(form_post_data.anonymous));
|
||||
// console.log(Number((form_post_data.anonymous)));
|
||||
// console.log(Boolean(Number((form_post_data.anonymous))));
|
||||
// let anonymous_test = Boolean(form_post_data.anonymous)
|
||||
|
||||
// console.log(!anonymous_test);
|
||||
// console.log(!!anonymous_test);
|
||||
// console.log(!!!anonymous_test);
|
||||
|
||||
post_data['anonymous'] = form_post_data.anonymous;
|
||||
|
||||
post_data['external_person_id'] = form_post_data.external_person_id;
|
||||
post_data['full_name'] = form_post_data.full_name;
|
||||
post_data['email'] = form_post_data.email;
|
||||
|
||||
post_data['hide'] = !!form_post_data.hide;
|
||||
post_data['priority'] = !!form_post_data.priority;
|
||||
if (form_post_data.sort) {
|
||||
post_data['sort'] = Number(form_post_data.sort);
|
||||
} else {
|
||||
post_data['sort'] = null;
|
||||
}
|
||||
if (form_post_data.group) {
|
||||
post_data['group'] = form_post_data.group;
|
||||
} else {
|
||||
post_data['group'] = null;
|
||||
}
|
||||
|
||||
if (form_post_data.enable) {
|
||||
post_data['enable'] = !!form_post_data.enable;
|
||||
}
|
||||
|
||||
if (tinyMCE.get('notes')) {
|
||||
post_data['notes'] = tinyMCE.get('notes').getContent();
|
||||
} else {
|
||||
post_data['notes'] = form_post_data.notes;
|
||||
}
|
||||
|
||||
console.log(post_data);
|
||||
|
||||
if (!$slct.post_id) {
|
||||
create_post_obj_promise = api.create_ae_obj_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post',
|
||||
fields: post_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (post_obj_create_result) {
|
||||
if (!post_obj_create_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$slct.post_id = post_obj_create_result.obj_id_random;
|
||||
|
||||
dispatch(
|
||||
'created__post_obj',
|
||||
{
|
||||
post_id: $slct.post_id,
|
||||
}
|
||||
);
|
||||
|
||||
return post_obj_create_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
return create_post_obj_promise;
|
||||
|
||||
} else {
|
||||
update_post_obj_promise = api.update_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post',
|
||||
obj_id: $slct.post_id,
|
||||
fields: post_data,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 1
|
||||
})
|
||||
.then(function (post_obj_update_result) {
|
||||
if (!post_obj_update_result) {
|
||||
console.log('The result was null or false.');
|
||||
return false;
|
||||
}
|
||||
|
||||
dispatch(
|
||||
'updated__post_obj',
|
||||
{
|
||||
post_id: $slct.post_id,
|
||||
}
|
||||
);
|
||||
|
||||
return post_obj_update_result;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
return false;
|
||||
});
|
||||
|
||||
return update_post_obj_promise;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function handle_delete_post_obj({post_id, method='disable'}) {
|
||||
console.log('*** handle_delete_post_obj() ***');
|
||||
|
||||
delete_post_obj_promise = api.delete_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'post',
|
||||
obj_id: post_id,
|
||||
method: method,
|
||||
// params: params,
|
||||
key: $ae_app.ae_api.api_crud_super_key,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (post_obj_delete_result) {
|
||||
if (post_obj_delete_result) {
|
||||
// console.log(`Result:`, post_obj_delete_result);
|
||||
|
||||
dispatch(
|
||||
'deleted__post_obj',
|
||||
{
|
||||
post_id: post_id,
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('The result was null or false when trying to delete.', error);
|
||||
});
|
||||
|
||||
return delete_post_obj_promise;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section
|
||||
class="svelte_component ae_edit post_obj"
|
||||
class:ae_create={!$slct.post_id}
|
||||
bind:clientHeight={$ae_app.iframe_height_modal_body}
|
||||
>
|
||||
|
||||
<form on:submit|preventDefault={handle_submit_form} class="">
|
||||
|
||||
{#await update_post_obj_promise}
|
||||
<div class="awaiting alert_msg_pulse" out:fade={{ duration: 2000 }}>Saving...</div>
|
||||
{:then}
|
||||
{#if update_post_obj_promise}
|
||||
<div class="awaiting" out:fade={{ duration: 2000 }}>Finished saving</div>
|
||||
{:else}
|
||||
<!-- <div class="awaiting" out:fade={{ duration: 2000 }}>Nothing here yet</div> -->
|
||||
{/if}
|
||||
{/await}
|
||||
|
||||
<h3>Post</h3>
|
||||
|
||||
<label for="title">Title of BB post
|
||||
<input type="text" id="title" name="title" required max="20" value={$slct.post_obj.title ? $slct.post_obj.title : '' } placeholder="BB post title">
|
||||
</label>
|
||||
|
||||
<label for="content">Content (post body)
|
||||
<textarea id="content" name="content" required rows="6" cols="80" value={$slct.post_obj.content ? $slct.post_obj.content : ''} class="ae_value post__content tinymce_editor editor_basic_200"></textarea>
|
||||
</label>
|
||||
|
||||
<label for="topic_id">BB post topic
|
||||
<select id="topic_id" name="topic_id" value={$slct.post_obj.topic_id}>
|
||||
<option value="">-- None --</option>
|
||||
<option value={16}>Licensing/ monitoring/ credentialing issues</option>
|
||||
<option value={17}>Return to practice</option>
|
||||
<option value={18}>Contacts/ sponsorship in my area</option>
|
||||
<option value={19}>Professional positions</option>
|
||||
<option value={21}
|
||||
disabled={!$ae_app.trusted_access}
|
||||
>
|
||||
Announcement
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<h3>Poster's Information</h3>
|
||||
<fieldset class="">
|
||||
<legend class="">Post as Anonymous</legend>
|
||||
<div class="">
|
||||
<input
|
||||
type="radio"
|
||||
id="anonymous_no"
|
||||
name="anonymous"
|
||||
value={false}
|
||||
bind:group={$slct.post_obj.anonymous}
|
||||
|
||||
>
|
||||
<label for="anonymous_no">No, include my name and email address</label>
|
||||
</div>
|
||||
<div class="">
|
||||
<input
|
||||
type="radio"
|
||||
id="anonymous_yes"
|
||||
name="anonymous"
|
||||
value={true}
|
||||
bind:group={$slct.post_obj.anonymous}
|
||||
|
||||
>
|
||||
<label for="anonymous_yes">Yes, the post will be listed as Anonymous</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<label for="external_person_id">Your ID
|
||||
{#if !$ae_app.trusted_access}
|
||||
<span class="fas fa-lock" title="Field is locked"></span>
|
||||
{:else}
|
||||
<span class="fas fa-unlock" title="Field is unlocked"></span>
|
||||
{/if}
|
||||
<input
|
||||
type="text"
|
||||
id="external_person_id"
|
||||
name="external_person_id"
|
||||
value={($slct.post_obj.external_person_id ? $slct.post_obj.external_person_id : $ae_app.novi_uuid)}
|
||||
readonly={!$ae_app.trusted_access}
|
||||
>
|
||||
<span class="ae_highlight">Primary link using the Novi API UUID</span>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
<label for="full_name">Your name
|
||||
{#if !$ae_app.trusted_access}
|
||||
<span class="fas fa-lock" title="Field is locked"></span>
|
||||
{:else}
|
||||
<span class="fas fa-unlock" title="Field is unlocked"></span>
|
||||
{/if}
|
||||
<input
|
||||
type="text"
|
||||
id="full_name"
|
||||
name="full_name"
|
||||
value={($slct.post_obj.full_name ? $slct.post_obj.full_name : $ae_app.novi_full_name)}
|
||||
readonly={!$ae_app.trusted_access}
|
||||
>
|
||||
</label>
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<label for="email">Your email
|
||||
{#if !$ae_app.trusted_access}
|
||||
<span class="fas fa-lock" title="Field is locked"></span>
|
||||
{:else}
|
||||
<span class="fas fa-unlock" title="Field is unlocked"></span>
|
||||
{/if}
|
||||
<input
|
||||
type="text"
|
||||
name="email"
|
||||
value={($slct.post_obj.email ? $slct.post_obj.email : $ae_app.novi_email)}
|
||||
readonly={!$ae_app.trusted_access}
|
||||
>
|
||||
<span class="ae_highlight">Secondary link using the Novi email address</span>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
<!-- <h3>Poster's Options</h3> -->
|
||||
|
||||
<!-- <fieldset class="">
|
||||
<legend class="">Official or Member Post</legend>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="group_official" name="group" value="official">
|
||||
<label for="group_official" class="">Post as Official/Leadership</label>
|
||||
</div>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="group_member" name="group" value="member" checked="">
|
||||
<label for="group_member" class="">Post as Member</label>
|
||||
</div>
|
||||
</fieldset> -->
|
||||
|
||||
<!-- <fieldset class="">
|
||||
<legend class="">Enable Comments</legend>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="enable_comments_no" name="enable_comments" value="0">
|
||||
<label for="enable_comments_no" class="">No, do not allow comments</label>
|
||||
</div>
|
||||
<div class="">
|
||||
<input type="radio" class="" id="enable_comments_yes" name="enable_comments" value="1" checked>
|
||||
<label for="enable_comments_yes" class="">Yes, allow comments</label>
|
||||
</div>
|
||||
</fieldset> -->
|
||||
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<section class="ae_section post__admin_options"> <!-- BEGIN: section post__admin_options -->
|
||||
|
||||
<h3>
|
||||
Admin Options
|
||||
<button type="button" class="ae_btn ae_d_none_toggle ae_float_right ae_smallest btn btn-xs btn-info" on:click={() => {document.querySelector('.ae_d_none_content').classList.toggle('ae_fade_out'); document.querySelector('.ae_d_none_content').classList.toggle('ae_fade_in');}}><span class="fas fa-eye"></span> Show/Hide Admin</button>
|
||||
</h3>
|
||||
|
||||
<span class="ae_d_none_content ae_fade_out">
|
||||
<label>Hide
|
||||
<input
|
||||
type="checkbox"
|
||||
name="hide"
|
||||
id="hide"
|
||||
bind:checked={$slct.post_obj.hide}
|
||||
>
|
||||
</label>
|
||||
|
||||
<label>Priority
|
||||
<input
|
||||
type="checkbox"
|
||||
name="priority"
|
||||
id="priority"
|
||||
bind:checked={$slct.post_obj.priority}
|
||||
>
|
||||
</label>
|
||||
|
||||
<label>Sort <input type="number" name="sort" value={$slct.post_obj.sort} /></label>
|
||||
|
||||
<label>Group <input type="text" name="group" value={$slct.post_obj.group} max="100" /></label>
|
||||
|
||||
{#if $ae_app.administrator_access}
|
||||
<label>Enable
|
||||
<input
|
||||
type="checkbox"
|
||||
name="enable"
|
||||
id="enable"
|
||||
bind:checked={$slct.post_obj.enable}
|
||||
>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<label>Internal Staff Notes
|
||||
<textarea id="notes" name="notes" class="ae_value post__notes tinymce_editor editor_basic_200" rows="2" cols="70" value={$slct.post_obj.notes}></textarea>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
</span> <!-- END: span ae_show_hide_content -->
|
||||
|
||||
</section> <!-- END: section post__admin_options -->
|
||||
{/if}
|
||||
|
||||
|
||||
<section class="ae_section ae_options ae_row">
|
||||
<button type="submit" class="ae_btn btn btn-primary"><span class="fas fa-check"></span> Save Post</button>
|
||||
|
||||
{#if $slct.post_id}
|
||||
{#if $ae_app.administrator_access}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to delete this post?')) {return false;}
|
||||
handle_delete_post_obj({post_id: $slct.post_id, method: 'delete'});
|
||||
|
||||
$slct.post_id = null;
|
||||
$slct.post_obj = {};
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-danger" type="button"
|
||||
title="Delete record permanently"
|
||||
>
|
||||
<span class="fas fa-minus"></span> Delete
|
||||
</button>
|
||||
{:else if $ae_app.trusted_access}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to disable this post?')) {return false;}
|
||||
handle_delete_post_obj({post_id: $slct.post_id, method: 'disable'});
|
||||
|
||||
$slct.post_id = null;
|
||||
$slct.post_obj = {};
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-danger" type="button"
|
||||
title="Disable record to delete"
|
||||
>
|
||||
<span class="fas fa-minus"></span> Disable
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to hide this post?')) {return false;}
|
||||
handle_delete_post_obj({post_id: $slct.post_id, method: 'hide'});
|
||||
|
||||
$slct.post_id = null;
|
||||
$slct.post_obj = {};
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-danger" type="button"
|
||||
title="Hide record to delete"
|
||||
>
|
||||
<span class="fas fa-comment-slash"></span> Delete
|
||||
</button>
|
||||
{/if}
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,63 +0,0 @@
|
||||
<script lang="ts">
|
||||
|
||||
// *** Import Svelte core
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
import { slct, slct_trigger, ae_app, ae_session } from './stores';
|
||||
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** OSIT - AE Hub: Site Menu');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<nav>
|
||||
{#if $ae_session.site_nav_menu}
|
||||
<ul>
|
||||
{#each Object.entries($ae_session.site_nav_menu) as [name, menu_item]}
|
||||
<li>
|
||||
<a href={menu_item.href} class={menu_item.class_li}>{@html menu_item.text}</a>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
</nav>
|
||||
|
||||
|
||||
<style>
|
||||
nav {
|
||||
/* outline: dashed thick red; */
|
||||
/* background-color: hsla(0, 0%, 100%, 0.85); */
|
||||
/* padding: .5em 1em; */
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
nav ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
nav ul li {
|
||||
/* display: inline; */
|
||||
/* margin-right: 1em; */
|
||||
}
|
||||
nav ul li a {
|
||||
text-decoration: none;
|
||||
}
|
||||
nav ul li a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
nav ul li a.active {
|
||||
font-weight: bold;
|
||||
}
|
||||
nav ul li a.active:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
@@ -1,489 +0,0 @@
|
||||
<script lang="ts">
|
||||
// *** Import Svelte core
|
||||
import { onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
import { ae, api, Element_modal_v3 } from 'aether_npm_lib';
|
||||
import { slct, ae_app, slct_trigger } from './stores';
|
||||
|
||||
import Edit_archive_content_obj from './10_edit__archive_content_obj.svelte';
|
||||
import Player_archive_content_obj from './10_player__archive_content_obj.svelte';
|
||||
|
||||
let idaa_archive_content_obj_li_get_promise: Promise<any>;
|
||||
let idaa_archive_content_obj_get_promise: Promise<any>;
|
||||
|
||||
let file_icons:any = {}
|
||||
file_icons['ac3'] = 'file-audio';
|
||||
file_icons['aac'] = 'file-audio';
|
||||
file_icons['csv'] = 'file-csv';
|
||||
file_icons['doc'] = 'file-word';
|
||||
file_icons['docx'] = 'file-word';
|
||||
file_icons['gif'] = 'file-image';
|
||||
file_icons['htm'] = 'file-code';
|
||||
file_icons['html'] = 'file-code';
|
||||
file_icons['jpeg'] = 'file-image';
|
||||
file_icons['jpg'] = 'file-image';
|
||||
file_icons['key'] = 'file-powerpoint';
|
||||
file_icons['mkv'] = 'file-video';
|
||||
file_icons['mov'] = 'file-video';
|
||||
file_icons['mp3'] = 'file-audio';
|
||||
file_icons['mp4'] = 'file-video';
|
||||
file_icons['pdf'] = 'file-pdf';
|
||||
file_icons['png'] = 'file-image';
|
||||
file_icons['ppt'] = 'file-powerpoint';
|
||||
file_icons['pptx'] = 'file-powerpoint';
|
||||
file_icons['txt'] = 'file-alt';
|
||||
file_icons['wav'] = 'file-audio';
|
||||
file_icons['webp'] = 'file-image';
|
||||
file_icons['xls'] = 'file-excel';
|
||||
file_icons['xlsx'] = 'file-excel';
|
||||
file_icons['zip'] = 'file-archive';
|
||||
|
||||
let media_play_extension_li = ['m4a', 'mp4', 'mp3'];
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** List - Archive Content Obj Li');
|
||||
});
|
||||
|
||||
$: if ($slct_trigger == 'load__archive_content_obj_li' && $slct.archive_id) {
|
||||
$slct_trigger = null;
|
||||
|
||||
handle_load_archive_content_obj_li({archive_id: $slct.archive_id, try_cache: false});
|
||||
}
|
||||
|
||||
async function handle_load_archive_content_obj_li({archive_id, try_cache=false}) {
|
||||
console.log('*** handle_load_archive_content_obj_li() ***');
|
||||
|
||||
let enabled = $ae_app.archives.enabled;
|
||||
let hidden = $ae_app.archives.hidden;
|
||||
let limit = $ae_app.archives.limit;
|
||||
let offset = $ae_app.archives.offset;
|
||||
// $ae_app.archives.content_group_sort = 'DESC'; // 'ASC' or 'DESC'
|
||||
let group_sort = $ae_app.archives.content_group_sort; // 'ASC' or 'DESC'
|
||||
|
||||
let params = {};
|
||||
|
||||
idaa_archive_content_obj_li_get_promise = api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive_content',
|
||||
for_obj_type: 'archive',
|
||||
for_obj_id: archive_id,
|
||||
enabled: enabled,
|
||||
hidden: hidden,
|
||||
order_by_li: {'group': group_sort, 'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC', 'created_on': 'DESC', 'updated_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: null,
|
||||
params: params,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (archive_content_obj_li_get_result) {
|
||||
if (archive_content_obj_li_get_result) {
|
||||
$slct.archive_content_obj_li = archive_content_obj_li_get_result;
|
||||
console.log(`Archive Content list:`, $slct.archive_content_obj_li);
|
||||
|
||||
// console.log(ae.dynamic_sort());
|
||||
// $slct.archive_content_obj_li.sort(ae.util.dynamic_sort_multiple('group ASC', 'created_on DESC', 'updated_on DESC'));
|
||||
} else {
|
||||
$slct.archive_content_obj_li = [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return idaa_archive_content_obj_li_get_promise;
|
||||
}
|
||||
|
||||
|
||||
$: if ($slct_trigger == 'load__archive_content_obj' && $slct.archive_content_id) {
|
||||
$slct_trigger = null;
|
||||
|
||||
handle_load_archive_content_obj({archive_content_id: $slct.archive_content_id, try_cache: false});
|
||||
}
|
||||
|
||||
|
||||
async function handle_load_archive_content_obj({archive_content_id, try_cache=false}) {
|
||||
console.log('*** handle_load_archive_content_obj() ***');
|
||||
|
||||
let params = {};
|
||||
|
||||
idaa_archive_content_obj_get_promise = api.get_ae_obj_id_crud({
|
||||
api_cfg: $ae_app.ae_api,
|
||||
obj_type: 'archive_content',
|
||||
obj_id: archive_content_id,
|
||||
use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
|
||||
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value in the API config.
|
||||
params: params,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (archive_content_obj_get_result) {
|
||||
if (archive_content_obj_get_result) {
|
||||
$slct.archive_content_obj = archive_content_obj_get_result;
|
||||
console.log(`Archive object:`, $slct.archive_content_obj);
|
||||
}
|
||||
|
||||
// handle_resize_document();
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return idaa_archive_content_obj_get_promise;
|
||||
}
|
||||
|
||||
function handle_created_archive_content_obj(event) {
|
||||
console.log('*** handle_created_archive_content_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
|
||||
$ae_app.archives.show_list__event_obj_li = true;
|
||||
$ae_app.archives.show_edit__archive_content_id = false;
|
||||
$ae_app.archives.show_view__archive_content_id = false;
|
||||
}
|
||||
|
||||
function handle_updated_archive_content_obj(event) {
|
||||
console.log('*** handle_updated_archive_content_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
|
||||
$ae_app.archives.show_list__event_obj_li = true;
|
||||
$ae_app.archives.show_edit__archive_content_id = false;
|
||||
$ae_app.archives.show_view__archive_content_id = false;
|
||||
}
|
||||
|
||||
function handle_deleted_archive_content_obj(event) {
|
||||
console.log('*** handle_deleted_archive_content_obj() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
|
||||
$ae_app.archives.show_list__event_obj_li = true;
|
||||
$ae_app.archives.show_edit__archive_content_id = false;
|
||||
$ae_app.archives.show_view__archive_content_id = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section class="svelte_component ae_section ae_list archive_content_obj_li list__archive_content_obj">
|
||||
{#if $slct.archive_content_obj_li}
|
||||
|
||||
{#each $slct.archive_content_obj_li as idaa_archive_content_obj, index}
|
||||
<!-- {#each $slct.archive_content_obj_li.sort(ae.util.dynamic_sort_multiple('group ASC', 'priority DESC')) 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}
|
||||
<div class="ae_row archive_content__group">
|
||||
<button
|
||||
class="ae_btn btn btn-info ae_margin_sm"
|
||||
on:click={() => {
|
||||
if ($ae_app.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group) {
|
||||
$ae_app.archives.show_list__archive_content_li_group = null;
|
||||
} else {
|
||||
$ae_app.archives.show_list__archive_content_li_group = idaa_archive_content_obj.group;
|
||||
}
|
||||
}}
|
||||
>
|
||||
{#if $ae_app.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group}
|
||||
<span class="fas fa-caret-down" in:fade={{ duration: 250 }}
|
||||
out:fade={{ duration: 0 }}></span>
|
||||
<!-- <span class="fas fa-minus"></span> -->
|
||||
<span class="ae_label">Hide:</span>
|
||||
{:else}
|
||||
<span class="fas fa-caret-right" in:fade={{ duration: 250 }}
|
||||
out:fade={{ duration: 0 }}></span>
|
||||
<!-- <span class="fas fa-plus"></span> -->
|
||||
<span class="ae_label">Show:</span>
|
||||
{/if}
|
||||
<!-- <span class="fas fa-caret-down"></span> -->
|
||||
<!-- <span class="ae_label">Show:</span> -->
|
||||
<span class="ae_value">{idaa_archive_content_obj.group}</span>
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
{#if $ae_app.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group}
|
||||
<!-- class:ae_d_none={$ae_app.archives.show_list__archive_content_li_group != idaa_archive_content_obj.group} -->
|
||||
<div
|
||||
id={`idaa_archive_content_id__${idaa_archive_content_obj.archive_content_id_random}`}
|
||||
class="container archive_content ae_object archive_content_obj"
|
||||
class:archive__content_type={idaa_archive_content_obj.type}
|
||||
|
||||
in:fade={{ duration: 125 }}
|
||||
out:fade={{ duration: 250 }}
|
||||
>
|
||||
|
||||
<header class="ae_header archive_content__header">
|
||||
<h3>
|
||||
<span class="archive_content__name">{idaa_archive_content_obj.name}</span>
|
||||
|
||||
{#if idaa_archive_content_obj.type}<span class="badge badge-info bg-info"><span class="fas fa-user-md"></span> {idaa_archive_content_obj.type}</span>{/if}
|
||||
|
||||
{#if $ae_app.trusted_access && idaa_archive_content_obj.hide}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Hidden</span>{/if}
|
||||
{#if $ae_app.administrator_access && !idaa_archive_content_obj.enable}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Not enabled</span>{/if}
|
||||
</h3>
|
||||
</header>
|
||||
|
||||
<section class="ae_options archive_content_obj__options">
|
||||
{#if idaa_archive_content_obj.archive_content_id_random != $ae_app.archives.show_view__archive_content_media}
|
||||
<button
|
||||
on:click={ () => {
|
||||
$slct.archive_content_id = idaa_archive_content_obj.archive_content_id_random;
|
||||
$slct.archive_content_obj = idaa_archive_content_obj;
|
||||
$ae_app.archives.show_view__archive_content_media = $slct.archive_content_id;
|
||||
// idaa_archive_content_obj.show_view__archive_content_media = true;
|
||||
}}
|
||||
class="ae_btn btn_md btn btn-md btn-primary"
|
||||
title="Open this file">
|
||||
{#if media_play_extension_li.includes( idaa_archive_content_obj.file_extension)}
|
||||
<span class="fas fa-play"></span>
|
||||
Play <!-- This really should check the file type: view, show, play, listen, watch -->
|
||||
{:else}
|
||||
<span class="fas fa-eye"></span>
|
||||
View
|
||||
{/if}
|
||||
<span class="badge">
|
||||
{#if file_icons[idaa_archive_content_obj.file_extension]}
|
||||
<span class="fas fa-{file_icons[idaa_archive_content_obj.file_extension]}"></span>
|
||||
{:else}
|
||||
<span class="fas fa-file"></span>
|
||||
{/if}
|
||||
.{idaa_archive_content_obj.file_extension}</span>
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
on:click={ () => {
|
||||
$slct.archive_content_id = idaa_archive_content_obj.archive_content_id_random;
|
||||
$slct.archive_content_obj = idaa_archive_content_obj;
|
||||
|
||||
$ae_app.archives.show_view__archive_content_media = false;
|
||||
// idaa_archive_content_obj.show_view__archive_content_media = false;
|
||||
}}
|
||||
class="ae_btn btn_md btn btn-md btn-secondary"
|
||||
title="Hide this file">
|
||||
<span class="fas fa-play"></span>
|
||||
Hide <!-- This really should check the file type: view, show, play, listen, watch -->
|
||||
<span class="badge">
|
||||
{#if file_icons[idaa_archive_content_obj.file_extension]}
|
||||
<span class="fas fa-{file_icons[idaa_archive_content_obj.file_extension]}"></span>
|
||||
{:else}
|
||||
<span class="fas fa-file"></span>
|
||||
{/if}
|
||||
.{idaa_archive_content_obj.file_extension}</span>
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<a href="{$ae_app.app.base_url}{idaa_archive_content_obj.hosted_file_path}" class="ae_btn btn_md btn btn-md btn-secondary" title="Download this file">
|
||||
<span class="fas fa-download"></span>
|
||||
Download <!-- This really should check the file type: view, show, play, listen, watch -->
|
||||
<span class="badge">
|
||||
{#if file_icons[idaa_archive_content_obj.file_extension]}
|
||||
<span class="fas fa-{file_icons[idaa_archive_content_obj.file_extension]}"></span>
|
||||
{:else}
|
||||
<span class="fas fa-file"></span>
|
||||
{/if}
|
||||
.{idaa_archive_content_obj.file_extension}</span>
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.archive_content_id = idaa_archive_content_obj.archive_content_id_random;
|
||||
$slct.archive_content_obj = idaa_archive_content_obj;
|
||||
$slct_trigger = 'load__archive_content_obj';
|
||||
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('archive_content_id', idaa_archive_content_obj.archive_content_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// $ae_app.archives.show_main__options = true;
|
||||
// $ae_app.archives.show_list__archive_content_li = true;
|
||||
// $ae_app.archives.show_view__archive_content_id = false;
|
||||
$ae_app.archives.show_view__archive_content_media = false;
|
||||
$ae_app.archives.show_edit__archive_content_id = true;
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-warning"
|
||||
title={`Edit content: ${idaa_archive_content_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit Content
|
||||
</button>
|
||||
<!-- <button
|
||||
on:click={() => {
|
||||
// Copy URL to clipboard
|
||||
// Is there a URL anymore?
|
||||
// const copy_text = document.getElementById(`archive_edit_url_${idaa_archive_content_obj.archive_content_id_random}`);
|
||||
}}
|
||||
class="ae_btn btn_sm btn_outline_info archive_edit_help"
|
||||
>
|
||||
<span class="fas fa-link"></span> URL
|
||||
</button> -->
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
|
||||
<!-- Doing some checks before the media player/viewer shows. The player should be the only one showing. So there is a sort of global check first. -->
|
||||
{#if idaa_archive_content_obj.archive_content_id_random == $ae_app.archives.show_view__archive_content_media}
|
||||
<Player_archive_content_obj archive_content_id={idaa_archive_content_obj.archive_content_id_random} />
|
||||
{/if}
|
||||
|
||||
|
||||
<section class="ae_section archive_content__content">
|
||||
{#if idaa_archive_content_obj.description}
|
||||
<div
|
||||
class="archive_content__description ae_description"
|
||||
>
|
||||
<div class="ae_label archive_content__description">Description:</div>
|
||||
<div class="ae_value archive_content__description">
|
||||
{idaa_archive_content_obj.description}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if idaa_archive_content_obj.content_html}
|
||||
<div
|
||||
class="archive_content__content_html ae_content_html"
|
||||
>
|
||||
<div class="ae_label archive_content__content_html">Content:</div>
|
||||
<div class="ae_value archive_content__content_html">
|
||||
{@html idaa_archive_content_obj.content_html}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div
|
||||
class="ae_group"
|
||||
class:ae_d_none={!idaa_archive_content_obj.original_datetime && !idaa_archive_content_obj.original_timezone}
|
||||
>
|
||||
<span class="ae_label">Original date/time:</span>
|
||||
{#if idaa_archive_content_obj.original_datetime}
|
||||
<span class="ae_value ae_prop prop_original_datetime fs_smaller">{ae.util.iso_datetime_formatter(idaa_archive_content_obj.original_datetime, 'datetime_long')}</span>
|
||||
{/if}
|
||||
{#if idaa_archive_content_obj.original_timezone}
|
||||
<span class="ae_label">Timezone:</span>
|
||||
<span class="ae_value">{idaa_archive_content_obj.original_timezone}</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<section
|
||||
class="ae_section ae_footer ae_meta archive_content__meta"
|
||||
class:ae_d_none={!$ae_app.administrator_access}
|
||||
>
|
||||
<span
|
||||
class="archive_content__archive_content_type"
|
||||
class:ae_d_none={!idaa_archive_content_obj.archive_content_type}
|
||||
>
|
||||
Type: {idaa_archive_content_obj.archive_content_type}
|
||||
</span>
|
||||
<span class="ae_group">
|
||||
<span
|
||||
class="archive_content__created_on"
|
||||
>
|
||||
Created on: {ae.util.iso_datetime_formatter(idaa_archive_content_obj.created_on, 'datetime_short')}
|
||||
</span>
|
||||
<span
|
||||
class="archive_content__updated_on"
|
||||
class:ae_d_none={!idaa_archive_content_obj.updated_on}
|
||||
>
|
||||
Updated on: {ae.util.iso_datetime_formatter(idaa_archive_content_obj.updated_on, 'datetime_short')}
|
||||
</span>
|
||||
</span>
|
||||
</section>
|
||||
</div>
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
{:else}
|
||||
<div>No archives avalible to show at this time</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
|
||||
{#if $ae_app.archives.show_edit__archive_content_id}
|
||||
<!-- <section class="ae_edit archive_content_obj archive_content_id idaa_archive_content_id_edit"> -->
|
||||
<Element_modal_v3
|
||||
show = { true }
|
||||
modal_cover_body = { false }
|
||||
on:close={ () => {
|
||||
$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, "*");
|
||||
}}
|
||||
>
|
||||
<span slot="header_title">{@html ($slct.archive_content_obj.name ? $slct.archive_content_obj.name : 'New Archive Content')}</span>
|
||||
|
||||
<span slot="body">
|
||||
|
||||
<Edit_archive_content_obj
|
||||
on:created__archive_content_obj={handle_created_archive_content_obj}
|
||||
on:updated__archive_content_obj={handle_updated_archive_content_obj}
|
||||
on:deleted__archive_content_obj={handle_deleted_archive_content_obj}
|
||||
/>
|
||||
|
||||
</span>
|
||||
</Element_modal_v3>
|
||||
<!-- </section> -->
|
||||
{/if}
|
||||
|
||||
|
||||
<style>
|
||||
.ae_label {
|
||||
font-size: smaller;
|
||||
}
|
||||
.ae_value {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ae_header h3 {
|
||||
font-size: 1.2em;
|
||||
margin: 0;
|
||||
/* padding: 0; */
|
||||
}
|
||||
|
||||
.ae_row.archive_content__group {
|
||||
width: 100%;
|
||||
}
|
||||
.ae_row.archive_content__group button {
|
||||
width: 100%;
|
||||
}
|
||||
.ae_value.archive_content__group {
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
text-align: center;
|
||||
|
||||
border-bottom: solid thin black;
|
||||
}
|
||||
|
||||
.archive_content_obj .ae_meta {
|
||||
flex-direction: column;
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
.archive_content_obj .ae_meta .ae_group {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.archive_content_obj .ae_meta .ae_options {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
@@ -1,151 +0,0 @@
|
||||
<script lang="ts">
|
||||
// *** Import Svelte core
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
import { ae } from 'aether_npm_lib';
|
||||
import { slct, ae_app, slct_trigger } from './stores';
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** List - Archive Obj Li');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<section class="svelte_component ae_section ae_list archive_obj_li list__archive_obj archive_list">
|
||||
{#if $slct.archive_obj_li}
|
||||
|
||||
{#each $slct.archive_obj_li as idaa_archive_obj, index}
|
||||
<div
|
||||
id={`idaa_archive_id__${idaa_archive_obj.archive_id_random}`}
|
||||
class="archive ae_object archive_obj"
|
||||
>
|
||||
|
||||
<div class="ae_header archive__header">
|
||||
<span class="archive__name">{idaa_archive_obj.name}</span>
|
||||
{#if idaa_archive_obj.original_location}
|
||||
<span>(
|
||||
<!-- <span class="ae_label">Location:</span> -->
|
||||
<span class="ae_value">{idaa_archive_obj.original_location}</span>
|
||||
)
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
{#if $ae_app.trusted_access && idaa_archive_obj.hide}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Hidden</span>{/if}
|
||||
{#if $ae_app.administrator_access && !idaa_archive_obj.enable}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Not enabled</span>{/if}
|
||||
</div>
|
||||
|
||||
<div class="ae_options archive_obj__options">
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.archive_id = idaa_archive_obj.archive_id_random;
|
||||
$slct.archive_obj = idaa_archive_obj;
|
||||
$ae_app.archives.content_group_sort = $slct.archive_obj.cfg_json.content_group_sort;
|
||||
$slct_trigger = 'load__archive_obj';
|
||||
|
||||
$ae_app.archives.show_main__options = true;
|
||||
$ae_app.archives.show_list__archive_obj_li = false;
|
||||
$ae_app.archives.show_view__archive_obj = true;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
}}
|
||||
class="btn btn-secondary"
|
||||
title={`View: ${idaa_archive_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-envelope-open"></span> Open
|
||||
</button>
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.archive_id = idaa_archive_obj.archive_id_random;
|
||||
$slct.archive_obj = idaa_archive_obj;
|
||||
$slct_trigger = 'load__archive_obj';
|
||||
|
||||
// $ae_app.archives.show_main__options = true;
|
||||
// $ae_app.archives.show_list__archive_obj_li = true;
|
||||
$ae_app.archives.show_view__archive_obj = false;
|
||||
$ae_app.archives.show_edit__archive_obj = true;
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-warning"
|
||||
title={`Edit archive: ${idaa_archive_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit Archive
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<section class="ae_section archive__content">
|
||||
<div
|
||||
class="archive_description description"
|
||||
>
|
||||
<!-- <div class="ae_label archive__description">Description:</div> -->
|
||||
<div class="ae_value archive__description">
|
||||
{@html idaa_archive_obj.description}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section class="ae_section ae_footer ae_meta archive__meta">
|
||||
<div class="ae_group">
|
||||
{#if !idaa_archive_obj.updated_on}
|
||||
<span
|
||||
class="archive__created_on"
|
||||
>
|
||||
<span class="ae_label">Created on:</span>
|
||||
<span class="ae_value">{ae.util.iso_datetime_formatter(idaa_archive_obj.created_on, 'datetime_short')}</span>
|
||||
</span>
|
||||
{:else}
|
||||
<span
|
||||
class="archive__updated_on"
|
||||
>
|
||||
<span class="ae_label">Updated on:</span>
|
||||
<span class="ae_value">{ae.util.iso_datetime_formatter(idaa_archive_obj.updated_on, 'datetime_short')}</span>
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
{:else}
|
||||
<div>No archives avalible to show at this time</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
.archive_obj {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1em;
|
||||
}
|
||||
|
||||
.archive__name {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.archive__content {
|
||||
display: none;
|
||||
}
|
||||
.archive__meta {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.archive_obj .ae_meta {
|
||||
flex-direction: column;
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
.archive_obj .ae_meta .ae_group {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.archive_obj .ae_meta .ae_options {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
@@ -1,163 +0,0 @@
|
||||
<script lang="ts">
|
||||
// *** Import Svelte core
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// *** Import Aether core variables and functions
|
||||
import { ae } from 'aether_npm_lib';
|
||||
import { slct, ae_app, slct_trigger } from './stores';
|
||||
|
||||
export let container_class_li = [];
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** List - Sponsorships Obj');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<section class="svelte_component ae_section ae_list list__sponsorship_obj sponsorship_obj_li {container_class_li.join(' ')}">
|
||||
{#if $slct.sponsorship_obj_li}
|
||||
<table class="ae_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Options</th>
|
||||
<th>Name</th> <!-- This is the name of the organization or person -->
|
||||
<th>Level</th>
|
||||
<th>Paid</th>
|
||||
<th>Guests</th>
|
||||
<th>
|
||||
<!-- Show what POC (Point of Contact) stands for when hovering -->
|
||||
<abbr title="Point of Contact" class="ae_label">POC</abbr>
|
||||
</th>
|
||||
<th>Created</th>
|
||||
<th>Updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each $slct.sponsorship_obj_li as ae_sponsorship_obj, index}
|
||||
<tr
|
||||
id={`ae_sponsorship_id__${ae_sponsorship_obj.sponsorship_id_random}`}
|
||||
class="ae_object sponsorship_obj"
|
||||
>
|
||||
|
||||
<td class="ae_options sponsorship_obj__options">
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.sponsorship_id = ae_sponsorship_obj.sponsorship_id_random;
|
||||
$slct.sponsorship_obj = ae_sponsorship_obj;
|
||||
$slct_trigger = 'load__sponsorship_obj';
|
||||
|
||||
$ae_app.sponsorships.show_main__options = true;
|
||||
$ae_app.sponsorships.show_list__sponsorship_obj_li = true;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = true;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = false;
|
||||
}}
|
||||
class="ae_btn btn_primary"
|
||||
title={`Open to see details: ${ae_sponsorship_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-envelope-open"></span>
|
||||
<!-- <span class="fas fa-info-circle"></span> -->
|
||||
View
|
||||
</button>
|
||||
|
||||
{#if $ae_app.administrator_access}
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.sponsorship_id = ae_sponsorship_obj.sponsorship_id_random;
|
||||
$slct.sponsorship_obj = ae_sponsorship_obj;
|
||||
$slct_trigger = 'load__sponsorship_obj';
|
||||
|
||||
// $ae_app.sponsorships.show_main__options = true;
|
||||
// $ae_app.sponsorships.show_list__sponsorship_obj_li = true;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = false;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = true;
|
||||
}}
|
||||
class="ae_btn btn_secondary"
|
||||
title={`Edit meeting: ${ae_sponsorship_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit
|
||||
</button>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
<td class="ae_value sponsorships__name">{ae_sponsorship_obj.name}</td>
|
||||
|
||||
<td class="">
|
||||
<span class="fas fa-gem"></span>
|
||||
{#if ae_sponsorship_obj.level_num}{ae_sponsorship_obj.level_num}{/if}
|
||||
{#if ae_sponsorship_obj.level_str}{ae_sponsorship_obj.level_str}{/if}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{#if ae_sponsorship_obj.paid}
|
||||
<!-- Show checkmark -->
|
||||
<span class="fas fa-check"
|
||||
title="Paid"></span>
|
||||
{:else}
|
||||
<!-- Show X or cross -->
|
||||
<span class="fas fa-times"
|
||||
title="Not Paid"></span>
|
||||
{/if}
|
||||
{#if ae_sponsorship_obj.amount}
|
||||
<span class="ae_value sponsorships__amount">${ae_sponsorship_obj.amount}</span>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{#if ae_sponsorship_obj.guest_li_json}
|
||||
<span class="fas fa-list-ol"></span> {ae_sponsorship_obj.guest_li_json.length}
|
||||
{:else}
|
||||
<!-- <span class="fas fa-list-ol"></span> -->
|
||||
-- None --
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
<td><span class="ae_flex ae_flex_justify_around">
|
||||
{#if ae_sponsorship_obj.poc_json}
|
||||
<span>
|
||||
<span class="fas fa-user"></span> {ae_sponsorship_obj.poc_json.given_name} {ae_sponsorship_obj.poc_json.family_name}
|
||||
</span>
|
||||
<a href="mailto:{ae_sponsorship_obj.poc_json.email}"><span class="fas fa-envelope"></span> {ae_sponsorship_obj.poc_json.email}</a>
|
||||
{/if}
|
||||
</span></td>
|
||||
|
||||
<td>{ae.util.iso_datetime_formatter(ae_sponsorship_obj.created_on, 'datetime_short')}</td>
|
||||
<td>{ae.util.iso_datetime_formatter(ae_sponsorship_obj.updated_on, 'datetime_short')}</td>
|
||||
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
{:else}
|
||||
<div>No sponsorships avalible to show at this time</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
.ae_label {
|
||||
font-size: smaller;
|
||||
}
|
||||
.ae_value {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ae_header h3 {
|
||||
font-size: 1.2em;
|
||||
margin: 0;
|
||||
/* padding: 0; */
|
||||
}
|
||||
|
||||
.sponsorship_obj .ae_meta {
|
||||
flex-direction: column;
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
.sponsorship_obj .ae_meta .ae_group {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.sponsorship_obj .ae_meta .ae_options {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
@@ -1,78 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
// import { ae, Element_modal_v3 } from 'aether_npm_lib';
|
||||
import { slct, slct_trigger, ae_app } from './stores';
|
||||
|
||||
// export let archive_content_id = null;
|
||||
|
||||
let file_icons:any = {}
|
||||
file_icons['ac3'] = 'file-audio';
|
||||
file_icons['aac'] = 'file-audio';
|
||||
file_icons['csv'] = 'file-csv';
|
||||
file_icons['doc'] = 'file-word';
|
||||
file_icons['docx'] = 'file-word';
|
||||
file_icons['gif'] = 'file-image';
|
||||
file_icons['htm'] = 'file-code';
|
||||
file_icons['html'] = 'file-code';
|
||||
file_icons['jpeg'] = 'file-image';
|
||||
file_icons['jpg'] = 'file-image';
|
||||
file_icons['key'] = 'file-powerpoint';
|
||||
file_icons['mkv'] = 'file-video';
|
||||
file_icons['mov'] = 'file-video';
|
||||
file_icons['mp3'] = 'file-audio';
|
||||
file_icons['mp4'] = 'file-video';
|
||||
file_icons['pdf'] = 'file-pdf';
|
||||
file_icons['png'] = 'file-image';
|
||||
file_icons['ppt'] = 'file-powerpoint';
|
||||
file_icons['pptx'] = 'file-powerpoint';
|
||||
file_icons['txt'] = 'file-alt';
|
||||
file_icons['wav'] = 'file-audio';
|
||||
file_icons['webp'] = 'file-image';
|
||||
file_icons['xls'] = 'file-excel';
|
||||
file_icons['xlsx'] = 'file-excel';
|
||||
file_icons['zip'] = 'file-archive';
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** Player - Archive Content Obj');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- <h3 class="ae_title">Viewing: {$slct.archive_content_obj.name}</h3> -->
|
||||
|
||||
<section class="ae_content">
|
||||
{#if file_icons[$slct.archive_content_obj.file_extension] == 'file-audio'}
|
||||
<audio id="view_archive_content_audio" width="" height="" autoplay controls style="max-width: 100%; max-height: 65vh;">
|
||||
<source id="view_archive_content_audio_source" src="{$ae_app.app.base_url}{$slct.archive_content_obj.file_path}" type="audio/mpeg">
|
||||
<!--<source src="audio.ogg" type="audio/ogg">-->
|
||||
Your browser does not support the audio tag.
|
||||
</audio>
|
||||
|
||||
{:else if file_icons[$slct.archive_content_obj.file_extension] == 'file-video'}
|
||||
<video id="view_archive_content_video" width="" height="" autoplay controls style="max-width: 100%; max-height: 65vh;">
|
||||
<source id="view_archive_content_video_source" src="{$ae_app.app.base_url}{$slct.archive_content_obj.file_path}" type="video/mp4">
|
||||
<!--<source src="video.ogg" type="video/ogg">-->
|
||||
<track kind="captions" src="" srclang="en" label="English">
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
|
||||
{:else if file_icons[$slct.archive_content_obj.file_extension] == 'file-image'}
|
||||
<img id="view_archive_content_image" src="{$ae_app.app.base_url}{$slct.archive_content_obj.file_path}" alt="{$slct.archive_content_obj.name}" style="max-width: 100%; max-height: 65vh;" />
|
||||
{:else}
|
||||
<a href="{$ae_app.app.base_url}{$slct.archive_content_obj.file_path}">{$slct.archive_content_obj.filename}</a>
|
||||
{/if}
|
||||
|
||||
{#if $slct.archive_content_obj.description}
|
||||
<div id="archive_content__description" class="archive_content__description">
|
||||
{$slct.archive_content_obj.description}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if $slct.archive_content_obj.content_html}
|
||||
<div id="archive_content__content_html" class="archive_content__content_html">
|
||||
{@html $slct.archive_content_obj.content_html}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</section>
|
||||
@@ -1,244 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { ae, Element_modal_v3 } from 'aether_npm_lib';
|
||||
import { slct, slct_trigger, ae_app } from './stores';
|
||||
|
||||
// import Edit_archive_content_obj from './10_edit__archive_content_obj.svelte';
|
||||
import List_archive_content_obj from './10_list__archive_content_obj.svelte';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
if ($slct.archive_id) {
|
||||
console.log(`Archive ID selected: ${$slct.archive_id}`);
|
||||
console.log(`Archive Object selected: ${$slct.archive_obj}`)
|
||||
|
||||
$slct_trigger = 'load__archive_obj';
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
|
||||
// Auto show the selected Archive ID
|
||||
// Set the URL param "archive_id" to the current Archive ID. This is a just in case.
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('archive_id', $slct.archive_id);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
// $ae_app.archives.show_main__options = true;
|
||||
$ae_app.archives.show_list__archive_obj_li = false;
|
||||
$ae_app.archives.show_edit__archive_obj = false;
|
||||
$ae_app.archives.show_view__archive_obj = true;
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** View - Archive Obj');
|
||||
});
|
||||
|
||||
function handle_archive_content_obj_created(event) {
|
||||
console.log('*** handle_archive_content_obj_created() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct.archive_content_id = null;
|
||||
$slct.archive_content_obj = {};
|
||||
|
||||
$slct_trigger = 'load__archive_obj_li';
|
||||
$slct_trigger = 'load__archive_obj';
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
|
||||
// $ae_app.archives.show_list__archive_obj_li = false;
|
||||
// $ae_app.archives.show_edit__archive_obj = false;
|
||||
// $ae_app.archives.show_view__archive_obj = true;
|
||||
$ae_app.archives.show_edit__archive_content_id = false;
|
||||
}
|
||||
function handle_archive_content_obj_updated(event) {
|
||||
console.log('*** handle_archive_content_obj_updated() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct_trigger = 'load__archive_obj';
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
|
||||
// $ae_app.archives.show_list__archive_obj_li = false;
|
||||
// $ae_app.archives.show_edit__archive_obj = false;
|
||||
// $ae_app.archives.show_view__archive_obj = true;
|
||||
$ae_app.archives.show_edit__archive_content_id = false;
|
||||
}
|
||||
function handle_archive_content_obj_deleted(event) {
|
||||
console.log('*** handle_archive_content_obj_deleted() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct_trigger = 'load__archive_obj_li';
|
||||
$slct_trigger = 'load__archive_obj';
|
||||
$slct_trigger = 'load__archive_content_obj_li';
|
||||
|
||||
// $ae_app.archives.show_list__archive_obj_li = false;
|
||||
// $ae_app.archives.show_edit__archive_obj = false;
|
||||
// $ae_app.archives.show_view__archive_obj = true;
|
||||
$ae_app.archives.show_edit__archive_content_id = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section class="svelte_component ae_section ae_view archive_obj view__archive_obj" bind:clientHeight={$ae_app.iframe_height_modal_body}>
|
||||
|
||||
<header class="ae_header archive__header">
|
||||
<h2 class="archive__name">{@html $slct.archive_obj.name}</h2>
|
||||
</header>
|
||||
|
||||
<section class="archive__content">
|
||||
{#if $slct.archive_obj.description}<div class="ae_value archive__description">{@html $slct.archive_obj.description}</div>{/if}
|
||||
{#if $slct.archive_obj.content_html}<div class="ae_value">{@html $slct.archive_obj.content_html}</div>{/if}
|
||||
{#if $slct.archive_obj.original_url}
|
||||
<div>
|
||||
<span class="ae_label">URL:</span>
|
||||
<span class="ae_value">{$slct.archive_obj.original_url}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{#if $slct.archive_obj.original_datetime}
|
||||
<div class="archive__original_datetime">
|
||||
<span class="ae_label">Start Date:</span>
|
||||
<span class="ae_value">{ae.util.iso_datetime_formatter($slct.archive_obj.original_datetime, 'datetime_long')}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{#if $slct.archive_obj.original_timezone}
|
||||
<span class="ae_label">Timezone:</span>
|
||||
<span class="ae_value">{$slct.archive_obj.original_timezone}</span>
|
||||
{/if}
|
||||
{#if $slct.archive_obj.original_location}
|
||||
<div>
|
||||
<span class="ae_label">Location:</span>
|
||||
<span class="ae_value">{$slct.archive_obj.original_location}</span>
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<section
|
||||
class="ae_section ae_meta archive__meta"
|
||||
class:ae_d_none={!$ae_app.administrator_access}
|
||||
>
|
||||
<div class="ae_group">
|
||||
<div class="archive__created_on_updated_on">
|
||||
<span class="ae_label">Created on:</span>
|
||||
<span class="ae_value archive__created_on">{ae.util.iso_datetime_formatter($slct.archive_obj.created_on, 'datetime_iso_no_seconds')}</span>
|
||||
{#if $slct.archive_obj.updated_on}
|
||||
<span class="ae_label">Updated on:</span>
|
||||
<span class="ae_value">{ae.util.iso_datetime_formatter($slct.archive_obj.updated_on, 'datetime_iso_no_seconds')}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if $ae_app.trusted_access}
|
||||
<div class="ae_options">
|
||||
{#if $ae_app.trusted_access || $slct.archive_obj.external_person_id === $ae_app.novi_uuid}
|
||||
<button
|
||||
on:click={() => {
|
||||
$slct.archive_content_id = null;
|
||||
$slct.archive_content_obj = {};
|
||||
$ae_app.archives.show_edit__archive_content_id = true;
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-warning"
|
||||
title={`Add content for: ${$slct.archive_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-plus"></span> Add Content
|
||||
</button>
|
||||
|
||||
<button
|
||||
on:click={() => {
|
||||
// $slct.archive_id = $slct.archive_obj.archive_id_random;
|
||||
// $slct.archive_obj = $slct.archive_obj;
|
||||
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('archive_id', $slct.archive_obj.archive_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// $ae_app.archives.show_main__options = false;
|
||||
// $ae_app.archives.show_list__archive_obj_li = false;
|
||||
$ae_app.archives.show_view__archive_obj = false;
|
||||
$ae_app.archives.show_edit__archive_obj = true;
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-xs btn-warning"
|
||||
title={`Edit archive: ${$slct.archive_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit Archive
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
{#if $slct.archive_obj}
|
||||
<!-- {#each $slct.archive_content_obj_li as idaa_archive_content_obj, index} -->
|
||||
<List_archive_content_obj />
|
||||
<!-- {/each} -->
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
<!-- {#if $slct.archive_content_obj_li && $slct.archive_content_obj_li.length} -->
|
||||
<!-- {#each $slct.archive_content_obj_li as idaa_archive_content_obj, index}
|
||||
<hr />
|
||||
<span class="archive_content__name">{idaa_archive_content_obj.name}</span>
|
||||
<pre class="archive_content__content">{@html idaa_archive_content_obj.content}</pre>
|
||||
|
||||
<section class="ae_section ae_meta archive_content__meta">
|
||||
<div class="ae_group">
|
||||
<div class="archive_content__created_on_updated_on">
|
||||
Created on:
|
||||
<span class="archive_content__created_on">{ae.util.iso_datetime_formatter(idaa_archive_content_obj.created_on, 'datetime_iso_no_seconds')}
|
||||
{#if idaa_archive_content_obj.updated_on}
|
||||
Updated on:
|
||||
{ae.util.iso_datetime_formatter(idaa_archive_content_obj.updated_on, 'datetime_iso_no_seconds')}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if $ae_app.trusted_access || idaa_archive_content_obj.external_person_id === $ae_app.novi_uuid}
|
||||
<div class="ae_options">
|
||||
<button on:click={() => {
|
||||
$slct.archive_content_id = idaa_archive_content_obj.archive_content_id_random;
|
||||
$slct.archive_content_obj = idaa_archive_content_obj;
|
||||
|
||||
// $ae_app.archives.show_archive_content_list = false;
|
||||
$ae_app.archives.show_edit__archive_content_id = true;
|
||||
// $ae_app.archives.show_view__archive_obj = false;
|
||||
}}
|
||||
class="btn btn-default"
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit Content
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
{/each} -->
|
||||
<!-- {/if} -->
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
.ae_label {
|
||||
font-size: smaller;
|
||||
}
|
||||
.ae_value {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.archive_obj .ae_meta {
|
||||
flex-direction: column;
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
.archive_obj .ae_meta .ae_group {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.archive_obj .ae_meta .ae_options {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.archive__created_on_updated_on, .archive_content__created_on_updated_on {
|
||||
/* font-size: smaller; */
|
||||
/* background-color: hsla(0,80%,50%,1); */
|
||||
/* color: hsla(0,0%,50%,1); */
|
||||
}
|
||||
</style>
|
||||
@@ -1,261 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { ae, Element_modal_v3 } from 'aether_npm_lib';
|
||||
import { slct, slct_trigger, ae_app } from './stores';
|
||||
|
||||
import Edit_post_comment_obj from './10_edit__post_comment_obj.svelte';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
if ($slct.post_id) {
|
||||
console.log(`Post ID selected: ${$slct.post_id}`);
|
||||
console.log(`Post Object selected: ${$slct.post_obj}`)
|
||||
|
||||
$slct_trigger = 'load__post_obj';
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** View - Post Obj');
|
||||
});
|
||||
|
||||
function handle_post_comment_obj_created(event) {
|
||||
console.log('*** handle_post_comment_obj_created() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct.post_comment_id = null;
|
||||
$slct.post_comment_obj = {};
|
||||
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
$slct_trigger = 'load__post_obj';
|
||||
$slct_trigger = 'load__post_comment_obj_li';
|
||||
|
||||
// $ae_app.posts.show_post_list = false;
|
||||
// $ae_app.posts.show_edit__post_id = false;
|
||||
// $ae_app.posts.show_view__post_id = true;
|
||||
$ae_app.posts.show_edit__post_comment = false;
|
||||
}
|
||||
function handle_post_comment_obj_updated(event) {
|
||||
console.log('*** handle_post_comment_obj_updated() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct_trigger = 'load__post_obj';
|
||||
$slct_trigger = 'load__post_comment_obj_li';
|
||||
|
||||
// $ae_app.posts.show_post_list = false;
|
||||
// $ae_app.posts.show_edit__post_id = false;
|
||||
// $ae_app.posts.show_view__post_id = true;
|
||||
$ae_app.posts.show_edit__post_comment = false;
|
||||
}
|
||||
function handle_post_comment_obj_deleted(event) {
|
||||
console.log('*** handle_post_comment_obj_deleted() ***');
|
||||
console.log(event.detail);
|
||||
|
||||
$slct_trigger = 'load__post_obj_li';
|
||||
$slct_trigger = 'load__post_obj';
|
||||
$slct_trigger = 'load__post_comment_obj_li';
|
||||
|
||||
// $ae_app.posts.show_post_list = false;
|
||||
// $ae_app.posts.show_edit__post_id = false;
|
||||
// $ae_app.posts.show_view__post_id = true;
|
||||
$ae_app.posts.show_edit__post_comment = false;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<section
|
||||
bind:clientHeight={$ae_app.iframe_height_modal_body}
|
||||
class="svelte_component ae_section ae_view post_obj view__post_obj"
|
||||
>
|
||||
|
||||
<div class="post__header">
|
||||
<h2 class="post__title">
|
||||
{@html $slct.post_obj.title}
|
||||
{#if $slct.post_obj.topic_id}<span class="badge badge-info bg-info"><span class="fas fa-user-md"></span> {$slct.post_obj.topic_name}</span>{/if}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="post__content">{@html $slct.post_obj.content}</div>
|
||||
|
||||
<section class="ae_section ae_meta post__meta">
|
||||
<div class="ae_group">
|
||||
{#if ($slct.post_obj.anonymous)}
|
||||
<div class="post__posted_by">
|
||||
Posted by: <span class="fas fa-user-secret"></span> <span class="post__full_name">Anonymous</span>
|
||||
</div>
|
||||
{:else if ($slct.post_obj.full_name)}
|
||||
<div class="post__posted_by">
|
||||
Posted by: <span class="fas fa-user"></span> <span class="post__full_name">{$slct.post_obj.full_name}
|
||||
{#if $ae_app.trusted_access && $slct.post_obj.email}
|
||||
<a href="mailto:{$slct.post_obj.email}?subject=IDAA BB Post">{$slct.post_obj.email}</a>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="post__created_on_updated_on">
|
||||
{#if !$slct.post_obj.updated_on}
|
||||
<span class="ae_label">Created on:</span>
|
||||
<span class="ae_value post__created_on">{ae.util.iso_datetime_formatter($slct.post_obj.created_on, 'datetime_iso_no_seconds')}</span>
|
||||
{:else}
|
||||
<span class="ae_label">Updated on:</span>
|
||||
<span class="ae_value post__updated_on">
|
||||
{ae.util.iso_datetime_formatter($slct.post_obj.updated_on, 'datetime_iso_no_seconds')}</span>
|
||||
{/if}
|
||||
<span class="post__archive_on">
|
||||
<span class="ae_label">Archive on:</span>
|
||||
<span class="ae_value">{ae.util.iso_datetime_formatter($slct.post_obj.archive_on, 'datetime_iso_no_seconds')}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ae_options">
|
||||
{#if $slct.post_obj.post_comment_count}
|
||||
<span class="ae_badge ae_info post__post_comment_count">
|
||||
<span class="fas fa-comment"></span> {($slct.post_obj.post_comment_count == 1 ? `${$slct.post_obj.post_comment_count} comment` : `${$slct.post_obj.post_comment_count} comments` )}
|
||||
</span>
|
||||
{/if}
|
||||
<button
|
||||
on:click={() => {
|
||||
$ae_app.posts.show_edit__post_comment = true;
|
||||
}}
|
||||
class="btn btn-primary"
|
||||
title={`New comment on: ${$slct.post_obj.title}`}
|
||||
>
|
||||
<span class="fas fa-plus"></span> New Comment
|
||||
</button>
|
||||
|
||||
{#if $ae_app.trusted_access || $slct.post_obj.external_person_id === $ae_app.novi_uuid || $slct.post_obj.email === $ae_app.novi_email}
|
||||
<button
|
||||
on:click={() => {
|
||||
// $slct.post_id = $slct.post_obj.post_id_random;
|
||||
// $slct.post_obj = $slct.post_obj;
|
||||
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('post_id', $slct.post_obj.post_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// $ae_app.posts.show_main__options = false;
|
||||
// $ae_app.posts.show_list__post_li = false;
|
||||
$ae_app.posts.show_view__post_id = false;
|
||||
$ae_app.posts.show_edit__post_id = true;
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-xs btn-secondary"
|
||||
title={`Edit post: ${$slct.post_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
{#if $ae_app.posts.show_edit__post_comment}
|
||||
<section class="bb_post_comment_crud">
|
||||
|
||||
<Element_modal_v3
|
||||
show = { true }
|
||||
modal_cover_body = { true }
|
||||
on:close={ () => {
|
||||
$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;
|
||||
}}
|
||||
>
|
||||
<span slot="header_title">Comment on: {($slct.post_obj.title ? $slct.post_obj.title : '')}</span>
|
||||
|
||||
<span slot="body">
|
||||
<section class="post_comment_obj_view">
|
||||
<Edit_post_comment_obj on:post_comment_obj_created={handle_post_comment_obj_created} on:post_comment_obj_updated={handle_post_comment_obj_updated} on:post_comment_obj_deleted={handle_post_comment_obj_deleted} />
|
||||
</section>
|
||||
</span>
|
||||
</Element_modal_v3>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{#if $slct.post_comment_obj_li.length}
|
||||
{#each $slct.post_comment_obj_li as idaa_post_comment_obj, index}
|
||||
<hr />
|
||||
<div class="post_comment__content">{@html idaa_post_comment_obj.content}</div>
|
||||
|
||||
|
||||
<section class="ae_section ae_meta post_comment__meta">
|
||||
<div class="ae_group">
|
||||
<span class="post_comment__posted_by `comment_by_container">
|
||||
<span class="comment_by_lable">Comment by:</span>
|
||||
{#if idaa_post_comment_obj.anonymous}
|
||||
<span class="fas fa-user-secret"></span>
|
||||
<span class="comment_by_full_name anonymous">Anonymous</span>
|
||||
{:else}
|
||||
<span class="fas fa-user"></span>
|
||||
<span class="comment_by_full_name">{idaa_post_comment_obj.full_name}</span>
|
||||
<!-- {#if idaa_post_comment_obj.email}
|
||||
(<a href="mailto:{idaa_post_comment_obj.email}"><span class="comment_by_email">{idaa_post_comment_obj.email}</span></a>)
|
||||
{/if} -->
|
||||
{/if}
|
||||
<div class="post_comment__created_on_updated_on">
|
||||
Created on:
|
||||
<span class="post_comment__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}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if $ae_app.trusted_access || idaa_post_comment_obj.external_person_id === $ae_app.novi_uuid}
|
||||
<div class="ae_options">
|
||||
<button on:click={() => {
|
||||
$slct.post_comment_id = idaa_post_comment_obj.post_comment_id_random;
|
||||
$slct.post_comment_obj = idaa_post_comment_obj;
|
||||
|
||||
// $ae_app.posts.show_post_comment_list = false;
|
||||
$ae_app.posts.show_edit__post_comment = true;
|
||||
// $ae_app.posts.show_view__post_id = false;
|
||||
}}
|
||||
class="ae_btn ae_smallest btn btn-secondary"
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit Comment
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
.post_obj .ae_meta {
|
||||
flex-direction: column;
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
.post_obj .ae_meta .ae_group {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.post_obj .ae_meta .ae_options {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.post__posted_by, .post_comment__posted_by {
|
||||
/* font-size: smaller; */
|
||||
/* background-color: hsla(0,80%,50%,1); */
|
||||
/* color: hsla(0,0%,50%,1); */
|
||||
}
|
||||
|
||||
.post__created_on_updated_on, .post_comment__created_on_updated_on {
|
||||
/* font-size: smaller; */
|
||||
/* background-color: hsla(0,80%,50%,1); */
|
||||
/* color: hsla(0,0%,50%,1); */
|
||||
}
|
||||
</style>
|
||||
@@ -1,192 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { ae } from 'aether_npm_lib';
|
||||
import { slct, slct_trigger, ae_app } from './stores';
|
||||
|
||||
export let container_class_li = [];
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
if ($slct.sponsorship_id) {
|
||||
console.log(`Sponsorship ID selected: ${$slct.sponsorship_id}`);
|
||||
console.log(`Sponsorship Object selected: ${$slct.sponsorship_obj}`)
|
||||
|
||||
$slct_trigger = 'load__sponsorship_obj';
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
console.log('** Component Mounted: ** View - Sponsorship Obj');
|
||||
});
|
||||
|
||||
|
||||
dayjs.extend(window.dayjs_plugin_utc)
|
||||
dayjs.extend(window.dayjs_plugin_timezone);
|
||||
console.log(`UTC offset: ${dayjs().utcOffset()}`);
|
||||
console.log(`TZ offset: ${dayjs().utcOffset('US/Pacific')}`);
|
||||
// let test_time = dayjs.utc('2024-01-08 11:55').tz('Asia/Taipei');
|
||||
// let test_time = dayjs.utc('2024-01-08 14:15').tz('America/New_York');
|
||||
let test_time = dayjs.tz('2024-01-08 14:15', 'US/Pacific');
|
||||
console.log(test_time.format('YYYY-MM-DD HH:mm'));
|
||||
let adjusted_to_local_tz = test_time.tz('America/New_York');
|
||||
console.log(adjusted_to_local_tz.format('YYYY-MM-DD HH:mm'));
|
||||
|
||||
let adjusted_to_local_tz_v2 = dayjs.tz('2024-01-08 14:15', 'US/Pacific').tz('America/New_York');
|
||||
console.log(adjusted_to_local_tz_v2);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<section class="svelte_component ae_section ae_view sponsorship_obj view__sponsorship_obj {container_class_li.join(' ')}">
|
||||
|
||||
<div class="sponsorship__header">
|
||||
<h2 class="sponsorship__name">{@html $slct.sponsorship_obj.name}</h2>
|
||||
</div>
|
||||
|
||||
<div class="sponsorship__content">
|
||||
<div
|
||||
class="sponsorship_description description"
|
||||
>
|
||||
<div class="ae_label sponsorship__description">Description:</div>
|
||||
<pre class="ae_value sponsorship__description">{@html $slct.sponsorship_obj.description ? $slct.sponsorship_obj.description : '-- No Description Given --'}</pre>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class:ae_d_none={!$slct.sponsorship_obj.level_num}
|
||||
class="sponsorship_level"
|
||||
>
|
||||
<span class="ae_label">Level of Sponsorship:</span>
|
||||
<span class="ae_value"><span class="fas fa-gem"></span> {$slct.sponsorship_obj.level_num} — {$slct.sponsorship_obj.level_str}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="ae_label">Paid:</span>
|
||||
$
|
||||
<span class="ae_value">
|
||||
{$slct.sponsorship_obj.paid ? 'Yes, marked as paid' : 'Not yet marked as paid'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="ae_list sponsorship__guests">
|
||||
<h2>Guest List</h2>
|
||||
|
||||
{#if $slct.sponsorship_obj.guest_li_json && $slct.sponsorship_obj.guest_li_json.length && $slct.sponsorship_obj.guest_li_json[0].full_name}
|
||||
<ul>
|
||||
{#each $slct.sponsorship_obj.guest_li_json as guest, index}
|
||||
<li class="sponsorship__guest"
|
||||
class:ae_d_none={!$slct.sponsorship_obj.guest_li_json[index].full_name}
|
||||
>
|
||||
<span class="ae_label">
|
||||
<span class="fas fa-user"></span> Contact:
|
||||
</span>
|
||||
{$slct.sponsorship_obj.guest_li_json[index].full_name}
|
||||
{#if $slct.sponsorship_obj.guest_li_json[index].email}
|
||||
| <a href="mailto:{$slct.sponsorship_obj.guest_li_json[index].email}?Subject={$slct.sponsorship_obj.full_name}">{$slct.sponsorship_obj.guest_li_json[index].email}</a>
|
||||
{/if}
|
||||
{#if $slct.sponsorship_obj.guest_li_json[index].phone_mobile}
|
||||
<span class="ae_label">| Mobile:</span>
|
||||
<a href="tel:{$slct.sponsorship_obj.guest_li_json[index].phone_mobile}">{$slct.sponsorship_obj.guest_li_json[index].phone_mobile}</a>
|
||||
{/if}
|
||||
{#if $slct.sponsorship_obj.guest_li_json[index].phone_home}
|
||||
<span class="ae_label">| Home:</span>
|
||||
<a href="tel:{$slct.sponsorship_obj.guest_li_json[index].phone_home}">{$slct.sponsorship_obj.guest_li_json[index].phone_home}</a>
|
||||
{/if}
|
||||
{#if $slct.sponsorship_obj.guest_li_json[index].phone_office}
|
||||
<span class="ae_label">| Office:</span>
|
||||
<a href="tel:{$slct.sponsorship_obj.guest_li_json[index].phone_office}">{$slct.sponsorship_obj.guest_li_json[index].phone_office}</a>
|
||||
{/if}
|
||||
{#if $slct.sponsorship_obj.guest_li_json[index].other_text}| {$slct.sponsorship_obj.guest_li_json[index].other_text}{/if}
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{:else}
|
||||
<div class="ae_warning">No guest list found!</div>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
<section class="ae_section ae_meta sponsorship__meta">
|
||||
<div class="ae_group">
|
||||
<span
|
||||
class="sponsorship__id"
|
||||
class:ae_d_none={!$ae_app.administrator_access}>
|
||||
ID:
|
||||
{$slct.sponsorship_obj.sponsorship_id_random}
|
||||
</span>
|
||||
<span
|
||||
class="sponsorship__created_on"
|
||||
>
|
||||
Created on: {ae.util.iso_datetime_formatter($slct.sponsorship_obj.created_on, 'datetime_short')}
|
||||
</span>
|
||||
<span
|
||||
class="sponsorship__updated_on"
|
||||
class:ae_d_none={!$slct.sponsorship_obj.updated_on}
|
||||
>
|
||||
Updated on: {ae.util.iso_datetime_formatter($slct.sponsorship_obj.updated_on, 'datetime_short')}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{#if $ae_app.trusted_access || $slct.sponsorship_obj.external_person_id === $ae_app.novi_uuid || $slct.sponsorship_obj.contact_1_email === $ae_app.novi_email}
|
||||
<div class="ae_options">
|
||||
<button
|
||||
on:click={() => {
|
||||
// $slct.sponsorship_id = $slct.sponsorship_obj.sponsorship_id_random;
|
||||
// $slct.sponsorship_obj = $slct.sponsorship_obj;
|
||||
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('sponsorship_id', $slct.sponsorship_obj.sponsorship_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// $ae_app.sponsorships.show_main__options = true;
|
||||
// $ae_app.sponsorships.show_list__sponsorship_obj_li = true;
|
||||
$ae_app.sponsorships.show_view__sponsorship_obj = false;
|
||||
$ae_app.sponsorships.show_edit__sponsorship_obj = true;
|
||||
}}
|
||||
class="btn btn-xs btn-secondary"
|
||||
title={`Edit sponsorship: ${$slct.sponsorship_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
.ae_label {
|
||||
font-size: smaller;
|
||||
}
|
||||
.ae_value {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sponsorship__user_timezone {
|
||||
font-size: smaller;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.sponsorship_obj .ae_meta {
|
||||
flex-direction: column;
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
.sponsorship_obj .ae_meta .ae_group {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.sponsorship_obj .ae_meta .ae_options {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
/* a {
|
||||
color: #82B6E1;
|
||||
} */
|
||||
</style>
|
||||
@@ -1,47 +0,0 @@
|
||||
<script lang="ts">
|
||||
import svelteLogo from './assets/svelte.svg'
|
||||
import viteLogo from '/vite.svg'
|
||||
import Counter from './lib/Counter.svelte'
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<div>
|
||||
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
|
||||
<img src={viteLogo} class="logo" alt="Vite Logo" />
|
||||
</a>
|
||||
<a href="https://svelte.dev" target="_blank" rel="noreferrer">
|
||||
<img src={svelteLogo} class="logo svelte" alt="Svelte Logo" />
|
||||
</a>
|
||||
</div>
|
||||
<h1>Vite + Svelte</h1>
|
||||
|
||||
<div class="card">
|
||||
<Counter />
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Check out <a href="https://github.com/sveltejs/kit#readme" target="_blank" rel="noreferrer">SvelteKit</a>, the official Svelte app framework powered by Vite!
|
||||
</p>
|
||||
|
||||
<p class="read-the-docs">
|
||||
Click on the Vite and Svelte logos to learn more
|
||||
</p>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
.logo {
|
||||
height: 6em;
|
||||
padding: 1.5em;
|
||||
will-change: filter;
|
||||
transition: filter 300ms;
|
||||
}
|
||||
.logo:hover {
|
||||
filter: drop-shadow(0 0 2em #646cffaa);
|
||||
}
|
||||
.logo.svelte:hover {
|
||||
filter: drop-shadow(0 0 2em #ff3e00aa);
|
||||
}
|
||||
.read-the-docs {
|
||||
color: #888;
|
||||
}
|
||||
</style>
|
||||
711
src/app.css
711
src/app.css
@@ -1,711 +0,0 @@
|
||||
: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 {
|
||||
/* Use boarder-box to make things easier with borders and scrolling in general. */
|
||||
box-sizing: border-box;
|
||||
|
||||
/* outline: dashed thick blue; */
|
||||
/* border: solid thick blue; */
|
||||
|
||||
margin: 1em;
|
||||
padding: 0em;
|
||||
|
||||
/* Account for the margin */
|
||||
height: calc(100vh - 1em - 1em);
|
||||
|
||||
/* max-width: 1280px; */
|
||||
|
||||
/* background-color: hsla(240, 50%, 20%); */
|
||||
background-color: hsla(207, 43%, 18%);
|
||||
|
||||
/* Display as flex does not seem to work well here. */
|
||||
}
|
||||
|
||||
.svelte_target.ae_svelte_app_hub {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
||||
background-color: hsla(0, 0%, 100%, .50);
|
||||
color: black;
|
||||
font-size: x-small;
|
||||
|
||||
padding: .25em;
|
||||
|
||||
z-index: 1000;
|
||||
|
||||
opacity: .5;
|
||||
|
||||
transition: all .25s ease-in-out;
|
||||
}
|
||||
.svelte_target.ae_svelte_app_hub:hover {
|
||||
opacity: 1;
|
||||
background-color: hsla(0, 50%, 80%, .75);
|
||||
}
|
||||
|
||||
.svelte_target.ae_svelte_app {
|
||||
|
||||
box-sizing: border-box;
|
||||
/* box-sizing: content-box; */
|
||||
/* outline: solid thin hsla(0, 50%, 50%, .50); */
|
||||
border: solid medium hsla(0, 0%, 50%, .40);
|
||||
/* border-color: hsla(207, 43%, 18%); */
|
||||
|
||||
/* background-color: white; */
|
||||
/* background-color: hsla(240, 100%, 95%, .97); */
|
||||
background-color: hsla(0, 0%, 100%, .90);
|
||||
|
||||
|
||||
overflow: scroll;
|
||||
|
||||
height: 100%;
|
||||
/* max-height: calc(100% - 1em); */
|
||||
|
||||
/* width: 100%; */
|
||||
/* max-width: calc(100% - 1em); */
|
||||
max-width: 1280px;
|
||||
|
||||
/* margin: 1em; */
|
||||
/* Use auto margin to center this element within the body */
|
||||
margin: auto;
|
||||
padding: .5em;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Use this to fix the scrolling. This is mostly useful for wide tables. */
|
||||
/* This must be applied to the parent of the table. */
|
||||
.svelte_target.ae_svelte_app .svelte_component {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
#Site-Header {
|
||||
background-color: hsla(0, 0%, 100%, 0.85);
|
||||
padding: .5em 1em;
|
||||
margin-bottom: 1em;
|
||||
|
||||
/* display: flex; */
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
#Site-Header h1 {
|
||||
/* text-shadow: 0em 0em .75em hsla(240,100%,25%,1); */
|
||||
/* text-shadow: 0em 0em .75em hsla(0,0%,5%,1); */
|
||||
|
||||
font-size: 2.5em;
|
||||
line-height: 1.1;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#Site-Header h2 {
|
||||
font-size: 1.5em;
|
||||
line-height: 1.1;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
/* Make font italic */
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#Site-Nav-Menu {
|
||||
background-color: hsla(0, 0%, 100%, 0.85);
|
||||
/* padding: .5em 1em; */
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
#Site-Footer {
|
||||
background-color: hsla(0, 0%, 100%, 0.85);
|
||||
padding: .5em 1em;
|
||||
margin-top: 1em;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
|
||||
address {
|
||||
margin-bottom: .25em;
|
||||
padding-left: .5em;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.ae_table {
|
||||
/* border-collapse: collapse; */
|
||||
border-spacing: 0px;
|
||||
border: solid thin hsla(0, 0%, 0%, .30);
|
||||
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
/* margin: 1em; */
|
||||
/* padding: 1em; */
|
||||
/* overflow: scroll; */
|
||||
|
||||
}
|
||||
.ae_table tr {
|
||||
border: solid thin hsla(0, 0%, 0%, .20);
|
||||
}
|
||||
.ae_table th {
|
||||
border: solid thin hsla(0, 0%, 0%, .10);
|
||||
border-bottom: solid thin hsla(0, 0%, 0%, .20);
|
||||
|
||||
padding: .5em;
|
||||
|
||||
/* text-align: center; */
|
||||
}
|
||||
.ae_table td {
|
||||
border: solid thin hsla(0, 0%, 0%, .10);
|
||||
|
||||
padding: .5em;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
textarea {
|
||||
/* width: calc(fit-content - 1em); */
|
||||
width: 100%;
|
||||
max-width: calc(fit-content - .5em);
|
||||
}
|
||||
|
||||
button.ae_normal, .btn.ae_normal {
|
||||
/* font: normal 1em sans-serif; */
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
button.ae_smaller, .btn.ae_smaller {
|
||||
font-size: .8rem;
|
||||
}
|
||||
|
||||
button.ae_smallest, .btn.ae_smallest {
|
||||
font-size: .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: .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: .5em .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: .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: .5em .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_flex {
|
||||
display: flex;
|
||||
|
||||
/* flex-direction: row; */
|
||||
/* align-items: center; */
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
.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_text_align_left {
|
||||
text-align: left;
|
||||
}
|
||||
.ae_text_align_center {
|
||||
text-align: center;
|
||||
}
|
||||
.ae_text_align_right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
.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_margin_xs {
|
||||
margin: .25em;
|
||||
}
|
||||
.ae_margin_sm {
|
||||
margin: .5em;
|
||||
}
|
||||
.ae_margin_md {
|
||||
margin: .75em;
|
||||
}
|
||||
.ae_margin_lg {
|
||||
margin: 1.0em;
|
||||
}
|
||||
.ae_margin_lg {
|
||||
margin: 1.25em;
|
||||
}
|
||||
|
||||
.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, .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, .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%,.1);
|
||||
|
||||
}
|
||||
|
||||
.svelte_component.ae_create {
|
||||
border: solid medium hsla(0,100%,50%,.1);
|
||||
}
|
||||
|
||||
/* This covers the entire viewable area. Essentially a new "body" */
|
||||
/* 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: 100%;
|
||||
/* width: 100%; */
|
||||
width: 100vw;
|
||||
max-width: 100vw;
|
||||
/* max-width: 1280px; */
|
||||
|
||||
/* background-color: hsla(180,75%,90%,.75); */
|
||||
background-color: hsla(180,0%,90%,.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: 0em;
|
||||
|
||||
/* 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: .5em;
|
||||
|
||||
/* box-shadow: .5em .5em 1.5em .5em hsla(0, 0%, 0%, .9); */
|
||||
box-shadow: 0em 0em 1.5em .5em hsla(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%,.5);
|
||||
border-bottom: solid thin lightgray;
|
||||
|
||||
margin: 0em;
|
||||
padding: .25em .25em;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.ae_modal .modal_body {
|
||||
/* outline: dashed medium pink; */
|
||||
|
||||
margin: 0em;
|
||||
padding: .25em .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%,.5);
|
||||
border-top: solid thin lightgray;
|
||||
|
||||
margin: 0em;
|
||||
padding: .25em .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 - .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: .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;
|
||||
}
|
||||
9
src/app.d.ts
vendored
Normal file
9
src/app.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// See https://kit.svelte.dev/docs/types#app
|
||||
// for information about these interfaces
|
||||
// and what to do when importing types
|
||||
declare namespace App {
|
||||
// interface Locals {}
|
||||
// interface PageData {}
|
||||
// interface Error {}
|
||||
// interface Platform {}
|
||||
}
|
||||
12
src/app.html
Normal file
12
src/app.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" class="dark">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover" data-theme="modern">
|
||||
<div style="display: contents" class="h-full overflow-hidden">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
16
src/app.postcss
Normal file
16
src/app.postcss
Normal file
@@ -0,0 +1,16 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
@tailwind variants;
|
||||
|
||||
html,
|
||||
body {
|
||||
@apply h-full overflow-hidden;
|
||||
}
|
||||
|
||||
/* modern theme */
|
||||
@font-face {
|
||||
font-family: 'Quicksand';
|
||||
src: url('/fonts/Quicksand.ttf');
|
||||
font-display: swap;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="26.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 308"><path fill="#FF3E00" d="M239.682 40.707C211.113-.182 154.69-12.301 113.895 13.69L42.247 59.356a82.198 82.198 0 0 0-37.135 55.056a86.566 86.566 0 0 0 8.536 55.576a82.425 82.425 0 0 0-12.296 30.719a87.596 87.596 0 0 0 14.964 66.244c28.574 40.893 84.997 53.007 125.787 27.016l71.648-45.664a82.182 82.182 0 0 0 37.135-55.057a86.601 86.601 0 0 0-8.53-55.577a82.409 82.409 0 0 0 12.29-30.718a87.573 87.573 0 0 0-14.963-66.244"></path><path fill="#FFF" d="M106.889 270.841c-23.102 6.007-47.497-3.036-61.103-22.648a52.685 52.685 0 0 1-9.003-39.85a49.978 49.978 0 0 1 1.713-6.693l1.35-4.115l3.671 2.697a92.447 92.447 0 0 0 28.036 14.007l2.663.808l-.245 2.659a16.067 16.067 0 0 0 2.89 10.656a17.143 17.143 0 0 0 18.397 6.828a15.786 15.786 0 0 0 4.403-1.935l71.67-45.672a14.922 14.922 0 0 0 6.734-9.977a15.923 15.923 0 0 0-2.713-12.011a17.156 17.156 0 0 0-18.404-6.832a15.78 15.78 0 0 0-4.396 1.933l-27.35 17.434a52.298 52.298 0 0 1-14.553 6.391c-23.101 6.007-47.497-3.036-61.101-22.649a52.681 52.681 0 0 1-9.004-39.849a49.428 49.428 0 0 1 22.34-33.114l71.664-45.677a52.218 52.218 0 0 1 14.563-6.398c23.101-6.007 47.497 3.036 61.101 22.648a52.685 52.685 0 0 1 9.004 39.85a50.559 50.559 0 0 1-1.713 6.692l-1.35 4.116l-3.67-2.693a92.373 92.373 0 0 0-28.037-14.013l-2.664-.809l.246-2.658a16.099 16.099 0 0 0-2.89-10.656a17.143 17.143 0 0 0-18.398-6.828a15.786 15.786 0 0 0-4.402 1.935l-71.67 45.674a14.898 14.898 0 0 0-6.73 9.975a15.9 15.9 0 0 0 2.709 12.012a17.156 17.156 0 0 0 18.404 6.832a15.841 15.841 0 0 0 4.402-1.935l27.345-17.427a52.147 52.147 0 0 1 14.552-6.397c23.101-6.006 47.497 3.037 61.102 22.65a52.681 52.681 0 0 1 9.003 39.848a49.453 49.453 0 0 1-22.34 33.12l-71.664 45.673a52.218 52.218 0 0 1-14.563 6.398"></path></svg>
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
7
src/index.test.ts
Normal file
7
src/index.test.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
describe('sum test', () => {
|
||||
it('adds 1 + 2 to equal 3', () => {
|
||||
expect(1 + 2).toBe(3);
|
||||
});
|
||||
});
|
||||
@@ -1,10 +0,0 @@
|
||||
<script lang="ts">
|
||||
let count: number = 0
|
||||
const increment = () => {
|
||||
count += 1
|
||||
}
|
||||
</script>
|
||||
|
||||
<button on:click={increment}>
|
||||
count is {count}
|
||||
</button>
|
||||
1
src/lib/index.ts
Normal file
1
src/lib/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
// place files you want to import through the `$lib` alias in this folder.
|
||||
59
src/main.ts
59
src/main.ts
@@ -1,59 +0,0 @@
|
||||
// Import ae_bridge from ae_bridge_init.js
|
||||
// import './ae_bridge_init';
|
||||
// import './ae_bridge_init.js';
|
||||
import './app.css';
|
||||
|
||||
import { ae } from 'aether_npm_lib';
|
||||
|
||||
import Hub_main from './0_hub__main.svelte';
|
||||
import Hub_site_menu from './10_hub__site_menu.svelte';
|
||||
import Sponsorships from './0_sponsorships__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.querySelector('.svelte_target.ae_svelte_app_hub')) { // ae_hub_main
|
||||
const hub_main_app = new Hub_main({
|
||||
target: document.querySelector('.svelte_target.ae_svelte_app_hub'), // ae_hub_main
|
||||
props: {
|
||||
// NOTE: decodeURIComponent() is needed because the value is passed in as a url param. Should this be taken care of by the ae.util.get_url_params() function?
|
||||
'ae_obj_type': url_params.ae_type,
|
||||
'ae_obj_id': url_params.ae_id,
|
||||
'user': decodeURIComponent(url_params.user),
|
||||
'email': decodeURIComponent(url_params.email),
|
||||
'key': (url_params.key ? url_params.key : false),
|
||||
// 'results_limit_administrator': 75,
|
||||
// 'results_limit_trusted': 50,
|
||||
// 'results_limit_authenticated': 25,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (document.querySelector('#Site-Nav-Menu')) { // ae_hub_main
|
||||
const hub_main_app = new Hub_site_menu({
|
||||
target: document.querySelector('#Site-Nav-Menu'), // ae_hub_main
|
||||
props: {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (document.querySelector('.svelte_target.ae_svelte_app')) { // ae_sponsorships_main
|
||||
const sponsorships_main_app = new Sponsorships({
|
||||
target: document.querySelector('.svelte_target.ae_svelte_app'), // ae_sponsorships_main
|
||||
props: {
|
||||
// NOTE: decodeURIComponent() is needed because the value is passed in as a url param. Should this be taken care of by the ae.util.get_url_params() function?
|
||||
'sponsorship_id': url_params.sponsorship_id,
|
||||
'user': decodeURIComponent(url_params.email),
|
||||
'key': (url_params.key ? url_params.key : false),
|
||||
// 'results_limit_administrator': 75,
|
||||
// 'results_limit_trusted': 50,
|
||||
// 'results_limit_authenticated': 25,
|
||||
}
|
||||
});
|
||||
}
|
||||
64
src/routes/+layout.svelte
Normal file
64
src/routes/+layout.svelte
Normal file
@@ -0,0 +1,64 @@
|
||||
<script lang="ts">
|
||||
import '../app.postcss';
|
||||
import { AppShell, AppBar } from '@skeletonlabs/skeleton';
|
||||
|
||||
// Highlight JS
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
import 'highlight.js/styles/github-dark.css';
|
||||
import { storeHighlightJs } from '@skeletonlabs/skeleton';
|
||||
import xml from 'highlight.js/lib/languages/xml'; // for HTML
|
||||
import css from 'highlight.js/lib/languages/css';
|
||||
import javascript from 'highlight.js/lib/languages/javascript';
|
||||
import typescript from 'highlight.js/lib/languages/typescript';
|
||||
|
||||
hljs.registerLanguage('xml', xml); // for HTML
|
||||
hljs.registerLanguage('css', css);
|
||||
hljs.registerLanguage('javascript', javascript);
|
||||
hljs.registerLanguage('typescript', typescript);
|
||||
storeHighlightJs.set(hljs);
|
||||
|
||||
// Floating UI for Popups
|
||||
import { computePosition, autoUpdate, flip, shift, offset, arrow } from '@floating-ui/dom';
|
||||
import { storePopup } from '@skeletonlabs/skeleton';
|
||||
storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow });
|
||||
</script>
|
||||
|
||||
<!-- App Shell -->
|
||||
<AppShell>
|
||||
<svelte:fragment slot="header">
|
||||
<!-- App Bar -->
|
||||
<AppBar>
|
||||
<svelte:fragment slot="lead">
|
||||
<strong class="text-xl uppercase">Skeleton</strong>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="trail">
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://discord.gg/EXqV7W8MtY"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Discord
|
||||
</a>
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://twitter.com/SkeletonUI"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Twitter
|
||||
</a>
|
||||
<a
|
||||
class="btn btn-sm variant-ghost-surface"
|
||||
href="https://github.com/skeletonlabs/skeleton"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
GitHub
|
||||
</a>
|
||||
</svelte:fragment>
|
||||
</AppBar>
|
||||
</svelte:fragment>
|
||||
<!-- Page Route Content -->
|
||||
<slot />
|
||||
</AppShell>
|
||||
71
src/routes/+page.svelte
Normal file
71
src/routes/+page.svelte
Normal file
@@ -0,0 +1,71 @@
|
||||
<!-- YOU CAN DELETE EVERYTHING IN THIS PAGE -->
|
||||
|
||||
<div class="container h-full mx-auto flex justify-center items-center">
|
||||
<div class="space-y-10 text-center flex flex-col items-center">
|
||||
<h2 class="h2">Welcome to Skeleton.</h2>
|
||||
<!-- Animated Logo -->
|
||||
<figure>
|
||||
<section class="img-bg" />
|
||||
<svg
|
||||
class="fill-token -scale-x-[100%]"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 200 200"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M98.77 50.95c25.1 0 46.54 8.7 61.86 23a41.34 41.34 0 0 0 5.19-1.93c4.35-2.02 10.06-6.17 17.13-12.43-1.15 10.91-2.38 18.93-3.7 24.04-.7 2.75-1.8 6.08-3.3 10a80.04 80.04 0 0 1 8.42 23.33c6.04 30.3-4.3 43.7-28.33 51.18.18.9.32 1.87.42 2.9.86 8.87-3.62 23.19-9 23.19-3.54 0-5.84-4.93-8.3-12.13-.78 8.34-4.58 17.9-8.98 17.9-4.73 0-7.25-8.84-10.93-20.13a214 214 0 0 1-.64 2.93l-.16.71-.16.71-.17.71c-1.84 7.58-4.46 15.07-8.5 15.07-5.06 0-2.29-15.9-10.8-22.63-43.14 2.36-79.43-13.6-79.43-59.62 0-8.48 2-16.76 5.69-24.45a93.72 93.72 0 0 1-1.77-3.68c-2.87-6.32-6.3-15.88-10.31-28.7 10.26 7.66 18.12 12.22 23.6 13.68.5.14 1.02.26 1.57.36 14.36-14.44 35.88-24.01 60.6-24.01Zm-9.99 62.3c-14.57 0-26.39 11.45-26.39 25.58 0 14.14 11.82 25.6 26.39 25.6s26.39-11.46 26.39-25.6c0-13.99-11.58-25.35-25.95-25.58Zm37.45 31.95c-4.4 0-6.73 9.4-6.73 13.62 0 3.3 1.1 5.12 2.9 5.45 4.39.4 3.05-5.97 5.23-5.97 1.06 0 2.2 1.35 3.34 2.73l.34.42c1.25 1.52 2.5 2.93 3.64 2.49 2.7-1.61 1.67-5.12.74-7.88-3.3-6.96-5.05-10.86-9.46-10.86Zm-36.85-28.45c12.57 0 22.76 9.78 22.76 21.85 0 12.07-10.2 21.85-22.76 21.85-.77 0-1.53-.04-2.29-.11 11.5-1.1 20.46-10.42 20.46-21.74 0-11.32-8.97-20.63-20.46-21.74.76-.07 1.52-.1 2.3-.1Zm65.54-5c-10.04 0-18.18 10.06-18.18 22.47 0 12.4 8.14 22.47 18.18 22.47s18.18-10.06 18.18-22.47c0-12.41-8.14-22.48-18.18-22.48Zm.6 3.62c8.38 0 15.16 8.4 15.16 18.74 0 10.35-6.78 18.74-15.16 18.74-.77 0-1.54-.07-2.28-.21 7.3-1.36 12.89-9.14 12.89-18.53 0-9.4-5.6-17.17-12.89-18.53.74-.14 1.5-.2 2.28-.2Zm3.34-72.27.12.07c.58.38.75 1.16.37 1.74l-2.99 4.6c-.35.55-1.05.73-1.61.44l-.12-.07a1.26 1.26 0 0 1-.37-1.74l2.98-4.6a1.26 1.26 0 0 1 1.62-.44ZM39.66 42l.08.1 2.76 3.93a1.26 1.26 0 0 1-2.06 1.45l-2.76-3.94A1.26 1.26 0 0 1 39.66 42Zm63.28-42 2.85 24.13 10.62-11.94.28 29.72-2.1-.47a77.8 77.8 0 0 0-16.72-2.04c-4.96 0-9.61.67-13.96 2l-2.34.73L83.5 4.96l9.72 18.37L102.94 0Zm-1.87 13.39-7.5 17.96-7.3-13.8-1.03 19.93.22-.06a51.56 51.56 0 0 1 12.1-1.45h.31c4.58 0 9.58.54 15 1.61l.35.07-.15-16.54-9.79 11-2.21-18.72Zm38.86 19.23c.67.2 1.05.89.86 1.56l-.38 1.32c-.17.62-.8 1-1.42.89l-.13-.03a1.26 1.26 0 0 1-.86-1.56l.38-1.32c.19-.66.88-1.05 1.55-.86ZM63.95 31.1l.05.12.7 2.17a1.26 1.26 0 0 1-2.34.9l-.04-.12-.71-2.17a1.26 1.26 0 0 1 2.34-.9Z"
|
||||
/>
|
||||
</svg>
|
||||
</figure>
|
||||
<!-- / -->
|
||||
<div class="flex justify-center space-x-2">
|
||||
<a
|
||||
class="btn variant-filled"
|
||||
href="https://skeleton.dev/"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Launch Documentation
|
||||
</a>
|
||||
</div>
|
||||
<div class="space-y-2">
|
||||
<p>Try editing the following:</p>
|
||||
<p><code class="code">/src/routes/+layout.svelte</code></p>
|
||||
<p><code class="code">/src/routes/+page.svelte</code></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style lang="postcss">
|
||||
figure {
|
||||
@apply flex relative flex-col;
|
||||
}
|
||||
figure svg,
|
||||
.img-bg {
|
||||
@apply w-64 h-64 md:w-80 md:h-80;
|
||||
}
|
||||
.img-bg {
|
||||
@apply absolute z-[-1] rounded-full blur-[50px] transition-all;
|
||||
animation: pulse 5s cubic-bezier(0, 0, 0, 0.5) infinite,
|
||||
glow 5s linear infinite;
|
||||
}
|
||||
@keyframes glow {
|
||||
0% {
|
||||
@apply bg-primary-400/50;
|
||||
}
|
||||
33% {
|
||||
@apply bg-secondary-400/50;
|
||||
}
|
||||
66% {
|
||||
@apply bg-tertiary-400/50;
|
||||
}
|
||||
100% {
|
||||
@apply bg-primary-400/50;
|
||||
}
|
||||
}
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
transform: scale(1.5);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
246
src/stores.ts
246
src/stores.ts
@@ -1,246 +0,0 @@
|
||||
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 = '_XY7DXtc9MY'; // OSIT Demo _XY7DXtc9MY (1)
|
||||
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 = { 'sponsorship_id': null, 'sponsorship_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),
|
||||
|
||||
'ae_user': null,
|
||||
'ae_key': null,
|
||||
'ae_full_name': null,
|
||||
'ae_admin_li': [],
|
||||
|
||||
// Module - OSIT Aether - The Hub
|
||||
'hub':{
|
||||
'show__site_header': true,
|
||||
'show__site_menu': true,
|
||||
'show__site_notificatons': true,
|
||||
'show__site_footer': true,
|
||||
'show__site_quick_access': false,
|
||||
|
||||
'ds':{},
|
||||
},
|
||||
|
||||
// Module - OSIT Aether - Sponsorships
|
||||
'sponsorships':{
|
||||
'show_sponsorship_id_view': false,
|
||||
'show_sponsorship_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
|
||||
|
||||
'group_sort': 'ASC', // ASC or DESC
|
||||
|
||||
'sponsorship_id': null,
|
||||
'sponsorship_cfg_id': null,
|
||||
|
||||
'qry_status': null,
|
||||
|
||||
'ds':{},
|
||||
},
|
||||
|
||||
'ds':{},
|
||||
|
||||
'testing': null
|
||||
}
|
||||
export let ae_app = writable(ae_app_struct);
|
||||
console.log(ae_app);
|
||||
|
||||
|
||||
|
||||
|
||||
// NOTE: read/write
|
||||
// Updated 2024-02-01
|
||||
export let ae_local = writable(ae_bridge.ae_local);
|
||||
ae_bridge.register_ae_local_listener((new_value) => {
|
||||
console.log(`Bridge to all: AE localStorage: ${new_value}`);
|
||||
console.log(new_value);
|
||||
|
||||
ae_local.set(new_value);
|
||||
console.log(ae_local);
|
||||
});
|
||||
|
||||
export let ae_session = writable(ae_bridge.ae_session);
|
||||
ae_bridge.register_ae_session_listener((new_value) => {
|
||||
console.log(`Bridge to all: AE sessionStorage: ${new_value}`);
|
||||
console.log(new_value);
|
||||
|
||||
ae_session.set(new_value);
|
||||
console.log(ae_session);
|
||||
});
|
||||
|
||||
|
||||
// if (ae_bridge.ae_local && !ae_bridge.ae_local.app && ae_bridge.ae_local.app !== {}) {
|
||||
// ae_bridge.ae_local.app = ae_app_struct; // .set({});
|
||||
// }
|
||||
|
||||
// if (ae_bridge.ae_session && !ae_bridge.ae_session.app && ae_bridge.ae_session.app !== {}) {
|
||||
// ae_bridge.ae_session.app = ae_app_struct; // .set({});
|
||||
// }
|
||||
|
||||
// if (!ae_bridge.ae_session.app.sponsorships) {
|
||||
// ae_bridge.ae_session.app.sponsorships = {
|
||||
// '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),
|
||||
|
||||
// 'ae_user': null,
|
||||
// 'ae_key': null,
|
||||
// 'ae_full_name': null,
|
||||
// 'ae_admin_li': [],
|
||||
|
||||
// // Module - OSIT Aether - Sponsorships
|
||||
// 'sponsorships':{
|
||||
// 'show_sponsorship_id_view': false,
|
||||
// 'show_sponsorship_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
|
||||
|
||||
// 'group_sort': 'ASC', // ASC or DESC
|
||||
|
||||
// 'sponsorship_id': null,
|
||||
// 'sponsorship_cfg_id': null,
|
||||
|
||||
// 'qry_status': null,
|
||||
|
||||
// 'ds':{},
|
||||
// },
|
||||
|
||||
// 'ds':{},
|
||||
|
||||
// };
|
||||
// }
|
||||
|
||||
console.log(ae_bridge.ae_session);
|
||||
@@ -1,40 +0,0 @@
|
||||
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;
|
||||
}
|
||||
2
src/vite-env.d.ts
vendored
2
src/vite-env.d.ts
vendored
@@ -1,2 +0,0 @@
|
||||
/// <reference types="svelte" />
|
||||
/// <reference types="vite/client" />
|
||||
BIN
static/favicon.png
Normal file
BIN
static/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
static/fonts/Quicksand.ttf
Normal file
BIN
static/fonts/Quicksand.ttf
Normal file
Binary file not shown.
@@ -1,67 +1,21 @@
|
||||
import adapter from '@sveltejs/adapter-auto';
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
||||
// import adapter from '@sveltejs/adapter-static';
|
||||
// import adapter from '@sveltejs/adapter-node';
|
||||
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: vitePreprocess(),
|
||||
|
||||
// Disable accessibility warnings
|
||||
onwarn: (warning, handler) => {
|
||||
// console.log('HERE');
|
||||
if (warning.code.includes("a11y")) return;
|
||||
// if (warning.code === 'a11y-distracting-elements') return;
|
||||
handler(warning);
|
||||
},
|
||||
|
||||
// kit: {
|
||||
// adapter: adapter({
|
||||
// // default options are shown. On some platforms
|
||||
// // these options are set automatically — see below
|
||||
// // pages: 'build',
|
||||
// // assets: 'build',
|
||||
// // fallback: undefined,
|
||||
// // precompress: false,
|
||||
// // strict: true,
|
||||
|
||||
// // output directory:
|
||||
// // target: 'dist_x',
|
||||
|
||||
// // default options are shown
|
||||
// out: 'build_x',
|
||||
// precompress: false,
|
||||
// envPrefix: ''
|
||||
|
||||
|
||||
// })
|
||||
// }
|
||||
}
|
||||
export default config;
|
||||
|
||||
|
||||
|
||||
// import adapter from '@sveltejs/adapter-auto';
|
||||
|
||||
// /** @type {import('@sveltejs/kit').Config} */
|
||||
// const config = {
|
||||
// // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
|
||||
// // for more information about preprocessors
|
||||
// preprocess: vitePreprocess(),
|
||||
|
||||
// // Disable accessibility warnings
|
||||
// onwarn: (warning, handler) => {
|
||||
// console.log('HERE');
|
||||
// if (warning.code.includes("a11y")) return;
|
||||
// handler(warning);
|
||||
// },
|
||||
|
||||
// kit: {
|
||||
// adapter: adapter()
|
||||
// }
|
||||
// };
|
||||
|
||||
// export default config;
|
||||
|
||||
extensions: ['.svelte'],
|
||||
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
||||
// for more information about preprocessors
|
||||
preprocess: [vitePreprocess()],
|
||||
|
||||
vitePlugin: {
|
||||
inspector: true,
|
||||
},
|
||||
kit: {
|
||||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
||||
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
||||
adapter: adapter()
|
||||
}
|
||||
};
|
||||
export default config;
|
||||
27
tailwind.config.ts
Normal file
27
tailwind.config.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { join } from 'path'
|
||||
import type { Config } from 'tailwindcss'
|
||||
import forms from '@tailwindcss/forms';
|
||||
import typography from '@tailwindcss/typography';
|
||||
import { skeleton } from '@skeletonlabs/tw-plugin'
|
||||
|
||||
export default {
|
||||
darkMode: 'class',
|
||||
content: ['./src/**/*.{html,js,svelte,ts}', join(require.resolve('@skeletonlabs/skeleton'), '../**/*.{html,js,svelte,ts}')],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [
|
||||
forms,
|
||||
typography,
|
||||
skeleton({
|
||||
themes: {
|
||||
preset: [
|
||||
{
|
||||
name: 'modern',
|
||||
enhancements: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
],
|
||||
} satisfies Config;
|
||||
6
tests/test.ts
Normal file
6
tests/test.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test('index page has expected h1', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await expect(page.getByRole('heading', { name: 'Welcome to SvelteKit' })).toBeVisible();
|
||||
});
|
||||
@@ -1,20 +1,18 @@
|
||||
{
|
||||
"extends": "@tsconfig/svelte/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
/**
|
||||
* Typecheck JS in `.svelte` and `.js` files by default.
|
||||
* Disable checkJs if you'd like to use dynamic types in JS.
|
||||
* Note that setting allowJs false does not prevent the use
|
||||
* of JS in `.svelte` files.
|
||||
*/
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"isolatedModules": true
|
||||
},
|
||||
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
"extends": "./.svelte-kit/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "bundler"
|
||||
}
|
||||
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
||||
//
|
||||
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
||||
// from the referenced tsconfig.json - TypeScript does not merge them in
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
import { purgeCss } from 'vite-plugin-tailwind-purgecss';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [svelte()],
|
||||
})
|
||||
plugins: [sveltekit(), purgeCss({
|
||||
safelist: {
|
||||
// any selectors that begin with "hljs-" will not be purged
|
||||
greedy: [/^hljs-/],
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user