Compare commits
46
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9162c4306c | ||
|
|
33f256bd16 | ||
|
|
fde9fd7ffe | ||
|
|
d977b83d06 | ||
|
|
a1eae7543e | ||
|
|
8d9bf62909 | ||
|
|
2f480c31bf | ||
|
|
19d33f78bd | ||
|
|
37c91664d3 | ||
|
|
eb853f773d | ||
|
|
d701d9d6ad | ||
|
|
75eeec737c | ||
|
|
36c3635bbb | ||
|
|
fa1c731ad3 | ||
|
|
2c24e788b0 | ||
|
|
26a8be2f0f | ||
|
|
fa51d16879 | ||
|
|
ceff21fd1f | ||
|
|
1357124f6f | ||
|
|
8c3fb43bf5 | ||
|
|
71e8b3c042 | ||
|
|
b37643147f | ||
|
|
ec57cbff1c | ||
|
|
7d6df11873 | ||
|
|
8043573370 | ||
|
|
f025c98ffa | ||
|
|
3a91c92bf7 | ||
|
|
b1d8a87256 | ||
|
|
c7ac4e2485 | ||
|
|
3467868607 | ||
|
|
ceac2b842c | ||
|
|
c763817ebf | ||
|
|
3c3bba514a | ||
|
|
837dc3ea7b | ||
|
|
ea5d89e0e1 | ||
|
|
aea15fa622 | ||
|
|
c1316f72a0 | ||
|
|
d996b91b54 | ||
|
|
07b3857465 | ||
|
|
8751b15385 | ||
|
|
6a40a9555a | ||
|
|
869f3b6815 | ||
|
|
465d417c35 | ||
|
|
eaf7577810 | ||
|
|
22358bd862 | ||
|
|
300de76c3a |
No files matched your search
@@ -21,3 +21,4 @@ uploads/**/*
|
|||||||
|
|
||||||
.sass-cache/*
|
.sass-cache/*
|
||||||
*.supported
|
*.supported
|
||||||
|
mongoid.yml
|
||||||
@@ -15,6 +15,9 @@ gem 'jquery-rails', '2.1.4'
|
|||||||
gem 'jquery-ui-rails'
|
gem 'jquery-ui-rails'
|
||||||
gem "select2-rails", '3.3.1'
|
gem "select2-rails", '3.3.1'
|
||||||
gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git'
|
gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git'
|
||||||
|
gem "acts_as_unvlogable"
|
||||||
|
gem 'youtube_it'
|
||||||
|
gem 'gotcha'
|
||||||
|
|
||||||
# gem "memcached", "~> 1.4.3"
|
# gem "memcached", "~> 1.4.3"
|
||||||
# gem "memcache-client"
|
# gem "memcache-client"
|
||||||
@@ -46,14 +49,14 @@ gem 'sinatra'
|
|||||||
gem 'sprockets'
|
gem 'sprockets'
|
||||||
gem 'social-share-button'
|
gem 'social-share-button'
|
||||||
|
|
||||||
gem 'tinymce-rails'
|
gem 'tinymce-rails', '3.5.8.3'
|
||||||
gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux")
|
gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux")
|
||||||
gem 'libv8', '~> 3.11.8' if RUBY_PLATFORM.downcase.include?("linux")
|
gem 'libv8', '~> 3.11.8' if RUBY_PLATFORM.downcase.include?("linux")
|
||||||
gem 'mongoid-encryptor', :require => 'mongoid/encryptor'
|
gem 'mongoid-encryptor', :require => 'mongoid/encryptor'
|
||||||
gem 'rb-readline','~> 0.4.2' if RUBY_PLATFORM.downcase.include?("linux")
|
gem 'rb-readline','~> 0.4.2' if RUBY_PLATFORM.downcase.include?("linux")
|
||||||
|
|
||||||
|
|
||||||
gem "impressionist", :git => 'git://github.com/charlotte-ruby/impressionist.git'
|
gem "impressionist",'1.2.0'
|
||||||
#gem 'contacts'
|
#gem 'contacts'
|
||||||
#gem 'event-calendar', :require => 'event_calendar'#, :git => 'git://github.com/elevation/event_calendar.git'
|
#gem 'event-calendar', :require => 'event_calendar'#, :git => 'git://github.com/elevation/event_calendar.git'
|
||||||
|
|
||||||
|
|||||||
-409
@@ -1,409 +0,0 @@
|
|||||||
GIT
|
|
||||||
remote: git://github.com/amatsuda/kaminari.git
|
|
||||||
revision: 2e09b5374fec33b57c6387ca7bac89ecaa60c9eb
|
|
||||||
specs:
|
|
||||||
kaminari (0.14.1)
|
|
||||||
actionpack (>= 3.0.0)
|
|
||||||
activesupport (>= 3.0.0)
|
|
||||||
|
|
||||||
GIT
|
|
||||||
remote: git://github.com/charlotte-ruby/impressionist.git
|
|
||||||
revision: 0894f6a550a33f83f4937d655e9f0774521781e4
|
|
||||||
specs:
|
|
||||||
impressionist (1.2.0)
|
|
||||||
httpclient (~> 2.2)
|
|
||||||
nokogiri (~> 1.5)
|
|
||||||
|
|
||||||
GEM
|
|
||||||
remote: http://rubygems.org/
|
|
||||||
specs:
|
|
||||||
actionmailer (3.2.12)
|
|
||||||
actionpack (= 3.2.12)
|
|
||||||
mail (~> 2.4.4)
|
|
||||||
actionpack (3.2.12)
|
|
||||||
activemodel (= 3.2.12)
|
|
||||||
activesupport (= 3.2.12)
|
|
||||||
builder (~> 3.0.0)
|
|
||||||
erubis (~> 2.7.0)
|
|
||||||
journey (~> 1.0.4)
|
|
||||||
rack (~> 1.4.5)
|
|
||||||
rack-cache (~> 1.2)
|
|
||||||
rack-test (~> 0.6.1)
|
|
||||||
sprockets (~> 2.2.1)
|
|
||||||
activemodel (3.2.12)
|
|
||||||
activesupport (= 3.2.12)
|
|
||||||
builder (~> 3.0.0)
|
|
||||||
activerecord (3.2.12)
|
|
||||||
activemodel (= 3.2.12)
|
|
||||||
activesupport (= 3.2.12)
|
|
||||||
arel (~> 3.0.2)
|
|
||||||
tzinfo (~> 0.3.29)
|
|
||||||
activeresource (3.2.12)
|
|
||||||
activemodel (= 3.2.12)
|
|
||||||
activesupport (= 3.2.12)
|
|
||||||
activesupport (3.2.12)
|
|
||||||
i18n (~> 0.6)
|
|
||||||
multi_json (~> 1.0)
|
|
||||||
arel (3.0.2)
|
|
||||||
attr_required (0.0.5)
|
|
||||||
bcrypt-ruby (3.0.0)
|
|
||||||
binding_of_caller (0.7.1)
|
|
||||||
debug_inspector (>= 0.0.1)
|
|
||||||
bourne (1.1.2)
|
|
||||||
mocha (= 0.10.5)
|
|
||||||
brakeman (1.9.2)
|
|
||||||
erubis (~> 2.6)
|
|
||||||
fastercsv (~> 1.5)
|
|
||||||
haml (~> 3.0)
|
|
||||||
highline (~> 1.6)
|
|
||||||
multi_json (~> 1.2)
|
|
||||||
ruby2ruby (~> 2.0)
|
|
||||||
ruby_parser (~> 3.1.1)
|
|
||||||
sass (~> 3.0)
|
|
||||||
terminal-table (~> 1.4)
|
|
||||||
bson (1.8.2)
|
|
||||||
bson_ext (1.8.2)
|
|
||||||
bson (~> 1.8.2)
|
|
||||||
builder (3.0.4)
|
|
||||||
capybara (2.0.2)
|
|
||||||
mime-types (>= 1.16)
|
|
||||||
nokogiri (>= 1.3.3)
|
|
||||||
rack (>= 1.0.0)
|
|
||||||
rack-test (>= 0.5.4)
|
|
||||||
selenium-webdriver (~> 2.0)
|
|
||||||
xpath (~> 1.0.0)
|
|
||||||
carrierwave (0.6.2)
|
|
||||||
activemodel (>= 3.2.0)
|
|
||||||
activesupport (>= 3.2.0)
|
|
||||||
carrierwave-mongoid (0.2.2)
|
|
||||||
carrierwave (~> 0.6.1)
|
|
||||||
mongoid (~> 2.1)
|
|
||||||
childprocess (0.3.8)
|
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
|
||||||
chinese_pinyin (0.4.1)
|
|
||||||
chronic (0.9.0)
|
|
||||||
coderay (1.0.9)
|
|
||||||
coffee-rails (3.2.2)
|
|
||||||
coffee-script (>= 2.2.0)
|
|
||||||
railties (~> 3.2.0)
|
|
||||||
coffee-script (2.2.0)
|
|
||||||
coffee-script-source
|
|
||||||
execjs
|
|
||||||
coffee-script-source (1.4.0)
|
|
||||||
columnize (0.3.6)
|
|
||||||
database_cleaner (0.9.1)
|
|
||||||
debug_inspector (0.0.2)
|
|
||||||
debugger (1.2.4)
|
|
||||||
columnize (>= 0.3.1)
|
|
||||||
debugger-linecache (~> 1.1.1)
|
|
||||||
debugger-ruby_core_source (~> 1.1.7)
|
|
||||||
debugger-linecache (1.1.2)
|
|
||||||
debugger-ruby_core_source (>= 1.1.1)
|
|
||||||
debugger-ruby_core_source (1.1.8)
|
|
||||||
delorean (2.1.0)
|
|
||||||
chronic
|
|
||||||
devise (1.5.3)
|
|
||||||
bcrypt-ruby (~> 3.0)
|
|
||||||
orm_adapter (~> 0.0.3)
|
|
||||||
warden (~> 1.1)
|
|
||||||
diff-lcs (1.1.3)
|
|
||||||
encrypted_strings (0.3.3)
|
|
||||||
erubis (2.7.0)
|
|
||||||
exception_notification (3.0.1)
|
|
||||||
actionmailer (>= 3.0.4)
|
|
||||||
execjs (1.4.0)
|
|
||||||
multi_json (~> 1.0)
|
|
||||||
factory_girl (4.2.0)
|
|
||||||
activesupport (>= 3.0.0)
|
|
||||||
factory_girl_rails (4.2.1)
|
|
||||||
factory_girl (~> 4.2.0)
|
|
||||||
railties (>= 3.0.0)
|
|
||||||
faker (1.1.2)
|
|
||||||
i18n (~> 0.5)
|
|
||||||
fastercsv (1.5.5)
|
|
||||||
fattr (2.2.1)
|
|
||||||
fb_graph (2.6.4)
|
|
||||||
httpclient (>= 2.2.0.2)
|
|
||||||
multi_json (>= 1.3)
|
|
||||||
rack-oauth2 (>= 0.14.4)
|
|
||||||
tzinfo
|
|
||||||
ffi (1.4.0)
|
|
||||||
haml (3.1.8)
|
|
||||||
highline (1.6.15)
|
|
||||||
hike (1.2.1)
|
|
||||||
httpclient (2.3.2)
|
|
||||||
i18n (0.6.1)
|
|
||||||
journey (1.0.4)
|
|
||||||
jquery-rails (2.1.4)
|
|
||||||
railties (>= 3.0, < 5.0)
|
|
||||||
thor (>= 0.14, < 2.0)
|
|
||||||
jquery-ui-rails (4.0.1)
|
|
||||||
jquery-rails
|
|
||||||
railties (>= 3.1.0)
|
|
||||||
json (1.7.7)
|
|
||||||
mail (2.4.4)
|
|
||||||
i18n (>= 0.4.0)
|
|
||||||
mime-types (~> 1.16)
|
|
||||||
treetop (~> 1.4.8)
|
|
||||||
metaclass (0.0.1)
|
|
||||||
method_source (0.8.1)
|
|
||||||
mime-types (1.21)
|
|
||||||
mini_magick (3.5.0)
|
|
||||||
subexec (~> 0.2.1)
|
|
||||||
mocha (0.10.5)
|
|
||||||
metaclass (~> 0.0.1)
|
|
||||||
mongo (1.8.2)
|
|
||||||
bson (~> 1.8.2)
|
|
||||||
mongo_session_store-rails3 (3.0.6)
|
|
||||||
actionpack (>= 3.0)
|
|
||||||
mongo
|
|
||||||
mongoid (2.6.0)
|
|
||||||
activemodel (~> 3.1)
|
|
||||||
mongo (~> 1.7)
|
|
||||||
tzinfo (~> 0.3.22)
|
|
||||||
mongoid-encryptor (0.0.5)
|
|
||||||
activesupport (~> 3.0)
|
|
||||||
encrypted_strings (~> 0.3.3)
|
|
||||||
mongoid (~> 2)
|
|
||||||
mongoid-tree (0.7.0)
|
|
||||||
mongoid (~> 2.0)
|
|
||||||
multi_json (1.6.1)
|
|
||||||
net-ldap (0.3.1)
|
|
||||||
nokogiri (1.5.6)
|
|
||||||
options (2.3.0)
|
|
||||||
fattr
|
|
||||||
orm_adapter (0.0.7)
|
|
||||||
polyglot (0.3.3)
|
|
||||||
pr_geohash (1.0.0)
|
|
||||||
progress_bar (0.4.0)
|
|
||||||
highline (~> 1.6.1)
|
|
||||||
options (~> 2.3.0)
|
|
||||||
pry (0.9.12)
|
|
||||||
coderay (~> 1.0.5)
|
|
||||||
method_source (~> 0.8)
|
|
||||||
slop (~> 3.4)
|
|
||||||
pry-debugger (0.2.1)
|
|
||||||
debugger (~> 1.2.0)
|
|
||||||
pry (~> 0.9.10)
|
|
||||||
pry-remote (0.1.6)
|
|
||||||
pry (~> 0.9)
|
|
||||||
slop (~> 3.0)
|
|
||||||
pry-stack_explorer (0.4.9)
|
|
||||||
binding_of_caller (>= 0.7)
|
|
||||||
pry (~> 0.9.11)
|
|
||||||
rack (1.4.5)
|
|
||||||
rack-cache (1.2)
|
|
||||||
rack (>= 0.4)
|
|
||||||
rack-gridfs (0.4.1)
|
|
||||||
mime-types
|
|
||||||
mongo (~> 1.2)
|
|
||||||
rack
|
|
||||||
rack-oauth2 (1.0.0)
|
|
||||||
activesupport (>= 2.3)
|
|
||||||
attr_required (>= 0.0.5)
|
|
||||||
httpclient (>= 2.2.0.2)
|
|
||||||
i18n
|
|
||||||
multi_json (>= 1.3.6)
|
|
||||||
rack (>= 1.1)
|
|
||||||
rack-protection (1.3.2)
|
|
||||||
rack
|
|
||||||
rack-ssl (1.3.3)
|
|
||||||
rack
|
|
||||||
rack-test (0.6.2)
|
|
||||||
rack (>= 1.0)
|
|
||||||
radius (0.7.3)
|
|
||||||
rails (3.2.12)
|
|
||||||
actionmailer (= 3.2.12)
|
|
||||||
actionpack (= 3.2.12)
|
|
||||||
activerecord (= 3.2.12)
|
|
||||||
activeresource (= 3.2.12)
|
|
||||||
activesupport (= 3.2.12)
|
|
||||||
bundler (~> 1.0)
|
|
||||||
railties (= 3.2.12)
|
|
||||||
railties (3.2.12)
|
|
||||||
actionpack (= 3.2.12)
|
|
||||||
activesupport (= 3.2.12)
|
|
||||||
rack-ssl (~> 1.3.2)
|
|
||||||
rake (>= 0.8.7)
|
|
||||||
rdoc (~> 3.4)
|
|
||||||
thor (>= 0.14.6, < 2.0)
|
|
||||||
rake (10.0.3)
|
|
||||||
rdoc (3.12.1)
|
|
||||||
json (~> 1.4)
|
|
||||||
redis (3.0.2)
|
|
||||||
redis-namespace (1.2.1)
|
|
||||||
redis (~> 3.0.0)
|
|
||||||
redis-search (0.9.0)
|
|
||||||
chinese_pinyin (>= 0.3.0)
|
|
||||||
redis (>= 2.1.1)
|
|
||||||
redis-namespace (>= 1.0.2)
|
|
||||||
resque (1.23.0)
|
|
||||||
multi_json (~> 1.0)
|
|
||||||
redis-namespace (~> 1.0)
|
|
||||||
sinatra (>= 0.9.2)
|
|
||||||
vegas (~> 0.1.2)
|
|
||||||
resque-restriction (0.3.0)
|
|
||||||
resque (>= 1.7.0)
|
|
||||||
resque-scheduler (2.0.0)
|
|
||||||
redis (>= 2.0.1)
|
|
||||||
resque (>= 1.20.0)
|
|
||||||
rufus-scheduler
|
|
||||||
rmmseg-cpp-huacnlee (0.2.9)
|
|
||||||
rsolr (1.0.8)
|
|
||||||
builder (>= 2.1.2)
|
|
||||||
rspec (2.12.0)
|
|
||||||
rspec-core (~> 2.12.0)
|
|
||||||
rspec-expectations (~> 2.12.0)
|
|
||||||
rspec-mocks (~> 2.12.0)
|
|
||||||
rspec-core (2.12.2)
|
|
||||||
rspec-expectations (2.12.1)
|
|
||||||
diff-lcs (~> 1.1.3)
|
|
||||||
rspec-mocks (2.12.2)
|
|
||||||
rspec-rails (2.12.2)
|
|
||||||
actionpack (>= 3.0)
|
|
||||||
activesupport (>= 3.0)
|
|
||||||
railties (>= 3.0)
|
|
||||||
rspec-core (~> 2.12.0)
|
|
||||||
rspec-expectations (~> 2.12.0)
|
|
||||||
rspec-mocks (~> 2.12.0)
|
|
||||||
ruby2ruby (2.0.3)
|
|
||||||
ruby_parser (~> 3.1)
|
|
||||||
sexp_processor (~> 4.0)
|
|
||||||
ruby_parser (3.1.1)
|
|
||||||
sexp_processor (~> 4.1)
|
|
||||||
rubyzip (0.9.9)
|
|
||||||
rufus-scheduler (2.0.17)
|
|
||||||
tzinfo (>= 0.3.23)
|
|
||||||
sass (3.2.5)
|
|
||||||
sass-rails (3.2.6)
|
|
||||||
railties (~> 3.2.0)
|
|
||||||
sass (>= 3.1.10)
|
|
||||||
tilt (~> 1.3)
|
|
||||||
select2-rails (3.3.1)
|
|
||||||
sass-rails (>= 3.2)
|
|
||||||
thor (~> 0.14)
|
|
||||||
selenium-webdriver (2.30.0)
|
|
||||||
childprocess (>= 0.2.5)
|
|
||||||
multi_json (~> 1.0)
|
|
||||||
rubyzip
|
|
||||||
websocket (~> 1.0.4)
|
|
||||||
sexp_processor (4.1.5)
|
|
||||||
shoulda-matchers (1.4.2)
|
|
||||||
activesupport (>= 3.0.0)
|
|
||||||
bourne (~> 1.1.2)
|
|
||||||
simplecov (0.7.1)
|
|
||||||
multi_json (~> 1.0)
|
|
||||||
simplecov-html (~> 0.7.1)
|
|
||||||
simplecov-html (0.7.1)
|
|
||||||
sinatra (1.3.4)
|
|
||||||
rack (~> 1.4)
|
|
||||||
rack-protection (~> 1.3)
|
|
||||||
tilt (~> 1.3, >= 1.3.3)
|
|
||||||
slop (3.4.3)
|
|
||||||
social-share-button (0.1.1)
|
|
||||||
spork (0.9.2)
|
|
||||||
sprockets (2.2.2)
|
|
||||||
hike (~> 1.2)
|
|
||||||
multi_json (~> 1.0)
|
|
||||||
rack (~> 1.0)
|
|
||||||
tilt (~> 1.1, != 1.3.0)
|
|
||||||
subexec (0.2.2)
|
|
||||||
sunspot (1.3.3)
|
|
||||||
pr_geohash (~> 1.0)
|
|
||||||
rsolr (~> 1.0.7)
|
|
||||||
sunspot-rails-tester (0.0.4)
|
|
||||||
sunspot_rails (~> 1.2)
|
|
||||||
sunspot_mongo (1.0.1)
|
|
||||||
sunspot_rails
|
|
||||||
sunspot_rails (1.3.3)
|
|
||||||
nokogiri
|
|
||||||
sunspot (= 1.3.3)
|
|
||||||
sunspot_solr (1.3.3)
|
|
||||||
syslog-logger (1.6.8)
|
|
||||||
terminal-table (1.4.5)
|
|
||||||
thor (0.17.0)
|
|
||||||
tilt (1.3.3)
|
|
||||||
tinymce-rails (3.5.8)
|
|
||||||
railties (>= 3.1.1)
|
|
||||||
treetop (1.4.12)
|
|
||||||
polyglot
|
|
||||||
polyglot (>= 0.3.1)
|
|
||||||
tzinfo (0.3.35)
|
|
||||||
uglifier (1.3.0)
|
|
||||||
execjs (>= 0.3.0)
|
|
||||||
multi_json (~> 1.0, >= 1.0.2)
|
|
||||||
vegas (0.1.11)
|
|
||||||
rack (>= 1.0.0)
|
|
||||||
warden (1.2.1)
|
|
||||||
rack (>= 1.0)
|
|
||||||
watchr (0.7)
|
|
||||||
websocket (1.0.7)
|
|
||||||
xpath (1.0.0)
|
|
||||||
nokogiri (~> 1.3)
|
|
||||||
|
|
||||||
PLATFORMS
|
|
||||||
ruby
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
brakeman
|
|
||||||
bson_ext
|
|
||||||
capybara
|
|
||||||
carrierwave
|
|
||||||
carrierwave-mongoid
|
|
||||||
chinese_pinyin (= 0.4.1)
|
|
||||||
coffee-rails
|
|
||||||
database_cleaner
|
|
||||||
debugger
|
|
||||||
delorean
|
|
||||||
devise (= 1.5.3)
|
|
||||||
exception_notification
|
|
||||||
execjs
|
|
||||||
factory_girl_rails
|
|
||||||
faker
|
|
||||||
fb_graph
|
|
||||||
impressionist!
|
|
||||||
jquery-rails (= 2.1.4)
|
|
||||||
jquery-ui-rails
|
|
||||||
kaminari!
|
|
||||||
mime-types
|
|
||||||
mini_magick
|
|
||||||
mongo_session_store-rails3 (= 3.0.6)
|
|
||||||
mongoid (> 2.1, < 3.0.0)
|
|
||||||
mongoid-encryptor
|
|
||||||
mongoid-tree
|
|
||||||
net-ldap (~> 0.3.1)
|
|
||||||
nokogiri
|
|
||||||
progress_bar
|
|
||||||
pry
|
|
||||||
pry-debugger
|
|
||||||
pry-remote
|
|
||||||
pry-stack_explorer
|
|
||||||
rack-gridfs
|
|
||||||
radius
|
|
||||||
rails (~> 3.2.9)
|
|
||||||
rake
|
|
||||||
redis (>= 2.1.1)
|
|
||||||
redis-namespace
|
|
||||||
redis-search
|
|
||||||
resque
|
|
||||||
resque-restriction
|
|
||||||
resque-scheduler
|
|
||||||
rmmseg-cpp-huacnlee (= 0.2.9)
|
|
||||||
rspec (~> 2.0)
|
|
||||||
rspec-rails (~> 2.0)
|
|
||||||
rubyzip
|
|
||||||
sass-rails
|
|
||||||
select2-rails (= 3.3.1)
|
|
||||||
shoulda-matchers
|
|
||||||
simplecov
|
|
||||||
sinatra
|
|
||||||
social-share-button
|
|
||||||
spork
|
|
||||||
sprockets
|
|
||||||
sunspot-rails-tester
|
|
||||||
sunspot_mongo
|
|
||||||
sunspot_solr
|
|
||||||
syslog-logger
|
|
||||||
tinymce-rails
|
|
||||||
uglifier
|
|
||||||
watchr
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
class Admin::MailCronLogsController < OrbitBackendController
|
||||||
|
|
||||||
|
layout "new_admin"
|
||||||
|
before_filter :authenticate_user!
|
||||||
|
before_filter :is_admin?
|
||||||
|
|
||||||
|
def index
|
||||||
|
|
||||||
|
# @mail_cron_logs = MailCronLog.all.desc(:created_at).page(params[:page_main] ).per('20')
|
||||||
|
@mail_cron_logs = (params[:sort]) ? get_sorted_and_filtered("mail_cron_log") : get_viewable("mail_cron_log")
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # index.html.erb
|
||||||
|
format.xml { render :xml => @mail_crons }
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@mail_cron_log = MailCronLog.find(params[:id])
|
||||||
|
@mail_cron_log.destroy
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { redirect_to(admin_mail_cron_logs_url) }
|
||||||
|
# format.xml { head :ok }
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete
|
||||||
|
if params[:ids]
|
||||||
|
mail_cron_logs = MailCronLog.any_in(:_id => params[:ids]).destroy_all
|
||||||
|
end
|
||||||
|
redirect_to admin_mail_cron_logs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
class Admin::MailCronsController < OrbitBackendController
|
||||||
|
|
||||||
|
layout "new_admin"
|
||||||
|
before_filter :authenticate_user!
|
||||||
|
before_filter :is_admin?
|
||||||
|
|
||||||
|
def index
|
||||||
|
|
||||||
|
# @mail_crons = MailCron.all.asc(:mail_sentdate).page(params[:page_main] ).per('20')
|
||||||
|
@mail_crons = (params[:sort]) ? get_sorted_and_filtered("mail_cron") : get_viewable("mail_cron")
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # index.html.erb
|
||||||
|
format.xml { render :xml => @mail_crons }
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@mail_cron = MailCron.new
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # new.html.erb
|
||||||
|
format.xml { render :xml => @mail_cron }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@mail_cron = MailCron.new(params[:mail_cron])
|
||||||
|
|
||||||
|
@mail_cron.create_user_id = current_user.id
|
||||||
|
@mail_cron.update_user_id = current_user.id
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
if @mail_cron.save
|
||||||
|
format.html { redirect_to(admin_mail_crons_url) }
|
||||||
|
format.xml { render :xml => @mail_cron, :status => :created, :location => @mail_cron }
|
||||||
|
else
|
||||||
|
format.html { render :action => "new" }
|
||||||
|
format.xml { render :xml => @mail_cron.errors, :status => :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@mail_cron = MailCron.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@datas = MailCron.where(:mail_sentdate.lte => Time.now, :mail_sent => false)
|
||||||
|
|
||||||
|
@datas.each do |mail_data|
|
||||||
|
|
||||||
|
@mail_j = 0
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
@mails = mail_data.mail_to.split(",")
|
||||||
|
|
||||||
|
@mails.each do |send_mail|
|
||||||
|
|
||||||
|
@read_mails << send_mail
|
||||||
|
|
||||||
|
@mail_j += 1
|
||||||
|
|
||||||
|
if 0 == @mail_j % 30
|
||||||
|
MailCronMailer.cron_mail( mail_data.id, @read_mails.join(',') ).deliver
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@read_mails.join(',').blank?
|
||||||
|
MailCronMailer.cron_mail( mail_data.id, @read_mails.join(',') ).deliver
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
@mail_cron = MailCron.find(params[:id])
|
||||||
|
|
||||||
|
@mail_cron.update_user_id = current_user.id
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
if @mail_cron.update_attributes(params[:mail_cron])
|
||||||
|
format.html { redirect_to(admin_mail_crons_url) }
|
||||||
|
format.js { render 'toggle_enable' }
|
||||||
|
format.xml { head :ok }
|
||||||
|
else
|
||||||
|
format.html { render :action => "edit" }
|
||||||
|
format.xml { render :xml => @mail_cron.errors, :status => :unprocessable_entity }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@mail_cron = MailCron.find(params[:id])
|
||||||
|
@mail_cron.destroy
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { redirect_to(admin_mail_crons_url) }
|
||||||
|
# format.xml { head :ok }
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def delete
|
||||||
|
if params[:ids]
|
||||||
|
mail_crons = MailCron.any_in(:_id => params[:ids]).destroy_all
|
||||||
|
end
|
||||||
|
redirect_to admin_mail_crons_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
end
|
||||||
@@ -40,9 +40,13 @@ class DefaultWidgetController< OrbitWidgetController
|
|||||||
|
|
||||||
def default_widget
|
def default_widget
|
||||||
@search = params["search_query"].blank? ? false : true
|
@search = params["search_query"].blank? ? false : true
|
||||||
if !params[:id].blank?
|
if !params[:id].blank? and !params["clicked_field_name"].blank?
|
||||||
clicked_field_name = params["clicked_field_name"].to_sym
|
clicked_field_name = params["clicked_field_name"].to_sym
|
||||||
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||||
|
elsif !params[:id].blank? and params["preview"]
|
||||||
|
clicked_field_name = :title
|
||||||
|
@preview_pages = @page_part.module_app.widget_fields_link_method.find_all{|t| t[1].has_key?(:preview)}.collect{|t| t[0]}
|
||||||
|
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[clicked_field_name][:method]}('#{params[:id]}', {preview: true,inner: #{params[:inner] || true},clicked_field_name: '#{@preview_pages.first.to_s}'})")
|
||||||
else
|
else
|
||||||
@tag_class = nil
|
@tag_class = nil
|
||||||
@default_widget = @page_part.module_app.get_default_widget
|
@default_widget = @page_part.module_app.get_default_widget
|
||||||
|
|||||||
@@ -7,4 +7,10 @@ class OrbitFrontendComponentController< ApplicationController
|
|||||||
@app_title = request.fullpath.split('/')[2]
|
@app_title = request.fullpath.split('/')[2]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delay_impressionist(item)
|
||||||
|
user_id = current_user.nil? ? nil : current_user.id
|
||||||
|
Resque.enqueue(DelayedImpressionist,:request=>DelayImpressionistRequest.new(request),:obj=>item,:class=>item.class.to_s,:controller_name=>controller_name,:action_name=>action_name,:user=>user_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -44,29 +44,13 @@ class PagesController < ApplicationController
|
|||||||
# render :file => "#{Rails.root}/public/404.html", :status => :not_found
|
# render :file => "#{Rails.root}/public/404.html", :status => :not_found
|
||||||
#end
|
#end
|
||||||
end
|
end
|
||||||
|
|
||||||
def convert_array_param(key,array)
|
|
||||||
array.collect{|t| "#{key}[]=#{t}"}.join("&")
|
|
||||||
end
|
|
||||||
|
|
||||||
def index_from_link
|
def index_from_link
|
||||||
url = "/#{@item.path}"
|
url = "/#{@item.path}"
|
||||||
options = ''
|
options = ''
|
||||||
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
|
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].blank?
|
||||||
|
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('category_id', params[:category_id])}" unless params[:category_id].blank?
|
||||||
if params[:category_id].is_a? Array
|
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id', params[:tag_id])}" unless params[:tag_id].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('category_id',params[:category_id])}" unless params[:category_id].blank?
|
|
||||||
elsif params[:category_id].is_a? String
|
|
||||||
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
|
||||||
end
|
|
||||||
|
|
||||||
if params[:tag_id].is_a? Array
|
|
||||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
|
||||||
elsif params[:category_id].is_a? String
|
|
||||||
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
||||||
uri = URI::escape(url + options)
|
uri = URI::escape(url + options)
|
||||||
@@ -78,8 +62,8 @@ class PagesController < ApplicationController
|
|||||||
url = "/#{@item.path}"
|
url = "/#{@item.path}"
|
||||||
options = ''
|
options = ''
|
||||||
options << "#{options.blank? ? '?' : '&'}id=#{params[:id]}" unless params[:id].blank?
|
options << "#{options.blank? ? '?' : '&'}id=#{params[:id]}" unless params[:id].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('category_id', params[:category_id])}" unless params[:category_id].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id', params[:tag_id])}" unless params[:tag_id].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
options << "#{options.blank? ? '?' : '&'}controller_action=#{params[:controller_action]}" unless params[:controller_action].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
options << "#{options.blank? ? '?' : '&'}clicked_field_name=#{params[:clicked_field_name]}" unless params[:clicked_field_name].blank?
|
||||||
@@ -98,23 +82,43 @@ class PagesController < ApplicationController
|
|||||||
elsif params[:same_page_id]
|
elsif params[:same_page_id]
|
||||||
@item = Item.find(params[:same_page_id])
|
@item = Item.find(params[:same_page_id])
|
||||||
else
|
else
|
||||||
category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
category_ids = Array(params[:category_id]) unless params[:category_id].nil?
|
||||||
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
tag_ids = Array(params[:tag_id]) unless params[:tag_id].nil?
|
||||||
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
|
||||||
|
|
||||||
|
default_query = { is_published: true, module_app_id: module_app.id, :app_frontend_url.in => [params[:app_action], 'default_widget'] }
|
||||||
|
specific_categories = { :category => category_ids }
|
||||||
|
in_categories = { :category.in => category_ids }
|
||||||
|
nil_categories = { :category.in => [nil, []] }
|
||||||
|
specific_tags = { :tag => tag_ids }
|
||||||
|
in_tags = { :tag.in => tag_ids }
|
||||||
|
nil_tags = { :tag.in => [nil, []] }
|
||||||
|
|
||||||
if !category_ids.blank? && !tag_ids.blank?
|
if !category_ids.blank? && !tag_ids.blank?
|
||||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => tag_ids})
|
@item = Item.where(default_query.merge(specific_categories).merge(specific_tags)).first
|
||||||
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category.in => category_ids, :tag.in => [nil, []]}) unless @item
|
@item = Item.where(default_query.merge(specific_categories).merge(in_tags)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(specific_tags).merge(in_categories)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(in_categories).merge(in_tags)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
||||||
elsif !category_ids.blank?
|
elsif !category_ids.blank?
|
||||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :category.in => category_ids).any_in(tag: [nil, []]).first
|
@item = Item.where(default_query.merge(specific_categories).merge(nil_tags)).first
|
||||||
|
@item = Item.where(default_query.merge(specific_categories)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(in_categories).merge(nil_tags)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(in_categories)).first unless @item
|
||||||
elsif !tag_ids.blank?
|
elsif !tag_ids.blank?
|
||||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action], :tag.in => tag_ids).any_in(category: [nil, []]).first
|
@item = Item.where(default_query.merge(specific_tags).merge(nil_categories)).first
|
||||||
|
@item = Item.where(default_query.merge(specific_tags)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(in_tags).merge(nil_categories)).first unless @item
|
||||||
|
@item = Item.where(default_query.merge(in_tags)).first unless @item
|
||||||
end
|
end
|
||||||
@item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
@item = Item.find(params[:orig_page]) unless @item || params[:orig_page].blank?
|
||||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).all_of("tag" => {"$in" => [nil, []]},"category" => { "$in" => [nil, []]}).first unless @item
|
@item = Item.where(default_query.merge(nil_categories).merge(nil_tags)).first unless @item
|
||||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').first unless @item
|
@item = Item.where(default_query).first unless @item
|
||||||
@item = Item.where(module_app_id: module_app.id, app_frontend_url: params[:app_action]).first unless @item
|
|
||||||
end
|
end
|
||||||
raise PageError,'Missing Frontend Page' if @item.nil?
|
raise PageError, 'Missing Frontend Page' if @item.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
def save_from_no_lang_for_page
|
def save_from_no_lang_for_page
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
include OrbitApp::Module::VisitorCounter
|
||||||
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
|
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
|
||||||
|
|
||||||
|
|
||||||
@@ -7,8 +7,10 @@ module ApplicationHelper
|
|||||||
request.referer.include?('?') ? [request.referer,param_hash.to_param].join('&') : [request.referer,param_hash.to_param].join('?')
|
request.referer.include?('?') ? [request.referer,param_hash.to_param].join('&') : [request.referer,param_hash.to_param].join('?')
|
||||||
end
|
end
|
||||||
|
|
||||||
def delayed_impressionist(object)
|
def delayed_impressionist(item)
|
||||||
# Resque.enqueue_at(1.minute.from_now,DelayedImpressionist,object)
|
user_id = current_user.nil? ? nil : current_user.id
|
||||||
|
request = DelayImpressionistRequest.new(request)
|
||||||
|
Resque.enqueue(DelayedImpressionist,:request=>request,:obj=>item,:class=>item.class.to_s,:controller_name=>controller_name,:action_name=>action_name,:user=>user_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_user_role_enable(attribute_fields)
|
def check_user_role_enable(attribute_fields)
|
||||||
@@ -242,25 +244,27 @@ module ApplicationHelper
|
|||||||
"#{t(:view_count)}: #{object.view_count}"
|
"#{t(:view_count)}: #{object.view_count}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_visitors(options={})
|
# def display_visitors(options={})
|
||||||
Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
|
# # Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
|
||||||
end
|
# impressions = Impression.where(options).and(:referrer.ne => nil)
|
||||||
|
# impressions.map{|i| i[:session_hash]}.uniq.count
|
||||||
|
# end
|
||||||
|
|
||||||
def display_visitors_today
|
# def display_visitors_today
|
||||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
|
# display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
|
||||||
end
|
# end
|
||||||
|
|
||||||
def display_visitors_this_week
|
# def display_visitors_this_week
|
||||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
|
# display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
|
||||||
end
|
# end
|
||||||
|
|
||||||
def display_visitors_this_month
|
# def display_visitors_this_month
|
||||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
|
# display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
|
||||||
end
|
# end
|
||||||
|
|
||||||
def display_visitors_this_year
|
# def display_visitors_this_year
|
||||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
|
# display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
|
||||||
end
|
# end
|
||||||
|
|
||||||
def display_date_time(object)
|
def display_date_time(object)
|
||||||
object.strftime("%Y-%m-%d %H:%M")
|
object.strftime("%Y-%m-%d %H:%M")
|
||||||
@@ -311,4 +315,8 @@ module ApplicationHelper
|
|||||||
link_to title, params.merge({direction: direction, sort: column, sort_options: column}), {:class => "#{css_class} sortable", :remote => options[:remote]}
|
link_to title, params.merge({direction: direction, sort: column, sort_options: column}), {:class => "#{css_class} sortable", :remote => options[:remote]}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def convert_array_param(key, array)
|
||||||
|
Array(array).collect{|t| "#{key}[]=#{t}"}.join("&")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -3,6 +3,13 @@ module DefaultWidgetHelper
|
|||||||
I18n.t("#{@page_part.module_app.key}.default_widget.#{field}")
|
I18n.t("#{@page_part.module_app.key}.default_widget.#{field}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_top_hot_class(row_data)
|
||||||
|
class_attr = []
|
||||||
|
class_attr << 'data_is_hot' if( row_data.is_hot? rescue false )
|
||||||
|
class_attr << 'data_is_top' if( row_data.is_top? rescue false)
|
||||||
|
return class_attr.join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
def link_to_field(row_data,field, switch, options=nil)
|
def link_to_field(row_data,field, switch, options=nil)
|
||||||
method_ary = @page_part.module_app.widget_fields_link_method
|
method_ary = @page_part.module_app.widget_fields_link_method
|
||||||
field = field.to_sym
|
field = field.to_sym
|
||||||
@@ -77,4 +84,13 @@ module DefaultWidgetHelper
|
|||||||
content_tag(:span,get_display(row_data,field_setting),:class=>field_setting[:class])
|
content_tag(:span,get_display(row_data,field_setting),:class=>field_setting[:class])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_row_category(row_data)
|
||||||
|
row_data.send("#{row_data.class.to_s.underscore}_category_id") rescue nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_row_tags(row_data)
|
||||||
|
row_data.tagged_ids rescue nil
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1,36 +1,21 @@
|
|||||||
class DashboardCounter < Resque::Plugins::RestrictionJob
|
class DashboardCounter < Resque::Plugins::RestrictionJob
|
||||||
|
extend OrbitApp::Module::VisitorCounterEval
|
||||||
|
|
||||||
@queue = :high
|
@queue = :high
|
||||||
|
|
||||||
def self.perform(*args)
|
def self.perform(*args)
|
||||||
site = Site.first
|
site = Site.first
|
||||||
obj = new(*args)
|
obj = new(*args)
|
||||||
site.dashboard_counter[:visitors_this_week] = obj.display_visitors_this_week
|
site.visitor_counters[:total] = display_visitors
|
||||||
site.dashboard_counter[:visitors_this_month] = obj.display_visitors_this_month
|
site.visitor_counters[:today] = display_visitors_today
|
||||||
site.dashboard_counter[:visitors_this_year] = obj.display_visitors_this_year
|
site.visitor_counters[:this_week] = display_visitors_this_week
|
||||||
|
site.visitor_counters[:this_month] = display_visitors_this_month
|
||||||
|
site.visitor_counters[:this_year] = display_visitors_this_year
|
||||||
site.save
|
site.save
|
||||||
OrbitLogger.info "DashboardCounter done #{site.dashboard_counter.to_s}"
|
OrbitLogger.info "DashboardCounter done #{site.visitor_counters.to_s}"
|
||||||
end
|
|
||||||
|
|
||||||
|
#Notice this is mainly used at user dashbroad. however the code there is currentlly using realtime evaluation.
|
||||||
def display_visitors(options={})
|
#and the site model will need a field call dashboard_counter to complete this job.
|
||||||
impressions = Impression.where(options).and(:referrer.ne => nil)
|
|
||||||
impressions.map{|i| i[:session_hash]}.uniq.count
|
|
||||||
end
|
|
||||||
|
|
||||||
def display_visitors_today
|
|
||||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
|
|
||||||
end
|
|
||||||
|
|
||||||
def display_visitors_this_week
|
|
||||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
|
|
||||||
end
|
|
||||||
|
|
||||||
def display_visitors_this_month
|
|
||||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
|
|
||||||
end
|
|
||||||
|
|
||||||
def display_visitors_this_year
|
|
||||||
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1,7 +1,45 @@
|
|||||||
class DelayedImpressionist
|
class DelayedImpressionist
|
||||||
@queue = :low
|
def self.before_filter(*args)
|
||||||
def self.perform(object)
|
return
|
||||||
impressionist(object)
|
end
|
||||||
true
|
|
||||||
end
|
include ImpressionistController::InstanceMethods
|
||||||
|
@queue = :low
|
||||||
|
|
||||||
|
def initialize(request,controller_name,action_name,user,obj)
|
||||||
|
@controller_name = controller_name
|
||||||
|
@action_name = action_name
|
||||||
|
@user = User.find user unless user.nil?
|
||||||
|
@request = request
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.perform(*args)
|
||||||
|
arg = args[0]
|
||||||
|
@request= DelayImpressionistRequest.new
|
||||||
|
@request.restore(arg["request"])
|
||||||
|
request = @request
|
||||||
|
obj = eval("#{arg["class"]}.find '#{arg['obj']['_id']}'")
|
||||||
|
# imp = new(@request,arg["controller_name"],arg["action_name"],arg["user"],obj)
|
||||||
|
new_impression = obj.impressions.build(:user_id=>arg["user"],:controller_name=>arg["controller_name"],:action_name=>arg["action_name"],:ip_address=>@request.remote_ip,:referrer=>@request.referer)
|
||||||
|
new_impression.save
|
||||||
|
obj.update_attribute(:view_count,obj.impression_count)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def user
|
||||||
|
@user
|
||||||
|
end
|
||||||
|
|
||||||
|
def action_name
|
||||||
|
@action_name
|
||||||
|
end
|
||||||
|
|
||||||
|
def controller_name
|
||||||
|
@controller_name
|
||||||
|
end
|
||||||
|
|
||||||
|
def request
|
||||||
|
@request
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
class EmailCron
|
||||||
|
@queue = :mail
|
||||||
|
|
||||||
|
def self.perform
|
||||||
|
|
||||||
|
@datas = MailCron.where(:mail_sentdate.lte => Time.now)
|
||||||
|
|
||||||
|
@datas.each do |mail_data|
|
||||||
|
|
||||||
|
@mail_j = 0
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
@mails = mail_data.mail_to.split(",")
|
||||||
|
|
||||||
|
@mails.each do |send_mail|
|
||||||
|
|
||||||
|
@read_mails << send_mail
|
||||||
|
|
||||||
|
@mail_j += 1
|
||||||
|
|
||||||
|
if 0 == @mail_j % 30
|
||||||
|
MailCronMailer.cron_mail( mail_data.id, @read_mails.join(',') ).deliver
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@read_mails.join(',').blank?
|
||||||
|
MailCronMailer.cron_mail( mail_data.id, @read_mails.join(',') ).deliver
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
@@ -3,7 +3,7 @@ class UpdateTagCloud
|
|||||||
|
|
||||||
def self.perform()
|
def self.perform()
|
||||||
Tag.all.each do |tag|
|
Tag.all.each do |tag|
|
||||||
tag.update_attribute(:cloud_view_count, tag.impressionist_count(:created_at.gte => 14.days.ago, :created_at.lte => Time.now))
|
tag.update_attribute(:cloud_view_count, tag.get_impressionist)
|
||||||
end
|
end
|
||||||
OrbitLogger.info "UpdateTagCloud Done"
|
OrbitLogger.info "UpdateTagCloud Done"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
class MailCronMailer < ActionMailer::Base
|
||||||
|
default :from => "orbit_test@rulingcom.com"
|
||||||
|
|
||||||
|
def get_settings
|
||||||
|
|
||||||
|
@site = Site.first
|
||||||
|
|
||||||
|
@smtp_settings = {
|
||||||
|
:address => @site['site_settings']['address'],
|
||||||
|
:port => @site['site_settings']['port'],
|
||||||
|
:domain => @site['site_settings']['domain'],
|
||||||
|
:authentication => @site['site_settings']['authentication'],
|
||||||
|
# :user_name => @site['site_settings']['user_name'],
|
||||||
|
# :password => @site['site_settings']['password'],
|
||||||
|
:tls => (@site['site_settings']['tls'] == '0' ? false : true ) ,
|
||||||
|
:enable_starttls_auto => (@site['site_settings']['enable_starttls_auto'] == '0' ? false : true )
|
||||||
|
}
|
||||||
|
|
||||||
|
if !@site['site_settings']['user_name'].blank?
|
||||||
|
@smtp_settings[:user_name] = @site['site_settings']['user_name']
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@site['site_settings']['password'].blank?
|
||||||
|
@smtp_settings[:password] = @site['site_settings']['password']
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
ActionMailer::Base.smtp_settings = @smtp_settings
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def cron_mail( data_id, group_mail )
|
||||||
|
|
||||||
|
get_settings
|
||||||
|
|
||||||
|
@data = MailCron.find(data_id)
|
||||||
|
|
||||||
|
if @data
|
||||||
|
|
||||||
|
@user = User.find(@data.create_user_id)
|
||||||
|
|
||||||
|
if !@data.mail_cron_files.blank?
|
||||||
|
@data.mail_cron_files.each_with_index do |mail_cron_file, i|
|
||||||
|
file_type = File.extname(mail_cron_file.file.to_s)
|
||||||
|
file_content = Mongo::GridFileSystem.new(Mongoid.database).open(mail_cron_file.file.url.gsub("/gridfs/", "").force_encoding("UTF-8"), 'r')
|
||||||
|
attachments["#{mail_cron_file.title}#{file_type}"] = file_content.read
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@data.mail_content["text"].blank?
|
||||||
|
mail( :from => @data.mail_from, :reply_to => @data.mail_reply_to, :bcc => group_mail, :subject => @data.mail_subject ) do |format|
|
||||||
|
format.html { render :text => @data.mail_content["text"] }
|
||||||
|
end
|
||||||
|
elsif !@data.mail_content["template"].blank?
|
||||||
|
mail( :from => @data.mail_from, :reply_to => @data.mail_reply_to, :bcc => group_mail, :subject => @data.mail_subject ) do |format|
|
||||||
|
format.html { render :template => @data.mail_content["template"], :collection => @data.mail_content }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@mail_cron_log = {
|
||||||
|
:mail_subject => @data.mail_subject,
|
||||||
|
:mail_to => group_mail,
|
||||||
|
:mail_user => @user.name,
|
||||||
|
:mailer_count => group_mail.split(",").size,
|
||||||
|
:mail_from_app => @data.mail_from_app
|
||||||
|
}
|
||||||
|
|
||||||
|
@mail_cron_log = MailCronLog.new(@mail_cron_log)
|
||||||
|
|
||||||
|
|
||||||
|
@mail_cron_log.save
|
||||||
|
|
||||||
|
@data.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
class MailCron
|
||||||
|
|
||||||
|
include Mongoid::Document
|
||||||
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
|
|
||||||
|
field :mail_from_app
|
||||||
|
field :mail_from
|
||||||
|
field :mail_to
|
||||||
|
field :mail_reply_to
|
||||||
|
field :mail_subject
|
||||||
|
field :mail_content, :type => Hash
|
||||||
|
field :mail_sentdate , :type => DateTime
|
||||||
|
|
||||||
|
field :create_user_id
|
||||||
|
field :update_user_id
|
||||||
|
|
||||||
|
has_many :mail_cron_files, :autosave => true, :dependent => :destroy
|
||||||
|
|
||||||
|
accepts_nested_attributes_for :mail_cron_files, :allow_destroy => true
|
||||||
|
|
||||||
|
after_save :save_mail_cron_files
|
||||||
|
|
||||||
|
|
||||||
|
def save_mail_cron_files
|
||||||
|
self.mail_cron_files.each do |t|
|
||||||
|
if t.should_destroy
|
||||||
|
t.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.send_mail_now(mail_cron_id)
|
||||||
|
|
||||||
|
mail_data = MailCron.find(mail_cron_id)
|
||||||
|
|
||||||
|
if !mail_data.blank?
|
||||||
|
|
||||||
|
@mail_j = 0
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
@mails = mail_data.mail_to.split(",")
|
||||||
|
|
||||||
|
@mails.each do |send_mail|
|
||||||
|
|
||||||
|
@read_mails << send_mail
|
||||||
|
|
||||||
|
@mail_j += 1
|
||||||
|
|
||||||
|
if 0 == @mail_j % 30
|
||||||
|
MailCronMailer.cron_mail( mail_data.id, @read_mails.join(',') ).deliver
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
if !@read_mails.join(',').blank?
|
||||||
|
MailCronMailer.cron_mail( mail_data.id, @read_mails.join(',') ).deliver
|
||||||
|
@read_mails = Array.new
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
class MailCronFile
|
||||||
|
|
||||||
|
include Mongoid::Document
|
||||||
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
|
mount_uploader :file, AssetUploader
|
||||||
|
|
||||||
|
field :should_destroy, :type => Boolean
|
||||||
|
field :title
|
||||||
|
|
||||||
|
belongs_to :mail_cron
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
class MailCronLog
|
||||||
|
|
||||||
|
include Mongoid::Document
|
||||||
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
|
|
||||||
|
field :mail_subject
|
||||||
|
field :mail_to
|
||||||
|
field :mail_user
|
||||||
|
field :mailer_count
|
||||||
|
field :mail_from_app
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
@@ -140,7 +140,7 @@ class ModuleApp
|
|||||||
def sorted_tags_for_cloud
|
def sorted_tags_for_cloud
|
||||||
temp_tags = {}
|
temp_tags = {}
|
||||||
self.tags.each{ |tag|
|
self.tags.each{ |tag|
|
||||||
temp_tags.merge!({tag => Tag.get_impressionist(tag)})
|
temp_tags.merge!({tag => tag.cloud_view_count})
|
||||||
}
|
}
|
||||||
if !temp_tags.blank?
|
if !temp_tags.blank?
|
||||||
sorted_tags = temp_tags.sort{|a,b| a[1]<=>b[1]}.reverse
|
sorted_tags = temp_tags.sort{|a,b| a[1]<=>b[1]}.reverse
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ class Page < Item
|
|||||||
include Impressionist::Impressionable
|
include Impressionist::Impressionable
|
||||||
include ParserFrontEnd
|
include ParserFrontEnd
|
||||||
|
|
||||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
is_impressionable #:counter_cache => { :column_name => :view_count }
|
||||||
|
|
||||||
field :content, localize: true
|
field :content, localize: true
|
||||||
field :app_frontend_url
|
field :app_frontend_url
|
||||||
|
|||||||
@@ -51,8 +51,9 @@ class PrototypeAuth
|
|||||||
end
|
end
|
||||||
|
|
||||||
def remove_operation(item,obj)
|
def remove_operation(item,obj)
|
||||||
if (self.send item).include? obj
|
item = (item.to_s.singularize == item.to_s) ? "#{item.to_s}_id" : "#{item.to_s.singularize}_ids"
|
||||||
(self.send item).delete obj
|
if (self.send item).include? obj.id
|
||||||
|
(self.send item).delete obj.id
|
||||||
self.save!
|
self.save!
|
||||||
else
|
else
|
||||||
false #should put error message for user not existed in list
|
false #should put error message for user not existed in list
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class Site
|
|||||||
field :title_always_on, :type => Boolean, :default => false
|
field :title_always_on, :type => Boolean, :default => false
|
||||||
field :dashbroad_allow_visitor, :type => Boolean, :default => false
|
field :dashbroad_allow_visitor, :type => Boolean, :default => false
|
||||||
field :mail_settings, :type => Hash
|
field :mail_settings, :type => Hash
|
||||||
|
field :visitor_counters,:type=> Hash,:default=>{:total=>0,:today=>0,:this_week=>0,:this_month=>0,:this_year=>0}
|
||||||
|
|
||||||
field :disk_space, :type => String
|
field :disk_space, :type => String
|
||||||
field :system_package_info, :type => Hash,:default=>{}
|
field :system_package_info, :type => Hash,:default=>{}
|
||||||
|
|||||||
+1
-25
@@ -8,7 +8,7 @@ class Tag
|
|||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
include Impressionist::Impressionable
|
include Impressionist::Impressionable
|
||||||
|
|
||||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
is_impressionable #:counter_cache => { :column_name => :view_count }
|
||||||
|
|
||||||
field :name, localize: true
|
field :name, localize: true
|
||||||
field :view_count, :type => Integer, :default => 0
|
field :view_count, :type => Integer, :default => 0
|
||||||
@@ -17,30 +17,6 @@ class Tag
|
|||||||
belongs_to :module_tag, polymorphic: true
|
belongs_to :module_tag, polymorphic: true
|
||||||
has_many :taggings, dependent: :destroy
|
has_many :taggings, dependent: :destroy
|
||||||
|
|
||||||
#field :cloud_amper,:type: Integer,:default=> 0
|
|
||||||
|
|
||||||
# def self.sorted_for_cloud
|
|
||||||
# tags = {}
|
|
||||||
# self.all.each{ |tag|
|
|
||||||
# tags.merge!({tag => self.get_impressionist(tag)})
|
|
||||||
# }
|
|
||||||
# if !tags.blank?
|
|
||||||
# sorted_tags = tags.sort{|a,b| a[1]<=>b[1]}.reverse
|
|
||||||
# sorted_tags[0][1] = :hot1
|
|
||||||
# offset = (sorted_tags.size - 1) / 3
|
|
||||||
# i = 1
|
|
||||||
# class_i = 2
|
|
||||||
# sorted_tags[1..-1].collect!{ |x|
|
|
||||||
# x[1] = "hot#{class_i}"
|
|
||||||
# i == offset ? i = 1 : i += 1 if class_i < 4
|
|
||||||
# class_i += 1 if i == offset && class_i < 4
|
|
||||||
# }
|
|
||||||
# sorted_tags
|
|
||||||
# else
|
|
||||||
# []
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def self.get_impressionist(item_tag = self)
|
def self.get_impressionist(item_tag = self)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class User
|
|||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :validatable #, :timeoutable
|
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable #, :timeoutable
|
||||||
|
|
||||||
mount_uploader :avatar, AvatarUploader
|
mount_uploader :avatar, AvatarUploader
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,5 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="form-actions form-fixed pagination-right">
|
<div class="form-actions form-fixed pagination-right">
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:add), new_admin_design_path, :class => 'btn btn-primary pull-right' %>
|
|
||||||
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:upload), upload_package_admin_designs_path, :class => 'btn btn-primary pull-right' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:upload), upload_package_admin_designs_path, :class => 'btn btn-primary pull-right' %>
|
||||||
</div>
|
</div>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="filter-clear">
|
||||||
|
<%= link_to content_tag(:i, nil, :class => 'icons-cycle') + t(:clear), admin_mail_crons_path(:filter => @filter, :sort => params[:sort], :direction => params[:direction], :clear => true, :type => type), :class => "btn btn-small js_history" %>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<div id="filter" class="subnav">
|
||||||
|
<div class="filters">
|
||||||
|
<div id="sort_headers" class="table-label">
|
||||||
|
<%= render 'sort_headers' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% content_for :page_specific_javascript do %>
|
||||||
|
<%= javascript_include_tag "sort_header" %>
|
||||||
|
<% end %>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<tr id="<%= dom_id mail_cron_log %>" class="with_action">
|
||||||
|
<td class="span1">
|
||||||
|
<% if is_manager? %>
|
||||||
|
<%= check_box_tag 'to_delete[]', mail_cron_log.id, false, :class => "checkbox_in_list" %>
|
||||||
|
<% end -%>
|
||||||
|
</td>
|
||||||
|
<td class="span1-2">
|
||||||
|
<%= mail_cron_log.mail_subject %>
|
||||||
|
<div class="quick-edit">
|
||||||
|
<ul class="nav nav-pills hide">
|
||||||
|
<%if at_least_module_manager %>
|
||||||
|
<li><%= link_to t(:delete_), admin_mail_cron_log_path(mail_cron_log), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
|
||||||
|
<% end -%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="span2">
|
||||||
|
<%= mail_cron_log.mail_to.gsub(/,/, "<br />").html_safe %>
|
||||||
|
</td>
|
||||||
|
<td class="span2">
|
||||||
|
<%= mail_cron_log.mail_user %>
|
||||||
|
</td>
|
||||||
|
<td class="span2">
|
||||||
|
<%= mail_cron_log.mail_from_app %>
|
||||||
|
</td>
|
||||||
|
<td class="span2">
|
||||||
|
<%= display_date_time(mail_cron_log.created_at) %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<%= render_sort_bar(true, delete_admin_mail_cron_logs_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
|
||||||
|
['subject', 'mail_subject','span2', :subject] ,
|
||||||
|
['mail_to', 'mail_to','span2', :mail_to] ,
|
||||||
|
['mail_user', 'mail_user','span2', :mail_user] ,
|
||||||
|
['mail_from_app', 'mail_from_app','span2', :mail_from_app] ,
|
||||||
|
['sentdate', 'created_at','span2', :sentdate] ).html_safe %>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
$("#<%= dom_id @mail_cron_log %>").remove();
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<% content_for :side_bar do %>
|
||||||
|
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= render 'filter' %>
|
||||||
|
<table class="table main-list">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="span1"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="tbody_mail_cron_logs" class="sort-holder">
|
||||||
|
<%= render :partial => "mail_cron_log",:collection=> @mail_cron_logs%>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-actions form-fixed pagination-right">
|
||||||
|
<div id="web_link_pagination" class="paginationFixed">
|
||||||
|
<%= paginate @mail_cron_logs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
$("#delete_all").attr("action", "<%= delete_admin_mail_cron_logs_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]) %>");
|
||||||
|
$("#sort_headers").html("<%= j render 'sort_headers' %>");
|
||||||
|
$("#tbody_mail_cron_logs").html("<%= j render :partial => 'mail_cron_log', :collection => @mail_cron_logs %>");
|
||||||
|
$("#mail_cron_log_pagination").html("<%= j paginate @mail_cron_logs, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="filter-clear">
|
||||||
|
<%= link_to content_tag(:i, nil, :class => 'icons-cycle') + t(:clear), admin_mail_crons_path(:filter => @filter, :sort => params[:sort], :direction => params[:direction], :clear => true, :type => type), :class => "btn btn-small js_history" %>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<div id="filter" class="subnav">
|
||||||
|
<div class="filters">
|
||||||
|
<div id="sort_headers" class="table-label">
|
||||||
|
<%= render 'sort_headers' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% content_for :page_specific_javascript do %>
|
||||||
|
<%= javascript_include_tag "sort_header" %>
|
||||||
|
<% end %>
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<div id= "poststuff">
|
||||||
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
|
<%= f.error_messages %>
|
||||||
|
|
||||||
|
<!--Widget start-->
|
||||||
|
|
||||||
|
<div id="sub-wiget">
|
||||||
|
|
||||||
|
<div id="widget-date" class="widget-box widget-size-300">
|
||||||
|
<h3 class="widget-title"><i class="icons-calendar"></i><%= t(:date_) %></h3>
|
||||||
|
<div class="widget-content clear">
|
||||||
|
<div class="control-group">
|
||||||
|
<%= f.datetime_picker :mail_sentdate, :picker_type => 'separated', :label => t(:start) %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!--Wiget End-->
|
||||||
|
<!--Post Start-->
|
||||||
|
|
||||||
|
<div id="post-body">
|
||||||
|
<div id="post-body-content" class="clear">
|
||||||
|
|
||||||
|
<%= f.label :mail_subject ,t(:mail_subject)%>
|
||||||
|
<%= f.text_field :mail_subject %>
|
||||||
|
|
||||||
|
<%= f.label :mail_from ,t(:mail_from)%>
|
||||||
|
<%= f.text_field :mail_from %>
|
||||||
|
|
||||||
|
<%= f.label :mail_reply_to ,t(:mail_reply_to)%>
|
||||||
|
<%= f.text_field :mail_reply_to %>
|
||||||
|
|
||||||
|
<%= f.label :mail_to ,t(:mail_to)%>
|
||||||
|
<%= f.text_field :mail_to %>
|
||||||
|
|
||||||
|
<%= f.label :mail_content ,t(:mail_content)%>
|
||||||
|
<%= f.text_area :mail_content, :class=>"span12", :cols=>"25", :rows=>"10" %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div id='plugin_files' class="plugin_files_block">
|
||||||
|
|
||||||
|
<table class="table table-condensed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>File</th>
|
||||||
|
<th>File Name</th>
|
||||||
|
<th class="span1"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center" colspan="3">
|
||||||
|
<div id='add_plugin_file' class="info_input plugin_files_block">
|
||||||
|
<%= hidden_field_tag 'plugin_file_field_count', @mail_cron.mail_cron_files.count %>
|
||||||
|
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tfoot>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<% @mail_cron.mail_cron_files.each_with_index do |mail_cron_file, i| %>
|
||||||
|
<%= f.fields_for :mail_cron_files, mail_cron_file do |f| %>
|
||||||
|
<%= render :partial => 'form_file', :object => mail_cron_file, :locals => {:f => f, :i => i} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!--Post End-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<%= f.submit t('submit'), :class=>'btn btn-primary' %>
|
||||||
|
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<% content_for :page_specific_javascript do %>
|
||||||
|
<%= javascript_include_tag "archive_plugin_form" %>
|
||||||
|
<script>
|
||||||
|
$('#add_plugin_file a.add').live('click', function(){
|
||||||
|
var new_id = $(this).prev().attr('value');
|
||||||
|
var old_id = new RegExp("new_add_plugin_files", "g");
|
||||||
|
$(this).prev().attr('value', parseInt(new_id) + 1);
|
||||||
|
$(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_file', f, :mail_cron_files) %>").replace(old_id, new_id));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.add_plugin_files_block a.delete').live('click', function(){
|
||||||
|
$(this).parents('.list_item').remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.action a.remove_existing_record').live('click', function(){
|
||||||
|
$(this).next('.should_destroy').attr('value', 1);
|
||||||
|
$("tr#add_plugin_file_" + $(this).prev().attr('value')).hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<% # encoding: utf-8 %>
|
||||||
|
|
||||||
|
<tr id="<%= "plugin_file_#{form_file.id}" if !form_file.new_record? %>" class='list_item'>
|
||||||
|
<td>
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.file_field :file %>
|
||||||
|
<%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
|
||||||
|
<%= f.text_field :title %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<span class="action">
|
||||||
|
<% if form_file.new_record? %>
|
||||||
|
<a class="delete"><i class="icon-remove"></i></a>
|
||||||
|
<% else %>
|
||||||
|
<%= f.hidden_field :id %>
|
||||||
|
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||||
|
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<tr id="<%= dom_id mail_cron %>" class="with_action">
|
||||||
|
<td class="span1">
|
||||||
|
<% if is_manager? %>
|
||||||
|
<%= check_box_tag 'to_delete[]', mail_cron.id, false, :class => "checkbox_in_list" %>
|
||||||
|
<% end -%>
|
||||||
|
</td>
|
||||||
|
<td class="span1-2">
|
||||||
|
<%= mail_cron.mail_subject %>
|
||||||
|
<div class="quick-edit">
|
||||||
|
<ul class="nav nav-pills hide">
|
||||||
|
<%if at_least_module_manager %>
|
||||||
|
<li><%= link_to t(:delete_), admin_mail_cron_path(mail_cron), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
|
||||||
|
<% end -%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="span2">
|
||||||
|
<%= mail_cron.mail_to.gsub(/,/, "<br />").html_safe %>
|
||||||
|
</td>
|
||||||
|
<td class="span2">
|
||||||
|
<%= mail_cron.mail_from_app %>
|
||||||
|
</td>
|
||||||
|
<td class="span2">
|
||||||
|
<%= display_date_time(mail_cron.mail_sentdate) %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<%= render_sort_bar(true, delete_admin_mail_crons_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
|
||||||
|
['subject', 'mail_subject','span2', :mail_subject] ,
|
||||||
|
['mail_to', 'mail_to','span2', :mail_to] ,
|
||||||
|
['mail_from_app', 'mail_from_app','span2', :mail_from_app] ,
|
||||||
|
['sentdate', 'mail_sentdate','span2', :mail_sentdate] ).html_safe %>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
$("#<%= dom_id @mail_cron %>").remove();
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<% content_for :side_bar do %>
|
||||||
|
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<h1><%= t('mail_cron.editing_mail_cron') %></h1>
|
||||||
|
|
||||||
|
<%= form_for @mail_cron, :url => admin_mail_cron_path(@mail_cron), :html => {:class => 'clear'} do |f| %>
|
||||||
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||||
|
<% end %>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<% content_for :side_bar do %>
|
||||||
|
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= render 'filter' %>
|
||||||
|
<table class="table main-list">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="span1"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
<th class="span2"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="tbody_mail_crons" class="sort-holder">
|
||||||
|
<%= render :partial => "mail_cron",:collection=> @mail_crons%>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-actions form-fixed pagination-right">
|
||||||
|
<div id="web_link_pagination" class="paginationFixed">
|
||||||
|
<%= paginate @mail_crons, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
$("#delete_all").attr("action", "<%= delete_admin_mail_crons_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]) %>");
|
||||||
|
$("#sort_headers").html("<%= j render 'sort_headers' %>");
|
||||||
|
$("#tbody_mail_crons").html("<%= j render :partial => 'mail_cron', :collection => @mail_crons %>");
|
||||||
|
$("#mail_cron_pagination").html("<%= j paginate @mail_crons, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
<% content_for :side_bar do %>
|
||||||
|
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div id="poststuff">
|
||||||
|
<h1><%= t('mail_cron.new_mail_cron') %></h1>
|
||||||
|
<%= form_for @mail_cron, :url => admin_mail_crons_path, :html => {:class => 'clear'} do |f| %>
|
||||||
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -9,6 +9,8 @@
|
|||||||
<%#= content_tag :li, link_to(t(:theme), admin_site_ui_theme_path(@site)), :class => active_for_action('sites', 'ui_theme') %>
|
<%#= content_tag :li, link_to(t(:theme), admin_site_ui_theme_path(@site)), :class => active_for_action('sites', 'ui_theme') %>
|
||||||
<%= content_tag :li, link_to(t('sitemap'), admin_site_sitemap_path(@site)), :class => active_for_action('sites', 'sitemap') %>
|
<%= content_tag :li, link_to(t('sitemap'), admin_site_sitemap_path(@site)), :class => active_for_action('sites', 'sitemap') %>
|
||||||
<%= content_tag :li, link_to(t('user_actions'), admin_user_actions_path), :class => active_for_action('user_actions', 'index') %>
|
<%= content_tag :li, link_to(t('user_actions'), admin_user_actions_path), :class => active_for_action('user_actions', 'index') %>
|
||||||
|
<%= content_tag :li, link_to(t('mail.mail_cron'), admin_mail_crons_path), :class => active_for_action('mail_cron', 'index') %>
|
||||||
|
<%= content_tag :li, link_to(t('mail.mail_cron_log'), admin_mail_cron_logs_path), :class => active_for_action('mail_cron_log', 'index') %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
<%= content_tag :div,:class=>@tag_class do%>
|
<%= content_tag :div, class: @tag_class do %>
|
||||||
<div class="default_widget_type_A">
|
<div class="default_widget_type_A">
|
||||||
<table class="default_widget_tb" border="0" cellpadding="0" cellspacing="0" >
|
<table class="default_widget_tb" border="0" cellpadding="0" cellspacing="0" >
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
|
||||||
<% @frontend_field_names.each_with_index do |field,index|%>
|
|
||||||
<%= content_tag(:th,content_tag(:span,get_field_header(field),:class=>@frontend_classes[index]))unless field.blank?%>
|
|
||||||
<% end %>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<% @data.each do |row_data| %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<% @frontend_field_names.each_with_index do |field,index|%>
|
<% @frontend_field_names.each_with_index do |field, index| %>
|
||||||
<%= content_tag(:td,content_tag(:span,link_to_field(row_data,field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s}),:class=>@frontend_classes[index]))unless field.blank?%>
|
<%= content_tag(:th, content_tag(:span, get_field_header(field), class: @frontend_classes[index])) unless field.blank? %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @data.each do |row_data| %>
|
||||||
|
<tr class="<%= get_top_hot_class(row_data) %>">
|
||||||
|
<% @frontend_field_names.each_with_index do |field, index|%>
|
||||||
|
<%= content_tag(:td, content_tag(:span, link_to_field(row_data, field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s, category_id: get_row_category(row_data), tag_id: get_row_tags(row_data)}), class: @frontend_classes[index])) unless field.blank? %>
|
||||||
|
<% end %>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<% end %>
|
</div>
|
||||||
|
<% end %>
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<%= content_tag :div,:class=>@tag_class do%>
|
<%= content_tag :div, class: @tag_class do %>
|
||||||
<ul class="default_widget_list">
|
<ul class="default_widget_list">
|
||||||
<% @data.each do |row_data| %>
|
<% @data.each do |row_data| %>
|
||||||
<%= content_tag(:li) do %>
|
<%= content_tag(:li, class: get_top_hot_class(row_data)) do %>
|
||||||
<div class="img app-pic">
|
<div class="img app-pic">
|
||||||
<%= image_tag row_data.send(@widget_image_field)%>
|
<%= image_tag row_data.send(@widget_image_field) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<% @frontend_field_names.each_with_index do |field,index|%>
|
<% @frontend_field_names.each_with_index do |field, index| %>
|
||||||
<%= content_tag(:span,link_to_field(row_data,field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s}),:class=>@frontend_classes[index]) unless field.blank?%>
|
<%= content_tag(:span, link_to_field(row_data,field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s, category_id: get_row_category(row_data), tag_id: get_row_tags(row_data)}), class: @frontend_classes[index]) unless field.blank? %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<%= content_tag :div,:class=>@tag_class do%>
|
<%= content_tag :div, class: @tag_class do %>
|
||||||
<div class="img app-pic">
|
<div class="img app-pic">
|
||||||
<%= image_tag @data.first.send(@widget_image_field)%>
|
<%= image_tag @data.first.send(@widget_image_field) %>
|
||||||
</div>
|
</div>
|
||||||
<ul class="default_widget_list">
|
<ul class="default_widget_list">
|
||||||
<% @data.each do |row_data| %>
|
<% @data.each do |row_data| %>
|
||||||
<%= content_tag(:li) do %>
|
<%= content_tag(:li, class: get_top_hot_class(row_data)) do %>
|
||||||
<% @frontend_field_names.each_with_index do |field,index|%>
|
<% @frontend_field_names.each_with_index do |field, index|%>
|
||||||
<%= content_tag(:span, link_to_field(row_data,field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s}),:class=>@frontend_classes[index]) unless field.blank?%>
|
<%= content_tag(:span, link_to_field(row_data, field, @frontend_sat_to_links[index], {orig_page: @page_id.to_s, category_id: get_row_category(row_data), tag_id: get_row_tags(row_data)}), class: @frontend_classes[index]) unless field.blank? %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -272,6 +272,8 @@ en:
|
|||||||
setting: Mail settings
|
setting: Mail settings
|
||||||
tls: TLS
|
tls: TLS
|
||||||
user_name: User Name
|
user_name: User Name
|
||||||
|
mail_cron: Scheduled Email
|
||||||
|
mail_cron_log: Email Log
|
||||||
manager: Manager
|
manager: Manager
|
||||||
markup: Markup
|
markup: Markup
|
||||||
markup_options: Markup options
|
markup_options: Markup options
|
||||||
|
|||||||
@@ -272,6 +272,8 @@ zh_tw:
|
|||||||
setting: 電子郵件設定
|
setting: 電子郵件設定
|
||||||
tls: 電子郵件TLS
|
tls: 電子郵件TLS
|
||||||
user_name: 電子郵件帳號
|
user_name: 電子郵件帳號
|
||||||
|
mail_cron: 待寄Email
|
||||||
|
mail_cron_log: Email發送記錄
|
||||||
manager: 管理者
|
manager: 管理者
|
||||||
markup: 輸入模式
|
markup: 輸入模式
|
||||||
markup_options: 標註選項
|
markup_options: 標註選項
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ defaults: &defaults
|
|||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: production_7
|
database: test_site
|
||||||
test:
|
test:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: test_site
|
database: test_site
|
||||||
@@ -21,4 +21,4 @@ production:
|
|||||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
database: demo_site_production
|
database: test_site
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
dashboard_counter_cache:
|
||||||
|
cron: 0 * * * * *
|
||||||
|
class: DashboardCounter
|
||||||
|
args:
|
||||||
|
description: DashboardCounterCache
|
||||||
|
|
||||||
update_tag_cloud:
|
update_tag_cloud:
|
||||||
cron: 0 0 [0,12] * * *
|
cron: 0 0 [0,12] * * *
|
||||||
class: UpdateTagCloud
|
class: UpdateTagCloud
|
||||||
@@ -8,4 +14,10 @@ generate_system_summary:
|
|||||||
cron: 0 0 12 * * *
|
cron: 0 0 12 * * *
|
||||||
class: GenerateSystemSummary
|
class: GenerateSystemSummary
|
||||||
args:
|
args:
|
||||||
description: Generate the system status such as disk free space,package version list for showing at site tab
|
description: Generate the system status such as disk free space,package version list for showing at site tab
|
||||||
|
|
||||||
|
email_cron:
|
||||||
|
cron: 0 0 [10,16,22] * * *
|
||||||
|
class: EmailCron
|
||||||
|
args:
|
||||||
|
description: EmailCron
|
||||||
@@ -29,6 +29,19 @@ Orbit::Application.routes.draw do
|
|||||||
get 'delete'
|
get 'delete'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resources :mail_crons do
|
||||||
|
collection do
|
||||||
|
get 'delete'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
resources :mail_cron_logs do
|
||||||
|
collection do
|
||||||
|
get 'delete'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
resources :asset_categories
|
resources :asset_categories
|
||||||
resources :asset_tags
|
resources :asset_tags
|
||||||
resources :app_auths
|
resources :app_auths
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
class DelayImpressionistRequest
|
||||||
|
attr_accessor :session_options,:remote_ip,:referer,:user_agent
|
||||||
|
def initialize(request=nil)
|
||||||
|
if request
|
||||||
|
self.session_options=request.session_options
|
||||||
|
self.remote_ip=request.remote_ip
|
||||||
|
self.referer=request.referer
|
||||||
|
self.user_agent=request.user_agent
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def restore(args)
|
||||||
|
args.each do |key,value|
|
||||||
|
self.send("#{key}=", value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
File renamed without changes.
@@ -0,0 +1,6 @@
|
|||||||
|
[{"old_id":1,"key":"administrative","title_translations":{"en":"Official","zh_tw":"行政公告"}}
|
||||||
|
,{"old_id":2,"key":"events","title_translations":{"en":"Activities","zh_tw":"活動"}}
|
||||||
|
,{"old_id":3,"key":"intern_opportunities","title_translations":{"en":"Internship","zh_tw":"實習機會"}}
|
||||||
|
,{"old_id":4,"key":"scholarship_and_exchange_student","title_translations":{"en":"Scholarship","zh_tw":"獎學金與交換生資訊"}}
|
||||||
|
,{"old_id":5,"key":"news","title_translations":{"en":"Newsletter","zh_tw":"新聞"}}
|
||||||
|
,{"old_id":6,"key":"enrollments","title_translations":{"en":"Admission","zh_tw":"招生資訊"}}]
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -6,15 +6,14 @@ module DefaultWidgetTagHelper
|
|||||||
@request = req
|
@request = req
|
||||||
params.delete :inner
|
params.delete :inner
|
||||||
@params = params
|
@params = params
|
||||||
|
params_str = "?"
|
||||||
params_str ="?"
|
|
||||||
params.each do |index,param|
|
params.each do |index,param|
|
||||||
if param.is_a?(Array) and !param.blank?
|
if param.is_a?(Array) and !param.blank?
|
||||||
|
params_str << "&" unless params_str.eql?("?")
|
||||||
params_str << param.collect{|t| "#{index}[]=#{t}"}.join("&")
|
params_str << param.collect{|t| "#{index}[]=#{t}"}.join("&")
|
||||||
params.delete index
|
params.delete index
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
params_str = params_str + (params_str.eql?("?") ? params.to_param : "&#{params.to_param}" )
|
params_str = params_str + (params_str.eql?("?") ? params.to_param : "&#{params.to_param}" )
|
||||||
content_tag :div,:class=> 'more' do
|
content_tag :div,:class=> 'more' do
|
||||||
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
link_to I18n.t(@more_link[:label_i18n]),[eval("#{@more_link[:path_method]}"),params_str].join()
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
module OrbitApp
|
||||||
|
module Module
|
||||||
|
module VisitorCounter
|
||||||
|
Version = "0.1"
|
||||||
|
|
||||||
|
def display_visitors(options={})
|
||||||
|
Site.first.visitor_counters["total"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_visitors_today
|
||||||
|
Site.first.visitor_counters["today"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_visitors_this_week
|
||||||
|
Site.first.visitor_counters["this_week"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_visitors_this_month
|
||||||
|
Site.first.visitor_counters["this_month"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_visitors_this_year
|
||||||
|
Site.first.visitor_counters["this_year"]
|
||||||
|
end
|
||||||
|
|
||||||
|
end # of VisitorCounter
|
||||||
|
end # of Module
|
||||||
|
end # of OrbitApp
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
module OrbitApp
|
||||||
|
module Module
|
||||||
|
module VisitorCounterEval
|
||||||
|
Version = "0.1"
|
||||||
|
|
||||||
|
def display_visitors(options={})
|
||||||
|
impressions = Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_visitors_today
|
||||||
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_visitors_this_week
|
||||||
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_visitors_this_month
|
||||||
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_visitors_this_year
|
||||||
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
|
||||||
|
end
|
||||||
|
end # end of VisitorCounterEval
|
||||||
|
end # of Module
|
||||||
|
end # of OrbitApp
|
||||||
@@ -79,9 +79,10 @@ module OrbitCoreLib
|
|||||||
else
|
else
|
||||||
auth_object_space = ObjectAuth.where(obj_authable_type: self.to_s,title: title)
|
auth_object_space = ObjectAuth.where(obj_authable_type: self.to_s,title: title)
|
||||||
end
|
end
|
||||||
|
|
||||||
query1 = auth_object_space.any_in({sub_role_ids: sub_role_ids_ary}).excludes(blocked_user_ids: user.id)
|
query1 = auth_object_space.any_in({sub_role_ids: sub_role_ids_ary}).excludes(blocked_user_ids: user.id)
|
||||||
query2 = auth_object_space.any_of({all: true},{privilege_user_ids: user.id},{role_ids: user.role_ids}).excludes(blocked_user_ids: user.id)
|
query2 = auth_object_space.any_of({all: true},{privilege_user_ids: user.id}).excludes(blocked_user_ids: user.id)
|
||||||
|
# query2 = auth_object_space.any_of({all: true},{privilege_user_ids: user.id},{role_ids: user.role_ids}).excludes(blocked_user_ids: user.id) #save for backup if something went wrong (0626 Matt)
|
||||||
|
|
||||||
result = (query1 + query2).uniq
|
result = (query1 + query2).uniq
|
||||||
result.collect{|t| t.obj_authable}.delete_if{|val| val==nil}
|
result.collect{|t| t.obj_authable}.delete_if{|val| val==nil}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ module OrbitTag
|
|||||||
def tags=(tag_ids)
|
def tags=(tag_ids)
|
||||||
ids = [tag_ids].flatten
|
ids = [tag_ids].flatten
|
||||||
tag_ids.delete('')
|
tag_ids.delete('')
|
||||||
|
self.tagged_ids = tag_ids
|
||||||
ids = self.taggings.blank? ? [] : self.taggings.map{|t| t.tag.id}
|
ids = self.taggings.blank? ? [] : self.taggings.map{|t| t.tag.id}
|
||||||
tag_ids.each do |tag_id|
|
tag_ids.each do |tag_id|
|
||||||
unless ids.include? tag_id
|
unless ids.include? tag_id
|
||||||
@@ -58,9 +59,6 @@ module OrbitTag
|
|||||||
|
|
||||||
def tag_ids=(ids)
|
def tag_ids=(ids)
|
||||||
self.tags = ids
|
self.tags = ids
|
||||||
ids = [ids].flatten
|
|
||||||
ids.delete('')
|
|
||||||
self.tagged_ids = ids
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
# encoding: utf-8
|
||||||
|
require 'pry'
|
||||||
|
namespace :import do
|
||||||
|
task :ntu_mb_news_report => :environment do
|
||||||
|
|
||||||
|
jfile = File.new("#{Rails.root}/lib/import_data/news_report.json").read
|
||||||
|
jdata = JSON.parse(jfile)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
task :ntu_mb => :environment do
|
||||||
|
DEPARTMENTS = %w[Management BA Acc Fin IB IM EMBA GMBA]
|
||||||
|
print 'Enter the numer of department you want to import'
|
||||||
|
puts DEPARTMENTS.map.with_index{|t,i| "#{i}.#{t}" }.to_s
|
||||||
|
num = STDIN.gets.gsub("\n",'').to_i
|
||||||
|
|
||||||
|
puts "Destroy all BulletinCategory? (Default No)"
|
||||||
|
if STDIN.gets.gsub("\n",'').downcase == 'yes'
|
||||||
|
BulletinCategory.destroy_all
|
||||||
|
else
|
||||||
|
puts "Did not destroy"
|
||||||
|
end
|
||||||
|
jfile = File.new("#{Rails.root}/lib/import_data/announce_categories.json").read
|
||||||
|
jdata = JSON.parse(jfile)
|
||||||
|
jdata.each do |data|
|
||||||
|
a = BulletinCategory.new data
|
||||||
|
a.save
|
||||||
|
end
|
||||||
|
news_report_category = BulletinCategory.new {"key":"news_report","title_translations":{"en":"NewsReport","zh_tw":"新聞報導"}}
|
||||||
|
puts "Imported #{jdata.count}+1(NewsReport)"
|
||||||
|
|
||||||
|
|
||||||
|
puts "Destroy all Bulletin? (Default No)"
|
||||||
|
if STDIN.gets.gsub("\n",'').downcase == 'yes'
|
||||||
|
Bulletin.destroy_all
|
||||||
|
else
|
||||||
|
puts "Did not destroy"
|
||||||
|
end
|
||||||
|
counter = 0
|
||||||
|
jfile = File.new("#{Rails.root}/lib/import_data/announcements.json").read
|
||||||
|
jdata = JSON.parse(jfile)
|
||||||
|
jdata.each do |data|
|
||||||
|
# puts data
|
||||||
|
# puts DEPARTMENTS[num]
|
||||||
|
if data["department"] == DEPARTMENTS[num]
|
||||||
|
a = Bulletin.new data
|
||||||
|
a.bulletin_category = BulletinCategory.where(:key=>data["category_key"]).first
|
||||||
|
a.save
|
||||||
|
counter = counter +1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
puts "Imported #{counter}"
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -310,4 +310,20 @@ namespace :migrate do
|
|||||||
Rake::Task["web_link_url:web_link_url_i18n"].execute
|
Rake::Task["web_link_url:web_link_url_i18n"].execute
|
||||||
end
|
end
|
||||||
|
|
||||||
|
task :fix_tagged_ids => :environment do
|
||||||
|
Tag.all.each do |tag|
|
||||||
|
tag.taggings.each do |tagging|
|
||||||
|
tagged_ids = tagging.taggable.tagged_ids
|
||||||
|
unless tagged_ids.include?(tag.id.to_s)
|
||||||
|
tagged_ids << tag.id.to_s
|
||||||
|
tagging.taggable.update_attribute(:tagged_ids, tagged_ids)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
task :clear_news_tags => :environment do
|
||||||
|
`mongo #{Mongoid.config.database.name} --eval "db.tags.remove({_type: {$ne: 'Tag'}})"`
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
+6
-1
@@ -26,6 +26,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
||||||
@item = Page.find(params[:page_id]) rescue nil
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
if @item
|
if @item
|
||||||
if @item.frontend_data_count
|
if @item.frontend_data_count
|
||||||
@@ -60,7 +61,11 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
|||||||
else
|
else
|
||||||
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page_main]).per(@page_num)
|
||||||
end
|
end
|
||||||
delayed_impressionist(@tag) if @tag
|
if params["tag_id"]
|
||||||
|
params["tag_id"].each do |tag_id|
|
||||||
|
delayed_impressionist(Tag.find tag_id) rescue nil
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Bulletin
|
|||||||
include OrbitTag::Taggable
|
include OrbitTag::Taggable
|
||||||
taggable
|
taggable
|
||||||
|
|
||||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
is_impressionable #:counter_cache => { :column_name => :view_count }
|
||||||
|
|
||||||
field :title, localize: true
|
field :title, localize: true
|
||||||
field :subtitle, localize: true
|
field :subtitle, localize: true
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ en:
|
|||||||
bulletin_category_with_title: Bulletin Category with Title
|
bulletin_category_with_title: Bulletin Category with Title
|
||||||
postdate: Post Date
|
postdate: Post Date
|
||||||
title: Title
|
title: Title
|
||||||
|
subtitle: SubTitle
|
||||||
editing_announcement: Edit Announcement
|
editing_announcement: Edit Announcement
|
||||||
editing_announcement_category: Edit Category
|
editing_announcement_category: Edit Category
|
||||||
error:
|
error:
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ zh_tw:
|
|||||||
bulletin_category_with_title: 公告類別及標題
|
bulletin_category_with_title: 公告類別及標題
|
||||||
postdate: 張貼日期
|
postdate: 張貼日期
|
||||||
title: 標題
|
title: 標題
|
||||||
|
subtitle: 副標題
|
||||||
editing_announcement: 編輯類別
|
editing_announcement: 編輯類別
|
||||||
editing_announcement_category: 編輯類別
|
editing_announcement_category: 編輯類別
|
||||||
error:
|
error:
|
||||||
|
|||||||
+4
-3
@@ -23,18 +23,19 @@ module Announcement
|
|||||||
end
|
end
|
||||||
|
|
||||||
category ["BulletinCategory"]
|
category ["BulletinCategory"]
|
||||||
data_count 3..10
|
data_count 1..10
|
||||||
|
|
||||||
taggable
|
taggable
|
||||||
|
|
||||||
widgets do
|
widgets do
|
||||||
default_widget do
|
default_widget do
|
||||||
query 'Bulletin.any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
|
query 'Bulletin.any_of( {deadline: nil,:postdate.lte => Time.now} , {:deadline.gte => Time.now,:postdate.lte => Time.now} )'
|
||||||
enable ["typeA","typeC"]
|
enable ["typeA","typeB_style3","typeC"]
|
||||||
image :image
|
image :image
|
||||||
field :postdate
|
field :postdate
|
||||||
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
|
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self,:preview=>true}
|
||||||
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
|
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:bulletin_category,:id]}}
|
||||||
|
field :subtitle
|
||||||
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
link_to_more 'panel_announcement_front_end_bulletins_path',:title_i18n=> 'more_plus'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+44
-4
@@ -1,14 +1,18 @@
|
|||||||
class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController
|
class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController
|
||||||
before_filter :for_app_manager,:except => [:index]
|
include OrbitControllerLib::DivisionForDisable
|
||||||
include OrbitControllerLib::DivisionForDisable
|
|
||||||
|
|
||||||
|
before_filter :for_app_manager,:except => [:index,:get_categorys_json,:get_archive_files_json]
|
||||||
|
|
||||||
|
before_filter :force_order_for_visitor,:only=>[:index,:get_categorys_json,:get_archive_files_json]
|
||||||
|
before_filter :force_order_for_user,:except => [:index,:get_categorys_json,:get_archive_files_json]
|
||||||
|
before_filter :for_app_sub_manager,:except => [:index,:get_categorys_json,:get_archive_files_json]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@archive_file_categorys = get_categories_for_index("ArchiveFileCategory")
|
@archive_file_categorys = get_categories_for_index("ArchiveFileCategory")
|
||||||
# @archive_file_categorys = ArchiveFileCategory.all
|
# @archive_file_categorys = ArchiveFileCategory.all
|
||||||
@archive_file_category = ArchiveFileCategory.new(:display => 'List')
|
@archive_file_category = ArchiveFileCategory.new(:display => 'List')
|
||||||
|
|
||||||
@url = panel_archive_back_end_archive_file_categorys_path
|
@url = panel_archive_back_end_archive_file_categorys_path
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
@@ -16,6 +20,42 @@ class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendCont
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_categorys_json
|
||||||
|
categorys = ArchiveFileCategory.all
|
||||||
|
data = Array.new
|
||||||
|
|
||||||
|
categorys.each do |c|
|
||||||
|
data << {
|
||||||
|
category: c.title,
|
||||||
|
link: "#{url_for( :action => "index",
|
||||||
|
:controller => "panel/archive/front_end/archive_files",
|
||||||
|
:format => :rss,
|
||||||
|
:only_path => false,
|
||||||
|
:inner=>true,
|
||||||
|
:category_id => c )}"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
render :json => JSON.pretty_generate(data)
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_archive_files_json
|
||||||
|
archive_file = ArchiveFileCategory.find(params[:archive_file_category_id]).archive_files
|
||||||
|
p archive_file
|
||||||
|
data = Array.new
|
||||||
|
|
||||||
|
archive_file.each do |b|
|
||||||
|
|
||||||
|
data << {
|
||||||
|
title: b.title,
|
||||||
|
link: "http://#{request.host_with_port}#{panel_archive_front_end_archive_file_path(b, :category_id => b.archive_file_category.id)}",
|
||||||
|
tag: b.sorted_tags.to_a,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
render :json => JSON.pretty_generate(data)
|
||||||
|
end
|
||||||
|
|
||||||
# GET /archive_files/1
|
# GET /archive_files/1
|
||||||
# GET /archive_files/1.xml
|
# GET /archive_files/1.xml
|
||||||
def show
|
def show
|
||||||
|
|||||||
Vendored
+15
@@ -0,0 +1,15 @@
|
|||||||
|
module Panel::Archive::BackEnd::ArchiveFileCategorysHelper
|
||||||
|
include ActionView::Helpers::UrlHelper
|
||||||
|
|
||||||
|
|
||||||
|
def show_anc_cate_permission_link(archive_file_category)
|
||||||
|
type = 'submit'
|
||||||
|
oa = archive_file_category.get_object_auth_by_title(type)
|
||||||
|
if oa.nil?
|
||||||
|
archive_file_category.object_auths.new(title: type ).save
|
||||||
|
oa = archive_file_category.get_object_auth_by_title(type)
|
||||||
|
end
|
||||||
|
link_to t(:category_auth),admin_object_auth_ob_auth_path(oa)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
+6
-3
@@ -1,13 +1,16 @@
|
|||||||
|
|
||||||
|
|
||||||
<tr id="<%= dom_id archive_file_category %>" class="with_action">
|
<tr id="<%= dom_id archive_file_category %>" class="with_action">
|
||||||
<td>
|
<td>
|
||||||
<%= archive_file_category.key %>
|
<%= archive_file_category.key %>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills hide">
|
<ul class="nav nav-pills hide">
|
||||||
<li><%= link_to t('archive_file_category.edit'), edit_panel_archive_back_end_archive_file_category_path(archive_file_category), :remote => true %></li>
|
<% if is_admin?%>
|
||||||
|
<li><%= link_to t(:edit), edit_panel_archive_back_end_archive_file_category_path(archive_file_category), :remote => true %></li>
|
||||||
<li><%= link_to show_toggle_archive_btn(archive_file_category) , panel_archive_back_end_archive_file_category_path(archive_file_category), :confirm => t(:sure?), :method => :delete, :remote => true,:class=> "archive_toggle" %></li>
|
<li><%= link_to show_toggle_archive_btn(archive_file_category) , panel_archive_back_end_archive_file_category_path(archive_file_category), :confirm => t(:sure?), :method => :delete, :remote => true,:class=> "archive_toggle" %></li>
|
||||||
<!-- <li><%#= link_to t('archive_file_category.delete'), panel_archive_back_end_archive_file_category_path(archive_file_category), :confirm => t('sure?'), :method => :delete, :remote => true %></li> -->
|
<% end %>
|
||||||
|
<%if is_manager? || is_admin? %>
|
||||||
|
<li><%= show_anc_cate_permission_link(archive_file_category) %></li>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
+10
-9
@@ -24,16 +24,17 @@
|
|||||||
</td>
|
</td>
|
||||||
<td><%= archive_file.archive_file_category.title %></td>
|
<td><%= archive_file.archive_file_category.title %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to archive_file.title, panel_archive_front_end_archive_file_path(archive_file) %>
|
<%= link_to archive_file.title, panel_archive_front_end_archive_file_path(archive_file) %>
|
||||||
|
|
||||||
|
<div class="quick-edit">
|
||||||
|
<ul class="nav nav-pills hide">
|
||||||
|
<% if (archive_file.create_user_id == current_or_guest_user.id) || is_manager? %>
|
||||||
|
<li><%= link_to t(:edit), edit_panel_archive_back_end_archive_file_path(archive_file) %></li>
|
||||||
|
<li class="dropdown"><%= link_to t(:delete_), panel_archive_back_end_archive_file_path(archive_file), :confirm => t(:sure?), :method => :delete, :remote => true %></li>
|
||||||
|
<% end -%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="quick-edit">
|
|
||||||
<ul class="nav nav-pills hide">
|
|
||||||
<%if at_least_module_manager || archive_file.archive_file_category.cur_user_is_sub_manager_of(:edit)%>
|
|
||||||
<li><%= link_to t('edit'), edit_panel_archive_back_end_archive_file_path(archive_file, :page => params[:page], :filter => @filter) %></li>
|
|
||||||
<li><%= link_to t(:delete_), panel_archive_back_end_archive_file_path(archive_file), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
|
|
||||||
<% end -%>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="label-group">
|
<div class="label-group">
|
||||||
|
|||||||
+8
-3
@@ -50,7 +50,7 @@ module Archive
|
|||||||
head_label_i18n 'archive.archive',:icon_class=>"icons-archive"
|
head_label_i18n 'archive.archive',:icon_class=>"icons-archive"
|
||||||
available_for [:admin,:guest,:manager,:sub_manager]
|
available_for [:admin,:guest,:manager,:sub_manager]
|
||||||
active_for_controllers ({:private=>['archive_file_categorys','archive_files'],:public=>['panel/archive/back_end/tags']})
|
active_for_controllers ({:private=>['archive_file_categorys','archive_files'],:public=>['panel/archive/back_end/tags']})
|
||||||
# active_for_object_auth ['BulletinCategory']
|
active_for_object_auth ['ArchiveFileCategory']
|
||||||
|
|
||||||
head_link_path "panel_archive_back_end_archive_files_path"
|
head_link_path "panel_archive_back_end_archive_files_path"
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ module Archive
|
|||||||
:link_path=>"new_panel_archive_back_end_archive_file_path" ,
|
:link_path=>"new_panel_archive_back_end_archive_file_path" ,
|
||||||
:priority=>2,
|
:priority=>2,
|
||||||
:active_for_action=>{:archive_files=>:new},
|
:active_for_action=>{:archive_files=>:new},
|
||||||
:available_for => [:admin]
|
:available_for => [:sub_manager]
|
||||||
|
|
||||||
context_link 'categories',
|
context_link 'categories',
|
||||||
:link_path=>"panel_archive_back_end_archive_file_categorys_path" ,
|
:link_path=>"panel_archive_back_end_archive_file_categorys_path" ,
|
||||||
@@ -76,7 +76,12 @@ module Archive
|
|||||||
:link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Archive'}))" ,
|
:link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Archive'}))" ,
|
||||||
:priority=>4,
|
:priority=>4,
|
||||||
# :active_for_action=>{:bulletin_categorys=>:index},
|
# :active_for_action=>{:bulletin_categorys=>:index},
|
||||||
:available_for => [:admin]
|
:available_for => [:manager]
|
||||||
|
|
||||||
|
context_link 'module_authorization',
|
||||||
|
:link_path=>"admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: 'Archive'}))",
|
||||||
|
:priority=>6,
|
||||||
|
:active_for_app_auth => 'Archive'
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Vendored
-28
@@ -1,28 +0,0 @@
|
|||||||
class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
|
|
||||||
|
|
||||||
layout false
|
|
||||||
|
|
||||||
def initialize
|
|
||||||
super
|
|
||||||
@app_title = 'ask'
|
|
||||||
end
|
|
||||||
|
|
||||||
def index
|
|
||||||
@ask_question = AskQuestion.new
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
@ask_question = AskQuestion.new(params[:ask_question])
|
|
||||||
if verify_recaptcha model: @ask_question, private_key: '6Lfl7OESAAAAAD4rl5S16-zjt5yiKNYJ6jsqdwmL'
|
|
||||||
@ask_acknowledgement = AskAcknowledgement.first || AskAcknowlegement.new
|
|
||||||
@ask_question.save
|
|
||||||
AskAdmin.all.each do |ask_admin|
|
|
||||||
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
respond_to do |format|
|
|
||||||
format.js
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
<% if @ask_question.errors.empty? %>
|
|
||||||
$('html,body').scrollTop(0);
|
|
||||||
$('#acknowledgement')
|
|
||||||
.html('<%= j simple_format(@ask_acknowledgement.content) %>')
|
|
||||||
.fadeIn(600)
|
|
||||||
.delay(3000)
|
|
||||||
.fadeOut(600);
|
|
||||||
<% else %>
|
|
||||||
alert('<%= @ask_question.errors.full_messages.join('\n') %>');
|
|
||||||
Recaptcha.reload()
|
|
||||||
<% end %>
|
|
||||||
Vendored
+1
@@ -14,6 +14,7 @@ module Ask
|
|||||||
app_page 'ask_questions' do
|
app_page 'ask_questions' do
|
||||||
frontend_i18n 'ask.ask'
|
frontend_i18n 'ask.ask'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
widgets do
|
widgets do
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
+46
@@ -0,0 +1,46 @@
|
|||||||
|
class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
|
||||||
|
|
||||||
|
layout false
|
||||||
|
|
||||||
|
def initialize
|
||||||
|
super
|
||||||
|
@app_title = 'ask'
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@ask_question = AskQuestion.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@ask_question = AskQuestion.new(params[:ask_question])
|
||||||
|
if gotcha_valid? && @ask_question.save
|
||||||
|
@ask_acknowledgement = AskAcknowledgement.first || AskAcknowlegement.new
|
||||||
|
#@ask_question.save
|
||||||
|
redirect_to root_path
|
||||||
|
AskAdmin.all.each do |ask_admin|
|
||||||
|
AskMailer.notice(ask_admin, @ask_question).deliver
|
||||||
|
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
|
||||||
|
end
|
||||||
|
# redirect_to panel_ask_front_end_thank_you_path
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
# format.js { render :thank_you, notice: 'Your question has been successfully sent.' }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def thank_you
|
||||||
|
@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
|
||||||
|
@item = Page.find(params[:page_id]) rescue nil
|
||||||
|
>>>>>>> a4fa967... Fix mailing redirect
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
class AskMailer < ActionMailer::Base
|
class AskMailer < ActionMailer::Base
|
||||||
default from: 'orbit_test@rulingcom.com'
|
default from: 'orbit_test@rulingcom.com'
|
||||||
|
|
||||||
def reply(ask_question)
|
def reply(ask_question)
|
||||||
@ask_question = ask_question
|
@ask_question = ask_question
|
||||||
mail(:to => @ask_question.email, :subject => "#{t('ask.reply')}:#{@ask_question.title}")
|
mail(:to => @ask_question.email, :subject => "#{t('ask.reply')}:#{@ask_question.title}")
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+5
@@ -1,4 +1,8 @@
|
|||||||
class AskQuestion
|
class AskQuestion
|
||||||
|
include ActiveModel::Validations
|
||||||
|
include ActiveModel::Conversion
|
||||||
|
extend ActiveModel::Naming
|
||||||
|
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
include OrbitCoreLib::ObjectDisable
|
include OrbitCoreLib::ObjectDisable
|
||||||
@@ -15,4 +19,5 @@ class AskQuestion
|
|||||||
|
|
||||||
belongs_to :ask_category
|
belongs_to :ask_category
|
||||||
has_one :ask_reply, dependent: :destroy
|
has_one :ask_reply, dependent: :destroy
|
||||||
|
|
||||||
end
|
end
|
||||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
<%= @ask_question.ask_reply.content %>
|
<%= @ask_question.content %>
|
||||||
</p>
|
</p>
|
||||||
<p>此為系統自動發信,請勿直接回覆</p>
|
<p>此為系統自動發信,請勿直接回覆</p>
|
||||||
</body>
|
</body>
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 262 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user