diff --git a/app/assets/javascripts/news_bulletin_form.js.erb b/app/assets/javascripts/news_bulletin_form.js.erb deleted file mode 100644 index 2a96e6be2..000000000 --- a/app/assets/javascripts/news_bulletin_form.js.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%#= encoding: utf-8 %> -$(document).ready(function(){ -//alert("News Loaded"); - -$('.news_bulletin_links_block a.delete').live('click', function(){ - $(this).parents('.list_item').remove(); -}); - -$('.news_bulletin_files_block a.delete').live('click', function(){ - $(this).parents('.list_item').remove(); -}); - -$(document).on('click', '.action a.remove_existing_record', function(){ - if(confirm("<%= I18n.t(:sure?)%>")){ - $(this).next('.should_destroy').attr('value', 1); - $("tr#" + $(this).prev().attr('value')).hide(); - } -}); - -$(document).on('click', '.quick_edit_cancel', function(){ - tr = $(this).attr('rel'); - $('#' + tr).hide(); - $("tr#news_bulletin_file_" + $(this).prev().attr('value')).hide(); - $("tr#news_bulletin_link_" + $(this).prev().attr('value')).hide(); -}); -$('.reject_info').tooltip({ - placement : 'bottom' -}); -}); \ No newline at end of file diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb index cd00b49da..756c41b57 100644 --- a/app/controllers/admin/dashboards_controller.rb +++ b/app/controllers/admin/dashboards_controller.rb @@ -5,9 +5,9 @@ class Admin::DashboardsController < OrbitBackendController # before_filter :is_admin? def index - @module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'news_bulletin', 'page_context', 'web_link') - @recent_updated = get_recently_updated('bulletin', 'news_bulletin', 'page_context', 'web_link') - @most_visited = get_most_visited('bulletin', 'news_bulletin', 'page_context') + @module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'page_context', 'web_link') + @recent_updated = get_recently_updated('bulletin', 'page_context', 'web_link') + @most_visited = get_most_visited('bulletin', 'page_context') end protected diff --git a/app/helpers/admin/dashboards_helper.rb b/app/helpers/admin/dashboards_helper.rb index 8ee0e36e4..95bd4dd6c 100644 --- a/app/helpers/admin/dashboards_helper.rb +++ b/app/helpers/admin/dashboards_helper.rb @@ -4,8 +4,6 @@ module Admin::DashboardsHelper case title when 'bulletin' panel_announcement_front_end_bulletins_path - when 'news_bulletin' - panel_news_front_end_news_bulletins_path when'page_context' panel_page_content_front_end_page_contexts_path when'web_link' @@ -17,8 +15,6 @@ module Admin::DashboardsHelper case object.class.to_s.underscore when 'bulletin' panel_announcement_front_end_bulletin_path(object) - when 'news_bulletin' - panel_news_front_end_news_bulletin_path(object) when'page_context' "/#{object.page.path}" when'web_link' diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ba0180997..4ad52a40f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -260,13 +260,8 @@ module ApplicationHelper end def share_links(object, key) - # js = '' - # js << "\n" rescue '' - # js << "\n" rescue '' - # js << "\n" rescue '' content_tag :div, :class => 'fb' do - concat social_share_button_tag(object.title, :fb_url => generate_fb_url(object,key), :image => "http://#{request.env['HTTP_HOST']}#{object.image.url if !object.image.blank?}") - # concat javascript_tag "$('head').append('#{j js}');" + concat social_share_button_tag(object.title, :fb_url => generate_fb_url(object,key), :image => "http://#{request.env['HTTP_HOST']}#{object.image_url}") end end diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb index 748bac16d..3f4b12613 100644 --- a/app/uploaders/image_uploader.rb +++ b/app/uploaders/image_uploader.rb @@ -32,7 +32,7 @@ class ImageUploader < CarrierWave::Uploader::Base # "/images/fallback/" + [version_name, "default.png"].compact.join('_') # end def default_url - Site.first.default_image.url rescue "-sign-in-logo.png" + [version_name, (Site.first.default_image.file.url rescue "sign-in-logo.png")].compact.join('_') end # Process files as they are uploaded: diff --git a/app/views/layouts/_side_bar_content.html.erb b/app/views/layouts/_side_bar_content.html.erb index a14465aba..f2656bd10 100644 --- a/app/views/layouts/_side_bar_content.html.erb +++ b/app/views/layouts/_side_bar_content.html.erb @@ -20,19 +20,6 @@ <% end -%> -<%= content_tag :li, :class =>( active_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')|| active_for_app_auth('news') || active_for_ob_auths_object("NewsBulletinCategory")) do -%> - <%= link_to content_tag(:i, nil, :class => 'icons-announcement') + content_tag(:span, t('admin.news')), panel_news_back_end_news_bulletins_path %> - <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')) do -%> - <%= content_tag :li, link_to((t('announcement.all_articles') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_news_back_end_news_bulletins_path), :class => active_for_action('news_bulletins', 'index') if (is_manager? rescue nil)%> - <%= content_tag :li, link_to((t('announcement.add_new') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') if (is_manager? rescue nil) %> - <%= content_tag :li, link_to((t('announcement.categories') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') || active_for_ob_auths_object("NewsBulletinCategory") if (is_manager? rescue nil) %> - <%= content_tag :li, link_to((t('announcement.tags') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') if (is_manager? rescue nil)%> - <%= content_tag :li, link_to((t('announcement.bulletin.approval_setting') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, panel_news_back_end_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %> - <%= content_tag :li, link_to((t('admin.module.authorization') + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe,admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_for_app_auth('news') if (is_admin? rescue nil) %> - <% end -%> - -<% end -%> - <%#= content_tag :li, :class => active_for_controllers('users') do -%> <%#= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %> <%# end -%> diff --git a/lib/tasks/data_migration.rake b/lib/tasks/data_migration.rake index 9c93c18ac..ea29e8038 100644 --- a/lib/tasks/data_migration.rake +++ b/lib/tasks/data_migration.rake @@ -19,10 +19,7 @@ namespace :data_migration do NewsBulletinCategory.all.each{|bc| bc.disable=false;bc.save!} end - task :add_search_widget_to_news_and_announcement => :environment do - app = ModuleApp.first({:conditions=>{:title => 'news'}}) - app.widgets << "news_bulletins_search_block" if !app.widgets.include?("news_bulletins_search_block") - app.save! + task :add_search_widget_to_announcement => :environment do app = ModuleApp.first({:conditions=>{:title => 'Announcement'}}) app.widgets << "bulletins_search_block" if !app.widgets.include?("bulletins_search_block") app.save! diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake index 74f8df8ce..c41e6d9bc 100644 --- a/lib/tasks/migrate.rake +++ b/lib/tasks/migrate.rake @@ -81,69 +81,6 @@ namespace :migrate do p '=====================================================' p '=====================================================' - p 'Start NewsBulletin' - news_bulletins = NewsBulletin.admin_manager_all - i = 1 - news_bulletins.each do |news_bulletin| - p "#{i}/#{news_bulletins.size} - #{news_bulletin.id}" - title = I18nVariable.first(:conditions => {:key => 'title', :language_value_id => news_bulletin.id, :language_value_type => news_bulletin.class}) - news_bulletin.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title - subtitle = I18nVariable.first(:conditions => {:key => 'subtitle', :language_value_id => news_bulletin.id, :language_value_type => news_bulletin.class}) - news_bulletin.subtitle_translations = {'en' => subtitle['en'], 'zh_tw' => subtitle['zh_tw']} if subtitle - text = I18nVariable.first(:conditions => {:key => 'text', :language_value_id => news_bulletin.id, :language_value_type => news_bulletin.class}) - news_bulletin.text_translations = {'en' => text['en'], 'zh_tw' => text['zh_tw']} if text - p news_bulletin.save(:validate => false) - i += 1 - end - p 'End NewsBulletin' - - p '=====================================================' - - p 'Start NewsBulletinCategory' - categories = NewsBulletinCategory.admin_manager_all - i = 1 - categories.each do |category| - p "#{i}/#{categories.size} - #{category.id}" - title = I18nVariable.first(:conditions => {:language_value_id => category.id, :language_value_type => category.class}) - category.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title - p category.save(:validate => false) - i += 1 - end - p 'End NewsBulletinCategory' - - p '=====================================================' - - p 'Start NewsBulletinFile' - files = NewsBulletinFile.all - i = 1 - files.each do |file| - p "#{i}/#{files.size} - #{file.id}" - description = I18nVariable.first(:conditions => {:language_value_id => file.id, :language_value_type => file.class}) - file.description_translations = {'en' => description['en'], 'zh_tw' => description['zh_tw']} if description - title = I18nVariable.first(:conditions => {:language_value_id => file.id, :language_value_type => file.class}) - file.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title - p file.save(:validate => false) - i += 1 - end - p 'End NewsBulletinFile' - - p '=====================================================' - - p 'Start NewsBulletinLink' - links = NewsBulletinLink.all - i = 1 - links.each do |link| - p "#{i}/#{links.size} - #{link.id}" - title = I18nVariable.first(:conditions => {:language_value_id => link.id, :language_value_type => link.class}) - link.title_translations = {'en' => title['en'], 'zh_tw' => title['zh_tw']} if title - p link.save(:validate => false) - i += 1 - end - p 'End NewsBulletinLink' - - p '=====================================================' - p '=====================================================' - p 'Start PageContext' page_contexts = PageContext.all i = 1 diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index 7ee017895..fcd5f205f 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -15,7 +15,6 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController end def preview - #@preview_obj = Preview.create(:object=>params[:news_bulletin],:expired_at=>DateTime.now+30.minutes,:preview_at_link=>"panel_news_front_end_news_bulletin_path",:object_class_type=>"NewsBulletin") bulletin = Bulletin.new params @preview_obj = bulletin.to_preview @preview_obj.save diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb index 64b507c86..42407007b 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb @@ -10,6 +10,7 @@ class Bulletin BelongsToCategory = :bulletin_category include OrbitCoreLib::BelongsToCategoryMayDisable include OrbitCoreLib::Preview + is_impressionable :counter_cache => { :column_name => :view_count } field :title, localize: true @@ -21,7 +22,6 @@ class Bulletin field :postdate , :type => DateTime field :deadline , :type => DateTime # field :url - field :cache_dept,type: Hash field :create_user_id field :update_user_id, :class_name => "User" @@ -42,12 +42,6 @@ class Bulletin scope :available_for_lang, ->(locale){ where("available_for_#{locale}".to_sym => true) } mount_uploader :image, ImageUploader - - - # belongs_to :unit_list_for_anc - - # embeds_many :bulletin_links, :cascade_callbacks => true - # embeds_many :bulletin_files, :cascade_callbacks => true has_many :bulletin_links, :autosave => true, :dependent => :destroy has_many :bulletin_files, :autosave => true, :dependent => :destroy @@ -58,9 +52,6 @@ class Bulletin validates :title, :at_least_one => true before_save :check_deadline, :update_avliable_language, :clean_values - before_create :update_avliable_language - - before_save :fetch_dept searchable do text :titles do @@ -240,10 +231,6 @@ class Bulletin end end end - - def fetch_dept - self.cache_dept = (User.find(self.create_user_id).cache_dept rescue nil) if self.new_record? - end def clean_values self.bulletin_links.each do |link| diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb index e575e3249..2e27bb024 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb @@ -7,6 +7,38 @@
+
+
+ +
+

