From 1384756b81c719f899359efc9125e80fae8614c0 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 1 Aug 2026 14:46:04 +0200 Subject: Allow aggregate to order by slug and paint chapters list more nicely --- app/helpers/content_helper.rb | 3 +++ app/helpers/link_helper.rb | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb index 9d52c110..b2603481 100644 --- a/app/helpers/content_helper.rb +++ b/app/helpers/content_helper.rb @@ -98,6 +98,9 @@ module ContentHelper # order_by="published_at" # order_direction="DESC" # ] + # + # order_by currently takes id, published_at, created_at, updated_at, title + # and slug def aggregate? content diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index 2121133e..21e4da59 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb @@ -21,8 +21,9 @@ module LinkHelper active = (page_path == path.sub(/^\//, "")) end - active_class = active ? {:class => 'active'} : {:class => 'inactive'} - html_options = html_options.merge(active_class) + html_options = html_options.merge( + :class => [html_options[:class], active ? "active" : "inactive"].compact.join(" ") + ) locale = (params[:locale] || I18n.locale).to_sym == I18n.default_locale ? nil : (params[:locale] || I18n.locale) link_to( -- cgit v1.3