Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Oct 3, 2023
1 parent 9a33920 commit 10ba050
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 29 deletions.
11 changes: 9 additions & 2 deletions resources/views/actions/action.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<x-root::modal :title="$name" :key="$modalKey">
{!! $form !!}
<form method="POST" action="{{ $url }}">
@csrf
<div class="form-group-stack form-group-stack--bordered form-group-container">
@foreach($fields as $field)
{!! $field !!}
@endforeach
</div>
</form>

<x-slot:footer>
<button form="{{ $form->getAttribute('id') }}" type="submit" class="btn btn-primary">
<button form="{{ $key }}" type="submit" class="btn btn--primary">
{{ __('Run') }}
</button>
<button type="button" class="btn btn--outline-primary" x-on:click="open = false">
Expand Down
8 changes: 0 additions & 8 deletions resources/views/actions/form.blade.php

This file was deleted.

4 changes: 2 additions & 2 deletions resources/views/resources/table/actions.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<button
type="button"
class="btn btn--primary btn--sm"
x-on:click="selection = {{ $items->pluck('id')->toJson() }}"
x-on:click="selection = {{ $data->pluck('id')->toJson() }}"
>
{{ __('Select all') }} ({{ $items->total() }})
{{ __('Select all') }} ({{ $data->total() }})
</button>
<button
type="button"
Expand Down
2 changes: 1 addition & 1 deletion resources/views/resources/table/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>
<div class="app-card__body">
<div class="data-table">
@includeWhen(! empty($actions), 'root::table.actions')
@includeWhen(! empty($actions), 'root::resources.table.actions')
<div class="table-responsive">
<table class="table table--hover">
<thead>
Expand Down
2 changes: 1 addition & 1 deletion src/Actions/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class Action extends Element implements Form, Responsable
/**
* The Blade template.
*/
protected string $template = 'root::table.actions.action';
protected string $template = 'root::actions.action';

/**
* Indicates if the action is descrtuctive.
Expand Down
1 change: 0 additions & 1 deletion src/Fields/Boolean.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Cone\Root\Fields;


use Illuminate\Http\Request;

class Boolean extends Field
Expand Down
1 change: 0 additions & 1 deletion src/Fields/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public function getConfig(): array
return $this->config;
}


/**
* Configure the media field.
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Fields/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ public function setForm(Form $form): static
*/
public function getModel(): Model
{
return $this->model ?: new class() extends Model {};
return $this->model ?: new class() extends Model
{
};
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/Fields/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Cone\Root\Fields;

use Cone\Root\Interfaces\Form;

class Range extends Number
{
/**
Expand Down
10 changes: 10 additions & 0 deletions stubs/Action.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@ class {{ class }} extends Action
{
//
}

/**
* Define the fields.
*/
public function fields(Request $request): array
{
return array_merge(parent::fields($request), [
//
]);
}
}
20 changes: 10 additions & 10 deletions stubs/Resource.stub
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,48 @@ class {{ class }} extends Resource
*/
public function columns(Request $request): array
{
return [
return array_merge(parent::columns($request), [
//
];
]);
}

/**
* Define the fields.
*/
public function fields(Request $request): array
{
return [
return array_merge(parent::fields($request), [
//
];
]);
}

/**
* Define the filters.
*/
public function filters(Request $request): array
{
return [
return array_merge(parent::filters($request), [
//
];
]);
}

/**
* Define the actions.
*/
public function actions(Request $request): array
{
return [
return array_merge(parent::actions($request), [
//
];
]);
}

/**
* Define the widgets for the resource.
*/
public function widgets(Request $request): array
{
return [
return array_merge(parent::widgets($request), [
//
];
]);
}
}

0 comments on commit 10ba050

Please sign in to comment.