Files
Cloud-CMS/modules/templates/stock-elements.xml
Matt Batchelder 05ce0da296 Initial Upload
2025-12-02 10:32:59 -05:00

735 lines
32 KiB
XML

<!--
~ Copyright (C) 2023 Xibo Signage Ltd
~
~ Xibo - Digital Signage - https://xibosignage.com
~
~ This file is part of Xibo.
~
~ Xibo is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ any later version.
~
~ Xibo is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with Xibo. If not, see <http://www.gnu.org/licenses/>.
-->
<templates>
<template>
<id>stock_name</id>
<extends override="text" with="data.Name">text</extends>
<title>Name</title>
<type>element</type>
<dataType>stock</dataType>
<canRotate>true</canRotate>
<icon>fas fa-font</icon>
<startWidth>420</startWidth>
<startHeight>100</startHeight>
</template>
<template>
<id>stock_symbol</id>
<extends override="text" with="data.SymbolTrimmed">text</extends>
<title>Symbol</title>
<type>element</type>
<dataType>stock</dataType>
<canRotate>true</canRotate>
<icon>fas fa-font</icon>
<startWidth>420</startWidth>
<startHeight>100</startHeight>
</template>
<template>
<id>stock_lastTradePrice</id>
<extends override="text" with="data.LastTradePriceOnly">text</extends>
<title>Last Trade Price</title>
<type>element</type>
<dataType>stock</dataType>
<icon>fas fa-money-bill-alt</icon>
<canRotate>true</canRotate>date
<startWidth>200</startWidth>
<startHeight>100</startHeight>
</template>
<template>
<id>stock_changePercentage</id>
<extends override="text" with="data.ChangePercentage">text</extends>
<title>Change Percentage</title>
<type>element</type>
<dataType>stock</dataType>
<canRotate>true</canRotate>
<icon>fas fa-percentage</icon>
<startWidth>200</startWidth>
<startHeight>100</startHeight>
<onElementParseData><![CDATA[
// value - element to be parsed
if (String(value).length === 0) {
return '';
}
if (String(value).includes('%')) {
return value;
}
return value + '%';
]]></onElementParseData>
<onTemplateRender><![CDATA[
var elementData = null;
if (properties.hasOwnProperty('data')) {
elementData = properties.data;
}
if (elementData !== null && elementData.hasOwnProperty('ChangeStyle')) {
var changeStyle = elementData.ChangeStyle;
var $changePercent = $(target).find('div:first');
if (changeStyle === 'value-equal') {
$changePercent.css({color: 'gray'});
} else {
$changePercent.css({color: changeStyle === 'value-down' ? 'red' : 'green'});
}
}
if(properties.fitToArea) {
// Set target for the text
properties.fitTarget = 'div';
// Scale text to container
$(target).find('.global-elements-text').xiboTextScaler(properties);
}
]]></onTemplateRender>
</template>
<template>
<id>stock_changeIcon</id>
<title>Stock Icon</title>
<type>element</type>
<dataType>stock</dataType>
<canRotate>true</canRotate>
<icon>fas fa-arrows-alt-v</icon>
<startWidth>80</startWidth>
<startHeight>60</startHeight>
<stencil>
<hbs><![CDATA[
<div class="stock-elements-icon" data-css-url="[[assetId=font-awesome]]" style="width: 100%;
height: 100%;
position: relative;
display: inline-block;
text-align: center;">
<div class="fa {{data.ChangeIcon}}
{{#eq data.ChangeIcon "up-arrow"}}fa-caret-up{{/eq}}
{{#eq data.ChangeIcon "down-arrow"}}fa-caret-down{{/eq}}
{{#eq data.ChangeIcon "right-arrow"}}fa-caret-right{{/eq}}"
style="
font-size: calc({{prop.width}}px * 0.75);
{{#if prop.height}}line-height: {{prop.height}}px;{{/if}}
{{#eq data.ChangeIcon "up-arrow"}}color: green;{{/eq}}
{{#eq data.ChangeIcon "down-arrow"}}color: red;{{/eq}}
{{#eq data.ChangeIcon "right-arrow"}}color: gray;{{/eq}}
"></div></div>
]]></hbs>
</stencil>
<onTemplateRender><![CDATA[
var $arrowContainer = $(target).find('.stock-elements-icon');
var $targetContainer = $(target).is('body') ? $('body') : $(target).parent().parent();
// Inject CSS into target container if it's not added yet
if ($targetContainer.find('.sampleCSS').length == 0) {
$targetContainer.prepend(`<link rel="stylesheet" href="${$arrowContainer.data('cssUrl')}" class="sampleCSS" media="screen"/>`);
}
]]></onTemplateRender>
<assets>
<asset id="font-awesome" type="path" mimeType="text/css" path="/modules/assets/common/font-awesome.min.css" />
<asset id="fontawesome-webfont.ttf" type="path" mimeType="application/x-font-ttf" path="/modules/assets/common/fontawesome-webfont.ttf"></asset>
<asset id="fontawesome-webfont.woff" type="path" mimeType="application/font-woff" path="/modules/assets/common/fontawesome-webfont.woff"></asset>
<asset id="fontawesome-webfont.woff2" type="path" mimeType="application/font-woff2" path="/modules/assets/common/fontawesome-webfont.woff2"></asset>
</assets>
</template>
<template>
<id>stocks_single_1</id>
<type>element-group</type>
<dataType>stock</dataType>
<title>Stocks - Single 1</title>
<thumbnail>stocks-single-1</thumbnail>
<stencil>
<hbs></hbs>
<startWidth>419</startWidth>
<startHeight>169</startHeight>
<elements>
<element id="rectangle">
<title>Background</title>
<layer>0</layer>
<top>0</top>
<left>0</left>
<width>419</width>
<height>169</height>
<defaultProperties>
<property id="backgroundColor">#001061</property>
<property id="roundBorder">1</property>
<property id="borderRadius">20</property>
<property id="outline">0</property>
</defaultProperties>
</element>
<element id="rectangle">
<title>Temp area</title>
<layer>2</layer>
<top>20</top>
<left>28</left>
<width>124</width>
<height>124</height>
<defaultProperties>
<property id="backgroundColor">#fff</property>
<property id="roundBorder">1</property>
<property id="borderRadius">10</property>
<property id="outline">0</property>
</defaultProperties>
</element>
<element id="stock_changeIcon">
<title>Stock change icon</title>
<layer>4</layer>
<top>31</top>
<left>40</left>
<width>100</width>
<height>100</height>
</element>
<element id="stock_name">
<title>Stock name</title>
<layer>4</layer>
<top>21</top>
<left>185</left>
<width>208</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">40</property>
<property id="bold">1</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
<property id="textWrap">0</property>
<property id="showOverflow">0</property>
</defaultProperties>
</element>
<element id="text">
<title>Stocks symbol</title>
<layer>8</layer>
<top>85</top>
<left>184</left>
<width>39</width>
<height>63</height>
<defaultProperties>
<property id="text">$</property>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_lastTradePrice">
<title>Last trade price</title>
<layer>3</layer>
<top>85</top>
<left>223</left>
<width>169</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
</elements>
</stencil>
<assets>
<asset id="stocks-single-1" type="path" cmsOnly="true" mimeType="image/png" path="/modules/assets/template-thumbnails/stocks/elements/stocks-single-1.png" />
</assets>
</template>
<template>
<id>stocks_single_2</id>
<type>element-group</type>
<dataType>stock</dataType>
<title>Stocks - Single 2</title>
<thumbnail>stocks-single-2</thumbnail>
<stencil>
<hbs></hbs>
<startWidth>479</startWidth>
<startHeight>225</startHeight>
<elements>
<element id="rectangle">
<title>Background</title>
<layer>0</layer>
<top>0</top>
<left>0</left>
<width>479</width>
<height>225</height>
<defaultProperties>
<property id="backgroundColor">#171717</property>
<property id="roundBorder">1</property>
<property id="borderRadius">20</property>
<property id="outline">0</property>
</defaultProperties>
</element>
<element id="stock_name">
<title>Stock name</title>
<layer>4</layer>
<top>41</top>
<left>44</left>
<width>392</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">open sans regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">60</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
<property id="textWrap">0</property>
<property id="showOverflow">0</property>
</defaultProperties>
</element>
<element id="text">
<title>Stock symbol</title>
<layer>8</layer>
<top>124</top>
<left>45</left>
<width>39</width>
<height>64</height>
<defaultProperties>
<property id="text">$</property>
<property id="fontFamily">open sans regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_lastTradePrice">
<title>Last trade price</title>
<layer>3</layer>
<top>124</top>
<left>84</left>
<width>119</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">open sans regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_changeIcon">
<title>Stock change icon</title>
<layer>10</layer>
<top>125</top>
<left>222</left>
<width>58</width>
<height>63</height>
</element>
<element id="stock_changePercentage">
<title>Change percentage</title>
<layer>9</layer>
<top>124</top>
<left>288</left>
<width>148</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">open sans regular</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
</elements>
</stencil>
<assets>
<asset id="stocks-single-2" type="path" cmsOnly="true" mimeType="image/png" path="/modules/assets/template-thumbnails/stocks/elements/stocks-single-2.png" />
</assets>
</template>
<template>
<id>stocks_group_1</id>
<type>element-group</type>
<dataType>stock</dataType>
<title>Stocks - Group 1</title>
<thumbnail>stocks-group-1</thumbnail>
<stencil>
<hbs></hbs>
<startWidth>482</startWidth>
<startHeight>683</startHeight>
<elementGroups>
<elementGroup id="group_0">
<title>Background group</title>
<layer>0</layer>
<top>0</top>
<left>0</left>
<width>482</width>
<height>683</height>
<slot>0</slot>
<pinSlot>1</pinSlot>
</elementGroup>
<elementGroup id="group_1">
<title>Group 1</title>
<layer>3</layer>
<top>38</top>
<left>40</left>
<width>400</width>
<height>63</height>
<slot>0</slot>
</elementGroup>
<elementGroup id="group_2">
<title>Group 2</title>
<layer>3</layer>
<top>179</top>
<left>40</left>
<width>400</width>
<height>63</height>
<slot>1</slot>
</elementGroup>
<elementGroup id="group_3">
<title>Group 3</title>
<layer>3</layer>
<top>312</top>
<left>40</left>
<width>400</width>
<height>63</height>
<slot>2</slot>
</elementGroup>
<elementGroup id="group_4">
<title>Group 4</title>
<layer>3</layer>
<top>445</top>
<left>40</left>
<width>400</width>
<height>63</height>
<slot>3</slot>
</elementGroup>
<elementGroup id="group_5">
<title>Group 5</title>
<layer>3</layer>
<top>582</top>
<left>40</left>
<width>400</width>
<height>63</height>
<slot>4</slot>
</elementGroup>
</elementGroups>
<elements>
<element id="rectangle" elementGroupId="group_0">
<title>Background</title>
<layer>1</layer>
<top>0</top>
<left>0</left>
<width>482</width>
<height>683</height>
<defaultProperties>
<property id="backgroundColor">#171717</property>
<property id="outline">1</property>
<property id="outlineColor">#b4b4b4</property>
<property id="outlineWidth">2</property>
<property id="roundBorder">1</property>
<property id="borderRadius">20</property>
</defaultProperties>
</element>
<element id="line" elementGroupId="group_0">
<title>Separator 1</title>
<layer>5</layer>
<top>116</top>
<left>36</left>
<width>402</width>
<height>48</height>
<defaultProperties>
<property id="lineColor">#b4b4b4</property>
<property id="lineWidth">2</property>
</defaultProperties>
</element>
<element id="line" elementGroupId="group_0">
<title>Separator 2</title>
<layer>5</layer>
<top>253</top>
<left>36</left>
<width>402</width>
<height>48</height>
<defaultProperties>
<property id="lineColor">#b4b4b4</property>
<property id="lineWidth">2</property>
</defaultProperties>
</element>
<element id="line" elementGroupId="group_0">
<title>Separator 3</title>
<layer>5</layer>
<top>386</top>
<left>36</left>
<width>402</width>
<height>48</height>
<defaultProperties>
<property id="lineColor">#b4b4b4</property>
<property id="lineWidth">2</property>
</defaultProperties>
</element>
<element id="line" elementGroupId="group_0">
<title>Separator 4</title>
<layer>5</layer>
<top>523</top>
<left>36</left>
<width>402</width>
<height>48</height>
<defaultProperties>
<property id="lineColor">#b4b4b4</property>
<property id="lineWidth">2</property>
</defaultProperties>
</element>
<element id="stock_name" elementGroupId="group_1">
<title>Stock name</title>
<layer>4</layer>
<top>0</top>
<left>0</left>
<width>203</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
<property id="textWrap">0</property>
<property id="showOverflow">0</property>
<property id="bold">1</property>
</defaultProperties>
</element>
<element id="text" elementGroupId="group_1">
<title>Stock symbol</title>
<layer>8</layer>
<top>0</top>
<left>225</left>
<width>39</width>
<height>63</height>
<defaultProperties>
<property id="text">$</property>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_lastTradePrice" elementGroupId="group_1">
<title>Last trade price</title>
<layer>3</layer>
<top>0</top>
<left>264</left>
<width>136</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_name" elementGroupId="group_2">
<title>Stock name</title>
<layer>4</layer>
<top>0</top>
<left>0</left>
<width>203</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
<property id="textWrap">0</property>
<property id="showOverflow">0</property>
<property id="bold">1</property>
</defaultProperties>
</element>
<element id="text" elementGroupId="group_2">
<title>Stock symbol</title>
<layer>8</layer>
<top>0</top>
<left>225</left>
<width>39</width>
<height>63</height>
<defaultProperties>
<property id="text">$</property>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_lastTradePrice" elementGroupId="group_2">
<title>Last trade price</title>
<layer>3</layer>
<top>0</top>
<left>264</left>
<width>136</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_name" elementGroupId="group_3">
<title>Stock name</title>
<layer>4</layer>
<top>0</top>
<left>0</left>
<width>203</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
<property id="textWrap">0</property>
<property id="showOverflow">0</property>
<property id="bold">1</property>
</defaultProperties>
</element>
<element id="text" elementGroupId="group_3">
<title>Stock symbol</title>
<layer>8</layer>
<top>0</top>
<left>225</left>
<width>39</width>
<height>63</height>
<defaultProperties>
<property id="text">$</property>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_lastTradePrice" elementGroupId="group_3">
<title>Last trade price</title>
<layer>3</layer>
<top>0</top>
<left>264</left>
<width>136</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_name" elementGroupId="group_4">
<title>Stock name</title>
<layer>4</layer>
<top>0</top>
<left>0</left>
<width>203</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
<property id="textWrap">0</property>
<property id="showOverflow">0</property>
<property id="bold">1</property>
</defaultProperties>
</element>
<element id="text" elementGroupId="group_4">
<title>Stock symbol</title>
<layer>8</layer>
<top>0</top>
<left>225</left>
<width>39</width>
<height>63</height>
<defaultProperties>
<property id="text">$</property>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_lastTradePrice" elementGroupId="group_4">
<title>Last trade price</title>
<layer>3</layer>
<top>0</top>
<left>264</left>
<width>136</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_name" elementGroupId="group_5">
<title>Stock name</title>
<layer>4</layer>
<top>0</top>
<left>0</left>
<width>203</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#fff</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
<property id="textWrap">0</property>
<property id="showOverflow">0</property>
<property id="bold">1</property>
</defaultProperties>
</element>
<element id="text" elementGroupId="group_5">
<title>Stock symbol</title>
<layer>8</layer>
<top>0</top>
<left>225</left>
<width>39</width>
<height>63</height>
<defaultProperties>
<property id="text">$</property>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
<element id="stock_lastTradePrice" elementGroupId="group_5">
<title>Last trade price</title>
<layer>3</layer>
<top>0</top>
<left>264</left>
<width>136</width>
<height>63</height>
<defaultProperties>
<property id="fontFamily">Poppins Regular</property>
<property id="fontColor">#b4b4b4</property>
<property id="fontSize">40</property>
<property id="horizontalAlign">flex-start</property>
<property id="verticalAlign">center</property>
</defaultProperties>
</element>
</elements>
</stencil>
<assets>
<asset id="stocks-group-1" type="path" cmsOnly="true" mimeType="image/png" path="/modules/assets/template-thumbnails/stocks/elements/stocks-group-1.png" />
</assets>
</template>
</templates>