This commit is contained in:
BoHung Chiu 2022-12-26 18:46:26 +08:00
parent b9dd7d9afc
commit 5e2a171e94
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,10 @@ class WebResourcesController < ApplicationController
end
def widget
links = WebLink.where(:title.ne => "").can_display.filter_by_widget_categories
cats = OrbitHelper.widget_categories || []
tags = OrbitHelper.widget_tags || []
tags = ['all'] if tags.blank?
links = WebLink.where(:title.ne => "").can_display.filter_by_categories(cats, false).filter_by_tags(tags)
web_link = links.collect do |link|
statuses = link.statuses_with_classname.collect do |status|
{