fixing browse page
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
Agnes 2026-11-07 11:53:52 -05:00
parent 596fd85f2f
commit f9bd07f29f
15 changed files with 67 additions and 125 deletions

View file

@ -1,4 +1,5 @@
get '/browse/?' do get '/browse/?' do
params[:tag] = nil if params[:tag].to_s.strip.empty?
@page = params[:page] @page = params[:page]
@page = 1 if @page.not_an_integer? @page = 1 if @page.not_an_integer?
@description = 'Browse Neocities websites by tags, popularity, and recent updates.' @description = 'Browse Neocities websites by tags, popularity, and recent updates.'
@ -60,60 +61,60 @@ def browse_sites_dataset
return ds return ds
end end
params[:sort_by] ||= 'special_sauce' params[:sort_by] = 'special_sauce'
ds = ds.order :score.desc, :follow_count.desc, :views.desc, :site_updated_at.desc
case params[:sort_by] #case params[:sort_by]
when 'special_sauce' # when 'special_sauce'
ds = ds.where{score > 1} unless params[:tag] # ds = ds.where{score > 1} unless params[:tag]
ds = ds.order :score.desc, :follow_count.desc, :views.desc, :site_updated_at.desc # ds = ds.order :score.desc, :follow_count.desc, :views.desc, :site_updated_at.desc
when 'random' # when 'random'
ds = ds.where{score > 3} unless params[:tag] # ds = ds.where{score > 3} unless params[:tag]
ds = ds.order(Sequel.lit('RANDOM()')) # ds = ds.order(Sequel.lit('RANDOM()'))
when 'most_followed' #when 'most_followed'
ds = ds.where{views > Site::BROWSE_MINIMUM_FOLLOWER_VIEWS} # ds = ds.where{views > Site::BROWSE_MINIMUM_FOLLOWER_VIEWS}
ds = ds.where{follow_count > Site::BROWSE_FOLLOWER_MINIMUM_FOLLOWS} # 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.where{updated_at > Site::BROWSE_FOLLOWER_UPDATED_AT_CUTOFF.ago} unless params[:tag]
ds = ds.order :follow_count.desc, :score.desc, :updated_at.desc # ds = ds.order :follow_count.desc, :score.desc, :updated_at.desc
when 'last_updated' #=#hen 'last_updated'
ds = ds.where{score > 3} unless params[:tag] # ds = ds.where{score > 3} unless params[:tag]
ds = ds.exclude site_updated_at: nil #ds = ds.exclude site_updated_at: nil
ds = ds.order :site_updated_at.desc #ds = ds.order :site_updated_at.desc
when 'newest' #when 'newest'
ds = ds.where{views > Site::BROWSE_MINIMUM_VIEWS} unless current_site && current_site.is_admin # ds = ds.where{views > Site::BROWSE_MINIMUM_VIEWS} unless current_site && current_site.is_admin
ds = ds.exclude site_updated_at: nil #ds = ds.exclude site_updated_at: nil
ds = ds.order :created_at.desc, :views.desc #ds = ds.order :created_at.desc, :views.desc
when 'moderation' #when 'moderation'
not_found unless current_site && current_site.is_admin # not_found unless current_site && current_site.is_admin
ds = Site.moderation_dataset #ds = Site.moderation_dataset
ds = ds.order :created_at.desc #ds = ds.order :created_at.desc
when 'oldest' #when 'oldest'
ds = ds.where{score > 0.4} unless params[:tag] # ds = ds.where{score > 0.4} unless params[:tag]
ds = ds.exclude site_updated_at: nil #ds = ds.exclude site_updated_at: nil
ds = ds.order(:created_at, :views.desc) #ds = ds.order(:created_at, :views.desc)
when 'hits' #when 'hits'
ds = ds.where{score > 5} # ds = ds.where{score > 5}
ds = ds.order(:hits.desc, :site_updated_at.desc) #ds = ds.order(:hits.desc, :site_updated_at.desc)
when 'views' #when 'views'
ds = ds.where{score > 5} # ds = ds.where{score > 5}
ds = ds.order(:views.desc, :site_updated_at.desc) #ds = ds.order(:views.desc, :site_updated_at.desc)
when 'featured' #when 'featured'
ds = ds.exclude featured_at: nil # ds = ds.exclude featured_at: nil
ds = ds.order :featured_at.desc #ds = ds.order :featured_at.desc
when 'tipping_enabled' #when 'tipping_enabled'
ds = ds.where tipping_enabled: true # 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("(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.where{score > 1} unless params[:tag]
ds = ds.group :sites__id #ds = ds.group :sites__id
ds = ds.order :follow_count.desc, :views.desc, :updated_at.desc #ds = ds.order :follow_count.desc, :views.desc, :updated_at.desc
when 'blocks' #when 'blocks'
require_admin # require_admin
ds = ds.select{[sites.*, Sequel[count(site_id)].as(:total)]} #ds = ds.select{[sites.*, Sequel[count(site_id)].as(:total)]}
ds = ds.inner_join :blocks, :site_id => :id #ds = ds.inner_join :blocks, :site_id => :id
ds = ds.group :sites__id #ds = ds.group :sites__id
ds = ds.order :total.desc #ds = ds.order :total.desc
else #else
not_found # not_found
end #end
unless params[:sort_by] == 'moderation' unless params[:sort_by] == 'moderation'
ds = ds.where ['sites.is_nsfw = ?', (params[:is_nsfw] == 'true' ? true : false)] ds = ds.where ['sites.is_nsfw = ?', (params[:is_nsfw] == 'true' ? true : false)]

