mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 15:32:35 +00:00
Migrate to HTMX (#114)
Dropped Livewire Added HTMX Added Blade code lint Drop Mysql and Redis Migrate to SQLite
This commit is contained in:
5
resources/views/settings/projects/index.blade.php
Normal file
5
resources/views/settings/projects/index.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
<x-profile-layout>
|
||||
<x-slot name="pageTitle">{{ __("Projects") }}</x-slot>
|
||||
|
||||
@include("settings.projects.partials.projects-list")
|
||||
</x-profile-layout>
|
@ -0,0 +1,40 @@
|
||||
<div>
|
||||
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'create-project')">
|
||||
{{ __("Create") }}
|
||||
</x-primary-button>
|
||||
|
||||
<x-modal name="create-project" :show="request()->has('create')">
|
||||
<form
|
||||
id="create-project-form"
|
||||
hx-post="{{ route("projects.create") }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#create-project-form"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#btn-create-project"
|
||||
class="p-6"
|
||||
>
|
||||
@csrf
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Create Project") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="name" value="Name" />
|
||||
<x-text-input value="{{ old('name') }}" id="name" name="name" type="text" class="mt-1 w-full" />
|
||||
@error("name")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-primary-button id="btn-create-project" class="ml-3">
|
||||
{{ __("Create") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<x-modal name="delete-project" :show="$errors->isNotEmpty()">
|
||||
<form id="delete-project-form" method="post" x-bind:action="deleteAction" class="p-6">
|
||||
@csrf
|
||||
@method("delete")
|
||||
|
||||
<h2 class="text-lg font-medium">
|
||||
Deleting a project will delete all of its servers, sites, etc. Are you sure you want to delete this project?
|
||||
</h2>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-danger-button class="ml-3">
|
||||
{{ __("Delete") }}
|
||||
</x-danger-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
@ -0,0 +1,47 @@
|
||||
<div>
|
||||
<x-icon-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'edit-project-{{ $project->id }}')">
|
||||
<x-heroicon-o-pencil class="h-5 w-5" />
|
||||
</x-icon-button>
|
||||
|
||||
<x-modal name="edit-project-{{ $project->id }}">
|
||||
<form
|
||||
id="edit-project-form-{{ $project->id }}"
|
||||
hx-post="{{ route("projects.update", $project) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#edit-project-form-{{ $project->id }}"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#btn-edit-project-{{ $project->id }}"
|
||||
class="p-6 text-left"
|
||||
>
|
||||
@csrf
|
||||
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Edit Project") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="edit-name-{{ $project->id }}" value="Name" />
|
||||
<x-text-input
|
||||
value="{{ old('name', $project->name) }}"
|
||||
id="edit-name-{{ $project->id }}"
|
||||
name="name"
|
||||
type="text"
|
||||
class="mt-1 w-full"
|
||||
/>
|
||||
@error("name")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-primary-button id="btn-edit-project-{{ $project->id }}" class="ml-3">
|
||||
{{ __("Save") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
||||
</div>
|
@ -0,0 +1,40 @@
|
||||
<div>
|
||||
<x-card-header>
|
||||
<x-slot name="title">{{ __("Projects") }}</x-slot>
|
||||
<x-slot name="description">
|
||||
{{ __("Here you can manage your projects") }}
|
||||
</x-slot>
|
||||
<x-slot name="aside">
|
||||
@include("settings.projects.partials.create-project")
|
||||
</x-slot>
|
||||
</x-card-header>
|
||||
<div id="projects-list" x-data="{ deleteAction: '' }" class="space-y-3">
|
||||
@foreach ($projects as $project)
|
||||
<x-item-card>
|
||||
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
|
||||
<div class="mb-1 flex items-center">
|
||||
{{ $project->name }}
|
||||
@if ($project->id == auth()->user()->current_project_id)
|
||||
<x-status status="success" class="ml-1">
|
||||
{{ __("Current") }}
|
||||
</x-status>
|
||||
@endif
|
||||
</div>
|
||||
<span class="text-sm text-gray-400">
|
||||
<x-datetime :value="$project->created_at" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
@include("settings.projects.partials.edit-project", ["project" => $project])
|
||||
<x-icon-button
|
||||
x-on:click="deleteAction = '{{ route('projects.delete', $project) }}'; $dispatch('open-modal', 'delete-project')"
|
||||
>
|
||||
<x-heroicon-o-trash class="h-5 w-5" />
|
||||
</x-icon-button>
|
||||
</div>
|
||||
</x-item-card>
|
||||
@endforeach
|
||||
|
||||
@include("settings.projects.partials.delete-project")
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user