Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/UI/Implementation/Component/Item/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ protected function renderShy(Shy $component, RendererInterface $default_renderer
$value = htmlentities($value);
}
$tpl->setCurrentBlock("property_row");
$tpl->setVariable("PROP_NAME_A", $name);
$tpl->setVariable("PROP_VAL_A", $value);
$tpl->setVariable("PROP_NAME", $name);
$tpl->setVariable("PROP_VAL", $value);
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("properties");
Expand Down Expand Up @@ -338,19 +338,15 @@ protected function renderProperties(Item $component, RendererInterface $default_
//should introduce here htmlentities
$value = $value;
}
$cnt++;
if ($cnt % 2 == 1) {
$tpl->setCurrentBlock("property_cell");
$tpl->setVariable("PROP_NAME", $name);
$tpl->setVariable("PROP_VAL", $value);
$tpl->parseCurrentBlock();
if ($cnt % 2 === 1 || array_key_last($props) === $name) {
$tpl->setCurrentBlock("property_row");
$tpl->setVariable("PROP_NAME_A", $name);
$tpl->setVariable("PROP_VAL_A", $value);
} else {
$tpl->setVariable("PROP_NAME_B", $name);
$tpl->setVariable("PROP_VAL_B", $value);
$tpl->parseCurrentBlock();
}
}
if ($cnt % 2 == 1) {
$tpl->parseCurrentBlock();
$cnt++;
}
$tpl->setCurrentBlock("properties");
$tpl->parseCurrentBlock();
Expand Down
9 changes: 4 additions & 5 deletions src/UI/templates/default/Item/tpl.item_notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ <h4 class="il-item-notification-title">{TITLE}</h4>
<hr class="il-item-divider">
<!-- BEGIN property_row -->
<div class="row il-item-properties">
<!-- BEGIN property_cell -->
<div class="col-sm-12 il-multi-line-cap-3">
<span class="il-item-property-name">{PROP_NAME_A}</span><span class="il-item-property-value">{PROP_VAL_A}</span>
</div>
<div class="col-sm-12 il-multi-line-cap-3">
<span class="il-item-property-name">{PROP_NAME_B}</span><span class="il-item-property-value">{PROP_VAL_B}</span>
<span class="il-item-property-name">{PROP_NAME}</span><span class="il-item-property-value">{PROP_VAL}</span>
</div>
<!-- END property_cell -->
</div>
<!-- END property_row -->
<!-- END properties -->
Expand All @@ -37,4 +36,4 @@ <h4 class="il-item-notification-title">{TITLE}</h4>
</div>
</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions src/UI/templates/default/Item/tpl.item_shy.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<hr class="il-item-divider" />
<!-- BEGIN property_row -->
<div class="il-item-properties">
<div class="il-item-property-name">{PROP_NAME_A}</div>
<div class="il-item-property-value">{PROP_VAL_A}</div>
<div class="il-item-property-name">{PROP_NAME}</div>
<div class="il-item-property-value">{PROP_VAL}</div>
</div>
<!-- END property_row -->
<!-- END properties -->
Expand Down
9 changes: 4 additions & 5 deletions src/UI/templates/default/Item/tpl.item_standard.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ <h4 class="il-item-title">{TITLE}</h4>
<hr class="il-item-divider" />
<!-- BEGIN property_row -->
<div class="row">
<!-- BEGIN property_cell -->
<div class="col-md-6 il-multi-line-cap-3">
<span class="il-item-property-name">{PROP_NAME_A}</span><span class="il-item-property-value">{PROP_VAL_A}</span>
</div>
<div class="col-md-6 il-multi-line-cap-3">
<span class="il-item-property-name">{PROP_NAME_B}</span><span class="il-item-property-value">{PROP_VAL_B}</span>
<span class="il-item-property-name">{PROP_NAME}</span><span class="il-item-property-value">{PROP_VAL}</span>
</div>
<!-- END property_cell -->
</div>
<!-- END property_row -->
<!-- END properties -->
Expand All @@ -72,4 +71,4 @@ <h4 class="il-item-title">{TITLE}</h4>
<!-- BEGIN lead_end -->
</div>
</div><!-- END lead_end -->
</div>
</div>
3 changes: 0 additions & 3 deletions tests/UI/Component/Item/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ public function testRenderBase(): void
<div class="col-md-6 il-multi-line-cap-3">
<span class="il-item-property-name">Location</span><span class="il-item-property-value">Room 123, Main Street 44, 3012 Bern</span>
</div>
<div class="col-md-6 il-multi-line-cap-3">
<span class="il-item-property-name"></span><span class="il-item-property-value"></span>
</div>
</div>
</div>
EOT;
Expand Down