fix some error
This commit is contained in:
parent
96665aeb93
commit
716a1ca64a
|
@ -21,10 +21,7 @@ class EventNewsController < ApplicationController
|
|||
target = a.is_external_link ? "_blank" : "_self"
|
||||
doc = Nokogiri::HTML(a.title)
|
||||
title = doc.text.empty? ? 'no content' : doc.text
|
||||
event_time = (a.event_date.strftime(a.date_parse_format) rescue "")
|
||||
if a.event_end_date
|
||||
event_time = "<span class=\"start_date\">#{event_time.split(" ")[0]}</span> ~ <span class=\"end_date\">#{a.event_end_date.strftime('%Y-%m-%d')}</span>"
|
||||
end
|
||||
event_time = a.event_time_formated_for_frontend
|
||||
event_time_formated = a.event_time_formated
|
||||
{
|
||||
"department" => author,
|
||||
|
@ -53,7 +50,7 @@ class EventNewsController < ApplicationController
|
|||
"target" => target,
|
||||
"img_src" => a.image.thumb.url || "/assets/event_news-default.jpg",
|
||||
"img_description" => desc,
|
||||
"more" => t(:more_plus),
|
||||
"more" => t("event_news.more"),
|
||||
"view_count" => a.view_count
|
||||
}
|
||||
else
|
||||
|
@ -72,11 +69,11 @@ class EventNewsController < ApplicationController
|
|||
"event_news" => event_news,
|
||||
"extras" => {
|
||||
"widget-title" =>t('event_news.event_news'),
|
||||
"title-head" => t('event_news.title'),
|
||||
"title-head" => EventNewsCustomTitle.get_trans('title'),
|
||||
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
|
||||
"place-head" => EventNewsCustomTitle.get_trans('place'),
|
||||
"host-head" => EventNewsCustomTitle.get_trans('host'),
|
||||
"notes-head" => t('event_news.notes'),
|
||||
"notes-head" => EventNewsCustomTitle.get_trans('notes'),
|
||||
"event_date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"status-head" => t('event_news.table.status'),
|
||||
|
@ -379,12 +376,13 @@ class EventNewsController < ApplicationController
|
|||
"more_url"=>OrbitHelper.widget_more_url,
|
||||
"main_picture" => mp,
|
||||
"main_picture_description" => mpd,
|
||||
"title-head" => t('event_news.title'),
|
||||
"title-head" => EventNewsCustomTitle.get_trans('title'),
|
||||
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
|
||||
"place-head" => EventNewsCustomTitle.get_trans('place'),
|
||||
"host-head" => EventNewsCustomTitle.get_trans('host'),
|
||||
"notes-head" => t('event_news.notes'),
|
||||
"notes-head" => EventNewsCustomTitle.get_trans('notes'),
|
||||
"event_date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"date-head" => t('event_news.table.date'),
|
||||
"author-head" => t('event_news.table.author'),
|
||||
"status-head" => t('event_news.table.status'),
|
||||
|
@ -532,7 +530,6 @@ class EventNewsController < ApplicationController
|
|||
event_news = top_event_news + rest_event_news
|
||||
end
|
||||
end
|
||||
event_news.each{|a| a["postdate"] = a["postdate"].in_time_zone(Time.zone.utc_offset / 3600).strftime((a['all_day'] ? '%Y-%m-%d' : '%Y-%m-%d %H:%M')) rescue nil }
|
||||
event_news
|
||||
end
|
||||
|
||||
|
@ -623,20 +620,26 @@ class EventNewsController < ApplicationController
|
|||
pause_btn_title = (I18n.locale.to_s =="zh_tw") ? "暫停播放" : "pause"
|
||||
prev_btn_title = (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev"
|
||||
next_btn_title = (I18n.locale.to_s =="zh_tw") ? "下一張" : "next"
|
||||
event_time = (event_news.event_date.strftime(event_news.date_parse_format) rescue "")
|
||||
if event_news.event_end_date
|
||||
event_time = "<span class=\"start_date\">#{event_time.split(" ")[0]}</span> ~ <span class=\"end_date\">#{event_news.event_end_date.strftime('%Y-%m-%d')}</span>"
|
||||
begin
|
||||
event_time = event_news.event_time_formated_for_frontend
|
||||
rescue => e
|
||||
puts e.to_s
|
||||
event_time = ""
|
||||
end
|
||||
|
||||
{
|
||||
"tags" => tags,
|
||||
"event_news_files" => files,
|
||||
"event_news_links" => links,
|
||||
"event_carousel_images" => event_carousel_images,
|
||||
"data" => {
|
||||
"title-head" => EventNewsCustomTitle.get_trans('title'),
|
||||
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
|
||||
"place-head" => EventNewsCustomTitle.get_trans('place'),
|
||||
"host-head" => EventNewsCustomTitle.get_trans('host'),
|
||||
"notes-head" => t('event_news.notes'),
|
||||
"notes-head" => EventNewsCustomTitle.get_trans('notes'),
|
||||
"event_date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"event-time-css" => (event_time.blank? ? "display: none;" : ""),
|
||||
"speaker-css" => (event_news.speaker.blank? ? "display: none;" : ""),
|
||||
"host-css" => (event_news.host.blank? ? "display: none;" : ""),
|
||||
"speaker" => event_news.speaker,
|
||||
|
@ -713,10 +716,7 @@ class EventNewsController < ApplicationController
|
|||
|
||||
event_date = DateTime.parse(event_news["event_date"].to_s) rescue nil
|
||||
event_end_date = DateTime.parse(event_news["event_end_date"].to_s) rescue nil
|
||||
event_time = (event_date.strftime(event_news.date_parse_format) rescue "")
|
||||
if event_end_date
|
||||
event_time = "<span class=\"start_date\">#{event_time.split(" ")[0]}</span> ~ <span class=\"end_date\">#{event_end_date.strftime('%Y-%m-%d')}</span>"
|
||||
end
|
||||
event_time = EventNewsSetting.event_time_formated_for_frontend(event_news["event_date"],event_news["event_end_date"])
|
||||
event_carousel_images = Array(event_news["event_carousel_images"])
|
||||
resume_btn_title = (I18n.locale.to_s =="zh_tw") ? "繼續播放" : "resume"
|
||||
pause_btn_title = (I18n.locale.to_s =="zh_tw") ? "暫停播放" : "pause"
|
||||
|
@ -735,10 +735,14 @@ class EventNewsController < ApplicationController
|
|||
"update_user" => update_user,
|
||||
"updated_at" => event_time,
|
||||
"body" => event_news["text_translations"][locale],
|
||||
"title-head" => EventNewsCustomTitle.get_trans('title'),
|
||||
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
|
||||
"place-head" => EventNewsCustomTitle.get_trans('place'),
|
||||
"host-head" => EventNewsCustomTitle.get_trans('host'),
|
||||
"notes-head" => t('event_news.notes'),
|
||||
"notes-head" => EventNewsCustomTitle.get_trans('notes'),
|
||||
"event_date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"event-time-css" => (event_time.blank? ? "display: none;" : ""),
|
||||
"speaker-css" => (speaker.blank? ? "display: none;" : ""),
|
||||
"host-css" => (host.blank? ? "display: none;" : ""),
|
||||
"speaker" => speaker,
|
||||
|
@ -809,10 +813,7 @@ class EventNewsController < ApplicationController
|
|||
target = a.is_external_link ? "_blank" : "_self"
|
||||
doc = Nokogiri::HTML(a.title)
|
||||
title = doc.text.empty? ? 'no content' : doc.text
|
||||
event_time = (a.event_date.strftime(a.date_parse_format) rescue "")
|
||||
if a.event_end_date
|
||||
event_time = "<span class=\"start_date\">#{event_time.split(" ")[0]}</span> ~ <span class=\"end_date\">#{a.event_end_date.strftime('%Y-%m-%d')}</span>"
|
||||
end
|
||||
event_time = a.event_time_formated_for_frontend
|
||||
event_time_formated = a.event_time_formated
|
||||
{
|
||||
"department" => author,
|
||||
|
@ -824,6 +825,8 @@ class EventNewsController < ApplicationController
|
|||
"place-css" => (a.place.blank? ? "display: none;" : ""),
|
||||
"event-time-formated" => event_time_formated,
|
||||
"event-time-css" => (event_time_formated.blank? ? "display: none;" : ""),
|
||||
"speaker-css" => (a.speaker.blank? ? "display: none;" : ""),
|
||||
"host-css" => (a.host.blank? ? "display: none;" : ""),
|
||||
"speaker" => a.speaker,
|
||||
"place" => a.place,
|
||||
"host" => a.host,
|
||||
|
@ -841,7 +844,7 @@ class EventNewsController < ApplicationController
|
|||
"target" => target,
|
||||
"img_src" => a.image.thumb.url || "/assets/event_news-default.jpg",
|
||||
"img_description" => desc,
|
||||
"more" => t(:more_plus),
|
||||
"more" => t("event_news.more"),
|
||||
"view_count" => a.view_count
|
||||
}
|
||||
else
|
||||
|
@ -860,11 +863,13 @@ class EventNewsController < ApplicationController
|
|||
"event_news" => event_news,
|
||||
"extras" => {
|
||||
"widget-title" =>t('event_news.event_news'),
|
||||
"title-head" => t('event_news.title'),
|
||||
"title-head" => EventNewsCustomTitle.get_trans('title'),
|
||||
"speaker-head" => EventNewsCustomTitle.get_trans('speaker'),
|
||||
"place-head" => EventNewsCustomTitle.get_trans('place'),
|
||||
"host-head" => EventNewsCustomTitle.get_trans('host'),
|
||||
"notes-head" => t('event_news.notes'),
|
||||
"notes-head" => EventNewsCustomTitle.get_trans('notes'),
|
||||
"event_date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"date-head" => EventNewsCustomTitle.get_trans('event_date'),
|
||||
"date-head" => t('event_news.table.date'),
|
||||
"status-head" => t('event_news.table.status'),
|
||||
"author-head" => t('event_news.table.author'),
|
||||
|
|
|
@ -50,8 +50,9 @@ module EventNewsHelper
|
|||
"speaker-css" => (a.speaker.blank? ? "display: none;" : ""),
|
||||
"host-css" => (a.host.blank? ? "display: none;" : ""),
|
||||
"place-css" => (a.place.blank? ? "display: none;" : ""),
|
||||
"event-time-formated" => event_time_formated,
|
||||
"event-time-css" => (event_time_formated.blank? ? "display: none;" : ""),
|
||||
"notes-css" => (a.notes.blank? ? "display: none;" : ""),
|
||||
"event-time-formated" => event_time_formated,
|
||||
"speaker" => a.speaker,
|
||||
"place" => a.place,
|
||||
"host" => a.host,
|
||||
|
@ -63,8 +64,8 @@ module EventNewsHelper
|
|||
"statuses" => statuses,
|
||||
"category" => (a.category.title rescue ""),
|
||||
"tag_ids" => (set_tag_ids.nil? ? (a.tag_ids.map{|id| id.to_s}.to_s.gsub('"',"'") rescue '[]') : set_tag_ids),
|
||||
"postdate" => a.event_date,
|
||||
"event_date" => a.event_date,
|
||||
"postdate" => event_time_formated,
|
||||
"event_date" => event_time_formated,
|
||||
"author" => author,
|
||||
"link_to_show" => link_to_show,
|
||||
"target" => target,
|
||||
|
@ -143,8 +144,9 @@ module EventNewsHelper
|
|||
"speaker-css" => (fa["speaker_translations"][locale].blank? ? "display: none;" : ""),
|
||||
"host-css" => (fa["host_translations"][locale].blank? ? "display: none;" : ""),
|
||||
"place-css" => (fa["place_translations"][locale].blank? ? "display: none;" : ""),
|
||||
"event-time-formated" => event_time_formated,
|
||||
"event-time-css" => (event_time_formated.blank? ? "display: none;" : ""),
|
||||
"notes-css" => (fa["notes_translations"][locale].blank? ? "display: none;" : ""),
|
||||
"event-time-formated" => event_time_formated,
|
||||
"speaker" => (fa["speaker_translations"][locale].to_s rescue ""),
|
||||
"place" => (fa["place_translations"][locale].to_s rescue ""),
|
||||
"host" => (fa["host_translations"][locale].to_s rescue ""),
|
||||
|
@ -162,7 +164,7 @@ module EventNewsHelper
|
|||
"target" => "_self",
|
||||
"img_src" => fa["image"]["thumb"] || "/assets/event_news-default.jpg",
|
||||
"img_description" => fa["image_description_translations"][locale],
|
||||
"more" => t(:more_plus),
|
||||
"more" => t("event_news.more"),
|
||||
"view_count" => ""
|
||||
}
|
||||
if (!x["title"].empty? rescue false)
|
||||
|
|
|
@ -26,6 +26,12 @@ class EventNews
|
|||
before_destroy do
|
||||
EventNewsCache.all.destroy
|
||||
end
|
||||
Week_day_trans = {:en=>["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
|
||||
:zh_tw=>["(日)","(一)","(二)","(三)","(四)","(五)","(六)"]}
|
||||
field :event_date_use_default_setting, type: Boolean, default: true
|
||||
field :including_day_of_the_week, type: Boolean, default: true
|
||||
field :including_time, type: Boolean, default: true
|
||||
field :hour_clock_24, type: Boolean, default: true
|
||||
field :is_edit, type: Boolean, default: false #use to check whether the preview record changed
|
||||
field :copy_id
|
||||
field :custom_carousel_image_width, type: String, default: ""
|
||||
|
@ -34,7 +40,7 @@ class EventNews
|
|||
field :calendar_start_date, :type => DateTime
|
||||
field :calendar_end_date, :type => DateTime
|
||||
field :calendar_all_day,type: Boolean,default: false
|
||||
field :all_day,type: Boolean,default: false
|
||||
field :all_day,type: Boolean,default: false #old field
|
||||
field :calendar_type_id
|
||||
field :event_id
|
||||
field :place, type: String, localize: true
|
||||
|
@ -106,26 +112,75 @@ class EventNews
|
|||
end
|
||||
end
|
||||
def date_parse_format
|
||||
all_day ? '%Y-%m-%d' : '%Y-%m-%d %H:%M'
|
||||
#all_day ? '%Y-%m-%d' : '%Y-%m-%d %H:%M'
|
||||
event_date_format
|
||||
end
|
||||
def get_weekday(w)
|
||||
trans = self.class::Week_day_trans
|
||||
if trans.keys.include?(I18n.locale)
|
||||
trans[I18n.locale][w]
|
||||
else
|
||||
trans[:en][w]
|
||||
end
|
||||
end
|
||||
def event_date_format
|
||||
@event_date_format ||= (self.event_date_use_default_setting ? EventNewsSetting.event_date_default_format : self.event_date_custom_format)
|
||||
end
|
||||
def event_date_custom_format
|
||||
datetime_format = "%Y-%m-%d"
|
||||
if self.including_day_of_the_week
|
||||
datetime_format += " %a"
|
||||
end
|
||||
if self.including_time
|
||||
if self.hour_clock_24
|
||||
datetime_format += " %H:%M"
|
||||
else
|
||||
datetime_format += " %I:%M %P"
|
||||
end
|
||||
end
|
||||
datetime_format
|
||||
end
|
||||
def custom_strftime(dt, datetime_format)
|
||||
if dt
|
||||
dt.strftime(datetime_format.sub("%a","%%a")).sub("%a",get_weekday(dt.wday))
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
def event_time_formated_for_frontend
|
||||
st,ed = self.event_time_formated.split("~")
|
||||
if st.nil?
|
||||
st = ""
|
||||
else
|
||||
st = "<span class=\"start_date\">#{st}</span>"
|
||||
end
|
||||
if ed.nil?
|
||||
st
|
||||
else
|
||||
ed = "<span class=\"start_date\">#{ed}</span>"
|
||||
"#{st} ~ #{ed}"
|
||||
end
|
||||
end
|
||||
|
||||
def event_time_formated
|
||||
s = self.event_date
|
||||
e = self.event_end_date
|
||||
s = self.event_date.in_time_zone(Time.zone.utc_offset / 3600) rescue nil
|
||||
e = self.event_end_date.in_time_zone(Time.zone.utc_offset / 3600) rescue nil
|
||||
if s.blank? && e.blank?
|
||||
""
|
||||
elsif e.blank?
|
||||
s.strftime(self.date_parse_format)
|
||||
custom_strftime(s, self.date_parse_format)
|
||||
elsif s.blank?
|
||||
"~ " + e.strftime(self.date_parse_format)
|
||||
"~ " + custom_strftime(e, self.date_parse_format)
|
||||
else
|
||||
parse_format = self.date_parse_format
|
||||
if s.to_date == e.to_date
|
||||
date_str = s.strftime('%Y-%m-%d')
|
||||
s_time = s.strftime('%H:%M')
|
||||
e_time = e.strftime('%H:%M')
|
||||
parse_format_arr = parse_format.split(/(%d %a|%d) /)
|
||||
parse_format_arr = parse_format_arr[0..-2].join(""), parse_format_arr[-1]
|
||||
date_str = custom_strftime(s, parse_format_arr[0])
|
||||
s_time = s.strftime(parse_format_arr[1])
|
||||
e_time = e.strftime(parse_format_arr[1])
|
||||
"#{date_str} #{s_time} ~ #{e_time}"
|
||||
else
|
||||
s.strftime(self.date_parse_format) + " ~ " + e.strftime(self.date_parse_format)
|
||||
custom_strftime(s, self.date_parse_format) + " ~ " + custom_strftime(e, self.date_parse_format)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ class EventNewsCustomTitle
|
|||
include Mongoid::Timestamps
|
||||
field :key
|
||||
field :title, type: String, localize: true
|
||||
KEYS = ['title','event_date','speaker','place','host']
|
||||
KEYS = ['title','speaker','host','event_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)
|
||||
|
|
|
@ -8,8 +8,16 @@ class EventNewsSetting
|
|||
field :email_to, type: Array, :default => ["admins","managers","approvers"]
|
||||
field :is_display_edit_only, type: Boolean, :default => false
|
||||
field :only_manager_can_edit_status, type: Boolean, :default => false
|
||||
field :including_day_of_the_week, type: Boolean, default: true
|
||||
field :including_time, type: Boolean, default: true
|
||||
field :hour_clock_24, type: Boolean, default: true
|
||||
has_many :event_news_status_settings, :autosave => true, :dependent => :destroy
|
||||
accepts_nested_attributes_for :event_news_status_settings, :allow_destroy => true
|
||||
after_save do
|
||||
if self.including_day_of_the_week_changed? || self.including_time_changed? || self.hour_clock_24_changed?
|
||||
EventNewsCache.all.destroy
|
||||
end
|
||||
end
|
||||
def self.check_limit_for_user(user_id, b_id = nil)
|
||||
limit = self.first.top_limit rescue 0
|
||||
return true if limit == 0
|
||||
|
@ -20,4 +28,63 @@ class EventNewsSetting
|
|||
def self.is_pro?
|
||||
self.first.pro_enabled rescue false
|
||||
end
|
||||
def self.event_date_default_format
|
||||
setting = self.first
|
||||
setting.event_date_default_format
|
||||
end
|
||||
def event_date_default_format
|
||||
datetime_format = "%Y-%m-%d"
|
||||
if self.including_day_of_the_week
|
||||
datetime_format += " %a"
|
||||
end
|
||||
if self.including_time
|
||||
if self.hour_clock_24
|
||||
datetime_format += " %H:%M"
|
||||
else
|
||||
datetime_format += " %I:%M %P"
|
||||
end
|
||||
end
|
||||
datetime_format
|
||||
end
|
||||
def event_date_format
|
||||
@event_date_format ||= self.event_date_default_format
|
||||
end
|
||||
def self.event_time_formated_for_frontend(st,ed)
|
||||
self.first.event_time_formated_for_frontend(st,ed)
|
||||
end
|
||||
def event_time_formated_for_frontend(st,ed)
|
||||
st,ed = self.event_time_formated(st,ed).split("~")
|
||||
if st.blank?
|
||||
st = "<span class=\"start_date\">#{st}</span>"
|
||||
end
|
||||
if ed.nil?
|
||||
st
|
||||
else
|
||||
ed = "<span class=\"start_date\">#{ed}</span>"
|
||||
"#{st} ~ #{ed}"
|
||||
end
|
||||
end
|
||||
def event_time_formated(st,ed)
|
||||
s = st
|
||||
e = ed
|
||||
if s.blank? && e.blank?
|
||||
""
|
||||
elsif e.blank?
|
||||
custom_strftime(s, self.event_date_format)
|
||||
elsif s.blank?
|
||||
"~ " + custom_strftime(e, self.event_date_format)
|
||||
else
|
||||
parse_format = self.event_date_format
|
||||
if s.to_date == e.to_date
|
||||
parse_format_arr = parse_format.split(/(%d %a|%d) /)
|
||||
parse_format_arr = parse_format_arr[0..-2].join(""), parse_format_arr[-1]
|
||||
date_str = custom_strftime(s, parse_format_arr[0])
|
||||
s_time = s.strftime(parse_format_arr[1])
|
||||
e_time = e.strftime(parse_format_arr[1])
|
||||
"#{date_str} #{s_time} ~ #{e_time}"
|
||||
else
|
||||
custom_strftime(s, self.event_date_format) + " ~ " + custom_strftime(e, self.event_date_format)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -70,18 +70,39 @@
|
|||
<%= f.datetime_picker :event_date, :no_label => true, :new_record => @event_news.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= I18n.t("event_news.event_date_use_default_setting") %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :event_date_use_default_setting, :id=>"event_date_use_default_setting" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("event_news.event_end_date") %></label>
|
||||
<div class="controls">
|
||||
<%= f.datetime_picker :event_end_date, :no_label => true, :new_record => @event_news.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset id="event_date_setting" class="<%='hide' if f.object.event_date_use_default_setting %>">
|
||||
<legend><%=t("event_news.event_date_setting")%></legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("event_news.all_day") %></label>
|
||||
<label class="control-label muted"><%= I18n.t("event_news.including_day_of_the_week") %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :all_day %>
|
||||
<%= f.check_box :including_day_of_the_week %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= I18n.t("event_news.including_time") %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :including_time, :id=>"including_time" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hour_clock_24_block control-group <%= 'hide' if !(f.object.including_time) %>">
|
||||
<label class="control-label muted"><%= I18n.t("event_news.hour_clock_24") %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :hour_clock_24 %>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("event_news.start_date") %></label>
|
||||
<div class="controls">
|
||||
|
@ -547,6 +568,8 @@
|
|||
</script>
|
||||
<% end %>
|
||||
<script>
|
||||
$("#event_date_use_default_setting").click(function(){$("#event_date_setting").toggleClass("hide")})
|
||||
$("#including_time").click(function(){$(".hour_clock_24_block").toggleClass("hide")})
|
||||
$("#event_news_display_img").click(function(){$("#image_display_setting").toggleClass("hide")})
|
||||
function Appendzero(obj)
|
||||
{
|
||||
|
|
|
@ -133,6 +133,27 @@
|
|||
<%= f.text_field :carousel_image_width %>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset id="event_date_setting">
|
||||
<legend><%=t("event_news.event_date_setting")%></legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= I18n.t("event_news.including_day_of_the_week") %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :including_day_of_the_week %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label muted"><%= I18n.t("event_news.including_time") %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :including_time, :id=>"including_time" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hour_clock_24_block control-group <%= 'hide' if !(f.object.including_time) %>">
|
||||
<label class="control-label muted"><%= I18n.t("event_news.hour_clock_24") %></label>
|
||||
<div class="controls">
|
||||
<%= f.check_box :hour_clock_24 %>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="control-group">
|
||||
<%= f.label :only_manager_can_edit_status, t("event_news.only_manager_can_edit_status"), :class => "control-label muted" %>
|
||||
<div class="controls">
|
||||
|
|
|
@ -2,6 +2,11 @@ en:
|
|||
module_name:
|
||||
event_news: Event News
|
||||
event_news:
|
||||
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"
|
||||
including_time: "Including time"
|
||||
hour_clock_24: "24 hour clock"
|
||||
title: Title
|
||||
all_day: All Day
|
||||
show_today_data_first: Show today data first
|
||||
|
|
|
@ -2,6 +2,11 @@ zh_tw:
|
|||
module_name:
|
||||
event_news: 活動公告
|
||||
event_news:
|
||||
event_date_setting: "事件日期設定"
|
||||
event_date_use_default_setting: "使用預設的事件日期設定"
|
||||
including_day_of_the_week: "包含星期幾"
|
||||
including_time: "包含時間"
|
||||
hour_clock_24: "24小時制"
|
||||
title: 講題
|
||||
all_day: 全天
|
||||
show_today_data_first: 優先顯示當日資料
|
||||
|
@ -135,7 +140,7 @@ zh_tw:
|
|||
event_news_and_web_links: 分眾頁籤
|
||||
index: 索引
|
||||
search: 搜尋
|
||||
more: 更多+
|
||||
more: 更多→
|
||||
more_: 更多
|
||||
email_reminder: 寄送提醒
|
||||
activate_email_reminder: 開啟寄送提醒
|
||||
|
|
|
@ -45,6 +45,7 @@ if bundle_update_flag
|
|||
widget_info << copy_h
|
||||
Bundler.with_clean_env{%x[cp -f #{app_path}/modules/event_news/_#{h["filename"]}.html.erb #{folder}modules/event_news/_#{copy_h["filename"]}.html.erb]}
|
||||
elsif h["force_cover"] == "true"
|
||||
puts "fffffffffffffff"
|
||||
Bundler.with_clean_env{%x[cp -f #{app_path}/modules/event_news/_#{h["filename"]}.html.erb #{folder}modules/event_news/_#{widget_info[widget_info_index]["filename"]}.html.erb]}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,29 +3,21 @@
|
|||
<span>{{widget-title}}</span>
|
||||
</h3>
|
||||
<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--title">{{title-head}}</th>
|
||||
<th class="w-annc__th w-annc__th--title">{{subtitle-head}}</th>
|
||||
<th class="w-annc__th w-annc__th--date">{{speaker-head}}</th>
|
||||
<th class="w-annc__th w-annc__th--title">{{host-head}}</th>
|
||||
<th class="w-annc__th w-annc__th--title">{{notes-head}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-level="0" data-list="event_news">
|
||||
<tr>
|
||||
<td class="w-annc__postdate" date-format="%Y-%m-%d">{{postdate}}</td>
|
||||
<td class="w-annc__postdate">{{postdate}}</td>
|
||||
<td class="w-annc_content">
|
||||
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
|
||||
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
|
||||
</span>
|
||||
<a class="w-annc__title" href="{{link_to_show}}">【{{title-head}}】{{title}}</a>
|
||||
<a class="w-annc__title" href="{{link_to_show}}">{{title-head}}{{title}}</a>
|
||||
</td>
|
||||
<td class="w-annc__speaker">【{{speaker-head}}】{{speaker}}</td>
|
||||
<td class="w-annc__host">{{host}}</td>
|
||||
<td style="{{speaker-css}}" class="w-annc__speaker">{{speaker-head}}{{speaker}}</td>
|
||||
<td style="{{host-css}}" class="w-annc__host">{{host-head}}{{host}}</td>
|
||||
<td style="{{place-css}}" class="w-annc__host">{{place-head}}{{place}}</td>
|
||||
<td style="{{event-time-css}}" class="w-annc__host">{{event_date-head}}{{event-time-formated}}</td>
|
||||
<td class="w-annc__subtitle">{{subtitle}}</td>
|
||||
<td class="w-annc__notes">【{{notes-head}}】{{notes}}</td>
|
||||
<td style="{{notes-css}}" class="w-annc__notes">{{notes-head}}{{notes}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
|
||||
<ul class="s-annc__meta-wrap list-unstyled no-print">
|
||||
<li class="s-annc__date-wrap s-annc__meta--item">
|
||||
<i class="fa fa-calendar-o"></i>
|
||||
<span style="display: inline-block;{{event-time-css}}">
|
||||
<span>{{event_date-head}}:</span>
|
||||
<span class="s-annc__date" date-format="%Y-%m-%d">{{updated_at}}</span>
|
||||
</span>
|
||||
</li>
|
||||
<li class="s-annc__author-wrap s-annc__meta--item">
|
||||
<li class="s-annc__author-wrap s-annc__meta--item" style="display: none;">
|
||||
<i class="fa fa-male"></i>
|
||||
<span class="s-annc__author">{{update_user}}</span>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue