Style tables better, use table for pin list

This commit is contained in:
Citlali del Rey 2023-02-22 20:20:39 -08:00
parent dca00fe3a3
commit 019e7eddff
Signed by: nullobsi
GPG Key ID: 933A1F44222C2634
2 changed files with 49 additions and 10 deletions

View File

@ -102,6 +102,31 @@ label.field-with-error {
color: red;
}
/* Tables */
table {
border-collapse: collapse;
}
th, td {
padding: 5px;
}
th {
border-bottom: solid 2px currentColor;
}
td:first-child {
border-right: solid 2px currentColor;
border-left: none;
}
td {
border-right: solid 2px currentColor;
border-left: solid 2px currentColor;
}
td:last-child {
border-right: none;
border-left: solid 2px currentColor;
}
/* Light mode */
@media (prefers-color-scheme: light) {
body {

View File

@ -19,18 +19,32 @@
<%= $count %> pins found.
</p>
<ul>
% for my $pin (@$pins) {
<li>
<a href="<%= $pin->{publicUrl} %>"><%= $pin->{name} || $pin->{cid} %></a>:
<a href="/my/pins/<%= $pin->{id} %>/delete">Delete</a>
<small>Created by: <%= $pin->{app_name} %></small>
</li>
% }
</ul>
% if (scalar @$pins == 0) {
<p>Seems like there's nothing here.</p>
% } elsif (scalar @$pins == $limit) {
% } else {
<table>
<tr>
<th>Filename</th>
<th>Created By</th>
<th>Actions</th>
</tr>
% for my $pin (@$pins) {
<tr>
<td>
<a href="<%= $pin->{publicUrl} %>"><%= $pin->{name} || $pin->{cid} %></a>
</td>
<td>
<%= $pin->{app_name} %>
</td>
<td>
<a href="/my/pins/<%= $pin->{id} %>/delete">Delete</a>
</td>
</tr>
% }
</table>
% }
% if (scalar @$pins == $limit) {
<a href="<%= url_with->query({before => $nextPage}) %>">Next page</a>
% }