Add tag output and customizable tag-head label to index

This commit is contained in:
rulingcom 2026-07-31 18:28:33 +08:00
parent bfa8c2dcad
commit 0856be3afa
4 changed files with 6 additions and 2 deletions

View File

@ -106,7 +106,8 @@ class RecruitmentModsController < ApplicationController
"img_description" => desc,
"more" => t("recruitment.more"),
"view_count" => a.view_count,
"orbithashtags" => a.hashtags_for_frontend
"orbithashtags" => a.hashtags_for_frontend,
"tag" => a.tags_for_frontend
}
else
a
@ -125,6 +126,7 @@ class RecruitmentModsController < ApplicationController
"extras" => {
"widget-title" =>t('recruitment.recruitment'),
"category-head" => RecruitmentCustomTitle.get_trans('category'),
"tag-head" => RecruitmentCustomTitle.get_trans('tag'),
"title-head" => RecruitmentCustomTitle.get_trans('title'),
"education_requirement-head" => RecruitmentCustomTitle.get_trans('education_requirement'),
"experience_requirement-head" => RecruitmentCustomTitle.get_trans('experience_requirement'),

View File

@ -3,7 +3,7 @@ class RecruitmentCustomTitle
include Mongoid::Timestamps
field :key
field :title, type: String, localize: true
KEYS = ['category', 'title', 'recruitment_date', 'education_requirement', 'experience_requirement', 'skills_requirement', 'language', 'salary_info', 'notes', 'contact_info']
KEYS = ['category', 'tag', 'title', 'recruitment_date', 'education_requirement', 'experience_requirement', 'skills_requirement', 'language', 'salary_info', 'notes', 'contact_info']
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("recruitment.#{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
title: Title
recruitment_date_setting: "Event date setting"
recruitment_date_use_default_setting: "Use default event date setting"

View File

@ -15,6 +15,7 @@ zh_tw:
enable_manually_sort: 開啟手動排序
manual_update_sort: 手動更新排序
category: 類別
tag: 標籤
title: 標題
recruitment_date_setting: "事件日期設定"
recruitment_date_use_default_setting: "使用預設的事件日期設定"