Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
81f6cb2
- base
EwelinaSkrzypacz Jun 24, 2025
5f04020
- base
EwelinaSkrzypacz Jun 24, 2025
dc5d371
- hero section
EwelinaSkrzypacz Jun 25, 2025
ac87b5d
- intro section
EwelinaSkrzypacz Jun 25, 2025
f824867
- our solutions section
EwelinaSkrzypacz Jun 25, 2025
f3b2021
- our solutions section
EwelinaSkrzypacz Jun 26, 2025
7a2c331
- our solutions section
EwelinaSkrzypacz Jun 26, 2025
1a5ca12
- for who we work
EwelinaSkrzypacz Jun 26, 2025
f1cdb81
- for who we work
EwelinaSkrzypacz Jun 26, 2025
1ced38f
- security section
EwelinaSkrzypacz Jun 26, 2025
4d9cf72
- add plus icons to section
EwelinaSkrzypacz Jun 26, 2025
494942b
- working on contact form - frontend
EwelinaSkrzypacz Jun 26, 2025
610a370
- working on contact form - frontend
EwelinaSkrzypacz Jun 27, 2025
751a0e9
- change naming
EwelinaSkrzypacz Jun 27, 2025
cdb8987
- hero, challenges and features sections and translations
EwelinaSkrzypacz Jun 27, 2025
ac792e5
- benefits section
EwelinaSkrzypacz Jun 27, 2025
53563f2
- image section
EwelinaSkrzypacz Jun 27, 2025
c879917
- working on security section
EwelinaSkrzypacz Jun 27, 2025
2e3d6e0
- scientific publication section
EwelinaSkrzypacz Jun 30, 2025
8b7bb25
- scientific publication section
EwelinaSkrzypacz Jun 30, 2025
6177583
- k1 landing page almost done
EwelinaSkrzypacz Jun 30, 2025
ca76307
- k1 fix to challenges section
EwelinaSkrzypacz Jul 1, 2025
10cdfda
- k1 fix to challenges section
EwelinaSkrzypacz Jul 1, 2025
f9b191f
- add translations
EwelinaSkrzypacz Jul 1, 2025
ec56203
- adjust mobile menu; adjust links in menu
EwelinaSkrzypacz Jul 1, 2025
456ec3a
- mobile fixes
EwelinaSkrzypacz Jul 1, 2025
58a13c7
- add backend for contact form; add telescope
EwelinaSkrzypacz Jul 2, 2025
d60ffcf
- add meta titles and descriptions
EwelinaSkrzypacz Jul 2, 2025
3261836
- contrast fixes
EwelinaSkrzypacz Jul 2, 2025
16f4853
- navigation fix
EwelinaSkrzypacz Jul 2, 2025
1ed6009
- csf
EwelinaSkrzypacz Jul 2, 2025
115c7c6
- remove telescope
EwelinaSkrzypacz Jul 2, 2025
09a8e78
- add toast when a message is sent
EwelinaSkrzypacz Jul 3, 2025
d34538a
- working on accessibility
EwelinaSkrzypacz Jul 3, 2025
8c31866
- add subdomain to staging docker
EwelinaSkrzypacz Jul 3, 2025
e29bdfa
- csf
EwelinaSkrzypacz Jul 3, 2025
0bc8896
- remove middleware authelia@file in docker-compose.beta.yml
Blusia Jul 3, 2025
1c5f744
- improve accessibility
EwelinaSkrzypacz Jul 3, 2025
4bcddfa
- cr fixes
EwelinaSkrzypacz Jul 3, 2025
5a09aaf
- cr fixes
EwelinaSkrzypacz Jul 3, 2025
187334c
- cr fixes
EwelinaSkrzypacz Jul 3, 2025
62a4171
- cr fixes
EwelinaSkrzypacz Jul 4, 2025
cd8f9e9
- cr fixes
EwelinaSkrzypacz Jul 7, 2025
6526e56
- cr fixes
EwelinaSkrzypacz Jul 8, 2025
2fdd838
- cr fixes
EwelinaSkrzypacz Jul 8, 2025
96546e7
- cr fixes
EwelinaSkrzypacz Jul 8, 2025
0aa4040
- cr fixes
EwelinaSkrzypacz Jul 9, 2025
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 app/DTOs/EdulandingContactFormResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\DTOs;

use Blumilk\Website\Models\EdulandingContactForm;

class EdulandingContactFormResponse
{
public function __construct(
public string $subject,
public string $response,
public string $messageDescription,
public string $locale,
) {}

public static function fromArray(EdulandingContactForm $record, array $data): self
{
return new self(
subject: $data["responseTopic"],
response: $data["response"],
messageDescription: $record->message,
locale: $record->lang,
);
}
}
143 changes: 143 additions & 0 deletions app/Filament/Resources/EdulandingContactFormResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Filament\Resources;

