akaunting 3.0 (the last dance)
This commit is contained in:
@ -2,32 +2,46 @@
|
||||
|
||||
namespace App\View\Components\Transactions;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
use App\Abstracts\View\Component;
|
||||
use App\Traits\ViewComponents;
|
||||
|
||||
class Script extends Component
|
||||
{
|
||||
use ViewComponents;
|
||||
|
||||
public const OBJECT_TYPE = 'transaction';
|
||||
public const DEFAULT_TYPE = 'income';
|
||||
public const DEFAULT_PLURAL_TYPE = 'incomes';
|
||||
|
||||
/** @var string */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $scriptFile;
|
||||
|
||||
/** @var string */
|
||||
public $version;
|
||||
|
||||
public $transaction;
|
||||
|
||||
/** @var string */
|
||||
public $alias;
|
||||
|
||||
/** @var string */
|
||||
public $folder;
|
||||
|
||||
/** @var string */
|
||||
public $file;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(string $type = '', string $scriptFile = '', string $version = '', $transaction = false)
|
||||
{
|
||||
public function __construct(
|
||||
string $type = '', $transaction = false,
|
||||
string $alias = '', string $folder = '', string $file = ''
|
||||
) {
|
||||
$this->type = $type;
|
||||
$this->scriptFile = ($scriptFile) ? $scriptFile : 'public/js/banking/transactions.js';
|
||||
$this->version = $this->getVersion($version);
|
||||
$this->transaction = $transaction;
|
||||
|
||||
$this->alias = $this->getAlias($type, $alias);
|
||||
$this->folder = $this->getScriptFolder($type, $folder);
|
||||
$this->file = $this->getScriptFile($type, $file);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -39,17 +53,4 @@ class Script extends Component
|
||||
{
|
||||
return view('components.transactions.script');
|
||||
}
|
||||
|
||||
protected function getVersion($version)
|
||||
{
|
||||
if (!empty($version)) {
|
||||
return $version;
|
||||
}
|
||||
|
||||
if ($alias = config('type.' . $this->type . '.alias')) {
|
||||
return module_version($alias);
|
||||
}
|
||||
|
||||
return version('short');
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionShow as Component;
|
||||
use App\Abstracts\View\Components\Transactions\Show as Component;
|
||||
|
||||
class Attachment extends Component
|
||||
{
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionShow as Component;
|
||||
use App\Abstracts\View\Components\Transactions\Show as Component;
|
||||
|
||||
class Header extends Component
|
||||
class Buttons extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
@ -13,6 +13,6 @@ class Header extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.show.header');
|
||||
return view('components.transactions.show.buttons');
|
||||
}
|
||||
}
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionShow as Component;
|
||||
use App\Abstracts\View\Components\Transactions\Show as Component;
|
||||
|
||||
class Histories extends Component
|
||||
class Children extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
@ -13,6 +13,6 @@ class Histories extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.show.histories');
|
||||
return view('components.transactions.show.children');
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionShow as Component;
|
||||
use App\Abstracts\View\Components\Transactions\Show as Component;
|
||||
|
||||
class Content extends Component
|
||||
{
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionShow as Component;
|
||||
use App\Abstracts\View\Components\Transactions\Show as Component;
|
||||
|
||||
class Footer extends Component
|
||||
class Create extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
@ -13,6 +13,6 @@ class Footer extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.show.footer');
|
||||
return view('components.transactions.show.create');
|
||||
}
|
||||
}
|
18
app/View/Components/Transactions/Show/MoreButtons.php
Normal file
18
app/View/Components/Transactions/Show/MoreButtons.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\Transactions\Show as Component;
|
||||
|
||||
class MoreButtons extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.show.more-buttons');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionShow as Component;
|
||||
|
||||
class RecurringMessage extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.show.recurring-message');
|
||||
}
|
||||
}
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionShow as Component;
|
||||
use App\Abstracts\View\Components\Transactions\Show as Component;
|
||||
|
||||
class TopButtons extends Component
|
||||
class Schedule extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
@ -13,6 +13,6 @@ class TopButtons extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.show.top-buttons');
|
||||
return view('components.transactions.show.schedule');
|
||||
}
|
||||
}
|
18
app/View/Components/Transactions/Show/Template.php
Normal file
18
app/View/Components/Transactions/Show/Template.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\Transactions\Show as Component;
|
||||
|
||||
class Template extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.show.template');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Transactions\Show;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionShow as Component;
|
||||
|
||||
class Transaction extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.transactions.show.transaction');
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\View\Components\Transactions\Template;
|
||||
|
||||
use App\Abstracts\View\Components\TransactionTemplate as Component;
|
||||
use App\Abstracts\View\Components\Transactions\Template as Component;
|
||||
|
||||
class Ddefault extends Component
|
||||
{
|
||||
|
Reference in New Issue
Block a user