Only show the Hashtags column when the table has hashtagged entries

This commit is contained in:
rulingcom committed 2026-10-15 18:51:55 +08:00
1 parent 1d0fe65f74
commit 25adc82695
1 file changed
+6 -3
@@ -401,6 +401,7 @@ class UniversalTablesController < ApplicationController
rows = []
entries = get_entries(params, table, page)
total_pages = entries.total_pages
show_hashtags = Hashtagging.where(:hashtaggable_id.in => TableEntry.where(:u_table_id => table.id).pluck(:id)).exists?
table_heads << {
"title" => t("universal_table.hashtags"),
"type" => "hashtag",
@@ -411,7 +412,7 @@ class UniversalTablesController < ApplicationController
"sort-class" => "sort hide",
"sort-url" => "",
"title-class" => " no-search"
}
}if show_hashtags
if have_serial_number
page_no_offset = (params_no.present? ? [0, params_no.to_i - 1].max : 0)
serial_number_count = page_no_offset * OrbitHelper.page_data_count
@@ -455,8 +456,10 @@ class UniversalTablesController < ApplicationController
cols << {"text" => ""}
end
end
text = te.hashtags_for_frontend
cols << {"text" => text}
if show_hashtags
text = te.hashtags_for_frontend
cols << {"text" => text}
end
rows << {
"columns" => cols
}