Support more than 6 thumbnails

This commit is contained in:
wayword 2024-12-13 17:46:11 -06:00
parent 16fb3444fa
commit 8817afd41b
3 changed files with 4 additions and 12 deletions

View file

@ -6,7 +6,7 @@ class SiteChange < Sequel::Model
one_to_one :site_change one_to_one :site_change
one_to_many :site_change_files one_to_many :site_change_files
def site_change_filenames(limit=6) def site_change_filenames(limit=30)
site_change_files_dataset.select(:filename).limit(limit).order(:created_at.desc).all.collect {|f| f.filename}.sort_by {|f| f.match('html') ? 0 : 1} site_change_files_dataset.select(:filename).limit(limit).order(:created_at.desc).all.collect {|f| f.filename}.sort_by {|f| f.match('html') ? 0 : 1}
end end

View file

@ -999,15 +999,7 @@ a.tag:hover {
.html-thumbnail { .html-thumbnail {
width: 102px; width: 102px;
} }
&:first-child .html-thumbnail.html { &.big-file .html-thumbnail.html {
width: 540px;
height: 405px;
@media (max-device-width:480px), screen and (max-width:800px) {
width: 270px;
height: 202px;
}
}
&:first-child .html-thumbnail.html img {
width: 540px; width: 540px;
height: 405px; height: 405px;
@media (max-device-width:480px), screen and (max-width:800px) { @media (max-device-width:480px), screen and (max-width:800px) {

View file

@ -92,8 +92,8 @@
<% unless site_change_filenames.empty? %> <% unless site_change_filenames.empty? %>
<div class="content"> <div class="content">
<div class="files"> <div class="files">
<% site_change_filenames.each do |f| %> <% site_change_filenames.each.with_index do |f, i| %>
<div class="file"> <div class="file <%= i == 0 && site_change_filenames.length <= 6 ? 'big-file' : '' %>">
<div class="html-thumbnail <%= site_change_file_display_class f %>"> <div class="html-thumbnail <%= site_change_file_display_class f %>">
<a href="https://<%= event_site.host %><%= f == 'index.html' ? '' : "/#{f}" %>"> <a href="https://<%= event_site.host %><%= f == 'index.html' ? '' : "/#{f}" %>">
<% if site_change_file_display_class(f) == 'html' %> <% if site_change_file_display_class(f) == 'html' %>