diff --git a/app/browse.rb b/app/browse.rb index e8615a7..fa4bcf4 100644 --- a/app/browse.rb +++ b/app/browse.rb @@ -1,4 +1,5 @@ get '/browse/?' do + params[:tag] = nil if params[:tag].to_s.strip.empty? @page = params[:page] @page = 1 if @page.not_an_integer? @description = 'Browse Neocities websites by tags, popularity, and recent updates.' @@ -60,60 +61,60 @@ def browse_sites_dataset return ds end - params[:sort_by] ||= 'special_sauce' - - case params[:sort_by] - when 'special_sauce' - ds = ds.where{score > 1} unless params[:tag] - ds = ds.order :score.desc, :follow_count.desc, :views.desc, :site_updated_at.desc - when 'random' - ds = ds.where{score > 3} unless params[:tag] - ds = ds.order(Sequel.lit('RANDOM()')) - when 'most_followed' - ds = ds.where{views > Site::BROWSE_MINIMUM_FOLLOWER_VIEWS} - ds = ds.where{follow_count > Site::BROWSE_FOLLOWER_MINIMUM_FOLLOWS} - ds = ds.where{updated_at > Site::BROWSE_FOLLOWER_UPDATED_AT_CUTOFF.ago} unless params[:tag] - ds = ds.order :follow_count.desc, :score.desc, :updated_at.desc - when 'last_updated' - ds = ds.where{score > 3} unless params[:tag] - ds = ds.exclude site_updated_at: nil - ds = ds.order :site_updated_at.desc - when 'newest' - ds = ds.where{views > Site::BROWSE_MINIMUM_VIEWS} unless current_site && current_site.is_admin - ds = ds.exclude site_updated_at: nil - ds = ds.order :created_at.desc, :views.desc - when 'moderation' - not_found unless current_site && current_site.is_admin - ds = Site.moderation_dataset - ds = ds.order :created_at.desc - when 'oldest' - ds = ds.where{score > 0.4} unless params[:tag] - ds = ds.exclude site_updated_at: nil - ds = ds.order(:created_at, :views.desc) - when 'hits' - ds = ds.where{score > 5} - ds = ds.order(:hits.desc, :site_updated_at.desc) - when 'views' - ds = ds.where{score > 5} - ds = ds.order(:views.desc, :site_updated_at.desc) - when 'featured' - ds = ds.exclude featured_at: nil - ds = ds.order :featured_at.desc - when 'tipping_enabled' - ds = ds.where tipping_enabled: true - ds = ds.where("(tipping_paypal is not null and tipping_paypal != '') or (tipping_bitcoin is not null and tipping_bitcoin != '')") - ds = ds.where{score > 1} unless params[:tag] - ds = ds.group :sites__id - ds = ds.order :follow_count.desc, :views.desc, :updated_at.desc - when 'blocks' - require_admin - ds = ds.select{[sites.*, Sequel[count(site_id)].as(:total)]} - ds = ds.inner_join :blocks, :site_id => :id - ds = ds.group :sites__id - ds = ds.order :total.desc - else - not_found - end + params[:sort_by] = 'special_sauce' + ds = ds.order :score.desc, :follow_count.desc, :views.desc, :site_updated_at.desc + #case params[:sort_by] + # when 'special_sauce' + # ds = ds.where{score > 1} unless params[:tag] + # ds = ds.order :score.desc, :follow_count.desc, :views.desc, :site_updated_at.desc + # when 'random' + # ds = ds.where{score > 3} unless params[:tag] + # ds = ds.order(Sequel.lit('RANDOM()')) + #when 'most_followed' + # ds = ds.where{views > Site::BROWSE_MINIMUM_FOLLOWER_VIEWS} + # ds = ds.where{follow_count > Site::BROWSE_FOLLOWER_MINIMUM_FOLLOWS} + # ds = ds.where{updated_at > Site::BROWSE_FOLLOWER_UPDATED_AT_CUTOFF.ago} unless params[:tag] + # ds = ds.order :follow_count.desc, :score.desc, :updated_at.desc + #=#hen 'last_updated' + # ds = ds.where{score > 3} unless params[:tag] + #ds = ds.exclude site_updated_at: nil + #ds = ds.order :site_updated_at.desc + #when 'newest' + # ds = ds.where{views > Site::BROWSE_MINIMUM_VIEWS} unless current_site && current_site.is_admin + #ds = ds.exclude site_updated_at: nil + #ds = ds.order :created_at.desc, :views.desc + #when 'moderation' + # not_found unless current_site && current_site.is_admin + #ds = Site.moderation_dataset + #ds = ds.order :created_at.desc + #when 'oldest' + # ds = ds.where{score > 0.4} unless params[:tag] + #ds = ds.exclude site_updated_at: nil + #ds = ds.order(:created_at, :views.desc) + #when 'hits' + # ds = ds.where{score > 5} + #ds = ds.order(:hits.desc, :site_updated_at.desc) + #when 'views' + # ds = ds.where{score > 5} + #ds = ds.order(:views.desc, :site_updated_at.desc) + #when 'featured' + # ds = ds.exclude featured_at: nil + #ds = ds.order :featured_at.desc + #when 'tipping_enabled' + # ds = ds.where tipping_enabled: true + #ds = ds.where("(tipping_paypal is not null and tipping_paypal != '') or (tipping_bitcoin is not null and tipping_bitcoin != '')") + #ds = ds.where{score > 1} unless params[:tag] + #ds = ds.group :sites__id + #ds = ds.order :follow_count.desc, :views.desc, :updated_at.desc + #when 'blocks' + # require_admin + #ds = ds.select{[sites.*, Sequel[count(site_id)].as(:total)]} + #ds = ds.inner_join :blocks, :site_id => :id + #ds = ds.group :sites__id + #ds = ds.order :total.desc + #else + # not_found + #end unless params[:sort_by] == 'moderation' ds = ds.where ['sites.is_nsfw = ?', (params[:is_nsfw] == 'true' ? true : false)] diff --git a/docker-compose.yml b/docker-compose.yml index ca83217..79953cb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,7 @@ services: ports: - "9292:9292" volumes: + - ./public/css/neo.css:/app/public/css/neo.css - .:/app - ./docker/config.yml.docker:/app/config.yml:ro - site_files:/app/public/sites diff --git a/public/cat.png b/public/cat.png index 75786e0..aa48fed 100644 Binary files a/public/cat.png and b/public/cat.png differ diff --git a/public/img/cat-larger.png b/public/img/cat-larger.png index 75786e0..aa48fed 100644 Binary files a/public/img/cat-larger.png and b/public/img/cat-larger.png differ diff --git a/public/img/cat.png b/public/img/cat.png index 75786e0..aa48fed 100644 Binary files a/public/img/cat.png and b/public/img/cat.png differ diff --git a/public/img/catlogo-big.png b/public/img/catlogo-big.png new file mode 100644 index 0000000..2354d13 Binary files /dev/null and b/public/img/catlogo-big.png differ diff --git a/public/img/eneen.png b/public/img/eneen.png new file mode 100644 index 0000000..d3d16f7 Binary files /dev/null and b/public/img/eneen.png differ diff --git a/public/img/favicon.png b/public/img/favicon.png index 3a82705..aa48fed 100644 Binary files a/public/img/favicon.png and b/public/img/favicon.png differ diff --git a/public/img/kidpix-1793826300264s.png b/public/img/kidpix-1793826300264s.png new file mode 100644 index 0000000..2354d13 Binary files /dev/null and b/public/img/kidpix-1793826300264s.png differ diff --git a/public/img/neocity.png b/public/img/neocity.png index d3d16f7..0d4b0c6 100644 Binary files a/public/img/neocity.png and b/public/img/neocity.png differ diff --git a/public/u1f48c_u2712-ufe0f.png b/public/u1f48c_u2712-ufe0f.png new file mode 100644 index 0000000..2354d13 Binary files /dev/null and b/public/u1f48c_u2712-ufe0f.png differ diff --git a/sass/_base-sass/_type-Code.scss b/sass/_base-sass/_type-Code.scss index 70e4115..5997b32 100644 --- a/sass/_base-sass/_type-Code.scss +++ b/sass/_base-sass/_type-Code.scss @@ -4,7 +4,7 @@ code, kbd, pre, samp{ @extend %margin-bottom; - background:#16414c; + background:lightpink; border-left:6px solid #acd473; color:#a9b9b9; display:block; diff --git a/sass/_project-sass/_project-Main.scss b/sass/_project-sass/_project-Main.scss index ec1ab3b..c0a0076 100644 --- a/sass/_project-sass/_project-Main.scss +++ b/sass/_project-sass/_project-Main.scss @@ -4,7 +4,7 @@ // Apply to
or top level
for styling .content-Base{ - background:$c-BG; + background:lightpink; min-height:500px; padding-bottom:50px; diff --git a/views/browse.erb b/views/browse.erb index 49ba454..75e71a2 100644 --- a/views/browse.erb +++ b/views/browse.erb @@ -13,25 +13,7 @@
<% unless is_education? %> - -
- -
+