<%= t('nccu.picture') %>

+
+
+ +
+ <% if @bulletin.image %> + <%= image_tag @bulletin.image rescue ''%> + <% else %> + + <% end %> +
+ <%= t("ad.widget_info_for_ad_image_size", :best_size=> "290px x 150px") %> +
+ <%= t(:browse) %> + <%= f.file_field :image, :id => "input-upload", :class => '', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %> + + <% if @bulletin.image.file %> + <%= f.check_box :remove_image %> + <%= t(:delete_file) %> + <% end %> +
+
+
+
+
@@ -127,6 +159,13 @@ <% end %>
+
+ <%= f.label :subtitle, t(:subtitle) %> + <%= f.fields_for :subtitle_translations do |f| %> + <%= I18nVariable.from_locale(locale) %> + <%= f.text_area locale, :rows => 5, :style=>"width:100%", :value => (@bulletin.subtitle_translations[locale] rescue nil) %> + <% end %> +
<%= f.label :text ,t(:text)%> @@ -214,23 +253,6 @@

<%= t("sys.limit_of_upload_file_size",:best_size => '3MB') %>

<%= t("sys.preview_only_for_img") %>

-
- -
-
Drop files here - or - -
-
-
- -
-
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb index 4e0765eb1..b2c7aa33b 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb @@ -16,12 +16,6 @@ -
- -
- <% content_for :page_specific_javascript do %> <%= javascript_include_tag "bulletin_form" %> <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %> diff --git a/vendor/built_in_modules/news/.gitignore b/vendor/built_in_modules/news/.gitignore deleted file mode 100644 index 1463de6df..000000000 --- a/vendor/built_in_modules/news/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.bundle/ -log/*.log -pkg/ -test/dummy/db/*.sqlite3 -test/dummy/log/*.log -test/dummy/tmp/ \ No newline at end of file diff --git a/vendor/built_in_modules/news/Gemfile b/vendor/built_in_modules/news/Gemfile deleted file mode 100644 index a86130f60..000000000 --- a/vendor/built_in_modules/news/Gemfile +++ /dev/null @@ -1,17 +0,0 @@ -source "http://rubygems.org" - -# Declare your gem's dependencies in news.gemspec. -# Bundler will treat runtime dependencies like base dependencies, and -# development dependencies will be added by default to the :development group. -gemspec - -# jquery-rails is used by the dummy application -gem "jquery-rails" - -# Declare any dependencies that are still in development here instead of in -# your gemspec. These might include edge Rails or gems from your path or -# Git. Remember to move these dependencies to your gemspec before releasing -# your gem to rubygems.org. - -# To use debugger -# gem 'ruby-debug19', :require => 'ruby-debug' diff --git a/vendor/built_in_modules/news/MIT-LICENSE b/vendor/built_in_modules/news/MIT-LICENSE deleted file mode 100644 index 80cf031a6..000000000 --- a/vendor/built_in_modules/news/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2011 YOURNAME - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/built_in_modules/news/README.rdoc b/vendor/built_in_modules/news/README.rdoc deleted file mode 100644 index d1a18aec7..000000000 --- a/vendor/built_in_modules/news/README.rdoc +++ /dev/null @@ -1,3 +0,0 @@ -= News - -This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/vendor/built_in_modules/news/Rakefile b/vendor/built_in_modules/news/Rakefile deleted file mode 100644 index ee1ca0a07..000000000 --- a/vendor/built_in_modules/news/Rakefile +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env rake -begin - require 'bundler/setup' -rescue LoadError - puts 'You must `gem install bundler` and `bundle install` to run rake tasks' -end -begin - require 'rdoc/task' -rescue LoadError - require 'rdoc/rdoc' - require 'rake/rdoctask' - RDoc::Task = Rake::RDocTask -end - -RDoc::Task.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'News' - rdoc.options << '--line-numbers' - rdoc.rdoc_files.include('README.rdoc') - rdoc.rdoc_files.include('lib/**/*.rb') -end - -APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) -load 'rails/tasks/engine.rake' - - -Bundler::GemHelper.install_tasks - -require 'rake/testtask' - -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.libs << 'test' - t.pattern = 'test/**/*_test.rb' - t.verbose = false -end - - -task :default => :test diff --git a/vendor/built_in_modules/news/app/assets/images/announcement/.gitkeep b/vendor/built_in_modules/news/app/assets/images/announcement/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/built_in_modules/news/app/assets/javascripts/news_link.js b/vendor/built_in_modules/news/app/assets/javascripts/news_link.js deleted file mode 100644 index 89a5e569d..000000000 --- a/vendor/built_in_modules/news/app/assets/javascripts/news_link.js +++ /dev/null @@ -1,45 +0,0 @@ -$(document).ready(function(){ - var topic1="0px"; - var topic2="-948px"; - var topic3="-1896px"; - var topic_page=1; - $(".topic_prev").addClass("topic_prev_first"); - $(document).on("click", ".topic_prev", function() { - if (topic_page !=1){ - topic_page-=1; - }else{ - } - if (topic_page == 1){ - $("#topic_list").stop().animate({"left": topic1}, "slow"); - $(".topic_prev").addClass("topic_prev_first"); - } - if (topic_page == 2){ - $("#topic_list").stop().animate({"left": topic2}, "slow"); - $(".topic_prev").removeClass("topic_prev_first"); - $(".topic_next").removeClass("topic_next_last"); - } - if (topic_page == 3){ - $("#topic_list").stop().animate({"left": topic3}, "slow"); - $(".topic_prev").removeClass("topic_next_last"); - } - - }); - $(document).on("click", ".topic_next", function() { - if (topic_page >=1 && topic_page <=2){ - topic_page+=1; - }else{ - } - if (topic_page == 1){ - $("#topic_list").stop().animate({"left": topic1}, "slow"); - $(".topic_prev").addClass("topic_prev_first"); - } - if (topic_page == 2){ - $("#topic_list").stop().animate({"left": topic2}, "slow"); - $(".topic_prev").removeClass("topic_prev_first"); - } - if (topic_page == 3){ - $("#topic_list").stop().animate({"left": topic3}, "slow"); - $(".topic_next").addClass("topic_next_last"); - } - }); -}); diff --git a/vendor/built_in_modules/news/app/assets/stylesheets/announcement/.gitkeep b/vendor/built_in_modules/news/app/assets/stylesheets/announcement/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/built_in_modules/news/app/controllers/.gitkeep b/vendor/built_in_modules/news/app/controllers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/built_in_modules/news/app/controllers/application_controller.rb b/vendor/built_in_modules/news/app/controllers/application_controller.rb deleted file mode 100644 index 307a4acd8..000000000 --- a/vendor/built_in_modules/news/app/controllers/application_controller.rb +++ /dev/null @@ -1,23 +0,0 @@ -class ApplicationController < ActionController::Base - protect_from_forgery - before_filter :set_locale - - # Set I18n.locale - def set_locale - # update session if passed - session[:locale] = params[:locale] if params[:locale] - - # set locale based on session or default - begin - # check if locale is valid for non site pages - if !VALID_LOCALES.include?(session[:locale]) - I18n.locale = I18n.default_locale - else - I18n.locale = session[:locale] - end - rescue - I18n.locale = I18n.default_locale - end - end - -end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb deleted file mode 100644 index dd75725fe..000000000 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb +++ /dev/null @@ -1,71 +0,0 @@ -class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController - before_filter :authenticate_user! - before_filter :is_admin? - include AdminHelper - - def preview_and_approve - @news_bulletin = NewsBulletin.find params[:news_bulletin_id] - end - - def approve - notice = "" - @news_bulletin = NewsBulletin.find params[:news_bulletin_id] - @news_bulletin.proc_check(params[:news_bulletin][:is_checked],params[:news_bulletin][:not_checked_reason]) - @news_bulletin.de_pending - if @news_bulletin.save - notice = t('approval.pass') - else - notice = t('approval.not_pass') - end - redirect_to(panel_news_back_end_news_bulletins_url,:notice => notice) - end - - def setting - @sys_users = User.all(conditions: {admin: false}).includes(:avatar) - @news_bulletin_categorys = NewsBulletinCategory.all - @options_from_collection_for_select_news_bulletin_categorys = @news_bulletin_categorys.collect{|bc| [bc.title,bc.id] } - if params.has_key? :news_category - @news_bulletin_categorys = NewsBulletinCategory.find params[:news_category][:id] - else - @news_bulletin_categorys = @news_bulletin_categorys.first - end - preload_object_auth = @news_bulletin_categorys.get_object_auth_by_title('fact_check') - @users_array = preload_object_auth.privilege_users rescue [] - respond_to do |format| - format.html - format.js - end - end - - def update_setting - object_auth = update_setting_by_params - if object_auth.save! - flash[:notice] = t('update.success_') - else - flash[:notice] = t('update.fail') - end - end - - def user_list - @news_bulletin_category = NewsBulletinCategory.find params[:news_category][:id] - end - - protected - def update_setting_by_params - category = NewsBulletinCategory.find params[:news_category][:id] - privilege_users = params[:users].collect{|key,value| User.find key } rescue [] - object_auth_ary = category.object_auths.where(title: 'fact_check') || (category.object_auths.create :title=> 'fact_check') - object_auth = object_auth_ary.first - object_auth.privilege_users = privilege_users - object_auth - end - - def get_categorys(id = nil) - @news_bulletin_categorys = [] - if(is_manager? || is_admin?) - @news_bulletin_categorys = (id ? NewsBulletinCategory.find(id).to_a : NewsBulletinCategory.all) - elsif is_sub_manager? - @news_bulletin_categorys = NewsBulletinCategory.authed_for_user(current_user,'submit_new') - end - end -end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb deleted file mode 100644 index 1cb99fb40..000000000 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_categorys_controller.rb +++ /dev/null @@ -1,133 +0,0 @@ -class Panel::News::BackEnd::NewsBulletinCategorysController < OrbitBackendController - include OrbitControllerLib::DivisionForDisable - before_filter :force_order_for_visitor,:only=>[:index] - before_filter :force_order_for_user,:except => [:index] - before_filter :for_app_sub_manager,:except => [:index] - - - def index - @news_bulletin_categorys = get_categories_for_index("NewsBulletinCategory") - #TODO 需要做 manager ,admin 才可以 all. 其他 available就好 - - @news_bulletin_category = NewsBulletinCategory.new(:display => 'List') - - @url = panel_news_back_end_news_bulletin_categorys_path - - respond_to do |format| - format.html # index.html.erb - # format.xml { render :xml => @news_bulletins } - format.js - end - end - - # GET /news_bulletins/1 - # GET /news_bulletins/1.xml - def show - @news_bulletin_category = NewsBulletinCategory.find(params[:id]) - - respond_to do |format| - format.html # show.html.erb - # format.xml { render :xml => @news_bulletin_category } - format.js - end - end - - # GET /news_bulletins/new - # GET /news_bulletins/new.xml - def new - @news_bulletin_category = NewsBulletinCategory.new(:display => 'List') - - respond_to do |format| - format.html # new.html.erb - # format.xml { render :xml => @news_bulletin_category } - format.js - end - end - - def quick_edit - # debugger - - @news_bulletin_category = NewsBulletinCategory.find(params[:news_bulletin_category_id]) - - @url = panel_news_back_end_news_bulletin_category_path(@news_bulletin_category) - - respond_to do |format| - format.js - end - - end - - # GET /news_bulletins/1/edit - def edit - @news_bulletin_category = NewsBulletinCategory.find(params[:id]) - - @url = panel_news_back_end_news_bulletin_category_path(@news_bulletin_category) - - respond_to do |format| - format.html - format.js - end - end - - # POST /news_bulletins - # POST /news_bulletins.xml - def create - @news_bulletin_category = NewsBulletinCategory.new(params[:news_bulletin_category]) - - respond_to do |format| - if @news_bulletin_category.save - # format.html { redirect_to @news_bulletin_category, notice: 'Entry was successfully created.' } - format.html { redirect_to(panel_news_back_end_news_bulletin_categorys_url, :notice => t('news_bulletin.create_news_bulletin_category_success')) } - # format.xml { render :xml => @news_bulletin_category, :status => :created, :location => @news_bulletin_category } - format.js - else - format.html { render :action => "new" } - # format.xml { render :xml => @news_bulletin_category.errors, :status => :unprocessable_entity } - format.js { render action: "new" } - end - end - end - - # PUT /news_bulletins/1 - # PUT /news_bulletins/1.xml - def update - @news_bulletin_category = NewsBulletinCategory.find(params[:id]) - - @url = panel_news_back_end_news_bulletin_category_path(@news_bulletin_category) - - respond_to do |format| - if @news_bulletin_category.update_attributes(params[:news_bulletin_category]) - # format.html { redirect_to(panel_news_back_end_news_bulletin_category_url(@news_bulletin_category), :notice => t('news_bulletin_category.update_news_bulletin_category_success')) } - # format.html { redirect_to(panel_news_back_end_news_bulletin_categorys_url, :notice => t('news_bulletin_category.update_news_bulletin_category_success')) } - # format.xml { head :ok } - format.js - else - format.html { render :action => "edit" } - format.js { render :action => "edit" } - # format.xml { render :xml => @news_bulletin_category.errors, :status => :unprocessable_entity } - end - end - end - - # DELETE /news_bulletins/1 - # DELETE /news_bulletins/1.xml - def destroy - @news_bulletin_category = NewsBulletinCategory.find(params[:id]) - @news_bulletin_category.disable = @news_bulletin_category.disable ? false : true - - if @news_bulletin_category.save! - expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') - respond_to do |format| - flash[:notice] = t("update.success_") - # flash[:error] += @bulletin_category.disable ? t(enable) : t(disable) - format.html { redirect_to(panel_announcement_back_end_news_bulletin_categorys_url) } - # format.xml { head :ok } - format.js - end - else - flash[:error] = t("update.fail") - format.html { render :action => "index" } - - end - end -end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_files_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_files_controller.rb deleted file mode 100644 index 806aced21..000000000 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_files_controller.rb +++ /dev/null @@ -1,48 +0,0 @@ -class Panel::News::BackEnd::NewsBulletinFilesController < ApplicationController - - layout 'new_admin' - - def index - @news_bulletin_files = NewsBulletinFile.all - - respond_to do |format| - format.html # index.html.erb - # format.xml { render :xml => @news_bulletins } - format.js - end - - end - - # POST /news_bulletins - # POST /news_bulletins.xml - def create - @news_bulletin_file = NewsBulletinFile.new(params[:news_bulletin_file]) - - respond_to do |format| - if @news_bulletin_file.save - format.html { redirect_to(panel_news_back_end_news_bulletins_url) } - format.js - else - format.html { render :action => "new" } - format.js { render action: "new" } - end - end - end - - # PUT /news_bulletins/1 - # PUT /news_bulletins/1.xml - def update - @news_bulletin_file = NewsBulletinFile.find(params[:id]) - - respond_to do |format| - if @news_bulletin_file.update_attributes(params[:news_bulletin_file]) - format.html { redirect_to(panel_news_back_end_news_bulletins_url) } - format.js - else - format.html { render :action => "edit" } - format.js { render :action => "edit" } - end - end - end - -end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_links_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_links_controller.rb deleted file mode 100644 index 15ae4f646..000000000 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletin_links_controller.rb +++ /dev/null @@ -1,49 +0,0 @@ -class Panel::News::BackEnd::NewsBulletinLinksController < ApplicationController - - layout 'new_admin' - - def index - @news_bulletin_links = NewsBulletinLink.all - - respond_to do |format| - format.html # index.html.erb - # format.xml { render :xml => @news_bulletins } - format.js - end - - end - - # POST /news_bulletins - # POST /news_bulletins.xml - def create - @news_bulletin_link = NewsBulletinLink.new(params[:news_bulletin_link]) - # @news_bulletin_link.news_bulletin_id = params[:news_bulletin_link][:news_bulletin_id] - - respond_to do |format| - if @news_bulletin_link.save - format.html { redirect_to(panel_news_back_end_news_bulletins_url) } - format.js - else - format.html { render :action => "new" } - format.js { render action: "new" } - end - end - end - - # PUT /news_bulletins/1 - # PUT /news_bulletins/1.xml - def update - @news_bulletin_link = NewsBulletinLink.find(params[:id]) - - respond_to do |format| - if @news_bulletin_link.update_attributes(params[:news_bulletin_link]) - format.html { redirect_to(panel_news_back_end_news_bulletins_url) } - format.js - else - format.html { render :action => "edit" } - format.js { render :action => "edit" } - end - end - end - -end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb deleted file mode 100644 index 8d34e2b30..000000000 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb +++ /dev/null @@ -1,407 +0,0 @@ -class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController - include OrbitControllerLib::DivisionForDisable - -# before_filter :for_admin_only,:only => [:] -# before_filter :for_app_manager,:only => [:index,:show,] - before_filter :force_order_for_visitor,:only=>[:index,:show,:get_sorted_and_filtered_news_bulletins] - before_filter :force_order_for_user,:except => [:index,:show,:get_sorted_and_filtered_news_bulletins] - before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_news_bulletins] - before_filter :only => [ :new,:edit,:update,:create] do |controller| - controller.get_categorys('NewsBulletinCategory') - controller.get_unit_list - end - before_filter :clean_values, :only => [:create, :update] - - def preview - #@preview_obj = Preview.create(:object=>params[:news_bulletin],:expired_at=>DateTime.now+30.minutes,:preview_at_link=>"panel_news_front_end_news_bulletin_path",:object_class_type=>"NewsBulletin") - news_bulletin = NewsBulletin.new params - @preview_obj = news_bulletin.to_preview - @preview_obj.save - render '/shared/preview/preview.html.erb', :layout=>false - end - - def index - # @news_bulletins = NewsBulletin.all - # @news_bulletins = NewsBulletin.desc("postdate desc") - get_categorys("NewsBulletinCategory",params[:news_bulletin_category_id]) - get_tags - - @filter = params[:filter] - new_filter = params[:new_filter] - - if @filter && params[:clear] - @filter.delete(params[:type]) - elsif @filter && new_filter - if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s) - @filter[new_filter[:type]].delete(new_filter[:id].to_s) - elsif @filter.has_key?(new_filter[:type]) - @filter[new_filter[:type]] << new_filter[:id].to_s - else - @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]}) - end - elsif new_filter - @filter = {new_filter[:type] => [new_filter[:id].to_s]} - end - - # @news_bulletins = NewsBulletin.where("news_bulletin_category_id" => params[:news_bulletin_category_id]).desc("postdate") if params[:news_bulletin_category_id] - - # @news_bulletins = NewsBulletin.search(params[:search], params[:category_id]) - # @news_bulletins = NewsBulletin.all.order_by([params[:sort], params[:direction]]) - - - # @news_bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered_news_bulletins : NewsBulletin.all.page(params[:page]).per(10) - - @news_bulletin_categories = get_categories_for_index("NewsBulletinCategory") - @news_bulletin_category_ids = @news_bulletin_categories.collect{|t| t.id.to_s} + [nil] - - - @news_bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered("news_bulletin",:news_bulletin_category_id.in => @news_bulletin_category_ids) : get_viewable("news_bulletin",:news_bulletin_category_id.in => @news_bulletin_category_ids) - - @news_bulletin_link = NewsBulletinLink.new - @link_url = panel_news_back_end_news_bulletins_path - - @news_bulletin_file = NewsBulletinFile.new - @file_url = panel_news_back_end_news_bulletins_path - - respond_to do |format| - format.html # index.html.erb - format.js { } - format.xml { render :xml => @news_bulletins } - end - end - - # GET /news_bulletins/1 - # GET /news_bulletins/1.xml - def show - @news_bulletin = NewsBulletin.find(params[:id]) - get_tags - # get_categorys - - # @news_bulletin_categorys = NewsBulletinCategory.where("_id" => params[:id]) - - # if params[:id] - # @news_bulletins = NewsBulletin.where("news_bulletin_category_id" => params[:id]) - # else - # @news_bulletins = NewsBulletin.desc("postdate desc") - # end - - respond_to do |format| - format.html # show.html.erb - format.xml { render :xml => @news_bulletin } - end - end - - # GET /news_bulletins/new - # GET /news_bulletins/new.xml - def new - if(session[:in_validate_object].blank?) - @news_bulletin = NewsBulletin.new - else - @news_bulletin = session[:in_validate_object] - session[:in_validate_object] = {} - end - @link_url = panel_news_back_end_news_bulletins_path - - # @news_bulletin.news_bulletin_files.build - # @news_bulletin.news_bulletin_files.new - - get_tags - respond_to do |format| - format.html # new.html.erb - format.xml { render :xml => @news_bulletin } - end - end - - # GET /news_bulletins/1/edit - def edit - @news_bulletin = NewsBulletin.find(params[:id]) - if !current_user.admin? && (@news_bulletin.is_rejected? || @news_bulletin.is_checked?) - redirect_to :action => :index - else - # @summary_variable = @news_bulletin.summary_variable - - @link_url = panel_news_back_end_news_bulletin_path(@news_bulletin) - - get_tags - end - end - - # POST /news_bulletins - # POST /news_bulletins.xml - def create - get_tags - - if params[:news_bulletin_link] - - @news_bulletin_link = NewsBulletinLink.new(params[:news_bulletin_link]) - - respond_to do |format| - if @news_bulletin_link.save - format.js { render 'create_news_bulletin_link' } - end - end - - elsif params[:news_bulletin_file] - - @news_bulletin_file = NewsBulletinFile.new(params[:news_bulletin_file]) - - respond_to do |format| - if @news_bulletin_file.save - expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') - format.js { render 'create_news_bulletin_file' } - end - end - - else - - @news_bulletin = NewsBulletin.new(params[:news_bulletin]) - @news_bulletin.deadline = nil if (@news_bulletin.deadline < @news_bulletin.postdate rescue nil) - - @news_bulletin.create_user_id = current_user.id - @news_bulletin.update_user_id = current_user.id - - if(is_manager? || is_admin?) - @news_bulletin.is_checked = true - @news_bulletin.is_rejected = false - @news_bulletin.de_pending - end - - respond_to do |format| - if @news_bulletin.save - expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') - format.html { redirect_to(panel_news_back_end_news_bulletins_url, :notice => t('news_bulletin.create_news_bulletin_success')) } - format.xml { render :xml => @news_bulletin, :status => :created, :location => @news_bulletin } - format.js - #format.json {render :json => {"success"=>"true","redirect_url"=>panel_news_back_end_news_bulletins_url,"notice" => t('news_bulletin.create_news_bulletin_success')}} - else - format.html { render :action => "new" } - format.xml { render :xml => @news_bulletin.errors, :status => :unprocessable_entity } - end - end - - end - - end - - def link_quick_add - # debugger - - @news_bulletin_link = NewsBulletinLink.new - @link_url = panel_news_back_end_news_bulletins_path - - @news_bulletin_link.news_bulletin_id = params[:news_bulletin_id] - - respond_to do |format| - format.js - end - - end - - def link_quick_edit - # debugger - @news_bulletin_link = NewsBulletinLink.find(params[:news_bulletin_id]) - - @link_url = panel_news_back_end_news_bulletin_path(@news_bulletin_link) - - # @news_bulletin = NewsBulletin.find(params[:news_bulletin_id]) - - # @link_url = panel_news_back_end_news_bulletin_path(@news_bulletin) - - respond_to do |format| - format.js - end - - end - - def file_quick_add - # debugger - - @news_bulletin_file = NewsBulletinFile.new - @file_url = panel_news_back_end_news_bulletins_path - - @news_bulletin_file.news_bulletin_id = params[:news_bulletin_id] - - respond_to do |format| - format.js - end - - end - - def file_quick_edit - # debugger - @news_bulletin_file = NewsBulletinFile.find(params[:news_bulletin_id]) - - @file_url = panel_news_back_end_news_bulletin_path(@news_bulletin_file) - - respond_to do |format| - format.js - end - end - - # PUT /news_bulletins/1 - # PUT /news_bulletins/1.xml - def update - if params[:news_bulletin_link] - - @news_bulletin_link = NewsBulletinLink.find(params[:id]) - - @link_url = panel_news_back_end_news_bulletin_path(@news_bulletin_link) - - respond_to do |format| - if @news_bulletin_link.update_attributes(params[:news_bulletin_link]) - expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') - # format.html { redirect_to(panel_news_back_end_news_bulletins_url) } - format.js { render 'update_news_bulletin_link' } - end - end - - elsif params[:news_bulletin_file] - - @news_bulletin_file = NewsBulletinFile.find(params[:id]) - - @file_url = panel_news_back_end_news_bulletin_path(@news_bulletin_file) - - respond_to do |format| - if @news_bulletin_file.update_attributes(params[:news_bulletin_file]) - expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') - # format.html { redirect_to(panel_news_back_end_news_bulletins_url) } - format.js { render 'update_news_bulletin_file' } - end - end - - else - - @news_bulletin = NewsBulletin.find(params[:id]) - @news_bulletin.deadline = nil if (@news_bulletin.deadline < @news_bulletin.postdate rescue nil) - - @news_bulletin.update_user_id = current_user.id - - # @news_bulletin.image.clear if params[:news_bulletin][:image_del] == '1' - # if params[:news_bulletin][:image_del] == '1' - # @news_bulletin.remove_image! - # @news_bulletin.image_del = nil - # params[:news_bulletin][:image_del] = nil - # end - delete_out_invalid_date_from_params - respond_to do |format| - if @news_bulletin.update_attributes(params[:news_bulletin]) - if(is_manager? || is_admin?) - @news_bulletin.is_checked = true - @news_bulletin.is_rejected = false - @news_bulletin.de_pending! - end - expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') - # format.html { redirect_to(panel_news_back_end_news_bulletin_url(@news_bulletin), :notice => t('news_bulletin.update_news_bulletin_success')) } - format.html { redirect_to(panel_news_back_end_news_bulletins_url, :notice => t('update.success_')) } - format.js { render 'toggle_enable' } - format.xml { head :ok } - else - get_tags - - format.html { render :action => "edit" } - format.xml { render :xml => @news_bulletin.errors, :status => :unprocessable_entity } - end - end - - end - - end - - # DELETE /news_bulletins/1 - # DELETE /news_bulletins/1.xml - def destroy - @news_bulletin = NewsBulletin.find(params[:id]) - # @news_bulletin.news_bulletin_files.destroy - @news_bulletin.destroy - - respond_to do |format| - expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') - format.html { redirect_to(panel_news_back_end_news_bulletins_url) } - # format.xml { head :ok } - format.js - end - end - - # def top_edit - - # NewsBulletin.where(id: params[:id]).update_all( is_top: true ) - # respond_to do |format| - # format.html { redirect_to(panel_news_back_end_news_bulletins_url) } - # format.xml { head :ok } - # end - - # end - - - def load_quick_edit - @news_bulletin = NewsBulletin.find(params[:id]) - @type = params[:type] - @news_bulletin_categories = NewsBulletinCategory.all - #TODO 需要做 manager ,admin 才可以 all. 其他 available就好 - - get_tags - end - - def delete - if params[:ids] - news_bulletins = NewsBulletin.any_in(:_id => params[:ids]).delete_all - end - redirect_to panel_news_back_end_news_bulletins_url(:filter => params[:filter], :direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) - end - - - protected - - def delete_out_invalid_date_from_params - if((params[:news_bulletin]["deadline(1i)"] && params[:news_bulletin]["deadline(1i)"].blank?) or (params[:news_bulletin]["deadline(2i)"] && params[:news_bulletin]["deadline(2i)"].blank?) or (params[:news_bulletin]["deadline(3i)"] && params[:news_bulletin]["deadline(3i)"].blank?)) - params[:news_bulletin].delete("deadline(1i)") - params[:news_bulletin].delete("deadline(2i)") - params[:news_bulletin].delete("deadline(3i)") - @news_bulletin.deadline = nil - end rescue nil - end - - # def get_categories_for_index(id = nil) - # @news_bulletin_categories = [] - # if(is_manager? || is_admin?) - # @news_bulletin_categories = (id ? NewsBulletinCategory.admin_manager_all.find(id).to_a : NewsBulletinCategory.admin_manager_all) - # elsif is_sub_manager? - # @news_bulletin_categories = NewsBulletinCategory.all - # end - # @news_bulletin_categories - # end - - # def get_categorys(id = nil) - # @news_bulletin_categorys = [] - # @unit_list_for_anc = UnitListForAnc.all - # if(is_manager? || is_admin?) - # @news_bulletin_categorys = (id ? NewsBulletinCategory.admin_manager_all.find(id).to_a : NewsBulletinCategory.admin_manager_all) - # elsif is_sub_manager? - # @news_bulletin_categorys = NewsBulletinCategory.all.authed_for_user(current_user,'submit') - # end - # if @news_bulletin_categorys.empty? && params[:action] != "index" - # flash[:alert] = t("news_bulletin.error.no_avilb_cate_for_posting") - # redirect_to :action => :index - # end - # end - def get_unit_list - @unit_list_for_anc = UnitListForAnc.all - end - - def get_tags - module_app = ModuleApp.first(:conditions => {:key => 'news'}) - @tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc) rescue [] - end - - def clean_values - if params[:news_bulletin] - params[:news_bulletin][:news_bulletin_links_attributes].each_with_index do |link, index| - params[:news_bulletin][:news_bulletin_links_attributes].delete(index.to_s) if link[1]['url'].blank? and link[1]['title'].blank? - end rescue nil - params[:news_bulletin][:news_bulletin_files_attributes].each_with_index do |link, index| - params[:news_bulletin][:news_bulletin_files_attributes].delete(index.to_s) if link[1]['file'].blank? and link[1]['title'].blank? - end rescue nil - end - end - -end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/tags_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/tags_controller.rb deleted file mode 100644 index 970b426e1..000000000 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/tags_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class Panel::News::BackEnd::TagsController < Admin::TagsController - - def initialize - super - @app_title = 'news' - end - -end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb deleted file mode 100644 index a939ae06a..000000000 --- a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb +++ /dev/null @@ -1,83 +0,0 @@ -class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController - - def initialize - super - @app_title = 'news' - end - - # GET /news_bulletins - # GET /news_bulletins.xml - - def index_news_bulletins_by_unit - @page = Page.find(params[:page_id]) rescue nil - @news_bulletins=NewsBulletin.all.available_for_lang(I18n.locale).can_display.where("unit_list_for_anc_id"=>params[:name]).page( params[:page_main]).per(15).page( params[:page_main]).per(10) - render :index - end - - def index - @page = Page.find(params[:page_id]) rescue nil - if !params[:search_query].blank? - # search_cond = {:is_checked=>true,:is_hidden=>false,:is_pending=>false,:is_pending=>false} - # search_cond.merge!({:news_bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? - @search = NewsBulletin.solr_search do - fulltext params[:search_query] - with(:frontend_search,true) - with(:available_lang).any_of([I18n.locale.to_s]) - end - - search_result = @search.results.collect{|result| result.id} - @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).desc(:postdate).page( params[:page_main]).per(10) - else - date_now = Time.now - if !params[:category_id].blank? && !params[:tag_id].blank? - @tag = NewsTag.find(params[:tag_id]) rescue nil - @tag = NewsTag.where(key: params[:tag_id])[0] unless @tag - @news_bulletins = @tag.news_bulletins.available_for_lang(I18n.locale).can_display.where(:news_bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page_main]).per(15) - @current_category = NewsBulletinCategory.from_id(params[:category_id]) rescue nil - elsif !params[:category_id].blank? - @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.where(:news_bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page_main]).per(15) - @current_category = NewsBulletinCategory.from_id(params[:category_id]) rescue nil - elsif !params[:tag_id].blank? - @tag = NewsTag.find(params[:tag_id]) rescue nil - @tag = NewsTag.where(key: params[:tag_id])[0] unless @tag - @news_bulletins = @tag.news_bulletins.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page_main]).per(15) - else - @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page_main]).per(15) - end - impressionist(@tag) if @tag - end - end - - def show - if params[:preview] == "true" - preview_content - else - '' - @news_bulletin = NewsBulletin.all.can_display.where(_id: params[:id]).first - if !@news_bulletin.disable? and !@news_bulletin.is_rejected - if @news_bulletin.enabled_for_lang(I18n.locale.to_s) - impressionist(@news_bulletin) - get_categorys - else - render :text => "
#{t('sys.can_not_display_due_to_no_context')}
".html_safe - end - else - render :nothing => true, :status => 403 - end - - end - end - - def preview_content - @news_bulletin = NewsBulletin.find params[:id] rescue nil - @news_bulletin = Preview.find(params[:id]).get_virtual_object if @news_bulletin.nil? - get_categorys - end - - protected - - def get_categorys - @news_bulletin_categorys = NewsBulletinCategory.all - end - -end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/widget/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/widget/news_bulletins_controller.rb deleted file mode 100644 index c713fbb78..000000000 --- a/vendor/built_in_modules/news/app/controllers/panel/news/widget/news_bulletins_controller.rb +++ /dev/null @@ -1,73 +0,0 @@ -class Panel::News::Widget::NewsBulletinsController < OrbitWidgetController -# caches_page :home_banner - - def initialize - super - @app_title = 'news' - end - - # GET /news_bulletins - # GET /news_bulletins.xml - - def index - @title = params[:part_title] - date_now = Time.now - if !params[:category_id].blank? - @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.where(:news_bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(5) - @current_category = NewsBulletinCategory.from_id(params[:category_id]) rescue nil - elsif !params[:tag_id].blank? - @tag = NewsTag.find(params[:tag_id]) rescue nil - @tag = NewsTag.where(key: params[:tag_id])[0] unless @tag - @news_bulletins = @tag.news_bulletins.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(5) rescue nil - else - @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(5) - end - - end - - def news_bulletins_and_web_links - @tags = NewsTag.all - @selected_tag = NewsTag.find(params[:id]) rescue @tags[0] - @news_bulletins = @selected_tag.get_visible_news_bulletins(:postdate).available_for_lang(I18n.locale).can_display.page(params[:page]).per(5) rescue nil - @web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links(:created_at).page(params[:page]).per(5) rescue nil - end - - def reload_news_bulletins - @selected_tag = NewsTag.find(params[:tag_id]) - @news_bulletins = @selected_tag.get_visible_news_bulletins(:postdate).available_for_lang(I18n.locale).can_display.page(params[:page]).per(5) rescue nil - end - - def reload_web_links - @selected_tag = NewsTag.find(params[:tag_id]) - @web_links = WebResourceTag.first(:conditions => {:en => @selected_tag[:en]}).get_visible_links(:created_at).page(params[:page]).per(5) rescue nil - end - - def news_bulletins_side_bar - @tags_and_class = NewsTag.sorted_for_cloud - get_categorys - end - - def news_bulletins_search_block - - end - - def home_banner - if !params[:category_id].blank? - @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.where(:news_bulletin_category_id => params[:category_id]).widget_datas.limit(9) - elsif !params[:tag_id].blank? - @news_bulletins = NewsTag.find(params[:tag_id]).news_bulletins.available_for_lang(I18n.locale).can_display.widget_datas.limit(9) rescue nil - else - @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.widget_datas.limit(9) - end - get_categorys - - end - - - protected - - def get_categorys - @news_bulletin_categorys = NewsBulletinCategory.all - end - -end diff --git a/vendor/built_in_modules/news/app/helpers/.gitkeep b/vendor/built_in_modules/news/app/helpers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletin_categorys_helper.rb b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletin_categorys_helper.rb deleted file mode 100644 index 5de3323c2..000000000 --- a/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletin_categorys_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Panel::News::BackEnd::NewsBulletinCategorysHelper -include ActionView::Helpers::UrlHelper - - - def show_news_cate_permission_link(news_bulletin_category) - type = 'submit' - oa = news_bulletin_category.get_object_auth_by_title(type) - if oa.nil? - news_bulletin_category.object_auths.new(title: type ).save - oa = news_bulletin_category.get_object_auth_by_title(type) - end -# link_to t(:category_auth), edit_admin_object_auth_path(oa) - link_to t(:category_auth),admin_object_auth_ob_auth_path(oa) - - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb b/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb deleted file mode 100644 index aba740c66..000000000 --- a/vendor/built_in_modules/news/app/helpers/panel/news/back_end/news_bulletins_helper.rb +++ /dev/null @@ -1,33 +0,0 @@ -module Panel::News::BackEnd::NewsBulletinsHelper - def news_show_reject_reason(news_bulletin) - by_news_bulletin = news_bulletin.is_rejected - by_user = (((news_bulletin.create_user_id == current_user.id) rescue nil) or is_manager? or is_admin?) - by_news_bulletin && by_user - end - def news_show_form_status_field(news_bulletin) - #by_news_bulletin = (!news_bulletin.is_expired? and news_bulletin.is_pending?) - by_user = ((news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) or is_manager? or is_admin?) - by_user - end - - def news_show_approval_link(news_bulletin) - by_news_bulletin = (!news_bulletin.is_expired? and news_bulletin.is_pending?) - by_user = ((news_bulletin.news_bulletin_category.authed_users('fact_check').include?(current_user) rescue nil) or is_manager? or is_admin?) - by_news_bulletin and by_user - end - - def news_show_delete_link(news_bulletin) - by_news_bulletin = current_user.nil? ? false : (news_bulletin.create_user_id == current_user.id) - by_user = (is_manager? or is_admin?) - by_news_bulletin or by_user - end - - def show_news_bulletin_title_at_index (news_bulletin) - if news_bulletin.is_checked? - link_to news_bulletin.title, panel_news_front_end_news_bulletin_path(news_bulletin, :category_id => news_bulletin.news_bulletin_category.id) rescue '' - else - news_bulletin.title - end - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/mailers/.gitkeep b/vendor/built_in_modules/news/app/mailers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/built_in_modules/news/app/models/.gitkeep b/vendor/built_in_modules/news/app/models/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/built_in_modules/news/app/models/news_bulletin.rb b/vendor/built_in_modules/news/app/models/news_bulletin.rb deleted file mode 100644 index d037960ab..000000000 --- a/vendor/built_in_modules/news/app/models/news_bulletin.rb +++ /dev/null @@ -1,291 +0,0 @@ -# encoding: utf-8 - -class NewsBulletin - include Mongoid::Document - include Mongoid::Timestamps - include Mongoid::MultiParameterAttributes - include Sunspot::Mongo - include Impressionist::Impressionable - - BelongsToCategory = :news_bulletin_category - include OrbitCoreLib::BelongsToCategoryMayDisable - include OrbitCoreLib::Preview -# include Tire::Model::Search - # include Tire::Model::Callbacks - # include Redis::Objects - - - - - #scope :searchable,where(:is_checked=>true,:is_hidden=>false,:is_pending=>false) - - is_impressionable :counter_cache => { :column_name => :view_count } - - field :title, localize: true - field :subtitle, localize: true - field :text, localize: true - has_and_belongs_to_many :tags, :class_name => "NewsTag" - - field :postdate , :type => DateTime - field :deadline , :type => DateTime - # field :url - field :create_user_id - field :update_user_id, :class_name => "User" - - field :is_top, :type => Boolean, :default => false - field :is_hot, :type => Boolean, :default => false - field :is_hidden, :type => Boolean, :default => false - field :is_checked, :type => Boolean, :default => false - field :is_pending, :type => Boolean, :default => true - field :is_rejected, :type => Boolean, :default => false - field :view_count, :type => Integer, :default => 0 - - field :not_checked_reason - - field :public, :type => Boolean, :default => true - - scope :can_display, where(is_checked: true, is_rejected: false, is_pending: false) - scope :available_for_lang, ->(locale){ where("available_for_#{locale}".to_sym => true) } - - mount_uploader :image, ImageUploader - - belongs_to :unit_list_for_anc - - # embeds_many :news_bulletin_links, :cascade_callbacks => true - # embeds_many :news_bulletin_files, :cascade_callbacks => true - - has_many :news_bulletin_links, :autosave => true, :dependent => :destroy - has_many :news_bulletin_files, :autosave => true, :dependent => :destroy - - accepts_nested_attributes_for :news_bulletin_files, :allow_destroy => true - accepts_nested_attributes_for :news_bulletin_links, :allow_destroy => true - - validates :title, :at_least_one => true - - before_save :check_deadline - before_save :update_avliable_language, :clean_tags - - after_save :save_news_bulletin_links - after_save :save_news_bulletin_files - - # Tire.index 'news_bulletin' do - # delete - # create :mappings =>{ - # :news_bulletin_by_title => { - # :properties=> { - # :title => { :type => 'string', :index => 'not_analyzed', :include_in_all => false }, - # :body => {} - # } - # } - # :news_bulletin_by_body => { - # :properties=> { - # :body => { :type => 'string', :index => 'not_analyzed', :include_in_all => false }, - # } - # } - # } - # end - # mapping do - # indexes :title, :analyzer => 'cjk', :boost => 10 - # indexes :sub_titles, :analyzer => 'cjk', :boost => 5 - # indexes :text, :analyzer => 'cjk' - # end - def type - "news_bulletin" - end - - searchable do - text :titles do - title_translations.to_a.collect{|t| t[1]} - end - text :texts do - text_translations.to_a.collect{|t| Nokogiri::HTML(t[1]).text} - end - integer :view_count - - string :available_lang , :multiple => true do - VALID_LOCALES.collect{|t| enabled_for_lang(t.to_sym) ? t : nil}.delete_if{|t| t.nil?} - end - - boolean :frontend_search do - ( !is_hidden && !is_pending && is_checked && !is_rejected ) - end - - - string :news_bulletin_category_id - end - - # redis_search_index(:title_field => :s_title, - # :alias_field => :s_title_en, - # :score_field => :view_count, - # :condition_fields => [:is_checked,:is_hidden,:news_bulletin_category_id,:is_pending], - # :ext_fields =>[]) - -# def gen_title_for_search -# # [s_title,s_title_en,s_text_en,s_text_zh_tw].join(' ') -# end - - # def s_title - # self. - # end - - # def s_title_was - # self.title_was["zh_tw"] - # end - - # def s_title_en - # self.title_translations["en"] - # end - - # def s_title_en_was - # self.title_was["en"] - # end - - # def s_text_en - # Nokogiri::HTML(self.text.en).text - # end - # def s_text_zh_tw - # Nokogiri::HTML(self.text.zh_tw).text - # end - def share_item - Item.first(conditions:{name: 'news'}) - end - - def self.widget_datas( category_id = nil ) - - date_now = Time.now - - # find(:all, :conditions => {:postdate => {"$lte" => Date.today}, deadline: nil} ).desc( :is_top, :postdate) - # where( :postdate.lte => date_now ).where( :deadline => nil ).desc(:is_top, :postdate) - # any_of({ :title => "test" },{:deadline => nil, :title => "123"}) - - if category_id.to_s.size > 0 - find(:all, :conditions => {news_bulletin_category_id: category_id}).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).any_of(is_hot: true, is_top: true).desc(:postdate) - else - any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).any_of(is_hot: true, is_top: true).desc(:postdate) - end - - end - - def proc_check(check,not_pass_info = "") - self.is_checked = true - if check =="true" - self.is_rejected = false - elsif check == "false" - self.is_rejected = true - self.not_checked_reason = not_pass_info - end - end - - def enabled_for_lang(lang) - eval("self.available_for_#{lang}") - end - - def de_pending - self.is_pending = false - end - - def de_pending! - de_pending - self.save! - end - - def is_expired? - Date.today > self.deadline ? true : false rescue false - #some dates might sat as nil so rescue false - end - - def is_top? - self.is_top - end - - def is_hot? - self.is_hot - end - - def is_hidden? - self.is_hidden - end - - def is_checked? - !self.is_pending && self.is_checked && (self.is_rejected == false) - end - - def is_pending? - self.is_pending - end - - def is_rejected? - !self.is_pending && self.is_rejected && (self.is_rejected == true) - end - - - - def save_news_bulletin_links - self.news_bulletin_links.each do |t| - if t.should_destroy - t.destroy - end - end - end - - def save_news_bulletin_files - self.news_bulletin_files.each do |t| - if t.should_destroy - t.destroy - end - end - end - - def self.filter(news_bulletins) - news_bulletins.each do |news_bulletin| - p "#{news_bulletin.id}/#{news_bulletin.is_top}/#{news_bulletin.is_hot}/#{news_bulletin.is_hidden}" - end - return nil - end - - def sorted_tags - tags.order_by(I18n.locale, :asc) - end - - def to_preview - preview_object = Preview.new(:expired_at=>DateTime.now+30.minutes,:preview_at_link=>"panel_news_front_end_news_bulletin_path",:object_class_type=>"NewsBulletin") - preview_object.preview_files.build(:file=>self.news_bulletin["image"],:field_name_for_rebuild=>'image') - - - self.news_bulletin["news_bulletin_files_attributes"].each_with_index do |atr,idx| - preview_object.preview_files.build(:file=>self.news_bulletin["news_bulletin_files_attributes"][idx.to_s],:field_name_for_rebuild=>'news_bulletin_files',:file_in_array=>true) - end unless self.news_bulletin["news_bulletin_files_attributes"].nil? - - self.news_bulletin["news_bulletin_links_attributes"].each_with_index do |atr,idx| - preview_object.preview_associations.build(:object=>self.news_bulletin["news_bulletin_links_attributes"][idx.to_s],:field_name_for_rebuild=>'news_bulletin_links',:object_in_array=>true) - end unless self.news_bulletin["news_bulletin_links_attributes"].nil? - - preview_object.object = self.news_bulletin.except("news_bulletin_files_attributes","image","news_bulletin_links_attributes") - preview_object - end - - protected - - def update_avliable_language - VALID_LOCALES.each do |locale| - if (title_translations[locale].blank? rescue true) - self["available_for_#{locale}".to_sym] = false - else - self["available_for_#{locale}".to_sym] = true - end - end - end - - def check_deadline - if(!self.deadline.nil? and (self.deadline < self.postdate )) - self.deadline = nil - end - end - - def clean_tags - self.tag_ids.delete('') - end - - - -end diff --git a/vendor/built_in_modules/news/app/models/news_bulletin_category.rb b/vendor/built_in_modules/news/app/models/news_bulletin_category.rb deleted file mode 100644 index 8d433d965..000000000 --- a/vendor/built_in_modules/news/app/models/news_bulletin_category.rb +++ /dev/null @@ -1,30 +0,0 @@ -# encoding: utf-8 - -class NewsBulletinCategory - include Mongoid::Document - include Mongoid::Timestamps - include OrbitCoreLib::ObjectAuthable - include OrbitCoreLib::ObjectDisable - - ObjectAuthTitlesOptions = %W{submit_new fact_check} - AfterObjectAuthUrl = '/panel/news/back_end/news_bulletin_categorys' - # include Mongoid::MultiParameterAttributes - - PAYMENT_TYPES = [ "List", "Picture" ] - APP_NAME = 'news' - - field :key - field :display - - field :title, localize: true - has_many :news_bulletins - - def pp_object - title - end - - def self.from_id(id) - NewsBulletinCategory.find(id) rescue nil - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/models/news_bulletin_file.rb b/vendor/built_in_modules/news/app/models/news_bulletin_file.rb deleted file mode 100644 index 882d96cb9..000000000 --- a/vendor/built_in_modules/news/app/models/news_bulletin_file.rb +++ /dev/null @@ -1,17 +0,0 @@ -class NewsBulletinFile - - include Mongoid::Document - include Mongoid::Timestamps - - mount_uploader :file, AssetUploader - - field :title, localize: true - field :description, localize: true - - # field :to_save, :type => Boolean - field :should_destroy, :type => Boolean - - belongs_to :news_bulletin - # embedded_in :news_bulletin - -end diff --git a/vendor/built_in_modules/news/app/models/news_bulletin_link.rb b/vendor/built_in_modules/news/app/models/news_bulletin_link.rb deleted file mode 100644 index 6f48e19ed..000000000 --- a/vendor/built_in_modules/news/app/models/news_bulletin_link.rb +++ /dev/null @@ -1,23 +0,0 @@ -class NewsBulletinLink - - include Mongoid::Document - include Mongoid::Timestamps - - field :url - field :title, localize: true - - field :should_destroy, :type => Boolean - - belongs_to :news_bulletin - - before_validation :add_http - validates :url, :presence => true, :format => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix - - protected - - def add_http - unless self.url[/^http:\/\//] || self.url[/^https:\/\//] - self.url = 'http://' + self.url - end - end -end diff --git a/vendor/built_in_modules/news/app/models/news_tag.rb b/vendor/built_in_modules/news/app/models/news_tag.rb deleted file mode 100644 index ec3dbd439..000000000 --- a/vendor/built_in_modules/news/app/models/news_tag.rb +++ /dev/null @@ -1,13 +0,0 @@ -class NewsTag < Tag - has_and_belongs_to_many :news_bulletins - - def get_visible_news_bulletins(sort = :title) - date_now = Time.now - self.news_bulletins.where(:is_hidden => false).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, sort) - end - - def news_bulletins - NewsBulletin.all.any_in(:_id => news_bulletin_ids) - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/.gitkeep b/vendor/built_in_modules/news/app/views/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/fact_checks/setting.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/fact_checks/setting.html.erb deleted file mode 100644 index dbfb4fb36..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/fact_checks/setting.html.erb +++ /dev/null @@ -1,40 +0,0 @@ -<% content_for :page_specific_css do %> - <%= stylesheet_link_tag "inc/permission-checkbox" %> -<% end %> -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "bootstrap" %> - <%= javascript_include_tag "inc/permission-checkbox" %> - <%= javascript_include_tag "inc/search" %> -<% end %> -<%= form_tag('', :remote => true) %> - -<%#= label_tag :role, t(:roles) %> -
-<%= content_tag :div do -%> - <% form_tag :action => "update_setting" do %> - <%= render :partial => "privilege_user", :locals => {:users => @users_array} %> -
- <%= submit_tag "Update", :class => 'btn' %> -
- <% end -%> -<% end -%> -
- - \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_approve.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_approve.html.erb deleted file mode 100644 index 252a4d728..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_approve.html.erb +++ /dev/null @@ -1,69 +0,0 @@ - <% if news_bulletin -%> - - - - - -<% end -%> diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_list.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_list.html.erb deleted file mode 100644 index 559b52286..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_approvals/_modal_list.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -<% if news_bulletin_category -%> - - - - <% @site_valid_locales.each do |locale| %> - - <% end %> - diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/_quick_edit_qe.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/_quick_edit_qe.html.erb deleted file mode 100644 index 005ae64e6..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/_quick_edit_qe.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -<% # encoding: utf-8 %> - -
- -
- <%= f.label :key %> - <%= f.text_field :key %> -
-
- <%= f.fields_for :title_translations do |f| %> - <% @site_valid_locales.each do |locale| %> -
- <%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> -
- <%= f.text_field locale, :class => 'input-xxlarge', :value => (news_bulletin_category.title_translations[locale] rescue nil) %> -
-
- <% end %> - <% end %> -
- -
- <%= f.label :display %> - <%= f.radio_button :display, "List" %>List - <%= f.radio_button :display, "Picture" %>Picture -
顯示方式是設定在前台頁面時,資訊所呈現的樣式 -
-
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/create.js.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/create.js.erb deleted file mode 100644 index 3fe18f5e7..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/create.js.erb +++ /dev/null @@ -1,2 +0,0 @@ -$('<%= j render :partial => 'news_bulletin_category', :collection => [@news_bulletin_category] %>').appendTo('#news_bulletin_categorys').hide().fadeIn(); -$("#new_news_bulletin_category")[0].reset(); \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/destroy.js.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/destroy.js.erb deleted file mode 100644 index e2acc583a..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/destroy.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#<%= dom_id @news_bulletin_category %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@news_bulletin_category) %> "); \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/edit.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/edit.html.erb deleted file mode 100644 index 688b0f314..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/edit.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

