Merge branch 'master' of github.com:kyledrake/neocities-web

This commit is contained in:
Kyle Drake 2013-06-20 21:21:10 -07:00
commit 0bf9ccc746
3 changed files with 3 additions and 8 deletions

6
app.rb
View file

@ -38,9 +38,7 @@ get '/browse' do
@current_page = params[:current_page] || 1
@current_page = @current_page.to_i
site_dataset = Site.order(:id.desc).filter(~{updated_at: nil}).paginate(@current_page, 100)
@page_count = site_dataset.page_count
@page_count = site_dataset.page_count || 1
@sites = site_dataset.all
slim :browse
end
@ -175,8 +173,6 @@ get '/site_files/:username.zip' do |username|
Zip::ZipFile.open(file_path, Zip::ZipFile::CREATE) do |zipfile|
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)
end
end

View file

@ -28,7 +28,6 @@ class ScreenshotJob
screenshot.unlink
img_list.new_image(img_list.first.columns, img_list.first.rows) { self.background_color = "white" }
img = img_list.reverse.flatten_images
puts 'boners'
img.crop!(0, 0, 1280, 720)
img.resize! 600, 400
img.write File.join(DIR_ROOT, 'public', 'site_screenshots', "#{username}.jpg")

View file

@ -8,7 +8,7 @@
.row
.span6 style="background-color: #F8F8F8; margin-bottom: 30px"
.row
.span3
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}
- 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"