adding Projects feature (#85)

This commit is contained in:
Saeed Vaziry
2024-01-02 19:50:49 +01:00
committed by GitHub
parent fd2244d382
commit 10a6bb57a8
32 changed files with 847 additions and 84 deletions

View File

@ -0,0 +1,31 @@
<div>
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'create-project')">
{{ __('Connect') }}
</x-primary-button>
<x-modal name="create-project" :show="$open">
<form wire:submit.prevent="create" class="p-6">
<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 wire:model.defer="inputs.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 class="ml-3" @created.window="$dispatch('close')">
{{ __('Create') }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,31 @@
<div>
<x-icon-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'edit-project-{{ $project->id }}')">
{{ __('Edit') }}
</x-icon-button>
<x-modal name="edit-project-{{ $project->id }}">
<form wire:submit.prevent="save" class="p-6 text-left">
<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 wire:model.defer="inputs.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 class="ml-3" @created.window="$dispatch('close')">
{{ __('Save') }}
</x-primary-button>
</div>
</form>
</x-modal>
</div>

View File

@ -0,0 +1,38 @@
<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">
<livewire:projects.create-project />
</x-slot>
</x-card-header>
<div x-data="" 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">
<livewire:projects.edit-project :project="$project" />
<x-icon-button x-on:click="$wire.deleteId = '{{ $project->id }}'; $dispatch('open-modal', 'delete-project')">
Delete
</x-icon-button>
</div>
</x-item-card>
@endforeach
<x-confirm-modal
name="delete-project"
:title="__('Confirm')"
:description="__('Deleting a project will delete all of its servers, sites, etc. Are you sure you want to delete this project?')"
method="delete"
/>
</div>
</div>