diff --git a/app/site.rb b/app/site.rb index a6d0e397..91f88ec7 100644 --- a/app/site.rb +++ b/app/site.rb @@ -134,7 +134,7 @@ post '/site/:username/comment' do |username| site.is_blocking?(current_site) || current_site.is_blocking?(site) || current_site.commenting_allowed? == false) - redirect "/site/#{username}" + redirect request.referrer end site.add_profile_comment( @@ -142,7 +142,7 @@ post '/site/:username/comment' do |username| message: params[:message] ) - redirect "/site/#{username}" + redirect request.referrer end get '/site/:username/tip' do |username| diff --git a/views/home.erb b/views/home.erb index 61926895..6bfdea6d 100644 --- a/views/home.erb +++ b/views/home.erb @@ -36,6 +36,9 @@ Below are some website suggestions for you. For more, check out all the sites on Neocities!
+ <% else %> + <%== erb :'site/_profile_comments', locals: {site: site} %> + <% end %> <% if !@events.empty? %> diff --git a/views/site.erb b/views/site.erb index 2a095281..c8d67edb 100644 --- a/views/site.erb +++ b/views/site.erb @@ -64,34 +64,7 @@+ <% if current_site.commenting_too_much? %> + To prevent spam, we have a <%= Site::MAX_COMMENTS_PER_DAY %> comment per day limit. Please try commenting again tomorrow! + <% else %> + To prevent spam, you cannot comment until you have updated your site <%= Site::COMMENTING_ALLOWED_UPDATED_COUNT %> times (on <%= Site::COMMENTING_ALLOWED_UPDATED_COUNT %> separate days), and your account is one week old. While waiting, now is a great time to start building your awesome site! + <% end %> +
+ <% end %> +
- <% if current_site.commenting_too_much? %> - To prevent spam, we have a <%= Site::MAX_COMMENTS_PER_DAY %> comment per day limit. Please try commenting again tomorrow! - <% else %> - To prevent spam, you cannot comment until you have updated your site <%= Site::COMMENTING_ALLOWED_UPDATED_COUNT %> times (on <%= Site::COMMENTING_ALLOWED_UPDATED_COUNT %> separate days), and your account is one week old. While waiting, now is a great time to start building your awesome site! - <% end %> -
- <% end %> -