From 8c8aeb451b07f2a34eff241feb2c362e33917f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 21 Oct 2021 12:14:15 +0800 Subject: [PATCH] add place --- app/controllers/event_news_controller.rb | 2 ++ app/helpers/event_news_helper.rb | 1 + update_event_news.rb | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/event_news_controller.rb b/app/controllers/event_news_controller.rb index b4f8830..3fe0788 100644 --- a/app/controllers/event_news_controller.rb +++ b/app/controllers/event_news_controller.rb @@ -33,6 +33,7 @@ class EventNewsController < ApplicationController "speaker" => a.speaker, "speaker-css" => (a.speaker.blank? ? "display: none;" : ""), "place" => a.place, + "place-css" => (a.place.blank? ? "display: none;" : ""), "host" => a.host, "host-css" => (a.host.blank? ? "display: none;" : ""), "notes" => a.notes, @@ -816,6 +817,7 @@ class EventNewsController < ApplicationController "title" => a.title, "speaker-css" => (a.speaker.blank? ? "display: none;" : ""), "host-css" => (a.host.blank? ? "display: none;" : ""), + "place-css" => (a.place.blank? ? "display: none;" : ""), "speaker" => a.speaker, "place" => a.place, "host" => a.host, diff --git a/app/helpers/event_news_helper.rb b/app/helpers/event_news_helper.rb index ef06fcb..df97e9d 100644 --- a/app/helpers/event_news_helper.rb +++ b/app/helpers/event_news_helper.rb @@ -48,6 +48,7 @@ module EventNewsHelper "title" => a.title, "speaker-css" => (a.speaker.blank? ? "display: none;" : ""), "host-css" => (a.host.blank? ? "display: none;" : ""), + "place-css" => (a.place.blank? ? "display: none;" : ""), "speaker" => a.speaker, "place" => a.place, "host" => a.host, diff --git a/update_event_news.rb b/update_event_news.rb index 069e085..f3a46d9 100644 --- a/update_event_news.rb +++ b/update_event_news.rb @@ -52,7 +52,8 @@ def update_event_news_template(folder) next if (c.include?("???") rescue true) flag1,c = add_css_style_for_block(c,'speaker-head','speaker','speaker-css') flag2,c = add_css_style_for_block(c,'host-head','host','host-css') - if flag1 || flag2 + flag3,c = add_css_style_for_block(c,'place-head','place','place-css') + if flag1 || flag2 || flag3 puts ['update file:',f] File.open(f,'w'){|f1| f1.write(c)} end