Skip to content

Commit

Permalink
Merge pull request #1595 from hydephp/fix-dashboard-table-should-grow…
Browse files Browse the repository at this point in the history
…-to-fit-container

Make the dashboard table properly responsive
  • Loading branch information
caendesilva committed Feb 26, 2024
2 parents 34ca9e4 + d70879a commit 00f1cdc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 40 deletions.
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This serves two purposes:
- for now removed features.

### Fixed
- for any bug fixes.
- Realtime Compiler: Fixed responsive dashboard table issue in https://github.com/hydephp/develop/pull/1595

### Security
- in case of vulnerabilities.
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 d-block overflow-x-auto">
<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 00f1cdc

Please sign in to comment.