diff --git a/app/controllers/universal_tables_controller.rb b/app/controllers/universal_tables_controller.rb index 72545a2..ba59fef 100755 --- a/app/controllers/universal_tables_controller.rb +++ b/app/controllers/universal_tables_controller.rb @@ -175,20 +175,17 @@ class UniversalTablesController < ApplicationController entries = entries.page(params["page_no"]).per(OrbitHelper.page_data_count) end else - if params[:tag] - tag = TableTag.where(:title => params[:tag], :u_table_id => table.id).first - end if paginated - if tag.nil? + if !params[:orbithashtag].present? entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}).can_display.sorting(params: params,table: table,page_num: params["page_no"],per: OrbitHelper.page_data_count) else - entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}, :table_tag_ids.in => [tag.id]).can_display.sorting(params: params,table: table,page_num: params["page_no"],per: OrbitHelper.page_data_count) + entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}).filter_by_hashtag(OrbitHelper.page_hashtag_id).can_display.sorting(params: params,table: table,page_num: params["page_no"],per: OrbitHelper.page_data_count) end else - if tag.nil? + if !params[:orbithashtag].present? entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}).can_display.sorting(params: params,table: table,paginated: false) else - entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}, :table_tag_ids.in => [tag.id]).can_display.sorting(params: params,table: table,paginated: false) + entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}).filter_by_hashtag(OrbitHelper.page_hashtag_id).can_display.sorting(params: params,table: table,paginated: false) end end end @@ -212,7 +209,7 @@ class UniversalTablesController < ApplicationController sorted = rows.sort{ |k,v| k["order"] <=> v["order"] } sorted << { "title" => t("universal_table.hashtags"), - "text" => entry.tags_for_frontend + "text" => entry.hashtags_for_frontend } entry.inc(view_count: 1) related_entries = [] @@ -434,7 +431,7 @@ class UniversalTablesController < ApplicationController cols << {"text" => ""} end end - text = te.tags_for_frontend + text = te.hashtags_for_frontend cols << {"text" => text} rows << { "columns" => cols diff --git a/app/models/table_entry.rb b/app/models/table_entry.rb index 2591794..118082a 100755 --- a/app/models/table_entry.rb +++ b/app/models/table_entry.rb @@ -2,6 +2,7 @@ class TableEntry include Mongoid::Document include Mongoid::Timestamps include OrbitModel::Status + include OrbitHashtag::Hashtaggable include Slug attr_accessor :sort_value diff --git a/app/views/admin/universal_tables/_entry_form.html.erb b/app/views/admin/universal_tables/_entry_form.html.erb index 26d2129..dcce3aa 100755 --- a/app/views/admin/universal_tables/_entry_form.html.erb +++ b/app/views/admin/universal_tables/_entry_form.html.erb @@ -3,10 +3,10 @@ <%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/fileupload" %> <%= stylesheet_link_tag "lib/main-list" %> - <%= stylesheet_link_tag "select2/select2" %> + <%#= stylesheet_link_tag "select2/select2" %> <% end %> <% content_for :page_specific_javascript do %> - <%= javascript_include_tag "select2/select2.min" %> + <%#= javascript_include_tag "select2/select2.min" %> <%= javascript_include_tag "lib/bootstrap-fileupload" %> <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> @@ -25,6 +25,7 @@