add hashtag widget

This commit is contained in:
rulingcom 2025-06-09 21:27:49 +08:00
parent 4aa3e25e72
commit 71e4201fed
3 changed files with 19 additions and 2 deletions

View File

@ -434,4 +434,20 @@ class UniversalTablesController < ApplicationController
"mind_map_data" => mindmap.mind_map_data "mind_map_data" => mindmap.mind_map_data
} }
end end
def tag_cloud
tables = UTable.filter_by_widget_categories(OrbitHelper.widget_categories,false)
tags = TableTag.where(:u_table_id.in => tables.pluck(:id))
hashtags = tags.map do |tag|
{
"title" => "##{tag.title}",
"count" => tag.table_entries.count,
"url_to_show" => "#{OrbitHelper.widget_more_url}?tag=#{tag.title}"
}
end
{
"hashtags" => hashtags,
"extras" => {}
}
end
end end

View File

@ -19,7 +19,7 @@ module UniversalTable
OrbitApp.registration "UniversalTable", :type => "ModuleApp" do OrbitApp.registration "UniversalTable", :type => "ModuleApp" do
module_label "universal_table.universal_table" module_label "universal_table.universal_table"
base_url File.expand_path File.dirname(__FILE__) base_url File.expand_path File.dirname(__FILE__)
widget_methods ["widget"] widget_methods ["widget","tag_cloud"]
widget_settings [{"data_count"=>30}] widget_settings [{"data_count"=>30}]
# taggable "Bulletin" # taggable "Bulletin"
categorizable categorizable

View File

@ -0,0 +1 @@
hi