fixes for site changed logic

This commit is contained in:
Kyle Drake 2015-06-25 00:31:25 -07:00
parent ba1b00cdb5
commit 2bb32e0091
4 changed files with 11 additions and 13 deletions

View file

@ -1099,7 +1099,7 @@ class Site < Sequel::Model
if results.include? true && opts[:new_install] != true
time = Time.now
sql = DB["update sites set site_changed=?, site_updated_at=?, updated_at=?, changed_count=changed_count+1, space_used=space_used#{new_size < 0 ? new_size.to_s : '+'+new_size.to_s} where id=?",
html_uploaded,
true,
time,
time,
self.id

View file

@ -11,8 +11,8 @@ describe '/' do
it 'loads the news feed with welcome' do
visit '/'
page.body.must_match /Neocities news feed/i
page.body.must_match /You arent following any websites yet/i
page.body.must_match /Thanks for joining the Neocities community/i
page.body.wont_match /You arent following any websites yet/i
end
it 'displays a follow and an unrelated follow' do

View file

@ -144,7 +144,7 @@ describe 'site_files' do
File.exists?(@site.thumbnail_path('test.jpg', resolution)).must_equal true
end
@site.site_changed.must_equal false
@site.site_changed.must_equal true
end
it 'fails with unsupported file' do

View file

@ -21,7 +21,13 @@
<div class="content misc-page columns right-col">
<div class="col-left">
<div class="col col-66">
<% if site.followings_dataset.count == 0 %>
<% if site.site_changed == false || site.changed_count == 0 %>
<div class="welcome">
<h4>Thanks for joining the Neocities community!</h4>
<p>Now start <a href="/dashboard">building your website</a>!</a>
</p>
</div>
<% elsif site.followings_dataset.count == 0 %>
<div class="welcome">
<h4>Welcome to your Neocities news feed!</h4>
<p>
@ -32,14 +38,6 @@
</div>
<% end %>
<% if !site.site_changed && site.followings_dataset.count > 0 %>
<div class="welcome">
<h4>Thanks for joining the Neocities community!</h4>
<p>Now start <a href="/dashboard">building your website</a>!</a>
</p>
</div>
<% end %>
<% if !@events.empty? %>
<%== erb :'_news', layout: false, locals: {site: current_site, events: @events} %>
<% end %>