mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
puts cleanups
This commit is contained in:
parent
712371101e
commit
4c61c1c040
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")
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
.row
|
.row
|
||||||
|
|
||||||
.span6 style="background-color: #F8F8F8; margin-bottom: 30px"
|
.span6 style="background-color: #F8F8F8; margin-bottom: 30px"
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.span3
|
.span3
|
||||||
h3 style="margin-left: 20px": a href="http://#{site.username}.neocities.org" target="_blank" #{site.username}
|
h3 style="margin-left: 20px": a href="http://#{site.username}.neocities.org" target="_blank" #{site.username}
|
||||||
|
@ -26,4 +26,4 @@
|
||||||
li class="#{"active" if num == @current_page}": a href="/browse?current_page=#{num}" #{num}
|
li class="#{"active" if num == @current_page}": a href="/browse?current_page=#{num}" #{num}
|
||||||
|
|
||||||
- if @current_page != @page_count
|
- if @current_page != @page_count
|
||||||
li: a href="/browse?current_page=#{@current_page + 1}": i.icon-arrow-right style="font-size: 12pt"
|
li: a href="/browse?current_page=#{@current_page + 1}": i.icon-arrow-right style="font-size: 12pt"
|
||||||
|
|
Loading…
Add table
Reference in a new issue