-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86b0128
commit 2f34f50
Showing
14 changed files
with
179 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Keating\DTOs; | ||
|
||
use Keating\Models\ContactInfo; | ||
|
||
readonly class ContactInfoData | ||
{ | ||
public function __construct( | ||
public string $label, | ||
public string $identifier, | ||
) {} | ||
|
||
public static function fromModel(ContactInfo $contactInfo): self | ||
{ | ||
return new self( | ||
label: $contactInfo->label, | ||
identifier: $contactInfo->identifier, | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Keating\Http\Controllers\Public; | ||
|
||
use Inertia\Response; | ||
use Keating\DTOs\ContactInfoData; | ||
use Keating\Models\ContactInfo; | ||
use Keating\Models\Setting; | ||
|
||
class ContactController | ||
{ | ||
public function __invoke(): Response | ||
{ | ||
/** @var Setting $settings */ | ||
$settings = Setting::query()->first(); | ||
$contactInfos = ContactInfo::query()->get(); | ||
|
||
return inertia("Public/Contact", [ | ||
"title" => $settings->teacher_titles, | ||
"name" => $settings->teacher_name, | ||
"email" => $settings->teacher_email, | ||
"department" => $settings->department_name, | ||
"university" => $settings->university_name, | ||
"universityLogo" => asset("cwup-full.png"), | ||
"contactInfos" => $contactInfos->map(fn(ContactInfo $contactInfo): ContactInfoData => ContactInfoData::fromModel($contactInfo)), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
database/migrations/2024_08_28_073139_remove_icon_field_from_contact_infos_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration { | ||
public function up(): void | ||
{ | ||
Schema::table("contact_infos", function (Blueprint $table): void { | ||
$table->dropColumn("icon"); | ||
}); | ||
} | ||
|
||
public function down(): void | ||
{ | ||
Schema::table("contact_infos", function (Blueprint $table): void { | ||
$table->string("icon")->nullable(); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<script setup> | ||
import PublicLayout from '@/Layouts/PublicLayout.vue' | ||
import BackgroundGrid from '@/Components/BackgroundGrid.vue' | ||
import SectionHeader from '@/Components/SectionHeader.vue' | ||
import { Head } from '@inertiajs/inertia-vue3' | ||
import ContactItem from '@/Shared/Components/ContactItem.vue' | ||
import { NoSymbolIcon } from '@heroicons/vue/24/outline' | ||
defineProps({ | ||
title: String, | ||
name: String, | ||
email: String, | ||
department: String, | ||
university: String, | ||
universityLogo: String, | ||
sectionSettings: Object, | ||
about: Array, | ||
counters: Array, | ||
contactInfos: Array, | ||
}) | ||
</script> | ||
|
||
<template> | ||
<Head title="Kontakt" /> | ||
|
||
<PublicLayout> | ||
<div class="relative isolate bg-white"> | ||
<BackgroundGrid /> | ||
<div class="py-24 sm:py-32"> | ||
<div class="mx-auto max-w-7xl px-6 lg:px-8"> | ||
<SectionHeader> | ||
<template #header> | ||
Kontakt | ||
</template> | ||
<template #subheader> | ||
Informacje kontaktowe. | ||
</template> | ||
</SectionHeader> | ||
<img src="/cwup.png" alt="" class="pointer-events-none absolute right-0 z-0 hidden w-1/2 opacity-10 lg:mt-16 lg:block xl:mt-10 2xl:mt-0"> | ||
<div class="mx-auto mt-10 border-t border-gray-200 pt-10 sm:mt-16 sm:pt-16 lg:mx-0 lg:max-w-none lg:grid-cols-3"> | ||
<div class="mx-auto max-w-7xl text-center lg:mx-0 lg:flex-auto "> | ||
<div v-if="email" class="mx-auto max-w-2xl py-6 text-left lg:mx-0 xl:py-3"> | ||
<label class="text-sm"> | ||
</label> | ||
<a :href="'mailto:' + email" | ||
class="flex w-full items-center text-center text-xl font-bold tracking-tight text-gray-900 sm:text-2xl" | ||
> | ||
{{ email.split('@')[0] }} | ||
<span class="font-normal">@{{ email.split('@')[1] }}</span> | ||
</a> | ||
</div> | ||
<div v-for="(contactInfo, index) in contactInfos" :key="index" class="mx-auto flex max-w-2xl py-6 lg:mx-0 xl:py-3"> | ||
<ContactItem :contact="contactInfo" /> | ||
</div> | ||
|
||
<div v-if="!email && contactInfos.length === 0" class="text-center"> | ||
<NoSymbolIcon class="mx-auto size-12 text-gray-400" /> | ||
<h3 class="mt-2 text-sm font-semibold text-gray-900"> | ||
Brak danych kontaktowych | ||
</h3> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</PublicLayout> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script setup> | ||
defineProps({ | ||
contact: Object, | ||
}) | ||
const isMailable = (contact) => { | ||
return contact.identifier.includes('@') | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="text-left"> | ||
<label class="text-sm"> | ||
{{ contact.label }} | ||
</label> | ||
<a v-if="isMailable(contact)" | ||
:href="'mailto:' + contact.identifier" | ||
class="flex w-full items-center justify-center text-center text-xl font-bold tracking-tight text-gray-900 sm:text-2xl" | ||
> | ||
{{ contact.identifier }} | ||
</a> | ||
<a v-else | ||
:href="contact.identifier" | ||
class="flex w-full items-center justify-center text-center text-xl font-bold tracking-tight text-gray-900 sm:text-2xl" | ||
> | ||
{{ contact.identifier }} | ||
</a> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters