Browse Source

Fix conditional and enhance OpeningHours (#66)

Co-authored-by: Daniel Siepmann <coding@daniel-siepmann.de>
pull/67/head
Carlos Pozo 3 months ago committed by GitHub
parent
commit
62b2c5d0c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      Resources/Private/Partials/Frontend/ContentElement/Opening.html
  2. 4
      Resources/Private/Templates/Frontend/ContentElement/TouristAttraction.html
  3. 24
      Tests/Functional/FrontendTest.php

9
Resources/Private/Partials/Frontend/ContentElement/Opening.html

@ -13,11 +13,14 @@
{openingHour.from -> f:format.date(format: 'd.m.Y')} -
{openingHour.through -> f:format.date(format: 'd.m.Y')}
</h3>
<p>
<div>
<f:for each="{openingHour.daysOfWeekWithMondayFirstWeekDay}" as="weekday">
{f:translate(id: 'content.openingHour.weekday.{weekday}', default: weekday, extensionName: 'Thuecat')} {openingHour.opens} - {openingHour.closes}<br>
<div class="day-row">
<div class="day"><span>{f:translate(id: 'content.openingHour.weekday.{weekday}', default: weekday, extensionName: 'Thuecat')}</span></div>
<div class="time"><span>{openingHour.opens} - {openingHour.closes}</span></div>
</div>
</f:for>
</p>
</div>
</div>
</f:for>
</div>

4
Resources/Private/Templates/Frontend/ContentElement/TouristAttraction.html

@ -74,9 +74,7 @@
|| entity.sanitation || entity.photography || entity.startOfConstruction || entity.architecturalStyles}"
>
<div class="col-md-6">
<f:if condition="{entity.generalInformation}">
<h2>{f:translate(id: 'content.generalInformation', extensionName: 'Thuecat')}</h2>
</f:if>
<h2>{f:translate(id: 'content.generalInformation', extensionName: 'Thuecat')}</h2>
<p>
<f:if condition="{entity.otherServices}">
{f:render(partial: 'Service', arguments: {otherServices: entity.otherServices})}

24
Tests/Functional/FrontendTest.php

@ -82,14 +82,22 @@ class FrontendTest extends FunctionalTestCase
self::assertStringContainsString('example@example.com', (string)$result->getBody());
self::assertStringContainsString('(0)30 23125 000', (string)$result->getBody());
self::assertStringContainsString('Montag: 09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Dienstag: 09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Mittwoch: 09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Donnerstag: 09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Freitag: 09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Samstag: 09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Sonntag: 13:00:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Feiertags: 13:00:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Montag:', (string)$result->getBody());
self::assertStringContainsString('09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Dienstag:', (string)$result->getBody());
self::assertStringContainsString('09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Mittwoch:', (string)$result->getBody());
self::assertStringContainsString('09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Donnerstag:', (string)$result->getBody());
self::assertStringContainsString('09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Freitag:', (string)$result->getBody());
self::assertStringContainsString('09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Samstag:', (string)$result->getBody());
self::assertStringContainsString('09:30:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Sonntag:', (string)$result->getBody());
self::assertStringContainsString('13:00:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Feiertags:', (string)$result->getBody());
self::assertStringContainsString('13:00:00 - 17:00:00', (string)$result->getBody());
self::assertStringContainsString('Führungen', (string)$result->getBody());
self::assertStringContainsString('(Führung)', (string)$result->getBody());

Loading…
Cancel
Save