Fix conditional and enhance OpeningHours (#66)

Co-authored-by: Daniel Siepmann <coding@daniel-siepmann.de>
This commit is contained in:
Carlos Pozo 2022-04-11 16:16:51 +02:00 committed by GitHub
parent 2de3a752cb
commit 62b2c5d0c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 14 deletions

View file

@ -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>

View file

@ -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})}

View file

@ -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());