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

RFC Mobile Tables #508

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ViewTemplates/Sites/item_extensions.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class="btn btn-outline-danger btn-sm" role="button">
@yield('extUpdateFilters')
@yield('extUpdateScheduleInfo')

<table class="table table-striped table-responsive">
<table class="table table-striped table-responsive is-mobile-stack">
<thead class="table-dark">
<tr>
<th>
Expand Down Expand Up @@ -396,7 +396,7 @@ class="btn btn-outline-danger btn-sm" role="button">
($hasUpdate ? ' filter-unscheduled' : '');
?>
<tr class="{{ $cssClasses }}">
<td>
<td data-label="@lang('PANOPTICON_SITE_LBL_EXTENSIONS_NAME')">
<div>
<span class="text-body-tertiary">
@yieldRepeatable('extUpdateExtensionIcon', $item)
Expand Down Expand Up @@ -485,7 +485,7 @@ class="ms-2 btn btn-outline-primary btn-sm" role="button">
@endif
@endif
</td>
<td class="small">
<td data-label="@lang('PANOPTICON_SITE_LBL_EXTENSIONS_AUTHOR')" class="small">
<div class="extensions-filterable-author">
@if ($item->authorUrl)
<a href="{{ (str_starts_with($item->authorUrl, 'http://') || str_starts_with($item->authorUrl, 'https://') || str_starts_with($item->authorUrl, '//')) ? '' : '//' }}{{{ $item->authorUrl }}}" target="_blank">
Expand All @@ -501,7 +501,7 @@ class="ms-2 btn btn-outline-primary btn-sm" role="button">
</div>
@endif
</td>
<td>
<td data-label="@lang('PANOPTICON_SITE_LBL_EXTENSIONS_VERSION')">
@if ($hasUpdate && $error)
<strong class="text-danger-emphasis">
{{{ $item->version->current }}}
Expand Down
2 changes: 1 addition & 1 deletion media/css/theme.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion media/css/theme.min.css.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions media/scss/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// PNP additional utility classes must be loaded before Bootstrap
@import "section/pnp/utilities";
@import "section/pnp/ismobilestack";

@import "../../node_modules/bootstrap/scss/bootstrap";

Expand Down
38 changes: 38 additions & 0 deletions media/scss/section/pnp/_ismobilestack.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* @package panopticon
* @copyright Copyright (c)2023-2024 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license https://www.gnu.org/licenses/agpl-3.0.txt GNU Affero General Public License, version 3 or later
*/

// alternative method to display tables on mobile

@media screen and (max-width: 567px) {
.table.is-mobile-stack {
thead {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important;
}

tbody tr,
tbody th,
tbody td {
display: block;
}

tbody th::before,
tbody td::before {
font-weight: 700;
display: inline-block;
content: attr(data-label);
min-width: 25%;
}
}
}