mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-11 17:01:50 +00:00
Mustache -> Handlebars
This commit is contained in:
parent
6d52d0e683
commit
7fe3a39d1d
|
@ -44,8 +44,8 @@
|
|||
"WikiaObject": "includes/nirvana/WikiaObject.class.php",
|
||||
"WikiaRegistry": "includes/nirvana/WikiaRegistry.class.php",
|
||||
"WikiaGlobalRegistry": "includes/nirvana/WikiaGlobalRegistry.class.php",
|
||||
"Wikia\\Template\\MustacheEngine": "includes/mustache/MustacheEngine.class.php",
|
||||
"MustacheService": "includes/mustache/MustacheService.class.php",
|
||||
"Wikia\\Template\\TemplateEngine": "includes/templates/TemplateEngine.class.php",
|
||||
"TemplateService": "includes/templates/TemplateService.class.php",
|
||||
"HtmlHelper": "includes/filehelpers/HtmlHelper.class.php",
|
||||
"FileNamespaceSanitizeHelper": "includes/filehelpers/FileNamespaceSanitizeHelper.php",
|
||||
"WikiaFileHelper": "includes/filehelpers/WikiaFileHelper.class.php",
|
||||
|
@ -69,7 +69,7 @@
|
|||
"Wikia\\PortableInfobox\\Parser\\Nodes\\NodeUnimplemented": "services/Parser/Nodes/NodeUnimplemented.php",
|
||||
"Wikia\\PortableInfobox\\Helpers\\InfoboxParamsValidator": "services/Helpers/InfoboxParamsValidator.php",
|
||||
"Wikia\\PortableInfobox\\Helpers\\PortableInfoboxDataBag": "services/Helpers/PortableInfoboxDataBag.php",
|
||||
"Wikia\\PortableInfobox\\Helpers\\PortableInfoboxMustacheEngine": "services/Helpers/PortableInfoboxMustacheEngine.php",
|
||||
"Wikia\\PortableInfobox\\Helpers\\PortableInfoboxTemplateEngine": "services/Helpers/PortableInfoboxTemplateEngine.php",
|
||||
"Wikia\\PortableInfobox\\Helpers\\PortableInfoboxImagesHelper": "services/Helpers/PortableInfoboxImagesHelper.php",
|
||||
"Wikia\\PortableInfobox\\Helpers\\PortableInfoboxParsingHelper": "services/Helpers/PortableInfoboxParsingHelper.php",
|
||||
"Wikia\\PortableInfobox\\Helpers\\PagePropsProxy": "services/Helpers/PagePropsProxy.php",
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
namespace Wikia\Template;
|
||||
|
||||
/**
|
||||
* Mustache FileSystem-based engine for Wikia Templating System.
|
||||
* Template FileSystem-based engine for Wikia Templating System.
|
||||
*
|
||||
* @package Wikia\Template
|
||||
* @author Federico "Lox" Lucignano <federico@wikia-inc.com>
|
||||
*/
|
||||
|
||||
class MustacheEngine {
|
||||
class TemplateEngine {
|
||||
protected $values = [];
|
||||
protected $prefix = '';
|
||||
|
||||
|
@ -16,9 +16,9 @@ class MustacheEngine {
|
|||
* Checks if a template exists.
|
||||
*
|
||||
* @param string $template The name of the template, will be combined with
|
||||
* the value passed to MustacheEngine::setPrefix().
|
||||
* the value passed to TemplateEngine::setPrefix().
|
||||
* In case of FileSystem-based engines it should be the filename
|
||||
* either alone (MustacheEngine::setPrefix()) or the full path, both need to
|
||||
* either alone (TemplateEngine::setPrefix()) or the full path, both need to
|
||||
* include the file's extension.
|
||||
*
|
||||
* @return bool Wether the template was found or not
|
||||
|
@ -36,9 +36,9 @@ class MustacheEngine {
|
|||
* Renders the template as a string.
|
||||
*
|
||||
* @param string $template The name of the template, will be combined with
|
||||
* the value passed to MustacheEngine::setPrefix().
|
||||
* the value passed to TemplateEngine::setPrefix().
|
||||
* In case of FileSystem-based engines it should be the filename
|
||||
* either alone (MustacheEngine::setPrefix()) or the full path, both need to
|
||||
* either alone (TemplateEngine::setPrefix()) or the full path, both need to
|
||||
* include the file's extension.
|
||||
*
|
||||
* @return string The rendered template
|
||||
|
@ -49,7 +49,7 @@ class MustacheEngine {
|
|||
$path = $this->prefix == '' ? $template : $this->prefix . DIRECTORY_SEPARATOR . $template;
|
||||
|
||||
//wfProfileIn( __METHOD__ . " - template: {$path}" );
|
||||
$contents = \MustacheService::getInstance()->render( $path, $this->values );
|
||||
$contents = \TemplateService::getInstance()->render( $path, $this->values );
|
||||
//wfProfileOut( __METHOD__ . " - template: {$path}" );
|
||||
|
||||
//wfProfileOut( __METHOD__ );
|
||||
|
@ -60,11 +60,11 @@ class MustacheEngine {
|
|||
* Sets the base path for this instance.
|
||||
*
|
||||
* @param string $prefix The prefix to append to the template
|
||||
* name passed as a parameter to MustacheEngine::render(), e.g. the path
|
||||
* name passed as a parameter to TemplateEngine::render(), e.g. the path
|
||||
* to a folder containing template files for filesystem-based
|
||||
* engines.
|
||||
*
|
||||
* @return MustacheEngine The current instance
|
||||
* @return TemplateEngine The current instance
|
||||
*/
|
||||
public function setPrefix ( $prefix ) {
|
||||
$this->prefix = (string) $prefix;
|
||||
|
@ -86,9 +86,9 @@ class MustacheEngine {
|
|||
* @param array $values The values to be passed to a template
|
||||
* in the form of an associative array, i.e. [IDENTIFIER => VALUE]
|
||||
*
|
||||
* @return MustacheEngine The current instance
|
||||
* @return TemplateEngine The current instance
|
||||
*
|
||||
* @see MustacheEngine::setVal() if you need to set only one value
|
||||
* @see TemplateEngine::setVal() if you need to set only one value
|
||||
*/
|
||||
public function setData( Array $values ) {
|
||||
$this->values = $values;
|
||||
|
@ -102,9 +102,9 @@ class MustacheEngine {
|
|||
* @param array $values The values to be added/updated in the form of an
|
||||
* associative array, i.e. [IDENTIFIER => VALUE]
|
||||
*
|
||||
* @return MustacheEngine The current instance
|
||||
* @return TemplateEngine The current instance
|
||||
*
|
||||
* * @see MustacheEngine::setVal() if you need to add/overwrite only one value
|
||||
* * @see TemplateEngine::setVal() if you need to add/overwrite only one value
|
||||
*/
|
||||
public function updateData( Array $values ) {
|
||||
wfProfileIn( __METHOD__ );
|
||||
|
@ -118,9 +118,9 @@ class MustacheEngine {
|
|||
/**
|
||||
* Empties the collection of values stored in an instance
|
||||
*
|
||||
* @return MustacheEngine The current instance
|
||||
* @return TemplateEngine The current instance
|
||||
*
|
||||
* @see MustacheEngine::clearVal() if you need to clear only one value
|
||||
* @see TemplateEngine::clearVal() if you need to clear only one value
|
||||
*/
|
||||
public function clearData(){
|
||||
$this->values = [];
|
||||
|
@ -133,7 +133,7 @@ class MustacheEngine {
|
|||
* @return array The values set for this instance, null if the collection
|
||||
* wasn't set
|
||||
*
|
||||
* @see MustacheEngine::getVal() if you need to get only one value
|
||||
* @see TemplateEngine::getVal() if you need to get only one value
|
||||
*/
|
||||
public function getData() {
|
||||
return $this->values;
|
||||
|
@ -145,9 +145,9 @@ class MustacheEngine {
|
|||
* @param string $name The name of the value
|
||||
* @param mixed $value The real value
|
||||
*
|
||||
* @return MustacheEngine The current instance
|
||||
* @return TemplateEngine The current instance
|
||||
*
|
||||
* @see MustacheEngine::setData() if you need to set multiple values instead
|
||||
* @see TemplateEngine::setData() if you need to set multiple values instead
|
||||
* of calling this method multiple times
|
||||
*/
|
||||
public function setVal( $name, $value ) {
|
||||
|
@ -160,9 +160,9 @@ class MustacheEngine {
|
|||
*
|
||||
* @param string $name The name of the value
|
||||
*
|
||||
* @return MustacheEngine The current instance
|
||||
* @return TemplateEngine The current instance
|
||||
*
|
||||
* @see MustacheEngine::clearData() if you need to clear the whole collection
|
||||
* @see TemplateEngine::clearData() if you need to clear the whole collection
|
||||
* instead of calling this method multiple times
|
||||
*/
|
||||
public function clearVal( $name ){
|
||||
|
@ -177,7 +177,7 @@ class MustacheEngine {
|
|||
*
|
||||
* @return mixed|null The current instance
|
||||
*
|
||||
* @see MustacheEngine::setData() if you need to get multiple values instead
|
||||
* @see TemplateEngine::setData() if you need to get multiple values instead
|
||||
* of calling this method multiple times
|
||||
*/
|
||||
public function getVal( $name ) {
|
|
@ -1,16 +1,16 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MustacheService is a wrapper for actual Mustache implementation
|
||||
* TemplateService is a wrapper for actual Mustache/Handlebars implementation
|
||||
* that automatically searches for all required partials and prefetches them
|
||||
* in order to supply Mustache engine (either in PHP or JS) with all necessary
|
||||
* in order to supply the engine (either in PHP or JS) with all necessary
|
||||
* dependencies.
|
||||
*
|
||||
* @see https://github.com/wikimedia/mediawiki-vendor/tree/master/zordius/lightncandy
|
||||
*
|
||||
* @author Władysław Bodzek <wladek@wikia-inc.com>
|
||||
*/
|
||||
class MustacheService {
|
||||
class TemplateService {
|
||||
|
||||
const REGEX_PARTIALS = '/{{>\s*([^{}]*?)}}/';
|
||||
|
||||
|
@ -20,7 +20,7 @@ class MustacheService {
|
|||
private $cache = array();
|
||||
|
||||
/**
|
||||
* Singleton - use MustacheService::getInstance() instead
|
||||
* Singleton - use TemplateService::getInstance() instead
|
||||
*/
|
||||
private function __construct() {}
|
||||
|
||||
|
@ -29,8 +29,8 @@ class MustacheService {
|
|||
*
|
||||
* @param $fileName string File path (absolute)
|
||||
* @return array Array containing requested data, keys are:
|
||||
* - MustacheService::TEMPLATE - contains template contents
|
||||
* - MustacheService::DEPENDENCIES - list of all partials that may be included
|
||||
* - TemplateService::TEMPLATE - contains template contents
|
||||
* - TemplateService::DEPENDENCIES - list of all partials that may be included
|
||||
* @throws Exception Thrown if any partial cannot be found
|
||||
*/
|
||||
private function getTemplateInfo( $fileName ) {
|
||||
|
@ -140,10 +140,10 @@ class MustacheService {
|
|||
* @throws Exception Thrown if any partial cannot be found
|
||||
*/
|
||||
public function render( $fileName, $data ) {
|
||||
$renderer = $this->getRenderer($fileName);
|
||||
return $renderer($this->parseData($data));
|
||||
$renderer = $this->getRenderer( $fileName );
|
||||
return $renderer( $data );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a mustache renderer
|
||||
*
|
||||
|
@ -155,19 +155,19 @@ class MustacheService {
|
|||
if ( !empty($this->cache[$fileName] ) ) {
|
||||
return $this->cache[$fileName];
|
||||
}
|
||||
|
||||
|
||||
list( $template, $partials ) = $this->getTemplateAndPartials( $fileName );
|
||||
|
||||
// @see https://github.com/wikimedia/mediawiki-vendor/tree/master/zordius/lightncandy
|
||||
$renderer = LightnCandy::prepare(
|
||||
LightnCandy::compile($template, array(
|
||||
'flags' => LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_BESTPERFORMANCE,
|
||||
'flags' => LightnCandy::FLAG_BESTPERFORMANCE,
|
||||
'partials' => $partials
|
||||
))
|
||||
);
|
||||
|
||||
|
||||
$this->cache[$fileName] = $renderer;
|
||||
|
||||
|
||||
return $renderer;
|
||||
}
|
||||
|
||||
|
@ -190,9 +190,9 @@ class MustacheService {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get a singleton instance of MustacheService
|
||||
* Get a singleton instance of TemplateService
|
||||
*
|
||||
* @return MustacheService Singleton
|
||||
* @return TemplateService Singleton
|
||||
*/
|
||||
public static function getInstance() {
|
||||
static $instance;
|
|
@ -3,27 +3,27 @@
|
|||
namespace Wikia\PortableInfobox\Helpers;
|
||||
|
||||
use MediaWiki\Logger\LoggerFactory;
|
||||
use Wikia\Template\MustacheEngine;
|
||||
use Wikia\Template\TemplateEngine;
|
||||
|
||||
class PortableInfoboxMustacheEngine {
|
||||
class PortableInfoboxTemplateEngine {
|
||||
const TYPE_NOT_SUPPORTED_MESSAGE = 'portable-infobox-render-not-supported-type';
|
||||
|
||||
protected static $templates = [
|
||||
'wrapper' => 'PortableInfoboxWrapper.mustache',
|
||||
'title' => 'PortableInfoboxItemTitle.mustache',
|
||||
'header' => 'PortableInfoboxItemHeader.mustache',
|
||||
'image' => 'PortableInfoboxItemImage.mustache',
|
||||
'data' => 'PortableInfoboxItemData.mustache',
|
||||
'group' => 'PortableInfoboxItemGroup.mustache',
|
||||
'smart-group' => 'PortableInfoboxItemSmartGroup.mustache',
|
||||
'horizontal-group-content' => 'PortableInfoboxHorizontalGroupContent.mustache',
|
||||
'navigation' => 'PortableInfoboxItemNavigation.mustache',
|
||||
'image-collection' => 'PortableInfoboxItemImageCollection.mustache'
|
||||
'wrapper' => 'PortableInfoboxWrapper.hbs',
|
||||
'title' => 'PortableInfoboxItemTitle.hbs',
|
||||
'header' => 'PortableInfoboxItemHeader.hbs',
|
||||
'image' => 'PortableInfoboxItemImage.hbs',
|
||||
'data' => 'PortableInfoboxItemData.hbs',
|
||||
'group' => 'PortableInfoboxItemGroup.hbs',
|
||||
'smart-group' => 'PortableInfoboxItemSmartGroup.hbs',
|
||||
'horizontal-group-content' => 'PortableInfoboxHorizontalGroupContent.hbs',
|
||||
'navigation' => 'PortableInfoboxItemNavigation.hbs',
|
||||
'image-collection' => 'PortableInfoboxItemImageCollection.hbs'
|
||||
];
|
||||
protected $templateEngine;
|
||||
|
||||
public function __construct() {
|
||||
$this->templateEngine = ( new MustacheEngine )
|
||||
$this->templateEngine = ( new TemplateEngine )
|
||||
->setPrefix( self::getTemplatesDir() );
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Wikia\PortableInfobox\Helpers\PortableInfoboxImagesHelper;
|
||||
use Wikia\PortableInfobox\Helpers\PortableInfoboxMustacheEngine;
|
||||
use Wikia\PortableInfobox\Helpers\PortableInfoboxTemplateEngine;
|
||||
|
||||
class PortableInfoboxRenderService {
|
||||
// keep synced with scss variables ($infobox-width)
|
||||
|
@ -16,7 +16,7 @@ class PortableInfoboxRenderService {
|
|||
private $helper;
|
||||
|
||||
public function __construct() {
|
||||
$this->templateEngine = new PortableInfoboxMustacheEngine();
|
||||
$this->templateEngine = new PortableInfoboxTemplateEngine();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
19
templates/PortableInfoboxHorizontalGroupContent.hbs
Normal file
19
templates/PortableInfoboxHorizontalGroupContent.hbs
Normal file
|
@ -0,0 +1,19 @@
|
|||
<table class="pi-horizontal-group{{#unless renderLabels}} pi-horizontal-group-no-labels{{/unless}}">
|
||||
{{#if header}}<caption class="pi-header pi-secondary-font pi-secondary-background pi-item-spacing">{{{header}}}</caption>{{/if}}
|
||||
{{#if renderLabels}}
|
||||
<thead>
|
||||
<tr>
|
||||
{{#each labels}}
|
||||
<th class="pi-horizontal-group-item pi-data-label pi-secondary-font pi-border-color pi-item-spacing">{{{.}}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</thead>
|
||||
{{/if}}
|
||||
<tbody>
|
||||
<tr>
|
||||
{{#each values}}
|
||||
<td class="pi-horizontal-group-item pi-data-value pi-font pi-border-color pi-item-spacing">{{{.}}}</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,19 +0,0 @@
|
|||
<table class="pi-horizontal-group{{^renderLabels}} pi-horizontal-group-no-labels{{/renderLabels}}">
|
||||
{{#header}}<caption class="pi-header pi-secondary-font pi-secondary-background pi-item-spacing">{{{header}}}</caption>{{/header}}
|
||||
{{#renderLabels}}
|
||||
<thead>
|
||||
<tr>
|
||||
{{#labels}}
|
||||
<th class="pi-horizontal-group-item pi-data-label pi-secondary-font pi-border-color pi-item-spacing">{{{.}}}</th>
|
||||
{{/labels}}
|
||||
</tr>
|
||||
</thead>
|
||||
{{/renderLabels}}
|
||||
<tbody>
|
||||
<tr>
|
||||
{{#values}}
|
||||
<td class="pi-horizontal-group-item pi-data-value pi-font pi-border-color pi-item-spacing">{{{.}}}</td>
|
||||
{{/values}}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
6
templates/PortableInfoboxItemData.hbs
Normal file
6
templates/PortableInfoboxItemData.hbs
Normal file
|
@ -0,0 +1,6 @@
|
|||
<div class="pi-item pi-data pi-item-spacing pi-border-color{{#if cssClasses}} {{{cssClasses}}}{{/if}}"{{#if inlineStyles}} style="{{inlineStyles}}"{{/if}}>
|
||||
{{#if label}}
|
||||
<h3 class="pi-data-label pi-secondary-font">{{{label}}}</h3>
|
||||
{{/if}}
|
||||
<div class="pi-data-value pi-font">{{{value}}}</div>
|
||||
</div>
|
|
@ -1,6 +0,0 @@
|
|||
<div class="pi-item pi-data pi-item-spacing pi-border-color{{#cssClasses}} {{{cssClasses}}}{{/cssClasses}}"{{#inlineStyles}} style="{{inlineStyles}}"{{/inlineStyles}}>
|
||||
{{#label}}
|
||||
<h3 class="pi-data-label pi-secondary-font">{{{label}}}</h3>
|
||||
{{/label}}
|
||||
<div class="pi-data-value pi-font">{{{value}}}</div>
|
||||
</div>
|
1
templates/PortableInfoboxItemGroup.hbs
Normal file
1
templates/PortableInfoboxItemGroup.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
<section class="pi-item pi-group pi-border-color{{#if cssClasses}} {{{cssClasses}}}{{/if}}">{{{content}}}</section>
|
|
@ -1 +0,0 @@
|
|||
<section class="pi-item pi-group pi-border-color{{#cssClasses}} {{{cssClasses}}}{{/cssClasses}}">{{{content}}}</section>
|
1
templates/PortableInfoboxItemHeader.hbs
Normal file
1
templates/PortableInfoboxItemHeader.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
<h2 class="pi-item pi-header pi-secondary-font pi-item-spacing pi-secondary-background"{{#if inlineStyles}} style="{{inlineStyles}}"{{/if}}>{{{value}}}</h2>
|
|
@ -1 +0,0 @@
|
|||
<h2 class="pi-item pi-header pi-secondary-font pi-item-spacing pi-secondary-background"{{#inlineStyles}} style="{{inlineStyles}}"{{/inlineStyles}}>{{{value}}}</h2>
|
7
templates/PortableInfoboxItemImage.hbs
Normal file
7
templates/PortableInfoboxItemImage.hbs
Normal file
|
@ -0,0 +1,7 @@
|
|||
<figure class="pi-item pi-image{{#if isVideo}} pi-video{{/if}}">
|
||||
<a href="{{url}}" class="image image-thumbnail{{#isVideo}} video video-thumbnail{{/isVideo}}" title="{{alt}}">
|
||||
{{#unless isVideo}}<img src="{{thumbnail}}" srcset="{{thumbnail}} 1x, {{thumbnail2x}} 2x" class="pi-image-thumbnail" alt="{{alt}}" width="{{{width}}}" height="{{{height}}}"/>
|
||||
{{else}}<video src="{{url}}" class="pi-video-player" controls="true" controlsList="nodownload" preload="metadata">{{alt}}</video>{{/unless}}
|
||||
</a>
|
||||
{{#if caption}}<figcaption class="pi-item-spacing pi-caption">{{{caption}}}</figcaption>{{/if}}
|
||||
</figure>
|
|
@ -1,7 +0,0 @@
|
|||
<figure class="pi-item pi-image{{#isVideo}} pi-video{{/isVideo}}">
|
||||
<a href="{{url}}" class="image image-thumbnail{{#isVideo}} video video-thumbnail{{/isVideo}}" title="{{alt}}">
|
||||
{{^isVideo}}<img src="{{thumbnail}}" srcset="{{thumbnail}} 1x, {{thumbnail2x}} 2x" class="pi-image-thumbnail" alt="{{alt}}" width="{{{width}}}" height="{{{height}}}"/>{{/isVideo}}
|
||||
{{#isVideo}}<video src="{{url}}" class="pi-video-player" controls controlsList="nodownload" preload="metadata">{{alt}}</video>{{/isVideo}}
|
||||
</a>
|
||||
{{#caption}}<figcaption class="pi-item-spacing pi-caption">{{{caption}}}</figcaption>{{/caption}}
|
||||
</figure>
|
15
templates/PortableInfoboxItemImageCollection.hbs
Normal file
15
templates/PortableInfoboxItemImageCollection.hbs
Normal file
|
@ -0,0 +1,15 @@
|
|||
<div class="pi-image-collection">
|
||||
<ul class="pi-image-collection-tabs">
|
||||
{{#each images}}<li class="pi-tab-link pi-item-spacing{{#if isFirst}} current{{/if}}" data-pi-tab="pi-tab-{{ref}}">{{{caption}}}</li>{{/each}}
|
||||
</ul>
|
||||
{{#each images}}
|
||||
<div class="pi-image-collection-tab-content{{#if isFirst}} current{{/if}}" id="pi-tab-{{ref}}">
|
||||
<figure class="pi-item pi-image{{#if isVideo}} pi-video{{/if}}">
|
||||
<a href="{{url}}" class="image image-thumbnail{{#isVideo}} video video-thumbnail{{/isVideo}}" title="{{alt}}">
|
||||
{{#unless isVideo}}<img src="{{thumbnail}}" srcset="{{thumbnail}} 1x, {{thumbnail2x}} 2x" class="pi-image-thumbnail" alt="{{alt}}" width="{{{width}}}" height="{{{height}}}"/>
|
||||
{{else}}<video src="{{url}}" class="pi-video-player" controls="true" controlsList="nodownload" preload="metadata">{{alt}}</video>{{/unless}}
|
||||
</a>
|
||||
</figure>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
|
@ -1,11 +0,0 @@
|
|||
<div class="pi-image-collection">
|
||||
<ul class="pi-image-collection-tabs">
|
||||
{{#images}}<li class="pi-tab-link pi-item-spacing{{#isFirst}} current{{/isFirst}}" data-pi-tab="pi-tab-{{ref}}">{{{caption}}}</li>{{/images}}
|
||||
</ul>
|
||||
|
||||
{{#images}}
|
||||
<div class="pi-image-collection-tab-content{{#isFirst}} current{{/isFirst}}" id="pi-tab-{{ref}}">
|
||||
{{>PortableInfoboxItemImage}}
|
||||
</div>
|
||||
{{/images}}
|
||||
</div>
|
|
@ -1 +1 @@
|
|||
<nav class="pi-navigation pi-item-spacing pi-secondary-background pi-secondary-font">{{{value}}}</nav>
|
||||
<nav class="pi-navigation pi-item-spacing pi-secondary-background pi-secondary-font">{{{value}}}</nav>
|
|
@ -1,14 +1,14 @@
|
|||
<section class="pi-item pi-smart-group pi-border-color">
|
||||
{{#renderLabels}}
|
||||
{{#if renderLabels}}
|
||||
<section class="pi-smart-group-head">
|
||||
{{#labels}}
|
||||
{{#each labels}}
|
||||
<h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="{{{inlineStyles}}}">{{{value}}}</h3>
|
||||
{{/labels}}
|
||||
{{/each}}
|
||||
</section>
|
||||
{{/renderLabels}}
|
||||
{{/if}}
|
||||
<section class="pi-smart-group-body">
|
||||
{{#values}}
|
||||
{{#each values}}
|
||||
<div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="{{{inlineStyles}}}">{{{value}}}</div>
|
||||
{{/values}}
|
||||
{{/each}}
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
1
templates/PortableInfoboxItemTitle.hbs
Normal file
1
templates/PortableInfoboxItemTitle.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
<h2 class="pi-item pi-item-spacing pi-title"{{#if inlineStyles}} style="{{inlineStyles}}"{{/if}}>{{{value}}}</h2>
|
|
@ -1 +0,0 @@
|
|||
<h2 class="pi-item pi-item-spacing pi-title"{{#inlineStyles}} style="{{inlineStyles}}"{{/inlineStyles}}>{{{value}}}</h2>
|
|
@ -1,18 +1,18 @@
|
|||
<p class="pi-error-info">{{info}}</p>
|
||||
<ul class="pi-debug">
|
||||
{{#code}}
|
||||
{{#each code}}
|
||||
<li>
|
||||
<div class="pi-debug-line{{#error}} error{{/error}}">
|
||||
<div class="pi-debug-line{{#if error}} error{{/if}}">
|
||||
<div class="pi-debug-line-number">{{line}}</div>
|
||||
<div class="pi-debug-line-code">{{codeLine}}</div>
|
||||
</div>
|
||||
{{#error}}
|
||||
{{#if error}}
|
||||
<div class="pi-debug-error-message">
|
||||
{{#error_messages}}
|
||||
{{#each error_messages}}
|
||||
<p class="pi-debug-error-message-item">{{{message}}}</p>
|
||||
{{/error_messages}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/error}}
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/code}}
|
||||
</ul>
|
||||
{{/each}}
|
||||
</ul>
|
1
templates/PortableInfoboxWrapper.hbs
Normal file
1
templates/PortableInfoboxWrapper.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
<aside class="portable-infobox pi-background{{#if theme}} {{theme}}{{/if}}{{#if layout}} {{layout}}{{/if}}">{{{content}}}</aside>
|
|
@ -1 +0,0 @@
|
|||
<aside class="portable-infobox pi-background{{#theme}} {{theme}}{{/theme}}{{#layout}} {{layout}}{{/layout}}">{{{content}}}</aside>
|
Loading…
Reference in a new issue