View file

@ -8,6 +8,7 @@ services:
ports: ports:
- "9292:9292" - "9292:9292"
volumes: volumes:
- ./public/css/neo.css:/app/public/css/neo.css
- .:/app - .:/app
- ./docker/config.yml.docker:/app/config.yml:ro - ./docker/config.yml.docker:/app/config.yml:ro
- site_files:/app/public/sites - site_files:/app/public/sites

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
public/img/catlogo-big.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
public/img/eneen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -4,7 +4,7 @@
code, kbd, pre, samp{ code, kbd, pre, samp{
@extend %margin-bottom; @extend %margin-bottom;
background:#16414c; background:lightpink;
border-left:6px solid #acd473; border-left:6px solid #acd473;
color:#a9b9b9; color:#a9b9b9;
display:block; display:block;

View file

@ -4,7 +4,7 @@
// Apply to <main> or top level <section> for styling // Apply to <main> or top level <section> for styling
.content-Base{ .content-Base{
background:$c-BG; background:lightpink;
min-height:500px; min-height:500px;
padding-bottom:50px; padding-bottom:50px;

View file

@ -13,25 +13,7 @@
<div class="col col-50 filter"> <div class="col col-50 filter">
<fieldset class="grouping"> <fieldset class="grouping">
<% unless is_education? %> <% unless is_education? %>
<label class="text-Label" for="sort_by">Sort by:</label> <label>Sites</label></div>
<div class="select-Container">
<select name="sort_by" id="sort_by" class="input-Select">
<option value="special_sauce" <%= params[:sort_by] == 'special_sauce' ? 'selected' : '' %>>Special Sauce</option>
<option value="random" <%= params[:sort_by] == 'random' ? 'selected' : '' %>>Random</option>
<option value="most_followed" <%= params[:sort_by] == 'most_followed' ? 'selected' : '' %>>Most Followed</option>
<option value="last_updated" <%= params[:sort_by] == 'last_updated' ? 'selected' : '' %>>Last Updated</option>
<option value="views" <%= params[:sort_by] == 'views' ? 'selected' : '' %>>Views</option>
<option value="tipping_enabled" <%= params[:sort_by] == 'tipping_enabled' ? 'selected' : '' %>>Tipping Enabled</option>
<% if signed_in? %>
<option value="newest" <%= params[:sort_by] == 'newest' ? 'selected' : '' %>>Newest</option>
<% end %>
<option value="oldest" <%= params[:sort_by] == 'oldest' ? 'selected' : '' %>>Oldest</option>
<% if current_site && current_site.is_admin %>
<option value="moderation" <%= params[:sort_by] == 'moderation' ? 'selected' : '' %>>Moderation</option>
<% end %>
<!-- <option value="robots" <%= params[:sort_by] == 'robots' ? 'selected' : '' %>>Robots</option> -->
</select>
</div>
<!-- <!--
<div> <div>
@ -57,16 +39,14 @@
</div> </div>
</div> </div>
</form> </form>
</div>
<div class="browse-page"> <div class="browse-page">
<% if @sites.empty? %>
<% if @sites.length == 0 %>
<div class="row website-Gallery content int-Gall" style="padding-left: 30px;"> <div class="row website-Gallery content int-Gall" style="padding-left: 30px;">
<h3>No active sites found.</h3> <h3>No active sites found.</h3>
<p>Try another search, or <a href="/browse">browse all sites</a>!</p> <p>Try another search, or <a href="/browse">browse all sites</a>!</p>
</div> </div>
<% else %> <% end %>
<ul class="row website-Gallery content int-Gall"> <ul class="row website-Gallery content int-Gall">
<% @sites.each_with_index do |site,i| %> <% @sites.each_with_index do |site,i| %>
<li id="username_<%= site.username %>"> <li id="username_<%= site.username %>">
@ -143,7 +123,6 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<% end %>
<% if params[:sort_by] != 'random' %> <% if params[:sort_by] != 'random' %>
<%== erb :'_pagination', layout: false %> <%== erb :'_pagination', layout: false %>

View file

@ -36,22 +36,20 @@
<div class="int-Logo hp-Logo"> <div class="int-Logo hp-Logo">
<a href="/" title="back to home"> <a href="/" title="back to home">
<span class="hidden">FEMSLASHCITY</span> <span class="hidden">FEMSLASHCITY</span> <img src="cat.png" width="65px" alt="FEMSLASHCITY!!" /></a>
<img src="/cat.png" alt="FEMSLASHCITY!!" />
</a>
</div> </div>
<section class="header-Intro"> <section class="header-Intro">
<h1 class="logo header-Content content"> <h1 class="logo header-Content content">
<span class="hidden">FEMSLASHCITY</span> <img src="/cat.png"/></h1> <span class="hidden">FEMSLASHCITY</span> <img src="/img/catlogo-big.png"/></h1>
</section> </section>
<div class="header-Outro"> <div class="header-Outro2"><div class="header-Outro">
<div class="row header-Content content"> <div class="row header-Content content">
<div class="col intro"> <div class="col intro">
<h2 class="section-header">A fork of the wonderful Neocities dedicated to femslash-related web hosting. Fans of femslash, shrines to femslash, etc. Invitation only; please email agnes@omg.lol to sign up. We also give you free supporter. No payments involved. Ya get 20GB of hosting and all of the neocities supporter features as well.</h2> <h2 class="section-header">A fork of the wonderful Neocities dedicated to femslash-related web hosting. Fans of femslash, shrines to femslash, etc. Invitation only; please email agnes@omg.lol to sign up. We also give you free supporter. No payments involved. Ya get 20GB of hosting and all of the neocities supporter features as well.</h2>
<p class="intro-text"> <p class="intro-text">
FEMSLASHCITY is a social network of <a href="/browse"><%= @sites_count.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse %> web sites</a> that are bringing back the lost individual creativity of the web. We offer free static web hosting and tools that allow you to create your own web site. Join us! FEMSLASHCITY is a social network of web sites that are bringing back the lost individual creativity of the web. We offer free static web hosting and tools that allow you to create your own web site. Join us!
</p> </p>
<ul class="intro-List"> <ul class="intro-List">
<li class="intro-Tools"> <li class="intro-Tools">
@ -70,7 +68,7 @@ What it does not feature is the Neocities CLI or the custom domain capabilities
</p> </p>
</li> </li>
</ul> </ul>
</div> </div></div>
<div class="col signup-Area"> <div class="col signup-Area">
<% if signed_in? %> <% if signed_in? %>
@ -175,43 +173,6 @@ What it does not feature is the Neocities CLI or the custom domain capabilities
<a href="/browse" class="btn-Action float-Right">Browse more sites</a> <a href="/browse" class="btn-Action float-Right">Browse more sites</a>
</div> </div>
<div class="section previews">
<h2 class="delta">Our mission: To make the web fun again by giving you back control of how you express yourself online.</h2>
<div class="row content">
<div class="col col-50"><div class="screenshot" style="background-image:url(/img/front-editor-screenshot.png)"></div></div>
<div class="col col-50 text">
<h3><i class="fa fa-edit"></i> HTML editor, right in your browser</h3>
<p>No tools needed. With our easy-to-use HTML editor, you're ready to start building your awesome website right now.</p>
<p>If you'd rather use your favorite desktop editor, no problem. Uploading files is as easy as drag-n-drop.</p>
</div>
</div>
<div class="row content right">
<div class="col col-50"><div class="screenshot" style="background-image:url(/img/front-browse-screenshot.jpg);"></div></div>
<div class="col col-50 text">
<h3><i class="fa fa-globe"></i> Welcome back, web surfing</h3>
<p>All FC sites are viewable and easily surfable in our <a href="/browse">website gallery</a>.</p>
<p>Using tags (our version of Web Rings) you can easily discover new sites related to your interests.</p>
</div>
</div>
<div class="row content">
<div class="col col-50"><div class="screenshot" style="background-image:url(/img/front-follow-screenshot.jpg);"></div></div>
<div class="col col-50 text">
<h3><i class="fa fa-user-plus"></i> Follow your favorite FC sites</h3>
<p>Keep track of all your favorite sites by following them. Any changes to the sites automatically show up in your news feed. You'll also see what sites they follow.</p>
</div>
</div>
<div class="row content right">
<div class="col col-50"><div class="screenshot" style="background-image:url(/img/front-comment-screenshot.png);"></div></div>
<div class="col col-50 text">
<h3><i class="fa fa-comments-o"></i> Web creativity plus community</h3>
<p>Interact with your favorite web builders by posting comments, and sharing their sites on your social network of choice.</p>
</div>
</div>
</div>
<section class="section features"> <section class="section features">
<div class="row"> <div class="row">