add hashtag widget
This commit is contained in:
parent
4aa3e25e72
commit
71e4201fed
|
@ -434,4 +434,20 @@ class UniversalTablesController < ApplicationController
|
|||
"mind_map_data" => mindmap.mind_map_data
|
||||
}
|
||||
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
|
||||
|
|
|
@ -19,7 +19,7 @@ module UniversalTable
|
|||
OrbitApp.registration "UniversalTable", :type => "ModuleApp" do
|
||||
module_label "universal_table.universal_table"
|
||||
base_url File.expand_path File.dirname(__FILE__)
|
||||
widget_methods ["widget"]
|
||||
widget_methods ["widget","tag_cloud"]
|
||||
widget_settings [{"data_count"=>30}]
|
||||
# taggable "Bulletin"
|
||||
categorizable
|
||||
|
@ -38,7 +38,7 @@ module UniversalTable
|
|||
:priority=>1,
|
||||
:active_for_action=>{'admin/universal_table'=>'index'},
|
||||
:available_for => 'users'
|
||||
context_link 'universal_table.new_table',
|
||||
context_link 'universal_table.new_table',
|
||||
:link_path=>"new_admin_universal_table_path" ,
|
||||
:priority=>2,
|
||||
:active_for_action=>{'admin/universal_tables'=>'new'},
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
hi
|
Loading…
Reference in New Issue