Skip to content

Commit

Permalink
Fixed document information component document show route
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jul 7, 2022
1 parent 9457120 commit 9749956
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app/View/Components/Documents/Index/Information.php
Expand Up @@ -19,6 +19,8 @@ class Information extends Component

public $showRoute;

public $showDocumentRoute;

public $placement;

/**
Expand All @@ -27,11 +29,12 @@ class Information extends Component
* @return void
*/
public function __construct(
$document, bool $hideShow = false, string $showRoute = '', string $placement = ''
$document, bool $hideShow = false, string $showRoute = '', string $showDocumentRoute = '', string $placement = ''
) {
$this->document = $document;
$this->hideShow = $hideShow;
$this->showRoute = $this->getShowRoute($document->contact->type, $showRoute);
$this->showDocumentRoute = $this->getShowRoute($document->type, $showDocumentRoute);
$this->placement = (! empty($placement)) ? $placement : 'left';
}

Expand Down
10 changes: 5 additions & 5 deletions resources/views/components/documents/index/information.blade.php
Expand Up @@ -47,6 +47,10 @@

@if ($document->items->count())
@foreach ($document->items as $document_item)
@if ($loop->index > 1)
@break
@endif

<li class="relative flex items-center text-sm mb-7">
<div class="flex flex-col items-center mr-2">
<span class="material-icons-outlined text-black-300">sell</span>
Expand All @@ -66,17 +70,13 @@
</div>
</div>
</li>

@if ($loop->index >= 2)
@break
@endif
@endforeach
@endif

@if ($document->items->count() > 2)
<li class="ml-10 mb-10">
@if (! $hideShow)
<a href="{{ route($showRoute, $document->id) }}" class="border-b">
<a href="{{ route($showDocumentRoute, $document->id) }}" class="border-b">
{{ trans('documents.invoice_detail.more_item', ['count' => $document->items->count() - 2]) }}
</a>
@else
Expand Down

0 comments on commit 9749956

Please sign in to comment.