mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
Merge branch 'master' of github.com:kyledrake/neocities-web
This commit is contained in:
commit
0bf9ccc746
3 changed files with 3 additions and 8 deletions
6
app.rb
6
app.rb
|
@ -38,9 +38,7 @@ get '/browse' do
|
||||||
@current_page = params[:current_page] || 1
|
@current_page = params[:current_page] || 1
|
||||||
@current_page = @current_page.to_i
|
@current_page = @current_page.to_i
|
||||||
site_dataset = Site.order(:id.desc).filter(~{updated_at: nil}).paginate(@current_page, 100)
|
site_dataset = Site.order(:id.desc).filter(~{updated_at: nil}).paginate(@current_page, 100)
|
||||||
|
@page_count = site_dataset.page_count || 1
|
||||||
@page_count = site_dataset.page_count
|
|
||||||
|
|
||||||
@sites = site_dataset.all
|
@sites = site_dataset.all
|
||||||
slim :browse
|
slim :browse
|
||||||
end
|
end
|
||||||
|
@ -175,8 +173,6 @@ get '/site_files/:username.zip' do |username|
|
||||||
|
|
||||||
Zip::ZipFile.open(file_path, Zip::ZipFile::CREATE) do |zipfile|
|
Zip::ZipFile.open(file_path, Zip::ZipFile::CREATE) do |zipfile|
|
||||||
current_site.file_list.collect {|f| f.filename}.each do |filename|
|
current_site.file_list.collect {|f| f.filename}.each do |filename|
|
||||||
puts filename
|
|
||||||
puts site_file_path(filename)
|
|
||||||
zipfile.add filename, site_file_path(filename)
|
zipfile.add filename, site_file_path(filename)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,6 @@ class ScreenshotJob
|
||||||
screenshot.unlink
|
screenshot.unlink
|
||||||
img_list.new_image(img_list.first.columns, img_list.first.rows) { self.background_color = "white" }
|
img_list.new_image(img_list.first.columns, img_list.first.rows) { self.background_color = "white" }
|
||||||
img = img_list.reverse.flatten_images
|
img = img_list.reverse.flatten_images
|
||||||
puts 'boners'
|
|
||||||
img.crop!(0, 0, 1280, 720)
|
img.crop!(0, 0, 1280, 720)
|
||||||
img.resize! 600, 400
|
img.resize! 600, 400
|
||||||
img.write File.join(DIR_ROOT, 'public', 'site_screenshots', "#{username}.jpg")
|
img.write File.join(DIR_ROOT, 'public', 'site_screenshots', "#{username}.jpg")
|
||||||
|
|
Loading…
Add table
Reference in a new issue