added hashtags
This commit is contained in:
parent
cf21d457bf
commit
d4adfc6b0e
|
|
@ -29,6 +29,7 @@ class VideoProsController < ApplicationController
|
||||||
end
|
end
|
||||||
def index
|
def index
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
|
request = OrbitHelper.request
|
||||||
module_app = ModuleApp.where(:key=>'video_pro').first
|
module_app = ModuleApp.where(:key=>'video_pro').first
|
||||||
page = OrbitHelper.page rescue Page.where(:url=>params[:url]).first
|
page = OrbitHelper.page rescue Page.where(:url=>params[:url]).first
|
||||||
page_categories = OrbitHelper.page_categories
|
page_categories = OrbitHelper.page_categories
|
||||||
|
|
@ -141,6 +142,11 @@ class VideoProsController < ApplicationController
|
||||||
video_images = video_images.where(:use_override_post_agency=>true, :override_post_agency=>selected_post_agency.split('-').last)
|
video_images = video_images.where(:use_override_post_agency=>true, :override_post_agency=>selected_post_agency.split('-').last)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if params[:hashtag].present?
|
||||||
|
video_images = video_images.where(video_tag_ids: params[:hashtag])
|
||||||
|
end
|
||||||
|
|
||||||
custom_data_field = (page.custom_data_field || {} rescue {})
|
custom_data_field = (page.custom_data_field || {} rescue {})
|
||||||
videos = get_videos(video_images, OrbitHelper.url_to_show(''), custom_data_field)
|
videos = get_videos(video_images, OrbitHelper.url_to_show(''), custom_data_field)
|
||||||
hd_icon_url = "/assets/video_pro/icon_hd.png"
|
hd_icon_url = "/assets/video_pro/icon_hd.png"
|
||||||
|
|
@ -149,13 +155,16 @@ class VideoProsController < ApplicationController
|
||||||
search_text1 = I18n.t("video_pro.search_text1")
|
search_text1 = I18n.t("video_pro.search_text1")
|
||||||
search_text2 = I18n.t("video_pro.search_text2")
|
search_text2 = I18n.t("video_pro.search_text2")
|
||||||
|
|
||||||
|
|
||||||
categories = categories.map do |category|
|
categories = categories.map do |category|
|
||||||
{"option"=>"<option value=\"#{category[:value]}\" #{category[:is_selected]}>#{category[:name]}</option>"}
|
{"option"=>"<option value=\"#{category[:value]}\" #{category[:is_selected]}>#{category[:name]}</option>"}
|
||||||
end
|
end
|
||||||
tags = tags.map do |tag|
|
tags = tags.map do |tag|
|
||||||
{"option"=>"<option value=\"#{tag[:value]}\" #{tag[:is_selected]}>#{tag[:name]}</option>"}
|
{"option"=>"<option value=\"#{tag[:value]}\" #{tag[:is_selected]}>#{tag[:name]}</option>"}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
hashtags = VideoTag.all.map do |tag|
|
||||||
|
{"hashtag" => tag.title, "hash_url" => request.base_url + request.path + "?hashtag=#{tag.id.to_s}", "selected" => (params[:hashtag] == tag.id.to_s ? "selected" : "")}
|
||||||
|
end
|
||||||
{
|
{
|
||||||
"extras" => {
|
"extras" => {
|
||||||
"search_placeholder" => search_placeholder,
|
"search_placeholder" => search_placeholder,
|
||||||
|
|
@ -171,6 +180,7 @@ class VideoProsController < ApplicationController
|
||||||
},
|
},
|
||||||
"categories" => categories,
|
"categories" => categories,
|
||||||
"tags" => tags,
|
"tags" => tags,
|
||||||
|
"hashtags" => hashtags,
|
||||||
"post_agencies" => post_agencies,
|
"post_agencies" => post_agencies,
|
||||||
"page_tabs" => page_tabs,
|
"page_tabs" => page_tabs,
|
||||||
"videos" => videos,
|
"videos" => videos,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue