From 18280599185b635dccea301269be2e2d17afd4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Mon, 27 Mar 2023 21:54:22 +0800 Subject: [PATCH] support multiple tag --- app/controllers/video_pros_controller.rb | 4 ++-- app/views/video_pros/show.html.erb | 4 +++- modules/video_pro/_video_pro_widget1.html.erb | 2 +- modules/video_pro/video_pro_index2.html.erb | 2 +- modules/video_pro/video_pro_index2_tag.html.erb | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/video_pros_controller.rb b/app/controllers/video_pros_controller.rb index 91ae09c..1e8d7da 100644 --- a/app/controllers/video_pros_controller.rb +++ b/app/controllers/video_pros_controller.rb @@ -232,7 +232,7 @@ class VideoProsController < ApplicationController video_postdate = video_image.postdate.to_s video_category = video_image.category_title video_tags = video_image.tags - video_tag = (video_tags.count > 0 ? video_tags.first.name : video_category) + video_tags = (video_tags.count > 0 ? video_tags.collect{|tag| {video_tag: tag.name}} : [{video_tag: video_category}]) statuses = video_image.statuses_with_classname video_desc = video_image.desc video_desc_escape = video_desc.gsub('"',""") rescue "" @@ -255,7 +255,7 @@ class VideoProsController < ApplicationController "api_url" => api_url, "video_show_url" => show_url + slug, "video_category" => video_category, - "video_tag" => video_tag, + "video_tags" => video_tags, "statuses" => statuses, "video_post_agency" => video_post_agency, "video_postdate" => video_postdate, diff --git a/app/views/video_pros/show.html.erb b/app/views/video_pros/show.html.erb index 8daf263..5295645 100644 --- a/app/views/video_pros/show.html.erb +++ b/app/views/video_pros/show.html.erb @@ -23,7 +23,7 @@ video_scale = (video_image.scale ? video_image.scale : 56.25) video_category = video_image.category_title video_tags = video_image.tags - video_tag = (video_tags.count > 0 ? video_tags.first.name : video_category) + video_tags = (video_tags.count > 0 ? video_tags.collect{|tag| tag.name} : [video_category]) %>

<%= video_title %>

@@ -42,7 +42,9 @@ <% end %>
<%= video_post_agency %> | <%= video_postdate %>
+ <% video_tags.each do |video_tag| %>
<%= video_tag %>
+ <% end %>
<%= video_desc %>
HD diff --git a/modules/video_pro/_video_pro_widget1.html.erb b/modules/video_pro/_video_pro_widget1.html.erb index 9892e67..e2c1b79 100644 --- a/modules/video_pro/_video_pro_widget1.html.erb +++ b/modules/video_pro/_video_pro_widget1.html.erb @@ -5,7 +5,7 @@
{{video_post_agency}} | {{video_postdate}}
-
{{video_tag}}
+
{{video_tag}}

{{video_title}}

{{video_desc}}
diff --git a/modules/video_pro/video_pro_index2.html.erb b/modules/video_pro/video_pro_index2.html.erb index a3b5587..da8ccfc 100644 --- a/modules/video_pro/video_pro_index2.html.erb +++ b/modules/video_pro/video_pro_index2.html.erb @@ -27,7 +27,7 @@
{{video_post_agency}} | {{video_postdate}}
-
{{video_tag}}
+
{{video_tag}}

{{video_title}}

{{video_desc}}
diff --git a/modules/video_pro/video_pro_index2_tag.html.erb b/modules/video_pro/video_pro_index2_tag.html.erb index 5c87ab0..741c2bf 100644 --- a/modules/video_pro/video_pro_index2_tag.html.erb +++ b/modules/video_pro/video_pro_index2_tag.html.erb @@ -27,7 +27,7 @@
{{video_post_agency}} | {{video_postdate}}
-
{{video_tag}}
+
{{video_tag}}

{{video_title}}

{{video_desc}}