Skip to content

Commit

Permalink
refactor: update dashboard submissions table layout and improve data …
Browse files Browse the repository at this point in the history
…presentation
  • Loading branch information
ibnsultan committed Nov 25, 2024
1 parent 1c9e017 commit 2910650
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions app/views/app/dashboard/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,32 +79,22 @@
<thead>
<tr>
<th>Form Name</th>
<th>Submission Summary</th>
<th class="text-end">Submitted</th>
<th class="text-center">Submissions</th>
<th class="text-center">Pending Review</th>
<th class="text-end">Last Submission</th>
</tr>
</thead>
<tbody>
@foreach($recentSubmissions as $submission)
<tr>
<td class="align-middle ps-1" style="min-width: 200px;">
<a href="{{ route('forms.submissions', $submission->form_id) }}" class="fw-bold">
<td class="align-middle ps-1">
<a href="@route('forms.submissions', $submission->form_id)">
{{ $submission->form->title }}
</a>
</td>
<td>
<div class="text-truncate" style="max-width: 60%;">
@foreach($submission->submission as $key => $value)
<span class="text-body-secondary fs-10">{{ $key }}:</span>
<span class="text-body-secondary fs-10 fw-bold">
@php is_array($value) ? $value = implode(', ', $value) : $value = $value @endphp
@if (strpos($value, 'data:image') !== false) 🖼️ @else {{$value}} @endif
</span>

@if ($loop->index == 3) @break @else | @endif
@endforeach
</div>
</td>
<td class="align-middle text-end pe-1">{{ $submission->created_at->diffForHumans() }}</td>
<td class="align-middle text-center">{{ $submission->submission }}</td>
<td class="align-middle text-center">{{ $submission->pending_review }}</td>
<td class="align-middle text-end pe-1">{{ carbon()::parse($submission->latest_submission)->diffForHumans() }}</td>
</tr>
@endforeach
</tbody>
Expand Down

0 comments on commit 2910650

Please sign in to comment.