Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the dashboard table properly responsive #1595

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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