From 987e6fff2b264678d6b9b6b7bbb1f27718bd5f73 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Thu, 9 Aug 2012 02:20:10 +0800 Subject: [PATCH] 1.Rss feed but no entry for clicking now. wait for design. 2.Unit link is now fixed. --- Gemfile.lock | 2 -- .../front_end/bulletins/show.html.erb | 5 +++-- .../front_end/bulletins/show.rss.builder | 20 ++++++++++++++++++ .../news/app/models/news_bulletin.rb | 1 + .../front_end/news_bulletins/show.html.erb | 2 +- .../front_end/news_bulletins/show.rss.builder | 21 +++++++++++++++++++ 6 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.rss.builder create mode 100644 vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.rss.builder diff --git a/Gemfile.lock b/Gemfile.lock index 463946c3..96f07221 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -186,7 +186,6 @@ GEM chinese_pinyin (>= 0.3.0) redis (>= 2.1.1) redis-namespace (~> 1.0.2) - remotipart (1.0.2) resque (1.20.0) multi_json (~> 1.0) redis-namespace (~> 1.0.2) @@ -333,7 +332,6 @@ DEPENDENCIES redis (>= 2.1.1) redis-namespace (~> 1.0.2) redis-search (= 0.7.1) - remotipart resque resque-restriction resque-scheduler diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb index a26f9200..0f60d98e 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb @@ -3,8 +3,9 @@
<%= dislpay_view_count(@bulletin) %> - <%= display_date_time(@bulletin.postdate) %> - <%= link_to @bulletin.cache_dept[I18n.locale.to_s],panel_announcement_front_end_index_bulletins_by_unit_path(:name=>@bulletin.cache_dept[I18n.locale.to_s]) rescue nil %> + <%= display_date_time(@bulletin.postdate) %> + <% unit = @bulletin.cache_dept[I18n.locale.to_s] rescue nil %> + <%= link_to unit,panel_announcement_front_end_index_bulletins_by_unit_path(:name=>unit) unless unit.blank? %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.rss.builder b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.rss.builder new file mode 100644 index 00000000..8fb929f5 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.rss.builder @@ -0,0 +1,20 @@ +xml.instruct! :xml, :version => "1.0" +xml.rss :version => "2.0" do + xml.channel do + if @current_category + xml.title @current_category.i18n_variable[I18n.locale] + else + xml.title t('announcement.announcement') + end + xml.link panel_announcement_front_end_bulletins_path(:rss) + + xml.item do + xml.title @bulletin.title + xml.description @bulletin.text + xml.pubDate @bulletin.postdate.to_s(:rfc822) + xml.link panel_announcement_front_end_bulletin_path(@bulletin, :rss) + xml.guid panel_announcement_front_end_bulletin_path(@bulletin, :rss) + end +# end + end +end \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/models/news_bulletin.rb b/vendor/built_in_modules/news/app/models/news_bulletin.rb index 4cb139be..578714c6 100644 --- a/vendor/built_in_modules/news/app/models/news_bulletin.rb +++ b/vendor/built_in_modules/news/app/models/news_bulletin.rb @@ -166,6 +166,7 @@ class NewsBulletin end end + def enabled_for_lang(lang) eval("self.available_for_#{lang}") end diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb index 7366127a..eac3fec8 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb @@ -6,7 +6,7 @@ <%= display_date(@news_bulletin.postdate) %> <% unit = @news_bulletin.unit_list_for_anc.title rescue nil %> <%= " | " if unit %> - <%= link_to unit, panel_news_front_end_index_news_bulletins_by_unit_path(:name=>@news_bulletin.unit_list_for_anc_id)%> + <%= link_to unit, panel_news_front_end_index_news_bulletins_by_unit_path(:name=>@news_bulletin.unit_list_for_anc_id) unless unit.blank?%>
diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.rss.builder b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.rss.builder new file mode 100644 index 00000000..ba01a48e --- /dev/null +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.rss.builder @@ -0,0 +1,21 @@ +xml.instruct! :xml, :version => "1.0" +xml.rss :version => "2.0" do + xml.channel do + if @current_category + xml.title @current_category.i18n_variable[I18n.locale] + else + xml.title t('news.campus_news') + end + xml.link panel_news_front_end_news_bulletins_path(:rss) + +# for news_bulletin in @news_bulletins + xml.item do + xml.title @news_bulletin.title + xml.description @news_bulletin.text + xml.pubDate @news_bulletin.postdate.to_s(:rfc822) + xml.link panel_news_front_end_news_bulletin_path(@news_bulletin, :rss) + xml.guid panel_news_front_end_news_bulletin_path(@news_bulletin, :rss) + end +# end + end +end \ No newline at end of file