diff --git a/app/controllers/event_news_controller.rb b/app/controllers/event_news_controller.rb index e9f0a21..5cd5784 100644 --- a/app/controllers/event_news_controller.rb +++ b/app/controllers/event_news_controller.rb @@ -369,6 +369,7 @@ class EventNewsController < ApplicationController else @categories = params[:categories] end + OrbitHelper.set_site_locale(I18n.locale) OrbitHelper.set_current_widget_module("event_news") OrbitHelper.set_params(params,current_user) EventNews.remove_expired_status @@ -413,7 +414,7 @@ class EventNewsController < ApplicationController "is_top" => (a.is_top? ? 1 : 0), "link_to_show" => link_to_show+"\" title=\"#{title}\"", "target" => target, - "img_src" => a.image.thumb.url || "/assets/event_news-default.jpg", + "img_src" => a.image.thumb.url || "/assets/announcement-default.jpg", "img_description" => desc, "more" => t(:more_plus), "view_count" => a.view_count diff --git a/app/helpers/event_news_helper.rb b/app/helpers/event_news_helper.rb index 5f195a8..8ca9cad 100644 --- a/app/helpers/event_news_helper.rb +++ b/app/helpers/event_news_helper.rb @@ -248,7 +248,7 @@ module EventNewsHelper total_pages = page_data_count == 0 ? 1 : (annc_count.to_f / page_data_count).ceil [sorted,total_pages] end - def render_view_for_annc(overridehtml=nil) + def render_view_for_event_news(overridehtml=nil) @key = Site.first.template def render_link_to_edit(html, url_to_edit) if html.scan("{{link_to_edit}}").length == 0 @@ -307,7 +307,7 @@ module EventNewsHelper file = File.open(f) doc = Nokogiri::HTML(file, nil, "UTF-8") file.close - controller = EventNewsModuleController.new + controller = EventNewsController.new begin data = @data# rescue nil rescue Exception => e @@ -344,7 +344,7 @@ module EventNewsHelper file = File.open(f) doc = Nokogiri::HTML(file, nil, "UTF-8") file.close - controller = EventNewsModuleController.new + controller = EventNewsController.new begin data = @data# rescue nil rescue Exception => e @@ -416,13 +416,17 @@ module EventNewsHelper end end html = Nokogiri::HTML.parse(html) - html.css('.i-annc__page-title').remove + html.css('.i-event_news__page-title').remove dates = html.css("*[date-format]") if !dates.blank? dates.each do |d| - format = d.attributes["date-format"].value - date = DateTime.parse(d.inner_text) - d.inner_html = d.inner_html.gsub(d.inner_text.strip, " " + date.strftime(format)) + begin + format = d.attributes["date-format"].value + date = DateTime.parse(d.inner_text) + d.inner_html = d.inner_html.gsub(d.inner_text.strip, " " + date.strftime(format)) + rescue + next + end end end html.css("body").to_html.html_safe diff --git a/app/views/event_news/show_widget.html.erb b/app/views/event_news/show_widget.html.erb index 770d885..b8597a4 100644 --- a/app/views/event_news/show_widget.html.erb +++ b/app/views/event_news/show_widget.html.erb @@ -10,6 +10,6 @@ <% @target_action = "show_widget" %> - <%=render_view_for_annc((!params[:layout_type].blank? ? params[:layout_type] : 'annc_index1'))%> + <%=render_view_for_event_news((!params[:layout_type].blank? ? params[:layout_type] : 'event_news_index1'))%> \ No newline at end of file