Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
336a55f
Implement search_by_params for all of the taggable models
maebeale Dec 15, 2025
d386f9a
Change admin page colors and ordering
maebeale Dec 15, 2025
caba9f7
Change all decorators to inherit from ApplicationDecorator. Change de…
maebeale Dec 15, 2025
7561653
Allow tailwind_paginate to work on decorator collections
maebeale Dec 15, 2025
c27175c
Add scope to 'with_taggings' to filter only those with xx-able_items
maebeale Dec 15, 2025
b749cf5
Add order_by_date scope to workshop
maebeale Dec 15, 2025
7dad220
Fix description default for workshop_series_membership
maebeale Dec 15, 2025
f85291e
Enhance workshop_search_service to handle/convert names -> ids as needed
maebeale Dec 15, 2025
82a65d8
Change dashboard header text for sections
maebeale Dec 15, 2025
81902f4
Call detail instead of description (so we have a universal signature …
maebeale Dec 15, 2025
6ce19ed
Change facilitator search box to use new param name (sector_names)
maebeale Dec 15, 2025
69aa4fa
Add tags/index, taggings/index, taggings/matrix
maebeale Dec 20, 2025
dbe3a83
Remove page param and @section_styles from taggings controller
maebeale Dec 20, 2025
1fe8ae8
Show all published tags on Tags index, even if there are no taggings …
maebeale Dec 20, 2025
21ecb86
Fix pagination_helper to work w draper collections
maebeale Dec 20, 2025
b3df066
Add color helpers in tag model
maebeale Dec 20, 2025
88edf22
Don't return any results from TaggingSearchService if params are empty
maebeale Dec 20, 2025
f428863
Fix registration_close_date display to fix test
maebeale Dec 20, 2025
945b610
Fix div classes for dropdowns to work
maebeale Dec 20, 2025
e4216b7
Show all sectors as footer buttons on tags index, even if they have n…
maebeale Dec 20, 2025
20acf04
Change display on taggings index, and get color from Tag.bg_class_for
maebeale Dec 20, 2025
59b5131
Change 'sector' word to 'service population'
maebeale Dec 20, 2025
bd1b076
Update aws-sdk-s3 gem, per vulnerability scan
maebeale Dec 20, 2025
c87280c
Add windows_type_filterable model concern
maebeale Dec 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ GEM
actionpack (>= 5.0)
activesupport (>= 5.0)
aws-eventstream (1.4.0)
aws-partitions (1.1159.0)
aws-sdk-core (3.232.0)
aws-partitions (1.1198.0)
aws-sdk-core (3.240.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
base64
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
aws-sdk-kms (1.112.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sdk-kms (1.118.0)
aws-sdk-core (~> 3, >= 3.239.1)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.199.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sdk-s3 (1.208.0)
aws-sdk-core (~> 3, >= 3.234.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/community_news_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class CommunityNewsController < ApplicationController
def index
per_page = params[:number_of_items_per_page].presence || 25
unpaginated = current_user.super_user? ? CommunityNews.all : Community_news.published
unpaginated = unpaginated.search_by_params(params)
@community_news_count = unpaginated.count
@community_news = unpaginated.paginate(page: params[:page], per_page: per_page)
end
Expand Down
93 changes: 46 additions & 47 deletions app/controllers/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ def index
@resources = Resource.includes(:windows_type, :main_image, :gallery_images)
.featured
.published
.published_kinds
.order(ordering: :asc, created_at: :desc)
.decorate
@stories = Story.includes(:windows_type, :main_image, :gallery_images)
.featured.published
.featured
.published
.order(:title)
.decorate
@community_news = CommunityNews.includes(:windows_type, :main_image, :gallery_images)
Expand All @@ -25,77 +25,76 @@ def index
.decorate
@events = Event.includes(:event_registrations, :main_image, :gallery_images)
.featured
.publicly_visible
.published
.order(:start_date)
.decorate
end

def admin
if current_user.super_user?
@user_content_cards = [
{ title: "Bookmarks tally", path: tally_bookmarks_path, icon: "🔖",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
{ title: "Recent portal activity", path: dashboard_recent_activities_path, icon: "🧭",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
{ title: "Event Registrations", path: event_registrations_path, icon: "🎟️",
bg_color: "bg-blue-100", text_color: "text-blue-800" },
{ title: "Quotes", path: quotes_path, icon: "💬",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
{ title: "Story Ideas", path: story_ideas_path, icon: "✍️️",
bg_color: "bg-rose-100", text_color: "text-rose-800" },
{ title: "Workshop Variations", path: workshop_variations_path, icon: "🔀",
bg_color: "bg-purple-100", text_color: "text-purple-800" },
{ title: "Workshop Ideas", path: workshop_ideas_path, icon: "💡",
bg_color: "bg-indigo-100", text_color: "text-indigo-800" },


{ title: "!!!Vision Seeds", path: authenticated_root_path, icon: "🌱",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
{ title: "!!!Annual Reports", path: authenticated_root_path, icon: "📊",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
{ title: "Workshop Logs", path: workshop_logs_path, icon: "📝",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
]

@system_cards = [
{ title: "Banners", path: banners_path, icon: "📣",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
{ title: "CommunityNews", path: community_news_index_path, icon: "📣",
bg_color: "bg-orange-50", text_color: "text-gray-800" },
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "CommunityNews", path: community_news_index_path, icon: "📰",
bg_color: "bg-orange-50", hover_bg_color: "bg-orange-100", text_color: "text-gray-800" },
{ title: "Events", path: events_path, icon: "📆",
bg_color: "bg-blue-50", text_color: "text-gray-800" },
bg_color: "bg-blue-50", hover_bg_color: "bg-blue-100", text_color: "text-gray-800" },
{ title: "FAQs", path: faqs_path, icon: "❔",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
{ title: "Stories", path: stories_path, icon: "🗣️",
bg_color: "bg-rose-50", text_color: "text-gray-800" },
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "Resources", path: resources_path, icon: "📚",
bg_color: "bg-violet-50", text_color: "text-gray-800" },
bg_color: "bg-violet-50", hover_bg_color: "bg-violet-100", text_color: "text-gray-800" },
{ title: "Stories", path: stories_path, icon: "🗣️",
bg_color: "bg-rose-50", hover_bg_color: "bg-rose-100", text_color: "text-gray-800" },
{ title: "Tags matrix", path: tags_matrix_path, icon: "🏷️",
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "Workshops", path: workshops_path, icon: "🎨",
bg_color: "bg-indigo-50", text_color: "text-gray-800" },



bg_color: "bg-indigo-50", hover_bg_color: "bg-indigo-100", text_color: "text-gray-800" },

{ title: "Facilitators", path: facilitators_path, icon: "🧑‍🎨",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
bg_color: "bg-sky-50", hover_bg_color: "bg-sky-100", text_color: "text-gray-800" },
{ title: "Organizations", path: projects_path, icon: "🏫",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
bg_color: "bg-emerald-50", hover_bg_color: "bg-emerald-100", text_color: "text-gray-800" },
{ title: "User accounts", path: users_path, icon: "👥",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "!!!Forms", path: authenticated_root_path, icon: "📋",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
]

@user_content_cards = [
{ title: "Bookmarks tally", path: tally_bookmarks_path, icon: "🔖",
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "Recent portal activity", path: dashboard_recent_activities_path, icon: "🧭",
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "Event Registrations", path: event_registrations_path, icon: "🎟️",
bg_color: "bg-blue-100", hover_bg_color: "bg-blue-200", text_color: "text-blue-800" },
{ title: "Quotes", path: quotes_path, icon: "💬",
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "!!!Vision Seeds", path: authenticated_root_path, icon: "🌱",
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "Story Ideas", path: story_ideas_path, icon: "✍️️",
bg_color: "bg-rose-100", hover_bg_color: "bg-rose-200", text_color: "text-rose-800" },
{ title: "Workshop Variations", path: workshop_variations_path, icon: "🔀",
bg_color: "bg-purple-100", hover_bg_color: "bg-purple-200", text_color: "text-purple-800" },
{ title: "Workshop Ideas", path: workshop_ideas_path, icon: "💡",
bg_color: "bg-indigo-100", hover_bg_color: "bg-indigo-200", text_color: "text-indigo-800" },
{ title: "Workshop Logs", path: workshop_logs_path, icon: "📝",
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "!!!Annual Reports", path: authenticated_root_path, icon: "📊",
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },

]


@reference_cards = [
{ title: "!!!Categories", path: authenticated_root_path, icon: "🗂️",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "!!!Sectors", path: authenticated_root_path, icon: "🏭",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "!!!Project Statuses", path: authenticated_root_path, icon: "🧮️",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
{ title: "WindowsTypes", path: windows_types_path, icon: "🪟",
bg_color: "bg-gray-50", text_color: "text-gray-800" },
bg_color: "bg-gray-50", hover_bg_color: "bg-gray-100", text_color: "text-gray-800" },
# { title: "FormFields", path: authenticated_root_path, icon: "✏️",
# bg_color: "bg-gray-50", text_color: "text-gray-800" },
# { title: "FormAnswerOptions", path: authenticated_root_path, icon: "🗳️",
Expand Down
1 change: 1 addition & 0 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class EventsController < ApplicationController

def index
unpaginated = current_user.super_user? ? Event.all : Event.published
unpaginated = unpaginated.search_by_params(params)
@events = unpaginated.order(start_date: :desc)
end

Expand Down
4 changes: 3 additions & 1 deletion app/controllers/quotes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ class QuotesController < ApplicationController

def index
per_page = params[:number_of_items_per_page].presence || 25
unpaginated = Quote.where.not(quote: [nil, ""]).order(created_at: :desc)
unpaginated = Quote.where.not(quote: [nil, ""])
.search_by_params(params)
.order(created_at: :desc)
@quotes_count = unpaginated.count
@quotes = unpaginated.paginate(page: params[:page], per_page: per_page)
end
Expand Down
1 change: 1 addition & 0 deletions app/controllers/stories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class StoriesController < ApplicationController
def index
per_page = params[:number_of_items_per_page].presence || 25
unpaginated = current_user.super_user? ? Story.all : Story.published
unpaginated = unpaginated.search_by_params(params)
@stories = unpaginated.includes(:windows_type, :project, :workshop, :created_by, :updated_by)
.order(created_at: :desc)
.paginate(page: params[:page], per_page: per_page)
Expand Down
91 changes: 91 additions & 0 deletions app/controllers/taggings_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
class TaggingsController < ApplicationController
def index
@sector_names = params[:sector_names].to_s
@category_names = params[:category_names].to_s

number_of_items_per_page = params[:number_of_items_per_page].present? ? params[:number_of_items_per_page].to_i : 9
pages = {
workshops: params[:workshops_page],
resources: params[:resources_page],
stories: params[:stories_page],
community_news: params[:community_news_page],
events: params[:events_page],
facilitators: params[:facilitators_page],
projects: params[:projects_page],
quotes: params[:quotes_page]
}

@grouped_tagged_items = TaggingSearchService.call(sector_names: @sector_names,
category_names: @category_names,
pages: pages,
number_of_items_per_page: number_of_items_per_page)
end

def matrix
@sectors =
Sector
.joins(:sectorable_items)
.published
.distinct
.order(:name)

@categories =
Category
.joins(:category_type, :categorizable_items)
.published
.select("categories.*, metadata.name AS category_type_name")
.distinct
.order("category_type_name ASC, categories.name ASC")



# ------------------------------------------------------------------
# 1. Build raw counts (SOURCE OF TRUTH)
# ------------------------------------------------------------------
@model_heatmap_stats = {}

Tag::TAGGABLE_MODELS.each do |key, model_class|
@model_heatmap_stats[key] = { sector: {}, category: {} }

model_class
.published
.joins(:sectors)
.group("sectors.id")
.count
.each do |sector_id, count|
@model_heatmap_stats[key][:sector][sector_id] = count
end

model_class
.published
.joins(:categories)
.group("categories.id")
.count
.each do |category_id, count|
@model_heatmap_stats[key][:category][category_id] = count
end
end

# ------------------------------------------------------------------
# 2. Compute quantiles FROM counts
# ------------------------------------------------------------------
@model_heatmap_quantiles = {}

@model_heatmap_stats.each do |key, dimensions|
@model_heatmap_quantiles[key] = {}

dimensions.each do |type, counts|
values = counts.values.sort
next if values.empty?

@model_heatmap_quantiles[key][type] = {
q20: values[(values.length * 0.2).floor],
q40: values[(values.length * 0.4).floor],
q60: values[(values.length * 0.6).floor],
q80: values[(values.length * 0.8).floor]
}
end
end
end

end
23 changes: 23 additions & 0 deletions app/controllers/tags_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class TagsController < ApplicationController
def index
@sectors =
Sector
.includes(:sectorable_items)
.references(:sectorable_items)
.published
.distinct
.order(:name)

categories =
Category
.includes(:category_type, :categorizable_items)
.references(:category_type, :categorizable_items)
.published
.select("categories.*, metadata.name AS category_type_name")
.distinct
.order("category_type_name ASC, categories.name ASC")

@categories_by_type = categories.group_by(&:category_type_name)
end

end
15 changes: 15 additions & 0 deletions app/decorators/application_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class ApplicationDecorator < Draper::Decorator
delegate_all

def link_target
object.respond_to?(:website_url) && object.website_url.present? ?
object.website_url :
default_link_target
end

private

def default_link_target
h.polymorphic_path(object)
end
end
5 changes: 2 additions & 3 deletions app/decorators/banner_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
class BannerDecorator < Draper::Decorator
delegate_all
class BannerDecorator < ApplicationDecorator

def title
content.truncate(50)
end

def description
def detail
content
end

Expand Down
5 changes: 2 additions & 3 deletions app/decorators/bookmark_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
class BookmarkDecorator < Draper::Decorator
delegate_all
class BookmarkDecorator < ApplicationDecorator
delegate :current_page, :total_pages, :limit_value
decorates_association :bookmarkable

def title
"Bookmark of #{bookmarkable_class_name} ##{bookmarkable.id}"
end

def description
def detail
"Bookmarkable: #{bookmarkable_class_name} ##{bookmarkable.id} (#{bookmarkable.title})"
end

Expand Down
3 changes: 1 addition & 2 deletions app/decorators/category_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
class CategoryDecorator < Draper::Decorator
delegate_all
class CategoryDecorator < ApplicationDecorator
end
5 changes: 2 additions & 3 deletions app/decorators/category_type_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
class CategoryTypeDecorator < Draper::Decorator
delegate_all
class CategoryTypeDecorator < ApplicationDecorator

def title
name.titleize
end

def description
def detail
end
end
Loading