generated from fastn-stack/fastn-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added presentation-settings page in slide
- Loading branch information
1 parent
3699aa7
commit 65c4460
Showing
3 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
-- optional boolean $is-template: | ||
-- string $fastn-conf: Not fetched | ||
-- string $settings-conf: Not fetched | ||
-- optional boolean $save-status: | ||
-- boolean debug: false | ||
|
||
|
||
-- slide-ds.page: | ||
|
||
-- ftd.text: Presentation Settings | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.heading-large | ||
|
||
-- slide-ds.button: Go back to editor | ||
button-icon: $assets.files.slides.ui.assets.go-back.svg | ||
icon-width.fixed.px: 20 | ||
icon-height.fixed.px: 20 | ||
$on-click$: $slide-ds.go-back() | ||
|
||
-- ftd.row: | ||
width: hug-content | ||
spacing.fixed.px: 20 | ||
align-content: center | ||
|
||
-- ftd.text: Is this a template presentation: | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.copy-regular | ||
|
||
-- ftd.text: Yes | ||
width.fixed.px: 30 | ||
if: { is-template != NULL } | ||
text if { !is-template }: No | ||
color: red | ||
color if { is-template }: green | ||
role: $inherited.types.copy-regular | ||
|
||
-- slide-ds.button: Convert into Template Presentation | ||
title if { is-template }: Revert Back to Normal Presentation | ||
button-icon: $assets.files.slides.ui.assets.convert.svg | ||
;; $on-click$: $convert-template-http(url = toggle-template/, method = post, id = $id) | ||
icon-width.fixed.px: 20 | ||
icon-height.fixed.px: 20 | ||
|
||
-- end: ftd.row | ||
|
||
-- ftd.text: fastn.ftd | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.heading-medium | ||
|
||
-- ftd.text-input: | ||
padding.px: 10 | ||
default-value: $fastn-conf | ||
multiline: true | ||
width.fixed.px: 600 | ||
height.fixed.px: 200 | ||
white-space: nowrap | ||
|
||
-- ftd.text: settings.ftd | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.heading-medium | ||
|
||
-- ftd.text-input: | ||
padding.px: 10 | ||
default-value: $settings-conf | ||
multiline: true | ||
width.fixed.px: 600 | ||
height.fixed.px: 200 | ||
white-space: nowrap | ||
|
||
-- ftd.text: Save | ||
border-width.px: 2 | ||
border-radius.px: 15 | ||
padding-vertical.px: 5 | ||
padding-horizontal.px: 10 | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.copy-regular | ||
;; $on-click$: $save-settings-http(url = save-settings/, method = post, settings = $settings-conf, fastn = $fastn-conf, id = $id) | ||
|
||
-- ftd.row: | ||
if: { save-status != NULL && debug } | ||
width.fixed.px: 200 | ||
|
||
-- ftd.text: Success: | ||
color: $inherited.colors.text | ||
role: $inherited.types.copy-regular | ||
margin-right.px: 20 | ||
|
||
-- ftd.boolean: $save-status | ||
color: red | ||
color if { save-status }: green | ||
role: $inherited.types.copy-regular | ||
|
||
-- end: ftd.row | ||
|
||
|
||
-- end: slide-ds.page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
-- import: fastn/processors as pr | ||
|
||
-- integer id: | ||
$processor$: pr.request-data | ||
|
||
-- optional boolean $is-template: | ||
-- string $fastn-conf: Not fetched | ||
-- string $settings-conf: Not fetched | ||
-- optional boolean $save-status: | ||
-- boolean debug: false | ||
|
||
-- boolean $is-loaded: false | ||
|
||
-- string settings-url: $construct-settings-url(id = $id, order = $order) | ||
|
||
|
||
|
||
-- loader-component: | ||
url: $settings-url | ||
|
||
|
||
-- slide-ds.page: | ||
|
||
-- ftd.column: | ||
if: { is-loaded } | ||
width: fill-container | ||
height: fill-container | ||
|
||
-- ftd.text: Presentation Settings | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.heading-large | ||
/margin-vertical.px: 10 | ||
|
||
-- ds.button: Go back to editor | ||
button-icon: $assets.files.slides.ui.assets.go-back.svg | ||
icon-width.fixed.px: 20 | ||
icon-height.fixed.px: 20 | ||
$on-click$: $ds.go-back() | ||
|
||
-- ftd.row: | ||
width: hug-content | ||
/margin-vertical.px: 20 | ||
spacing.fixed.px: 20 | ||
align-content: center | ||
|
||
-- ftd.text: Is this a template presentation: | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.copy-regular | ||
|
||
-- ftd.text: Yes | ||
width.fixed.px: 30 | ||
if: { is-template != NULL } | ||
text if { !is-template }: No | ||
color: red | ||
color if { is-template }: green | ||
role: $inherited.types.copy-regular | ||
|
||
-- ds.button: Convert into Template Presentation | ||
title if { is-template }: Revert Back to Normal Presentation | ||
button-icon: $assets.files.slides.ui.assets.convert.svg | ||
$on-click$: $convert-template-http(url = toggle-template/, method = post, id = $id) | ||
icon-width.fixed.px: 20 | ||
icon-height.fixed.px: 20 | ||
|
||
-- end: ftd.row | ||
|
||
-- ftd.text: fastn.ftd | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.heading-medium | ||
/margin-vertical.px: 10 | ||
|
||
-- ftd.text-input: | ||
padding.px: 10 | ||
default-value: $fastn-conf | ||
multiline: true | ||
width.fixed.px: 600 | ||
height.fixed.px: 200 | ||
white-space: nowrap | ||
|
||
-- ftd.text: settings.ftd | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.heading-medium | ||
/margin-vertical.px: 10 | ||
|
||
-- ftd.text-input: | ||
padding.px: 10 | ||
default-value: $settings-conf | ||
multiline: true | ||
width.fixed.px: 600 | ||
height.fixed.px: 200 | ||
white-space: nowrap | ||
|
||
-- ftd.text: Save | ||
/margin-vertical.px: 20 | ||
border-width.px: 2 | ||
border-radius.px: 15 | ||
padding-vertical.px: 5 | ||
padding-horizontal.px: 10 | ||
color: $inherited.colors.text-strong | ||
role: $inherited.types.copy-regular | ||
$on-click$: $save-settings-http(url = save-settings/, method = post, settings = $settings-conf, fastn = $fastn-conf, id = $id) | ||
|
||
-- ftd.row: | ||
if: { save-status != NULL && debug } | ||
width.fixed.px: 200 | ||
|
||
-- ftd.text: Success: | ||
color: $inherited.colors.text | ||
role: $inherited.types.copy-regular | ||
margin-right.px: 20 | ||
|
||
-- ftd.boolean: $save-status | ||
color: red | ||
color if { save-status }: green | ||
role: $inherited.types.copy-regular | ||
|
||
-- end: ftd.row | ||
|
||
-- end: ftd.column | ||
|
||
-- end: slide-ds.page | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
;; --------------------- FUNCTIONS + WEB COMPONENTS --------------------------- | ||
-- string construct-settings-url(id): | ||
integer id: | ||
js: $assets.files.slides.ui.functions.js | ||
|
||
"settings/" + id + "/" | ||
|
||
-- void save-settings-http(id,url,method): | ||
integer id: | ||
string url: | ||
string method: | ||
string fastn: | ||
string settings: | ||
js: $assets.files.slides.ui.functions.js | ||
|
||
http(url, method, null, ("settings-ftd", settings), ("fastn-ftd", fastn), ("id", id)) | ||
|
||
-- void convert-template-http(url,method,id): | ||
integer id: | ||
string url: | ||
string method: | ||
js: $assets.files.slides.ui.functions.js | ||
|
||
http(url, method, null, ("id", id)) | ||
|
||
-- web-component loader-component: | ||
string url: | ||
js: $assets.files.slides.ui.loader-component.js |