Skip to content

Commit

Permalink
Make the dashboard table properly responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Feb 26, 2024
1 parent 1350c84 commit edc165e
Showing 1 changed file with 41 additions and 39 deletions.
80 changes: 41 additions & 39 deletions packages/realtime-compiler/resources/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,46 +228,48 @@
@endif
</div>
@else
<table class="table table-bordered">
<tr>
@foreach(['Page Type', 'Route Key', 'Source File', 'Output File', 'Identifier'] as $header)
<th>{{ $header }}</th>
@endforeach
<th class="text-end">Actions</th>
</tr>
@foreach($dashboard->getPageList() as $route)
<tr id="pageRow-{{ $route->getRouteKey() }}" @class(['page-table-row', $dashboard->getFlash('justCreatedPage') === $route->getRouteKey() ? 'justCreatedPage active' : ''])>
<td>
<code title="\{{ $route->getPageClass() }}">{{ class_basename($route->getPageClass()) }}</code>
</td>
<td>
{{ $route->getRouteKey() }}
</td>
<td>
{{ $route->getSourcePath() }}
</td>
<td>
{{ $route->getOutputPath() }}
</td>
<td>
{{ $route->getPageIdentifier() }}
</td>
<td class="text-end">
<div class="d-flex justify-content-end">
@if($dashboard->isInteractive())
<form class="buttonActionForm" action="" method="POST">
<input type="hidden" name="_token" value="{{ $csrfToken }}">
<input type="hidden" name="action" value="openPageInEditor">
<input type="hidden" name="routeKey" value="{{ $route->getRouteKey() }}">
<button type="submit" class="btn btn-outline-primary btn-sm me-2" title="Open in system default application">Edit</button>
</form>
@endif
<a href="{{ $route->getLink() }}" class="btn btn-outline-primary btn-sm" title="Open this page preview in browser">View</a>
</div>
</td>
<div class="table-responsive">
<table class="table table-bordered">
<tr>
@foreach(['Page Type', 'Route Key', 'Source File', 'Output File', 'Identifier'] as $header)
<th>{{ $header }}</th>
@endforeach
<th class="text-end">Actions</th>
</tr>
@endforeach
</table>
@foreach($dashboard->getPageList() as $route)
<tr id="pageRow-{{ $route->getRouteKey() }}" @class(['page-table-row', $dashboard->getFlash('justCreatedPage') === $route->getRouteKey() ? 'justCreatedPage active' : ''])>
<td>
<code title="\{{ $route->getPageClass() }}">{{ class_basename($route->getPageClass()) }}</code>
</td>
<td>
{{ $route->getRouteKey() }}
</td>
<td>
{{ $route->getSourcePath() }}
</td>
<td>
{{ $route->getOutputPath() }}
</td>
<td>
{{ $route->getPageIdentifier() }}
</td>
<td class="text-end">
<div class="d-flex justify-content-end">
@if($dashboard->isInteractive())
<form class="buttonActionForm" action="" method="POST">
<input type="hidden" name="_token" value="{{ $csrfToken }}">
<input type="hidden" name="action" value="openPageInEditor">
<input type="hidden" name="routeKey" value="{{ $route->getRouteKey() }}">
<button type="submit" class="btn btn-outline-primary btn-sm me-2" title="Open in system default application">Edit</button>
</form>
@endif
<a href="{{ $route->getLink() }}" class="btn btn-outline-primary btn-sm" title="Open this page preview in browser">View</a>
</div>
</td>
</tr>
@endforeach
</table>
</div>
@endif
</div>
</div>
Expand Down

0 comments on commit edc165e

Please sign in to comment.