<%= t('news_bulletin.editing_news_category') %>

- -<%= form_for @news_bulletin_category, :url => panel_news_back_end_news_bulletin_category_path(@news_bulletin_category) do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> -<% end %> - -<%= link_back %> diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/edit.js.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/edit.js.erb deleted file mode 100644 index eaff01fa3..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/edit.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#form > form").replaceWith("<%= j render "form" %>"); \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/index.html.erb deleted file mode 100644 index 976bee4ed..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/index.html.erb +++ /dev/null @@ -1,23 +0,0 @@ - -<%= flash_messages %> - -
- <%= news_bulletin_category.key %> -
- -
-
<%= news_bulletin_category.title_translations[locale] rescue nil %>
- - - - <% @site_valid_locales.each do |locale| %> - - <% end %> - - - - - <%= render :partial => 'news_bulletin_category', :collection => @news_bulletin_categorys %> - - -
<%= t(:key) %><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
- -
<%= render :partial => "form" if is_manager? %>
- - - diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/new.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/new.html.erb deleted file mode 100644 index 19ae25dd1..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/new.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% content_for :secondary do %> -<%= render :partial => '/panel/news/back_end/news_secondary' %> -<% end -%> - -<%= flash_messages %> - -
-
-
-
-
- -

<%= t('news_bulletin.new_news_category') %>

