\ No newline at end of file
diff --git a/custom_announcement/app/views/admin/custom_announcements/_form_image.html.erb b/custom_announcement/app/views/admin/custom_announcements/_form_image.html.erb
new file mode 100644
index 0000000..4087ea1
--- /dev/null
+++ b/custom_announcement/app/views/admin/custom_announcements/_form_image.html.erb
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+ <% if form_image.file.file %>
+ <%= image_tag form_image.file %>
+ <% else %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/custom_announcement/app/views/admin/custom_announcements/_form_link.html.erb b/custom_announcement/app/views/admin/custom_announcements/_form_link.html.erb
new file mode 100644
index 0000000..461a3fc
--- /dev/null
+++ b/custom_announcement/app/views/admin/custom_announcements/_form_link.html.erb
@@ -0,0 +1,26 @@
+
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/_annc_widget13.html.erb b/custom_announcement/modules/custom_announcement/_annc_widget13.html.erb
new file mode 100644
index 0000000..8c84f35
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/_annc_widget13.html.erb
@@ -0,0 +1,27 @@
+
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/_annc_widget14.html.erb b/custom_announcement/modules/custom_announcement/_annc_widget14.html.erb
new file mode 100644
index 0000000..e80bd4e
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/_annc_widget14.html.erb
@@ -0,0 +1,29 @@
+
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/_annc_widget18.html.erb b/custom_announcement/modules/custom_announcement/_annc_widget18.html.erb
new file mode 100644
index 0000000..059e48d
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/_annc_widget18.html.erb
@@ -0,0 +1,86 @@
+
+
+
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/_annc_widget2.html.erb b/custom_announcement/modules/custom_announcement/_annc_widget2.html.erb
new file mode 100644
index 0000000..ac0e8b9
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/_annc_widget2.html.erb
@@ -0,0 +1,34 @@
+
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/_annc_widget9.html.erb b/custom_announcement/modules/custom_announcement/_annc_widget9.html.erb
new file mode 100644
index 0000000..008b072
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/_annc_widget9.html.erb
@@ -0,0 +1,29 @@
+
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index1.html.erb b/custom_announcement/modules/custom_announcement/annc_index1.html.erb
new file mode 100644
index 0000000..9623c45
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index1.html.erb
@@ -0,0 +1,25 @@
+
+{{pagination_goes_here}}
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index11.html.erb b/custom_announcement/modules/custom_announcement/annc_index11.html.erb
new file mode 100644
index 0000000..7365c75
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index11.html.erb
@@ -0,0 +1,18 @@
+
+{{pagination_goes_here}}
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index12.html.erb b/custom_announcement/modules/custom_announcement/annc_index12.html.erb
new file mode 100644
index 0000000..bed0aff
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index12.html.erb
@@ -0,0 +1,18 @@
+
+{{pagination_goes_here}}
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index13.html.erb b/custom_announcement/modules/custom_announcement/annc_index13.html.erb
new file mode 100644
index 0000000..bee85e5
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index13.html.erb
@@ -0,0 +1,23 @@
+
+{{pagination_goes_here}}
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index3.html.erb b/custom_announcement/modules/custom_announcement/annc_index3.html.erb
new file mode 100644
index 0000000..b69e56f
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index3.html.erb
@@ -0,0 +1,25 @@
+
+{{pagination_goes_here}}
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index4.html.erb b/custom_announcement/modules/custom_announcement/annc_index4.html.erb
new file mode 100644
index 0000000..e95aa94
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index4.html.erb
@@ -0,0 +1,27 @@
+
+{{pagination_goes_here}}
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index5.html.erb b/custom_announcement/modules/custom_announcement/annc_index5.html.erb
new file mode 100644
index 0000000..d0614d0
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index5.html.erb
@@ -0,0 +1,30 @@
+
+{{pagination_goes_here}}
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index7.html.erb b/custom_announcement/modules/custom_announcement/annc_index7.html.erb
new file mode 100644
index 0000000..b731bc9
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index7.html.erb
@@ -0,0 +1,83 @@
+
+{{pagination_goes_here}}
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/annc_index9.html.erb b/custom_announcement/modules/custom_announcement/annc_index9.html.erb
new file mode 100644
index 0000000..dd09135
--- /dev/null
+++ b/custom_announcement/modules/custom_announcement/annc_index9.html.erb
@@ -0,0 +1,22 @@
+
+
+{{link_to_edit}}
+
+
\ No newline at end of file
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index10_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index10_thumbs.png
new file mode 100644
index 0000000..0745dc6
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index10_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index11_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index11_thumbs.png
new file mode 100644
index 0000000..8dc2261
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index11_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index12_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index12_thumbs.png
new file mode 100644
index 0000000..2e00654
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index12_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index13_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index13_thumbs.png
new file mode 100644
index 0000000..82eee2c
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index13_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index14_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index14_thumbs.png
new file mode 100644
index 0000000..0a58044
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index14_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index15_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index15_thumbs.png
new file mode 100644
index 0000000..cb9ed5e
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index15_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index16_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index16_thumbs.png
new file mode 100644
index 0000000..6ecaa4e
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index16_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index1_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index1_thumbs.png
new file mode 100644
index 0000000..0ad29c4
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index1_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index2_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index2_thumbs.png
new file mode 100644
index 0000000..d7baca7
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index2_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index3_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index3_thumbs.png
new file mode 100644
index 0000000..0193f81
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index3_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index4_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index4_thumbs.png
new file mode 100644
index 0000000..7c0a551
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index4_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index5_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index5_thumbs.png
new file mode 100644
index 0000000..832fe35
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index5_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index6_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index6_thumbs.png
new file mode 100644
index 0000000..eac8619
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index6_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index7_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index7_thumbs.png
new file mode 100644
index 0000000..b69abd9
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index7_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index8_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index8_thumbs.png
new file mode 100644
index 0000000..cf6eb30
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index8_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_index9_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_index9_thumbs.png
new file mode 100644
index 0000000..9fc7c23
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_index9_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget10_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget10_thumbs.png
new file mode 100644
index 0000000..8dc2261
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget10_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget11_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget11_thumbs.png
new file mode 100644
index 0000000..2e00654
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget11_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget12_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget12_thumbs.png
new file mode 100644
index 0000000..82eee2c
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget12_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget13_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget13_thumbs.png
new file mode 100644
index 0000000..0a58044
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget13_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget14_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget14_thumbs.png
new file mode 100644
index 0000000..d1cab18
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget14_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget1_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget1_thumbs.png
new file mode 100644
index 0000000..77ba0a8
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget1_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget2_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget2_thumbs.png
new file mode 100644
index 0000000..832fe35
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget2_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget3_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget3_thumbs.png
new file mode 100644
index 0000000..eac8619
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget3_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget4_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget4_thumbs.png
new file mode 100644
index 0000000..b69abd9
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget4_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget5_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget5_thumbs.png
new file mode 100644
index 0000000..cf6eb30
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget5_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget6_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget6_thumbs.png
new file mode 100644
index 0000000..9fc7c23
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget6_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget7_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget7_thumbs.png
new file mode 100644
index 0000000..0745dc6
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget7_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget8_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget8_thumbs.png
new file mode 100644
index 0000000..7cfddf7
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget8_thumbs.png differ
diff --git a/custom_announcement/modules/custom_announcement/thumbs/annc_widget9_thumbs.png b/custom_announcement/modules/custom_announcement/thumbs/annc_widget9_thumbs.png
new file mode 100644
index 0000000..b0a2bb4
Binary files /dev/null and b/custom_announcement/modules/custom_announcement/thumbs/annc_widget9_thumbs.png differ
diff --git a/custom_announcement/source.txt b/custom_announcement/source.txt
new file mode 100644
index 0000000..2ea6f7f
--- /dev/null
+++ b/custom_announcement/source.txt
@@ -0,0 +1 @@
+http://gitlab.tp.rulingcom.com/chiu/custom_announcement.git
\ No newline at end of file
diff --git a/custom_announcement/test/controllers/admin/custom_announcements_controller_test.rb b/custom_announcement/test/controllers/admin/custom_announcements_controller_test.rb
new file mode 100644
index 0000000..3e91633
--- /dev/null
+++ b/custom_announcement/test/controllers/admin/custom_announcements_controller_test.rb
@@ -0,0 +1,14 @@
+require 'test_helper'
+
+class Admin::CustomAnnouncementsControllerTest < ActionController::TestCase
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should get create" do
+ get :create
+ assert_response :success
+ end
+
+end
diff --git a/custom_announcement/test/custom_bulletin_test.rb b/custom_announcement/test/custom_bulletin_test.rb
new file mode 100644
index 0000000..118825e
--- /dev/null
+++ b/custom_announcement/test/custom_bulletin_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class CustomBulletinTest < ActiveSupport::TestCase
+ test "truth" do
+ assert_kind_of Module, CustomBulletin
+ end
+end
diff --git a/custom_announcement/test/dummy/README.rdoc b/custom_announcement/test/dummy/README.rdoc
new file mode 100644
index 0000000..dd4e97e
--- /dev/null
+++ b/custom_announcement/test/dummy/README.rdoc
@@ -0,0 +1,28 @@
+== README
+
+This README would normally document whatever steps are necessary to get the
+application up and running.
+
+Things you may want to cover:
+
+* Ruby version
+
+* System dependencies
+
+* Configuration
+
+* Database creation
+
+* Database initialization
+
+* How to run the test suite
+
+* Services (job queues, cache servers, search engines, etc.)
+
+* Deployment instructions
+
+* ...
+
+
+Please feel free to use a different markup language if you do not plan to run
+rake doc:app.
diff --git a/custom_announcement/test/dummy/Rakefile b/custom_announcement/test/dummy/Rakefile
new file mode 100644
index 0000000..ba6b733
--- /dev/null
+++ b/custom_announcement/test/dummy/Rakefile
@@ -0,0 +1,6 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Rails.application.load_tasks
diff --git a/custom_announcement/test/dummy/app/assets/images/.keep b/custom_announcement/test/dummy/app/assets/images/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_announcement/test/dummy/app/assets/javascripts/application.js b/custom_announcement/test/dummy/app/assets/javascripts/application.js
new file mode 100644
index 0000000..5bc2e1c
--- /dev/null
+++ b/custom_announcement/test/dummy/app/assets/javascripts/application.js
@@ -0,0 +1,13 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// compiled file.
+//
+// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
+// about supported directives.
+//
+//= require_tree .
diff --git a/custom_announcement/test/dummy/app/assets/stylesheets/application.css b/custom_announcement/test/dummy/app/assets/stylesheets/application.css
new file mode 100644
index 0000000..a443db3
--- /dev/null
+++ b/custom_announcement/test/dummy/app/assets/stylesheets/application.css
@@ -0,0 +1,15 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
+ * compiled file so the styles you add here take precedence over styles defined in any styles
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
+ * file per style scope.
+ *
+ *= require_tree .
+ *= require_self
+ */
diff --git a/custom_announcement/test/dummy/app/controllers/application_controller.rb b/custom_announcement/test/dummy/app/controllers/application_controller.rb
new file mode 100644
index 0000000..d83690e
--- /dev/null
+++ b/custom_announcement/test/dummy/app/controllers/application_controller.rb
@@ -0,0 +1,5 @@
+class ApplicationController < ActionController::Base
+ # Prevent CSRF attacks by raising an exception.
+ # For APIs, you may want to use :null_session instead.
+ protect_from_forgery with: :exception
+end
diff --git a/custom_announcement/test/dummy/app/controllers/concerns/.keep b/custom_announcement/test/dummy/app/controllers/concerns/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_announcement/test/dummy/app/helpers/application_helper.rb b/custom_announcement/test/dummy/app/helpers/application_helper.rb
new file mode 100644
index 0000000..de6be79
--- /dev/null
+++ b/custom_announcement/test/dummy/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
diff --git a/custom_announcement/test/dummy/app/mailers/.keep b/custom_announcement/test/dummy/app/mailers/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_announcement/test/dummy/app/models/.keep b/custom_announcement/test/dummy/app/models/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_announcement/test/dummy/app/models/concerns/.keep b/custom_announcement/test/dummy/app/models/concerns/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_announcement/test/dummy/app/views/layouts/application.html.erb b/custom_announcement/test/dummy/app/views/layouts/application.html.erb
new file mode 100644
index 0000000..593a778
--- /dev/null
+++ b/custom_announcement/test/dummy/app/views/layouts/application.html.erb
@@ -0,0 +1,14 @@
+
+
+
+ Dummy
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
+ <%= csrf_meta_tags %>
+
+
+
+<%= yield %>
+
+
+
diff --git a/custom_announcement/test/dummy/bin/bundle b/custom_announcement/test/dummy/bin/bundle
new file mode 100644
index 0000000..66e9889
--- /dev/null
+++ b/custom_announcement/test/dummy/bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
diff --git a/custom_announcement/test/dummy/bin/rails b/custom_announcement/test/dummy/bin/rails
new file mode 100644
index 0000000..728cd85
--- /dev/null
+++ b/custom_announcement/test/dummy/bin/rails
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require_relative '../config/boot'
+require 'rails/commands'
diff --git a/custom_announcement/test/dummy/bin/rake b/custom_announcement/test/dummy/bin/rake
new file mode 100644
index 0000000..1724048
--- /dev/null
+++ b/custom_announcement/test/dummy/bin/rake
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
diff --git a/custom_announcement/test/dummy/config.ru b/custom_announcement/test/dummy/config.ru
new file mode 100644
index 0000000..5bc2a61
--- /dev/null
+++ b/custom_announcement/test/dummy/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Rails.application
diff --git a/custom_announcement/test/dummy/config/application.rb b/custom_announcement/test/dummy/config/application.rb
new file mode 100644
index 0000000..e4c8d3a
--- /dev/null
+++ b/custom_announcement/test/dummy/config/application.rb
@@ -0,0 +1,29 @@
+require File.expand_path('../boot', __FILE__)
+
+# Pick the frameworks you want:
+# require "active_record/railtie"
+require "action_controller/railtie"
+require "action_mailer/railtie"
+require "action_view/railtie"
+require "sprockets/railtie"
+require "rails/test_unit/railtie"
+
+Bundler.require(*Rails.groups)
+require "custom_bulletin"
+
+module Dummy
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+ end
+end
+
diff --git a/custom_announcement/test/dummy/config/boot.rb b/custom_announcement/test/dummy/config/boot.rb
new file mode 100644
index 0000000..6266cfc
--- /dev/null
+++ b/custom_announcement/test/dummy/config/boot.rb
@@ -0,0 +1,5 @@
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
+$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
diff --git a/custom_announcement/test/dummy/config/environment.rb b/custom_announcement/test/dummy/config/environment.rb
new file mode 100644
index 0000000..ee8d90d
--- /dev/null
+++ b/custom_announcement/test/dummy/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the Rails application.
+require File.expand_path('../application', __FILE__)
+
+# Initialize the Rails application.
+Rails.application.initialize!
diff --git a/custom_announcement/test/dummy/config/environments/development.rb b/custom_announcement/test/dummy/config/environments/development.rb
new file mode 100644
index 0000000..a384d95
--- /dev/null
+++ b/custom_announcement/test/dummy/config/environments/development.rb
@@ -0,0 +1,34 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.cache_classes = false
+
+ # Do not eager load code on boot.
+ config.eager_load = false
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send.
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger.
+ config.active_support.deprecation = :log
+
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
+ config.assets.debug = true
+
+ # Adds additional error checking when serving assets at runtime.
+ # Checks for improperly declared sprockets dependencies.
+ # Raises helpful error messages.
+ config.assets.raise_runtime_errors = true
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
+end
diff --git a/custom_announcement/test/dummy/config/environments/production.rb b/custom_announcement/test/dummy/config/environments/production.rb
new file mode 100644
index 0000000..4f67ce3
--- /dev/null
+++ b/custom_announcement/test/dummy/config/environments/production.rb
@@ -0,0 +1,80 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # Code is not reloaded between requests.
+ config.cache_classes = true
+
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both threaded web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
+ # Add `rack-cache` to your Gemfile before enabling this.
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
+ # config.action_dispatch.rack_cache = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this).
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :sass
+
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
+
+ # Generate digests for assets URLs.
+ config.assets.digest = true
+
+ # Version of your assets, change this if you want to expire all your assets.
+ config.assets.version = '1.0'
+
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # Set to :debug to see everything in the log.
+ config.log_level = :info
+
+ # Prepend all log lines with the following tags.
+ # config.log_tags = [ :subdomain, :uuid ]
+
+ # Use a different logger for distributed setups.
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+ # Use a different cache store in production.
+ # config.cache_store = :mem_cache_store
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Precompile additional assets.
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+ # config.assets.precompile += %w( search.js )
+
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation cannot be found).
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners.
+ config.active_support.deprecation = :notify
+
+ # Disable automatic flushing of the log to improve performance.
+ # config.autoflush_log = false
+
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ config.log_formatter = ::Logger::Formatter.new
+end
diff --git a/custom_announcement/test/dummy/config/environments/test.rb b/custom_announcement/test/dummy/config/environments/test.rb
new file mode 100644
index 0000000..053f5b6
--- /dev/null
+++ b/custom_announcement/test/dummy/config/environments/test.rb
@@ -0,0 +1,39 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Do not eager load code on boot. This avoids loading your whole application
+ # just for the purpose of running a single test. If you are using a tool that
+ # preloads Rails for running tests, you may have to set it to true.
+ config.eager_load = false
+
+ # Configure static asset server for tests with Cache-Control for performance.
+ config.serve_static_assets = true
+ config.static_cache_control = 'public, max-age=3600'
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates.
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Print deprecation notices to the stderr.
+ config.active_support.deprecation = :stderr
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
+end
diff --git a/custom_announcement/test/dummy/config/initializers/backtrace_silencers.rb b/custom_announcement/test/dummy/config/initializers/backtrace_silencers.rb
new file mode 100644
index 0000000..59385cd
--- /dev/null
+++ b/custom_announcement/test/dummy/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
diff --git a/custom_announcement/test/dummy/config/initializers/cookies_serializer.rb b/custom_announcement/test/dummy/config/initializers/cookies_serializer.rb
new file mode 100644
index 0000000..7a06a89
--- /dev/null
+++ b/custom_announcement/test/dummy/config/initializers/cookies_serializer.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.action_dispatch.cookies_serializer = :json
\ No newline at end of file
diff --git a/custom_announcement/test/dummy/config/initializers/filter_parameter_logging.rb b/custom_announcement/test/dummy/config/initializers/filter_parameter_logging.rb
new file mode 100644
index 0000000..4a994e1
--- /dev/null
+++ b/custom_announcement/test/dummy/config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
diff --git a/custom_announcement/test/dummy/config/initializers/inflections.rb b/custom_announcement/test/dummy/config/initializers/inflections.rb
new file mode 100644
index 0000000..ac033bf
--- /dev/null
+++ b/custom_announcement/test/dummy/config/initializers/inflections.rb
@@ -0,0 +1,16 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.acronym 'RESTful'
+# end
diff --git a/custom_announcement/test/dummy/config/initializers/mime_types.rb b/custom_announcement/test/dummy/config/initializers/mime_types.rb
new file mode 100644
index 0000000..72aca7e
--- /dev/null
+++ b/custom_announcement/test/dummy/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register_alias "text/html", :iphone
diff --git a/custom_announcement/test/dummy/config/initializers/session_store.rb b/custom_announcement/test/dummy/config/initializers/session_store.rb
new file mode 100644
index 0000000..e766b67
--- /dev/null
+++ b/custom_announcement/test/dummy/config/initializers/session_store.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.session_store :cookie_store, key: '_dummy_session'
diff --git a/custom_announcement/test/dummy/config/initializers/wrap_parameters.rb b/custom_announcement/test/dummy/config/initializers/wrap_parameters.rb
new file mode 100644
index 0000000..b81ea74
--- /dev/null
+++ b/custom_announcement/test/dummy/config/initializers/wrap_parameters.rb
@@ -0,0 +1,9 @@
+# Be sure to restart your server when you modify this file.
+
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
+end
diff --git a/custom_announcement/test/dummy/config/locales/en.yml b/custom_announcement/test/dummy/config/locales/en.yml
new file mode 100644
index 0000000..0653957
--- /dev/null
+++ b/custom_announcement/test/dummy/config/locales/en.yml
@@ -0,0 +1,23 @@
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
+
+en:
+ hello: "Hello world"
diff --git a/custom_announcement/test/dummy/config/routes.rb b/custom_announcement/test/dummy/config/routes.rb
new file mode 100644
index 0000000..3f66539
--- /dev/null
+++ b/custom_announcement/test/dummy/config/routes.rb
@@ -0,0 +1,56 @@
+Rails.application.routes.draw do
+ # The priority is based upon order of creation: first created -> highest priority.
+ # See how all your routes lay out with "rake routes".
+
+ # You can have the root of your site routed with "root"
+ # root 'welcome#index'
+
+ # Example of regular route:
+ # get 'products/:id' => 'catalog#view'
+
+ # Example of named route that can be invoked with purchase_url(id: product.id)
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
+
+ # Example resource route (maps HTTP verbs to controller actions automatically):
+ # resources :products
+
+ # Example resource route with options:
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
+ #
+ # collection do
+ # get 'sold'
+ # end
+ # end
+
+ # Example resource route with sub-resources:
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
+
+ # Example resource route with more complex sub-resources:
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', on: :collection
+ # end
+ # end
+
+ # Example resource route with concerns:
+ # concern :toggleable do
+ # post 'toggle'
+ # end
+ # resources :posts, concerns: :toggleable
+ # resources :photos, concerns: :toggleable
+
+ # Example resource route within a namespace:
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
+ # end
+end
diff --git a/custom_announcement/test/dummy/config/secrets.yml b/custom_announcement/test/dummy/config/secrets.yml
new file mode 100644
index 0000000..e9213c0
--- /dev/null
+++ b/custom_announcement/test/dummy/config/secrets.yml
@@ -0,0 +1,22 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key is used for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure the secrets in this file are kept private
+# if you're sharing your code publicly.
+
+development:
+ secret_key_base: 51f457918fc204bef2280de08080b24d6289997cc1af905e47aead42b5e027b6bc27cd6cbd1cb11a34d8df4163d63db2a0ff973acfa11b239a5dd15d6bfb5bfd
+
+test:
+ secret_key_base: 1a2d31f4fb35a33e52a69eac67e125b9b1ba5b302e8d3468e60282061a8e74d1a8d977fb88f2eb001aecb99c9c3fbde29e0c7c5ac5d548e1458772ee50ed48e9
+
+# Do not keep production secrets in the repository,
+# instead read values from the environment.
+production:
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
diff --git a/custom_announcement/test/dummy/lib/assets/.keep b/custom_announcement/test/dummy/lib/assets/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_announcement/test/dummy/log/.keep b/custom_announcement/test/dummy/log/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_announcement/test/dummy/public/404.html b/custom_announcement/test/dummy/public/404.html
new file mode 100644
index 0000000..b612547
--- /dev/null
+++ b/custom_announcement/test/dummy/public/404.html
@@ -0,0 +1,67 @@
+
+
+
+ The page you were looking for doesn't exist (404)
+
+
+
+
+
+
+
+
+
The page you were looking for doesn't exist.
+
You may have mistyped the address or the page may have moved.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/custom_announcement/test/dummy/public/422.html b/custom_announcement/test/dummy/public/422.html
new file mode 100644
index 0000000..a21f82b
--- /dev/null
+++ b/custom_announcement/test/dummy/public/422.html
@@ -0,0 +1,67 @@
+
+
+
+ The change you wanted was rejected (422)
+
+
+
+
+
+
+
+
+
The change you wanted was rejected.
+
Maybe you tried to change something you didn't have access to.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/custom_announcement/test/dummy/public/500.html b/custom_announcement/test/dummy/public/500.html
new file mode 100644
index 0000000..061abc5
--- /dev/null
+++ b/custom_announcement/test/dummy/public/500.html
@@ -0,0 +1,66 @@
+
+
+
+ We're sorry, but something went wrong (500)
+
+
+
+
+
+
+
+
+
We're sorry, but something went wrong.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/custom_announcement/test/dummy/public/favicon.ico b/custom_announcement/test/dummy/public/favicon.ico
new file mode 100644
index 0000000..e69de29
diff --git a/custom_announcement/test/helpers/admin/custom_announcements_helper_test.rb b/custom_announcement/test/helpers/admin/custom_announcements_helper_test.rb
new file mode 100644
index 0000000..fc77f0d
--- /dev/null
+++ b/custom_announcement/test/helpers/admin/custom_announcements_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class Admin::CustomAnnouncementsHelperTest < ActionView::TestCase
+end
diff --git a/custom_announcement/test/integration/navigation_test.rb b/custom_announcement/test/integration/navigation_test.rb
new file mode 100644
index 0000000..eec8c0e
--- /dev/null
+++ b/custom_announcement/test/integration/navigation_test.rb
@@ -0,0 +1,9 @@
+require 'test_helper'
+
+class NavigationTest < ActionDispatch::IntegrationTest
+
+ # test "the truth" do
+ # assert true
+ # end
+end
+
diff --git a/custom_announcement/test/test_helper.rb b/custom_announcement/test/test_helper.rb
new file mode 100644
index 0000000..1e26a31
--- /dev/null
+++ b/custom_announcement/test/test_helper.rb
@@ -0,0 +1,15 @@
+# Configure Rails Environment
+ENV["RAILS_ENV"] = "test"
+
+require File.expand_path("../dummy/config/environment.rb", __FILE__)
+require "rails/test_help"
+
+Rails.backtrace_cleaner.remove_silencers!
+
+# Load support files
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+
+# Load fixtures from the engine
+if ActiveSupport::TestCase.method_defined?(:fixture_path=)
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
+end
diff --git a/custom_gallery/.gitignore b/custom_gallery/.gitignore
new file mode 100644
index 0000000..de5d954
--- /dev/null
+++ b/custom_gallery/.gitignore
@@ -0,0 +1,8 @@
+.bundle/
+log/*.log
+pkg/
+test/dummy/db/*.sqlite3
+test/dummy/db/*.sqlite3-journal
+test/dummy/log/*.log
+test/dummy/tmp/
+test/dummy/.sass-cache
diff --git a/custom_gallery/Gemfile b/custom_gallery/Gemfile
new file mode 100644
index 0000000..a5fcaa2
--- /dev/null
+++ b/custom_gallery/Gemfile
@@ -0,0 +1,14 @@
+source "https://rubygems.org"
+
+# Declare your gem's dependencies in custom_gallery.gemspec.
+# Bundler will treat runtime dependencies like base dependencies, and
+# development dependencies will be added by default to the :development group.
+gemspec
+
+# 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 'debugger'
diff --git a/custom_gallery/Gemfile.lock b/custom_gallery/Gemfile.lock
new file mode 100644
index 0000000..2e7e0cd
--- /dev/null
+++ b/custom_gallery/Gemfile.lock
@@ -0,0 +1,104 @@
+PATH
+ remote: .
+ specs:
+ custom_gallery (0.0.1)
+ mongoid (= 4.0.0.beta1)
+ rails (~> 4.1.0.rc2)
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (4.1.0)
+ actionpack (= 4.1.0)
+ actionview (= 4.1.0)
+ mail (~> 2.5.4)
+ actionpack (4.1.0)
+ actionview (= 4.1.0)
+ activesupport (= 4.1.0)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ actionview (4.1.0)
+ activesupport (= 4.1.0)
+ builder (~> 3.1)
+ erubis (~> 2.7.0)
+ activemodel (4.1.0)
+ activesupport (= 4.1.0)
+ builder (~> 3.1)
+ activerecord (4.1.0)
+ activemodel (= 4.1.0)
+ activesupport (= 4.1.0)
+ arel (~> 5.0.0)
+ activesupport (4.1.0)
+ i18n (~> 0.6, >= 0.6.9)
+ json (~> 1.7, >= 1.7.7)
+ minitest (~> 5.1)
+ thread_safe (~> 0.1)
+ tzinfo (~> 1.1)
+ arel (5.0.1.20140414130214)
+ bson (2.2.2)
+ builder (3.2.2)
+ connection_pool (2.0.0)
+ erubis (2.7.0)
+ hike (1.2.3)
+ i18n (0.6.9)
+ json (1.8.1)
+ mail (2.5.4)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.25.1)
+ minitest (5.3.3)
+ mongoid (4.0.0.beta1)
+ activemodel (>= 4.0.0)
+ moped (~> 2.0.beta6)
+ origin (~> 2.1)
+ tzinfo (>= 0.3.37)
+ moped (2.0.0.rc1)
+ bson (~> 2.2)
+ connection_pool (~> 2.0)
+ optionable (~> 0.2.0)
+ multi_json (1.9.3)
+ optionable (0.2.0)
+ origin (2.1.1)
+ polyglot (0.3.4)
+ rack (1.5.2)
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (4.1.0)
+ actionmailer (= 4.1.0)
+ actionpack (= 4.1.0)
+ actionview (= 4.1.0)
+ activemodel (= 4.1.0)
+ activerecord (= 4.1.0)
+ activesupport (= 4.1.0)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.1.0)
+ sprockets-rails (~> 2.0)
+ railties (4.1.0)
+ actionpack (= 4.1.0)
+ activesupport (= 4.1.0)
+ rake (>= 0.8.7)
+ thor (>= 0.18.1, < 2.0)
+ rake (10.3.1)
+ sprockets (2.12.1)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sprockets-rails (2.1.3)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
+ thor (0.19.1)
+ thread_safe (0.3.3)
+ tilt (1.4.1)
+ treetop (1.4.15)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (1.1.0)
+ thread_safe (~> 0.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ custom_gallery!
diff --git a/custom_gallery/MIT-LICENSE b/custom_gallery/MIT-LICENSE
new file mode 100644
index 0000000..ea966ec
--- /dev/null
+++ b/custom_gallery/MIT-LICENSE
@@ -0,0 +1,20 @@
+Copyright 2014 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/custom_gallery/README.rdoc b/custom_gallery/README.rdoc
new file mode 100644
index 0000000..c0009f6
--- /dev/null
+++ b/custom_gallery/README.rdoc
@@ -0,0 +1,6 @@
+= CustomGallery
+
+This project rocks and uses MIT-LICENSE.
+
+
+### 20190116 jason Join edit
\ No newline at end of file
diff --git a/custom_gallery/Rakefile b/custom_gallery/Rakefile
new file mode 100644
index 0000000..0ddcc68
--- /dev/null
+++ b/custom_gallery/Rakefile
@@ -0,0 +1,32 @@
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+
+require 'rdoc/task'
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'CustomGallery'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+
+
+
+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/custom_gallery/app/assets/images/custom_gallery/.gitkeep b/custom_gallery/app/assets/images/custom_gallery/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/assets/images/custom_gallery/.keep b/custom_gallery/app/assets/images/custom_gallery/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/assets/images/custom_gallery/default.jpg b/custom_gallery/app/assets/images/custom_gallery/default.jpg
new file mode 100644
index 0000000..1a90afb
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/default.jpg differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/nodata.jpg b/custom_gallery/app/assets/images/custom_gallery/nodata.jpg
new file mode 100644
index 0000000..d3c857b
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/nodata.jpg differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/pbar-ani.gif b/custom_gallery/app/assets/images/custom_gallery/pbar-ani.gif
new file mode 100644
index 0000000..6edd174
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/pbar-ani.gif differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/slidelistbg.png b/custom_gallery/app/assets/images/custom_gallery/slidelistbg.png
new file mode 100644
index 0000000..8d468d0
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/slidelistbg.png differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/slidenav.png b/custom_gallery/app/assets/images/custom_gallery/slidenav.png
new file mode 100644
index 0000000..79fd32e
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/slidenav.png differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/slidetitlebg.png b/custom_gallery/app/assets/images/custom_gallery/slidetitlebg.png
new file mode 100644
index 0000000..f6de34e
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/slidetitlebg.png differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/slideui.gif b/custom_gallery/app/assets/images/custom_gallery/slideui.gif
new file mode 100644
index 0000000..8d16d90
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/slideui.gif differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/upicon.png b/custom_gallery/app/assets/images/custom_gallery/upicon.png
new file mode 100644
index 0000000..0a16ebe
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/upicon.png differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/uploadbg.gif b/custom_gallery/app/assets/images/custom_gallery/uploadbg.gif
new file mode 100644
index 0000000..e5fac42
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/uploadbg.gif differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/uppt.png b/custom_gallery/app/assets/images/custom_gallery/uppt.png
new file mode 100644
index 0000000..b1c0db0
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/uppt.png differ
diff --git a/custom_gallery/app/assets/images/custom_gallery/upsep.png b/custom_gallery/app/assets/images/custom_gallery/upsep.png
new file mode 100644
index 0000000..314f8ac
Binary files /dev/null and b/custom_gallery/app/assets/images/custom_gallery/upsep.png differ
diff --git a/custom_gallery/app/assets/images/jquery.minicolors.png b/custom_gallery/app/assets/images/jquery.minicolors.png
new file mode 100644
index 0000000..bccc201
Binary files /dev/null and b/custom_gallery/app/assets/images/jquery.minicolors.png differ
diff --git a/custom_gallery/app/assets/javascripts/cropper.js b/custom_gallery/app/assets/javascripts/cropper.js
new file mode 100644
index 0000000..b449513
--- /dev/null
+++ b/custom_gallery/app/assets/javascripts/cropper.js
@@ -0,0 +1,3566 @@
+/*!
+ * Cropper.js v1.5.5
+ * https://fengyuanchen.github.io/cropperjs
+ *
+ * Copyright 2015-present Chen Fengyuan
+ * Released under the MIT license
+ *
+ * Date: 2019-08-04T02:26:31.160Z
+ */
+
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = global || self, global.Cropper = factory());
+}(this, function () { 'use strict';
+
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function (obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+ }
+
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
+
+ function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+ }
+
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
+ }
+
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) {
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
+
+ return arr2;
+ }
+ }
+
+ function _iterableToArray(iter) {
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
+ }
+
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
+ }
+
+ var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';
+ var WINDOW = IS_BROWSER ? window : {};
+ var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
+ var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
+ var NAMESPACE = 'cropper'; // Actions
+
+ var ACTION_ALL = 'all';
+ var ACTION_CROP = 'crop';
+ var ACTION_MOVE = 'move';
+ var ACTION_ZOOM = 'zoom';
+ var ACTION_EAST = 'e';
+ var ACTION_WEST = 'w';
+ var ACTION_SOUTH = 's';
+ var ACTION_NORTH = 'n';
+ var ACTION_NORTH_EAST = 'ne';
+ var ACTION_NORTH_WEST = 'nw';
+ var ACTION_SOUTH_EAST = 'se';
+ var ACTION_SOUTH_WEST = 'sw'; // Classes
+
+ var CLASS_CROP = "".concat(NAMESPACE, "-crop");
+ var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled");
+ var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden");
+ var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
+ var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible");
+ var CLASS_MODAL = "".concat(NAMESPACE, "-modal");
+ var CLASS_MOVE = "".concat(NAMESPACE, "-move"); // Data keys
+
+ var DATA_ACTION = "".concat(NAMESPACE, "Action");
+ var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); // Drag modes
+
+ var DRAG_MODE_CROP = 'crop';
+ var DRAG_MODE_MOVE = 'move';
+ var DRAG_MODE_NONE = 'none'; // Events
+
+ var EVENT_CROP = 'crop';
+ var EVENT_CROP_END = 'cropend';
+ var EVENT_CROP_MOVE = 'cropmove';
+ var EVENT_CROP_START = 'cropstart';
+ var EVENT_DBLCLICK = 'dblclick';
+ var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
+ var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
+ var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
+ var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;
+ var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;
+ var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;
+ var EVENT_READY = 'ready';
+ var EVENT_RESIZE = 'resize';
+ var EVENT_WHEEL = 'wheel';
+ var EVENT_ZOOM = 'zoom'; // Mime types
+
+ var MIME_TYPE_JPEG = 'image/jpeg'; // RegExps
+
+ var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;
+ var REGEXP_DATA_URL = /^data:/;
+ var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
+ var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc
+ // Inspired by the default width and height of a canvas element.
+
+ var MIN_CONTAINER_WIDTH = 200;
+ var MIN_CONTAINER_HEIGHT = 100;
+
+ var DEFAULTS = {
+ // Define the view mode of the cropper
+ viewMode: 0,
+ // 0, 1, 2, 3
+ // Define the dragging mode of the cropper
+ dragMode: DRAG_MODE_CROP,
+ // 'crop', 'move' or 'none'
+ // Define the initial aspect ratio of the crop box
+ initialAspectRatio: NaN,
+ // Define the aspect ratio of the crop box
+ aspectRatio: NaN,
+ // An object with the previous cropping result data
+ data: null,
+ // A selector for adding extra containers to preview
+ preview: '',
+ // Re-render the cropper when resize the window
+ responsive: true,
+ // Restore the cropped area after resize the window
+ restore: true,
+ // Check if the current image is a cross-origin image
+ checkCrossOrigin: true,
+ // Check the current image's Exif Orientation information
+ checkOrientation: true,
+ // Show the black modal
+ modal: true,
+ // Show the dashed lines for guiding
+ guides: true,
+ // Show the center indicator for guiding
+ center: true,
+ // Show the white modal to highlight the crop box
+ highlight: true,
+ // Show the grid background
+ background: true,
+ // Enable to crop the image automatically when initialize
+ autoCrop: true,
+ // Define the percentage of automatic cropping area when initializes
+ autoCropArea: 0.8,
+ // Enable to move the image
+ movable: true,
+ // Enable to rotate the image
+ rotatable: true,
+ // Enable to scale the image
+ scalable: true,
+ // Enable to zoom the image
+ zoomable: true,
+ // Enable to zoom the image by dragging touch
+ zoomOnTouch: true,
+ // Enable to zoom the image by wheeling mouse
+ zoomOnWheel: true,
+ // Define zoom ratio when zoom the image by wheeling mouse
+ wheelZoomRatio: 0.1,
+ // Enable to move the crop box
+ cropBoxMovable: true,
+ // Enable to resize the crop box
+ cropBoxResizable: true,
+ // Toggle drag mode between "crop" and "move" when click twice on the cropper
+ toggleDragModeOnDblclick: true,
+ // Size limitation
+ minCanvasWidth: 0,
+ minCanvasHeight: 0,
+ minCropBoxWidth: 0,
+ minCropBoxHeight: 0,
+ minContainerWidth: 200,
+ minContainerHeight: 100,
+ // Shortcuts of events
+ ready: null,
+ cropstart: null,
+ cropmove: null,
+ cropend: null,
+ crop: null,
+ zoom: null
+ };
+
+ var TEMPLATE = '
"
+ end
+ if params[:action] != "index"
+ if params[:custom_module]
+ extra_url = "/#{params[:custom_module]}#{params[:bind_uid].present? ? ('-'+params[:bind_uid]) : ''}"
+ end
+ res << "
"
+ end
+ res.html_safe
+ else
+ super
+ end
+ end
+ def import_this_image(row,custom_album)
+ value = {}
+ image = CustomAlbumImage.new
+ image.custom_album = custom_album
+ row.cells.each_with_index do |cell,index|
+ val = cell.value rescue nil
+ next if val.blank?
+ case index
+ when 0
+ image.remote_file_url = val
+ when 1
+ value["zh_tw"] = val
+ value["en"] = (row.cells[index + 1].value rescue "")
+ image.description_translations = value
+ end
+ end
+ image.save
+ end
+end
diff --git a/custom_gallery/app/mailers/.keep b/custom_gallery/app/mailers/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/models/.keep b/custom_gallery/app/models/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/models/custom_album.rb b/custom_gallery/app/models/custom_album.rb
new file mode 100644
index 0000000..20013a6
--- /dev/null
+++ b/custom_gallery/app/models/custom_album.rb
@@ -0,0 +1,119 @@
+class CustomAlbum
+ include Mongoid::Document
+ include Mongoid::Timestamps
+
+ include OrbitCategory::Categorizable
+ include OrbitTag::Taggable
+ include Slug
+
+ field :custom_module
+ field :bind_uid
+ field :name, as: :slug_title, localize: true
+ field :description, localize: true
+ field :cover, default: "default"
+ field :cover_path #can refact
+ field :tag_names
+ field :uid, type: String
+ field :rss2_id, type: String
+ field :order, type: Integer, default: -1
+ field :resize_gravity
+ # has_and_belongs_to_many :tags, :class_name => "CustomGalleryTag"
+ has_many :custom_album_images, :autosave => true, :dependent => :destroy
+ has_many :custom_album_colors, :autosave => true, :dependent => :destroy
+ accepts_nested_attributes_for :custom_album_images, :allow_destroy => true
+ accepts_nested_attributes_for :custom_album_colors, :allow_destroy => true
+ before_save do |record|
+ if record.order.nil? || record.order == -1
+ topest_order = CustomAlbum.all.pluck(:order).sort{|a,b| a.to_i<=>b.to_i}.first
+ if topest_order.nil? || topest_order == 0
+ record.order = -2
+ else
+ record.order = topest_order - 1
+ end
+ end
+ end
+ after_create do
+ custom_record_callback(1)
+ end
+ after_destroy do
+ custom_record_callback(-1)
+ end
+ def custom_record_callback(num)
+ if self.custom_module && self.bind_uid.present?
+ custom_album_config = CustomAlbumConfig.where(:module=>self.custom_module).first
+ if custom_album_config && custom_album_config.custom_record_callback.present? && custom_album_config.bind_model.present?
+ target_model = custom_album_config.bind_model.constantize rescue nil
+ if target_model
+ target_record = target_model.where(custom_album_config.uid_field=>self.bind_uid).first
+ target_record.send(custom_album_config.custom_record_callback,num)
+ end
+ end
+ end
+ end
+ def resize_gravity
+ """
+ NorthWestGravity
+ Position object at top-left of region
+ NorthGravity
+ Position object at top-center of region
+ NorthEastGravity
+ Position object at top-right of region
+ WestGravity
+ Position object at left-center of region
+ CenterGravity
+ Position object at center of region
+ EastGravity
+ Position object at right-center of region
+ SouthWestGravity
+ Position object at left-bottom of region
+ SouthGravity
+ Position object at bottom-center of region
+ SouthEastGravity
+ Position object at bottom-right of region
+ """
+ tmp = self[:resize_gravity]
+ (tmp.blank? ? (CustomAlbumSetting.first.resize_gravity.blank? ? "Center" : CustomAlbumSetting.first.resize_gravity) : tmp) rescue 'Center'
+ end
+ def self.find_by_param(input)
+ self.find_by(uid: input)
+ end
+ def self.filter_by_tags(tags=[])
+ tags = OrbitHelper.page_tags if tags.blank?
+ tags = [tags].flatten.uniq
+ if !(tags.include?("all"))
+ tag_temp = Tag.all.select{|value| tags.include? value.id.to_s}
+ tag_temp_length = 0
+ tag_temp.each do |value|
+ if value.name==I18n.t('custom_gallery.show_desc') || value.name==I18n.t('custom_gallery.not_show_desc')
+ tag_temp_length+=1
+ end
+ end
+ if tag_temp_length!=0
+ if (tags.length - tag_temp_length) == 0
+ tags = ['all']
+ end
+ end
+ end
+ if tags.blank? || (tags.include?("all") rescue false)
+ self.all
+ else
+ tags
+ taggings = Tagging.where(:tag_id.in=>tags).map{|item| item.taggable_id}
+ self.where(:id.in=>taggings)
+ end
+ end
+ def cover
+ tmp = self['cover']
+ if tmp=='default'
+ tmp = (self.custom_album_images.first.id.to_s rescue 'default')
+ end
+ tmp
+ end
+ def cover_path
+ tmp = self['cover_path']
+ if tmp.nil?
+ tmp = (self.custom_album_images.first.file.thumb.url rescue nil)
+ end
+ tmp
+ end
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_color.rb b/custom_gallery/app/models/custom_album_color.rb
new file mode 100644
index 0000000..30dc125
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_color.rb
@@ -0,0 +1,9 @@
+class CustomAlbumColor
+ include Mongoid::Document
+ include Mongoid::Timestamps
+ field :color, type: String
+ field :custom_album_card_background_color, type: String
+ field :custom_album_card_text_color, type: String
+
+ belongs_to :custom_album
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_config.rb b/custom_gallery/app/models/custom_album_config.rb
new file mode 100644
index 0000000..c6ca1fa
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_config.rb
@@ -0,0 +1,10 @@
+class CustomAlbumConfig
+ include Mongoid::Document
+ include Mongoid::Timestamps
+ field :module
+ field :bind_model , :type => String
+ field :title_field , :type => String , :default => "slug_title"
+ field :uid_field , :type => String , :default => "uid"
+ field :custom_record_callback #if exists, it will call 'custom_record_callback(num)'
+ #where num is 1 when create bulletin, num is -1 when destroy.
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_crop.rb b/custom_gallery/app/models/custom_album_crop.rb
new file mode 100644
index 0000000..ea7665d
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_crop.rb
@@ -0,0 +1,8 @@
+class CustomAlbumCrop
+ include Mongoid::Document
+ field :crop_x, type: String
+ field :crop_y, type: String
+ field :crop_w, type: String
+ field :crop_h, type: String
+ belongs_to :custom_album_image
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_image.rb b/custom_gallery/app/models/custom_album_image.rb
new file mode 100644
index 0000000..a0948a9
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_image.rb
@@ -0,0 +1,27 @@
+require 'net/http'
+class CustomAlbumImage
+ include Mongoid::Document
+ include Mongoid::Timestamps
+ include OrbitTag::Taggable
+ mount_uploader :file, CustomGalleryUploader
+ field :title
+ field :title_translations, type: Hash, default: {}
+ field :description, localize: true
+ field :rss2_id, type: String
+ field :order, type: Integer, default: -1
+
+ # has_and_belongs_to_many :tags, :class_name => "CustomGalleryTag"
+ def title_translations
+ tmp = super || {}
+ if tmp == {}
+ tmp = I18n.available_locales.collect{|locale| [locale,self[:title]]}.to_h
+ end
+ tmp
+ end
+ def title
+ self.title_translations[I18n.locale]
+ end
+ belongs_to :custom_album
+ has_many :custom_album_crops, :autosave => true, :dependent => :destroy
+ accepts_nested_attributes_for :custom_album_crops, :allow_destroy => true
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_setting.rb b/custom_gallery/app/models/custom_album_setting.rb
new file mode 100644
index 0000000..927cfaf
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_setting.rb
@@ -0,0 +1,9 @@
+class CustomAlbumSetting
+ include Mongoid::Document
+ include Mongoid::Timestamps
+ field :limit
+ field :resize_gravity, type: String, default: 'center'
+ ResizeGravities = %w[Center NorthWest North NorthEast West East SouthWest South SouthEast]
+ field :custom_album_card_background_color, default: ''
+ field :custom_album_card_text_color, default: '#000000'
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_unprocess.rb b/custom_gallery/app/models/custom_album_unprocess.rb
new file mode 100644
index 0000000..0182c71
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_unprocess.rb
@@ -0,0 +1,18 @@
+class CustomAlbumUnprocess
+ include Mongoid::Document
+ field :image_id
+ field :save_var, type: String
+ field :upload_success, type: Boolean
+ def save_var
+ temp = YAML.load(self[:save_var])
+ temp[:tempfile] = File.open(temp[:tempfile])
+ ActionDispatch::Http::UploadedFile.new(temp)
+ end
+ def save_var=(value)
+ temp = {:filename => value.original_filename,
+ :type => value.content_type,
+ :head => value.headers,
+ :tempfile => value.tempfile.path}
+ self[:save_var] = temp.to_yaml
+ end
+end
\ No newline at end of file
diff --git a/custom_gallery/app/models/custom_album_variable.rb b/custom_gallery/app/models/custom_album_variable.rb
new file mode 100644
index 0000000..e0240da
--- /dev/null
+++ b/custom_gallery/app/models/custom_album_variable.rb
@@ -0,0 +1,8 @@
+class CustomAlbumVariable
+ include Mongoid::Document
+ field :count, type: Integer
+ field :progress_percent, type: String
+ field :progress_filename, type: String
+ field :finish, type: Boolean
+ field :notalive, type: Boolean
+end
\ No newline at end of file
diff --git a/custom_gallery/app/uploaders/custom_gallery_uploader.rb b/custom_gallery/app/uploaders/custom_gallery_uploader.rb
new file mode 100644
index 0000000..1236986
--- /dev/null
+++ b/custom_gallery/app/uploaders/custom_gallery_uploader.rb
@@ -0,0 +1,183 @@
+# encoding: utf-8
+module CarrierWave
+ module Uploader
+ module Versions
+ def store_dir
+ "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
+ end
+ end
+ end
+end
+
+class CustomGalleryUploader < CarrierWave::Uploader::Base
+ # Include RMagick or ImageScience support:
+ # include CarrierWave::RMagick
+ # include CarrierWave::ImageScience
+ include CarrierWave::MiniMagick
+ # Choose what kind of storage to use for this uploader:
+ # storage :file
+ # storage :s3
+
+ # Override the directory where uploaded files will be stored.
+ # This is a sensible default for uploaders that are meant to be mounted:
+ def store_dir
+ "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
+ end
+ def get_org_url
+ if have_crop?
+ model.file.resized.url
+ else
+ model.file.url
+ end
+ end
+ def fix_exif_rotation
+ manipulate! do |img|
+ img.tap(&:auto_orient)
+ end
+ end
+ # Provide a default URL as a default if there hasn't been a file uploaded:
+ # def default_url
+ # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
+ # end
+
+ # Process files as they are uploaded:
+ # process :scale => [200, 300]
+ #
+ # def scale(width, height)
+ # # do something
+ # end
+
+ # Create different versions of your uploaded files:
+ # version :thumb do
+ # process :scale => [50, 50]
+ # end
+ process :resizer
+ process :optimize
+ version :resized, :if => :have_crop? do #backup
+ def full_filename(for_file)
+ extension = File.extname(super(for_file))
+ base_name = super(for_file).split('resized_').join('').chomp(extension)
+ base_name + '_resized'+ extension
+ end
+ end
+ version :crop_from_org, :if => :have_crop? do
+ process :crop_it
+ def full_filename(for_file)
+ super(for_file).split('crop_from_org_').join('')
+ end
+ end
+ version :thumb do
+ process :convert => 'png', :if => :transparent?
+ process :pad_process => [200,200]
+ end
+ version :thumb_large do
+ process :convert => 'png', :if => :transparent?
+ process :pad_process => [600,600]
+ end
+ version :theater do
+ process :limit_process => [1920, 1080]
+ end
+ version :mobile do
+ process :limit_process => [1152, 768]
+ end
+# Add a white list of extensions which are allowed to be uploaded.
+# For images you might use something like this:
+# def extension_white_list
+# %w(jpg jpeg gif png)
+# end
+
+# Override the filename of the uploaded files:
+# def filename
+# "something.jpg" if original_filename
+# end
+
+# def manipulate!
+# raise current_path.inspect
+# image = ::MiniMagick::Image.open(current_path)
+# image = yield(image)
+# image.write(current_path)
+# ::MiniMagick::Image.open(current_path)
+# rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
+# raise CarrierWave::ProcessingError.new("Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: #{e}")
+# end
+ def get_w_and_h
+ if have_crop?
+ img = MiniMagick::Image.open(model.file.resized.path)
+ else
+ img = MiniMagick::Image.open(model.file.path)
+ end
+ [img[:width], img[:height]]
+ end
+ def rotate_ang(angle)
+ if have_crop?
+ img_path = model.file.resized.path
+ else
+ img_path = model.file.path
+ end
+ puts img_path
+ img = MiniMagick::Image.open(img_path)
+ img.rotate(angle)
+ puts img
+ img.write(img_path)
+ end
+ def optimize (*arg)
+ manipulate! do |img|
+ return img unless img.mime_type.match /image\/jpeg/
+ img.strip
+ img.combine_options do |c|
+ c.quality "90"
+ c.depth "24"
+ c.interlace "plane"
+ end
+ img
+ end
+ end
+ private
+ def resizer
+ size_of_file = size.to_f / (2**20)
+ if size_of_file > 5
+ img = MiniMagick::Image.open(path)
+ img_width = img[:width]
+ img_height = img[:height]
+ multiple = [img_width/Math.sqrt(size_of_file/5)/1920,img_height/Math.sqrt(size_of_file/5)/1080].max
+ if (multiple - multiple.to_i)>0.5
+ multiple = multiple.to_i + 0.5
+ else
+ multiple = multiple.to_i
+ end
+ resize_to_limit(multiple*1920,multiple*1080)
+ else
+ manipulate! do |img|
+ img
+ end
+ end
+ end
+ def limit_process(w,h)
+ resize_to_limit(w,h)
+ end
+ def have_crop?(*arg)
+ !(model.custom_album_crops.first.nil?)
+ end
+ def crop_it
+ crops = model.custom_album_crops.first
+ x=(crops.crop_x).to_i.abs.to_s
+ y=(crops.crop_y).to_i.abs.to_s
+ w=crops.crop_w.to_i
+ h=crops.crop_h.to_i
+ crop_image("#{w}x#{h}+#{x}+#{y}")
+ end
+ def crop_image(geometry)
+ img = MiniMagick::Image.open(model.file.resized.path)
+ img.crop(geometry)
+ img.write(model.file.crop_from_org.path)
+ end
+ def transparent?(*arg)
+ now_custom_album = model.custom_album
+ now_custom_album.custom_album_colors.first['color']=='transparent' rescue true
+ end
+ def pad_process (w,h)
+ now_custom_album = model.custom_album
+ resize_and_pad(w, h, (transparent? ? :transparent : now_custom_album.custom_album_colors.first['color']), (now_custom_album.resize_gravity rescue 'Center'))
+ end
+end
+
diff --git a/custom_gallery/app/views/.keep b/custom_gallery/app/views/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/custom_gallery/app/views/admin/custom_galleries/_custom_album.html.erb b/custom_gallery/app/views/admin/custom_galleries/_custom_album.html.erb
new file mode 100644
index 0000000..93dae6c
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/_custom_album.html.erb
@@ -0,0 +1,29 @@
+
\ No newline at end of file
diff --git a/custom_gallery/app/views/admin/custom_galleries/_custom_albums.html.erb b/custom_gallery/app/views/admin/custom_galleries/_custom_albums.html.erb
new file mode 100644
index 0000000..0da9a6e
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/_custom_albums.html.erb
@@ -0,0 +1,14 @@
+<%= render :partial => "custom_album", :collection => @custom_albums %>
+
\ No newline at end of file
diff --git a/custom_gallery/app/views/admin/custom_galleries/_form.html.erb b/custom_gallery/app/views/admin/custom_galleries/_form.html.erb
new file mode 100644
index 0000000..db571db
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/_form.html.erb
@@ -0,0 +1,202 @@
+<% content_for :page_specific_css do %>
+ <%= stylesheet_link_tag "lib/main-forms" %>
+ <%= stylesheet_link_tag "lib/fileupload" %>
+ <%= stylesheet_link_tag "lib/main-list" %>
+ <%= stylesheet_link_tag "jquery.minicolors" %>
+<% end %>
+<% content_for :page_specific_javascript do %>
+ <%= javascript_include_tag "lib/bootstrap-fileupload" %>
+ <%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
+ <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
+ <%= javascript_include_tag "lib/modal-preview" %>
+ <%= javascript_include_tag "lib/file-type" %>
+ <%= javascript_include_tag "jquery.minicolors" %>
+<% end %>
+
+
+
+
\ No newline at end of file
diff --git a/custom_gallery/app/views/admin/custom_galleries/_image.html.erb b/custom_gallery/app/views/admin/custom_galleries/_image.html.erb
new file mode 100644
index 0000000..91d1c33
--- /dev/null
+++ b/custom_gallery/app/views/admin/custom_galleries/_image.html.erb
@@ -0,0 +1,18 @@
+
\ No newline at end of file
diff --git a/custom_gallery/modules/custom_gallery/_custom_gallery_widget3.html.erb b/custom_gallery/modules/custom_gallery/_custom_gallery_widget3.html.erb
new file mode 100644
index 0000000..0a5dc2e
--- /dev/null
+++ b/custom_gallery/modules/custom_gallery/_custom_gallery_widget3.html.erb
@@ -0,0 +1,31 @@
+
\ No newline at end of file
diff --git a/custom_gallery/modules/custom_gallery/_custom_gallery_widget5.html.erb b/custom_gallery/modules/custom_gallery/_custom_gallery_widget5.html.erb
new file mode 100644
index 0000000..7570c11
--- /dev/null
+++ b/custom_gallery/modules/custom_gallery/_custom_gallery_widget5.html.erb
@@ -0,0 +1,73 @@
+
\ No newline at end of file
diff --git a/custom_gallery/modules/custom_gallery/custom_gallery_index1.html.erb b/custom_gallery/modules/custom_gallery/custom_gallery_index1.html.erb
new file mode 100644
index 0000000..4531ca1
--- /dev/null
+++ b/custom_gallery/modules/custom_gallery/custom_gallery_index1.html.erb
@@ -0,0 +1,21 @@
+
+