fix error

This commit is contained in:
BOYA,CHIU 2021-08-24 23:43:30 +08:00
parent 034339bcc2
commit 5f4fe041b2
2 changed files with 57 additions and 51 deletions

View File

@ -562,31 +562,33 @@ class EventNewsController < ApplicationController
"event_news_files" => files, "event_news_files" => files,
"event_news_links" => links, "event_news_links" => links,
"event_carousel_images" => event_carousel_images, "event_carousel_images" => event_carousel_images,
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'), "data" => {
"host-head" => EventNewsCustomTitle.get_trans('host'), "speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
"notes-head" => t('event_news.notes'), "host-head" => EventNewsCustomTitle.get_trans('host'),
"speaker-css" => (event_news.speaker.blank? ? "display: none;" : ""), "notes-head" => t('event_news.notes'),
"host-css" => (event_news.host.blank? ? "display: none;" : ""), "speaker-css" => (event_news.speaker.blank? ? "display: none;" : ""),
"speaker" => event_news.speaker, "host-css" => (event_news.host.blank? ? "display: none;" : ""),
"host" => event_news.host, "speaker" => event_news.speaker,
"notes" => event_news.notes, "host" => event_news.host,
"title" => event_news.title, "notes" => event_news.notes,
"subtitle_ann" => subtitle_ann, "title" => event_news.title,
"update_user" => update_user, "subtitle_ann" => subtitle_ann,
"updated_at" => event_time, "update_user" => update_user,
"body" =>event_news.text, "updated_at" => event_time,
"image" => event_news.image.url, "body" =>event_news.text,
"img_src" => img_src, "image" => event_news.image.url,
"img_description" => img_description, "img_src" => img_src,
"hide_class" => event_news.display_img? ? event_news.image_display_class : ' hide', "img_description" => img_description,
"alt_title" => desc, "hide_class" => event_news.display_img? ? event_news.image_display_class : ' hide',
"resume_btn_title" => resume_btn_title, "alt_title" => desc,
"pause_btn_title" => pause_btn_title, "resume_btn_title" => resume_btn_title,
"prev_btn_title" => prev_btn_title, "pause_btn_title" => pause_btn_title,
"next_btn_title" => next_btn_title, "prev_btn_title" => prev_btn_title,
"carousel_display_style" => (event_carousel_images.count == 0 ? 'display: none' : "width: #{event_news.carousel_image_width};margin: auto;"), "next_btn_title" => next_btn_title,
"carousel_count" => event_carousel_images.count, "carousel_display_style" => (event_carousel_images.count == 0 ? 'display: none' : "width: #{event_news.carousel_image_width};margin: auto;"),
"place_text" => (event_news.place.present? rescue false) ? "#{EventNewsCustomTitle.get_trans("place")}: #{event_news.place}" : "", "carousel_count" => event_carousel_images.count,
"place_text" => (event_news.place.present? rescue false) ? "#{EventNewsCustomTitle.get_trans("place")}: #{event_news.place}" : ""
},
"impressionist" => (event_news.is_preview ? nil : event_news), "impressionist" => (event_news.is_preview ? nil : event_news),
"url_to_edit"=>url_to_edit "url_to_edit"=>url_to_edit
} }
@ -656,32 +658,34 @@ class EventNewsController < ApplicationController
"event_news_files" => files, "event_news_files" => files,
"event_news_links" => links, "event_news_links" => links,
"event_carousel_images" => event_carousel_images, "event_carousel_images" => event_carousel_images,
"title" => event_news["title_translations"][locale], "data" => {
"subtitle_ann" => subtitle_ann, "title" => event_news["title_translations"][locale],
"update_user" => update_user, "subtitle_ann" => subtitle_ann,
"updated_at" => event_time, "update_user" => update_user,
"body" => event_news["text_translations"][locale], "updated_at" => event_time,
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'), "body" => event_news["text_translations"][locale],
"host-head" => EventNewsCustomTitle.get_trans('host'), "speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
"notes-head" => t('event_news.notes'), "host-head" => EventNewsCustomTitle.get_trans('host'),
"event_date-head" => EventNewsCustomTitle.get_trans('event_date'), "notes-head" => t('event_news.notes'),
"speaker-css" => (speaker.blank? ? "display: none;" : ""), "event_date-head" => EventNewsCustomTitle.get_trans('event_date'),
"host-css" => (host.blank? ? "display: none;" : ""), "speaker-css" => (speaker.blank? ? "display: none;" : ""),
"speaker" => speaker, "host-css" => (host.blank? ? "display: none;" : ""),
"host" => host, "speaker" => speaker,
"notes" => (event_news["notes_translations"][locale].to_s rescue ""), "host" => host,
"image" => event_news["image"]["original"], "notes" => (event_news["notes_translations"][locale].to_s rescue ""),
"img_src" => img_src, "image" => event_news["image"]["original"],
"img_description" => img_description, "img_src" => img_src,
"hide_class" => event_news["display_img"] ? '' : ' hide', "img_description" => img_description,
"alt_title" => desc, "hide_class" => event_news["display_img"] ? '' : ' hide',
"resume_btn_title" => resume_btn_title, "alt_title" => desc,
"pause_btn_title" => pause_btn_title, "resume_btn_title" => resume_btn_title,
"prev_btn_title" => prev_btn_title, "pause_btn_title" => pause_btn_title,
"next_btn_title" => next_btn_title, "prev_btn_title" => prev_btn_title,
"carousel_display_style" => (event_carousel_images.count == 0 ? 'display: none' : "width: #{EventNewsSetting.last.carousel_image_width};margin: auto;"), "next_btn_title" => next_btn_title,
"carousel_count" => event_carousel_images.count, "carousel_display_style" => (event_carousel_images.count == 0 ? 'display: none' : "width: #{EventNewsSetting.last.carousel_image_width};margin: auto;"),
"place_text" => (event_news["place"].present? rescue false) ? "#{I18n.t("event_news.place")}: #{event_news["place"]}" : "", "carousel_count" => event_carousel_images.count,
"place_text" => (event_news["place"].present? rescue false) ? "#{I18n.t("event_news.place")}: #{event_news["place"]}" : ""
},
"impressionist" => nil, "impressionist" => nil,
"url_to_edit" => url_to_edit "url_to_edit" => url_to_edit
} }

View File

@ -56,6 +56,8 @@ module EventNewsHelper
"event_news_links" => links, "event_news_links" => links,
"event_news_files" => files, "event_news_files" => files,
"title" => a.title, "title" => a.title,
"speaker-css" => (a.speaker.blank? ? "display: none;" : ""),
"host-css" => (a.host.blank? ? "display: none;" : ""),
"speaker" => a.speaker, "speaker" => a.speaker,
"place" => a.place, "place" => a.place,
"host" => a.host, "host" => a.host,