-<%= form_for @news_bulletin_category, :url => panel_news_back_end_news_bulletin_categorys_path do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> -<% end %> - -<%= link_back %> - diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/new.js.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/new.js.erb deleted file mode 100644 index 40061b9fc..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/new.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#form > form").replaceWith("<%= j render "form" %>"); diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/update.js.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/update.js.erb deleted file mode 100644 index 9b11d5d58..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletin_categorys/update.js.erb +++ /dev/null @@ -1,4 +0,0 @@ -$("#<%= dom_id @news_bulletin_category %>").replaceWith("<%= j render :partial => 'news_bulletin_category', :collection => [@news_bulletin_category] %>"); -<% @news_bulletin_category = NewsBulletinCategory.new(:display => 'List') # reset for new form %> -$(".edit_news_bulletin_category").replaceWith("<%= j render "form" %>") -$(".new_news_bulletin_category")[0].reset(); \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_clear_filters.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_clear_filters.html.erb deleted file mode 100644 index 532b141e7..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_clear_filters.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -
- <%= link_to content_tag(:i, nil, :class => 'icons-brush-large') + t(:clear), panel_news_back_end_news_bulletins_path(:filter => @filter, :sort => params[:sort], :direction => params[:direction], :clear => true, :type => type), :class => "btn btn-small js_history" %> -
\ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_file.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_file.html.erb deleted file mode 100644 index 8346402b9..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_file.html.erb +++ /dev/null @@ -1,37 +0,0 @@ -
- - <% news_bulletin_files.each do | news_bulletin_file | %> - - <%= fields_for 'news_bulletin[news_bulletin_files][]', news_bulletin_file, :index => nil do |f| %> - -
" class='list_item'> -
- <%= f.label :file %> - <%#= file_field_tag 'news_bulletin[file]' %> - <%= f.file_field :file %> - - <%= f.label :file_title %> - <%= f.text_field :title %> - - <%= f.label :file_description %> - <%= f.text_field :description %> - - - <% if news_bulletin_file.new_record? %> - <%= t(:delete) %> - <% else %> - <%= f.hidden_field :id %> - <% if news_bulletin_file.is_built_in? %> - - <% else %> - <%= t(:delete) %> - <%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %> - <% end %> - <% end %> - -
-
- <% end %> - - <% end %> -
diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter.html.erb deleted file mode 100644 index f9d064b12..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter.html.erb +++ /dev/null @@ -1,37 +0,0 @@ - - -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "sort_header" %> -<% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_categories.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_categories.html.erb deleted file mode 100644 index 81d597348..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_categories.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -
- <% @news_bulletin_categories.each do |category| -%> - <%= link_to category.title, panel_news_back_end_news_bulletins_path(:filter => @filter, :new_filter => {:type => 'categories', :id => category.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('categories', category.id)}" %> - <% end -%> -
-<%= render :partial => 'clear_filters', :locals => {:type => 'categories'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_status.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_status.html.erb deleted file mode 100644 index 40d4f0021..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_status.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -
- <%= link_to t(:top), panel_news_back_end_news_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_top'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_top')}" %> - <%= link_to t(:hot), panel_news_back_end_news_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hot'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_hot')}" %> - <%= link_to t(:hidden), panel_news_back_end_news_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hidden'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_hidden')}" unless(is_guest?)%> - <%= link_to t(:pending), panel_news_back_end_news_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_pending'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_pending')}" if(is_manager?) %> - <%= link_to t(:passed), panel_news_back_end_news_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_checked'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_checked')}" if(is_manager?)%> - <%= link_to t(:rejected), panel_news_back_end_news_bulletins_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_rejected'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_rejected')}" if(is_manager?)%> -
-<%= render :partial => 'clear_filters', :locals => {:type => 'status'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_tags.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_tags.html.erb deleted file mode 100644 index 2579ef38f..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_filter_tags.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -
- <% @tags.each do |tag| -%> - <%= link_to tag[I18n.locale], panel_news_back_end_news_bulletins_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %> - <% end -%> -
-<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb deleted file mode 100644 index 1b7e1f197..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form.html.erb +++ /dev/null @@ -1,308 +0,0 @@ -<% # encoding: utf-8 %> -<% content_for :page_specific_javascript do -%> - <%= javascript_include_tag "inc/modal-preview" %> -<% end -%> - - <%= f.error_messages %> -
-
-
- -
-

<%= t('nccu.picture') %>

-
-
- -
- <% if @news_bulletin.image %> - <%= image_tag @news_bulletin.image rescue ''%> - <% else %> - - <% end %> -
- <%= t("ad.widget_info_for_ad_image_size", :best_size=> "290px x 150px") %> -
- <%= t(:browse) %> - <%= f.file_field :image, :id => "input-upload", :class => '', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %> - - <% if @news_bulletin.image.file %> - <%= f.check_box :remove_image %> - <%= t(:delete_file) %> - <% end %> -
-
-
-
- - - -
-
- -
-

<%= t('nccu.date') %>

-
-
- -
- <%= f.date_select :postdate, {:use_month_numbers => true, :order => [:day, :month, :year] }, {:class => 'input-small'} %> -
-
-
- -
- <%= f.date_select :deadline, {:use_month_numbers => true, :prompt => { :month => 'Month', :day => 'Day', :year => 'Year'}, :order => [:day, :month, :year] }, {:class => 'input-small'} %> -
-
-
-
- - <% if news_show_form_status_field( @news_bulletin)%> -
-
- -
-

<%= t(:status) %>

-
-
- <%= content_tag :label,:class => "checkbox inline" do -%> - <%= f.check_box :is_top %> - <%= t('top') %> - <% end -%> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= f.check_box :is_hot %> - <%= t('news_bulletin.hot') %> - <% end -%> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= f.check_box :is_hidden %> - <%= t('hide') %> - <% end -%> -
-
-
- <% end %> -
-
- -
-

<%= t('nccu.tags') %>

-
- <% @tags.each do |tag| %> - <%= content_tag :label,:class => "checkbox inline" do -%> - <%= check_box_tag 'news_bulletin[tag_ids][]', tag.id, @news_bulletin.tag_ids.include?(tag.id)%> - <%= tag[I18n.locale] %> - <%= hidden_field_tag 'news_bulletin[tag_ids][]', '' %> - <% end %> - <% end %> -
-
- <% if @news_bulletin.is_rejected %> -
-
- -
-

<%= t('approval.stat') %>

-
- <%= @news_bulletin.not_checked_reason rescue t("rejected_reason_empty") %> -
-
- <% end %> - <% if params[:action] != 'new' %> -
-
- -
- -
- <% elsif current_user.admin? %> - <%= f.hidden_field :is_checked,:value => true%> - <% end %> -
- - - - - -
-
- <%= alert_block_tag(t("activerecord.errors.template.body"),session[:in_validate_object].errors.messages) unless session[:in_validate_object].blank? %> - <%= f.label :unit_list_for_anc,t(:unit_name)%> - <%= f.select :unit_list_for_anc_id,@unit_list_for_anc.collect{|t| [ t.title, t.id ]}, {:prompt => t("news_bulletin.ut_prompt")}, :class => "input-medium" %> - - <%= f.label :category,t(:category) %> - <%= f.select :news_bulletin_category_id, @news_bulletin_categorys.collect{|t| [ t.title, t.id ]}, {}, :class => "input-medium" %> - - - -
- - <%# @site_valid_locales.each_with_index do |locale, i| %> - <% @site_valid_locales.each_with_index do |locale, i| %> - -
"> - -
- <%= f.label :title, t(:title)%> - <%= f.fields_for :title_translations do |f| %> - <%= I18nVariable.from_locale(locale) %> - <%= f.text_field locale, :class=>'post-title', :value => (@news_bulletin.title_translations[locale] rescue nil) %> - <% end %> -
- -
- <%= f.label :subtitle, t(:subtitle) %> - <%= f.fields_for :subtitle_translations do |f| %> - <%= I18nVariable.from_locale(locale) %> - <%= f.text_area locale, :rows => 5, :style=>"width:100%", :value => (@news_bulletin.subtitle_translations[locale] rescue nil) %> - <% end %> -
- -
- <%= f.label :text, t(:text) %> - <%= f.fields_for :text_translations do |f| %> - <%= I18nVariable.from_locale(locale) %> - <%= f.text_area locale, :style=>"width:100%", :class => 'tinymce_textarea', :value => (@news_bulletin.text_translations[locale] rescue nil) %> - <% end %> -
- -
- - <% end %> - -
- -
- -
-
- -
-

<%= t('nccu.file') %>

-
- -
- - - - - - - - - - - - - - - - - - <% @news_bulletin.news_bulletin_files.each_with_index do |news_bulletin_file, i| %> - <%#= fields_for "news_bulletin[news_bulletin_files][]", news_bulletin_file do |f| %> - <%= f.fields_for :news_bulletin_files, news_bulletin_file do |f| %> - <%= render :partial => 'form_news_bulletin_file', :object => news_bulletin_file, :locals => {:f => f, :i => i} %> - <% end %> - <% end %> - - -
<%= t('nccu.selected_file') %><%= t('nccu.file_name') %><%= t('nccu.file_description') %>
-
- <%= hidden_field_tag 'news_bulletin_file_field_count', @news_bulletin.news_bulletin_files.count %> - <%= t(:add) %> -

<%= t("sys.limit_of_upload_file_size",:best_size => '3MB') %>

-

<%= t("sys.preview_only_for_img") %>

- -
-
-
- -
-
-
- -
- -
- -
- <%= button_tag t("preview"), :id=>"button_for_preview", :name=>"commit", :class=>'btn post_preview two_btn',:type=>:button, :url=>preview_panel_news_back_end_news_bulletins_path %> - <%= f.submit t('submit'), :class=>'btn btn-primary two_btn' %> - <%= link_to t('cancel'), get_go_back, :class=>"btn" %> -
- -
- - - -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "inc/jquery.imagesloaded.js" %> - -<% end %> diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form_news_bulletin_file.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form_news_bulletin_file.html.erb deleted file mode 100644 index 0eb9c3a0c..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form_news_bulletin_file.html.erb +++ /dev/null @@ -1,73 +0,0 @@ - - " class='list_item'> - -
-
- <%= f.file_field :file %> - <%= form_news_bulletin_file.file.file ? ( link_to t(:view), form_news_bulletin_file.file.url, {:class => 'for_preview btn', :target => '_blank', :title => t(:view)}.merge(file_picture_preview_setting(form_news_bulletin_file.file.url)) ) : '' %> -
-
- - - -
- - <% @site_valid_locales.each_with_index do |locale, i| %> - -
"> - - <%= f.fields_for :title_translations do |f| %> -
- -
- <%= f.text_field locale, :id => "link-#{locale}", :value => (form_news_bulletin_file.title_translations[locale] rescue nil) %> -
-
- <% end %> - -
- - <% end %> - -
- - - - -
- - <% @site_valid_locales.each_with_index do |locale, i| %> - -
"> - - <%= f.fields_for :description_translations do |f| %> -
- -
- <%= f.text_field locale, :id => "link-#{locale}", :value => (form_news_bulletin_file.description_translations[locale] rescue nil) %> -
-
- <% end %> - -
- - <% end %> - -
- - - - - <% if form_news_bulletin_file.new_record? %> - - <% else %> - <%= f.hidden_field :id %> - <%= hidden_field_tag :tr, (dom_id form_news_bulletin_file) %> - - <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> - <% end %> - - - - - diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form_news_bulletin_link.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form_news_bulletin_link.html.erb deleted file mode 100644 index 9a280bdd3..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_form_news_bulletin_link.html.erb +++ /dev/null @@ -1,48 +0,0 @@ - - " class='list_item'> - - -
-
- <%= f.text_field :url %> -
-
- - - - -
- - <% @site_valid_locales.each_with_index do |locale, i| %> - -
"> - - <%= f.fields_for :title_translations do |f| %> -
- -
- <%= f.text_field locale, :id => "link-#{locale}", :class => "input-xlarge", :value => (form_news_bulletin_link.title_translations[locale] rescue nil) %> -
-
- <% end %> - -
- - <% end %> - -
- - - - - <% if form_news_bulletin_link.new_record? %> - - <% else %> - <%= f.hidden_field :id %> - <%= hidden_field_tag :tr, (dom_id form_news_bulletin_link) %> - - <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> - <% end %> - - - diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_list_news_bulletin_file.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_list_news_bulletin_file.html.erb deleted file mode 100644 index 04f11c44c..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_list_news_bulletin_file.html.erb +++ /dev/null @@ -1,22 +0,0 @@ - - - <%= list_news_bulletin_file.file.file ? ( link_to list_news_bulletin_file.title_translations['zh_tw'], list_news_bulletin_file.file.url, {:target => '_blank', :title => list_news_bulletin_file.description_translations['zh_tw']} ) : list_news_bulletin_file.title_translations['zh_tw'] %> - <%= list_news_bulletin_file.file.file ? ( link_to list_news_bulletin_file.title_translations['en'], list_news_bulletin_file.file.url, {:target => '_blank', :title => list_news_bulletin_file.description_translations['en']} ) : list_news_bulletin_file.title_translations['en'] %> - - - - <%= fields_for "news_bulletin[news_bulletin_files_attributes][]", list_news_bulletin_file, :index => list_news_bulletin_file_counter do |f| %> - <%= f.hidden_field :id %> - <%= hidden_field_tag :tr, (dom_id list_news_bulletin_file) %> - - <%= f.hidden_field :_destroy, :value => nil , :class => 'should_destroy' %> - <% end %> - - - - - - - - - \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_list_news_bulletin_link.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_list_news_bulletin_link.html.erb deleted file mode 100644 index b5e94323d..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_list_news_bulletin_link.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - - <%= link_to list_news_bulletin_link.title_translations['zh_tw'], list_news_bulletin_link.url, :target => '_blank' %> - <%= link_to list_news_bulletin_link.title_translations['en'], list_news_bulletin_link.url, :target => '_blank' %> - - - - <%= fields_for "news_bulletin[news_bulletin_links_attributes][]", list_news_bulletin_link, :index => list_news_bulletin_link_counter do |f| %> - <%= f.hidden_field :id %> - <%= hidden_field_tag :tr, (dom_id list_news_bulletin_link) %> - - <%= f.hidden_field :_destroy, :value => nil, :class => 'should_destroy' %> - <% end %> - - - diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb deleted file mode 100644 index bd9bddfd0..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin.html.erb +++ /dev/null @@ -1,76 +0,0 @@ - - - <% if (news_bulletin.create_user_id == current_or_guest_user.id) || is_manager? %> - <%= check_box_tag 'to_delete[]', news_bulletin.id, false, :class => "checkbox_in_list" %> - <% end -%> - - -
-
- <% if news_bulletin.is_top? %> - <%= t(:top) %> - <% end %> - <% if news_bulletin.is_hot? %> - <%= t('news_bulletin.hot') %> - <% end %> - <% if news_bulletin.is_hidden? %> - <%= t(:hidden) %> - <% end %> - <% if news_bulletin.is_pending? %> - <%= t(:pending) %> - <% end %> - <% if news_bulletin.is_checked? %> - <%= t(:passed) %> - <% end %> - <% if news_bulletin.is_rejected? %> - <%= t(:rejected) %> - <% end %> -
-
- - - <%= show_news_bulletin_title_at_index news_bulletin%> -
- -
- - <%= display_date(news_bulletin.postdate) %> - <%= (news_bulletin.deadline) ? display_date(news_bulletin.deadline) : t(:no_deadline) %> - -
-
- <% news_bulletin.sorted_tags.each do |tag| %> - <%= tag[I18n.locale] %> - <% end %> -
-
- - <%= news_bulletin.view_count rescue nil %> - <%= news_bulletin.unit_list_for_anc.title rescue nil %> - - diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin_file_qe.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin_file_qe.html.erb deleted file mode 100644 index 842ebe09e..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin_file_qe.html.erb +++ /dev/null @@ -1,51 +0,0 @@ -<% # encoding: utf-8 %> - - <%= form_for @news_bulletin_file, :url => @file_url, :html => {:id => 'ajaxForm', :multipart => true} do |f| %> - - - - - - - - <% end %> - - - \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin_link_qe.html.erb b/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin_link_qe.html.erb deleted file mode 100644 index e033b46fd..000000000 --- a/vendor/built_in_modules/news/app/views/panel/news/back_end/news_bulletins/_news_bulletin_link_qe.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -<% # encoding: utf-8 %> - -<%= form_for(@news_bulletin_link, :remote => true, :url => @link_url) do |f| %> - - - -