From 54964d54d471a06d3a98209ab3ff15e83fbbbaeb Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 5 Nov 2025 08:59:05 +0100 Subject: [PATCH] fix: clean up utility classes and improve readability in Blade templates --- resources/css/utilities.css | 6 +- resources/views/layouts/app.blade.php | 25 +- resources/views/layouts/base.blade.php | 422 +++++++++--------- .../project/application/general.blade.php | 80 ++-- 4 files changed, 259 insertions(+), 274 deletions(-) diff --git a/resources/css/utilities.css b/resources/css/utilities.css index f5d173204..5d8a6bfa1 100644 --- a/resources/css/utilities.css +++ b/resources/css/utilities.css @@ -124,7 +124,7 @@ @utility menu { } @utility menu-item { - @apply flex gap-3 items-center px-2 py-1 w-full text-sm sm:pr-0 dark:hover:bg-coolgray-100 dark:hover:text-white hover:bg-neutral-300 min-w-fit sm:min-w-64 text-black dark:text-neutral-400; + @apply flex gap-3 items-center px-2 py-1 w-full text-sm sm:pr-0 dark:hover:bg-coolgray-100 dark:hover:text-white hover:bg-neutral-300 min-w-fit sm:min-w-64; } @utility menu-item-active { @@ -152,7 +152,7 @@ @utility custom-modal { } @utility navbar-main { - @apply flex flex-col gap-4 justify-items-start pb-2 border-b-2 border-solid h-fit md:flex-row sm:justify-between dark:border-coolgray-200 border-neutral-200 md:items-center; + @apply flex flex-col gap-4 justify-items-start pb-2 border-b-2 border-solid h-fit md:flex-row sm:justify-between dark:border-coolgray-200 border-neutral-200 md:items-center text-neutral-700 dark:text-neutral-400; } @utility loading { @@ -220,7 +220,7 @@ @utility title { } @utility subtitle { - @apply pt-2 pb-9 text-neutral-500 dark:text-neutral-400; + @apply pt-2 pb-9; } @utility fullscreen { diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 01a128bd2..fae2e1b6d 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -9,16 +9,15 @@ @auth
+ open: false, + init() { + this.pageWidth = localStorage.getItem('pageWidth'); + if (!this.pageWidth) { + this.pageWidth = 'full'; + localStorage.setItem('pageWidth', 'full'); + } + } + }" x-cloak class="mx-auto" :class="pageWidth === 'full' ? '' : 'max-w-7xl'"> @endauth -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php index 0bb7a3c34..c577f7248 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/layouts/base.blade.php @@ -2,7 +2,7 @@ - + } + }) + window.Livewire.on('info', (message) => { + if (typeof message === 'string') { + window.toast('Info', { + type: 'info', + description: message, + }) + return; + } + if (message.length == 1) { + window.toast('Info', { + type: 'info', + description: message[0], + }) + } else if (message.length == 2) { + window.toast(message[0], { + type: 'info', + description: message[1], + }) + } + }) + window.Livewire.on('error', (message) => { + if (typeof message === 'string') { + window.toast('Error', { + type: 'danger', + description: message, + }) + return; + } + if (message.length == 1) { + window.toast('Error', { + type: 'danger', + description: message[0], + }) + } else if (message.length == 2) { + window.toast(message[0], { + type: 'danger', + description: message[1], + }) + } + }) + window.Livewire.on('warning', (message) => { + if (typeof message === 'string') { + window.toast('Warning', { + type: 'warning', + description: message, + }) + return; + } + if (message.length == 1) { + window.toast('Warning', { + type: 'warning', + description: message[0], + }) + } else if (message.length == 2) { + window.toast(message[0], { + type: 'warning', + description: message[1], + }) + } + }) + window.Livewire.on('success', (message) => { + if (typeof message === 'string') { + window.toast('Success', { + type: 'success', + description: message, + }) + return; + } + if (message.length == 1) { + window.toast('Success', { + type: 'success', + description: message[0], + }) + } else if (message.length == 2) { + window.toast(message[0], { + type: 'success', + description: message[1], + }) + } + }) + }); + + @show - \ No newline at end of file + diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index bfec17dc6..8e614a4e9 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -23,16 +23,15 @@ @if (!$application->dockerfile && $application->build_pack !== 'dockerimage')
- + @if ($application->settings->is_static || $application->build_pack === 'static') - + @@ -75,7 +74,9 @@ submitAction="generateNginxConfiguration('{{ $application->settings->is_spa ? 'spa' : 'static' }}')" :actions="[ 'This will overwrite your current custom Nginx configuration.', - 'The default configuration will be generated based on your application type (' . ($application->settings->is_spa ? 'SPA' : 'static') . ').', + 'The default configuration will be generated based on your application type (' . + ($application->settings->is_spa ? 'SPA' : 'static') . + ').', ]" /> @endcan @endif @@ -94,13 +95,11 @@ @if ($application->build_pack !== 'dockercompose')
@if ($application->settings->is_container_label_readonly_enabled == false) - @else - @can('update', $application) @@ -210,21 +209,17 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" + id="customDockerRunOptions" label="Custom Docker Options" x-bind:disabled="!canUpdate" /> @else @if ($application->could_set_build_commands()) @if ($application->build_pack === 'nixpacks')
+ id="installCommand" label="Install Command" x-bind:disabled="!canUpdate" /> + id="buildCommand" label="Build Command" x-bind:disabled="!canUpdate" /> + id="startCommand" label="Start Command" x-bind:disabled="!canUpdate" />
Nixpacks will detect the required configuration automatically. @@ -246,13 +241,12 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" id="baseDirectory" label="Base Directory" helper="Directory to use as root. Useful for monorepos." />
- @@ -264,13 +258,11 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" you doing.
@@ -278,15 +270,14 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry"
+ placeholder="services/api/**" id="watchPaths" label="Watch Paths" + x-bind:disabled="shouldDisable()" />
@endif
@else
- @if ($application->build_pack === 'dockerfile' && !$application->dockerfile) @@ -297,8 +288,7 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" @endif @if ($application->build_pack === 'dockerfile') - @endif @@ -317,8 +307,8 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry"
+ placeholder="src/pages/**" id="watchPaths" label="Watch Paths" + x-bind:disabled="!canUpdate" />
@endif + instantSave id="isBuildServerEnabled" label="Use a Build Server?" + x-bind:disabled="!canUpdate" />
@endif @endif @@ -359,8 +349,7 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" helper="You need to modify the docker compose file in the git repository." monacoEditorLanguage="yaml" useMonacoEditor /> @endif - @endif @@ -386,13 +375,11 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" x-bind:disabled="!canUpdate" /> @else @if ($application->settings->is_container_label_readonly_enabled === false) - @else - @endif @@ -413,15 +400,14 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry"
+ label="Enable" id="isHttpBasicAuthEnabled" x-bind:disabled="!canUpdate" />
@if ($application->is_http_basic_auth_enabled)
- +
@endif
@@ -472,8 +458,8 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" id="postDeploymentCommand" label="Post-deployment " helper="An optional script or command to execute in the newly built container after the deployment completes.
It is always executed with 'sh -c', so you do not need add it manually." /> @if ($application->build_pack === 'dockercompose') - @endif