From 490ced3b4d49ce19c8410d42799d6cd0cd224753 Mon Sep 17 00:00:00 2001 From: Manson Wang Date: Tue, 14 Jan 2014 19:54:35 +0800 Subject: [PATCH] Orbit Announcement --- .gitignore | 6 + Gemfile | 17 + MIT-LICENSE | 20 + README | 0 README.rdoc | 3 + Rakefile | 39 + announcement.gemspec | 23 + app/assets/images/announcement/.gitkeep | 0 app/assets/javascripts/announcement_link.js | 45 + app/assets/stylesheets/announcement/.gitkeep | 0 .../announcement/bulletins_and_web_links.css | 78 + app/controllers/.gitkeep | 0 app/controllers/application_controller.rb | 23 + .../back_end/approvals_controller.rb | 65 + .../back_end/bulletin_files_controller.rb | 48 + .../back_end/bulletin_links_controller.rb | 49 + .../back_end/bulletins_controller.rb | 187 +++ .../front_end/bulletins_controller.rb | 81 + .../widget/bulletins_controller.rb | 162 ++ app/helpers/.gitkeep | 0 app/mailers/.gitkeep | 0 app/models/.gitkeep | 0 app/models/bulletin.rb | 163 ++ app/models/bulletin_category.rb | 33 + app/models/bulletin_file.rb | 14 + app/models/bulletin_link.rb | 25 + app/models/unit_list_for_anc.rb | 11 + app/views/.gitkeep | 0 .../approvals/_modal_approve.html.erb | 83 + .../back_end/approvals/_modal_list.html.erb | 44 + .../approvals/preview_and_approve.js.erb | 2 + .../back_end/approvals/setting.html.erb | 53 + .../back_end/approvals/setting.js.erb | 2 + .../back_end/approvals/update_setting.js.erb | 1 + .../back_end/approvals/user_list.js.erb | 2 + .../_modal_list.html.erb | 44 + .../back_end/bulletins/_form.html.erb | 307 ++++ .../back_end/bulletins/_form_back.html.erb | 305 ++++ .../back_end/bulletins/_form_file.html.erb | 55 + .../back_end/bulletins/_form_link.html.erb | 26 + .../bulletins/_modal_preview.html.erb | 48 + .../back_end/bulletins/destroy.js.erb | 1 + .../back_end/bulletins/edit.html.erb | 5 + .../back_end/bulletins/index.html.erb | 61 + .../back_end/bulletins/new.html.erb | 5 + .../bulletins/realtime_preview.js.erb | 2 + .../back_end/bulletins/show.html.erb | 49 + .../back_end/bulletins/toggle_enable.js.erb | 3 + .../fact_checks/_privilege_user.html.erb | 25 + .../front_end/bulletins/index.html.erb | 34 + .../front_end/bulletins/index.rss.builder | 22 + .../bulletins/search_result.html.erb | 34 + .../front_end/bulletins/show.html.erb | 41 + .../front_end/bulletins/show.rss.builder | 19 + .../announcement/plugin/_profile.html.erb | 53 + .../widget/bulletins/_bulletins.html.erb | 10 + .../widget/bulletins/_index.html.erb | 252 +++ .../widget/bulletins/_tag.html.erb | 3 + .../widget/bulletins/_web_links.html.erb | 10 + .../bulletins_and_web_links.html.erb | 35 + .../bulletins/bulletins_and_web_links.js.erb | 3 + .../widget/bulletins/bulletins_list.html.erb | 31 + .../bulletins/bulletins_search_block.html.erb | 9 + .../bulletins/bulletins_side_bar.html.erb | 23 + .../widget/bulletins/index.html.erb | 7 + .../widget/bulletins/index.js.erb | 1 + .../widget/bulletins/reload_bulletins.js.erb | 1 + .../widget/bulletins/reload_web_links.js.erb | 1 + config/locales/en.yml | 38 + config/locales/zh_tw.yml | 41 + config/routes.rb | 46 + lib/announcement.rb | 100 ++ lib/announcement/version.rb | 3 + lib/nccu_ann20120918.csv | 1485 +++++++++++++++++ script/rails | 6 + 75 files changed, 4523 insertions(+) create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 MIT-LICENSE create mode 100644 README create mode 100644 README.rdoc create mode 100644 Rakefile create mode 100644 announcement.gemspec create mode 100644 app/assets/images/announcement/.gitkeep create mode 100644 app/assets/javascripts/announcement_link.js create mode 100644 app/assets/stylesheets/announcement/.gitkeep create mode 100644 app/assets/stylesheets/announcement/bulletins_and_web_links.css create mode 100644 app/controllers/.gitkeep create mode 100644 app/controllers/application_controller.rb create mode 100644 app/controllers/panel/announcement/back_end/approvals_controller.rb create mode 100644 app/controllers/panel/announcement/back_end/bulletin_files_controller.rb create mode 100644 app/controllers/panel/announcement/back_end/bulletin_links_controller.rb create mode 100644 app/controllers/panel/announcement/back_end/bulletins_controller.rb create mode 100644 app/controllers/panel/announcement/front_end/bulletins_controller.rb create mode 100644 app/controllers/panel/announcement/widget/bulletins_controller.rb create mode 100644 app/helpers/.gitkeep create mode 100644 app/mailers/.gitkeep create mode 100644 app/models/.gitkeep create mode 100644 app/models/bulletin.rb create mode 100644 app/models/bulletin_category.rb create mode 100644 app/models/bulletin_file.rb create mode 100644 app/models/bulletin_link.rb create mode 100644 app/models/unit_list_for_anc.rb create mode 100644 app/views/.gitkeep create mode 100644 app/views/panel/announcement/back_end/approvals/_modal_approve.html.erb create mode 100644 app/views/panel/announcement/back_end/approvals/_modal_list.html.erb create mode 100644 app/views/panel/announcement/back_end/approvals/preview_and_approve.js.erb create mode 100644 app/views/panel/announcement/back_end/approvals/setting.html.erb create mode 100644 app/views/panel/announcement/back_end/approvals/setting.js.erb create mode 100644 app/views/panel/announcement/back_end/approvals/update_setting.js.erb create mode 100644 app/views/panel/announcement/back_end/approvals/user_list.js.erb create mode 100644 app/views/panel/announcement/back_end/bulletin_category_setting/_modal_list.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/_form.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/_form_back.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/_form_file.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/_form_link.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/_modal_preview.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/destroy.js.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/edit.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/index.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/new.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/realtime_preview.js.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/show.html.erb create mode 100644 app/views/panel/announcement/back_end/bulletins/toggle_enable.js.erb create mode 100644 app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb create mode 100644 app/views/panel/announcement/front_end/bulletins/index.html.erb create mode 100644 app/views/panel/announcement/front_end/bulletins/index.rss.builder create mode 100644 app/views/panel/announcement/front_end/bulletins/search_result.html.erb create mode 100644 app/views/panel/announcement/front_end/bulletins/show.html.erb create mode 100644 app/views/panel/announcement/front_end/bulletins/show.rss.builder create mode 100644 app/views/panel/announcement/plugin/_profile.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/_bulletins.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/_index.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/_tag.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/_web_links.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.js.erb create mode 100644 app/views/panel/announcement/widget/bulletins/bulletins_list.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/bulletins_search_block.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/bulletins_side_bar.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/index.html.erb create mode 100644 app/views/panel/announcement/widget/bulletins/index.js.erb create mode 100644 app/views/panel/announcement/widget/bulletins/reload_bulletins.js.erb create mode 100644 app/views/panel/announcement/widget/bulletins/reload_web_links.js.erb create mode 100644 config/locales/en.yml create mode 100644 config/locales/zh_tw.yml create mode 100644 config/routes.rb create mode 100644 lib/announcement.rb create mode 100644 lib/announcement/version.rb create mode 100644 lib/nccu_ann20120918.csv create mode 100644 script/rails diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1463de6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.bundle/ +log/*.log +pkg/ +test/dummy/db/*.sqlite3 +test/dummy/log/*.log +test/dummy/tmp/ \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..ee2fc0a --- /dev/null +++ b/Gemfile @@ -0,0 +1,17 @@ +source "http://rubygems.org" + +# Declare your gem's dependencies in announcement.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/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..80cf031 --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +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/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..9dfb6c9 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,3 @@ += Announcement + +This project rocks and uses MIT-LICENSE. \ No newline at end of file diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..3c4cece --- /dev/null +++ b/Rakefile @@ -0,0 +1,39 @@ +#!/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 = 'Announcement' + 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/announcement.gemspec b/announcement.gemspec new file mode 100644 index 0000000..967ee3d --- /dev/null +++ b/announcement.gemspec @@ -0,0 +1,23 @@ +# coding: utf-8 +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'announcement/version' + +Gem::Specification.new do |spec| + spec.name = "announcement" + spec.version = Announcement::VERSION + spec.authors = ["Manson Wang"] + spec.email = ["manson@rulingcom.com"] + spec.description = "Orbit Announcement module" + spec.summary = "" + spec.homepage = "" + spec.license = "RulingDigital" + + spec.files = `git ls-files`.split($/) + spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } + spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler", "~> 1.3" + spec.add_development_dependency "rake" +end diff --git a/app/assets/images/announcement/.gitkeep b/app/assets/images/announcement/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/announcement_link.js b/app/assets/javascripts/announcement_link.js new file mode 100644 index 0000000..89a5e56 --- /dev/null +++ b/app/assets/javascripts/announcement_link.js @@ -0,0 +1,45 @@ +$(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/app/assets/stylesheets/announcement/.gitkeep b/app/assets/stylesheets/announcement/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/stylesheets/announcement/bulletins_and_web_links.css b/app/assets/stylesheets/announcement/bulletins_and_web_links.css new file mode 100644 index 0000000..ecd2821 --- /dev/null +++ b/app/assets/stylesheets/announcement/bulletins_and_web_links.css @@ -0,0 +1,78 @@ + +.mega_tab_block { + clear: both; + position: relative; +} + +.mega_tab_block h3 { + font: 22px/100% 'arial',sans-serif; + margin: 0 0 10px; + padding: 0; +} + +.mega_tab_block .pagination { + float: left; + height: auto; + margin: 10px 0 0; + width: auto; +} +.mega_tab_block .pagination a { + background: none repeat scroll 0 0 #EEEEEE; + display: block; + float: left; + margin: 0 5px 0 0; + padding: 10px; +} + + +.tag_block { + clear: both; + margin: 0 0 20px; + position: relative; +} +.mega_tab_block .tag_list { + background: none repeat scroll 0 0 #EEEEEE; + margin: 0; + overflow: hidden; + padding: 0 0 0 5px; +} +.mega_tab_block .tag_list li { + float: left; + list-style: none outside none; +} +.mega_tab_block .tag_list li a { + background: none repeat scroll 0 0 #DDDDDD; + float: left; + margin: 0 5px 0 0; + padding: 10px; +} + +.news_block { + clear: both; + margin: 0 0 20px; + overflow: hidden; + position: relative; +} +.mega_tab_block .news_list { + margin: 0; + padding: 0; +} +.mega_tab_block .news_list li { + list-style: none outside none; + padding: 5px 0; +} + + +.links_block { + clear: both; + overflow: hidden; + position: relative; +} +.mega_tab_block .links_list { + margin: 0; + padding: 0; +} +.mega_tab_block .links_list li { + list-style: none outside none; + padding: 5px 0; +} \ No newline at end of file diff --git a/app/controllers/.gitkeep b/app/controllers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..307a4ac --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,23 @@ +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/app/controllers/panel/announcement/back_end/approvals_controller.rb b/app/controllers/panel/announcement/back_end/approvals_controller.rb new file mode 100644 index 0000000..81ce81e --- /dev/null +++ b/app/controllers/panel/announcement/back_end/approvals_controller.rb @@ -0,0 +1,65 @@ +class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendController + before_filter :authenticate_user! + before_filter :is_admin? + include AdminHelper + # layout 'admin' + + + def preview_and_approve + @bulletin = Bulletin.find params[:bulletin_id] + end + + def approve + notice = "" + @bulletin = Bulletin.find params[:bulletin_id] + @bulletin.proc_check(params[:bulletin][:is_checked],params[:bulletin][:not_checked_reason]) + @bulletin.de_pending + if @bulletin.save + notice = t('announcement.approve_bulletin_success') + else + notice = t('announcement.approve_bulletin_fail') + end + redirect_to(panel_announcement_back_end_bulletins_url,:notice => notice) + end + + def setting + @sys_users = User.all(conditions: {admin: false}).includes(:avatar).not_guest_user + @bulletin_categorys = BulletinCategory.all + @options_from_collection_for_select_bulletin_categorys = @bulletin_categorys.collect{|bc| [bc.title,bc.id] } + if params.has_key? :category + @bulletin_category = BulletinCategory.find params[:category][:id] + else + @bulletin_category = @bulletin_categorys.first + end + preload_object_auth = @bulletin_category.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 + @bulletin_category = BulletinCategory.find params[:category][:id] + end + + protected + def update_setting_by_params + category = BulletinCategory.find params[: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 + +end diff --git a/app/controllers/panel/announcement/back_end/bulletin_files_controller.rb b/app/controllers/panel/announcement/back_end/bulletin_files_controller.rb new file mode 100644 index 0000000..a3ac3d0 --- /dev/null +++ b/app/controllers/panel/announcement/back_end/bulletin_files_controller.rb @@ -0,0 +1,48 @@ +class Panel::Announcement::BackEnd::BulletinFilesController < ApplicationController + + layout 'back_end' + + def index + @bulletin_files = BulletinFile.all + + respond_to do |format| + format.html # index.html.erb + # format.xml { render :xml => @bulletins } + format.js + end + + end + + # POST /bulletins + # POST /bulletins.xml + def create + @bulletin_file = BulletinFile.new(params[:bulletin_file]) + + respond_to do |format| + if @bulletin_file.save + format.html { redirect_to(panel_announcement_back_end_bulletins_url) } + format.js + else + format.html { render :action => "new" } + format.js { render action: "new" } + end + end + end + + # PUT /bulletins/1 + # PUT /bulletins/1.xml + def update + @bulletin_file = BulletinFile.find(params[:id]) + + respond_to do |format| + if @bulletin_file.update_attributes(params[:bulletin_file]) + format.html { redirect_to(panel_announcement_back_end_bulletins_url) } + format.js + else + format.html { render :action => "edit" } + format.js { render :action => "edit" } + end + end + end + +end diff --git a/app/controllers/panel/announcement/back_end/bulletin_links_controller.rb b/app/controllers/panel/announcement/back_end/bulletin_links_controller.rb new file mode 100644 index 0000000..022d896 --- /dev/null +++ b/app/controllers/panel/announcement/back_end/bulletin_links_controller.rb @@ -0,0 +1,49 @@ +class Panel::Announcement::BackEnd::BulletinLinksController < ApplicationController + + layout 'back_end' + + def index + @bulletin_links = BulletinLink.all + + respond_to do |format| + format.html # index.html.erb + # format.xml { render :xml => @bulletins } + format.js + end + + end + + # POST /bulletins + # POST /bulletins.xml + def create + @bulletin_link = BulletinLink.new(params[:bulletin_link]) + # @bulletin_link.bulletin_id = params[:bulletin_link][:bulletin_id] + + respond_to do |format| + if @bulletin_link.save + format.html { redirect_to(panel_announcement_back_end_bulletins_url) } + format.js + else + format.html { render :action => "new" } + format.js { render action: "new" } + end + end + end + + # PUT /bulletins/1 + # PUT /bulletins/1.xml + def update + @bulletin_link = BulletinLink.find(params[:id]) + + respond_to do |format| + if @bulletin_link.update_attributes(params[:bulletin_link]) + format.html { redirect_to(panel_announcement_back_end_bulletins_url) } + format.js + else + format.html { render :action => "edit" } + format.js { render :action => "edit" } + end + end + end + +end diff --git a/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/app/controllers/panel/announcement/back_end/bulletins_controller.rb new file mode 100644 index 0000000..f44c7cb --- /dev/null +++ b/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -0,0 +1,187 @@ +class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController + # include OrbitControllerLib::DivisionForDisable + + before_filter :clean_values, :only => [:create, :update] + + open_for_visitor :only => [:index, :show, :get_sorted_and_filtered_bulletins] + + before_filter :only => [ :new, :create, :edit, :update ] do |controller| + @categories = get_categories_for_form + end + + def preview + bulletin = Bulletin.new params + @preview_obj = bulletin.to_preview + @preview_obj.save + render '/shared/preview/preview.html.erb',:layout=>false + end + + + def index + @tags = get_tags + @categories = get_categories_for_index + @statuses = get_statuses + category_ids = @categories.collect{|t| t.id} + + @bulletins = get_sorted_and_filtered("bulletin", :category_id.in => category_ids) + respond_to do |format| + format.html # index.html.erb + format.js { } + format.xml { render :xml => @bulletins } + end + end + + # GET /bulletins/1 + # GET /bulletins/1.xml + def show + @bulletin = Bulletin.find(params[:id]) + @tags = get_tags + + respond_to do |format| + format.html # show.html.erb + format.xml { render :xml => @bulletin } + end + end + + # GET /bulletins/new + # GET /bulletins/new.xml + def new + if(session[:in_validate_object].blank?) + @bulletin = Bulletin.new(:postdate => DateTime.now) + else + @bulletin = session[:in_validate_object] + session[:in_validate_object] = {} + end + + @link_url = panel_announcement_back_end_bulletins_path + @tags = get_tags + respond_to do |format| + format.html # new.html.erb + format.xml { render :xml => @bulletin } + end + end + + # GET /bulletins/1/edit + def edit + @bulletin = Bulletin.find(params[:id]) + @tags = get_tags + is_authorized_sub_manager = @bulletin.category.auth_sub_manager.authorized_user_ids rescue nil + + if !(is_manager? || is_admin? || is_authorized_sub_manager.include?(current_user.id)) + redirect_to :action => :index + else + # @summary_variable = @bulletin.summary_variable + + @link_url = panel_announcement_back_end_bulletin_path(@bulletin) + + @tags = get_tags + end + end + + # POST /bulletins + # POST /bulletins.xml + def create + @tags = get_tags + @bulletin = Bulletin.new(params[:bulletin]) + @bulletin.deadline = nil if (@bulletin.deadline < @bulletin.postdate rescue nil) + + @bulletin.create_user_id = current_user.id + @bulletin.update_user_id = current_user.id + # if(is_manager? || is_admin?) + # @bulletin.is_checked = true + # @bulletin.is_rejected = false + # @bulletin.de_pending + # end + + respond_to do |format| + if @bulletin.save + + format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('announcement.create_bulletin_success')) } + format.xml { render :xml => @bulletin, :status => :created, :location => @bulletin } + # format.js + format.js { + @info = {"success"=>"true","redirect_url"=>panel_announcement_back_end_bulletins_url} + flash[:notice] = t('bulletin.create_bulletin_success') + render "/shared/preview/after_create.js.erb" + } + else + format.html { render :action => "new" } + format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity } + format.js { + @info = {"success"=>"false","redirect_url"=>new_panel_announcement_back_end_bulletin_url(:bulletin => @bulletin)} + session[:in_validate_object] = @bulletin + render "/shared/preview/after_create.js.erb" + } + end + end + end + + # PUT /bulletins/1 + # PUT /bulletins/1.xml + + def update + @bulletin = Bulletin.find(params[:id]) + + delete_out_invalid_date_from_params + respond_to do |format| + if @bulletin.update_attributes(params[:bulletin]) + + format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.update_bulletin_success')) } + format.js { render 'toggle_enable' } + format.xml { head :ok } + else + @tags = get_tags + format.html { render :action => "edit" } + format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity } + end + end + + end + + # DELETE /bulletins/1 + # DELETE /bulletins/1.xml + def destroy + @bulletin = Bulletin.find(params[:id]) + # @bulletin.bulletin_files.destroy + @bulletin.destroy + + respond_to do |format| + + format.html { redirect_to(panel_announcement_back_end_bulletins_url) } + # format.xml { head :ok } + format.js + end + end + + def delete + if params[:ids] + bulletins = Bulletin.any_in(:_id => params[:ids]).destroy_all + end + redirect_to panel_announcement_back_end_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[:bulletin]["deadline(1i)"] && params[:bulletin]["deadline(1i)"].blank?) or (params[:bulletin]["deadline(2i)"] && params[:bulletin]["deadline(2i)"].blank?) or (params[:bulletin]["deadline(3i)"] && params[:bulletin]["deadline(3i)"].blank?)) + params[:bulletin].delete("deadline(1i)") + params[:bulletin].delete("deadline(2i)") + params[:bulletin].delete("deadline(3i)") + params[:bulletin].delete("deadline(4i)") + params[:bulletin].delete("deadline(5i)") + @bulletin.deadline = nil + end rescue nil + end + + def clean_values + if params[:bulletin] + params[:bulletin][:bulletin_links_attributes].each_with_index do |link, index| + params[:bulletin][:bulletin_links_attributes].delete(index.to_s) if link[1]['url'].blank? and link[1]['title_translations'].blank? + end rescue nil + params[:bulletin][:bulletin_files_attributes].each_with_index do |link, index| + params[:bulletin][:bulletin_files_attributes].delete(index.to_s) if link[1]['file'].blank? and link[1]['title_translations'].blank? + end rescue nil + end + end +end diff --git a/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/app/controllers/panel/announcement/front_end/bulletins_controller.rb new file mode 100644 index 0000000..d2fee70 --- /dev/null +++ b/app/controllers/panel/announcement/front_end/bulletins_controller.rb @@ -0,0 +1,81 @@ +class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController + + # GET /bulletins + # GET /bulletins.xml + def index_bulletins_by_unit + @item = Page.find(params[:page_id]) rescue nil + @bulletins=Bulletin.all.available_for_lang(I18n.locale).can_display.where("cache_dept.#{I18n.locale.to_s.downcase}"=>params[:name]).page( params[:page_main]).per(15) + render :index + end + + def search_result + if params[:search_query] == "" + @bulletins = get_bulletins_for_index + else + @search = Bulletin.tire.search "#{params[:search_query]}" + search_result = @search.collect{|result| result.id} + + @bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num) + end + end + + def index + @bulletins = get_bulletins_for_index + end + + def get_bulletins_for_index + + @item = Page.find(params[:page_id]) rescue nil + + if @item + if @item.frontend_data_count + @page_num = @item.frontend_data_count + else + @page_num = 15 + end + @frontend_style = @item.frontend_style + end + + date_now = Time.now + if !params[:category_id].blank? && !params[:tag_id].blank? + @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in=>params[:category_id],:tagged_ids.in=>params[:tag_id]) + @current_category = BulletinCategory.from_id(params[:category_id]) rescue nil + elsif !params[:category_id].blank? + @bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + @current_category = BulletinCategory.from_id(params[:category_id]) rescue nil + elsif !params[:tag_id].blank? + @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + else + @bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + end + # delayed_impressionist(@tag) if @tag + @bulletins + end + + def show + @item = Page.find(params[:page_id]) rescue nil + if params[:preview] == "true" + preview_content + else + @bulletin = Bulletin.all.can_display.where(_id: params[:id]).first + if @bulletin and !@bulletin.disable? + if @bulletin.enabled_for_lang(I18n.locale.to_s) + # delayed_impressionist(@bulletin) + impressionist(@bulletin) + 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 + @bulletin = Bulletin.find params[:id] rescue nil + @bulletin = Preview.find(params[:id]).get_virtual_object if @bulletin.nil? + end + +end diff --git a/app/controllers/panel/announcement/widget/bulletins_controller.rb b/app/controllers/panel/announcement/widget/bulletins_controller.rb new file mode 100644 index 0000000..2bebdd0 --- /dev/null +++ b/app/controllers/panel/announcement/widget/bulletins_controller.rb @@ -0,0 +1,162 @@ +class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController + def initialize + super + @app_title = 'announcement' + end + + # GET /bulletins + # GET /bulletins.xml + + # def index + + # @part = PagePart.find(params[:part_id]) + + # if @part.widget_data_count + # @page_num = @part.widget_data_count + # else + # @page_num = 4 + # end + + # num_of_fields = @part.widget_field_name.reject(&:empty?).length + # widget_field_names = @part.widget_field_name.reject(&:empty?) + # widget_classes = @part.widget_class.reject(&:empty?) + # @widget_fields = [] + + # if @part.widget_field_name + # num_of_fields.times do |index| + # @widget_fields << [widget_field_names[index], widget_classes[index]] + # end + # end + + # @title = @part.title_translations[I18n.locale.to_s] + # @widget_style = @part.widget_style + # @category_id = @part.category + + # date_now = Time.now + + # if !params[:category_id].blank? && !params[:tag_id].blank? + # @posts = Bulletin.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # elsif !params[:category_id].blank? + # @posts = Bulletin.all.available_for_lang(I18n.locale).can_display.where(:category_id.in => params[:category_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # elsif !params[:tag_id].blank? + # @posts = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids.in => params[:tag_id]).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # else + # @posts = Bulletin.all.available_for_lang(I18n.locale).can_display.desc( :is_top, :postdate).page( params[:page_main]).per(@page_num) + # end + + # @categories = @module_app.categories.enabled + + # end + + def bulletins_list_and_pic + + if params[:widget_data_count] + @page_num = params[:widget_data_count]; + else + @page_num = 4; + end + + @title = params[:part_title] + date_now = Time.now + if !params[:category_id].blank? + @bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.where(: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(@page_num ) + @current_category = BulletinCategory.from_id(params[:category_id]) rescue nil + elsif !params[:tag_id].blank? + @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => params[:tag_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(@page_num) + else + @bulletins = Bulletin.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(@page_num ) + end + + @categories = @module_app.categories.enabled + + end + + def bulletins_and_web_links + + @part = PagePart.find(params[:part_id]) if !params[:part_id].blank? + + @title = @part.title_translations[I18n.locale.to_s] + + if !@part.blank? and @part.widget_data_count + @page_num = @part.widget_data_count + else + @page_num = 5 + end + + date_now = Time.now + + if !params[:tag_id].blank? + @tags = Tag.any_in(:_id => params[:tag_id]).asc(:created_at) + elsif params[:tag_id].blank? and !@part.tag.blank? + @tags = Tag.any_in(:_id => @part.tag).asc(:created_at) + else + @ModuleApp_b = ModuleApp.first(:conditions => {:key=>'announcement'}) + @tags = Tag.where(:module_tag_id => @ModuleApp_b.id).asc(:created_at) + end + + @selected_tag = Tag.find(params[:id]).first rescue @tags[0] + + @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => @selected_tag.id.to_s, :is_hidden => false).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, :postdate).page(params[:page]).per(@page_num) rescue nil + + if @part.widget_style == 'bulletins_and_links' + @ModuleApp_w = ModuleApp.first(:conditions => {:key=>'web_resource'}) + + @link_module_tag = ModuleTag.first(:conditions => {:name => @selected_tag.name, :module_app_id => @ModuleApp_w.id}) + + if !@link_module_tag.blank? + @link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :tag_lease_id => @link_module_tag.id}) + else + @link_selected_tag = @link_module_tag + end + + @web_links = WebLink.where(:tagged_ids => @link_selected_tag.id.to_s, :is_hidden => false).desc(:is_top,:created_at).available_for_lang(I18n.locale).page(params[:page]).per(@page_num) rescue nil + end + + end + + def reload_bulletins + + @part = PagePart.find(params[:part_id]) if !params[:part_id].blank? + + @title = @part.title_translations[I18n.locale.to_s] + + if !@part.blank? and @part.widget_data_count + @page_num = @part.widget_data_count + else + @page_num = 5 + end + + date_now = Time.now + + @selected_tag = Tag.find(params[:tag_id]).first + @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => @selected_tag.id.to_s, :is_hidden => false).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, :postdate).page(params[:page]).per(@page_num) rescue nil + end + + def reload_web_links + + @part = PagePart.find(params[:part_id]) if !params[:part_id].blank? + + if !@part.blank? and @part.widget_data_count + @page_num = @part.widget_data_count + else + @page_num = 5 + end + + date_now = Time.now + + @selected_tag = Tag.find(params[:tag_id]).first + @ModuleApp = ModuleApp.first(:conditions => {:key=>'web_resource'}) + @link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :module_tag_id => @ModuleApp.id}) + @web_links = WebLink.where(:tagged_ids => @link_selected_tag.id.to_s, :is_hidden => false).desc(:is_top,:created_at).available_for_lang(I18n.locale).page(params[:page]).per(@page_num) rescue nil + end + + def bulletins_side_bar + @tags_and_class = @module_app.sorted_tags_for_cloud + @categories = @module_app.categories.enabled + end + + def bulletins_search_block + @part = PagePart.find params[:part_id] + end + +end diff --git a/app/helpers/.gitkeep b/app/helpers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/mailers/.gitkeep b/app/mailers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb new file mode 100644 index 0000000..77fa12b --- /dev/null +++ b/app/models/bulletin.rb @@ -0,0 +1,163 @@ +# encoding: utf-8 +class Bulletin + include Mongoid::Document + include Mongoid::Timestamps + include Mongoid::MultiParameterAttributes + include Impressionist::Impressionable + + include OrbitCategory::Categorizable + include OrbitCoreLib::Preview + # include OrbitModel::Approval + include OrbitModel::LanguageRestrict + include OrbitModel::Status + include OrbitModel::TimeFrame + include OrbitTag::Taggable + + include Tire::Model::Search + include Tire::Model::Callbacks + + is_impressionable :counter_cache => { :column_name => :view_count } + + field :title, localize: true + field :subtitle, localize: true + field :text, localize: true + + field :create_user_id + field :update_user_id, :class_name => "User" + + field :view_count, :type => Integer, :default => 0 + + field :public, :type => Boolean, :default => true + + mount_uploader :image, ImageUploader + + has_many :bulletin_links, :autosave => true, :dependent => :destroy + has_many :bulletin_files, :autosave => true, :dependent => :destroy + + accepts_nested_attributes_for :bulletin_files, :allow_destroy => true + accepts_nested_attributes_for :bulletin_links, :allow_destroy => true + + validates :title, :at_least_one => true + + def to_indexed_json + self.to_json + end + + # search_in :title, :subtitle, :text + + #before_save :clean_values, :save_bulletin_links, :save_bulletin_files + + # def self.search(str, options={}) + # options[:limit] = options[:limit] || 50 + # # default limit: 50 (mongoDB default: 100) + + # res = self.mongo_session.command({ text: self.collection.name, + # search: str}.merge(options)) + + # # We shall now return a criteria of resulting objects!! + # self.where(:id.in => res['results'].collect {|o| o['obj']['_id']}) + # end + + def bulletin_category_with_title + self.category.title + end + + def get_bulletin_category + self.category + end + + def share_item + Item.first(conditions:{name: 'announcement'}) + end + + def enabled_for_lang(lang) + eval("self.available_for_#{lang}") rescue false + end + + def publish_month + published_at.strftime("%B %Y") + end + + # def self.search( search = nil, category_id = nil ) + # if category_id.to_s.size > 0 and search.to_s.size > 0 + # key = /#{search}/ + # find(:all, :conditions => {title: key, category_id: category_id}).desc( :is_top, :postdate ) + # elsif category_id.to_s.size > 0 and search.to_s.size < 1 + # find(:all, :conditions => {category_id: category_id}).desc( :is_top, :postdate ) + # elsif search.to_s.size > 0 and category_id.to_s.size < 1 + # key = /#{search}/ + # find(:all, :conditions => {title: key}).desc( :is_top, :postdate ) + # else + # find(:all).desc( :is_top, :postdate) + # end + # 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 => {category_id: category_id}).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate) + else + any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate) + end + + end + + + def save_bulletin_links + self.bulletin_links.each do |t| + if t.should_destroy + t.destroy + end + end + end + + def save_bulletin_files + self.bulletin_files.each do |t| + if t.should_destroy + t.destroy + end + end + end + + def self.filter(bulletins) + bulletins.each do |bulletin| + p "#{bulletin.id}/#{bulletin.is_top}/#{bulletin.is_hot}/#{bulletin.is_hidden}" + end + return nil + end + + def to_preview + preview_object = Preview.new(:expired_at=>DateTime.now+30.minutes,:preview_at_link=>"panel_announcement_front_end_bulletin_path",:object_class_type=>"Bulletin") + + self.bulletin["bulletin_files_attributes"].each_with_index do |atr,idx| + preview_object.preview_files.build(:file=>self.bulletin["bulletin_files_attributes"][idx.to_s],:field_name_for_rebuild=>'bulletin_files',:file_in_array=>true) + end unless self.bulletin["bulletin_files_attributes"].nil? + + self.bulletin["bulletin_links_attributes"].each_with_index do |atr,idx| + preview_object.preview_associations.build(:object=>self.bulletin["bulletin_links_attributes"][idx.to_s],:field_name_for_rebuild=>'bulletin_links',:object_in_array=>true) + end unless self.bulletin["bulletin_links_attributes"].nil? + + + preview_object.object = self.bulletin.except("bulletin_files_attributes","bulletin_links_attributes") + preview_object + end + + + protected + + # def clean_values + # self.bulletin_links.each do |link| + # link.delete if link.url.blank? && link.title.blank? + # end + # self.tag_ids.delete('') + # end + + +end diff --git a/app/models/bulletin_category.rb b/app/models/bulletin_category.rb new file mode 100644 index 0000000..56c335e --- /dev/null +++ b/app/models/bulletin_category.rb @@ -0,0 +1,33 @@ +# encoding: utf-8 + +class BulletinCategory + include Mongoid::Document + include Mongoid::Timestamps + include OrbitCoreLib::ObjectAuthable + include OrbitCoreLib::ObjectDisable + + ObjectAuthTitlesOptions = %W{submit_new fact_check} + AfterObjectAuthUrl = '/panel/announcement/back_end/bulletin_categorys' + # include Mongoid::MultiParameterAttributes + + PAYMENT_TYPES = [ "List", "Picture" ] + APP_NAME = 'Announcement' + + field :disable, type: Boolean, :default => false + field :display + field :key + field :title, localize: true + + has_many :bulletins + + validates :title, :at_least_one => true + + def pp_object + title + end + + def self.from_id(id) + BulletinCategory.find(id) rescue nil + end + +end diff --git a/app/models/bulletin_file.rb b/app/models/bulletin_file.rb new file mode 100644 index 0000000..2912fc9 --- /dev/null +++ b/app/models/bulletin_file.rb @@ -0,0 +1,14 @@ +class BulletinFile + + include Mongoid::Document + include Mongoid::Timestamps + + mount_uploader :file, AssetUploader + + field :description, localize: true + field :should_destroy, :type => Boolean + field :title, localize: true + + belongs_to :bulletin + +end diff --git a/app/models/bulletin_link.rb b/app/models/bulletin_link.rb new file mode 100644 index 0000000..4763513 --- /dev/null +++ b/app/models/bulletin_link.rb @@ -0,0 +1,25 @@ +class BulletinLink + + include Mongoid::Document + include Mongoid::Timestamps + + field :url + field :title, localize: true + + field :should_destroy, :type => Boolean + + # embedded_in :bulletin + belongs_to :bulletin + + before_validation :add_http + validates :url, :presence => true, :format => /^(http|https):\/\/(([a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5})|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(:[0-9]{1,5})?(\/.*)?/i + + protected + + def add_http + unless self.url[/^http:\/\//] || self.url[/^https:\/\//] + self.url = 'http://' + self.url + end + end + +end diff --git a/app/models/unit_list_for_anc.rb b/app/models/unit_list_for_anc.rb new file mode 100644 index 0000000..179e958 --- /dev/null +++ b/app/models/unit_list_for_anc.rb @@ -0,0 +1,11 @@ +class UnitListForAnc + include Mongoid::Document + include Mongoid::Timestamps + + field :order + field :ut_code + field :up_ut_code + field :title, localize: true + + +end \ No newline at end of file diff --git a/app/views/.gitkeep b/app/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/panel/announcement/back_end/approvals/_modal_approve.html.erb b/app/views/panel/announcement/back_end/approvals/_modal_approve.html.erb new file mode 100644 index 0000000..802156b --- /dev/null +++ b/app/views/panel/announcement/back_end/approvals/_modal_approve.html.erb @@ -0,0 +1,83 @@ + <% if bulletin -%> + + + +<% end -%> diff --git a/app/views/panel/announcement/back_end/approvals/_modal_list.html.erb b/app/views/panel/announcement/back_end/approvals/_modal_list.html.erb new file mode 100644 index 0000000..9daa228 --- /dev/null +++ b/app/views/panel/announcement/back_end/approvals/_modal_list.html.erb @@ -0,0 +1,44 @@ +<% if category -%> + +