Skip to content
Merged
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
27 changes: 27 additions & 0 deletions lang/en/support_lines.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

return [
'title' => 'Support lines',
'lines' => [
'119' => [
'number' => '119',
'name' => 'DGASPC',
'detail' => 'Free, 24/7 — abuse, neglect, exploitation, and trafficking of minors',
],
'116111' => [
'number' => '116 111',
'name' => 'Child Helpline',
'detail' => 'Free',
],
'anitp' => [
'number' => '0800 800 678',
'name' => 'ANITP Green Line',
'detail' => 'Free',
],
'112' => [
'number' => '112',
'name' => 'Emergencies',
'detail' => 'Immediate danger',
],
],
];
27 changes: 27 additions & 0 deletions lang/ro/support_lines.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

return [
'title' => 'Linii de sprijin',
'lines' => [
'119' => [
'number' => '119',
'name' => 'DGASPC',
'detail' => 'Gratuit, 24/7 — abuz, neglijare, exploatare și trafic de minori',
],
'116111' => [
'number' => '116 111',
'name' => 'Telefonul Copilului',
'detail' => 'Gratuit',
],
'anitp' => [
'number' => '0800 800 678',
'name' => 'Linia Verde ANITP',
'detail' => 'Gratuit',
],
'112' => [
'number' => '112',
'name' => 'Urgențe',
'detail' => 'Pericol imediat',
],
],
];
16 changes: 16 additions & 0 deletions resources/views/components/support-lines.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<x-ui.card data-support-lines class="p-8">
<h2 class="text-2xl font-bold text-navy mb-5">{{ __('support_lines.title') }}</h2>
<ul class="space-y-4">
@foreach (['119', '116111', 'anitp', '112'] as $line)
<li class="flex flex-col gap-1 sm:flex-row sm:items-baseline sm:gap-4">
<a href="tel:{{ str_replace(' ', '', __('support_lines.lines.'.$line.'.number')) }}" class="text-lg font-bold text-primary hover:text-navy shrink-0">
{{ __('support_lines.lines.'.$line.'.number') }}
</a>
<div>
<p class="font-semibold text-navy">{{ __('support_lines.lines.'.$line.'.name') }}</p>
<p class="text-sm text-muted">{{ __('support_lines.lines.'.$line.'.detail') }}</p>
</div>
</li>
@endforeach
</ul>
</x-ui.card>
2 changes: 2 additions & 0 deletions resources/views/pages/⚡about.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
{{ __('about.notice_body') }}
</x-ui.alert>

<x-support-lines />

<section class="rounded-xl bg-accent p-8 text-center text-white">
<h2 class="text-2xl font-bold">{{ __('about.cta_title') }}</h2>
<p class="mt-3 mb-6">{{ __('about.cta_body') }}</p>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/pages/⚡contact.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public function organizationKeys(): array
<x-page-header :title="__('contact.title')" :subtitle="__('contact.subtitle')" />

<main class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12 space-y-6">
<x-support-lines />

@foreach ($this->organizationKeys() as $key)
<x-ui.card wire:key="contact-{{ $key }}" class="p-8">
<h2 class="text-2xl font-bold text-navy mb-4">{{ __("contact.organizations.$key.name") }}</h2>
Expand Down
5 changes: 5 additions & 0 deletions resources/views/pages/⚡home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public function featuredResources(): Collection
</div>
</section>

<section class="pb-4 bg-background">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<x-support-lines />
</div>
</section>

{{-- Featured resources --}}
<section class="py-16 bg-background">
Expand Down
20 changes: 20 additions & 0 deletions tests/Feature/SupportLinesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

test('support lines appear on the home, about, and contact pages', function () {
$home = $this->get('/ro')->assertSuccessful()->getContent();
$about = $this->get('/ro/about')->assertSuccessful()->getContent();
$contact = $this->get('/ro/contact')->assertSuccessful()->getContent();

foreach ([$home, $about, $contact] as $html) {
expect($html)
->toContain('Linii de sprijin')
->toContain('data-support-lines')
->toContain('0800 800 678')
->toContain('116 111')
->toContain('Telefonul Copilului');
}

expect(strpos($home, 'Linii de sprijin'))->toBeLessThan(strpos($home, __('home.featured_title', [], 'ro')))
->and(strpos($about, __('about.notice_title', [], 'ro')))->toBeLessThan(strpos($about, 'Linii de sprijin'))
->and(strpos($contact, 'Linii de sprijin'))->toBeLessThan(strpos($contact, __('contact.organizations.anitp.name', [], 'ro')));
});
Loading