diff --git a/app/controllers/video_pros_controller.rb b/app/controllers/video_pros_controller.rb index 27e2c8a..a837622 100644 --- a/app/controllers/video_pros_controller.rb +++ b/app/controllers/video_pros_controller.rb @@ -40,6 +40,17 @@ class VideoProsController < ApplicationController categories += categories_for_page.map do |c| {:name=>c.title, :value=>c.id.to_s} end + + page_tags = OrbitHelper.page_tags + tags = [{:name=>I18n.t("video_pro.all_tag"), :value=>"all"}] + if page_tags.blank? || page_tags.include?('all') + tags_for_page = Tag.where(:module_app_id=>ModuleApp.where(:key=>'video_pro').pluck(:id).first) + else + tags_for_page = Tag.where(:id=>page_tags) + end + tags += tags_for_page.map do |c| + {:name=>c.title, :value=>c.id.to_s} + end selected_category = params["category"] if selected_category.present? && selected_category != 'all' categories.each do |h| @@ -100,8 +111,24 @@ class VideoProsController < ApplicationController page_tabs[0]["klass"] = "now_view" end selected_tag = params['tags'] + page_title = page.title + + + tags = tags.map do |tag| + {"option"=>""} + end if selected_tag.present? + tags.each do |h| + if h[:value] == selected_tag + h[:is_selected] = "selected" + break + end + end filter_tags = [selected_tag] + tag = Tag.where(selected_tag).first + if tag + page_title = tag.title + end else filter_tags = OrbitHelper.page_tags end @@ -138,8 +165,10 @@ class VideoProsController < ApplicationController "hd_icon_url" => hd_icon_url, "view_icon_url" => view_icon_url, "more" => "More", + "page-title" => page_title }, "categories" => categories, + "tags" => tags, "post_agencies" => post_agencies, "page_tabs" => page_tabs, "videos" => videos, diff --git a/config/locales/en.yml b/config/locales/en.yml index f692bde..fa9e35b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -9,6 +9,7 @@ en: search_text1: "Search" search_text2: "Search" all_category: "All Category" + all_tag: "All Tag" view_count: "View Count" the_same_as_publisher: "The same as Publisher" other: "Other" diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index a67aed9..f1e3e6b 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -9,6 +9,7 @@ zh_tw: search_text1: "搜尋" search_text2: "查詢" all_category: "全部類別" + all_tag: "全部標籤" view_count: "觀看人數" the_same_as_publisher: "同發佈人" other: "其他" diff --git a/modules/video_pro/info.json b/modules/video_pro/info.json index 6a8cd59..5c1b39b 100644 --- a/modules/video_pro/info.json +++ b/modules/video_pro/info.json @@ -38,6 +38,15 @@ }, "thumbnail" : "thumb.png" }, + { + "filename" : "video_pro_index2_tag", + "force_cover": "true", + "name" : { + "zh_tw" : "2-1. 影片列表1 + 標籤 + 搜尋 ( 縮圖, 影片資訊, 頁面連結)", + "en" : "2-1. Video List 1 + Tag filter + Search ( snapshot, video info, page link)" + }, + "thumbnail" : "thumb.png" + }, { "filename" : "video_pro_index3", "force_cover": "true", diff --git a/modules/video_pro/video_pro_index1.html.erb b/modules/video_pro/video_pro_index1.html.erb index 3a9c0cf..56b4769 100644 --- a/modules/video_pro/video_pro_index1.html.erb +++ b/modules/video_pro/video_pro_index1.html.erb @@ -1,4 +1,5 @@