mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
Merge branch 'master' into newdesignv2
This commit is contained in:
commit
18b4ead54e
5 changed files with 23 additions and 10 deletions
6
app.rb
6
app.rb
|
@ -53,7 +53,7 @@ get '/browse' do
|
||||||
site_dataset.order!(:updated_at.desc, :hits.desc)
|
site_dataset.order!(:updated_at.desc, :hits.desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
site_dataset.filter!(is_nsfw: true) if params[:is_nsfw] == 'true'
|
site_dataset.filter! is_nsfw: (params[:is_nsfw] == 'true' ? true : false)
|
||||||
|
|
||||||
@page_count = site_dataset.page_count || 1
|
@page_count = site_dataset.page_count || 1
|
||||||
@sites = site_dataset.all
|
@sites = site_dataset.all
|
||||||
|
@ -279,7 +279,7 @@ post '/site_files/upload' do
|
||||||
current_site.update site_changed: true
|
current_site.update site_changed: true
|
||||||
end
|
end
|
||||||
|
|
||||||
current_site.update updated_at: Time.now
|
current_site.update changed_count: 1+current_site.changed_count, updated_at: Time.now
|
||||||
|
|
||||||
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
|
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
|
||||||
redirect '/dashboard'
|
redirect '/dashboard'
|
||||||
|
@ -349,7 +349,7 @@ post '/site_files/save/:filename' do |filename|
|
||||||
current_site.update site_changed: true
|
current_site.update site_changed: true
|
||||||
end
|
end
|
||||||
|
|
||||||
current_site.update updated_at: Time.now
|
current_site.update changed_count: 1+current_site.changed_count, updated_at: Time.now
|
||||||
|
|
||||||
'ok'
|
'ok'
|
||||||
end
|
end
|
||||||
|
|
11
migrations/016_site_updated_count.rb
Normal file
11
migrations/016_site_updated_count.rb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
Sequel.migration do
|
||||||
|
up {
|
||||||
|
DB.add_column :sites, :changed_count, :integer, default: 0
|
||||||
|
DB.add_index :sites, :changed_count
|
||||||
|
}
|
||||||
|
|
||||||
|
down {
|
||||||
|
DB.drop_column :sites, :changed_count
|
||||||
|
DB.drop_index :sites, :changed_count
|
||||||
|
}
|
||||||
|
end
|
|
@ -8,7 +8,7 @@
|
||||||
<a href="/" title="Back to the Start">NeoCities</a>
|
<a href="/" title="Back to the Start">NeoCities</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/browse" title="Browse NeoCities member websites">Browse</a>
|
<a href="/browse" title="Browse NeoCities member websites">Websites</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/tutorials" title="Learn to code with these tutorials">Tutorials</a>
|
<a href="/tutorials" title="Learn to code with these tutorials">Tutorials</a>
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
<a href="/" title="back to the start">NeoCities</a>
|
<a href="/" title="back to the start">NeoCities</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/browse" title="Browse NeoCities member websites">Browse</a>
|
<a href="/browse" title="Browse NeoCities member websites">Websites</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="/tutorials" title="Learn to code with these tutorials">Tutorials</a>
|
<a href="/tutorials" title="Learn to code with these tutorials">Tutorials</a>
|
||||||
|
@ -200,7 +200,9 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a href="/browse" title="Browse all Neocities websites" class="action-Link">Browse all Websites</a>
|
<div class="txt-Center" style="margin-top: 15px">
|
||||||
|
<a href="/browse" title="Browse all Neocities websites" class="btn-Action btn-Large">Browse All Websites</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
</section> <!-- end .featured-Websites -->
|
</section> <!-- end .featured-Websites -->
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'RMagick'
|
||||||
|
|
||||||
class ScreenshotWorker
|
class ScreenshotWorker
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
sidekiq_options queue: :screenshots, retry: 1, backtrace: true
|
sidekiq_options queue: :screenshots, retry: 3, backtrace: true
|
||||||
|
|
||||||
def perform(username)
|
def perform(username)
|
||||||
screenshot = Tempfile.new 'neocities_screenshot'
|
screenshot = Tempfile.new 'neocities_screenshot'
|
||||||
|
|
Loading…
Add table
Reference in a new issue