Skip to content

Commit

Permalink
Merge pull request #71 from exodusanto/feature/70-better-output-restyle
Browse files Browse the repository at this point in the history
Better output restyle
  • Loading branch information
roberto-butti authored Jul 17, 2022
2 parents 58245b6 + 9d05079 commit 198cc7b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 98 deletions.
94 changes: 33 additions & 61 deletions resources/views/laralens/term/checks.blade.php
Original file line number Diff line number Diff line change
@@ -1,78 +1,50 @@
<div class="mt-1 mx-1">
<div class="mt-2 mx-1">
@if (sizeof($rows) > 0)
<div class="flex space-x-1">
<span class="flex-1 content-repeat-[─] text-red">
</span>
<span class="text-red">
CHECK: issues found
</span>
</div>
<div class="flex space-x-1">
<span class="text-red">CHECK: issues found</span>
<span class="flex-1 content-repeat-[─] text-red"></span>
</div>
@else
<div class="flex space-x-1">
<span class="flex-1 content-repeat-[─] text-green">
</span>
<span class="text-green">
CHECK: everything looks good
</span>
</div>
<div class="flex space-x-1">
<span class="text-green">CHECK: everything looks good</span>
<span class="flex-1 content-repeat-[─] text-green"></span>
</div>
@endif
<div>
<span>
@foreach ($rows as $row)
@php
@foreach ($rows as $row)
@php
$lineType = Arr::get($row, "lineType", HiFolks\LaraLens\ResultLens::LINE_TYPE_DEFAULT);
$label = Arr::get($row, "label", "");
@endphp

@if ($label === "*** HINT")
<div class="flex bg-gray-900 space-x-1">
<span class="px-1 text-gray-100">
💡 Hint:
</span>

@endphp
@if ($label === "*** HINT")
<div class="flex space-x-1 mt-1">
<span class="px-1 text-gray-100">💡 Hint:</span>
<span>
<span class="px-0 text-gray-300">
{{ Arr::get($row, "value", "") }}
{{ Arr::get($row, "value", "") }}
</span>
</span>
</div>
@else
<div class="">
</div>
<div class="flex bg-gray-900 space-x-0 ">
<span class=" text-gray-800 px-1 bg-gray-200 font-bold">
@else
<div @class([
'w-full mx-1 py-1 mt-1 text-center font-bold',
'bg-red text-white' => $lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR,
'bg-yellow text-black' => $lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING,
'bg-green text-white' => $lineType !== HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR
&& $lineType !== HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING,
])>
{{ Arr::get($row, "label", "")}}
</div>
<div class="mt-1 mx-1 text-gray-300">
@if ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR)
@elseif ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING)
⚠️
@else
✔️
@endif
&nbsp;{{ Arr::get($row, "label", "")}}
</span>

<span class="flex-1 content-repeat-[.] text-gray"></span>

<span>
@if ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR)
<span class="px-0 bg-red text-white font-bold">
{{ Arr::get($row, "value", "")}}
</span>
@elseif ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING)
<span class="px-0 bg-yellow text-gray font-bold">
@elseif ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING)
{{ Arr::get($row, "value", "")}}
</span>
@else

<span class="px-0 bg-green text-gray font-bold">
@else
{{ Str::replace("\\", "/", Arr::get($row, "value", "")) }}
</span>
@endif

</span>
@endif
</div>
@endif
@endforeach
</span>
@endif
@endforeach
</div>
</div>
</div>
64 changes: 27 additions & 37 deletions resources/views/laralens/term/table.blade.php
Original file line number Diff line number Diff line change
@@ -1,62 +1,52 @@
<div class="mt-1 mx-1">
<div class="mt-1.5 mx-1">
<div class="flex space-x-1">
<span class="flex-1 content-repeat-[─] text-gray">

</span>

<span class="text-green">
{{ $title }}
</span>
<span class="text-green">{{ $title }}</span>
<span class="flex-1 content-repeat-[─] text-gray"></span>
</div>
<div>
<div class="mt-1">
<span>
@foreach ($rows as $row)
@php
$lineType = Arr::get($row, "lineType", HiFolks\LaraLens\ResultLens::LINE_TYPE_DEFAULT);
$label = Arr::get($row, "label", "");
$lineType = Arr::get($row, "lineType", HiFolks\LaraLens\ResultLens::LINE_TYPE_DEFAULT);
$label = Arr::get($row, "label", "");
@endphp
@if ($label === "*** HINT")
<div class="flex bg-gray-900 space-x-1">
<span class=" text-white font-bold">
Hint:
</span>
<div class="flex space-x-1">
<span class=" text-white font-bold">Hint:</span>
<span class="flex-1 content-repeat-[.] text-gray"></span>
<span>
<span class="px-2 text-gray font-bold">
{{ Arr::get($row, "value", "") }}
<div>
<span class="px-2 text-gray font-bold">
{{ Arr::get($row, "value", "") }}
</span>
</span>
</div>
</div>
@else
<div class="flex bg-gray-900 space-x-1">
<div class="flex space-x-1">
<span class=" text-white font-bold">
{{ Arr::get($row, "label", "")}}
</span>

<span class="flex-1 content-repeat-[.] text-gray"></span>

<span>
<div>
@if ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_ERROR)
<span class="text-gray-100 bg-red font-bold">
{{ Arr::get($row, "value", "")}}
</span>
<span class="text-gray-100 bg-red font-bold">
{{ Arr::get($row, "value", "")}}
</span>
@elseif ($lineType === HiFolks\LaraLens\ResultLens::LINE_TYPE_WARNING)
<span class="text-gray-100 bg-yellow font-bold">
{{ Arr::get($row, "value", "")}}
</span>
<span class="text-gray-100 bg-yellow font-bold">
{{ Arr::get($row, "value", "")}}
</span>
@else

<span class="text-gray-100 ">
{{ Str::replace("\\", "/", Arr::get($row, "value", "")) }}
</span>
<span class="text-gray-100">
{{ Str::replace("\\", "/", Arr::get($row, "value", "")) }}
</span>
@endif

</span>
</div>
</div>
@endif
@endforeach
</span>
</div>
</div>

</div>

0 comments on commit 198cc7b

Please sign in to comment.