" +
(use_tag ? tags.map.with_index{|tag,i|
@@ -310,7 +311,7 @@ class AnnouncementsController < ApplicationController
if tag != "all"
begin
read_more_text = I18n.t("announcement.more_") + tags_translations[tag]
- rescue
+ rescue
nil
end
end
@@ -322,7 +323,7 @@ class AnnouncementsController < ApplicationController
if cat != "all"
begin
read_more_text = I18n.t("announcement.more_") + cats_translations[cat]
- rescue
+ rescue
nil
end
end
@@ -361,19 +362,19 @@ class AnnouncementsController < ApplicationController
}
}
var wpexLocalize = {
- "lightboxType": "iLightbox",
- "iLightbox": { "auto": false, "skin": "minimal", "path": "horizontal",
+ "lightboxType": "iLightbox",
+ "iLightbox": { "auto": false, "skin": "minimal", "path": "horizontal",
"infinite": false, "maxScale": 1, "minScale": 0, "width": 1400, "height": "",
- "slideshow": { "pauseTime": 3000, "startPaused": true },
- "effects": { "reposition": true, "repositionSpeed": 200, "switchSpeed": 300,
- "loadedFadeSpeed": 50, "fadeSpeed": 500
- },
- "show": { "title": true, "speed": 200 },
- "hide": { "speed": 200 },
+ "slideshow": { "pauseTime": 3000, "startPaused": true },
+ "effects": { "reposition": true, "repositionSpeed": 200, "switchSpeed": 300,
+ "loadedFadeSpeed": 50, "fadeSpeed": 500
+ },
+ "show": { "title": true, "speed": 200 },
+ "hide": { "speed": 200 },
"overlay": { "blur": true, "opacity": "0.9" },
- "slideShow": "Slideshow", "next": "Next", "previous": "Previous" ,
- "thumbnails": { "maxWidth": 120, "maxHeight": 80 }
- }
+ "slideShow": "Slideshow", "next": "Next", "previous": "Previous" ,
+ "thumbnails": { "maxWidth": 120, "maxHeight": 80 }
+ }
};
$(document).ready(function(){
var first_filter_tab = $("[data-subpart-id=\"'+subpart.id.to_s+'\"] .filter_tab").eq(0);
@@ -403,7 +404,7 @@ class AnnouncementsController < ApplicationController
if cats.count == 1 && cats[0] != "all"
begin
read_more_text = I18n.t("announcement.more_") + ((all_tags.count == 1 && all_tags[0] != 'all') ? tags_translations[tags[0]] : cats_translations[cats[0]])
- rescue
+ rescue
nil
end
end
@@ -581,7 +582,7 @@ class AnnouncementsController < ApplicationController
first_deadline = sorted_anns.pluck(:deadline).compact.sort[0]
first_postdate = anns_for_locale.open_in_future.limit(1).pluck(:postdate)[0]
invalid_date = [first_postdate,first_deadline].compact.sort[0]
-
+
if devide_flag
now_anns = sorted_anns.to_a
top_anns = now_anns.select{|v| v.is_top}.map{|v| data_to_human_type(v,set_tags)}
@@ -832,7 +833,8 @@ class AnnouncementsController < ApplicationController
"hide_class" => announcement.display_img? ? announcement.image_display_class : ' hide',
"alt_title" => desc,
"carousel_html" => carousel_html,
- "sub_anncs_text" => sub_anncs_text
+ "sub_anncs_text" => sub_anncs_text,
+ "orbithashtags" => announcement.hashtags_for_frontend
},
"comments" => announcement.comments,
"show_comment_flag" => show_comment_flag,
diff --git a/app/helpers/announcements_helper.rb b/app/helpers/announcements_helper.rb
index f2bd5fd..81ae971 100644
--- a/app/helpers/announcements_helper.rb
+++ b/app/helpers/announcements_helper.rb
@@ -140,9 +140,15 @@ module AnnouncementsHelper
}
end
if !params["source"].present?
- announcements = Bulletin.can_display_and_sorted
+ if params["orbithashtag"].present?
+ announcements = Bulletin.can_display_and_sorted
+ .filter_by_categories(categories, false).filter_by_hashtag(OrbitHelper.page_hashtag_id).filter_by_tags(tags)
+ .where(:title.nin => ["",nil])
+ else
+ announcements = Bulletin.can_display_and_sorted
.filter_by_categories(categories, false).filter_by_tags(tags)
.where(:title.nin => ["",nil])
+ end
if !extra_match_cond.empty?
announcements = announcements.and(extra_match_cond)
end
@@ -218,7 +224,7 @@ module AnnouncementsHelper
if wrap_elements.count > 0
htmls = parsing_repeats_again(wrap_elements,d[data_name][i], level + 1)
htmls[0].each_with_index do |html,i|
- element = element.gsub(html,htmls[1][i])
+ element = element.gsub(html,htmls[1][i])
end
end
item.each do |key,value|
@@ -254,11 +260,11 @@ module AnnouncementsHelper
doc = Nokogiri::HTML(file, nil, "UTF-8")
file.close
controller = AnnouncementsController.new
- begin
+ begin
data = @data# rescue nil
- rescue Exception => e
+ rescue Exception => e
write_debug_file(e,'announcements',@target_action) if Site::DEBUG
- end
+ end
if !data.nil?
wrap_elements = doc.css("*[data-list][data-level='0']")
htmls = parsing_repeats_again(wrap_elements,data,1)
@@ -291,11 +297,11 @@ module AnnouncementsHelper
doc = Nokogiri::HTML(file, nil, "UTF-8")
file.close
controller = AnnouncementsController.new
- begin
+ begin
data = @data# rescue nil
- rescue Exception => e
+ rescue Exception => e
write_debug_file(e,'announcements',@target_action) if Site::DEBUG
- end
+ end
if data.nil?
return "
No content to show.
".html_safe
end
@@ -400,8 +406,8 @@ module AnnouncementsHelper
if layout_types.empty?
Dir.glob("#{Rails.root}/app/templates/#{@key}/modules/#{module_app}/*").each do |w|
next if File.ftype(w).eql?("directory")
- w = File.basename(w, ".*")
- w = File.basename(w, ".*")
+ w = File.basename(w, ".*")
+ w = File.basename(w, ".*")
if w[0,1] != "_" && w[0,1] != "s" && w != "info"
layout_types << w
end
@@ -434,7 +440,7 @@ module AnnouncementsHelper
#{e['description']}
- "
+ "
end.join+
"
diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb
index 2a7c99c..ee6475a 100644
--- a/app/models/bulletin.rb
+++ b/app/models/bulletin.rb
@@ -6,6 +6,7 @@ class Bulletin
include OrbitModel::Impression
# encoding: utf-8
include OrbitTag::Taggable
+ include OrbitHashtag::Hashtaggable
include OrbitCategory::Categorizable
include Slug
require 'announcement/cache'
@@ -505,7 +506,7 @@ class Bulletin
feed_cache = BulletinFeedCache.where(uid: uid, start: startdt, end: enddt, date: dt)
if force_update
feed_cache = nil
- else
+ else
feed_cache_old = feed_cache.all_of([{:invalid_date.ne=>nil},{:invalid_date.lte => Time.now}]).last
feed_cache.all_of([{:invalid_date.ne=>nil},{:invalid_date.lte => Time.now}]).destroy
count = feed_cache.count
diff --git a/app/views/admin/announcements/_form.html.erb b/app/views/admin/announcements/_form.html.erb
index fb4fd59..aee7177 100644
--- a/app/views/admin/announcements/_form.html.erb
+++ b/app/views/admin/announcements/_form.html.erb
@@ -80,6 +80,7 @@