Refactored Manufacturer and Buildplate Livewire components. Introduced create, edit, and show components with route-based navigation. Updated views for consistency and cleaned up unused modals and legacy code. Adjusted styles and table layouts.
This commit is contained in:
@@ -4,10 +4,7 @@ namespace App\Livewire\Buildplate;
|
||||
|
||||
use App\Models\Buildplate as BuildplateModel;
|
||||
use App\Models\Manufacturer as Manufacturer;
|
||||
use Flux\Flux;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
@@ -16,118 +13,25 @@ class Buildplate extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
#[Validate('required')]
|
||||
public $name = '';
|
||||
public $description = '';
|
||||
public $manufacturer_id = '';
|
||||
public $temp_max = '';
|
||||
public $amount = '';
|
||||
|
||||
public $search ='';
|
||||
|
||||
// Edit Modal + Query
|
||||
public $editquery = '';
|
||||
|
||||
public $editid = '';
|
||||
public $deleteid = '';
|
||||
|
||||
public function create(){
|
||||
@Auth::check();
|
||||
|
||||
|
||||
// Validate
|
||||
$this->validate();
|
||||
|
||||
$buildplate = new BuildplateModel();
|
||||
$buildplate->name = $this->name;
|
||||
$buildplate->description = $this->description;
|
||||
$buildplate->manufacturer_id = $this->manufacturer_id;
|
||||
$buildplate->temp_max = $this->temp_max;
|
||||
$buildplate->amount = $this->amount;
|
||||
$buildplate->save();
|
||||
|
||||
// Clear the form
|
||||
$this->resetInputFields();
|
||||
|
||||
// Close the modal
|
||||
Flux::modal('createModal')->close();
|
||||
return $this->redirectRoute('buildplate.create', navigate: true);
|
||||
}
|
||||
|
||||
public function edit($buildplateid) {
|
||||
@Auth::check();
|
||||
|
||||
$editid = $buildplateid;
|
||||
$this->editid = $editid;
|
||||
|
||||
$buildplate = BuildplateModel::findOrFail($editid);
|
||||
|
||||
$this->name = $buildplate->name;
|
||||
$this->description = $buildplate->description;
|
||||
$this->manufacturer_id = $buildplate->manufacturer_id;
|
||||
$this->temp_max = $buildplate->temp_max;
|
||||
$this->amount = $buildplate->amount;
|
||||
|
||||
Flux::modal('editModal')->show();
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('buildplate.edit', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function save($editid) {
|
||||
@Auth::check();
|
||||
|
||||
$buildplate = BuildplateModel::findOrFail($editid);
|
||||
$buildplate->name = $this->name;
|
||||
$buildplate->description = $this->description;
|
||||
$buildplate->manufactuerer_id = $this->manufacturer_id;
|
||||
$buildplate->temp_max = $this->temp_max;
|
||||
$buildplate->amount = $this->amount;
|
||||
$buildplate->save();
|
||||
|
||||
$this->resetInputFields();
|
||||
|
||||
Flux::modal('editModal')->close();
|
||||
public function show($id){
|
||||
return $this->redirectRoute('buildplate.show', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function deleteModal($buildplateid) {
|
||||
@Auth::check();
|
||||
|
||||
$deleteid = $buildplateid;
|
||||
$this->deleteid = $deleteid;
|
||||
|
||||
$buildplate = BuildplateModel::findOrFail($deleteid);
|
||||
$this->name = $buildplate->name;
|
||||
$this->description = $buildplate->description;
|
||||
$this->manufacturer_id = $buildplate->manufacturer_id;
|
||||
$this->temp_max = $buildplate->temp_max;
|
||||
$this->amount = $buildplate->amount;
|
||||
|
||||
Flux::modal('deleteModal')->show();
|
||||
}
|
||||
|
||||
public function delete($deleteid) {
|
||||
@Auth::check();
|
||||
|
||||
$buildplate = BuildplateModel::findOrFail($deleteid)->delete();
|
||||
|
||||
$this->deleteid = $deleteid;
|
||||
Flux::modal('deleteModal')->close();
|
||||
|
||||
// Clear the form
|
||||
$this->resetInputFields();
|
||||
}
|
||||
|
||||
public function cancel() {
|
||||
$this->resetInputFields();
|
||||
Flux::modals()->close();
|
||||
}
|
||||
|
||||
public function resetInputFields() {
|
||||
$this->reset(['name', 'description', 'manufacturer_id', 'temp_max', 'amount', 'deleteid', 'editid']);;
|
||||
public function delete($id){
|
||||
BuildplateModel::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.buildplate.index', [
|
||||
'buildplates' => BuildplateModel::search('name', $this->search)->paginate(20),
|
||||
'manufacturers' => Manufacturer::all(),
|
||||
'buildplates' => BuildplateModel::search('name', $this->search)->paginate(10),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Buildplate;
|
||||
|
||||
use App\Models\Buildplate as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Buildplates')]
|
||||
class CreateBuildplate extends Component
|
||||
{
|
||||
public Model $buildplate ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
public string $temp_max = '';
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'temp_max' => ['required', 'integer']
|
||||
]);
|
||||
|
||||
$buildplate = new Model();
|
||||
$buildplate->name = $this->name;
|
||||
$buildplate->description = $this->description;
|
||||
$buildplate->manufacturer_id = $this->manufacturer_id;
|
||||
$buildplate->temp_max = $this->temp_max;
|
||||
$buildplate->save();
|
||||
|
||||
return $this->redirectRoute('buildplate.show', $buildplate->id , navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.buildplate.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Buildplate;
|
||||
|
||||
use App\Models\Buildplate as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Buildplates')]
|
||||
class EditBuildplate extends Component
|
||||
{
|
||||
public Model $buildplate ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
public string $temp_max = '';
|
||||
|
||||
public function mount(Model $buildplate){
|
||||
$this->buildplate = $buildplate;
|
||||
$this->name = $buildplate->name;
|
||||
$this->description = $buildplate->description;
|
||||
$this->manufacturer_id = $buildplate->manufacturer_id;
|
||||
$this->temp_max = $buildplate->temp_max;
|
||||
}
|
||||
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'temp_max' => ['required', 'integer']
|
||||
]);
|
||||
|
||||
$this->buildplate->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'manufacturer_id' => $this->manufacturer_id,
|
||||
'temp_max' => $this->temp_max
|
||||
]);
|
||||
return $this->redirectRoute('livewire.buildplate.show', $this->buildplate->id, navigate: true);
|
||||
}
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('buildplate.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.buildplate.edit', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Buildplate;
|
||||
|
||||
use App\Models\Buildplate as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Buildplates')]
|
||||
class ShowBuildplate extends Component
|
||||
{
|
||||
public Model $buildplate ;
|
||||
|
||||
public function back(){
|
||||
return $this->redirectRoute('buildplate.index', navigate: true);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('buildplate.edit', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.buildplate.show', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace App\Livewire\Color;
|
||||
|
||||
use App\Models\Color as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Colors')]
|
||||
@@ -15,6 +16,7 @@ class CreateColor extends Component
|
||||
public string $name = '';
|
||||
public string $hex = '';
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Manufacturer;
|
||||
|
||||
use App\Models\Manufacturer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Manufacturer List')]
|
||||
class CreateManufacturer extends Component{
|
||||
|
||||
public Model $manufacturer ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public string $website = '';
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'website' => ['nullable', 'string', 'max:255']
|
||||
]);
|
||||
|
||||
$manufacturer = new Model();
|
||||
$manufacturer->name = $this->name;
|
||||
$manufacturer->description = $this->description;
|
||||
$manufacturer->website = $this->website;
|
||||
$manufacturer->save();
|
||||
|
||||
return redirect()->route('manufacturer.index');
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
|
||||
return view('livewire.manufacturer.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Manufacturer;
|
||||
|
||||
use App\Models\Manufacturer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Manufacturer List')]
|
||||
class EditManufacturer extends Component{
|
||||
|
||||
public Model $manufacturer ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public string $website = '';
|
||||
|
||||
public function mount(Model $manufacturer){
|
||||
$this->manufacturer = $manufacturer;
|
||||
$this->name = $manufacturer->name;
|
||||
$this->description = $manufacturer->description;
|
||||
$this->website = $manufacturer->website;
|
||||
}
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'website' => ['nullable', 'string', 'max:255']
|
||||
]);
|
||||
|
||||
$this->manufacturer->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'website' => $this->website
|
||||
]);
|
||||
|
||||
return $this->redirectRoute('manufacturer.show', $this->manufacturer->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('manufacturer.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
return view('livewire.manufacturer.edit', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,7 @@
|
||||
namespace App\Livewire\Manufacturer;
|
||||
|
||||
use App\Models\Manufacturer as Model;
|
||||
use Flux\Flux;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
@@ -14,93 +11,19 @@ use Livewire\WithPagination;
|
||||
class Manufacturer extends Component{
|
||||
use WithPagination;
|
||||
|
||||
#[Validate('required')]
|
||||
public $name = '';
|
||||
|
||||
public $description = '';
|
||||
public $website = '';
|
||||
|
||||
public $search ='';
|
||||
|
||||
public $editid = '';
|
||||
public $deleteid = '';
|
||||
|
||||
public function create(){
|
||||
@Auth::check();
|
||||
|
||||
|
||||
// Validate
|
||||
$this->validate();
|
||||
|
||||
$manufacturer = new Model();
|
||||
$manufacturer->name = $this->name;
|
||||
$manufacturer->description = $this->description;
|
||||
$manufacturer->website = $this->website;
|
||||
$manufacturer->save();
|
||||
|
||||
// Clear the form
|
||||
$this->resetInputFields();
|
||||
|
||||
// Close the modal
|
||||
Flux::modal('createModal')->close();
|
||||
return $this->redirectRoute('manufacturer.create', navigate: true);
|
||||
}
|
||||
public function edit($manufacturerid) {
|
||||
@Auth::check();
|
||||
|
||||
$editid = $manufacturerid;
|
||||
$this->editid = $editid;
|
||||
|
||||
$manufacturer = Model::findOrFail($editid);
|
||||
|
||||
$this->name = $manufacturer->name;
|
||||
$this->description = $manufacturer->description;
|
||||
$this->website = $manufacturer->website;
|
||||
|
||||
Flux::modal('editModal')->show();
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('manufacturer.edit', $id, navigate: true);
|
||||
}
|
||||
public function save($editid) {
|
||||
@Auth::check();
|
||||
|
||||
$manufacturer = Model::findOrFail($editid);
|
||||
$manufacturer->name = $this->name;
|
||||
$manufacturer->description = $this->description;
|
||||
$manufacturer->website = $this->website;
|
||||
$manufacturer->save();
|
||||
|
||||
$this->resetInputFields();
|
||||
|
||||
Flux::modal('editModal')->close();
|
||||
public function show($id){
|
||||
return $this->redirectRoute('manufacturer.show', $id, navigate: true);
|
||||
}
|
||||
public function deleteModal($manufacturerid) {
|
||||
@Auth::check();
|
||||
|
||||
$deleteid = $manufacturerid;
|
||||
$this->deleteid = $deleteid;
|
||||
|
||||
$manufacturer = Model::findOrFail($deleteid);
|
||||
$this->name = $manufacturer->name;
|
||||
$this->description = $manufacturer->description;
|
||||
$this->website = $manufacturer->website;
|
||||
|
||||
Flux::modal('deleteModal')->show();
|
||||
}
|
||||
public function delete($deleteid) {
|
||||
@Auth::check();
|
||||
|
||||
$manufacturer = Model::findOrFail($deleteid)->delete();
|
||||
|
||||
$this->deleteid = $deleteid;
|
||||
Flux::modal('deleteModal')->close();
|
||||
|
||||
// Clear the form
|
||||
$this->resetInputFields();
|
||||
}
|
||||
public function cancel() {
|
||||
$this->resetInputFields();
|
||||
Flux::modals()->close();
|
||||
}
|
||||
public function resetInputFields() {
|
||||
$this->reset(['name', 'description', 'website', 'deleteid', 'editid']);
|
||||
public function delete($id){
|
||||
Model::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Manufacturer;
|
||||
|
||||
use App\Models\Manufacturer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Manufacturer List')]
|
||||
class ShowManufacturer extends Component{
|
||||
|
||||
public Model $manufacturer ;
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('manufacturer.edit', $id, navigate: true);
|
||||
}
|
||||
public function back(){
|
||||
return $this->redirectRoute('manufacturer.index', navigate: true);
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
|
||||
return view('livewire.manufacturer.show', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<section>
|
||||
<form wire:submit="save">
|
||||
<x-header>
|
||||
{{ __('Create Buildplate') }}
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button type="submit" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 hover:cursor-pointer transition-all ease-in-out" icon="check">Save</flux:button>
|
||||
<flux:button wire:click="cancel" variant="primary" class=" bg-red-700 shadow hover:bg-red-800 hover:cursor-pointer transition-all ease-in-out" icon="x-mark">Cancel</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant-950 border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<div>
|
||||
<div class="px-4 sm:px-0">
|
||||
<h3 class="text-base/7 font-semibold text-white">Buildplate Information</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm/6 text-gray-200">Buildplate details.</p>
|
||||
</div>
|
||||
<div class="mt-6 border-t border-white/10">
|
||||
<dl class="divide-y divide-white/10">
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Name</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:input wire:model="name" type="text" class="mt-1 block w-full"/>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Description</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:textarea wire:model="description" type="text" class="mt-1 block w-full"/>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Manufacturer</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:select wire:model="manufacturer_id" class="mt-1 block w-full">
|
||||
<flux:select.option default value="">Select Manufacturer</flux:select.option>
|
||||
@foreach(\App\Models\Manufacturer::all() as $manufacturer)
|
||||
<flux:select.option key="{{ $manufacturer->id }}" value="{{$manufacturer->id}}">{{$manufacturer->name}}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Max Temperature</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:input.group>
|
||||
<flux:input wire:model="temp_max" type="text" class="block w-full"/>
|
||||
<flux:input.group.suffix>°C</flux:input.group.suffix>
|
||||
</flux:input.group>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@@ -0,0 +1,58 @@
|
||||
<section>
|
||||
<form wire:submit="save">
|
||||
<x-header>
|
||||
{{ __('Edit Buildplate') }}
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button type="submit" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 hover:cursor-pointer transition-all ease-in-out" icon="check">Save</flux:button>
|
||||
<flux:button wire:click="cancel" variant="primary" class=" bg-red-700 shadow hover:bg-red-800 hover:cursor-pointer transition-all ease-in-out" icon="x-mark">Cancel</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant-950 border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<div>
|
||||
<div class="px-4 sm:px-0">
|
||||
<h3 class="text-base/7 font-semibold text-white">Buildplate Information</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm/6 text-gray-200">Buildplate details.</p>
|
||||
</div>
|
||||
<div class="mt-6 border-t border-white/10">
|
||||
<dl class="divide-y divide-white/10">
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Name</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:input wire:model="name" type="text" class="mt-1 block w-full"/>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Description</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:textarea wire:model="description" type="text" class="mt-1 block w-full"/>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Manufacturer</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:select wire:model="manufacturer_id" class="mt-1 block w-full">
|
||||
<flux:select.option default value="">Select Manufacturer</flux:select.option>
|
||||
@foreach(\App\Models\Manufacturer::all() as $manufacturer)
|
||||
<flux:select.option key="{{ $manufacturer->id }}" value="{{$manufacturer->id}}">{{$manufacturer->name}}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Max Temperature</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:input.group>
|
||||
<flux:input wire:model="temp_max" type="text" class="block w-full"/>
|
||||
<flux:input.group.suffix>°C</flux:input.group.suffix>
|
||||
</flux:input.group>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@@ -3,19 +3,15 @@
|
||||
{{ __('Buildplates') }}
|
||||
|
||||
<x-slot name="headerleft">
|
||||
<input type="text" placeholder="Search..." wire:model.live="search" class="bg-jet-700 border-jet-500 rounded text-jet-50 placeholder:text-jet-200 focus:border-olivine focus:ring-olivine" />
|
||||
<input type="text" placeholder="Search..." wire:model.live="search" class="bg-black/10 border-white/20 rounded text-gray-50 placeholder:text-gray-200 focus:border-white/50 focus:ring-white/50" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:modal.trigger name="createModal">
|
||||
<flux:button variant="primary" class="bg-olivine hover:bg-olivine-600">Create Buildplate</flux:button>
|
||||
</flux:modal.trigger>
|
||||
<flux:button wire:click="create" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 transition ease-in-out hover:cursor-pointer">Create Buildplate</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
|
||||
|
||||
<div class="container m-auto my-8 bg-jet-800 rounded-lg shadow p-6 text-jet-50">
|
||||
<div class="container m-auto my-8 bg-elephant border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<x-table>
|
||||
<x-slot name="tableheader">
|
||||
<x-table.header>Name</x-table.header>
|
||||
@@ -24,10 +20,10 @@
|
||||
<x-table.header>Max Temp.</x-table.header>
|
||||
<x-table.header>Amount</x-table.header>
|
||||
<x-table.header></x-table.header>
|
||||
<x-table.header class="w-1/6"></x-table.header>
|
||||
<x-table.header class="w-[150px]">Actions</x-table.header>
|
||||
</x-slot>
|
||||
@foreach ($buildplates as $buildplate)
|
||||
<tr wire:key="{{ $buildplate->id }}" class="text-jet-200 border-b border-jet-600 hover:bg-jet-700 transition duration-150 ease-in-out">
|
||||
<tr wire:key="{{ $buildplate->id }}" class="text-gray-200 border-b border-white/50 hover:bg-white/10 transition duration-150 ease-in-out">
|
||||
<x-table.item><p class="p-4 px-3 pl-6 font-bold">{{ $buildplate->name }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ $buildplate->description }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ App\Models\Manufacturer::find($buildplate->manufacturer_id)->name }}</p></x-table.item>
|
||||
@@ -36,8 +32,9 @@
|
||||
<x-table.item><p class="p-4 px-3"></p></x-table.item>
|
||||
<x-table.item>
|
||||
<div class="flex flex-row gap-4 justify-end pr-8">
|
||||
<flux:button variant="ghost" wire:click="edit({{ $buildplate->id }})" icon="pencil">Edit</flux:button>
|
||||
<flux:button variant="danger" wire:click="deleteModal({{ $buildplate->id }})" icon="x-mark">Delete</flux:button>
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-cornflower hover:shadow hover:text-gray-950 hover:cursor-pointer" wire:click="show({{ $buildplate->id }})" icon="magnifying-glass"></flux:button>
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-gold-drop hover:shadow hover:text-gray-950 hover:cursor-pointer" wire:click="edit({{ $buildplate->id }})" icon="pencil"></flux:button>
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-red-700 hover:shadow hover:cursor-pointer" wire:click="delete({{ $buildplate->id }})" icon="trash"></flux:button>
|
||||
</div>
|
||||
</x-table.item>
|
||||
</tr>
|
||||
@@ -48,97 +45,4 @@
|
||||
</x-table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Create Form -->
|
||||
<flux:modal wire:model.self='createModal' name="createModal" class="md:w-lg">
|
||||
<form wire:submit.prevent="create">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg" class="text-nuke-400">Create buildplate</flux:heading>
|
||||
<flux:text class="mt-2">Create a new buildplate.</flux:text>
|
||||
</div>
|
||||
<flux:input label="Name" wire:model="name" placeholder="Buildplate Name" required />
|
||||
<flux:textarea label="Description" wire:model="description" placeholder="Description" />
|
||||
<flux:select wire:model="manufacturer_id" label="Manufacturer">
|
||||
<flux:select.option disabled value="">Choose Manufacturer</flux:select.option>
|
||||
@foreach ($manufacturers as $manufacturer)
|
||||
<flux:select.option wire:key="{{ $manufacturer->id }}" value="{{ $manufacturer->id }}">{{ $manufacturer->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<div class="grid grid-cols-2 gap-x-4 gap-y-6">
|
||||
<flux:input label="Temperature" wire:model="temp_max" placeholder="Temperature" required />
|
||||
<flux:input label="Amount" wire:model="amount" placeholder="Amount" required />
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<flux:spacer />
|
||||
<flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button>
|
||||
<flux:button type="submit" variant="primary" class="bg-nuke-400 hover:bg-nuke-500">Create</flux:button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</flux:modal>
|
||||
|
||||
<!-- Edit Form -->
|
||||
@empty($buildplate)
|
||||
@else
|
||||
<flux:modal wire:model.self='editModal' name="editModal" class="md:w-lg">
|
||||
<form wire:submit.prevent="save({{ $editid }})">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg" class="text-etheral-300">Edit buildplate</flux:heading>
|
||||
<flux:text class="mt-2">Edit an existing buildplate.</flux:text>
|
||||
</div>
|
||||
<flux:input label="Name" wire:model="name" placeholder="Buildplate Name" required />
|
||||
<flux:textarea label="Description" wire:model="description" placeholder="Description" />
|
||||
<flux:select wire:model="manufacturer_id" label="Manufacturer">
|
||||
<flux:select.option disabled value="">Choose Manufacturer</flux:select.option>
|
||||
@foreach ($manufacturers as $manufacturer)
|
||||
<flux:select.option wire:key="{{ $manufacturer->id }}" value="{{ $manufacturer->id }}">{{ $manufacturer->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<div class="grid grid-cols-2 gap-x-4 gap-y-6">
|
||||
<flux:input label="Temperature" wire:model="temp_max" placeholder="Temperature" required />
|
||||
<flux:input label="Amount" wire:model="amount" placeholder="Amount" required />
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<flux:spacer />
|
||||
<flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button>
|
||||
<flux:button type="submit" variant="primary" class="bg-etheral-300 hover:bg-etheral-400">Save</flux:button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</flux:modal>
|
||||
@endempty
|
||||
|
||||
<!-- Delete Form -->
|
||||
<flux:modal wire:model.self='deleteModal' name="deleteModal" class="md:w-lg">
|
||||
<form wire:submit.prevent="delete({{ $deleteid }})">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg" class="text-red-500">Delete buildplate?</flux:heading>
|
||||
<flux:text class="mt-2">
|
||||
<p>You're about to delete this buildplate.</p>
|
||||
<p>This action cannot be reversed.</p>
|
||||
</flux:text>
|
||||
</div>
|
||||
<flux:input label="Name" wire:model="name" disabled placeholder="Buildplate Name" required />
|
||||
<flux:textarea label="Description" wire:model="description" disabled placeholder="Description" />
|
||||
<flux:select wire:model="manufacturer_id" disabled label="Manufacturer">
|
||||
<flux:select.option disabled value="">Choose Manufacturer</flux:select.option>
|
||||
@foreach ($manufacturers as $manufacturer)
|
||||
<flux:select.option wire:key="{{ $manufacturer->id }}" value="{{ $manufacturer->id }}">{{ $manufacturer->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<div class="grid grid-cols-2 gap-x-4 gap-y-6">
|
||||
<flux:input label="Temperature" wire:model="temp_max" disabled placeholder="Temperature" required />
|
||||
<flux:input label="Amount" wire:model="amount" disabled placeholder="Amount" required />
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<flux:spacer />
|
||||
<flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button>
|
||||
<flux:button type="submit" variant="danger">Delete Buildplate</flux:button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</flux:modal>
|
||||
</section>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<section>
|
||||
<x-header>
|
||||
{{ __('Show Buildplate') }}
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button wire:click="back" variant="primary" class="bg-transparent shadow-none hover:bg-black/10 hover:cursor-pointer transition-all ease-in-out" icon="arrow-left">Back</flux:button>
|
||||
<flux:button wire:click="edit({{ $buildplate->id }})" variant="primary" class="bg-selective text-gray-950 shadow-none hover:bg-selective-600 hover:cursor-pointer transition-all ease-in-out" icon="check">Edit</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant-950 border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<div>
|
||||
<div class="px-4 sm:px-0">
|
||||
<h3 class="text-base/7 font-semibold text-white">Buildplate Information</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm/6 text-gray-200">Buildplate details.</p>
|
||||
</div>
|
||||
<div class="mt-6 border-t border-white/10">
|
||||
<dl class="divide-y divide-white/10">
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Name</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
{{ $buildplate->name }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Description</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
{{ $buildplate->description }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Manufacturer</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
{{ App\Models\Manufacturer::find($buildplate->manufacturer_id)->name }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Max Temperature</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
{{ $buildplate->temp_max }} °C
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@@ -1,7 +1,7 @@
|
||||
<section>
|
||||
<form wire:submit="save">
|
||||
<x-header>
|
||||
{{ __('Create Color') }}
|
||||
{{ __('Edit Color') }}
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button type="submit" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 hover:cursor-pointer transition-all ease-in-out" icon="check">Save</flux:button>
|
||||
|
||||
@@ -7,15 +7,10 @@
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:modal.trigger name="createModal">
|
||||
<flux:button wire:click="create" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 transition ease-in-out hover:cursor-pointer">Create Type</flux:button>
|
||||
</flux:modal.trigger>
|
||||
<flux:button wire:click="create" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 transition ease-in-out hover:cursor-pointer">Create Color</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<x-table>
|
||||
<x-slot name="tableheader">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<section>
|
||||
<x-header>
|
||||
{{ __('Create Color') }}
|
||||
{{ __('Show Color') }}
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button wire:click="back" variant="primary" class="bg-transparent shadow-none hover:bg-black/10 hover:cursor-pointer transition-all ease-in-out" icon="arrow-left">Back</flux:button>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<section>
|
||||
<form wire:submit="save">
|
||||
<x-header>
|
||||
{{ __('Create Manufacturer') }}
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button type="submit" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 hover:cursor-pointer transition-all ease-in-out" icon="check">Save</flux:button>
|
||||
<flux:button wire:click="cancel" variant="primary" class=" bg-red-700 shadow hover:bg-red-800 hover:cursor-pointer transition-all ease-in-out" icon="x-mark">Cancel</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant-950 border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<div>
|
||||
<div class="px-4 sm:px-0">
|
||||
<h3 class="text-base/7 font-semibold text-white">Manufacturer Information</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm/6 text-gray-200">Manufacturer details.</p>
|
||||
</div>
|
||||
<div class="mt-6 border-t border-white/10">
|
||||
<dl class="divide-y divide-white/10">
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Name</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:input wire:model="name" type="text" class="block w-full"/>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Description</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:textarea wire:model="description" type="text" class="block w-full"/>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Website</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:input.group>
|
||||
<flux:input.group.prefix>https://</flux:input.group.prefix>
|
||||
<flux:input wire:model="website" type="text" class="block w-full"/>
|
||||
</flux:input.group>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@@ -0,0 +1,47 @@
|
||||
<section>
|
||||
<form wire:submit="save">
|
||||
<x-header>
|
||||
{{ __('Edit Manufacturer') }}
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button type="submit" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 hover:cursor-pointer transition-all ease-in-out" icon="check">Save</flux:button>
|
||||
<flux:button wire:click="cancel" variant="primary" class=" bg-red-700 shadow hover:bg-red-800 hover:cursor-pointer transition-all ease-in-out" icon="x-mark">Cancel</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant-950 border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<div>
|
||||
<div class="px-4 sm:px-0">
|
||||
<h3 class="text-base/7 font-semibold text-white">Manufacturer Information</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm/6 text-gray-200">Manufacturer details.</p>
|
||||
</div>
|
||||
<div class="mt-6 border-t border-white/10">
|
||||
<dl class="divide-y divide-white/10">
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Name</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:input wire:model="name" type="text" class="block w-full"/>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Description</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:textarea wire:model="description" type="text" class="block w-full"/>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Website</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<flux:input.group>
|
||||
<flux:input.group.prefix>https://</flux:input.group.prefix>
|
||||
<flux:input wire:model="website" type="text" class="block w-full"/>
|
||||
</flux:input.group>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@@ -3,38 +3,44 @@
|
||||
{{ __('Manufacturers') }}
|
||||
|
||||
<x-slot name="headerleft">
|
||||
<input type="text" placeholder="Search..." wire:model.live="search" class="bg-jet-700 border-jet-500 rounded text-jet-50 placeholder:text-jet-200 focus:border-olivine focus:ring-olivine" />
|
||||
<input type="text" placeholder="Search..." wire:model.live="search" class="bg-black/10 border-white/20 rounded text-gray-50 placeholder:text-gray-200 focus:border-white/50 focus:ring-white/50" />
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:modal.trigger name="createModal">
|
||||
<flux:button variant="primary" class="bg-olivine hover:bg-olivine-600">Create Manufacturer</flux:button>
|
||||
</flux:modal.trigger> </x-slot>
|
||||
<flux:button wire:click="create" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 transition ease-in-out hover:cursor-pointer">Create Type</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container m-auto my-8 bg-jet-800 rounded-lg shadow p-6 text-jet-50">
|
||||
<div class="container m-auto my-8 bg-elephant border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<x-table>
|
||||
<x-slot name="tableheader">
|
||||
<x-table.header>Name</x-table.header>
|
||||
<x-table.header>Description</x-table.header>
|
||||
<x-table.header>Website</x-table.header>
|
||||
<x-table.header>Rolls</x-table.header>
|
||||
<x-table.header class="w-1/6"></x-table.header>
|
||||
<x-table.header class="w-[150px]">Actions</x-table.header>
|
||||
</x-slot>
|
||||
|
||||
@foreach ($manufacturers as $manufacturer)
|
||||
<tr wire:key="{{ $manufacturer->id }}" class="text-jet-200 border-b border-jet-600 hover:bg-jet-700 transition duration-150 ease-in-out">
|
||||
<tr wire:key="{{ $manufacturer->id }}" class="text-gray-200 border-b border-white/50 hover:bg-white/10 transition duration-150 ease-in-out">
|
||||
<x-table.item><p class="p-4 px-3 pl-6 font-bold">{{ $manufacturer->name }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ $manufacturer->description }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3"><a href="{{ $manufacturer->website }}" target="_blank" class="flex justify-center items-center gap-2">{{ $manufacturer->website }} <flux:icon.arrow-top-right-on-square variant="mini"/></a></p></x-table.item>
|
||||
<x-table.item>
|
||||
<p class="p-4 px-3">
|
||||
@if($manufacturer->website !== '')
|
||||
<a href="{{ $manufacturer->website }}" target="_blank" class="flex justify-center items-center gap-2">{{ $manufacturer->website }} <flux:icon.arrow-top-right-on-square variant="mini"/></a>
|
||||
@endif
|
||||
</p>
|
||||
</x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ $manufacturer->filament_count }}</p></x-table.item>
|
||||
<x-table.item>
|
||||
<div class="flex flex-row gap-4 justify-end pr-8">
|
||||
<flux:button variant="ghost" wire:click="edit({{ $manufacturer->id }})" icon="pencil">Edit</flux:button>
|
||||
<flux:button variant="danger" wire:click="deleteModal({{ $manufacturer->id }})" icon="x-mark">Delete</flux:button>
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-cornflower hover:shadow hover:text-gray-950 hover:cursor-pointer" wire:click="show({{ $manufacturer->id }})" icon="magnifying-glass"></flux:button>
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-gold-drop hover:shadow hover:text-gray-950 hover:cursor-pointer" wire:click="edit({{ $manufacturer->id }})" icon="pencil"></flux:button>
|
||||
<flux:button variant="primary" class="text-gray-200 bg-transparent shadow-none hover:bg-red-700 hover:shadow hover:cursor-pointer" wire:click="delete({{ $manufacturer->id }})" icon="trash"></flux:button>
|
||||
</div>
|
||||
</x-table.item>
|
||||
</tr>
|
||||
@@ -46,71 +52,4 @@
|
||||
</x-table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Create Form -->
|
||||
<flux:modal wire:model.self='createModal' name="createModal" class="md:w-lg">
|
||||
<form wire:submit.prevent="create">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg" class="text-nuke-400">Create manufacturer</flux:heading>
|
||||
<flux:text class="mt-2">Create a new manufacturer.</flux:text>
|
||||
</div>
|
||||
<flux:input label="Name" wire:model="name" placeholder="Manufacturer Name" required />
|
||||
<flux:textarea label="Description" wire:model="description" placeholder="Description" />
|
||||
<flux:input label="Website" wire:model="website" placeholder="Website" />
|
||||
<div class="flex gap-2">
|
||||
<flux:spacer />
|
||||
<flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button>
|
||||
<flux:button type="submit" variant="primary" class="bg-nuke-400 hover:bg-nuke-500">Create</flux:button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</flux:modal>
|
||||
|
||||
<!-- Edit Form -->
|
||||
@empty($manufacturer)
|
||||
@else
|
||||
<flux:modal wire:model.self='editModal' name="editModal" class="md:w-lg">
|
||||
<form wire:submit.prevent="save({{ $editid }})">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg" class="text-etheral-300">Edit manufacturer</flux:heading>
|
||||
<flux:text class="mt-2">Edit an existing manufacturer.</flux:text>
|
||||
</div>
|
||||
<flux:input label="Name" wire:model="name" placeholder="Manufacturer Name" required />
|
||||
<flux:textarea label="Description" wire:model="description" placeholder="Description" />
|
||||
<flux:input label="Website" wire:model="website" placeholder="Website" />
|
||||
<div class="flex gap-2">
|
||||
<flux:spacer />
|
||||
<flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button>
|
||||
<flux:button type="submit" variant="primary" class="bg-etheral-300 hover:bg-etheral-400">Save</flux:button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</flux:modal>
|
||||
@endempty
|
||||
|
||||
<!-- Delete Form -->
|
||||
<flux:modal wire:model.self='deleteModal' name="deleteModal" class="md:w-lg">
|
||||
<form wire:submit.prevent="delete({{ $deleteid }})">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<flux:heading size="lg" class="text-red-500">Delete manufacturer?</flux:heading>
|
||||
<flux:text class="mt-2">
|
||||
<p>You're about to delete this manufacturer.</p>
|
||||
<p>This action cannot be reversed.</p>
|
||||
</flux:text>
|
||||
</div>
|
||||
<flux:input label="Name" wire:model="name" disabled placeholder="Manufacturer Name" required />
|
||||
<flux:textarea label="Description" disabled wire:model="description" placeholder="Description" />
|
||||
<flux:input label="Website" wire:model="website" disabled placeholder="Website" />
|
||||
<div class="flex gap-2">
|
||||
<flux:spacer />
|
||||
<flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button>
|
||||
<flux:button type="submit" variant="danger">Delete type</flux:button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</flux:modal>
|
||||
|
||||
</section>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<section>
|
||||
<form wire:submit="save">
|
||||
<x-header>
|
||||
{{ __('Show Manufacturer') }}
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:button wire:click="back" variant="primary" class="bg-transparent shadow-none hover:bg-black/10 hover:cursor-pointer transition-all ease-in-out" icon="arrow-left">Back</flux:button>
|
||||
<flux:button wire:click="edit({{ $manufacturer->id }})" variant="primary" class="bg-selective text-gray-950 shadow-none hover:bg-selective-600 hover:cursor-pointer transition-all ease-in-out" icon="check">Edit</flux:button>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
<div class="container m-auto my-8 bg-elephant-950 border border-elephant-900 rounded-lg shadow p-6 text-gray-50">
|
||||
<div>
|
||||
<div class="px-4 sm:px-0">
|
||||
<h3 class="text-base/7 font-semibold text-white">Manufacturer Information</h3>
|
||||
<p class="mt-1 max-w-2xl text-sm/6 text-gray-200">Manufacturer details.</p>
|
||||
</div>
|
||||
<div class="mt-6 border-t border-white/10">
|
||||
<dl class="divide-y divide-white/10">
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Name</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
{{ $manufacturer->name }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Description</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
{{ $manufacturer->description }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 items-center">
|
||||
<dt class="text-sm/6 font-medium text-gray-100">Website</dt>
|
||||
<dd class="mt-1 text-sm/6 text-gray-200 sm:col-span-2 sm:mt-0">
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="https://{{ $manufacturer->website }}" target="_blank" class="hover:underline">{{ $manufacturer->website }}</a>
|
||||
<flux:icon name="arrow-top-right-on-square" class="w-4 h-4 text-gray-200"></flux:icon>
|
||||
</div>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
@@ -7,9 +7,7 @@
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="headerright">
|
||||
<flux:modal.trigger name="createModal">
|
||||
<flux:button wire:click="create" variant="primary" class="bg-selective hover:bg-selective-600 text-gray-950 transition ease-in-out hover:cursor-pointer">Create Type</flux:button>
|
||||
</flux:modal.trigger>
|
||||
</x-slot>
|
||||
</x-header>
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ Route::middleware([
|
||||
|
||||
// Buildplates
|
||||
Route::get('buildplate', Buildplate::class)->name('buildplate.index');
|
||||
Route::get('buildplate/create', \App\Livewire\Buildplate\CreateBuildplate::class)->name('buildplate.create');
|
||||
Route::get('buildplate/{buildplate}/edit', \App\Livewire\Buildplate\EditBuildplate::class)->name('buildplate.edit');
|
||||
Route::get('buildplate/{buildplate}', \App\Livewire\Buildplate\ShowBuildplate::class)->name('buildplate.show');
|
||||
|
||||
// Colors
|
||||
Route::get('color', Color::class)->name('color.index');
|
||||
@@ -47,6 +50,9 @@ Route::middleware([
|
||||
|
||||
// Manufacturers
|
||||
Route::get('manufacturer', Manufacturer::class)->name('manufacturer.index');
|
||||
Route::get('manufacturer/create', \App\Livewire\Manufacturer\CreateManufacturer::class)->name('manufacturer.create');
|
||||
Route::get('manufacturer/{manufacturer}/edit', \App\Livewire\Manufacturer\EditManufacturer::class)->name('manufacturer.edit');
|
||||
Route::get('manufacturer/{manufacturer}', \App\Livewire\Manufacturer\ShowManufacturer::class)->name('manufacturer.show');
|
||||
|
||||
// Orders
|
||||
Route::get('orders', Orders::class)->name('orders.index');
|
||||
|
||||
Reference in New Issue
Block a user