Add tag output and customizable tag-head label to event_news index

This commit is contained in:
rulingcom 2026-07-31 18:11:09 +08:00
parent 5de458bbdb
commit eaf462fe45
4 changed files with 6 additions and 2 deletions

View File

@ -104,7 +104,8 @@ class EventNewsModsController < ApplicationController
"img_description" => desc,
"more" => t("event_news.more"),
"view_count" => a.view_count,
"orbithashtags" => a.hashtags_for_frontend
"orbithashtags" => a.hashtags_for_frontend,
"tag" => a.tags_for_frontend
}
else
a
@ -123,6 +124,7 @@ class EventNewsModsController < ApplicationController
"extras" => {
"widget-title" =>t('event_news.event_news'),
"category-head" => EventNewsCustomTitle.get_trans('category'),
"tag-head" => EventNewsCustomTitle.get_trans('tag'),
"title-head" => EventNewsCustomTitle.get_trans('title'),
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
"place-head" => EventNewsCustomTitle.get_trans('place'),

View File

@ -3,7 +3,7 @@ class EventNewsCustomTitle
include Mongoid::Timestamps
field :key
field :title, type: String, localize: true
KEYS = ['category', 'title','speaker','host','event_date','event_end_date','place','notes']
KEYS = ['category','tag','title','speaker','host','event_date','event_end_date','place','notes']
def self.get_map
KEYS.map do |k|
s = self.where(key: k).first || self.create(key: k,title_translations: I18n.available_locales.map{|l| [l,I18n.with_locale(l){I18n.t("event_news.#{k}")}]}.to_h)

View File

@ -15,6 +15,7 @@ en:
enable_manually_sort: Enable Manually Sort
manual_update_sort: Manually Update Sort
category: Category
tag: Tag
event_date_setting: "Event date setting"
event_date_use_default_setting: "Event date use default setting"
including_day_of_the_week: "Including day of the week"

View File

@ -15,6 +15,7 @@ zh_tw:
enable_manually_sort: 開啟手動排序
manual_update_sort: 手動更新排序
category: 類別
tag: 標籤
event_date_setting: "事件日期設定"
event_date_use_default_setting: "使用預設的事件日期設定"
including_day_of_the_week: "包含星期幾"