Skip to content

Commit

Permalink
3123: Added admin form and built template
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Dec 4, 2024
1 parent 3a092a9 commit 2969e31
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 51 deletions.
60 changes: 60 additions & 0 deletions build/social-news-admin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[
{
"key": "social-news-form-1",
"input": "header",
"text": "Skabelon: Instagram feed",
"name": "header1",
"formGroupClasses": "h4 mb-3"
},
{
"key": "social-news-form-2",
"input": "header-h3",
"text": "Opsæt feed",
"name": "header2",
"formGroupClasses": "h5 mb-3"
},
{
"key": "social-news-form-3",
"input": "feed",
"text": "Opsæt feed",
"name": "feeds",
"supportedFeedOutputType": "social-news",
"formGroupClasses": "mb-3",
"singleSelect": true
},
{
"key": "social-news-form-entry-duration",
"input": "input",
"name": "entryDuration",
"type": "number",
"label": "Varighed pr. nyhed (i sekunder)",
"helpText": "Her skal du skrive varigheden pr. nyhed.",
"formGroupClasses": "mb-3",
"required": true
},
{
"key": "social-news-form-readmore",
"input": "input",
"text": "Læs mere tekst",
"name": "readMore",
"formGroupClasses": "mb-3"
},
{
"key": "social-news-max-entries",
"input": "input",
"name": "maxEntries",
"type": "number",
"min": 1,
"label": "Maksimalt antal nyheder",
"helpText": "Her kan du skrive maksimalt antal nyheder, der skal vises.",
"formGroupClasses": "mb-3"
},
{
"key": "form-media-contain",
"input": "checkbox",
"name": "mediaContain",
"label": "Deaktivér billedbeskæring",
"helpText": "Billedet vil blive vist ubeskåret med tomme områder omkring",
"formGroupClasses": "mb-3"
}
]
14 changes: 14 additions & 0 deletions build/social-news-config-develop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"title": "Instagram feed",
"icon": "",
"id": "01FTZC0RKJYHG4JVZG5K709G46",
"description": "Mulighed for at vise instagram indhold.",
"resources": {
"component": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/instagram-feed.js?ts=1733305345933",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/instagram-feed-admin.json?ts=1733305345933",
"schema": "https://raw.githubusercontent.com/os2display/display-templates/develop/build/instagram-feed-schema.json?ts=1733305345933",
"assets": [],
"options": {},
"content": {}
}
}
14 changes: 14 additions & 0 deletions build/social-news-config-main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"title": "Instagram feed",
"icon": "",
"id": "01FTZC0RKJYHG4JVZG5K709G46",
"description": "Mulighed for at vise instagram indhold.",
"resources": {
"component": "https://raw.githubusercontent.com/os2display/display-templates/main/build/instagram-feed.js?ts=1733305345933",
"admin": "https://raw.githubusercontent.com/os2display/display-templates/main/build/instagram-feed-admin.json?ts=1733305345933",
"schema": "https://raw.githubusercontent.com/os2display/display-templates/main/build/instagram-feed-schema.json?ts=1733305345933",
"assets": [],
"options": {},
"content": {}
}
}
2 changes: 2 additions & 0 deletions build/social-news.js

Large diffs are not rendered by default.

70 changes: 19 additions & 51 deletions src/social-news/social-news-admin.json
Original file line number Diff line number Diff line change
@@ -1,92 +1,60 @@
[
{
"key": "instagram-feed-form-1",
"key": "social-news-form-1",
"input": "header",
"text": "Skabelon: Instagram feed",
"name": "header1",
"formGroupClasses": "h4 mb-3"
},
{
"key": "instagram-feed-form-2",
"key": "social-news-form-2",
"input": "header-h3",
"text": "Opsæt feed",
"name": "header2",
"formGroupClasses": "h5 mb-3"
},
{
"key": "instagram-feed-form-3",
"key": "social-news-form-3",
"input": "feed",
"text": "Opsæt feed",
"name": "feeds",
"supportedFeedOutputType": "instagram",
"supportedFeedOutputType": "social-news",
"formGroupClasses": "mb-3",
"singleSelect": true
},
{
"key": "instagram-feed-form-entry-duration",
"key": "social-news-form-entry-duration",
"input": "input",
"name": "entryDuration",
"type": "number",
"label": "Varighed pr. billede/video (i sekunder)",
"helpText": "Her skal du skrive varigheden pr. billede/video.",
"required": true,
"formGroupClasses": "col-md-6 mb-3"
},
{
"key": "instagram-feed-hashtag-text",
"input": "input",
"name": "hashtagText",
"type": "text",
"label": "Hashtag-tekst",
"helpText": "Her kan du skrive hashtag-teksten.",
"formGroupClasses": "col-md-6"
},
{
"key": "instagram-feed-orientation",
"input": "select",
"name": "orientation",
"label": "Vælg skærmorientering",
"required": true,
"formGroupClasses": "col-md-6 mb-3",
"options": [
{
"key": "orientation1",
"title": "Horisontalt",
"value": "landscape"
},
{
"key": "orientation2",
"title": "Vertikal",
"value": "vertical"
}
]
"label": "Varighed pr. nyhed (i sekunder)",
"helpText": "Her skal du skrive varigheden pr. nyhed.",
"formGroupClasses": "mb-3",
"required": true
},
{
"key": "instagram-feed-image-width",
"key": "social-news-form-readmore",
"input": "input",
"name": "imageWidth",
"type": "number",
"min": 0,
"max": 100.0,
"label": "Billedebredde %",
"helpText": "Her kan du skrive billedebredden i procent.",
"formGroupClasses": "col-md-6"
"text": "Læs mere tekst",
"name": "readMore",
"formGroupClasses": "mb-3"
},
{
"key": "instagram-feed-max-entries",
"key": "social-news-max-entries",
"input": "input",
"name": "maxEntries",
"type": "number",
"min": 1,
"label": "Maksimalt antal billeder/videoer fra feedet",
"helpText": "Her kan du skrive maksimalt antal billeder/videoer fra feedet.",
"formGroupClasses": "col-md-6"
"label": "Maksimalt antal nyheder",
"helpText": "Her kan du skrive maksimalt antal nyheder, der skal vises.",
"formGroupClasses": "mb-3"
},
{
"key": "form-media-contain",
"input": "checkbox",
"name": "mediaContain",
"label": "Deaktivér billedbeskæring",
"helpText": "Billedet vil blive vist ubeskåret med tomme områder omkring"
"helpText": "Billedet vil blive vist ubeskåret med tomme områder omkring",
"formGroupClasses": "mb-3"
}
]
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ const entry = devMode
"./src/instagram-feed/instagram-feed.js"
),
iframe: path.resolve(__dirname, "./src/iframe/iframe.js"),
"social-news": path.resolve(
__dirname,
"./src/social-news/social-news.js"
),
table: path.resolve(__dirname, "./src/table/table.js"),
video: path.resolve(__dirname, "./src/video/video.js"),
travel: path.resolve(__dirname, "./src/travel/travel.js"),
Expand Down

0 comments on commit 2969e31

Please sign in to comment.