From c075b1d4724635a0d301fbbdeb06f621793b42cd Mon Sep 17 00:00:00 2001 From: Aidan Cornelius-Bell Date: Sat, 18 Jan 2025 17:48:15 +1030 Subject: [PATCH] Added some corner-case handling for users from a.c-b.com --- app/assets/stylesheets/application.css | 4 ++++ app/controllers/pubview_controller.rb | 11 +++++++++++ app/views/pubview/index.html.erb | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 75155dd..d604755 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -421,6 +421,10 @@ footer p { max-width: 80%; } +#no-a-style { + color: var(--accent-b); +} + .lead-button { text-decoration: none; border: 1px dashed var(--link-color); diff --git a/app/controllers/pubview_controller.rb b/app/controllers/pubview_controller.rb index 5864bce..6bd93f4 100644 --- a/app/controllers/pubview_controller.rb +++ b/app/controllers/pubview_controller.rb @@ -7,6 +7,17 @@ class PubviewController < ApplicationController @page = params[:page].to_i || 1 @filter = params[:filter] || 'all' + if params[:from] == "a...com" || session[:cbcom] == "true" + @cbcom = true + session[:cbcom] = "true" + puts "DEBUG: Matched condition #{@cbcom} #{session[:cbcom]} SET" + end + if params[:from] == "clear" + @cbcom = false + session.delete(:cbcom) + puts "DEBUG: Matched condition #{@cbcom} #{session[:cbcom]} CLEAR" + end + @items = Post.get_posts_and_bookmarks_with_pagination(@page, @per_page, @filter) @total_pages = @items.total_pages @current_page = @items.current_page diff --git a/app/views/pubview/index.html.erb b/app/views/pubview/index.html.erb index ada59d2..ec3a855 100644 --- a/app/views/pubview/index.html.erb +++ b/app/views/pubview/index.html.erb @@ -2,7 +2,10 @@ <%= link_to root_path do %> <%= image_tag "icon-512.png", class: "logo", alt: "mind reader logo" %> <% end %> -

mind reader <% if ["9/1", "8/2", "14/2", "12/4"].include?(Time.current.strftime("%-d/%-m")) %>acb❦pab<% end %>

+

mind reader <% if ["9/1", "8/2", "14/2", "12/4"].include?(Time.current.strftime("%-d/%-m")) %> + acb❦pab<% end %><% if ["7/2", "9/2"].include?(Time.current.strftime("%-d/%-m")) %> + luxuriating in my anxiety<% end %><% if @cbcom === true %> + click to return to cornelius-bell.com<% end %>

An anti-capitalist blog of dispatches and links from Aidan Cornelius-Bell

-- 2.39.5