use Blumilk\Website\Enums\ContactFormStatus;
use Blumilk\Website\Enums\DateFormats;
use Blumilk\Website\Filament\Resources\EdulandingContactFormResource\Actions\RespondToEdulandingContactFormMessageAction;
use Blumilk\Website\Filament\Resources\EdulandingContactFormResource\Pages;
use Blumilk\Website\Models\EdulandingContactForm;
use Exception;
use Filament\Forms;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Split;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Filters\Filter;
use Filament\Tables\Filters\SelectFilter;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;

class EdulandingContactFormResource extends Resource
{
protected static ?string $model = EdulandingContactForm::class;
protected static ?string $label = "wiadomość z edulandingu";
protected static ?string $pluralLabel = "Wiadomości - edulanding";
protected static ?string $navigationIcon = "heroicon-o-envelope-open";
protected static bool $hasTitleCaseModelLabel = false;

public static function form(Form $form): Form
{
return $form
->schema([
Split::make([
Section::make([
Forms\Components\TextInput::make("email")
->label("E-mail")
->disabled(),
Forms\Components\Select::make("status")
->label("Status")
->options(ContactFormStatus::class)
->required(),
]),
Section::make([
Forms\Components\TextInput::make("full_name")
->label("Imię i nazwisko")
->disabled(),
Forms\Components\TextInput::make("company_name")
->label("Nazwa firmy")
->disabled(),
Forms\Components\Textarea::make("message")
->rows(4)
->label("Wiadomość")
->disabled(),
Forms\Components\RichEditor::make("response")
->label("Odpowiedź")
->disableToolbarButtons(["attachFiles"])
->maxLength(65000)
->disabled()
->visible(fn($record): bool => $record->status === ContactFormStatus::Responded),
]),
])->from("lg"),
])->columns(1);
}

/**
* @throws Exception
*/
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make("email")
->label("E-mail")
->searchable(),
Tables\Columns\TextColumn::make("status")
->badge()
->colors([
"warning" => static fn($state): bool => $state === ContactFormStatus::Read,
"danger" => static fn($state): bool => $state === ContactFormStatus::Unread,
"success" => static fn($state): bool => $state === ContactFormStatus::Responded,
])
->label("Status"),
Tables\Columns\TextColumn::make("created_at")
->date(DateFormats::DATE_DISPLAY)
->label("Data kontaktu")
->sortable(),
])->defaultSort("created_at", "desc")
->filters([
Filter::make("published_at")
->form([
Forms\Components\DatePicker::make("created_from")
->label("Data od")
->format(DateFormats::DATE_DISPLAY),
Forms\Components\DatePicker::make("created_to")
->label("Data do")
->format(DateFormats::DATE_DISPLAY),
])->query(fn(Builder $query, array $data): Builder => $query
->when(
$data["created_from"],
fn(Builder $query, $date): Builder => $query->whereDate("created_at", ">=", $date),
)
->when(
$data["created_to"],
fn(Builder $query, $date): Builder => $query->whereDate("created_at", "<=", $date),
)),
SelectFilter::make("status")
->label("Status wiadomości")
->options(ContactFormStatus::class),
])
->actions([
Tables\Actions\ViewAction::make(),
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make()->visible(fn($record): bool => $record->status !== ContactFormStatus::Responded),
RespondToEdulandingContactFormMessageAction::make("respond"),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}

public static function getNavigationBadge(): string
{
return (string)static::$model::where("status", ContactFormStatus::Unread)->count();
}

public static function getPages(): array
{
return [
"index" => Pages\ListEdulandingContactForm::route("/"),
"edit" => Pages\EditEdulandingContactForm::route("/{record}/edit"),
];
}

public static function canCreate(): bool
{
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Filament\Resources\EdulandingContactFormResource\Actions;

use Blumilk\Website\DTOs\EdulandingContactFormResponse;
use Blumilk\Website\Enums\ContactFormStatus;
use Blumilk\Website\Mail\EdulandingContactFormResponded;
use Blumilk\Website\Models\EdulandingContactForm;
use Filament\Forms;
use Filament\Notifications\Notification;
use Filament\Tables\Actions\Action;
use Illuminate\Support\Facades\Mail;

class RespondToEdulandingContactFormMessageAction extends Action
{
protected function setUp(): void
{
parent::setUp();

$this->label("Odpowiedz")
->icon("heroicon-m-envelope")
->color("success")
->visible(fn($record): bool => $record->status !== ContactFormStatus::Responded)
->form([
Forms\Components\Section::make([
Forms\Components\TextInput::make("email")
->label("E-mail")
->disabled()
->default(fn($record) => $record->email),
Forms\Components\TextInput::make("full_name")
->label("Imię i nazwisko")
->disabled()
->default(fn($record) => $record->full_name),
Forms\Components\TextInput::make("company_name")
->label("Nazwa firmy")
->disabled()
->default(fn($record) => $record->company_name),
Forms\Components\Textarea::make("message")
->label("Wiadomość")
->default(fn($record) => $record->message)
->disabled(),
]),
Forms\Components\TextInput::make("responseTopic")
->label("Tytuł odpowiedzi")
->default(fn($record) => "Re: " . $record->company_name),
Forms\Components\RichEditor::make("response")
->label("Odpowiedź")
->disableToolbarButtons(["attachFiles", "codeBlock", "blockquote"])
->maxLength(65000)
->required(),
])
->action(function (EdulandingContactForm $record, array $data): void {
app()->setLocale($record->lang);

$details = EdulandingContactFormResponse::fromArray($record, $data);

Mail::to($record->email)->send(new EdulandingContactFormResponded($details));

$record->update([
"response" => $details->response,
"status" => ContactFormStatus::Responded,
]);

Notification::make()
->title("Sukces")
->body("E-mail został pomyślnie wysłany.")
->success()
->send();
})
->modalHeading("Wyślij odpowiedź na e-mail")
->modalButton("Wyślij e-mail");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Filament\Resources\EdulandingContactFormResource\Pages;

use Blumilk\Website\Enums\ContactFormStatus;
use Blumilk\Website\Filament\Resources\BaseResource\Pages\BaseEditRecord;
use Blumilk\Website\Filament\Resources\EdulandingContactFormResource;
use Filament\Actions;

class EditEdulandingContactForm extends BaseEditRecord
{
protected static string $resource = EdulandingContactFormResource::class;

protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make()->visible(fn($record): bool => $record->status !== ContactFormStatus::Responded),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Filament\Resources\EdulandingContactFormResource\Pages;

use Blumilk\Website\Filament\Resources\BaseResource\Pages\BaseListRecord;
use Blumilk\Website\Filament\Resources\EdulandingContactFormResource;

class ListEdulandingContactForm extends BaseListRecord
{
protected static string $resource = EdulandingContactFormResource::class;
}
19 changes: 19 additions & 0 deletions app/Http/Controllers/EdulandingContactController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Controllers;

use Blumilk\Website\Http\Requests\EdulandingStoreRequest;
use Blumilk\Website\Models\EdulandingContactForm;
use Illuminate\Http\RedirectResponse;

class EdulandingContactController extends Controller
{
public function store(EdulandingStoreRequest $request): RedirectResponse
{
EdulandingContactForm::create($request->getData());

return redirect()->back()->with(["success" => __("toast.contact.success")])->withFragment("contact");
}
}
18 changes: 18 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,22 @@ public function __invoke(Request $request, Factory $factory): View
->with("references", $references)
->with("clients", $clients);
}

public function eduLanding(): View
{
return view("edulanding/edulanding");
}

public function eduLandingErasmus(): View
{
return view("edulanding/edulanding-erasmus");
}

public function eduLandingK1(): View
{
$locale = app()->getLocale();

return view("edulanding/edulanding-k1")
->with("locale", $locale);
}
}
42 changes: 42 additions & 0 deletions app/Http/Requests/EdulandingStoreRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

declare(strict_types=1);

namespace Blumilk\Website\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class EdulandingStoreRequest extends FormRequest
{
private const string EMAIL_PATTERN = "regex:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/";

public function rules(): array
{
return [
"email" => ["required", "email", "string", "max:255", self::EMAIL_PATTERN],
"full_name" => ["required", "string", "max:255"],
"company_name" => ["required", "string", "max:255"],
"message" => ["required", "string", "max:65000"],
"consents" => ["accepted"],
"g-recaptcha-response" => "required|recaptchav3:contact,0.5",
];
}

public function getData(): array
{
return [
"email" => mb_convert_encoding($this->get("email"), "UTF-8", "auto"),
"full_name" => mb_convert_encoding($this->get("full_name"), "UTF-8", "auto"),
"company_name" => mb_convert_encoding($this->get("company_name"), "UTF-8", "auto"),
"message" => mb_convert_encoding($this->get("message"), "UTF-8", "auto"),
"lang" => app()->getLocale(),
];
}

protected function getRedirectUrl(): string
{
$url = parent::getRedirectUrl();

return $url . "#contact";
}
}
Loading
Loading