Fix render :text and stale event_date placeholders

This commit is contained in:
rulingcom 2026-09-10 16:36:36 +08:00
parent 0856be3afa
commit 1b68a2009c
11 changed files with 23 additions and 12 deletions

View File

@ -84,7 +84,7 @@ class Admin::RecruitmentController < OrbitAdminController
uids = iframe_params['member_ids'].to_a.map{|m_id| MemberProfile.find(m_id).uid rescue nil}.select{|uid| !uid.nil?}
url_params = iframe_params.except(:member_ids)
url_params['uids'] = uids if uids != []
render :text => '/xhr/panel/recruitment/widget/sync_data?'+url_params.to_param
render :plain => '/xhr/panel/recruitment/widget/sync_data?'+url_params.to_param
end
def settings
@setting = @recruitment_setting
@ -488,7 +488,12 @@ class Admin::RecruitmentController < OrbitAdminController
recruitment.is_preview = true
recruitment.save
render :text=>page_for_recruitment(recruitment) + "?preview=true"
preview_url = page_for_recruitment(recruitment)
if preview_url == "/"
render :json => { "error" => true, "message" => t("recruitment.no_recruitment_page") }
else
render :plain=>preview_url + "?preview=true"
end
end
def destroy_preview

View File

@ -759,6 +759,10 @@
processData: false,
contentType: false
}).done(function(data){
if(typeof data === "object" && data.error){
alert(data.message);
return;
}
if(window.location.protocol === "https:"){
data = data.replace("http:","https:");
}

View File

@ -4,6 +4,7 @@ en:
recruitment_mod:
recruitment_mod: Recruitment
recruitment:
no_recruitment_page: "No recruitment page has been set. Please set one first."
carousel_image_types:
default: Default
carousel: Carousel

View File

@ -4,6 +4,7 @@ zh_tw:
recruitment_mod:
recruitment_mod: 徵才資訊
recruitment:
no_recruitment_page: "沒有任何徵才頁面,請先設定一個"
carousel_image_types:
default: 預設
carousel: 輪播

View File

@ -130,7 +130,7 @@ module RecruitmentMod
authorizable
frontend_enabled
feeds_url "/xhr/recruitment/feeds"
feeds_time_field (::RecruitmentHelper.is_postdate_sort_first ? ['postdate', 'event_date'] : ['event_date', 'postdate'])
feeds_time_field (::RecruitmentHelper.is_postdate_sort_first ? ['postdate', 'recruitment_date'] : ['recruitment_date', 'postdate'])
data_count 1..30
begin
show_options data

View File

@ -2,7 +2,7 @@
<table class="w-annc__table table">
<thead>
<tr>
<th class="w-annc__th w-annc__th--date">{{event_date-head}}</th>
<th class="w-annc__th w-annc__th--date">{{recruitment_date-head}}</th>
<th class="w-annc__th w-annc__th--title">{{title-head}}</th>
<th class="w-annc__th w-annc__th--title">{{subtitle-head}}</th>
<th class="w-annc__th w-annc__th--title">{{notes-head}}</th>
@ -25,4 +25,4 @@
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}"><%= t("recruitment.more") %></a>
</div>
</div>
</div>

View File

@ -12,7 +12,7 @@
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title-head}}{{title}}</a>
</td>
<td style="{{event-time-css}}" class="w-annc__host">{{event_date-head}}{{event-time-formated}}</td>
<td style="{{event-time-css}}" class="w-annc__host">{{recruitment_date-head}}{{event-time-formated}}</td>
<td class="w-annc__subtitle">{{subtitle}}</td>
<td style="{{notes-css}}" class="w-annc__notes">{{notes-head}}{{notes}}</td>
</tr>
@ -21,4 +21,4 @@
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}"><%= t("recruitment.more") %></a>
</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
<table class="i-annc__table table table-striped">
<thead>
<tr>
<th class="i-annc__th i-annc__th--event_date">{{event_date-head}}</th>
<th class="i-annc__th i-annc__th--event_date">{{recruitment_date-head}}</th>
<th class="i-annc__th i-annc__th--title">{{title-head}}</th>
<th class="i-annc__th i-annc__th--notes">{{notes-head}}</th>
</tr>

View File

@ -4,7 +4,7 @@
<thead>
<tr>
<th class="i-annc__th i-annc__th--category">{{category-head}}</th>
<th class="i-annc__th i-annc__th--event_date">{{event_date-head}}</th>
<th class="i-annc__th i-annc__th--event_date">{{recruitment_date-head}}</th>
<th class="i-annc__th i-annc__th--title">{{title-head}}</th>
<th class="i-annc__th i-annc__th--view-count">{{view-count-head}}</th>
</tr>

View File

@ -4,7 +4,7 @@
<ul class="s-annc__meta-wrap list-unstyled no-print">
<li class="s-annc__date-wrap s-annc__meta--item">
<span style="display: inline-block;{{event-time-css}}">
<span>{{event_date-head}}:</span>
<span>{{recruitment_date-head}}:</span>
<span class="s-annc__date" date-format="%Y-%m-%d">{{updated_at}}</span>
</span>
</li>
@ -75,4 +75,4 @@
</li>
</ul>
</article>
{{link_to_edit}}
{{link_to_edit}}

View File

@ -10,7 +10,7 @@
</li>
<li class="s-annc__date-wrap s-annc__meta--item">
<span style="display: inline-block;{{event-time-css}}">
<span>{{event_date-head}}</span>
<span>{{recruitment_date-head}}</span>
<span class="s-annc__date" date-format="%Y-%m-%d">{{updated_at}}</span>
</span>
</li>