Compare commits
99 Commits
master
...
daily-0402
Author | SHA1 | Date |
---|---|---|
|
74f9dea6b9 | |
|
20bdeb3c2d | |
|
695d712843 | |
|
8b44f930f3 | |
|
3476237fa7 | |
|
bd3e9fe4f6 | |
|
4bb5e18f44 | |
|
78205d8b00 | |
|
a62ff9308f | |
|
474e8b9b57 | |
|
a8f7422c25 | |
|
9e02011956 | |
|
3f0addf04d | |
|
0a01faedc9 | |
|
8e0331449f | |
|
635d3f1690 | |
|
9e33bdadc3 | |
|
54acaebc98 | |
|
7f7e21b4f2 | |
|
8609c8dec0 | |
|
f3e40c1405 | |
|
42aca64dc3 | |
|
6ba840de4a | |
|
53953e57db | |
|
ddf61e5606 | |
|
5685e11511 | |
|
0e39de56e2 | |
|
677faf1811 | |
|
f0fbd50261 | |
|
573270c98c | |
|
f61b786e90 | |
|
d085197635 | |
|
6c58a0f773 | |
|
478b54da26 | |
|
e799ac4395 | |
|
c101413d32 | |
|
50a09763ec | |
|
811b30791b | |
|
4b8c68500a | |
|
e5e45f3ada | |
|
f619c5e389 | |
|
3c6ca3c254 | |
|
12fdb5a0ca | |
|
7df0be3826 | |
|
80be9e63ef | |
|
0444b1f5e5 | |
|
91d3e1d92c | |
|
fb8407dbe3 | |
|
9963c9fb68 | |
|
80a2f67dda | |
|
7b2e7f5297 | |
|
38a695d8a9 | |
|
df83c6fff7 | |
|
adec8c8938 | |
|
2746616610 | |
|
61cc8f0f54 | |
|
31476bb813 | |
|
d2c1abeb95 | |
|
f0c19cfdf9 | |
|
8ab4e90a06 | |
|
7a78594594 | |
|
b50548c538 | |
|
84f255173c | |
|
b4ba4149d4 | |
|
3830fddfe0 | |
|
66633443de | |
|
3d7fbd9711 | |
|
aa851cad76 | |
|
4a2c994401 | |
|
af6813480a | |
|
4a83521b84 | |
|
470dbea22d | |
|
8e369fe819 | |
|
2b4e53ed1b | |
|
6d194759fa | |
|
d20081157a | |
|
e88487bc9f | |
|
311d741f92 | |
|
8e0632236b | |
|
78abcac1cb | |
|
385e043809 | |
|
8d5a2d71b7 | |
|
1880ed11ca | |
|
96602842a3 | |
|
ca64cba9ad | |
|
4f64ff3568 | |
|
a22c0c46e0 | |
|
196030b4b4 | |
|
75a5e74bc0 | |
|
39a20f6cc9 | |
|
32d56232bc | |
|
b7beadfc04 | |
|
e53ad9f5d1 | |
|
b2cbcf6629 | |
|
906e522a6a | |
|
4f7928ad1b | |
|
77c7053bf1 | |
|
20ac4f1ac0 | |
|
9931eb7f61 |
|
@ -11,16 +11,10 @@ public/assets
|
||||||
public/index.html
|
public/index.html
|
||||||
public/panel/**/*
|
public/panel/**/*
|
||||||
public/uploads/**/*
|
public/uploads/**/*
|
||||||
solr/data
|
solr
|
||||||
tmp/**/*
|
tmp/**/*
|
||||||
uploads/**/*
|
uploads/**/*
|
||||||
config/*.god
|
|
||||||
log/*.gz
|
|
||||||
tmp/restart.txt
|
|
||||||
*.swp
|
*.swp
|
||||||
*.pid
|
*.pid
|
||||||
*.lck
|
*.lck
|
||||||
|
|
||||||
.sass-cache/*
|
|
||||||
*.supported
|
|
||||||
mongoid.yml
|
|
||||||
|
|
17
Gemfile
17
Gemfile
|
@ -14,11 +14,7 @@ gem 'execjs'
|
||||||
gem 'jquery-rails', '2.1.4'
|
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'
|
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"
|
||||||
|
@ -30,7 +26,6 @@ gem "mongo_session_store-rails3", '3.0.6'
|
||||||
gem 'nokogiri'
|
gem 'nokogiri'
|
||||||
|
|
||||||
gem 'fb_graph'
|
gem 'fb_graph'
|
||||||
gem 'rack-gridfs'
|
|
||||||
gem 'radius'
|
gem 'radius'
|
||||||
gem 'rake'
|
gem 'rake'
|
||||||
# gem 'remotipart'
|
# gem 'remotipart'
|
||||||
|
@ -39,7 +34,7 @@ gem 'resque-scheduler' # job scheduling
|
||||||
gem 'resque-restriction'
|
gem 'resque-restriction'
|
||||||
#gem 'rb-readline'
|
#gem 'rb-readline'
|
||||||
# gem 'ruby-debug19'
|
# gem 'ruby-debug19'
|
||||||
gem 'rubyzip','0.9.9'
|
gem 'rubyzip'
|
||||||
|
|
||||||
gem 'sunspot_mongo'
|
gem 'sunspot_mongo'
|
||||||
gem 'sunspot_solr'
|
gem 'sunspot_solr'
|
||||||
|
@ -50,14 +45,14 @@ gem 'sinatra'
|
||||||
gem 'sprockets'
|
gem 'sprockets'
|
||||||
gem 'social-share-button'
|
gem 'social-share-button'
|
||||||
|
|
||||||
gem 'tinymce-rails', '3.5.8.3'
|
gem 'tinymce-rails'
|
||||||
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' if RUBY_PLATFORM.downcase.include?("linux")
|
||||||
|
|
||||||
|
|
||||||
gem "impressionist",'1.2.0'
|
gem "impressionist", :git => 'git://github.com/charlotte-ruby/impressionist.git'
|
||||||
#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'
|
||||||
|
|
||||||
|
@ -67,8 +62,6 @@ gem 'chinese_pinyin', '0.4.1'
|
||||||
gem 'rmmseg-cpp-huacnlee', '0.2.9'
|
gem 'rmmseg-cpp-huacnlee', '0.2.9'
|
||||||
gem 'redis-namespace'
|
gem 'redis-namespace'
|
||||||
gem 'redis-search'
|
gem 'redis-search'
|
||||||
gem 'syslog-logger'
|
|
||||||
gem "recaptcha", :require => "recaptcha/rails"
|
|
||||||
|
|
||||||
# Gems used only for assets and not required
|
# Gems used only for assets and not required
|
||||||
# in production environments by default.
|
# in production environments by default.
|
||||||
|
|
|
@ -0,0 +1,402 @@
|
||||||
|
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-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)
|
||||||
|
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
|
||||||
|
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
|
||||||
|
tinymce-rails
|
||||||
|
uglifier
|
||||||
|
watchr
|
Binary file not shown.
Before Width: | Height: | Size: 824 B After Width: | Height: | Size: 613 B |
Binary file not shown.
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 524 B |
Binary file not shown.
Before Width: | Height: | Size: 738 B |
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
orbitDesktop.prototype.themefolder = "desktop_themes";
|
orbitDesktop.prototype.themefolder = "desktop_themes";
|
||||||
orbitDesktopAPI.prototype.notifyImgPath = "/assets/";
|
orbitDesktopAPI.prototype.notifyImgPath = "/assets/";
|
||||||
// alert("<%= @desktop.inspect %>")
|
alert("<%= @desktop.inspect %>")
|
||||||
var od = new orbitDesktop("#ajax_container");
|
var od = new orbitDesktop("#ajax_container");
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
getEvent(selet);
|
||||||
function resetText() {
|
function resetText() {
|
||||||
$events.find('li').find($mon).html('');
|
$events.find('li').find($mon).html('');
|
||||||
$events.find('li').find($day).html('');
|
$events.find('li').find($day).html('');
|
||||||
|
@ -63,4 +63,60 @@ $(document).ready(function(){
|
||||||
$events.find('li').find($link_text).attr('href', '');
|
$events.find('li').find($link_text).attr('href', '');
|
||||||
$events.find('li').find($time).html('');
|
$events.find('li').find($time).html('');
|
||||||
}
|
}
|
||||||
|
function getEvent(selet){
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: "/static/nccu_calendar.xml",
|
||||||
|
dataType: "xml",
|
||||||
|
timeout: 1000,
|
||||||
|
error: function(xml){
|
||||||
|
$events.find('.links_next').addClass('disabled')
|
||||||
|
$events.find('.error_mag').show();
|
||||||
|
$events.find('ul').hide();
|
||||||
|
$events.find('.error_mag').html("讀取錯誤");
|
||||||
|
},
|
||||||
|
success: function(xml) {
|
||||||
|
xmlLength = $(xml).find('entry').length;
|
||||||
|
$(xml).find('entry').slice(selet, selet+objLength).each(function(i){
|
||||||
|
title_text = $(this).find('title').text()
|
||||||
|
link_text = $(this).find('link').attr('href')
|
||||||
|
summary_text = $(this).find('summary').text()
|
||||||
|
indexA = summary_text.indexOf("-");
|
||||||
|
indexB = summary_text.indexOf(" ");
|
||||||
|
indexC = summary_text.indexOf("/");
|
||||||
|
//清除前後空白字元
|
||||||
|
summary_text = jQuery.trim(summary_text);
|
||||||
|
//篩選標題
|
||||||
|
title_text = title_text.slice(0, 16)
|
||||||
|
if (summary_text.length == 31) {
|
||||||
|
startDate_text = summary_text.slice(0, indexA);
|
||||||
|
startMon_text = startDate_text.slice((indexC+1), (indexC+3));
|
||||||
|
startDay_text = startDate_text.slice(7);
|
||||||
|
endDate_text = summary_text.slice((indexA+1), indexB);
|
||||||
|
time_text = summary_text.slice((indexB+1));
|
||||||
|
} else {
|
||||||
|
startDate_text = summary_text.slice(0, indexB);
|
||||||
|
startMon_text = startDate_text.slice((indexC+1), (indexC+3));
|
||||||
|
startDay_text = startDate_text.slice(7);
|
||||||
|
endDate_text = '';
|
||||||
|
time_text = summary_text.slice((indexB+1));
|
||||||
|
}
|
||||||
|
if(startMon_text.slice(0, 1) == '0'){
|
||||||
|
startMon_text = month[startMon_text.slice(1)-1];
|
||||||
|
} else {
|
||||||
|
startMon_text = month[startMon_text-1];
|
||||||
|
}
|
||||||
|
$events.find('li').eq(i).find($mon).html(startMon_text);
|
||||||
|
$events.find('li').eq(i).find($day).html(startDay_text);
|
||||||
|
$events.find('li').eq(i).find($link_text).html(title_text+"…");
|
||||||
|
$events.find('li').eq(i).find($link_text).attr('href', link_text);
|
||||||
|
$events.find('li').eq(i).find($time).html('時間:'+time_text);
|
||||||
|
//console.log();
|
||||||
|
/*$('<li></li>')
|
||||||
|
.html('<div class="event_date"><span class="mon">'+startMon_text+'</span><span class="day">'+startDay_text+'</div>')
|
||||||
|
.appendTo('.events ul');*/
|
||||||
|
});//close each(
|
||||||
|
}
|
||||||
|
}); //close $.ajax(
|
||||||
|
}
|
||||||
});
|
});
|
|
@ -1,34 +0,0 @@
|
||||||
function append_id(){
|
|
||||||
if ($("#object_id").length == 1) {
|
|
||||||
return "&id="+$("#object_id").val();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return '';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#page_design").live('change', function() {
|
|
||||||
$.getScript($(this).attr('rel') + '?design_id=' + $(this).val() + append_id());
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$("#module_app_list select").live('change', function() {
|
|
||||||
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val() + append_id());
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#widget_list select,#frontend_list select").live('change', function() {
|
|
||||||
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() + append_id() );
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#tag_list select").live('change', function() {
|
|
||||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + append_id() );
|
|
||||||
});
|
|
||||||
|
|
||||||
$("select.widget_field_select").live('change', function() {
|
|
||||||
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val() + append_id() );
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.part_kind').live('click', function() {
|
|
||||||
$('.part_kind_partial').hide();
|
|
||||||
$('#part_' + $(this).attr('value')).show();
|
|
||||||
});
|
|
|
@ -108,7 +108,7 @@ var orbitDesktop = function(dom){
|
||||||
this.contentHolder = dom;
|
this.contentHolder = dom;
|
||||||
this.themesettings = "";
|
this.themesettings = "";
|
||||||
this.theme = "4f8d3f493b67fcd05f086359";
|
this.theme = "4f8d3f493b67fcd05f086359";
|
||||||
this.transitionTime = 1000;
|
this.transitionTime = 500;
|
||||||
this.currenthtml = "desktop.html";
|
this.currenthtml = "desktop.html";
|
||||||
this.currentface = "home";
|
this.currentface = "home";
|
||||||
this.desktopData = {};
|
this.desktopData = {};
|
||||||
|
@ -135,7 +135,7 @@ var orbitDesktop = function(dom){
|
||||||
o.theme = theme;
|
o.theme = theme;
|
||||||
loadTheme(desktopSettings.customtheme,desktopSettings.wallpaper);
|
loadTheme(desktopSettings.customtheme,desktopSettings.wallpaper);
|
||||||
}else{loadTheme();}
|
}else{loadTheme();}
|
||||||
});
|
})
|
||||||
var loadTheme = function(customtheme,customwallpaper){ //This function will load the theme from database
|
var loadTheme = function(customtheme,customwallpaper){ //This function will load the theme from database
|
||||||
$.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){
|
$.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){
|
||||||
o.themesettings = eval(ts);
|
o.themesettings = eval(ts);
|
||||||
|
@ -160,8 +160,8 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
this.customPage = function(customload){
|
this.customPage = function(customload){
|
||||||
customload = customload.replace("#","");
|
customload = customload.replace("#","");
|
||||||
if(customload.search("-") != -1){
|
if(customload.search("-") != -1){
|
||||||
|
@ -170,7 +170,7 @@ var orbitDesktop = function(dom){
|
||||||
}else{
|
}else{
|
||||||
o.menu_item($(".docklist a[custom-load="+customload+"]"),true);
|
o.menu_item($(".docklist a[custom-load="+customload+"]"),true);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
this.changeTheme = function(theme){ // this function is used for changing theme
|
this.changeTheme = function(theme){ // this function is used for changing theme
|
||||||
o.theme = theme;
|
o.theme = theme;
|
||||||
$.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){
|
$.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){
|
||||||
|
@ -189,9 +189,9 @@ var orbitDesktop = function(dom){
|
||||||
$.getJSON("http://maps.googleapis.com/maps/api/geocode/json?latlng="+o.locationdata.lat+","+o.locationdata.lng+"&sensor=true",function(data){
|
$.getJSON("http://maps.googleapis.com/maps/api/geocode/json?latlng="+o.locationdata.lat+","+o.locationdata.lng+"&sensor=true",function(data){
|
||||||
$.each(data.results[0].address_components,function(i,val){
|
$.each(data.results[0].address_components,function(i,val){
|
||||||
o.locationdata[val.types[0]] = val.long_name;
|
o.locationdata[val.types[0]] = val.long_name;
|
||||||
});
|
})
|
||||||
o.locationdata.formatted_address = data.results[0].formatted_address;
|
o.locationdata.formatted_address = data.results[0].formatted_address;
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var locationError = function(){
|
var locationError = function(){
|
||||||
|
@ -211,7 +211,7 @@ var orbitDesktop = function(dom){
|
||||||
$(".docklist a").click(function(){
|
$(".docklist a").click(function(){
|
||||||
o.menu_item($(this));
|
o.menu_item($(this));
|
||||||
return false;
|
return false;
|
||||||
});
|
})
|
||||||
|
|
||||||
|
|
||||||
$('body').on({
|
$('body').on({
|
||||||
|
@ -254,7 +254,7 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
$(this).ajaxSubmit(options);
|
$(this).ajaxSubmit(options);
|
||||||
return false;
|
return false;
|
||||||
});
|
})
|
||||||
|
|
||||||
$("body").on("click","*[ajax-remote]",function(){
|
$("body").on("click","*[ajax-remote]",function(){
|
||||||
var $e = $(this);
|
var $e = $(this);
|
||||||
|
@ -310,11 +310,11 @@ var orbitDesktop = function(dom){
|
||||||
a();
|
a();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
})
|
||||||
|
|
||||||
$(window).resize(function(){
|
$(window).resize(function(){
|
||||||
// var ww = $(window).width();
|
var ww = $(window).width();
|
||||||
// $("img#thmbackground").attr({"width":ww});
|
$("img#thmbackground").attr({"width":ww});
|
||||||
if( $('.tinycanvas').length > 0 ){ $('.tinycanvas').tinyscrollbar_update('relative'); }
|
if( $('.tinycanvas').length > 0 ){ $('.tinycanvas').tinyscrollbar_update('relative'); }
|
||||||
if($(o.contentHolder).find("div.app_frame").length > 0){
|
if($(o.contentHolder).find("div.app_frame").length > 0){
|
||||||
$(o.contentHolder).find("div.app_frame").each(function(){
|
$(o.contentHolder).find("div.app_frame").each(function(){
|
||||||
|
@ -322,7 +322,7 @@ var orbitDesktop = function(dom){
|
||||||
var app_holder_width = $(this).width();
|
var app_holder_width = $(this).width();
|
||||||
$(this).find("div.app_holder").height(app_holder_height);
|
$(this).find("div.app_holder").height(app_holder_height);
|
||||||
$(this).find("div.app_holder iframe").attr({"height":app_holder_height,"width":app_holder_width});
|
$(this).find("div.app_holder iframe").attr({"height":app_holder_height,"width":app_holder_width});
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -372,14 +372,14 @@ var orbitDesktop = function(dom){
|
||||||
this.value = terms.join( ", " );
|
this.value = terms.join( ", " );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.layout_data = function(h){
|
this.layout_data = function(h){
|
||||||
var $e;
|
var $e;
|
||||||
var column_container,layout, base_width, total_width, gutter, no_of_entries = 0, pagination_link, pagination_variable;
|
var column_container,layout, base_width , no_of_entries = 0, pagination_link , pagination_variable, gutter, total_width;
|
||||||
o.paging = true;
|
o.paging = true;
|
||||||
gutter = (!isNaN(gutter)) ? gutter : 12;
|
gutter = (!isNaN(gutter)) ? gutter : 12;
|
||||||
this.layout_data.generate_layout_html = function(l){
|
this.layout_data.generate_layout_html = function(l){
|
||||||
|
@ -393,6 +393,7 @@ var orbitDesktop = function(dom){
|
||||||
case "simple":
|
case "simple":
|
||||||
total_columns++;
|
total_columns++;
|
||||||
temp_div.append(column_container.html());
|
temp_div.append(column_container.html());
|
||||||
|
total_width = "auto";
|
||||||
break;
|
break;
|
||||||
case "datalist":
|
case "datalist":
|
||||||
no_of_entries = (typeof column_container.attr("per-column") != "undefined"? parseInt(column_container.attr("per-column")) : 4);
|
no_of_entries = (typeof column_container.attr("per-column") != "undefined"? parseInt(column_container.attr("per-column")) : 4);
|
||||||
|
@ -411,7 +412,10 @@ var orbitDesktop = function(dom){
|
||||||
x = 0;
|
x = 0;
|
||||||
temp_div.append(column);
|
temp_div.append(column);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
if(x != 0){
|
||||||
|
temp_div.append(column);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
total_width = (!isNaN(base_width)) ? (base_width + gutter*2 +1) * total_columns : null;
|
total_width = (!isNaN(base_width)) ? (base_width + gutter*2 +1) * total_columns : null;
|
||||||
break;
|
break;
|
||||||
|
@ -424,12 +428,11 @@ var orbitDesktop = function(dom){
|
||||||
column.append(ul);
|
column.append(ul);
|
||||||
x++;
|
x++;
|
||||||
temp_div.append(column);
|
temp_div.append(column);
|
||||||
});
|
})
|
||||||
}
|
|
||||||
total_width = (!isNaN(base_width)) ? (base_width + gutter*2 +1) * total_columns : null;
|
total_width = (!isNaN(base_width)) ? (base_width + gutter*2 +1) * total_columns : null;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// total_width = (!isNaN(base_width) ? ( base_width + 12 ) * total_columns : null);
|
// total_width = (!isNaN(base_width) ? ( base_width + 12 ) * total_columns : null);
|
||||||
|
@ -470,22 +473,20 @@ var orbitDesktop = function(dom){
|
||||||
var f = o.layout_data.generate_layout_html(html);
|
var f = o.layout_data.generate_layout_html(html);
|
||||||
// console.log(f.total)
|
// console.log(f.total)
|
||||||
if(f.total > 0){
|
if(f.total > 0){
|
||||||
$("div[container=true] .overview").append(f.markup);
|
$("div[container=true] div.overview").append(f.markup);
|
||||||
if(f.width){
|
if(f.width){
|
||||||
var w = $("div[container=true] .overview").width();
|
var w = $("div[container=true] div.overview").width();
|
||||||
$("div[container=true] .overview").width(w+f.width);
|
$("div[container=true] div.overview").width(w+f.width);
|
||||||
}
|
}
|
||||||
o.tinyscrollbar.tinyscrollbar_update("relative");
|
o.tinyscrollbar.tinyscrollbar_update("relative");
|
||||||
o.paging = true;
|
o.paging = true;
|
||||||
} else {
|
}else{o.paging = false;}
|
||||||
o.paging = false;
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.insert_new_column = function(index){
|
this.insert_new_column = function(index){
|
||||||
var column_container = $("div[container=true] .overview"),layout = column_container.attr("content-layout"),base_width = parseInt(column_container.attr("base-width")),column;
|
var column_container = $("div[container=true] div.overview"),layout = column_container.attr("content-layout"),base_width = parseInt(column_container.attr("base-width")),column;
|
||||||
var i = (index == 0? 0 : index-1);
|
var i = (index == 0? 0 : index-1);
|
||||||
var previous_column = column_container.find(".column").eq(i);
|
var previous_column = column_container.find(".column").eq(i);
|
||||||
if(previous_column.length == 0)return false;
|
if(previous_column.length == 0)return false;
|
||||||
|
@ -514,7 +515,7 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
|
|
||||||
this.remove_column = function(index){
|
this.remove_column = function(index){
|
||||||
var column_container = $("div[container=true] .overview"),layout = column_container.attr("content-layout"),column = column_container.find(".column").eq(index),base_width = parseInt(column_container.attr("base-width"));
|
var column_container = $("div[container=true] div.overview"),layout = column_container.attr("content-layout"),column = column_container.find(".column").eq(index),base_width = parseInt(column_container.attr("base-width"));
|
||||||
if(column.length == 0)return false;
|
if(column.length == 0)return false;
|
||||||
switch(layout){
|
switch(layout){
|
||||||
case "datalist":
|
case "datalist":
|
||||||
|
@ -541,69 +542,52 @@ var orbitDesktop = function(dom){
|
||||||
o.lastlink = url;
|
o.lastlink = url;
|
||||||
o.data_method = dom.attr("callback-method");
|
o.data_method = dom.attr("callback-method");
|
||||||
if(o.currenthtml!=target){
|
if(o.currenthtml!=target){
|
||||||
if(o.desktopData[o.currentface] == "undefined"){
|
if(o.desktopData[o.currentface] == "undefined")
|
||||||
o.desktopData[o.currentface] = "";
|
o.desktopData[o.currentface] = "";
|
||||||
}
|
|
||||||
o.desktopData[o.currentface] = $(o.contentHolder).html();
|
o.desktopData[o.currentface] = $(o.contentHolder).html();
|
||||||
if(customload){
|
if(customload){
|
||||||
$(o.contentHolder).html("<div id='content'></div>");
|
$(o.contentHolder).html("<div id='content'></div>");
|
||||||
}
|
}
|
||||||
$("#content > #holder").toggle("drop",{ easing: "easeInOutQuint" },o.transitionTime,function(){
|
$("#content").hide("drop",o.transitionTime,function(){
|
||||||
o.currenthtml = target;
|
o.currenthtml = target;
|
||||||
o.currentface = target;
|
o.currentface = target;
|
||||||
var cache = false;
|
var cache = false;
|
||||||
if(!o.desktopData[o.currentface]){
|
if(!o.desktopData[o.currentface]){
|
||||||
$(o.contentHolder).empty().load(url,function(data){
|
$(o.contentHolder).empty().load(url,function(data){
|
||||||
if(typeof o.data_method != "undefined"){
|
if(typeof o.data_method != "undefined"){
|
||||||
if(o.data_method != ""){
|
if(o.data_method != "")
|
||||||
window.o[o.data_method](target,url,cache);
|
window.o[o.data_method](target,url,cache);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
try {
|
|
||||||
if(!customload){
|
|
||||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
|
||||||
} else {
|
|
||||||
if(submenuitem){
|
|
||||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"));
|
|
||||||
} else {
|
|
||||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch(EX){}
|
|
||||||
header_ani();
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
|
||||||
try{
|
try{
|
||||||
if(!customload){
|
if(!customload)
|
||||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"));
|
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
||||||
}else{
|
else{
|
||||||
if(submenuitem)
|
if(submenuitem)
|
||||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"));
|
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"));
|
||||||
else
|
else
|
||||||
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"));
|
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
||||||
|
}
|
||||||
|
}catch(EX){}
|
||||||
|
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||||
|
try{
|
||||||
|
if(!customload)
|
||||||
|
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
||||||
|
else{
|
||||||
|
if(submenuitem)
|
||||||
|
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[custom-load="+submenuitem+"]"));
|
||||||
|
else
|
||||||
|
o.sub_menu_item($(o.contentHolder).find("*[content-type=menu] a[load=true]"),data);
|
||||||
}
|
}
|
||||||
}catch(EX){}
|
}catch(EX){}
|
||||||
cache = true;
|
cache = true;
|
||||||
if(typeof o.data_method != "undefined"){
|
if(typeof o.data_method != "undefined"){
|
||||||
if(o.data_method != ""){
|
if(o.data_method != "")
|
||||||
window.o[o.data_method](target,url,cache);
|
window.o[o.data_method](target,url,cache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
$('#header')
|
|
||||||
.delay(600)
|
|
||||||
.effect('drop',{
|
|
||||||
easing: 'easeInOutQuint',
|
|
||||||
direction: 'down'
|
|
||||||
},300);
|
|
||||||
}
|
|
||||||
|
|
||||||
var header_ani = function(){
|
|
||||||
$('#header').hide().toggle('drop',{easing: 'easeInOutQuint', direction:'down'});
|
|
||||||
$('#header > *').each(function(i){
|
|
||||||
$(this).hide().delay(i*100).fadeIn(600,'easeInOutQuint');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -648,56 +632,173 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initializeDesktop = function(target,url,cache){ //this is for initializing main desktops that are sections and tiles
|
this.initializeDesktop = function(target,url,cache){ //this is for initializing main desktops that are sections and tiles
|
||||||
target = (!target) ? 'desktop' : target;
|
if(!target)target = "desktop";
|
||||||
var bindHandlers = function(){ // this function will bind all the handlers in the desktop
|
var bindHandlers = function(){ // this function will bind all the handlers in the desktop
|
||||||
|
// var groupWrapperWidth = 0;
|
||||||
|
// $("div#desktop .group").each(function(){groupWrapperWidth+=$(this).outerWidth(true);});
|
||||||
|
// var grps = new Array;
|
||||||
|
// $("div#desktop #group_wrapper").css("width",groupWrapperWidth);
|
||||||
|
// var first = true;
|
||||||
|
// $("div#desktop .g_col").sortable({
|
||||||
|
// connectWith: ".g_col",
|
||||||
|
// tolerance: 'pointer' ,
|
||||||
|
// revert: 300,
|
||||||
|
// containment: '#group_wrapper',
|
||||||
|
// helper: 'clone',
|
||||||
|
// stop:function(){
|
||||||
|
// first = true;
|
||||||
|
// var grpwidth = 0;
|
||||||
|
// for(i in grps){
|
||||||
|
// var grp = grps[i];
|
||||||
|
// if(grp.find(".element").length == 0){
|
||||||
|
// grp.animate({"width":"0px"},500,function(){$(this).remove();});
|
||||||
|
// grpwidth+=225;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// grps = [];
|
||||||
|
// $("#group_wrapper").width($("#group_wrapper").width()-grpwidth);
|
||||||
|
// },
|
||||||
|
// start:function(){
|
||||||
|
// $("#group_wrapper").find("div.group").each(function(i,par){
|
||||||
|
// var nextnumber = $(this).find("ul").length;
|
||||||
|
// $newcol = $('<ul class="g_col g_col_w2 col'+nextnumber+' ui-sortable">');
|
||||||
|
// $(this).append($newcol);
|
||||||
|
// $newcol.sortable({connectWith: '.g_col'});
|
||||||
|
// grps.push($newcol);
|
||||||
|
// $("#group_wrapper").width($("#group_wrapper").width()+225);
|
||||||
|
// });
|
||||||
|
// $("div#desktop .g_col").sortable('refresh');
|
||||||
|
// },
|
||||||
|
// update:function(){
|
||||||
|
// if(first){
|
||||||
|
// first = false;
|
||||||
|
// var newpostitions = new Array;
|
||||||
|
// var groupids = new Array;
|
||||||
|
// $.each($("div#desktop .group"),function(i,grp){
|
||||||
|
// var groupone = new Array;
|
||||||
|
// groupids.push($(grp).attr("id"));
|
||||||
|
// $ul = $(grp).find(".g_col .element");
|
||||||
|
// $.each($ul,function(){
|
||||||
|
// groupone.push($(this).attr("id"));
|
||||||
|
// })
|
||||||
|
// newpostitions.push(groupone);
|
||||||
|
// });
|
||||||
|
// $.post("/desktop/newpositions",{"sectionid":o.sectionId,"newpos":newpostitions,"groupids":groupids});
|
||||||
|
// }
|
||||||
|
// var s = $(this).find('.element').length;
|
||||||
|
// if(s!=0){
|
||||||
|
// last = $(this).find('.element').eq(s-1).position(),
|
||||||
|
// lasth = $(this).find('.element').eq(s-1).outerHeight(true);
|
||||||
|
// if ((last.top+lasth)>528){
|
||||||
|
// $(this).sortable('cancel');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// $("#group_wrapper ul").each(function(){
|
||||||
|
// if($(this).find('.element').length == 0)
|
||||||
|
// $(this).animate({"width":"0px"},500,function(){$(this).remove();});
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
// receive: function(event, ui){
|
||||||
|
// var s = $(this).find('.element').length,
|
||||||
|
// last = $(this).find('.element').eq(s-1).position(),
|
||||||
|
// lasth = $(this).find('.element').eq(s-1).outerHeight(true);
|
||||||
|
// if ((last.top+lasth)>528){
|
||||||
|
// $(ui.sender).sortable('cancel');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
var dragged = null,draggable,lastpos = [];
|
var dragged = null,draggable,lastpos = [];
|
||||||
o.gridvar = $(".grid ul").find("> li ")
|
o.gridvar = $(".grid ul").find("> li ").mousedown(function(e){
|
||||||
.mousedown(function(e){
|
|
||||||
!draggable;
|
!draggable;
|
||||||
dragged = $(this);
|
dragged = $(this);
|
||||||
lastpos = [];
|
lastpos = [];
|
||||||
$(".grid ul li").each(function(){
|
$(".grid ul li").each(function(){
|
||||||
lastpos.push({"col":$(this).attr("data-col"),"row":$(this).attr("data-row")});
|
lastpos.push({"col":$(this).attr("data-col"),"row":$(this).attr("data-row")})
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.end()
|
}).end()
|
||||||
.gridster({
|
.gridster({
|
||||||
widget_margins: [6, 6],
|
widget_margins: [6, 6],
|
||||||
widget_base_dimensions: [120, 120],
|
widget_base_dimensions: [120, 120],
|
||||||
|
// avoid_overlapped_widgets: true,
|
||||||
|
serialize_params: function($w, wgd) { return { col: wgd.col, row: wgd.row, id: $w.data("id") } },
|
||||||
draggable : {
|
draggable : {
|
||||||
start: function(event, ui){
|
start : function(event, ui){
|
||||||
dragged.addClass("noClick");
|
dragged.addClass("noClick");
|
||||||
},
|
},
|
||||||
stop: function(event, ui){
|
stop: function(event, ui){
|
||||||
|
|
||||||
|
// var widgetchanged_col = dragged.attr("data-col");
|
||||||
|
// var total = 0;
|
||||||
|
// // console.log(widgetchanged.col);
|
||||||
|
// // console.log(o.gridvar.serialize_changed());
|
||||||
|
// $(".grid ul li[data-col="+widgetchanged_col+"]").each(function(i,w){
|
||||||
|
// var size = parseInt($(this).attr("data-sizey"));
|
||||||
|
// if(!isNaN(size)){
|
||||||
|
// total += size;
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// // other way to calculate the overflow is by top > height of div
|
||||||
|
// if(total>totaltiles_in_a_row){
|
||||||
|
// revertbacktiles();
|
||||||
|
// }else{
|
||||||
|
// console.log(widgetchanged_col-1);
|
||||||
|
// $(".grid ul li[data-col="+(widgetchanged_col-1)+"]").each(function(i,w){
|
||||||
|
// var sizey = parseInt($(this).attr("data-sizey"));
|
||||||
|
// var sizex = parseInt($(this).attr("data-sizex"));
|
||||||
|
// if(sizey==1){
|
||||||
|
// sizex = sizex - 1;
|
||||||
|
// }
|
||||||
|
// console.log(sizex);
|
||||||
|
|
||||||
|
// if(!isNaN(sizex)){
|
||||||
|
// total += sizex;
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// if(total>totaltiles_in_a_row){
|
||||||
|
// revertbacktiles();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
for (var i = 1; i <= 30; i++) {
|
for (var i = 1; i <= 30; i++) {
|
||||||
// var celement = $(".grid ul .widget[data-col="+i+"]:last");
|
// var celement = $(".grid ul .widget[data-col="+i+"]:last");
|
||||||
$(".grid ul .widget[data-col="+i+"]").each(function(){
|
$(".grid ul .widget[data-col="+i+"]").each(function(){
|
||||||
var pos = $(this).position();
|
var pos = $(this).position();
|
||||||
if(pos && (pos.top + $(this).height() + 6) > 550){
|
if(pos){
|
||||||
|
|
||||||
|
if((pos.top + $(this).height() + 6) > 550){
|
||||||
revertbacktiles();
|
revertbacktiles();
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.data('gridster');
|
|
||||||
|
}
|
||||||
|
var newpos = o.gridvar.serialize();
|
||||||
|
console.log(newpos);
|
||||||
|
$.post("/desktop/newpositions",{"newpositions":newpos});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).data('gridster');
|
||||||
var revertbacktiles = function(){
|
var revertbacktiles = function(){
|
||||||
lastpos.push({"col":"","row":""});
|
lastpos.push({"col":"","row":""});
|
||||||
$(".grid ul li").each(function(i){
|
$(".grid ul li").each(function(i){
|
||||||
$(this).attr({"data-col":lastpos[i].col,"data-row":lastpos[i].row});
|
$(this).attr({"data-col":lastpos[i].col,"data-row":lastpos[i].row});
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
var remove_empty_columns = function(){
|
var remove_empty_columns = function(){
|
||||||
for (var i = 1; i <= 30; i++) {
|
for (var i = 1; i <= 30; i++) {
|
||||||
// var celement = $(".grid ul .widget[data-col="+i+"]:last");
|
// var celement = $(".grid ul .widget[data-col="+i+"]:last");
|
||||||
$(".grid ul .widget[data-col="+i+"]").each(function(){
|
$(".grid ul .widget[data-col="+i+"]").each(function(){
|
||||||
|
|
||||||
});
|
})
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$(".app[data-category=app]").click(function(){
|
o.simple_drop_down();
|
||||||
|
o.tinyscrollbar_ext({
|
||||||
|
main: '.tinycanvas'
|
||||||
|
})
|
||||||
|
$("li.app[data-category=app]").click(function(){
|
||||||
if(!$(this).hasClass("noClick")){
|
if(!$(this).hasClass("noClick")){
|
||||||
var url = $(this).find("a").data("url");
|
var url = $(this).find("a").data("url");
|
||||||
var app = $(this);
|
var app = $(this);
|
||||||
|
@ -709,64 +810,135 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
dragged.removeClass("noClick");
|
dragged.removeClass("noClick");
|
||||||
|
|
||||||
});
|
})
|
||||||
var element = $('.gridster li');
|
|
||||||
$.each(element, function(i){
|
|
||||||
if($(this).attr("data-category")=="app" && $(this).find('.text_wrapper').length < 1){
|
|
||||||
$(this).find('.appname').wrapInner('<span class="text_wrapper"/>');
|
|
||||||
var w = $(this).find('.text_wrapper').width();
|
|
||||||
if (w > 96){
|
|
||||||
var text = $(this).find('.text_wrapper').text();
|
|
||||||
slice = text.substr(0,12);
|
|
||||||
$(this).find('.text_wrapper').attr('title',text).text(slice+'...');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
o.simple_drop_down();
|
// $("div#group_wrapper ul li[data-category=app]").click(function(){
|
||||||
o.tinyscrollbar_ext({
|
// o.appWindow({
|
||||||
main: '.tinycanvas'
|
// title : $(this).find("a").attr("href"),
|
||||||
});
|
// appid : $(this).find("a").attr("href")
|
||||||
|
// });
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
var loadTiles = function(id){ //This will load tiles for a specific desktop .. id of section has to be passed here to load tiles
|
var loadTiles = function(id){ //This will load tiles for a specific desktop .. id of section has to be passed here to load tiles
|
||||||
$("#desktop #group_wrapper").empty();
|
$("div#desktop div#group_wrapper").empty();
|
||||||
$.getJSON("/desktop/getgroups",{sectionid:id},function(tiles){
|
$.getJSON("/desktop/getgroups",{sectionid:id},function(tiles){
|
||||||
tiles.sort(o.sortJSON("position",true,parseInt));
|
// tiles.sort(o.sortJSON("position",true,parseInt));
|
||||||
var tilecolors = o.themesettings.tilecolor;
|
var tilecolors = o.themesettings.tilecolor;
|
||||||
var totaltiles_in_a_row = 4;
|
var totaltiles_in_a_row = 4;
|
||||||
var opacity = ["op07","op08","op09",""];
|
var opacity = ["op07","op08","op09",""];
|
||||||
var row = 1, col = 1, x = 1, y = 1;
|
var row = 0,col = 1,x = 1,y = 1,total_x = 0,prev_y = 0;
|
||||||
var $group = $('<div class="grid gridster"></div>');
|
var $group = $('<div class="grid gridster"></div>');
|
||||||
var $ul = $('<ul></ul>');
|
var $ul = $('<ul style="margin: -6px 0 0 -6px;"></ul>');
|
||||||
|
|
||||||
$.each(tiles,function(i,tile){
|
$.each(tiles,function(i,tile){
|
||||||
if(row >= 4){
|
|
||||||
row = 1;
|
|
||||||
col++;
|
|
||||||
}
|
|
||||||
var shape = tile.shape.split(" ");
|
var shape = tile.shape.split(" ");
|
||||||
|
// if(tile.title == "Weather")console.log("Big - row : " + tile.row + ", col : "+ tile.column);
|
||||||
|
// if(tile.title == "Google Scholar")console.log("Scholar - row : " + tile.row + ", col : "+ tile.column);
|
||||||
|
|
||||||
|
// if(total_x % 2 != 0)
|
||||||
|
// row = row - y;
|
||||||
|
// if(i == 7)tile.row = null;
|
||||||
|
if(tile.row){
|
||||||
|
row = tile.row;
|
||||||
|
col = tile.column;
|
||||||
x = parseInt(shape[0].substr(1,1));
|
x = parseInt(shape[0].substr(1,1));
|
||||||
y = parseInt(shape[1].substr(1,1));
|
y = parseInt(shape[1].substr(1,1));
|
||||||
|
}else{
|
||||||
|
console.log(row + " : " + col);
|
||||||
|
x = parseInt(shape[0].substr(1,1));
|
||||||
|
if(total_x % 2 == 0){
|
||||||
|
row = row + y;
|
||||||
|
}else if(x == 1){
|
||||||
|
col++;
|
||||||
|
}
|
||||||
|
y = parseInt(shape[1].substr(1,1));
|
||||||
|
total_x = total_x + ( x * y );
|
||||||
|
prev_y = y;
|
||||||
|
if(total_x > 8){
|
||||||
|
row = 1;
|
||||||
|
total_x = 0;
|
||||||
|
col++;
|
||||||
|
}
|
||||||
|
}
|
||||||
var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)];
|
var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)];
|
||||||
var op = opacity[Math.floor(Math.random()*opacity.length)];
|
var op = opacity[Math.floor(Math.random()*opacity.length)];
|
||||||
var f = (tile.fullsize?"fullsize":null);
|
var f = (tile.fullsize?"fullsize":null);
|
||||||
|
|
||||||
if(tile.data_category == "app"){
|
if(tile.data_category == "app")
|
||||||
$li = $('<li data-id="'+tile.id+'" class="app" data-row="'+row+'" data-col="'+col+'" data-sizex="'+x+'" data-sizey="'+y+'" data-title="'+tile.title+'" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile.data_content+'" class="appicon" onclick="return false;" data-url="'+tile.link+'"><img src="'+o.iconPath+tile.data_content+'.png" alt="" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
$li = $('<li data-id="'+tile.id+'" class="app" data-row="'+row+'" data-col="'+col+'" data-sizex="'+x+'" data-sizey="'+y+'" data-title="'+tile.title+'" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile.data_content+'" class="appicon" onclick="return false;" data-url="'+tile.link+'"><img src="'+o.iconPath+tile.data_content+'.png" alt="" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
||||||
} else {
|
else
|
||||||
$li = $('<li data-id="'+tile.id+'" class="widget '+f+'" data-row="'+row+'" data-col="'+col+'" data-sizex="'+x+'" data-sizey="'+y+'" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" js-link="'+tile.js[0].url+'" css-link="'+tile.css.url+'"><span class="tile '+tilecolor+' '+op+'"></span><div class="appholder"></div><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
$li = $('<li data-id="'+tile.id+'" class="widget '+f+'" data-row="'+row+'" data-col="'+col+'" data-sizex="'+x+'" data-sizey="'+y+'" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" js-link="'+tile.js[0].url+'" css-link="'+tile.css.url+'"><span class="tile '+tilecolor+' '+op+'"></span><div class="appholder"><div class="thmtxt all-loading"><i class="icon-spinner icon-spin"></i> Loading </div></div><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
||||||
}
|
|
||||||
|
|
||||||
row = row + y;
|
|
||||||
|
|
||||||
$ul.append($li);
|
$ul.append($li);
|
||||||
});
|
})
|
||||||
$group.append($ul);
|
$group.append($ul);
|
||||||
$("#desktop #group_wrapper").append($group);
|
$("div#desktop div#group_wrapper").append($group);
|
||||||
|
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
o.initializeWidgets();
|
o.initializeWidgets();
|
||||||
});
|
})
|
||||||
|
// var tilecolors = o.themesettings.tilecolor;
|
||||||
|
// var opacity = ["op05","op06","op07","op08","op09"];
|
||||||
|
// $.each(groups,function(i,group){
|
||||||
|
// group.sort(o.sortJSON("position",true,parseInt));
|
||||||
|
// // var $group = $('<div class="group"><ul class="grp ui-sortable"></ul></div>'),
|
||||||
|
// var colindex = 0,
|
||||||
|
// $group = $('<div class="group"></div>'),
|
||||||
|
// $col = $('<ul class="g_col g_col_w2 col'+ colindex +'"/>'),
|
||||||
|
// $li,
|
||||||
|
// bdsum = 0,
|
||||||
|
// bwsum = 0,
|
||||||
|
// bhsum = 0,
|
||||||
|
// small = 0,
|
||||||
|
// single = false;
|
||||||
|
// $group.append($col);
|
||||||
|
// for(j=0;j<group.length;j++){
|
||||||
|
// var tile = group[j];
|
||||||
|
// var brick = tile.shape.replace(' holder_f','').split(' '),
|
||||||
|
// bw = parseInt(brick[0].substr(1)),
|
||||||
|
// bh = parseInt(brick[1].substr(1)),
|
||||||
|
// bd = bw * bh;
|
||||||
|
// if(bh==1 && bw==1){
|
||||||
|
// small++;
|
||||||
|
// }else if(bh!=1 && bw!=1){
|
||||||
|
// single = true;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if(small==2){
|
||||||
|
// small=0;
|
||||||
|
// single=false;
|
||||||
|
// }else if(small==1 && single==true){
|
||||||
|
// bh++;
|
||||||
|
// small=0;
|
||||||
|
// single=false;
|
||||||
|
// }else{small=0;single=false;}
|
||||||
|
|
||||||
|
// bdsum+=bd;
|
||||||
|
// bwsum+=bw;
|
||||||
|
// bhsum+=bh;
|
||||||
|
|
||||||
|
// if(bdsum > 8 || bhsum > 6){
|
||||||
|
// bdsum = 0, bhsum = 0, colindex++,j--;
|
||||||
|
// $group.append('<ul class="g_col g_col_w2 col'+ colindex +'"/>');
|
||||||
|
// }else{
|
||||||
|
// var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)];
|
||||||
|
// var op = opacity[Math.floor(Math.random()*opacity.length)];
|
||||||
|
// if(j==0)$group.attr("id",tile.group_id);
|
||||||
|
|
||||||
|
// if(tile.data_category == "app")
|
||||||
|
// $li = $('<li data-id="'+tile.id+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" ><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile.data_content+'" class="appicon" onclick="return false;"><img src="'+o.iconPath+tile.data_content+'.png" alt="" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
||||||
|
// else
|
||||||
|
// $li = $('<li data-id="'+tile.id+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" js-link="'+tile.js[0].url+'" css-link="'+tile.css.url+'"><span class="tile '+tilecolor+' '+op+'"></span><h1 class="appname thmtxt">'+tile.title+'</h1><div class="appholder">Loading...</div></li>');
|
||||||
|
|
||||||
|
// $group.find('.col'+colindex).append($li);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// $("div#desktop div#group_wrapper").append($group);
|
||||||
|
// })
|
||||||
|
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
var loadSectionList = function(){ //This will load the section list from the db
|
var loadSectionList = function(){ //This will load the section list from the db
|
||||||
$.getJSON("/desktop/getsectionlist",{desktopid:o.desktopId},function(sectionlist){
|
$.getJSON("/desktop/getsectionlist",{desktopid:o.desktopId},function(sectionlist){
|
||||||
|
@ -777,39 +949,39 @@ var orbitDesktop = function(dom){
|
||||||
tempstyle = "style='display:none;'";
|
tempstyle = "style='display:none;'";
|
||||||
$("#desktop #section_heading").text(section.name);
|
$("#desktop #section_heading").text(section.name);
|
||||||
}
|
}
|
||||||
$("#desktop #section_list").append($('<li class="section_name" '+tempstyle+'><a class="admtxt hp hh1" onclick="return false;" href="'+section._id+'" >'+section.name+'</a></li>'));
|
$("div#desktop ul#section_list").append($('<li class="section_name" '+tempstyle+'><a class="admtxt hp w2 hh1" onclick="return false;" href="'+section._id+'" >'+section.name+'</a></li>'));
|
||||||
});
|
})
|
||||||
bindSecondaryHandlers();
|
bindSecondaryHandlers();
|
||||||
o.simple_drop_down();
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
var bindSecondaryHandlers = function(){ //This is the secondary bind handler function which is used to bind events which are repeatative
|
var bindSecondaryHandlers = function(){ //This is the secondary bind handler function which is used to bind events which are repeatative
|
||||||
$("#desktop #section_list .section_name").click(function(){
|
$("div#desktop ul#section_list li.section_name").click(function(){
|
||||||
$("#desktop .section_name").show();
|
$("div#desktop li.section_name").show();
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
$("#desktop #section_heading").text($(this).text());
|
$("#desktop #section_heading").text($(this).text());
|
||||||
o.sectionId = $(this).find("a").attr("href");
|
o.sectionId = $(this).find("a").attr("href");
|
||||||
loadTiles(o.sectionId);
|
loadTiles(o.sectionId);
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
if(cache){
|
if(cache){
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
o.initializeWidgets();
|
o.initializeWidgets();
|
||||||
$("#desktop #section_list").empty();
|
bindSecondaryHandlers();
|
||||||
|
$("div#desktop ul#section_list").empty();
|
||||||
$.each(o.sectionList,function(i,section){
|
$.each(o.sectionList,function(i,section){
|
||||||
var tempstyle="";
|
var tempstyle="";
|
||||||
if(section._id==o.sectionId){
|
if(section._id==o.sectionId){
|
||||||
tempstyle = "style='display:none;'";
|
tempstyle = "style='display:none;'";
|
||||||
$("#desktop #section_heading").text(section.name);
|
$("div#desktop span#section_heading").text(section.name);
|
||||||
}
|
}
|
||||||
$("#desktop #section_list").append($('<li class="section_name" '+tempstyle+'><a class="admtxt hp hh1" onclick="return false;" href="'+section._id+'" >'+section.name+'</a></li>'));
|
$("div#desktop ul#section_list").append($('<li class="section_name" '+tempstyle+'><a class="admtxt hp w2 hh1" onclick="return false;" href="'+section._id+'" >'+section.name+'</a></li>'));
|
||||||
});
|
})
|
||||||
bindSecondaryHandlers();
|
bindSecondaryHandlers();
|
||||||
}else{
|
}else{
|
||||||
loadSectionList();
|
|
||||||
loadTiles(o.sectionId);
|
loadTiles(o.sectionId);
|
||||||
|
loadSectionList();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
this.tempFunc = function(th){
|
this.tempFunc = function(th){
|
||||||
$.post("desktop/twitter",function(){});
|
$.post("desktop/twitter",function(){});
|
||||||
|
@ -825,11 +997,11 @@ var orbitDesktop = function(dom){
|
||||||
//for textbox search
|
//for textbox search
|
||||||
$("#app_manager #searchbox").focus(function(){$(this).val("");}).keyup(function(e){
|
$("#app_manager #searchbox").focus(function(){$(this).val("");}).keyup(function(e){
|
||||||
if($(this).val()){
|
if($(this).val()){
|
||||||
$("#app_manager .search_result").empty();
|
$("div#app_manager .search_result").empty();
|
||||||
$("#app_manager #seperator").hide();
|
$("div#app_manager #seperator").hide();
|
||||||
searchArray = $("#app_manager .element:containsi("+$(this).val()+")");
|
searchArray = $("div#app_manager .element:containsi("+$(this).val()+")");
|
||||||
if(searchArray.length>0){
|
if(searchArray.length>0){
|
||||||
$("#app_manager #seperator").show();
|
$("div#app_manager #seperator").show();
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var $column;
|
var $column;
|
||||||
searchArray.each(function(){
|
searchArray.each(function(){
|
||||||
|
@ -840,19 +1012,19 @@ var orbitDesktop = function(dom){
|
||||||
var $newelement = $('<div class="search element w1 h1 hp vp thmc2" data-category="desktop">'+$(this).html()+'</div>');
|
var $newelement = $('<div class="search element w1 h1 hp vp thmc2" data-category="desktop">'+$(this).html()+'</div>');
|
||||||
$column.append($newelement);
|
$column.append($newelement);
|
||||||
if(i == 4){
|
if(i == 4){
|
||||||
$("#app_manager .search_result").append($column);
|
$("div#app_manager .search_result").append($column);
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if(i != 0){
|
if(i != 0){
|
||||||
$("#app_manager .search_result").append($column);
|
$("div#app_manager .search_result").append($column);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{$("#app_manager #seperator").hide();$("#app_manager .search_result").empty();}
|
}else{$("div#app_manager #seperator").hide();$("div#app_manager .search_result").empty();}
|
||||||
}).blur(function(){$(this).val("Search");});
|
}).blur(function(){$(this).val("Search");});
|
||||||
|
|
||||||
//for Alphabet sorting
|
//for Alphabet sorting
|
||||||
$("#app_manager #alphabet_sort_btn").click(function(){
|
$("div#app_manager a#alphabet_sort_btn").click(function(){
|
||||||
switch ($(this).attr("href")){
|
switch ($(this).attr("href")){
|
||||||
case "ascending":
|
case "ascending":
|
||||||
$(this).attr("href","descending").find(".thmtxt").text("Alphabet [Z-A]");
|
$(this).attr("href","descending").find(".thmtxt").text("Alphabet [Z-A]");
|
||||||
|
@ -860,10 +1032,10 @@ var orbitDesktop = function(dom){
|
||||||
break;
|
break;
|
||||||
case "descending":
|
case "descending":
|
||||||
$(this).attr("href","ascending").find(".thmtxt").text("Alphabet [A-Z]");
|
$(this).attr("href","ascending").find(".thmtxt").text("Alphabet [A-Z]");
|
||||||
allApps = $("#app_manager .group_search .element").sort(sortDescending);
|
allApps = $("div#app_manager .group_search .element").sort(sortDescending);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$("#app_manager #app_list").empty();
|
$("div#app_manager #app_list").empty();
|
||||||
var count = 0, colindex = 0;
|
var count = 0, colindex = 0;
|
||||||
$('#app_list').append('<div class="g_col g_col_w1 col'+ colindex +'"/>');
|
$('#app_list').append('<div class="g_col g_col_w1 col'+ colindex +'"/>');
|
||||||
$.each(allApps,function(i,app){
|
$.each(allApps,function(i,app){
|
||||||
|
@ -875,9 +1047,9 @@ var orbitDesktop = function(dom){
|
||||||
} else {
|
} else {
|
||||||
$('.g_col.col'+ colindex).append(app);
|
$('.g_col.col'+ colindex).append(app);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
return false;
|
return false;
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
var loadApps = function(){ //this load apps for sorting and searching
|
var loadApps = function(){ //this load apps for sorting and searching
|
||||||
$.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){
|
$.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){
|
||||||
|
@ -895,23 +1067,22 @@ var orbitDesktop = function(dom){
|
||||||
} else {
|
} else {
|
||||||
$('.g_col.col'+ colindex).append($app);
|
$('.g_col.col'+ colindex).append($app);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
if(cache){
|
if(cache)
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
} else {
|
else
|
||||||
loadApps();
|
loadApps();
|
||||||
}
|
|
||||||
};
|
};
|
||||||
this.initializeSectionsManager = function(target,url,cache){ // this is init function for section manager
|
this.initializeSectionsManager = function(target,url,cache){ // this is init function for section manager
|
||||||
var elementParent,element,slabel;
|
var elementParent,element,slabel;
|
||||||
var bindHandlers = function(){ // this is bind handler for section manager page
|
var bindHandlers = function(){ // this is bind handler for section manager page
|
||||||
var groupWrapperWidth = 0;
|
var groupWrapperWidth = 0;
|
||||||
$("#sections .group").each(function(){groupWrapperWidth+=$(this).width();})
|
$("div#sections .group").each(function(){groupWrapperWidth+=$(this).width();})
|
||||||
groupWrapperWidth+=200;
|
groupWrapperWidth+=200;
|
||||||
groupWrapperHeight = $(".group").height() + 20;
|
groupWrapperHeight = $(".group").height() + 20;
|
||||||
$("#group_wrapper").width(groupWrapperWidth);
|
$("#group_wrapper").width(groupWrapperWidth);
|
||||||
|
@ -925,9 +1096,9 @@ var orbitDesktop = function(dom){
|
||||||
slabel.find('li:not(:nth-child(1))').stop(1,1).fadeOut(500);
|
slabel.find('li:not(:nth-child(1))').stop(1,1).fadeOut(500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$("#sections #group_wrapper .appgroup").sortable(sortingoptions);
|
$("div#sections #group_wrapper .appgroup").sortable(sortingoptions);
|
||||||
|
|
||||||
$("#sections .section_label li:not(:nth-child(1))").droppable({
|
$("div#sections .section_label li:not(:nth-child(1))").droppable({
|
||||||
drop:function(event, ui){
|
drop:function(event, ui){
|
||||||
elementParent = ui.draggable.parents('.group');
|
elementParent = ui.draggable.parents('.group');
|
||||||
elementParentUl = ui.draggable.parents(".appgroup");
|
elementParentUl = ui.draggable.parents(".appgroup");
|
||||||
|
@ -971,7 +1142,7 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newul){
|
if(newul){
|
||||||
$("#sections #group_wrapper .appgroup").sortable(sortingoptions);
|
$("div#sections #group_wrapper .appgroup").sortable(sortingoptions);
|
||||||
$list.removeClass("no_app");
|
$list.removeClass("no_app");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1005,12 +1176,12 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
if(z!=x){
|
if(z!=x){
|
||||||
$lii = $('<li class="element w1 h1 hp vp thmtxt" style="display: none;" data-category="section'+(x+1)+'" data-content="'+o.sectionList[x]._id+'"><span class="tile thmc2 op06"></span><span class="thmtxt">'+o.sectionList[x].name+'</span></li>');
|
$lii = $('<li class="element w1 h1 hp vp thmtxt" style="display: none;" data-category="section'+(x+1)+'" data-content="'+o.sectionList[x]._id+'"><span class="tile thmc2 op06"></span><span class="thmtxt">'+o.sectionList[x].name+'</span></li>');
|
||||||
$group.find(".section_grp").append($lii);
|
$group.find("ul.section_grp").append($lii);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
z++;
|
z++;
|
||||||
|
|
||||||
$("#group_wrapper").append($group);
|
$("div#group_wrapper").append($group);
|
||||||
}
|
}
|
||||||
|
|
||||||
var x = 0;
|
var x = 0;
|
||||||
|
@ -1024,14 +1195,14 @@ var orbitDesktop = function(dom){
|
||||||
$li = $('<li class="element to_drop w1 hh2 hp vp" data-category="'+app.data_category+'" data-content="'+app.data_content+'" id="'+app._id+'"><div class="appicon"><img src="'+o.iconPath+app.data_content+'.png" class="" width="30" /></div><h1 class="appname thmtxth">'+app.title+'</h1></li>');
|
$li = $('<li class="element to_drop w1 hh2 hp vp" data-category="'+app.data_category+'" data-content="'+app.data_content+'" id="'+app._id+'"><div class="appicon"><img src="'+o.iconPath+app.data_content+'.png" class="" width="30" /></div><h1 class="appname thmtxth">'+app.title+'</h1></li>');
|
||||||
$ul.append($li);
|
$ul.append($li);
|
||||||
if(x == 7){
|
if(x == 7){
|
||||||
$("#group_wrapper #section"+(i+1)).append($ul);
|
$("div#group_wrapper div#section"+(i+1)).append($ul);
|
||||||
$("#group_wrapper #section"+(i+1)).removeClass("no_app")
|
$("div#group_wrapper div#section"+(i+1)).removeClass("no_app")
|
||||||
x = 0;
|
x = 0;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if(x != 0){
|
if(x != 0){
|
||||||
$("#group_wrapper #section"+(i+1)).append($ul);
|
$("div#group_wrapper div#section"+(i+1)).append($ul);
|
||||||
$("#group_wrapper #section"+(i+1)).removeClass("no_app")
|
$("div#group_wrapper div#section"+(i+1)).removeClass("no_app")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
|
@ -1057,7 +1228,7 @@ var orbitDesktop = function(dom){
|
||||||
this.initializeSettings.sections = function(){ // this load section page in setting page
|
this.initializeSettings.sections = function(){ // this load section page in setting page
|
||||||
var bindHandlers = function(){ // binding handlers in section page
|
var bindHandlers = function(){ // binding handlers in section page
|
||||||
|
|
||||||
$("#name_save_btn").click(function(){
|
$("a#name_save_btn").click(function(){
|
||||||
var desktopnm = new Array;
|
var desktopnm = new Array;
|
||||||
$("#desktop_names input").each(function(){
|
$("#desktop_names input").each(function(){
|
||||||
desktopnm.push($(this).val());
|
desktopnm.push($(this).val());
|
||||||
|
@ -1124,7 +1295,7 @@ var orbitDesktop = function(dom){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#theme_submit").click(function(){
|
$("a#theme_submit").click(function(){
|
||||||
o.confirm({
|
o.confirm({
|
||||||
message : "Are you sure that you want to save custom theme?",
|
message : "Are you sure that you want to save custom theme?",
|
||||||
highlighted : 1,
|
highlighted : 1,
|
||||||
|
@ -1268,7 +1439,7 @@ var orbitDesktop = function(dom){
|
||||||
$ul.find("input[type=password]").replaceWith("<div class='c_info pwd'>••••••</div>");
|
$ul.find("input[type=password]").replaceWith("<div class='c_info pwd'>••••••</div>");
|
||||||
$ul.find("a[for=new]").text("Edit").attr("for","edit");
|
$ul.find("a[for=new]").text("Edit").attr("for","edit");
|
||||||
$ul.find("a[for=delete]").show();
|
$ul.find("a[for=delete]").show();
|
||||||
$ul.find(".c_status").text("Connected").addClass("c_status_on");
|
$ul.find("span.c_status").text("Connected").addClass("c_status_on");
|
||||||
})
|
})
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
})
|
})
|
||||||
|
@ -1388,21 +1559,21 @@ var orbitDesktop = function(dom){
|
||||||
s_name_list_not+= "<a href='addthis' for='"+sec_link+"' style='text-decoration:underline;'>"+sec_name+"</a> ";
|
s_name_list_not+= "<a href='addthis' for='"+sec_link+"' style='text-decoration:underline;'>"+sec_name+"</a> ";
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
li.find(".status").html("Status : Installed on "+s_name_list);
|
li.find("div.status").html("Status : Installed on "+s_name_list);
|
||||||
if(s_name_list_not)
|
if(s_name_list_not)
|
||||||
li.find(".not_status").html("Install on "+s_name_list_not);
|
li.find("div.not_status").html("Install on "+s_name_list_not);
|
||||||
}else{
|
}else{
|
||||||
li.find(".not_status").html("Install on <a href='addthis' for='"+o.sectionList[0]._id+"' style='text-decoration:underline;'>"+o.sectionList[0].name+"</a> <a href='addthis' for='"+o.sectionList[1]._id+"' style='text-decoration:underline;'>"+o.sectionList[1].name+"</a> <a href='addthis' for='"+o.sectionList[2]._id+"' style='text-decoration:underline;'>"+o.sectionList[2].name+"</a> <a href='addthis' for='"+o.sectionList[3]._id+"' style='text-decoration:underline;'>"+o.sectionList[3].name)+"</a>";
|
li.find("div.not_status").html("Install on <a href='addthis' for='"+o.sectionList[0]._id+"' style='text-decoration:underline;'>"+o.sectionList[0].name+"</a> <a href='addthis' for='"+o.sectionList[1]._id+"' style='text-decoration:underline;'>"+o.sectionList[1].name+"</a> <a href='addthis' for='"+o.sectionList[2]._id+"' style='text-decoration:underline;'>"+o.sectionList[2].name+"</a> <a href='addthis' for='"+o.sectionList[3]._id+"' style='text-decoration:underline;'>"+o.sectionList[3].name)+"</a>";
|
||||||
}
|
}
|
||||||
//console.log(section_names);
|
//console.log(section_names);
|
||||||
column.find("ul").append(li);
|
column.find("ul").append(li);
|
||||||
if(counter%4==0){
|
if(counter%4==0){
|
||||||
$("#apps_store #widget_list").append(column);
|
$("#apps_store div#widget_list").append(column);
|
||||||
column = $('<div class="g_col list_t" style="width:350px;"><ul></ul></div>');
|
column = $('<div class="g_col list_t" style="width:350px;"><ul></ul></div>');
|
||||||
}
|
}
|
||||||
counter++;
|
counter++;
|
||||||
})
|
})
|
||||||
$("#apps_store #widget_list").append(column);
|
$("#apps_store div#widget_list").append(column);
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1422,52 +1593,32 @@ var orbitDesktop = function(dom){
|
||||||
this.loadWallpaper = function(wallpaper){ // this is to load new wallpaper
|
this.loadWallpaper = function(wallpaper){ // this is to load new wallpaper
|
||||||
wallpapernm = (!wallpaper) ? o.themesettings.background : wallpaper;
|
wallpapernm = (!wallpaper) ? o.themesettings.background : wallpaper;
|
||||||
if(!wallpaper){
|
if(!wallpaper){
|
||||||
$("#thmbackground").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+wallpapernm);
|
$("img#thmbackground").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+wallpapernm);
|
||||||
} else {
|
} else {
|
||||||
$("#thmbackground").attr("src",o.wallpaperPath+wallpaper);
|
$("img#thmbackground").attr("src",o.wallpaperPath+wallpaper);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.loadIconCache = function(){ // this function load or refresh icon cache for the theme
|
this.loadIconCache = function(){ // this function load or refresh icon cache for the theme
|
||||||
var imgs = $(".docklist img");
|
var imgs = $("ul.docklist img");
|
||||||
$.each(imgs,function(){
|
$.each(imgs,function(){
|
||||||
var setting_name = $(this).attr("id").replace("_icon","");
|
var setting_name = $(this).attr("id").replace("_icon","");
|
||||||
$(this).attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons[setting_name])
|
$(this).attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons[setting_name])
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
this.initializeWidgets = function(){ // this function will initialize all the widgets in the desktop
|
this.initializeWidgets = function(){ // this function will initialize all the widgets in the desktop
|
||||||
var elements = $("#group_wrapper .widget"),
|
var elements = $("#group_wrapper li.widget");
|
||||||
loading = '<div class="thmtxt o-loading"><i class="icon-spin icon-spinner"></i> Loading</div>';
|
|
||||||
$.each(elements,function(){
|
$.each(elements,function(){
|
||||||
var widget = $(this),
|
var widget = $(this);
|
||||||
widget_holder = $(this).find('.appholder'),
|
|
||||||
widget_style = (widget.find('.widget_style').length > 0) ? '' : '<link class="widget_style" rel="stylesheet" href="'+widget.attr("css-link")+'" type="text/css" />';
|
|
||||||
if(widget.attr("data-category")=="widget"){
|
if(widget.attr("data-category")=="widget"){
|
||||||
var widgetname = widget.attr("data-content");
|
var widgename = widget.attr("data-content");
|
||||||
widget_holder.before(widget_style).empty();
|
$.getScript(widget.attr("js-link"),function(){
|
||||||
$.getScript(widget.attr("js-link")).done(function(){
|
widget.find("div.appholder").load(widget.attr("data-content"));
|
||||||
// widget.find(".appholder").load(widget.attr("data-content"));
|
|
||||||
$.ajax({
|
|
||||||
url: widgetname,
|
|
||||||
beforeSend: function(){
|
|
||||||
widget_holder.html(loading);
|
|
||||||
},
|
|
||||||
success: function(html){
|
|
||||||
widget_holder
|
|
||||||
.css('top','100%')
|
|
||||||
.html(html);
|
|
||||||
},
|
|
||||||
complete: function(){
|
|
||||||
widget_holder
|
|
||||||
.delay(300)
|
|
||||||
.animate({top:'0'},500,'easeInOutQuint');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
$(this).find("div.appholder").append( '<link rel="stylesheet" id="dyn_css" href="'+widget.attr("css-link")+'" type="text/css" />')
|
||||||
// $(this).find(".appholder").append( '<link rel="stylesheet" href="'+widget.attr("css-link")+'" type="text/css" />');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
})
|
||||||
};
|
};
|
||||||
this.saveWallpaper = function(wallpaper){ // this function saves wallpaper in db
|
this.saveWallpaper = function(wallpaper){ // this function saves wallpaper in db
|
||||||
$.post("/desktop/save_desktop_settings",{"save":"wallpaper","wallpapernm":wallpaper,"desktopid":o.desktopId},function(result){
|
$.post("/desktop/save_desktop_settings",{"save":"wallpaper","wallpapernm":wallpaper,"desktopid":o.desktopId},function(result){
|
||||||
|
@ -1515,18 +1666,20 @@ var orbitDesktop = function(dom){
|
||||||
};
|
};
|
||||||
this.simple_drop_down = function(){
|
this.simple_drop_down = function(){
|
||||||
// simple dropdown menu
|
// simple dropdown menu
|
||||||
var $sdm = $('.sdm');
|
if( !$('.sdm').children('.sdm_o').length > 0 ){
|
||||||
if( $sdm.find('.sdm_o') ){
|
return;
|
||||||
$sdm.find('a').andSelf().on({
|
} else {
|
||||||
mouseenter: function(){
|
$('.sdm').hover(function(){
|
||||||
$(this).addClass('thmc2 thmtxt');
|
$(this).stop(1,1).toggleClass('thmc2 thmtxt');
|
||||||
},
|
}, function(){
|
||||||
mouseleave: function(){
|
$(this).stop(1,1).toggleClass('thmc2 thmtxt');
|
||||||
$(this).removeClass('thmc2 thmtxt');
|
});
|
||||||
}
|
$('.sdm').find('a').hover(function(){
|
||||||
|
$(this).stop(1,1).toggleClass('thmc2 thmtxt');
|
||||||
|
}, function(){
|
||||||
|
$(this).stop(1,1).toggleClass('thmc2 thmtxt');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
this.simple_tab = function(){
|
this.simple_tab = function(){
|
||||||
// tab
|
// tab
|
||||||
|
|
|
@ -147,7 +147,7 @@ var orbitDesktopAPI = function(){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var whtml =$('<div id="app_frame_'+o.windowcounter+'" class="thmc2 app_frame" data-app="'+settings.appid+'"><div id="content"><div id="header" class="hh3"><div class="dtitle hh3 hp" style="text-transform:capitalize;"><span class="thmtxth">'+settings.title+'</span></div><span class="icon-remove hh3 hp thmtxt"></span></div><div id="holder_'+o.windowcounter+'" class="app_holder"><iframe src="'+appurl+'" frameborder="0" scrolling="auto"></iframe><div class="clear"></div></div></div></div>');
|
var whtml =$('<div id="app_frame_'+o.windowcounter+'" class="thmc2 app_frame" data-app="'+settings.appid+'"><div id="content"><div id="header" class="hh3"><div class="dtitle w2 hh3 hp" style="text-transform:capitalize;"><span class="thmtxth">'+settings.title+'</span></div><span class="icon-remove hh3 hp thmtxt"></span></div><div id="holder_'+o.windowcounter+'" class="app_holder"><iframe src="'+appurl+'" frameborder="0" scrolling="auto"></iframe><div class="clear"></div></div></div></div>');
|
||||||
$(o.contentHolder).append(whtml);
|
$(o.contentHolder).append(whtml);
|
||||||
var parentwindow = $(o.contentHolder).find("div#app_frame_"+o.windowcounter);
|
var parentwindow = $(o.contentHolder).find("div#app_frame_"+o.windowcounter);
|
||||||
var app_holder_height = parentwindow.height() - 72;
|
var app_holder_height = parentwindow.height() - 72;
|
||||||
|
@ -206,6 +206,12 @@ var orbitDesktopAPI = function(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
this.use_select2 = function(){
|
||||||
|
$('select:not(.select2-offscreen)').select2({
|
||||||
|
minimumResultsForSearch: -1
|
||||||
|
// minimumInputLength: -1
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
orbitDesktopAPI.prototype.notifyImgPath = "temp";
|
orbitDesktopAPI.prototype.notifyImgPath = "temp";
|
||||||
orbitDesktopAPI.prototype.wallpaperPath = "temp";
|
orbitDesktopAPI.prototype.wallpaperPath = "temp";
|
||||||
|
|
|
@ -1,3 +1,42 @@
|
||||||
|
function append_id(){
|
||||||
|
if ($("#object_id").length == 1) {
|
||||||
|
return "&id="+$("#object_id").val();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return '';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
$("div.editable").live("mouseenter mouseleave", function (event) {
|
||||||
|
$(this).children('.edit_link').toggle();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#page_design").live('change', function() {
|
||||||
|
$.getScript($(this).attr('rel') + '?design_id=' + $(this).val() + append_id());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#module_app_list select").live('change', function() {
|
||||||
|
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val() + append_id());
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#widget_list select,#frontend_list select").live('change', function() {
|
||||||
|
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() + append_id() );
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#tag_list select").live('change', function() {
|
||||||
|
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + append_id() );
|
||||||
|
});
|
||||||
|
|
||||||
|
$("select.widget_field_select").live('change', function() {
|
||||||
|
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val() + append_id() );
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.part_kind').live('click', function() {
|
||||||
|
$('.part_kind_partial').hide();
|
||||||
|
$('#part_' + $(this).attr('value')).show();
|
||||||
|
});
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
bindTreeDragHandle();
|
bindTreeDragHandle();
|
||||||
});
|
});
|
||||||
|
@ -22,7 +61,3 @@ var bindTreeDragHandle = function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$("div.editable").live("mouseenter mouseleave", function (event) {
|
|
||||||
$(this).children('.edit_link').toggle();
|
|
||||||
});
|
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
<%#= encoding: utf-8 %>
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
$(document).on('click', '.survey_question_item a.remove_existing_record_question', function(){
|
|
||||||
if(confirm("<%= I18n.t(:sure?)%>")){
|
|
||||||
$(this).next('.should_destroy').val(1);
|
|
||||||
$(".survey_question_item#" + $(this).prev().attr('value')).hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on('click', '.survey_question_option_item a.remove_existing_record_option', function(){
|
|
||||||
if(confirm("<%= I18n.t(:sure?)%>")){
|
|
||||||
$(this).next('.should_destroy').val(1);
|
|
||||||
$(".survey_question_option_item#" + $(this).prev().attr('value')).hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on('click', '.survey_question_radiogroup_item a.remove_existing_record_radiogroup', function(){
|
|
||||||
if(confirm("<%= I18n.t(:sure?)%>")){
|
|
||||||
$(this).next('.should_destroy').val(1);
|
|
||||||
$(".survey_question_radiogroup_item#" + $(this).prev().attr('value')).hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.survey_question_item .type-selector').live('change', function(){
|
|
||||||
$item = $(this).parents('.survey_question_item');
|
|
||||||
$item.find('.type-specify').hide();
|
|
||||||
$item.find('.type-specify.type-' + $(this).val()).show();
|
|
||||||
$item.find('.type-specify.hide-type-' + $(this).val()).hide();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.survey_question_item .type-selector').trigger('change');
|
|
||||||
|
|
||||||
$('.survey_question_item .add_survey_question_option a.add').live('click', function(){
|
|
||||||
var new_id = $(this).prev().attr('value');
|
|
||||||
var old_id = new RegExp("new_survey_question_options", "g");
|
|
||||||
$(this).prev().attr('value', parseInt(new_id) + 1);
|
|
||||||
$_new = $($(this).next().html().replace(old_id, new_id));
|
|
||||||
$(this).parents('.survey_question_options_wrapper').find('tbody').append($_new);
|
|
||||||
$_new.find('a.delete_option').on('click', function(){
|
|
||||||
$(this).parents('.survey_question_option_item').remove();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.survey_question_item .add_survey_question_radiogroup a.add').live('click', function(){
|
|
||||||
var new_id = $(this).prev().attr('value');
|
|
||||||
var old_id = new RegExp("new_survey_question_radiogroups", "g");
|
|
||||||
$(this).prev().attr('value', parseInt(new_id) + 1);
|
|
||||||
$_new = $($(this).next().html().replace(old_id, new_id));
|
|
||||||
$(this).parents('.survey_question_radiogroups_wrapper').find('tbody').append($_new);
|
|
||||||
$_new.find('a.delete_radiogroup').on('click', function(){
|
|
||||||
$(this).parents('.survey_question_radiogroup_item').remove();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
|
@ -15,11 +15,6 @@ function load_tinymce() {
|
||||||
theme_advanced_statusbar_location : "bottom",
|
theme_advanced_statusbar_location : "bottom",
|
||||||
theme_advanced_resizing : true,
|
theme_advanced_resizing : true,
|
||||||
|
|
||||||
// Domain Absolute URLs
|
|
||||||
relative_urls : false,
|
|
||||||
remove_script_host : false,
|
|
||||||
document_base_url: window.location.protocol + '//' + window.location.host,
|
|
||||||
|
|
||||||
// Skin options
|
// Skin options
|
||||||
skin : "o2k7",
|
skin : "o2k7",
|
||||||
skin_variant : "silver",
|
skin_variant : "silver",
|
||||||
|
|
|
@ -5,4 +5,3 @@
|
||||||
*= require_self
|
*= require_self
|
||||||
*= require social-share-button
|
*= require social-share-button
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
#acknowledgement {
|
|
||||||
display: none;
|
|
||||||
padding: 20px;
|
|
||||||
margin: -20px 0 30px 0;
|
|
||||||
background-color: #fff;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 15px;
|
|
||||||
border: solid 2px #f0f0f0;
|
|
||||||
}
|
|
||||||
#aclnowledgement:after {
|
|
||||||
content: '';
|
|
||||||
display: table;
|
|
||||||
width: table;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ask-question {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* AQ form */
|
|
||||||
#new-ask-question {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
padding: 20px 0;
|
|
||||||
}
|
|
||||||
#new-ask-question .form-horizontal .control-label {
|
|
||||||
width: 100px;
|
|
||||||
}
|
|
||||||
#new-ask-question .form-horizontal .controls {
|
|
||||||
margin-left: 120px;
|
|
||||||
}
|
|
||||||
#new-ask-question .form-horizontal .controls textarea {
|
|
||||||
width: 80%;
|
|
||||||
resize: vertical;
|
|
||||||
}
|
|
||||||
#new-ask-question .form-horizontal .form-actions {
|
|
||||||
padding-left: 120px;
|
|
||||||
background-color: transparent;
|
|
||||||
border: none;
|
|
||||||
}
|
|
|
@ -3,10 +3,12 @@ $gray: #ddd;
|
||||||
@mixin font-main($font-size) {
|
@mixin font-main($font-size) {
|
||||||
font-family: "Source Sans Pro", sans-serif;
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
font-size: #{$font-size}px;
|
font-size: #{$font-size}px;
|
||||||
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
@mixin font-sub($font-size) {
|
@mixin font-sub($font-size) {
|
||||||
font-family: "Source Sans Pro", Arial, sans-serif;
|
font-family: "Source Sans Pro", Arial, sans-serif;
|
||||||
font-size: #{$font-size}px;
|
font-size: #{$font-size}px;
|
||||||
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
@mixin transition-type($property, $sec) {
|
@mixin transition-type($property, $sec) {
|
||||||
-webkit-transition: #{$property} #{$sec}s ease;
|
-webkit-transition: #{$property} #{$sec}s ease;
|
||||||
|
|
|
@ -92,26 +92,18 @@
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 60px;
|
top: 60px;
|
||||||
font-size: 15px;
|
font-size: 15px; }
|
||||||
width: 120px;
|
|
||||||
border: solid 2px #dddddd;
|
.sdm_o li {
|
||||||
-webkit-box-sizing: border-box;
|
border-top: solid 1px #f2f2f2; }
|
||||||
/* webkit */
|
|
||||||
-khtml-box-sizing: border-box;
|
.sdm_o li:first-child {
|
||||||
/* konqueror */
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
/* firefox */
|
|
||||||
-ms-box-sizing: border-box;
|
|
||||||
/* ie */
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* css3 */ }
|
|
||||||
.sdm_o li {
|
|
||||||
border-top: solid 1px #f7f7f7; }
|
|
||||||
.sdm_o li:first-child {
|
|
||||||
border: none; }
|
border: none; }
|
||||||
.sdm_o a {
|
|
||||||
|
.sdm_o a {
|
||||||
display: block; }
|
display: block; }
|
||||||
.sdm_o .admtxt {
|
|
||||||
|
.sdm_o .admtxt {
|
||||||
display: block;
|
display: block;
|
||||||
line-height: 36px; }
|
line-height: 36px; }
|
||||||
|
|
||||||
|
@ -127,11 +119,14 @@
|
||||||
.s_menu {
|
.s_menu {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: 36px; }
|
line-height: 36px; }
|
||||||
.s_menu li {
|
|
||||||
|
.s_menu li {
|
||||||
border-top: solid 1px #dddddd; }
|
border-top: solid 1px #dddddd; }
|
||||||
.s_menu li:first-child {
|
|
||||||
|
.s_menu li:first-child {
|
||||||
border: none; }
|
border: none; }
|
||||||
.s_menu a {
|
|
||||||
|
.s_menu a {
|
||||||
display: block; }
|
display: block; }
|
||||||
|
|
||||||
/* simple tabs */
|
/* simple tabs */
|
||||||
|
@ -162,7 +157,7 @@
|
||||||
font-size: 15px; }
|
font-size: 15px; }
|
||||||
.s_form label {
|
.s_form label {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: bold;
|
font-weight: normal;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
|
@ -202,8 +197,7 @@
|
||||||
.s_form input[type=text]:focus,
|
.s_form input[type=text]:focus,
|
||||||
.s_form input[type=password]:focus,
|
.s_form input[type=password]:focus,
|
||||||
.s_form textarea:focus {
|
.s_form textarea:focus {
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7; }
|
||||||
border-color: #c4c4c4; }
|
|
||||||
.s_form textarea {
|
.s_form textarea {
|
||||||
resize: none; }
|
resize: none; }
|
||||||
.s_form textarea.full_height {
|
.s_form textarea.full_height {
|
||||||
|
@ -256,12 +250,16 @@
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 9; }
|
z-index: 9; }
|
||||||
.toolbar .sdm, .toolbar .fn_g {
|
|
||||||
|
.toolbar .sdm, .toolbar .fn_g {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top; }
|
vertical-align: top; }
|
||||||
.toolbar .sdm_o {
|
|
||||||
top: 36px; }
|
.toolbar .sdm_o {
|
||||||
.toolbar button {
|
top: 36px;
|
||||||
|
background-color: #f0f0f0; }
|
||||||
|
|
||||||
|
.toolbar button {
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
|
@ -269,7 +267,8 @@
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
vertical-align: top; }
|
vertical-align: top; }
|
||||||
.toolbar .fn_btn {
|
|
||||||
|
.toolbar .fn_btn {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top; }
|
vertical-align: top; }
|
||||||
|
|
||||||
|
@ -369,7 +368,10 @@
|
||||||
.tinycanvas:hover .scrollbar {
|
.tinycanvas:hover .scrollbar {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
opacity: 1; }
|
opacity: 1; }
|
||||||
.toolbar + .tinycanvas, .s_tab + .tinycanvas {
|
|
||||||
|
.toolbar + .tinycanvas,
|
||||||
|
.s_tab + .tinycanvas {
|
||||||
height: 480px; }
|
height: 480px; }
|
||||||
#panel_r .tinycanvas {
|
|
||||||
|
#panel_r .tinycanvas {
|
||||||
padding: 12px 0; }
|
padding: 12px 0; }
|
||||||
|
|
|
@ -58,23 +58,19 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 60px;
|
top: 60px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
width: 120px;
|
|
||||||
border: solid 2px $gray;
|
|
||||||
@include box-sizing;
|
|
||||||
|
|
||||||
li {
|
|
||||||
border-top: solid 1px lighten( $gray, 10% );
|
|
||||||
}
|
}
|
||||||
li:first-child {
|
.sdm_o li {
|
||||||
|
border-top: solid 1px #f2f2f2;
|
||||||
|
}
|
||||||
|
.sdm_o li:first-child {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
a {
|
.sdm_o a {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.admtxt {
|
.sdm_o .admtxt {
|
||||||
display: block;
|
display: block;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* simple dropdown menu with indicator */
|
/* simple dropdown menu with indicator */
|
||||||
|
@ -90,16 +86,15 @@
|
||||||
.s_menu {
|
.s_menu {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
|
}
|
||||||
li {
|
.s_menu li {
|
||||||
border-top: solid 1px $gray;
|
border-top: solid 1px #ddd;
|
||||||
}
|
}
|
||||||
li:first-child {
|
.s_menu li:first-child {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
a {
|
.s_menu a {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* simple tabs */
|
/* simple tabs */
|
||||||
|
@ -135,7 +130,7 @@
|
||||||
// basic style
|
// basic style
|
||||||
label {
|
label {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: bold;
|
font-weight: normal;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
|
@ -170,7 +165,6 @@
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
background-color: lighten($gray, 10%);
|
background-color: lighten($gray, 10%);
|
||||||
border-color: darken($gray, 10%);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
textarea {
|
textarea {
|
||||||
|
@ -234,15 +228,16 @@
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
|
}
|
||||||
.sdm, .fn_g {
|
.toolbar .sdm, .toolbar .fn_g {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
.sdm_o {
|
.toolbar .sdm_o {
|
||||||
top: 36px;
|
top: 36px;
|
||||||
}
|
background-color: #f0f0f0;
|
||||||
button {
|
}
|
||||||
|
.toolbar button {
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
|
@ -250,11 +245,10 @@
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
.fn_btn {
|
.toolbar .fn_btn {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tiny scrollbar */
|
/* tiny scrollbar */
|
||||||
|
@ -357,11 +351,11 @@
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
.toolbar + &,
|
}
|
||||||
.s_tab + & {
|
.toolbar + .tinycanvas,
|
||||||
height: 480px;
|
.s_tab + .tinycanvas {
|
||||||
}
|
height: 480px;
|
||||||
#panel_r & {
|
}
|
||||||
padding: 12px 0;
|
#panel_r .tinycanvas {
|
||||||
}
|
padding: 12px 0;
|
||||||
}
|
}
|
|
@ -54,6 +54,7 @@ table {
|
||||||
body {
|
body {
|
||||||
font-family: "Source Sans Pro", sans-serif;
|
font-family: "Source Sans Pro", sans-serif;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
font-weight: 300;
|
||||||
background-color: #000; }
|
background-color: #000; }
|
||||||
|
|
||||||
a, a:hover {
|
a, a:hover {
|
||||||
|
@ -69,13 +70,11 @@ a:focus {
|
||||||
.clear:after {
|
.clear:after {
|
||||||
display: table;
|
display: table;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
content: '';
|
content: ''; }
|
||||||
clear: both; }
|
|
||||||
|
|
||||||
.o-loading {
|
.o-loading {
|
||||||
font-size: 13px; }
|
font-size: 13px;
|
||||||
.fullsize .o-loading {
|
font-weight: normal; }
|
||||||
padding: 12px; }
|
|
||||||
.o-loading i {
|
.o-loading i {
|
||||||
font-size: 20px; }
|
font-size: 20px; }
|
||||||
|
|
||||||
|
@ -295,7 +294,7 @@ a:focus {
|
||||||
|
|
||||||
.fn_des.admtxt {
|
.fn_des.admtxt {
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
padding: 0 12px;
|
padding: 0 6px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
|
@ -334,7 +333,8 @@ a:focus {
|
||||||
.section_label li {
|
.section_label li {
|
||||||
font-size: 15px; }
|
font-size: 15px; }
|
||||||
.section_label li:first-child {
|
.section_label li:first-child {
|
||||||
font-size: 18px; }
|
font-size: 18px;
|
||||||
|
font-weight: normal; }
|
||||||
|
|
||||||
/* panel */
|
/* panel */
|
||||||
#panel_l {
|
#panel_l {
|
||||||
|
@ -369,7 +369,8 @@ a:focus {
|
||||||
#orbitnote .note_holder .note_message {
|
#orbitnote .note_holder .note_message {
|
||||||
color: #333;
|
color: #333;
|
||||||
margin: 10px 0 0 48px;
|
margin: 10px 0 0 48px;
|
||||||
font-size: 15px; }
|
font-size: 15px;
|
||||||
|
font-weight: normal; }
|
||||||
|
|
||||||
/* Desktop Dialogue */
|
/* Desktop Dialogue */
|
||||||
#orbitdiag {
|
#orbitdiag {
|
||||||
|
@ -400,6 +401,7 @@ a:focus {
|
||||||
margin: 0 6px;
|
margin: 0 6px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
font-weight: normal;
|
||||||
line-height: 36px; }
|
line-height: 36px; }
|
||||||
#orbitdiag .diag_holder .diag_holder_inner .diag_btn:hover {
|
#orbitdiag .diag_holder .diag_holder_inner .diag_btn:hover {
|
||||||
outline: solid 2px white; }
|
outline: solid 2px white; }
|
||||||
|
@ -416,12 +418,12 @@ a:focus {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 3;
|
z-index: 3; }
|
||||||
white-space: nowrap; }
|
|
||||||
[data-sizex="1"] .appname, .w1.h1 .appname {
|
[data-sizex="1"] .appname, .w1.h1 .appname {
|
||||||
text-align: center; }
|
text-align: center; }
|
||||||
[data-sizey="2"] .appname {
|
[data-sizey="2"] .appname {
|
||||||
font-size: 21px; }
|
font-size: 21px;
|
||||||
|
font-weight: normal; }
|
||||||
.hh2 .appname {
|
.hh2 .appname {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
@ -473,12 +475,8 @@ a:focus {
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0; }
|
top: 0; }
|
||||||
|
|
||||||
.gridster ul {
|
|
||||||
margin: -6px 0 0 -6px; }
|
|
||||||
|
|
||||||
.widget.gs_w {
|
.widget.gs_w {
|
||||||
cursor: move;
|
cursor: move; }
|
||||||
overflow: hidden; }
|
|
||||||
|
|
||||||
/* header drop menu */
|
/* header drop menu */
|
||||||
.sdm_mdr .sdm_o {
|
.sdm_mdr .sdm_o {
|
||||||
|
@ -509,6 +507,7 @@ a:focus {
|
||||||
|
|
||||||
.theme_preview {
|
.theme_preview {
|
||||||
width: 528px;
|
width: 528px;
|
||||||
|
height: 150px;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
font-size: 15px; }
|
font-size: 15px; }
|
||||||
|
|
||||||
|
@ -519,24 +518,15 @@ a:focus {
|
||||||
margin-right: 12px; }
|
margin-right: 12px; }
|
||||||
.theme_plate > div:first-child {
|
.theme_plate > div:first-child {
|
||||||
margin-right: 48px; }
|
margin-right: 48px; }
|
||||||
.theme_plate .g_sep {
|
|
||||||
margin-right: 0; }
|
|
||||||
|
|
||||||
#color_input th {
|
|
||||||
vertical-align: bottom; }
|
|
||||||
|
|
||||||
.stock_wallpaper .ssl_item {
|
.stock_wallpaper .ssl_item {
|
||||||
margin-bottom: 6px; }
|
margin-bottom: 6px; }
|
||||||
|
|
||||||
.s_title {
|
.s_title {
|
||||||
font-size: 21px;
|
font-size: 21px;
|
||||||
|
font-weight: normal;
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
text-align: left; }
|
text-align: left; }
|
||||||
.s_title.size_large {
|
|
||||||
font-size: 36px; }
|
|
||||||
.s_title.size_small {
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 2em; }
|
|
||||||
|
|
||||||
.s_subtitle {
|
.s_subtitle {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
@ -555,6 +545,7 @@ a:focus {
|
||||||
display: block;
|
display: block;
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
font-weight: normal;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 0; }
|
border: 0; }
|
||||||
|
@ -569,18 +560,8 @@ a:focus {
|
||||||
max-width: 340px; }
|
max-width: 340px; }
|
||||||
|
|
||||||
.g_sep {
|
.g_sep {
|
||||||
width: 12px;
|
width: 11px;
|
||||||
border-left: solid 1px white;
|
border-left: solid 1px white; }
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
/* webkit */
|
|
||||||
-khtml-box-sizing: border-box;
|
|
||||||
/* konqueror */
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
/* firefox */
|
|
||||||
-ms-box-sizing: border-box;
|
|
||||||
/* ie */
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* css3 */ }
|
|
||||||
|
|
||||||
.grp {
|
.grp {
|
||||||
height: 528px;
|
height: 528px;
|
||||||
|
@ -605,12 +586,14 @@ a:focus {
|
||||||
|
|
||||||
/* list item */
|
/* list item */
|
||||||
.list_t_item {
|
.list_t_item {
|
||||||
|
/*padding: 2px;*/
|
||||||
overflow: hidden; }
|
overflow: hidden; }
|
||||||
|
|
||||||
.list_t_title {
|
.list_t_title {
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 15px; }
|
font-size: 15px;
|
||||||
|
font-weight: normal; }
|
||||||
|
|
||||||
.list_t_des {
|
.list_t_des {
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
|
@ -624,74 +607,118 @@ a:focus {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
-webkit-text-size-adjust: none; }
|
-webkit-text-size-adjust: none; }
|
||||||
|
|
||||||
|
/* Connection Page */
|
||||||
|
#connection_setting {
|
||||||
|
height: 492px; }
|
||||||
|
|
||||||
|
#connection_setting .s_form {
|
||||||
|
float: left;
|
||||||
|
margin: 0 12px 0 0;
|
||||||
|
padding-left: 24px;
|
||||||
|
height: 100%;
|
||||||
|
border-left: solid 1px #dddddd; }
|
||||||
|
|
||||||
|
#connection_setting .s_form:first-child {
|
||||||
|
padding-left: 0;
|
||||||
|
border: none; }
|
||||||
|
|
||||||
|
#connection_setting .s_form label {
|
||||||
|
line-height: 30px; }
|
||||||
|
|
||||||
|
#connection_setting .s_form .c_icon, #connection_setting .s_form .c_name {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle; }
|
||||||
|
|
||||||
|
#connection_setting .s_form .c_name {
|
||||||
|
padding: 0 12px;
|
||||||
|
font-size: 18px; }
|
||||||
|
|
||||||
|
#connection_setting .s_form input[type=text], #connection_setting .s_form input[type=password] {
|
||||||
|
width: 202px; }
|
||||||
|
|
||||||
|
#connection_setting .setting_btn {
|
||||||
|
margin-left: 12px; }
|
||||||
|
|
||||||
|
#connection_setting .setting_btn.disable {
|
||||||
|
background-color: #ddd;
|
||||||
|
cursor: default; }
|
||||||
|
|
||||||
|
#connection_setting .c_status {
|
||||||
|
float: right;
|
||||||
|
padding: 6px;
|
||||||
|
background-color: #eee;
|
||||||
|
color: #ccc;
|
||||||
|
font-size: 9px;
|
||||||
|
font-weight: normal;
|
||||||
|
-webkit-text-size-adjust: none;
|
||||||
|
-webkit-transition: background-color 0.5s ease;
|
||||||
|
-moz-transition: background-color 0.5s ease;
|
||||||
|
transition: background-color 0.5s ease; }
|
||||||
|
|
||||||
|
#connection_setting .c_status_on {
|
||||||
|
background-color: #51A351;
|
||||||
|
color: #fff; }
|
||||||
|
|
||||||
|
#connection_setting .c_info {
|
||||||
|
padding: 7px 6px;
|
||||||
|
background-color: #fcfcfc;
|
||||||
|
cursor: default;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: normal; }
|
||||||
|
|
||||||
/* Journal Papers */
|
/* Journal Papers */
|
||||||
[page-name="journal_p_list"] .list_t_item .inner {
|
[page-name="journal_p_list"] .list_t_item .inner {
|
||||||
padding-left: 30px; }
|
padding-left: 30px; }
|
||||||
|
|
||||||
[page-name="journal_p_list"] .list_item_action {
|
[page-name="journal_p_list"] .list_item_action {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: -30px; }
|
margin-left: -30px; }
|
||||||
[page-name="journal_p_list"] .list_item_action a {
|
|
||||||
|
[page-name="journal_p_list"] .list_item_action a {
|
||||||
display: block;
|
display: block;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin: 1px 1px 6px 1px; }
|
margin: 1px 1px 6px 1px; }
|
||||||
[page-name="journal_p_list"] .list_item_action .icon-star-empty {
|
|
||||||
|
[page-name="journal_p_list"] .list_item_action .icon-star-empty {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 20px; }
|
font-size: 20px; }
|
||||||
[page-name="journal_p_list"] .list_item_action .icon-star {
|
|
||||||
|
[page-name="journal_p_list"] .list_item_action .icon-star {
|
||||||
color: #faa732;
|
color: #faa732;
|
||||||
font-size: 20px; }
|
font-size: 20px; }
|
||||||
[page-name="journal_p_list"] .list_item_action .icon-check-empty {
|
|
||||||
|
[page-name="journal_p_list"] .list_item_action .icon-check-empty {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 20px; }
|
font-size: 20px; }
|
||||||
[page-name="journal_p_list"] .list_item_action .icon-check {
|
|
||||||
|
[page-name="journal_p_list"] .list_item_action .icon-check {
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 20px; }
|
font-size: 20px; }
|
||||||
[page-name="journal_p_list"] .file_view .list_t_des {
|
|
||||||
overflow: hidden; }
|
[page-name="journal_p_list"] .list_t_item.file_view {
|
||||||
|
height: 148px; }
|
||||||
|
|
||||||
[page-name="journal_p_list"] .file_view .file {
|
[page-name="journal_p_list"] .file_view .file {
|
||||||
float: left;
|
display: inline-block;
|
||||||
width: 120px;
|
width: 62px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
padding: 6px;
|
text-align: center; }
|
||||||
margin: 1px;
|
|
||||||
position: relative;
|
[page-name="journal_p_list"] .file_view .file:hover {
|
||||||
-webkit-box-sizing: border-box;
|
background-color: #ddd; }
|
||||||
/* webkit */
|
|
||||||
-khtml-box-sizing: border-box;
|
[page-name="journal_p_list"] .file_view .file img {
|
||||||
/* konqueror */
|
width: 24px;
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
/* firefox */
|
|
||||||
-ms-box-sizing: border-box;
|
|
||||||
/* ie */
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* css3 */ }
|
|
||||||
[page-name="journal_p_list"] .file_view .file:hover {
|
|
||||||
background-color: #f7f7f7; }
|
|
||||||
[page-name="journal_p_list"] .file_view .file img {
|
|
||||||
width: 38px;
|
|
||||||
height: 38px;
|
|
||||||
position: absolute;
|
|
||||||
left: 6px;
|
|
||||||
top: 6px; }
|
|
||||||
[page-name="journal_p_list"] .file_view .file .filetitle {
|
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
margin: 0 auto;
|
||||||
height: 38px;
|
margin-top: 4px; }
|
||||||
padding-left: 40px;
|
|
||||||
overflow: hidden;
|
[page-name="journal_p_list"] .file_view .filetitle {
|
||||||
-webkit-box-sizing: border-box;
|
font-size: 11px;
|
||||||
/* webkit */
|
-webkit-text-size-adjust: none; }
|
||||||
-khtml-box-sizing: border-box;
|
|
||||||
/* konqueror */
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
/* firefox */
|
|
||||||
-ms-box-sizing: border-box;
|
|
||||||
/* ie */
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* css3 */ }
|
|
||||||
|
|
||||||
/* Journal Paper Add */
|
/* Journal Paper Add */
|
||||||
#paper_add .s_grid_con {
|
#paper_add .s_grid_con {
|
||||||
|
@ -700,22 +727,27 @@ a:focus {
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
padding-left: 12px;
|
padding-left: 12px;
|
||||||
border-left: solid 1px #eeeeee; }
|
border-left: solid 1px #eeeeee; }
|
||||||
#paper_add .s_grid_con:first-child {
|
|
||||||
|
#paper_add .s_grid_con:first-child {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
border: none; }
|
border: none; }
|
||||||
|
|
||||||
#paper_add .f_w {
|
#paper_add .f_w {
|
||||||
width: 336px; }
|
width: 336px; }
|
||||||
|
|
||||||
#paper_add label {
|
#paper_add label {
|
||||||
margin-right: 0; }
|
margin-right: 0; }
|
||||||
|
|
||||||
/* Journal Journal list */
|
/* Journal Journal list */
|
||||||
[page-name="journal_p_journal"] .datalist_item .inner {
|
[page-name="journal_p_journal"] .datalist_item .inner {
|
||||||
padding-left: 30px; }
|
padding-left: 30px; }
|
||||||
|
|
||||||
[page-name="journal_p_journal"] .list_item_action {
|
[page-name="journal_p_journal"] .list_item_action {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: -30px; }
|
margin-left: -30px; }
|
||||||
|
|
||||||
[page-name="journal_p_journal"] .list_item_action i {
|
[page-name="journal_p_journal"] .list_item_action i {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -724,6 +756,7 @@ a:focus {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin: 1px 1px 6px 1px; }
|
margin: 1px 1px 6px 1px; }
|
||||||
|
|
||||||
[page-name="journal_p_journal"] .list_t_desc {
|
[page-name="journal_p_journal"] .list_t_desc {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
@ -732,17 +765,21 @@ a:focus {
|
||||||
/* Journal Co-Author */
|
/* Journal Co-Author */
|
||||||
[page-name="journal_p_coauthor"] .list_t_item {
|
[page-name="journal_p_coauthor"] .list_t_item {
|
||||||
height: 110px; }
|
height: 110px; }
|
||||||
|
|
||||||
[page-name="journal_p_coauthor"] .list_item_function a {
|
[page-name="journal_p_coauthor"] .list_item_function a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
-webkit-text-size-adjust: none; }
|
-webkit-text-size-adjust: none; }
|
||||||
|
|
||||||
[page-name="journal_p_coauthor"] .info {
|
[page-name="journal_p_coauthor"] .info {
|
||||||
font-family: Arial, sans-serif; }
|
font-family: Arial, sans-serif; }
|
||||||
|
|
||||||
[page-name="journal_p_coauthor"] .info li {
|
[page-name="journal_p_coauthor"] .info li {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
color: #999; }
|
color: #999; }
|
||||||
|
|
||||||
[page-name="journal_p_coauthor"] .info .name {
|
[page-name="journal_p_coauthor"] .info .name {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
|
@ -751,6 +788,7 @@ a:focus {
|
||||||
/* Journal Co-Author Relationship*/
|
/* Journal Co-Author Relationship*/
|
||||||
[page-name="journal_p_coauthor_relation"] .edit_co_author_relation {
|
[page-name="journal_p_coauthor_relation"] .edit_co_author_relation {
|
||||||
/*margin-left: -10px;*/ }
|
/*margin-left: -10px;*/ }
|
||||||
|
|
||||||
[page-name="journal_p_coauthor_relation"] .form_space {
|
[page-name="journal_p_coauthor_relation"] .form_space {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
@ -771,11 +809,13 @@ a:focus {
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 12; }
|
z-index: 12; }
|
||||||
.app_frame .app_holder {
|
|
||||||
|
.app_frame .app_holder {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%; }
|
width: 100%; }
|
||||||
.app_frame #header .icon-remove {
|
|
||||||
|
.app_frame #header .icon-remove {
|
||||||
display: block;
|
display: block;
|
||||||
float: right;
|
float: right;
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
|
|
|
@ -66,15 +66,11 @@ a:focus { outline: none; }
|
||||||
display: table;
|
display: table;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
content: '';
|
content: '';
|
||||||
clear: both;
|
|
||||||
}
|
}
|
||||||
.o-loading {
|
.o-loading {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
// font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
||||||
.fullsize & {
|
|
||||||
padding: 12px;
|
|
||||||
}
|
|
||||||
i {
|
i {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
@ -231,7 +227,7 @@ a:focus { outline: none; }
|
||||||
}
|
}
|
||||||
.fn_des.admtxt {
|
.fn_des.admtxt {
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
padding: 0 12px;
|
padding: 0 6px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
|
@ -277,9 +273,10 @@ a:focus { outline: none; }
|
||||||
}
|
}
|
||||||
li:first-child {
|
li:first-child {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
// font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* panel */
|
/* panel */
|
||||||
#panel_l {
|
#panel_l {
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
|
@ -320,7 +317,7 @@ a:focus { outline: none; }
|
||||||
color: #333;
|
color: #333;
|
||||||
margin: 10px 0 0 48px;
|
margin: 10px 0 0 48px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
// font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -360,7 +357,7 @@ a:focus { outline: none; }
|
||||||
margin: 0 6px;
|
margin: 0 6px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
// font-weight: normal;
|
font-weight: normal;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
@ -385,7 +382,6 @@ a:focus { outline: none; }
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
[data-sizex="1"] &,
|
[data-sizex="1"] &,
|
||||||
.w1.h1 & {
|
.w1.h1 & {
|
||||||
|
@ -393,7 +389,7 @@ a:focus { outline: none; }
|
||||||
}
|
}
|
||||||
[data-sizey="2"] & {
|
[data-sizey="2"] & {
|
||||||
font-size: 21px;
|
font-size: 21px;
|
||||||
// font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
.hh2 & {
|
.hh2 & {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -421,6 +417,8 @@ a:focus { outline: none; }
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.appholder {
|
.appholder {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
@ -444,7 +442,7 @@ a:focus { outline: none; }
|
||||||
margin: 0 12px 0 0;
|
margin: 0 12px 0 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
.tile {
|
.tile {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -452,19 +450,10 @@ a:focus { outline: none; }
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
.gridster ul {
|
|
||||||
margin: -6px 0 0 -6px;
|
|
||||||
}
|
|
||||||
.widget.gs_w {
|
.widget.gs_w {
|
||||||
cursor: move;
|
cursor: move;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
// .app.gs_w:active {
|
|
||||||
// -webkit-transform: scale(0.9);
|
|
||||||
// -moz-transform: scale(0.9);
|
|
||||||
// transform: scale(0.9);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/* header drop menu */
|
/* header drop menu */
|
||||||
.sdm_mdr .sdm_o { top: 36px; }
|
.sdm_mdr .sdm_o { top: 36px; }
|
||||||
|
@ -495,6 +484,7 @@ a:focus { outline: none; }
|
||||||
}
|
}
|
||||||
.theme_preview {
|
.theme_preview {
|
||||||
width: 528px;
|
width: 528px;
|
||||||
|
height: 150px;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
@ -508,12 +498,6 @@ a:focus { outline: none; }
|
||||||
> div:first-child {
|
> div:first-child {
|
||||||
margin-right: 48px;
|
margin-right: 48px;
|
||||||
}
|
}
|
||||||
.g_sep {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#color_input th {
|
|
||||||
vertical-align: bottom
|
|
||||||
}
|
}
|
||||||
.stock_wallpaper {
|
.stock_wallpaper {
|
||||||
.ssl_item {
|
.ssl_item {
|
||||||
|
@ -523,17 +507,9 @@ a:focus { outline: none; }
|
||||||
|
|
||||||
.s_title {
|
.s_title {
|
||||||
font-size: 21px;
|
font-size: 21px;
|
||||||
// font-weight: normal;
|
font-weight: normal;
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
||||||
&.size_large {
|
|
||||||
font-size: 36px;
|
|
||||||
}
|
|
||||||
&.size_small {
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 2em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.s_subtitle {
|
.s_subtitle {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
@ -552,7 +528,7 @@ a:focus { outline: none; }
|
||||||
display: block;
|
display: block;
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
// font-weight: normal;
|
font-weight: normal;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 0;
|
border: 0;
|
||||||
|
@ -570,9 +546,9 @@ a:focus { outline: none; }
|
||||||
max-width: 340px;
|
max-width: 340px;
|
||||||
}
|
}
|
||||||
.g_sep {
|
.g_sep {
|
||||||
width: 12px;
|
width: 11px;
|
||||||
border-left: solid 1px #fff;
|
border-left:
|
||||||
@include box-sizing;
|
solid 1px #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -596,12 +572,12 @@ a:focus { outline: none; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* list item */
|
/* list item */
|
||||||
.list_t_item { overflow: hidden; }
|
.list_t_item { /*padding: 2px;*/ overflow: hidden; }
|
||||||
.list_t_title {
|
.list_t_title {
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
// font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
.list_t_des {
|
.list_t_des {
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
|
@ -616,93 +592,108 @@ a:focus { outline: none; }
|
||||||
-webkit-text-size-adjust: none;
|
-webkit-text-size-adjust: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Connection Page */
|
||||||
|
#connection_setting { height: 492px; }
|
||||||
|
#connection_setting .s_form {
|
||||||
|
float: left;
|
||||||
|
margin: 0 12px 0 0;
|
||||||
|
padding-left: 24px;
|
||||||
|
height: 100%;
|
||||||
|
border-left: solid 1px #ddd;
|
||||||
|
}
|
||||||
|
#connection_setting .s_form:first-child { padding-left: 0; border: none; }
|
||||||
|
#connection_setting .s_form label { line-height: 30px; }
|
||||||
|
#connection_setting .s_form .c_icon, #connection_setting .s_form .c_name {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
#connection_setting .s_form .c_name { padding: 0 12px; font-size: 18px; }
|
||||||
|
#connection_setting .s_form input[type=text], #connection_setting .s_form input[type=password] { width: 202px; }
|
||||||
|
#connection_setting .setting_btn { margin-left: 12px; }
|
||||||
|
#connection_setting .setting_btn.disable { background-color: #ddd; cursor: default; }
|
||||||
|
#connection_setting .c_status {
|
||||||
|
float: right;
|
||||||
|
padding: 6px;
|
||||||
|
background-color: #eee;
|
||||||
|
color: #ccc;
|
||||||
|
font-size: 9px;
|
||||||
|
font-weight: normal;
|
||||||
|
-webkit-text-size-adjust: none;
|
||||||
|
@include transition-type("background-color",0.5);
|
||||||
|
}
|
||||||
|
#connection_setting .c_status_on { background-color: #51A351; color: #fff; }
|
||||||
|
#connection_setting .c_info {
|
||||||
|
padding: 7px 6px;
|
||||||
|
background-color: #fcfcfc;
|
||||||
|
cursor: default;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
/* Journal Papers */
|
/* Journal Papers */
|
||||||
[page-name="journal_p_list"] {
|
[page-name="journal_p_list"] .list_t_item .inner { padding-left: 30px; }
|
||||||
.list_t_item .inner { padding-left: 30px; }
|
[page-name="journal_p_list"] .list_item_action {
|
||||||
.list_item_action {
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: -30px;
|
margin-left: -30px;
|
||||||
|
}
|
||||||
a {
|
[page-name="journal_p_list"] .list_item_action a {
|
||||||
display: block;
|
display: block;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin: 1px 1px 6px 1px;
|
margin: 1px 1px 6px 1px;
|
||||||
}
|
}
|
||||||
.icon-star-empty { color: #999; font-size: 20px; }
|
[page-name="journal_p_list"] .list_item_action .icon-star-empty { color: #999; font-size: 20px; }
|
||||||
.icon-star { color: #faa732; font-size: 20px; }
|
[page-name="journal_p_list"] .list_item_action .icon-star { color: #faa732; font-size: 20px; }
|
||||||
.icon-check-empty { color: #999; font-size: 20px; }
|
[page-name="journal_p_list"] .list_item_action .icon-check-empty { color: #999; font-size: 20px; }
|
||||||
.icon-check { color: #333; font-size: 20px; }
|
[page-name="journal_p_list"] .list_item_action .icon-check { color: #333; font-size: 20px; }
|
||||||
}
|
|
||||||
|
|
||||||
.file_view {
|
[page-name="journal_p_list"] .list_t_item.file_view {
|
||||||
.list_t_des {
|
height: 148px;
|
||||||
overflow: hidden;
|
}
|
||||||
}
|
[page-name="journal_p_list"] .file_view .file {
|
||||||
.file {
|
display: inline-block;
|
||||||
float: left;
|
width: 62px;
|
||||||
width: 120px;
|
|
||||||
height: 50px;
|
height: 50px;
|
||||||
padding: 6px;
|
text-align: center;
|
||||||
margin: 1px;
|
}
|
||||||
position: relative;
|
[page-name="journal_p_list"] .file_view .file:hover {
|
||||||
@include box-sizing;
|
background-color: #ddd;
|
||||||
|
}
|
||||||
&:hover {
|
[page-name="journal_p_list"] .file_view .file img {
|
||||||
background-color: lighten($gray, 10%);
|
width: 24px;
|
||||||
}
|
|
||||||
img {
|
|
||||||
width: 38px;
|
|
||||||
height: 38px;
|
|
||||||
position: absolute;
|
|
||||||
left: 6px;
|
|
||||||
top: 6px;
|
|
||||||
}
|
|
||||||
.filetitle {
|
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
margin: 0 auto;
|
||||||
height: 38px;
|
margin-top: 4px;
|
||||||
padding-left: 40px;
|
}
|
||||||
overflow: hidden;
|
[page-name="journal_p_list"] .file_view .filetitle {
|
||||||
@include box-sizing;
|
font-size: 11px;
|
||||||
}
|
-webkit-text-size-adjust: none;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Journal Paper Add */
|
/* Journal Paper Add */
|
||||||
#paper_add {
|
#paper_add .s_grid_con {
|
||||||
.s_grid_con {
|
|
||||||
float: left;
|
float: left;
|
||||||
height: 456px;
|
height: 456px;
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
padding-left: 12px;
|
padding-left: 12px;
|
||||||
border-left: solid 1px #eee;
|
border-left: solid 1px #eee;
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
padding-left: 0;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.f_w { width: 336px; }
|
|
||||||
label { margin-right: 0; }
|
|
||||||
}
|
}
|
||||||
|
#paper_add .s_grid_con:first-child { margin-left: 0; padding-left: 0; border: none; }
|
||||||
|
#paper_add .f_w { width: 336px; }
|
||||||
|
#paper_add label { margin-right: 0; }
|
||||||
|
|
||||||
/* Journal Journal list */
|
/* Journal Journal list */
|
||||||
[page-name="journal_p_journal"] {
|
[page-name="journal_p_journal"] .datalist_item .inner {
|
||||||
|
|
||||||
.datalist_item .inner {
|
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
}
|
}
|
||||||
.list_item_action {
|
[page-name="journal_p_journal"] .list_item_action {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: -30px;
|
margin-left: -30px;
|
||||||
}
|
}
|
||||||
.list_item_action i {
|
[page-name="journal_p_journal"] .list_item_action i {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -710,51 +701,46 @@ a:focus { outline: none; }
|
||||||
height: 20px;
|
height: 20px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin: 1px 1px 6px 1px;
|
margin: 1px 1px 6px 1px;
|
||||||
}
|
}
|
||||||
.list_t_desc {
|
[page-name="journal_p_journal"] .list_t_desc {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Journal Co-Author */
|
/* Journal Co-Author */
|
||||||
[page-name="journal_p_coauthor"] {
|
[page-name="journal_p_coauthor"] {}
|
||||||
.list_t_item {
|
[page-name="journal_p_coauthor"] .list_t_item {
|
||||||
height: 110px;
|
height: 110px;
|
||||||
}
|
}
|
||||||
.list_item_function {}
|
[page-name="journal_p_coauthor"] .list_item_function {}
|
||||||
.list_item_function a {
|
[page-name="journal_p_coauthor"] .list_item_function a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
-webkit-text-size-adjust: none;
|
-webkit-text-size-adjust: none;
|
||||||
}
|
}
|
||||||
.info {
|
[page-name="journal_p_coauthor"] .info {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
}
|
}
|
||||||
.info li {
|
[page-name="journal_p_coauthor"] .info li {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
.info .name {
|
[page-name="journal_p_coauthor"] .info .name {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Journal Co-Author Relationship*/
|
/* Journal Co-Author Relationship*/
|
||||||
[page-name="journal_p_coauthor_relation"]{
|
[page-name="journal_p_coauthor_relation"] .edit_co_author_relation {
|
||||||
.edit_co_author_relation {
|
|
||||||
/*margin-left: -10px;*/
|
/*margin-left: -10px;*/
|
||||||
}
|
}
|
||||||
.form_space {
|
[page-name="journal_p_coauthor_relation"] .form_space {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* Journal New Co-Author */
|
/* Journal New Co-Author */
|
||||||
#new_co_author label {
|
#new_co_author label {
|
||||||
|
@ -773,19 +759,18 @@ a:focus { outline: none; }
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
|
}
|
||||||
.app_holder {
|
.app_frame .app_holder {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
#header .icon-remove {
|
.app_frame #header .icon-remove {
|
||||||
display: block;
|
display: block;
|
||||||
float: right;
|
float: right;
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Tooltip popup */
|
/*Tooltip popup */
|
||||||
|
|
|
@ -65,7 +65,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
font-size: 1px;
|
font-size: 1px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: url("select2/select2.png") right top no-repeat;
|
background: url(<%= asset_path "desktop/select2/select2.png" %>) right top no-repeat;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
outline: 0; }
|
outline: 0; }
|
||||||
|
|
||||||
|
@ -86,21 +86,24 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
background-color: #fff;
|
background: #fff;
|
||||||
color: #000;
|
color: #000;
|
||||||
border: 2px solid #dddddd; }
|
border: 1px solid #dddddd;
|
||||||
|
border-top: 0; }
|
||||||
|
|
||||||
.select2-drop.select2-drop-above {
|
.select2-drop.select2-drop-above {
|
||||||
margin-top: 1px; }
|
margin-top: 1px;
|
||||||
|
border-top: 1px solid #dddddd;
|
||||||
|
border-bottom: 0; }
|
||||||
|
|
||||||
.select2-container .select2-choice div {
|
.select2-container .select2-choice div {
|
||||||
display: block;
|
display: block;
|
||||||
width: 21px;
|
width: 20px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
border-left: solid 1px #dddddd;
|
background: #ccc;
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
/* webkit */
|
/* webkit */
|
||||||
-khtml-box-sizing: border-box;
|
-khtml-box-sizing: border-box;
|
||||||
|
@ -116,7 +119,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: url("select2/select2.png") no-repeat 0 50%; }
|
background: url(<%= asset_path "desktop/select2/select2.png" %>) no-repeat 0 1px; }
|
||||||
|
|
||||||
.select2-search {
|
.select2-search {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -149,25 +152,29 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
margin-top: 4px; }
|
margin-top: 4px; }
|
||||||
|
|
||||||
.select2-search input.select2-active {
|
.select2-search input.select2-active {
|
||||||
background: white url("select2/spinner.gif") no-repeat 100%; }
|
background: white image-url(<%= asset_path "desktop/select2/select2-spinner.gif" %>) no-repeat 100%; }
|
||||||
|
|
||||||
.select2-container-active .select2-choice,
|
.select2-container-active .select2-choice,
|
||||||
.select2-container-active .select2-choices {
|
.select2-container-active .select2-choices {
|
||||||
outline: none; }
|
outline: none; }
|
||||||
|
|
||||||
.select2-dropdown-open .select2-choice {
|
.select2-dropdown-open .select2-choice {
|
||||||
border-bottom-color: transparent; }
|
border-bottom-color: transparent;
|
||||||
|
background-color: #eee; }
|
||||||
|
|
||||||
.select2-dropdown-open .select2-choice div {
|
.select2-dropdown-open .select2-choice div {
|
||||||
background-color: #dddddd;
|
background: transparent;
|
||||||
|
border-left: none;
|
||||||
filter: none; }
|
filter: none; }
|
||||||
|
|
||||||
.select2-dropdown-open .select2-choice div b {
|
.select2-dropdown-open .select2-choice div b {
|
||||||
background-position: -20px 50%; }
|
background-position: -18px 1px; }
|
||||||
|
|
||||||
/* results */
|
/* results */
|
||||||
.select2-results {
|
.select2-results {
|
||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
|
padding: 0 0 0 4px;
|
||||||
|
margin: 4px 4px 4px 0;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
@ -201,16 +208,13 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
.select2-results li {
|
.select2-results li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
display: list-item;
|
display: list-item;
|
||||||
background-image: none;
|
background-image: none; }
|
||||||
border-top: solid 1px #f7f7f7; }
|
|
||||||
.select2-results li :first-child {
|
|
||||||
border-top: 0; }
|
|
||||||
|
|
||||||
.select2-results li.select2-result-with-children > .select2-result-label {
|
.select2-results li.select2-result-with-children > .select2-result-label {
|
||||||
font-weight: bold; }
|
font-weight: bold; }
|
||||||
|
|
||||||
.select2-results .select2-result-label {
|
.select2-results .select2-result-label {
|
||||||
padding: 6px;
|
padding: 4px 6px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
|
@ -261,7 +265,7 @@ disabled look for disabled choices in the results dropdown
|
||||||
display: none; }
|
display: none; }
|
||||||
|
|
||||||
.select2-more-results.select2-active {
|
.select2-more-results.select2-active {
|
||||||
background: #f4f4f4 url("select2/spinner.gif") no-repeat 100%; }
|
background: #f4f4f4 image-url(<%= asset_path "desktop/select2/select2-spinner.gif" %>) no-repeat 100%; }
|
||||||
|
|
||||||
.select2-more-results {
|
.select2-more-results {
|
||||||
background: #f4f4f4;
|
background: #f4f4f4;
|
||||||
|
@ -323,7 +327,7 @@ disabled look for disabled choices in the results dropdown
|
||||||
background: transparent !important; }
|
background: transparent !important; }
|
||||||
|
|
||||||
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
|
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
|
||||||
background: white url("select2/spinner.gif") no-repeat 100% !important; }
|
background: white image-url(<%= asset_path "desktop/select2/select2-spinner.gif" %>) no-repeat 100% !important; }
|
||||||
|
|
||||||
.select2-default {
|
.select2-default {
|
||||||
color: #999999 !important; }
|
color: #999999 !important; }
|
||||||
|
@ -352,23 +356,23 @@ disabled look for disabled choices in the results dropdown
|
||||||
|
|
||||||
.select2-search-choice-close {
|
.select2-search-choice-close {
|
||||||
display: block;
|
display: block;
|
||||||
width: 10px;
|
width: 12px;
|
||||||
height: 10px;
|
height: 13px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 3px;
|
right: 3px;
|
||||||
top: 5px;
|
top: 4px;
|
||||||
font-size: 1px;
|
font-size: 1px;
|
||||||
outline: none;
|
outline: none;
|
||||||
background: url("select2/select2.png") right top no-repeat; }
|
background: url(<%= asset_path "desktop/select2/select2.png" %>) right top no-repeat; }
|
||||||
|
|
||||||
.select2-container-multi .select2-search-choice-close {
|
.select2-container-multi .select2-search-choice-close {
|
||||||
left: 3px; }
|
left: 3px; }
|
||||||
|
|
||||||
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
|
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
|
||||||
background-position: right -20px; }
|
background-position: right -11px; }
|
||||||
|
|
||||||
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
||||||
background-position: right -20px; }
|
background-position: right -11px; }
|
||||||
|
|
||||||
/* disabled styles */
|
/* disabled styles */
|
||||||
.select2-container-multi.select2-container-disabled .select2-choices {
|
.select2-container-multi.select2-container-disabled .select2-choices {
|
||||||
|
@ -393,13 +397,12 @@ disabled look for disabled choices in the results dropdown
|
||||||
|
|
||||||
.select2-offscreen {
|
.select2-offscreen {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -10000px;
|
left: -10000px; }
|
||||||
top: 0; }
|
|
||||||
|
|
||||||
/* Retina-ize icons */
|
/* Retina-ize icons */
|
||||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
|
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
|
||||||
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
|
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
|
||||||
background-image: url("select2/select2x2.png") !important;
|
background-image: url(<%= asset_path "desktop/select2/select2x2.png" %>) !important;
|
||||||
background-repeat: no-repeat !important;
|
background-repeat: no-repeat !important;
|
||||||
background-size: 60px 40px !important; }
|
background-size: 60px 40px !important; }
|
||||||
|
|
|
@ -86,26 +86,27 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
background-color: #fff;
|
|
||||||
|
background: #fff;
|
||||||
color: #000;
|
color: #000;
|
||||||
border: 2px solid $gray;
|
border: 1px solid $gray;
|
||||||
// border-top: 0;
|
border-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-drop.select2-drop-above {
|
.select2-drop.select2-drop-above {
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
// border-top: 1px solid $gray;
|
border-top: 1px solid $gray;
|
||||||
// border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-container .select2-choice div {
|
.select2-container .select2-choice div {
|
||||||
display: block;
|
display: block;
|
||||||
width: 21px;
|
width: 20px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
border-left: solid 1px $gray;
|
background: #ccc;
|
||||||
@include box-sizing;
|
@include box-sizing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +114,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: url('select2/select2.png') no-repeat 0 50%;
|
background: url('select2/select2.png') no-repeat 0 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-search {
|
.select2-search {
|
||||||
|
@ -166,22 +167,23 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
|
|
||||||
.select2-dropdown-open .select2-choice {
|
.select2-dropdown-open .select2-choice {
|
||||||
border-bottom-color: transparent;
|
border-bottom-color: transparent;
|
||||||
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-dropdown-open .select2-choice div {
|
.select2-dropdown-open .select2-choice div {
|
||||||
background-color: $gray;
|
background: transparent;
|
||||||
// border-left: none;
|
border-left: none;
|
||||||
filter: none;
|
filter: none;
|
||||||
}
|
}
|
||||||
.select2-dropdown-open .select2-choice div b {
|
.select2-dropdown-open .select2-choice div b {
|
||||||
background-position: -20px 50%;
|
background-position: -18px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* results */
|
/* results */
|
||||||
.select2-results {
|
.select2-results {
|
||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
// padding: 0 0 0 4px;
|
padding: 0 0 0 4px;
|
||||||
// margin: 4px 4px 4px 0;
|
margin: 4px 4px 4px 0;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
@ -205,11 +207,6 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
list-style: none;
|
list-style: none;
|
||||||
display: list-item;
|
display: list-item;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
border-top: solid 1px lighten($gray, 10%);
|
|
||||||
|
|
||||||
:first-child {
|
|
||||||
border-top: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-results li.select2-result-with-children > .select2-result-label {
|
.select2-results li.select2-result-with-children > .select2-result-label {
|
||||||
|
@ -217,7 +214,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-results .select2-result-label {
|
.select2-results .select2-result-label {
|
||||||
padding: 6px;
|
padding: 4px 6px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
@ -380,11 +377,11 @@ disabled look for disabled choices in the results dropdown
|
||||||
|
|
||||||
.select2-search-choice-close {
|
.select2-search-choice-close {
|
||||||
display: block;
|
display: block;
|
||||||
width: 10px;
|
width: 12px;
|
||||||
height: 10px;
|
height: 13px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 3px;
|
right: 3px;
|
||||||
top: 5px;
|
top: 4px;
|
||||||
font-size: 1px;
|
font-size: 1px;
|
||||||
outline: none;
|
outline: none;
|
||||||
background: url('select2/select2.png') right top no-repeat;
|
background: url('select2/select2.png') right top no-repeat;
|
||||||
|
@ -395,10 +392,10 @@ disabled look for disabled choices in the results dropdown
|
||||||
}
|
}
|
||||||
|
|
||||||
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
|
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
|
||||||
background-position: right -20px;
|
background-position: right -11px;
|
||||||
}
|
}
|
||||||
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
||||||
background-position: right -20px;
|
background-position: right -11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* disabled styles */
|
/* disabled styles */
|
||||||
|
@ -430,7 +427,6 @@ disabled look for disabled choices in the results dropdown
|
||||||
.select2-offscreen {
|
.select2-offscreen {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -10000px;
|
left: -10000px;
|
||||||
top: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Retina-ize icons */
|
/* Retina-ize icons */
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
.main-list {
|
.main-list {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
#filter .main-list, #filter + .main-list {
|
|
||||||
table-layout: fixed;
|
|
||||||
}
|
|
||||||
.main-wrap>.main-list thead th {
|
.main-wrap>.main-list thead th {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border-right: medium none;
|
border-right: medium none;
|
||||||
|
@ -39,7 +36,7 @@
|
||||||
}
|
}
|
||||||
.main-list tbody .quick-edit .nav {
|
.main-list tbody .quick-edit .nav {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 440px;
|
width: 350px;
|
||||||
left: -8px;
|
left: -8px;
|
||||||
}
|
}
|
||||||
.main-list tbody .quick-edit .nav .dropdown-menu {
|
.main-list tbody .quick-edit .nav .dropdown-menu {
|
||||||
|
|
|
@ -1,150 +0,0 @@
|
||||||
.o-question {
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
.o-question input[type=checkbox], .o-question input[type=radio] {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.o-question textarea {
|
|
||||||
resize: vertical;
|
|
||||||
}
|
|
||||||
.o-question-topic {
|
|
||||||
font-size: 2em;
|
|
||||||
line-height: normal;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0.5em 0;
|
|
||||||
}
|
|
||||||
.o-question-description {
|
|
||||||
font-size: 0.9em;
|
|
||||||
line-height: 1.5em;
|
|
||||||
}
|
|
||||||
.o-question-list {
|
|
||||||
clear: both;
|
|
||||||
margin: 40px 0;
|
|
||||||
padding: 0;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.o-question-list > li {
|
|
||||||
margin: 0 0 0 40px;
|
|
||||||
padding: 16px 0;
|
|
||||||
border-top: solid 1px #eee;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.o-question-list > li .required-star {
|
|
||||||
position: absolute;
|
|
||||||
left: -42px;
|
|
||||||
padding-top: 4px;
|
|
||||||
}
|
|
||||||
.o-question-list > li:first-child {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
.o-question-title {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.2em;
|
|
||||||
line-height: 1.5em;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
.o-question-title + .o-question-description {
|
|
||||||
font-weight: normal;
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
padding: 16px;
|
|
||||||
position: relative;
|
|
||||||
margin-top: 20px;
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
||||||
.o-question-title + .o-question-description:before {
|
|
||||||
display: block;
|
|
||||||
content: "";
|
|
||||||
border-left: 12px solid transparent;
|
|
||||||
border-right: 12px solid transparent;
|
|
||||||
border-bottom: 12px solid #f6f6f6;
|
|
||||||
position: absolute;
|
|
||||||
top: -12px;
|
|
||||||
left: 16px;
|
|
||||||
}
|
|
||||||
.o-question-title + input[type=text],
|
|
||||||
.o-question-title + textarea,
|
|
||||||
.o-question-title + select,
|
|
||||||
.o-question-description + input[type=text],
|
|
||||||
.o-question-description + textarea,
|
|
||||||
.o-question-description + select {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.o-question-title + input[type=text], .o-question-title + textarea {
|
|
||||||
border: solid 1px #ccc;
|
|
||||||
padding: 6px;
|
|
||||||
margin: 20px 0;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
.o-question-title + input[type=text] {
|
|
||||||
width: 40%;
|
|
||||||
}
|
|
||||||
.o-question-title + textarea {
|
|
||||||
width: 70%;
|
|
||||||
}
|
|
||||||
.o-question-group {
|
|
||||||
margin: 20px 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.o-question-option {
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.o-question-group.view-list {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
.o-question-group.view-list .o-question-option {}
|
|
||||||
.o-question-group.view-list > li {
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
.o-question-group.view-list > li:first-child {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.o-question-group.view-list > li > * {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.o-question-group.view-list > li input + .o-question-option {
|
|
||||||
margin: 0 0 0 12px;
|
|
||||||
}
|
|
||||||
.o-question-group.view-dropdown {
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid {
|
|
||||||
border-collapse: collapse;
|
|
||||||
max-width: 90%;
|
|
||||||
min-width: 50%;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid th, .o-question-group.view-grid td {
|
|
||||||
padding: 6px;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid thead th {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid tbody th {}
|
|
||||||
.o-question-group.view-grid tbody .odd .o-question-title, .o-question-group.view-grid tbody .odd td {
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid .o-question-title {
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid tbody .odd .o-question-title {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid tbody .odd td {}
|
|
||||||
.o-question-group.view-grid tbody tr:hover td {
|
|
||||||
background-color: #aaa;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid tbody td {
|
|
||||||
vertical-align: middle;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.o-question-group.view-grid tbody td input {
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
.o-question-action {
|
|
||||||
padding: 20px;
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700);
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 50px 0;
|
|
||||||
background-color: #eee;
|
|
||||||
font-family: 'Open Sans', sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
background: #FFFFFF none;
|
|
||||||
box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
|
|
||||||
margin: 0 auto;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 980px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper > h1 {
|
|
||||||
margin: 0;
|
|
||||||
padding: 20px;
|
|
||||||
font-family: 'Open Sans', sans-serif;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
section {
|
|
||||||
border-top: dashed 3px #eee;
|
|
||||||
padding: 40px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
section:first-child {
|
|
||||||
border: 0;
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
section > h2 {
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: bold;
|
|
||||||
border: solid 1px #ddd;
|
|
||||||
background-color: #2676C0;
|
|
||||||
color: #fff;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0 16px;
|
|
||||||
box-shadow: 0 1px 1px #fff, 0 2px 6px rgba(0,0,0,0.1);
|
|
||||||
}
|
|
||||||
.side {
|
|
||||||
float: right;
|
|
||||||
width: 189px;
|
|
||||||
padding-left: 20px;
|
|
||||||
border-left: solid 1px #eee;
|
|
||||||
}
|
|
||||||
.main {
|
|
||||||
float: left;
|
|
||||||
width: 710px;
|
|
||||||
padding-right: 20px;
|
|
||||||
}
|
|
|
@ -11,7 +11,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||||
def new
|
def new
|
||||||
@asset = Asset.new
|
@asset = Asset.new
|
||||||
@asset_categories = AssetCategory.all
|
@asset_categories = AssetCategory.all
|
||||||
@tags = get_tags
|
@tags = AssetTag.all
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {}
|
format.html {}
|
||||||
format.js { render 'js/show_pop_up', :locals => {:partial => 'admin/assets/new'} }
|
format.js { render 'js/show_pop_up', :locals => {:partial => 'admin/assets/new'} }
|
||||||
|
@ -21,7 +21,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||||
def edit
|
def edit
|
||||||
@asset = Asset.find(params[:id])
|
@asset = Asset.find(params[:id])
|
||||||
@asset_categories = AssetCategory.all
|
@asset_categories = AssetCategory.all
|
||||||
@tags = get_tags
|
@tags = AssetTag.all
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {}
|
format.html {}
|
||||||
format.js { render 'js/show_pop_up', :locals => {:partial => 'admin/assets/edit'} }
|
format.js { render 'js/show_pop_up', :locals => {:partial => 'admin/assets/edit'} }
|
||||||
|
@ -46,7 +46,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||||
else
|
else
|
||||||
flash[:error] = t('create.fail')
|
flash[:error] = t('create.fail')
|
||||||
@asset_categories = AssetCategory.all
|
@asset_categories = AssetCategory.all
|
||||||
@tags = get_tags
|
@tags = AssetTag.all
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js {
|
format.js {
|
||||||
if params[:uploader]
|
if params[:uploader]
|
||||||
|
@ -69,7 +69,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||||
else
|
else
|
||||||
flash[:error] = t('update.fail')
|
flash[:error] = t('update.fail')
|
||||||
@asset_categories = AssetCategory.all
|
@asset_categories = AssetCategory.all
|
||||||
@tags = get_tags
|
@tags = AssetTag.all
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :action => :edit }
|
format.html { render :action => :edit }
|
||||||
format.js { render 'js/reload_pop_up', :locals => {:value => @asset, :values => nil, :partial => 'admin/assets/edit', :locals => {:is_html => false}} }
|
format.js { render 'js/reload_pop_up', :locals => {:value => @asset, :values => nil, :partial => 'admin/assets/edit', :locals => {:is_html => false}} }
|
||||||
|
@ -96,7 +96,7 @@ class Admin::AssetsController < OrbitBackendController
|
||||||
def file_upload
|
def file_upload
|
||||||
@asset = Asset.new
|
@asset = Asset.new
|
||||||
@asset_categories = AssetCategory.all
|
@asset_categories = AssetCategory.all
|
||||||
@tags = get_tags
|
@tags = AssetTag.all
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ class Admin::DashboardsController < OrbitBackendController
|
||||||
# before_filter :is_admin?
|
# before_filter :is_admin?
|
||||||
|
|
||||||
def index
|
def index
|
||||||
check_backend_openness
|
|
||||||
@module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'page_context', 'web_link')
|
@module_app_contents, @module_app_contents_total = get_module_app_count('bulletin', 'page_context', 'web_link')
|
||||||
@recent_updated = get_recently_updated('bulletin', 'page_context', 'web_link')
|
@recent_updated = get_recently_updated('bulletin', 'page_context', 'web_link')
|
||||||
@most_visited = get_most_visited('bulletin', 'page_context')
|
@most_visited = get_most_visited('bulletin', 'page_context')
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
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
|
|
|
@ -1,126 +0,0 @@
|
||||||
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
|
|
|
@ -22,11 +22,6 @@ class Admin::PagePartsController < OrbitBackendController
|
||||||
@part = PagePart.find(params[:id])
|
@part = PagePart.find(params[:id])
|
||||||
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
|
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
|
||||||
@tag_objects = @r_tag.classify.constantize.all rescue nil
|
@tag_objects = @r_tag.classify.constantize.all rescue nil
|
||||||
if @r_tag.eql?('tag_cloud')
|
|
||||||
@tag_objects = ModuleApp.where(has_tag: true)
|
|
||||||
else
|
|
||||||
@tag_objects = @r_tag.classify.constantize.all rescue nil
|
|
||||||
end
|
|
||||||
|
|
||||||
@module_apps = ModuleApp.for_widget_select
|
@module_apps = ModuleApp.for_widget_select
|
||||||
@categories = nil
|
@categories = nil
|
||||||
|
@ -124,11 +119,7 @@ class Admin::PagePartsController < OrbitBackendController
|
||||||
def reload_r_tag_options
|
def reload_r_tag_options
|
||||||
@part = PagePart.find params[:id]
|
@part = PagePart.find params[:id]
|
||||||
@r_tag = params[:type]
|
@r_tag = params[:type]
|
||||||
if params[:type].eql?('tag_cloud')
|
|
||||||
@tag_objects = ModuleApp.where(has_tag: true)
|
|
||||||
else
|
|
||||||
@tag_objects = @r_tag.classify.constantize.all rescue nil
|
@tag_objects = @r_tag.classify.constantize.all rescue nil
|
||||||
end
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js {}
|
format.js {}
|
||||||
end
|
end
|
||||||
|
|
|
@ -148,22 +148,7 @@ include Admin::FrontendWidgetInterface
|
||||||
else
|
else
|
||||||
flash.now[:error] = t('create.error.page')
|
flash.now[:error] = t('create.error.page')
|
||||||
@designs = Design.all.entries
|
@designs = Design.all.entries
|
||||||
@design = Design.find(params[:page][:design]) || Design.first
|
@design = Design.first
|
||||||
@themes = @design.themes
|
|
||||||
@module_apps = ModuleApp.for_frontend_select
|
|
||||||
@selected={
|
|
||||||
:design => params[:page][:design],
|
|
||||||
:theme=> (Theme.find(params[:page][:theme_id]) rescue nil),
|
|
||||||
:module_app=> (ModuleApp.find(params[:page][:module_app_id]) rescue nil) ,#@module_apps.first
|
|
||||||
:app_frontend_url=> params[:page][:app_frontend_url], #@module_apps.first
|
|
||||||
:category=>params[:page][:category],
|
|
||||||
:tag=>params[:page][:tag],
|
|
||||||
:page_frontend_data_count=>params[:page][:page_frontend_data_count],
|
|
||||||
:frontend_style => params[:page][:frontend_style]
|
|
||||||
}
|
|
||||||
@app_frontend_urls = @item.module_app ? select_array_for_app_frontend_urls(@item.module_app.app_pages) : nil
|
|
||||||
get_categories_and_tags
|
|
||||||
get_frontend_data_count
|
|
||||||
render :action => "new"
|
render :action => "new"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
class Admin::RoleCategorysController < Admin::RoleFiltersController
|
|
||||||
|
|
||||||
def initialize
|
|
||||||
super
|
|
||||||
@app_type = 'role_category'
|
|
||||||
@app_type_name = 'category'
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,144 +0,0 @@
|
||||||
class Admin::RoleFiltersController < OrbitBackendController
|
|
||||||
|
|
||||||
include OrbitControllerLib::DivisionForDisable
|
|
||||||
|
|
||||||
layout "new_admin"
|
|
||||||
|
|
||||||
before_filter :authenticate_user!
|
|
||||||
before_filter :is_admin?
|
|
||||||
# before_filter :set_attribute, :only => [:index, :show, :new, :edit]
|
|
||||||
helper Admin::AttributeValuesViewHelper
|
|
||||||
|
|
||||||
def index
|
|
||||||
get_types
|
|
||||||
@role = Role.find(params[:role_id])
|
|
||||||
@role_filters = @types.where(:role_id=>params[:role_id])
|
|
||||||
@role_filter = @types.new(:display => 'List')
|
|
||||||
|
|
||||||
# @url = admin_role_filter_role_filters_path
|
|
||||||
|
|
||||||
if @app_type == 'role_statuses'
|
|
||||||
@url = eval("admin_#{@app_type}_path")
|
|
||||||
else
|
|
||||||
@url = eval("admin_#{@app_type}s_path")
|
|
||||||
end
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # index.html.erb
|
|
||||||
format.js
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def show
|
|
||||||
|
|
||||||
get_types
|
|
||||||
|
|
||||||
@role_filter = @types.find(params[:id])
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # show.html.erb
|
|
||||||
format.js
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def new
|
|
||||||
|
|
||||||
get_types
|
|
||||||
|
|
||||||
@role_filter = @types.new(:display => 'List')
|
|
||||||
|
|
||||||
@verb = :post
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html # new.html.erb
|
|
||||||
format.js
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def edit
|
|
||||||
|
|
||||||
get_types
|
|
||||||
|
|
||||||
@role_filter = @types.find(params[:id])
|
|
||||||
|
|
||||||
@url = polymorphic_path([:admin, @role_filter])
|
|
||||||
|
|
||||||
@verb = :put
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
format.html
|
|
||||||
format.js
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def create
|
|
||||||
|
|
||||||
get_types
|
|
||||||
|
|
||||||
@role_filter = @types.new(params[:role_filter])
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
if @role_filter.save
|
|
||||||
format.html { redirect_to(admin_role_filter_url(params[:role_filter][:role_id])) }
|
|
||||||
format.js
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def update
|
|
||||||
|
|
||||||
get_types
|
|
||||||
|
|
||||||
@role_filter = @types.find(params[:id])
|
|
||||||
# debugger
|
|
||||||
# @url = admin_role_filter_role_filter_path(@role_filter)
|
|
||||||
# @url = eval("admin_role_filter_#{@app_type}_path(#{@role_filter})")
|
|
||||||
@url = polymorphic_path([:admin, @role_filter])
|
|
||||||
|
|
||||||
respond_to do |format|
|
|
||||||
if @role_filter.update_attributes(params[:role_filter])
|
|
||||||
format.html { redirect_to(admin_role_filter_role_filters_url(params[:role_id]), :notice => t('role_filter.update_role_filter_success')) }
|
|
||||||
# format.xml { head :ok }
|
|
||||||
format.js
|
|
||||||
else
|
|
||||||
format.html { render :action => "edit" }
|
|
||||||
format.js { render :action => "edit" }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def destroy
|
|
||||||
|
|
||||||
get_types
|
|
||||||
|
|
||||||
@role_filter = @types.find(params[:id])
|
|
||||||
@role_filter.disable = @role_filter.disable ? false : true
|
|
||||||
|
|
||||||
if @role_filter.save!
|
|
||||||
respond_to do |format|
|
|
||||||
format.html { redirect_to(admin_role_filter_role_filters_url) }
|
|
||||||
# format.xml { head :ok }
|
|
||||||
format.js
|
|
||||||
end
|
|
||||||
else
|
|
||||||
flash[:error] = t("role_filter.update_failed")
|
|
||||||
format.html { render :action => "index" }
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def get_types
|
|
||||||
@types = @app_type.classify.constantize
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,9 +0,0 @@
|
||||||
class Admin::RoleStatusesController < Admin::RoleFiltersController
|
|
||||||
|
|
||||||
def initialize
|
|
||||||
super
|
|
||||||
@app_type = 'role_statuses'
|
|
||||||
@app_type_name = 'status'
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -28,6 +28,7 @@ class Admin::RolesController < OrbitBackendController
|
||||||
@attribute = Role.find(params[:role_id])
|
@attribute = Role.find(params[:role_id])
|
||||||
@attribute_fields_upper_object = @attribute.sub_roles
|
@attribute_fields_upper_object = @attribute.sub_roles
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_sub_role
|
def add_sub_role
|
||||||
|
@ -94,6 +95,7 @@ class Admin::RolesController < OrbitBackendController
|
||||||
format.js { render 'add_attribute_field' }
|
format.js { render 'add_attribute_field' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
|
@ -14,16 +14,8 @@ class Admin::SitesController < OrbitBackendController
|
||||||
# @site = Site.new
|
# @site = Site.new
|
||||||
# end
|
# end
|
||||||
|
|
||||||
def show_system_preference
|
|
||||||
@git_commit_list_file = File.new(OrbitSystemPreference::GitCommitListPath, "r") rescue nil
|
|
||||||
@db_backup_list_file = File.new(OrbitSystemPreference::ArchiveDbListPath, "r") rescue nil
|
|
||||||
@resque_logs_file = File.new(OrbitSystemPreference::ResqueLogFile, "r") rescue nil
|
|
||||||
@site = Site.first
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@site.update_attributes(params[:site])
|
@site.update_attributes(params[:site])
|
||||||
site_restart
|
|
||||||
redirect_to :back
|
redirect_to :back
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,16 @@ class Admin::TagsController < OrbitBackendController
|
||||||
before_filter :force_order_for_visitor,:only=>[:index]
|
before_filter :force_order_for_visitor,:only=>[:index]
|
||||||
before_filter :force_order_for_user,:except => [:index]
|
before_filter :force_order_for_user,:except => [:index]
|
||||||
before_filter :for_app_sub_manager,:except => [:index]
|
before_filter :for_app_sub_manager,:except => [:index]
|
||||||
|
|
||||||
|
|
||||||
|
# layout 'new_admin'
|
||||||
|
# before_filter :authenticate_user!
|
||||||
|
# before_filter :is_admin?
|
||||||
# before_filter :set_module_app
|
# before_filter :set_module_app
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@tags = get_tags
|
get_tags
|
||||||
|
@module_app_id = @module_app.id rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
@ -17,7 +23,12 @@ class Admin::TagsController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@tag = @module_app ? @module_app.tags.create(params[:tag]) : Tag.create(params[:tag])
|
if params[:tag][:module_app_id].blank?
|
||||||
|
@tag = Tag.create(params[:tag])
|
||||||
|
else
|
||||||
|
module_app = ModuleApp.find(params[:tag][:module_app_id])
|
||||||
|
@tag = eval("#{module_app.key.camelize}Tag").create(params[:tag])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
@ -36,12 +47,15 @@ class Admin::TagsController < OrbitBackendController
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def get_tags
|
def get_tags
|
||||||
@tags = @module_app.blank? ? Tag.all : @module_app.tags
|
@tags = (@module_app ? @module_app.tags : Tag.all)
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_vars
|
def setup_vars
|
||||||
@module_app = ModuleApp.find(params[:module_app_id]) if params[:module_app_id]
|
@app_key = request.env['HTTP_REFERER'].split('/')[4]
|
||||||
@module_app_id = @module_app.id rescue nil
|
if @app_key
|
||||||
|
@app_key.gsub!(/[?].*/, '')
|
||||||
|
@module_app = ModuleApp.first(conditions: {:key => @app_key})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
class Admin::UserActionsController < OrbitBackendController
|
|
||||||
layout "new_admin"
|
|
||||||
before_filter :authenticate_user!
|
|
||||||
before_filter :is_admin?
|
|
||||||
def index
|
|
||||||
@user_actions = UserAction.all
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,7 +1,5 @@
|
||||||
class Admin::UsersNewInterfaceController < OrbitBackendController
|
class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||||
|
|
||||||
helper MemberHelper
|
|
||||||
|
|
||||||
layout "new_admin"
|
layout "new_admin"
|
||||||
# before_filter :authenticate_user!
|
# before_filter :authenticate_user!
|
||||||
# before_filter :set_attribute, :only => [:index, :show, :new, :edit]
|
# before_filter :set_attribute, :only => [:index, :show, :new, :edit]
|
||||||
|
@ -25,13 +23,13 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||||
|
|
||||||
render case params[:at]
|
render case params[:at]
|
||||||
when 'summary'
|
when 'summary'
|
||||||
@users=User.not_guest_user.page(page_num).per(12).asc("_id").includes('avatar')
|
@users=User.not_guest_user.page(page_num).per(12).includes('avatar')
|
||||||
"index_summary"
|
"index_summary"
|
||||||
when 'thumbnail'
|
when 'thumbnail'
|
||||||
@users=User.not_guest_user.page(page_num).per(36).asc("_id").includes('avatar')
|
@users=User.not_guest_user.page(page_num).per(36).includes('avatar')
|
||||||
"index_thumbnail"
|
"index_thumbnail"
|
||||||
else
|
else
|
||||||
@users=User.not_guest_user.page(page_num).per(10).asc("_id").includes('avatar')
|
@users=User.not_guest_user.page(page_num).per(10).includes('avatar')
|
||||||
"index"
|
"index"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -45,7 +43,7 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||||
@student_data = []
|
@student_data = []
|
||||||
@staff_data = []
|
@staff_data = []
|
||||||
|
|
||||||
attribute_values = @user.attribute_values.asc("_id")
|
attribute_values = @user.attribute_values
|
||||||
attribute_values.each{|att_val|
|
attribute_values.each{|att_val|
|
||||||
@profile_data.push({:name => att_val.attribute_field.title,:value =>att_val.get_value_by_locale(I18n.locale.to_s)}) if att_val.attribute_field.attribute.key=="profile" rescue false
|
@profile_data.push({:name => att_val.attribute_field.title,:value =>att_val.get_value_by_locale(I18n.locale.to_s)}) if att_val.attribute_field.attribute.key=="profile" rescue false
|
||||||
}
|
}
|
||||||
|
@ -82,29 +80,21 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
# puts params.to_yaml
|
puts params.to_yaml
|
||||||
# attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
|
# attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
|
||||||
# attribute_values = params[:user].delete(attribute_values_key)
|
# attribute_values = params[:user].delete(attribute_values_key)
|
||||||
@user = User.new(params["user"])
|
@user = User.new(params["user"])
|
||||||
|
|
||||||
@checkuser = User.where(:user_id => params[:user][:user_id]).first
|
|
||||||
|
|
||||||
if !@checkuser.blank?
|
|
||||||
flash.now[:error] = t("users.user_id_error")
|
|
||||||
end
|
|
||||||
|
|
||||||
# attribute_values.to_hash.each{|key,value|
|
# attribute_values.to_hash.each{|key,value|
|
||||||
# @user.attribute_values.build(value)
|
# @user.attribute_values.build(value)
|
||||||
# }
|
# }
|
||||||
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||||
# binding.pry
|
# binding.pry
|
||||||
if !flash.now[:error] && @user.save
|
if @user.save
|
||||||
flash[:notice] = t('create.success.user')
|
flash[:notice] = t('create.success.user')
|
||||||
redirect_to :action => :index
|
redirect_to :action => :index
|
||||||
else
|
else
|
||||||
@user.attribute_values = nil
|
|
||||||
@form_index = 0
|
@form_index = 0
|
||||||
render :action => :new , :notice => flash.now[:error]
|
render :action => :new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -121,45 +111,15 @@ class Admin::UsersNewInterfaceController < OrbitBackendController
|
||||||
get_info_and_roles
|
get_info_and_roles
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit_passwd
|
|
||||||
# @disable_all_field = false
|
|
||||||
@user = User.find(params[:users_new_interface_id])
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|
||||||
@user = User.find(params[:id])
|
@user = User.find(params[:id])
|
||||||
|
|
||||||
if params[:edit_type] == 'edit_passwd'
|
|
||||||
|
|
||||||
@checkuser = User.where(:user_id => params[:user][:user_id]).first
|
|
||||||
|
|
||||||
if !@checkuser.blank? && @checkuser.id != @user.id
|
|
||||||
flash.now[:error] = t("users.user_id_error")
|
|
||||||
elsif @user.admin && current_user.id == @user.id
|
|
||||||
flash.now[:error] = t("users.admin_change_password")
|
|
||||||
end
|
|
||||||
|
|
||||||
if !flash.now[:error] && @user.update_attributes(params[:user])
|
|
||||||
redirect_to :action => :show
|
|
||||||
else
|
|
||||||
render :action => :edit_passwd, :notice => flash.now[:error]
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
@user.update_attributes(params[:user])
|
@user.update_attributes(params[:user])
|
||||||
|
|
||||||
attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
|
attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values'
|
||||||
attribute_values = params[:user].delete(attribute_values_key)
|
attribute_values = params[:user].delete(attribute_values_key)
|
||||||
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
|
||||||
@user.save
|
@user.save
|
||||||
|
|
||||||
redirect_to :action => :show
|
redirect_to :action => :show
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# # Update changes to the avatar
|
# # Update changes to the avatar
|
||||||
# @user.remove_avatar! if params[:file]
|
# @user.remove_avatar! if params[:file]
|
||||||
# @user.avatar = params[:file] if params[:file]
|
# @user.avatar = params[:file] if params[:file]
|
||||||
|
|
|
@ -17,19 +17,10 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
helper_attr :site_valid_locales
|
helper_attr :site_valid_locales
|
||||||
|
|
||||||
def check_backend_openness
|
|
||||||
if !Me.backend_openness_on
|
|
||||||
redirect_to '/users/sign_in' if not (authenticate_user! and is_member? )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def site_restart
|
|
||||||
Resque.enqueue(RestartServer)
|
|
||||||
end
|
|
||||||
|
|
||||||
def set_current_user
|
def set_current_user
|
||||||
User.current = current_or_guest_user
|
User.current = current_or_guest_user
|
||||||
UserActionRecoder.perform(current_or_guest_user,params.to_s)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def front_end_available(module_app_title='')
|
def front_end_available(module_app_title='')
|
||||||
|
@ -110,10 +101,10 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# Render the page
|
# Render the page
|
||||||
def render_page(args={})
|
def render_page
|
||||||
if @item
|
if @item
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :text => parse_page_content(@item,args), :layout => 'page_layout' }
|
format.html { render :text => parse_page_content(@item), :layout => 'page_layout' }
|
||||||
format.rss { render_main_rss }
|
format.rss { render_main_rss }
|
||||||
format.mobile { redirect_to mobile_path(:app => params[:app]) }
|
format.mobile { redirect_to mobile_path(:app => params[:app]) }
|
||||||
end
|
end
|
||||||
|
@ -156,7 +147,7 @@ class ApplicationController < ActionController::Base
|
||||||
# Set the site variables
|
# Set the site variables
|
||||||
def set_site
|
def set_site
|
||||||
# set site if exist or create site
|
# set site if exist or create site
|
||||||
@site = Site.first || Site.create({:valid_locales => VALID_LOCALES, :in_use_locales => VALID_LOCALES})
|
@site = Site.first || Site.create({:valid_locales => [], :in_use_locales => []})
|
||||||
session[:site] = @site.id
|
session[:site] = @site.id
|
||||||
@site_in_use_locales = site_locales_default_head(@site.in_use_locales)
|
@site_in_use_locales = site_locales_default_head(@site.in_use_locales)
|
||||||
@site_valid_locales = site_locales_default_head(@site.valid_locales)
|
@site_valid_locales = site_locales_default_head(@site.valid_locales)
|
||||||
|
@ -229,174 +220,6 @@ class ApplicationController < ActionController::Base
|
||||||
redirect_to ret
|
redirect_to ret
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_sorted_and_filtered(object_class, query = nil, objects = nil)
|
|
||||||
objects ||= get_objects(object_class, query)
|
|
||||||
object_class = object_class.classify.constantize
|
|
||||||
if !params[:sort].blank?
|
|
||||||
options = params[:sort_options]
|
|
||||||
options = [options] if !options.class.eql?(Array)
|
|
||||||
options.each do |option|
|
|
||||||
if object_class.fields.include?(option)
|
|
||||||
if object_class.fields[option].type.to_s.eql?('Object') && !object_class.relations[option].nil?
|
|
||||||
objects = get_objects_from_referenced_objects(object_class.fields[option].options[:class_name].constantize, objects, option)
|
|
||||||
else
|
|
||||||
(objects = objects.order_by(option, params[:direction])) rescue nil
|
|
||||||
end
|
|
||||||
elsif object_class.relations.include?(option)
|
|
||||||
case object_class.relations[option].macro
|
|
||||||
when :references_one
|
|
||||||
a = Array.new
|
|
||||||
objects.each { |object| a << [get_string_value_from_object(object), object] }
|
|
||||||
sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse!
|
|
||||||
objects = sorted.collect {|x| x[1] }
|
|
||||||
when :references_many, :references_and_referenced_in_many
|
|
||||||
objects = get_objects_from_self(object_class, objects, option)
|
|
||||||
when :referenced_in
|
|
||||||
objects = get_objects_from_referenced_objects(object_class.relations[option].class_name.constantize, objects, "#{option}_id")
|
|
||||||
end
|
|
||||||
elsif option.eql?('tags')
|
|
||||||
tag_array = @module_app.tags.inject([]){ |result, value|
|
|
||||||
result << [value.name, value]
|
|
||||||
}
|
|
||||||
params[:direction].eql?('asc') ? tag_array.sort : tag_array.sort.reverse!
|
|
||||||
sorted_objects = Array.new
|
|
||||||
tag_array.each do |x|
|
|
||||||
taggings = x[1].taggings
|
|
||||||
taggings.each {|tagging| sorted_objects << tagging.taggable }
|
|
||||||
end
|
|
||||||
# debugger
|
|
||||||
sorted_objects.flatten!
|
|
||||||
sorted_objects.uniq!
|
|
||||||
objects = get_with_nil(objects, option, sorted_objects)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if @filter
|
|
||||||
@filter.each do |key, value|
|
|
||||||
case key
|
|
||||||
when 'status'
|
|
||||||
a = Array.new
|
|
||||||
objects.each do |object|
|
|
||||||
value.each do |v|
|
|
||||||
a << object if object[v]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
objects = a.uniq
|
|
||||||
when 'categories'
|
|
||||||
a = Array.new
|
|
||||||
objects.each do |object|
|
|
||||||
a << object if (value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s) rescue nil)
|
|
||||||
end
|
|
||||||
objects = a.uniq
|
|
||||||
when 'tags'
|
|
||||||
a = Array.new
|
|
||||||
objects.each do |object|
|
|
||||||
object.tags.each do |tag|
|
|
||||||
a << object if value.include?(tag.id.to_s)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
objects = a.uniq
|
|
||||||
end if value.size > 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_viewable(object_class, query=nil)
|
|
||||||
objects = get_objects(object_class,query).order_by(:created_at, :desc)
|
|
||||||
Kaminari.paginate_array(objects).page(params[:page]).per(10)
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_objects(object_class, query=nil)
|
|
||||||
object_class = object_class.classify.constantize
|
|
||||||
# debugger
|
|
||||||
# a=1
|
|
||||||
if query
|
|
||||||
if object_class.include?(Mongoid::Sortable)
|
|
||||||
objects = object_class.default_sort(params[:sort]).where(query)
|
|
||||||
else
|
|
||||||
objects = object_class.where(query)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if object_class.include?(Mongoid::Sortable)
|
|
||||||
objects = object_class.default_sort(params[:sort]).all
|
|
||||||
else
|
|
||||||
objects = object_class.all
|
|
||||||
end
|
|
||||||
end
|
|
||||||
objects
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_objects_from_referenced_objects(object_class, objects, option)
|
|
||||||
referer_ids = objects.distinct(option)
|
|
||||||
referenced_objects = object_class.find(referer_ids) rescue nil
|
|
||||||
if referenced_objects
|
|
||||||
a = Array.new
|
|
||||||
referenced_objects.to_a.each { |referer| a << [get_string_value_from_object(referer), referer.id] }
|
|
||||||
sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse!
|
|
||||||
sorted_objects = sorted.collect {|x| objects.where(option => x[1]).entries }
|
|
||||||
sorted_objects.flatten!
|
|
||||||
sorted_objects.uniq!
|
|
||||||
get_with_nil(objects, option, sorted_objects)
|
|
||||||
else
|
|
||||||
objects
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_objects_from_self(object_class, objects, option)
|
|
||||||
referenced_class = object_class.relations[option].class_name.constantize
|
|
||||||
referenced_objects = referenced_class.all rescue nil
|
|
||||||
if referenced_objects
|
|
||||||
reverse_relation = nil
|
|
||||||
referenced_class.relations.each { |relation| reverse_relation = relation[1].name.to_s if relation[1].class_name.eql?(object_class.to_s) }
|
|
||||||
a = Array.new
|
|
||||||
referenced_objects.each { |referenced_object| a << [get_string_value_from_object(referenced_object), referenced_object] }
|
|
||||||
a.compact!
|
|
||||||
sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse!
|
|
||||||
sorted_objects = Array.new
|
|
||||||
sorted.each {|x| sorted_objects << x[1].send(reverse_relation) }
|
|
||||||
sorted_objects.flatten!
|
|
||||||
sorted_objects.uniq!
|
|
||||||
get_with_nil(objects, option, sorted_objects)
|
|
||||||
else
|
|
||||||
objects
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_string_value_from_object(object)
|
|
||||||
s = object.name_translations[I18n.locale.to_s] unless s rescue nil
|
|
||||||
s = object.title_translations[I18n.locale.to_s] unless s rescue nil
|
|
||||||
s = object.name unless s rescue nil
|
|
||||||
s = object.title unless s rescue nil
|
|
||||||
s.downcase rescue ''
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_with_nil(objects, option, sorted_objects)
|
|
||||||
tmp = Array.new
|
|
||||||
objects.each { |object| tmp << [get_string_value_from_object(object), object] if (object.send(option).blank? || (object.send(option).size == 0 rescue nil)) }
|
|
||||||
sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse!
|
|
||||||
sorted_tmp = sorted.collect {|a| a[1] }
|
|
||||||
a = params[:direction].eql?('asc') ? (sorted_tmp + sorted_objects) : (sorted_objects + sorted_tmp)
|
|
||||||
a.flatten
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def filter_authorized_objects(objects)
|
|
||||||
if(!is_admin? || !is_manager?)
|
|
||||||
objects.delete_if{ |object|
|
|
||||||
if object.is_pending == true
|
|
||||||
if check_permission(:manager)
|
|
||||||
object.create_user_id != current_user.id
|
|
||||||
else
|
|
||||||
!object.send("#{object.class.to_s.underscore}_category").authed_users('fact_check').include?(current_user) rescue false
|
|
||||||
end
|
|
||||||
else
|
|
||||||
false
|
|
||||||
end
|
|
||||||
}
|
|
||||||
end
|
|
||||||
objects
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -11,40 +11,37 @@ class DefaultWidgetController< OrbitWidgetController
|
||||||
end
|
end
|
||||||
|
|
||||||
def query_for_default_widget
|
def query_for_default_widget
|
||||||
@ori_class_name = @default_widget["query"].split('.')[0]
|
|
||||||
@result = eval(@default_widget["query"])
|
ori_class_name = @default_widget["query"].split('.')[0]
|
||||||
|
result = nil
|
||||||
|
result_objects = nil
|
||||||
|
|
||||||
if !params["tag_id"].blank?
|
if !params["tag_id"].blank?
|
||||||
|
@tags = Tag.find(params["tag_id"]) rescue nil
|
||||||
|
result_ids = nil
|
||||||
|
|
||||||
|
result_ids = @tags.collect{|tag| tag.send(ori_class_name.downcase.pluralize).entries.collect{|t| t.id}}
|
||||||
if params["category_id"].blank? #has tag no cate
|
if params["category_id"].blank? #has tag no cate
|
||||||
@result.selector[:tagged_ids] = { "$in" => params['tag_id'] }
|
#nothing
|
||||||
else #has tag and cate
|
else #has tag and cate
|
||||||
@result.selector[get_category_field_name] = { "$in" => params['category_id'].collect{|t| BSON::ObjectId(t)}}
|
# result_ids = @tags.collect{|tag| tag.send(ori_class_name.downcase.pluralize).where(:#{get_category_field_name(ori_class_name)}.in=>params["category_id"]).available_for_lang(I18n.locale).can_display.collect{|t| t.id}}.flatten
|
||||||
@result.selector[:tagged_ids] = { "$in" => params['tag_id'] }
|
result_ids << eval("#{ori_class_name}.where(:#{get_category_field_name(ori_class_name)}.in=>params['category_id']).entries.collect{|t| t.id}")
|
||||||
|
result_ids.flatten!
|
||||||
|
|
||||||
end
|
end
|
||||||
|
result = eval("#{ori_class_name}.where(:id=>result_ids)")
|
||||||
elsif params["category_id"].blank? #no tag no cate
|
elsif params["category_id"].blank? #no tag no cate
|
||||||
|
result = eval(@default_widget["query"])
|
||||||
else #no tag has cate
|
else #no tag has cate
|
||||||
|
result = eval("#{ori_class_name}.where(:#{get_category_field_name(ori_class_name)}.in=>params['category_id'])")
|
||||||
@result.selector[get_category_field_name] = { "$in" => params['category_id'].collect{|t| BSON::ObjectId(t)}}
|
|
||||||
end
|
end
|
||||||
eval("@result.#{@default_widget[:sorting_query]}")
|
date_now = Time.now
|
||||||
end
|
result.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)
|
||||||
|
|
||||||
def search_result
|
|
||||||
@search = query_for_default_widget.solr_search do
|
|
||||||
fulltext params[:search_query]
|
|
||||||
end
|
|
||||||
search_result = @search.results.collect{|result| result.id}
|
|
||||||
@items = eval(@ori_class_name).all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_widget
|
def default_widget
|
||||||
@search = params["search_query"].blank? ? false : true
|
if !params[:id].blank?
|
||||||
if !params[:id].blank? and !params["clicked_field_name"].blank?
|
redirect_to eval("#{@page_part.module_app.widget_fields_link_method[:title][:method]}('#{params[:id]}', {inner: #{params[:inner] || true}})")
|
||||||
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}})")
|
|
||||||
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
|
||||||
|
@ -66,13 +63,8 @@ class DefaultWidgetController< OrbitWidgetController
|
||||||
@fields = @page_part.widget_field
|
@fields = @page_part.widget_field
|
||||||
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
@data_limit = @page_part.widget_data_count.is_a?(Fixnum) ? @page_part.widget_data_count : (@page_part.widget_data_count.to_i rescue 3)
|
||||||
end
|
end
|
||||||
|
if @paginate
|
||||||
if @paginate || @search
|
|
||||||
if @search
|
|
||||||
@data = search_result.page(params[:page_main]).per(@data_limit) rescue []
|
|
||||||
else #regular listing
|
|
||||||
@data = query_for_default_widget.includes(@widget_image_field).page(params[:page_main]).per(@data_limit)
|
@data = query_for_default_widget.includes(@widget_image_field).page(params[:page_main]).per(@data_limit)
|
||||||
end
|
|
||||||
# @data = query_for_default_widget.limit(@data_limit).includes(@widget_image_field)
|
# @data = query_for_default_widget.limit(@data_limit).includes(@widget_image_field)
|
||||||
else
|
else
|
||||||
@data = query_for_default_widget.includes(@widget_image_field).limit(@data_limit)
|
@data = query_for_default_widget.includes(@widget_image_field).limit(@data_limit)
|
||||||
|
@ -92,10 +84,10 @@ class DefaultWidgetController< OrbitWidgetController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_category_field_name
|
def get_category_field_name(ori_class_name)
|
||||||
@ori_class_name = @ori_class_name.constantize unless @ori_class_name.is_a? Class
|
ori_class_name = ori_class_name.constantize
|
||||||
@ori_class_name.fields.each_key do |key|
|
ori_class_name.fields.each_key do |key|
|
||||||
return key.to_s if key.include?('category_id')
|
return key if key.include?('category_id')
|
||||||
end
|
end
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,11 +38,6 @@ class FrontController < ApplicationController
|
||||||
@ad_images = AdImage.all
|
@ad_images = AdImage.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_tag_cloud
|
|
||||||
module_app = ModuleApp.find(params[:id]) rescue nil
|
|
||||||
@tags = module_app.sorted_tags_for_cloud
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def menu_level(page, current_page, current, menu)
|
def menu_level(page, current_page, current, menu)
|
||||||
|
|
|
@ -43,7 +43,7 @@ class MobileController < ApplicationController
|
||||||
|
|
||||||
def page
|
def page
|
||||||
@page_title = t('mobile.page')
|
@page_title = t('mobile.page')
|
||||||
@page_contexts = get_sorted_page_from_structure
|
@page_contexts = PageContext.where(:archived => false).page(params[:page_main]).per(15)
|
||||||
end
|
end
|
||||||
|
|
||||||
def page_content
|
def page_content
|
||||||
|
@ -57,12 +57,4 @@ class MobileController < ApplicationController
|
||||||
@no_footer = true if request.path =~ /app/
|
@no_footer = true if request.path =~ /app/
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_sorted_page_from_structure
|
|
||||||
page_contexts = Item.structure_ordered_items.inject([]){ |pages, page|
|
|
||||||
pages << page.page_contexts.where(archived: false).limit(1)[0] if page.is_a?(Page) && !page.page_contexts.blank?
|
|
||||||
pages
|
|
||||||
}
|
|
||||||
Kaminari.paginate_array(page_contexts).page(params[:page]).per(15)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
class OrbitBackendController < ApplicationController
|
class OrbitBackendController < ApplicationController
|
||||||
include OrbitCoreLib::AppBackendUtility
|
include OrbitCoreLib::AppBackendUtility
|
||||||
include OrbitCoreLib::PermissionUtility
|
include OrbitCoreLib::PermissionUtility
|
||||||
include OrbitTag::Tagging
|
|
||||||
include AdminHelper
|
include AdminHelper
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
|
||||||
|
@ -16,7 +15,6 @@ class OrbitBackendController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def force_order_for_visitor
|
def force_order_for_visitor
|
||||||
check_backend_openness
|
|
||||||
setup_vars
|
setup_vars
|
||||||
set_current_user
|
set_current_user
|
||||||
end
|
end
|
||||||
|
@ -35,4 +33,152 @@ class OrbitBackendController < ApplicationController
|
||||||
redirect_to root_url
|
redirect_to root_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_sorted_and_filtered(object_class, query=nil)
|
||||||
|
objects = get_objects(object_class, query)
|
||||||
|
object_class = object_class.classify.constantize
|
||||||
|
if !params[:sort].blank?
|
||||||
|
options = params[:sort_options]
|
||||||
|
options = [options] if !options.class.eql?(Array)
|
||||||
|
options.each do |option|
|
||||||
|
if object_class.fields.include?(option)
|
||||||
|
if object_class.fields[option].type.to_s.eql?('Object') && !object_class.relations[option].nil?
|
||||||
|
objects = get_objects_from_referenced_objects(object_class.fields[option].options[:class_name].constantize, objects, option)
|
||||||
|
else
|
||||||
|
(objects = objects.order_by(option, params[:direction])) rescue nil
|
||||||
|
end
|
||||||
|
elsif object_class.relations.include?(option)
|
||||||
|
case object_class.relations[option].macro
|
||||||
|
when :references_one
|
||||||
|
a = Array.new
|
||||||
|
objects.each { |object| a << [get_string_value_from_object(object), object] }
|
||||||
|
sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse!
|
||||||
|
objects = sorted.collect {|x| x[1] }
|
||||||
|
when :references_many, :references_and_referenced_in_many
|
||||||
|
objects = get_objects_from_self(object_class, objects, option)
|
||||||
|
when :referenced_in
|
||||||
|
objects = get_objects_from_referenced_objects(object_class.relations[option].class_name.constantize, objects, "#{option}_id")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if @filter
|
||||||
|
@filter.each do |key, value|
|
||||||
|
case key
|
||||||
|
when 'status'
|
||||||
|
a = Array.new
|
||||||
|
objects.each do |object|
|
||||||
|
value.each do |v|
|
||||||
|
a << object if object[v]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
objects = a.uniq
|
||||||
|
when 'categories'
|
||||||
|
a = Array.new
|
||||||
|
objects.each do |object|
|
||||||
|
a << object if (value.include?(object.send("#{object.class.to_s.underscore}_category").id.to_s) rescue nil)
|
||||||
|
end
|
||||||
|
objects = a.uniq
|
||||||
|
when 'tags'
|
||||||
|
a = Array.new
|
||||||
|
objects.each do |object|
|
||||||
|
object.tags.each do |tag|
|
||||||
|
a << object if value.include?(tag.id.to_s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
objects = a.uniq
|
||||||
|
end if value.size > 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_string_value_from_object(object)
|
||||||
|
s = object.name_translations[I18n.locale.to_s] unless s rescue nil
|
||||||
|
s = object.title_translations[I18n.locale.to_s] unless s rescue nil
|
||||||
|
s = object.name unless s rescue nil
|
||||||
|
s = object.title unless s rescue nil
|
||||||
|
s.downcase rescue ''
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_objects_from_referenced_objects(object_class, objects, option)
|
||||||
|
referer_ids = objects.distinct(option)
|
||||||
|
referenced_objects = object_class.find(referer_ids) rescue nil
|
||||||
|
if referenced_objects
|
||||||
|
a = Array.new
|
||||||
|
referenced_objects.to_a.each { |referer| a << [get_string_value_from_object(referer), referer.id] }
|
||||||
|
sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse!
|
||||||
|
sorted_objects = sorted.collect {|x| objects.where(option => x[1]).entries }
|
||||||
|
sorted_objects.flatten!
|
||||||
|
sorted_objects.uniq!
|
||||||
|
get_with_nil(objects, option, sorted_objects)
|
||||||
|
else
|
||||||
|
objects
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_objects_from_self(object_class, objects, option)
|
||||||
|
referenced_class = object_class.relations[option].class_name.constantize
|
||||||
|
referenced_objects = referenced_class.all rescue nil
|
||||||
|
if referenced_objects
|
||||||
|
reverse_relation = nil
|
||||||
|
referenced_class.relations.each { |relation| reverse_relation = relation[1].name.to_s if relation[1].class_name.eql?(object_class.to_s) }
|
||||||
|
a = Array.new
|
||||||
|
referenced_objects.each { |referenced_object| a << [get_string_value_from_object(referenced_object), referenced_object] }
|
||||||
|
a.compact!
|
||||||
|
sorted = params[:direction].eql?('asc') ? a.sort : a.sort.reverse!
|
||||||
|
sorted_objects = Array.new
|
||||||
|
sorted.each {|x| sorted_objects << x[1].send(reverse_relation) }
|
||||||
|
sorted_objects.flatten!
|
||||||
|
sorted_objects.uniq!
|
||||||
|
get_with_nil(objects, option, sorted_objects)
|
||||||
|
else
|
||||||
|
objects
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_with_nil(objects, option, sorted_objects)
|
||||||
|
tmp = Array.new
|
||||||
|
objects.each { |object| tmp << [get_string_value_from_object(object), object] if (object.send(option).blank? || (object.send(option).size == 0 rescue nil)) }
|
||||||
|
sorted = params[:direction].eql?('asc') ? tmp.sort : tmp.sort.reverse!
|
||||||
|
sorted_tmp = sorted.collect {|a| a[1] }
|
||||||
|
a = params[:direction].eql?('asc') ? (sorted_tmp + sorted_objects) : (sorted_objects + sorted_tmp)
|
||||||
|
a.flatten
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def get_viewable(object_class, query=nil)
|
||||||
|
objects = get_objects(object_class,query).order_by(:created_at, :desc)
|
||||||
|
Kaminari.paginate_array(objects).page(params[:page]).per(10)
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_objects(object_class, query=nil)
|
||||||
|
object_class = object_class.classify.constantize
|
||||||
|
# debugger
|
||||||
|
# a=1
|
||||||
|
if query
|
||||||
|
objects = object_class.where(query)
|
||||||
|
else
|
||||||
|
objects = object_class.all
|
||||||
|
end
|
||||||
|
objects
|
||||||
|
end
|
||||||
|
|
||||||
|
def filter_authorized_objects(objects)
|
||||||
|
if(!is_admin? || !is_manager?)
|
||||||
|
objects.delete_if{ |object|
|
||||||
|
if object.is_pending == true
|
||||||
|
if check_permission(:manager)
|
||||||
|
object.create_user_id != current_user.id
|
||||||
|
else
|
||||||
|
!object.send("#{object.class.to_s.underscore}_category").authed_users('fact_check').include?(current_user) rescue false
|
||||||
|
end
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
objects
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -7,10 +7,4 @@ 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
|
|
@ -1,9 +1,4 @@
|
||||||
class OrbitWidgetController< OrbitFrontendComponentController
|
class OrbitWidgetController< OrbitFrontendComponentController
|
||||||
include FrontEndArrayParamsHelper
|
|
||||||
before_filter {get_tags_and_cates(params)}
|
|
||||||
|
|
||||||
def get_tags_and_cates(params)
|
|
||||||
params = tags_and_cates(params)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,24 +1,16 @@
|
||||||
class PagesController < ApplicationController
|
class PagesController < ApplicationController
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
before_filter :get_item, :only => [:index_from_link, :show_from_link]
|
before_filter :get_item, :only => [:index_from_link, :show_from_link]
|
||||||
before_filter :check_frontend_open, :only => [:index,:show]
|
|
||||||
# caches_page :index
|
# caches_page :index
|
||||||
|
|
||||||
def check_frontend_open
|
|
||||||
if Me.frontend_closed and current_user.nil? #Need to be change
|
|
||||||
redirect_to '/admin/dashboards'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@item = Page.find_by_name('home')
|
@item = Page.find_by_name('home')
|
||||||
|
|
||||||
if @item
|
if @item
|
||||||
delayed_impressionist(@item)
|
impressionist(@item)
|
||||||
render_page
|
render_page
|
||||||
else
|
else
|
||||||
redirect_to '/admin/dashboards',:notice=>t(:need_home)
|
render :text => t(:need_home)
|
||||||
# render :text => t(:need_home)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -26,14 +18,10 @@ class PagesController < ApplicationController
|
||||||
#begin
|
#begin
|
||||||
@item = Item.first(:conditions => {:path => params[:page_name]})
|
@item = Item.first(:conditions => {:path => params[:page_name]})
|
||||||
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
|
if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s))
|
||||||
delayed_impressionist(@item)
|
impressionist(@item)
|
||||||
case @item.class.to_s
|
case @item.class.to_s
|
||||||
when 'Page'
|
when 'Page'
|
||||||
if params[:clicked_field_name]
|
render_page unless save_from_no_lang_for_page
|
||||||
render_page({"clicked_field_name"=>params["clicked_field_name"]}) unless save_from_no_lang_for_page
|
|
||||||
else
|
|
||||||
render_page(params) unless save_from_no_lang_for_page
|
|
||||||
end
|
|
||||||
when 'Link'
|
when 'Link'
|
||||||
redirect_to(@item[:url]) unless save_from_no_lang_for_page
|
redirect_to(@item[:url]) unless save_from_no_lang_for_page
|
||||||
end
|
end
|
||||||
|
@ -49,8 +37,8 @@ class PagesController < ApplicationController
|
||||||
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?
|
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id', params[:tag_id])}" unless params[:tag_id].blank?
|
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||||
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)
|
||||||
|
@ -62,11 +50,10 @@ 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? ? '?' : '&'}#{convert_array_param('category_id', params[:category_id])}" unless params[:category_id].blank?
|
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id', params[:tag_id])}" unless params[:tag_id].blank?
|
options << "#{options.blank? ? '?' : '&'}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?
|
|
||||||
redirect_to(url + options) unless save_from_no_lang_for_page
|
redirect_to(url + options) unless save_from_no_lang_for_page
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -82,43 +69,23 @@ 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 = Array(params[:category_id]) unless params[:category_id].nil?
|
category_ids = params[:category_id].is_a?(Array) ? params[:category_id] : [params[:category_id]]
|
||||||
tag_ids = Array(params[:tag_id]) unless params[:tag_id].nil?
|
tag_ids = params[:tag_id].is_a?(Array) ? params[:tag_id] : [params[:tag_id]]
|
||||||
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.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 => tag_ids})
|
||||||
@item = Item.where(default_query.merge(specific_categories).merge(in_tags)).first unless @item
|
@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(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(default_query.merge(specific_categories).merge(nil_tags)).first
|
@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)).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(default_query.merge(specific_tags).merge(nil_categories)).first
|
@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)).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(default_query.merge(nil_categories).merge(nil_tags)).first unless @item
|
@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).first unless @item
|
@item = Item.where(module_app_id: module_app.id, app_frontend_url: 'default_widget').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
|
||||||
|
|
|
@ -4,7 +4,7 @@ protected
|
||||||
def get_categories_and_tags
|
def get_categories_and_tags
|
||||||
unless @selected[:module_app].nil?
|
unless @selected[:module_app].nil?
|
||||||
@categories = @selected[:module_app].get_categories
|
@categories = @selected[:module_app].get_categories
|
||||||
@tags = @selected[:module_app].tags
|
@tags = @selected[:module_app].get_tags
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,9 @@
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
include OrbitApp::Module::VisitorCounter
|
|
||||||
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
|
FLASH_NOTICE_KEYS = [:error, :notice, :warning]
|
||||||
|
|
||||||
|
|
||||||
def current_path(param_hash)
|
|
||||||
request.referer.include?('?') ? [request.referer,param_hash.to_param].join('&') : [request.referer,param_hash.to_param].join('?')
|
|
||||||
end
|
|
||||||
|
|
||||||
def delayed_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
|
|
||||||
|
|
||||||
def check_user_role_enable(attribute_fields)
|
def check_user_role_enable(attribute_fields)
|
||||||
@user.attribute_values.collect{|t| attribute_fields.include?(t.attribute_field) }.include?(true) rescue false
|
@user.attribute_values.collect{|t| attribute_fields.include?(t.attribute_field) }.include?(true) rescue false
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_attribute_value(value)
|
def show_attribute_value(value)
|
||||||
if value.kind_of? Hash
|
if value.kind_of? Hash
|
||||||
result = []
|
result = []
|
||||||
|
@ -243,27 +231,25 @@ 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
|
||||||
# impressions = Impression.where(options).and(:referrer.ne => nil)
|
end
|
||||||
# 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")
|
||||||
|
@ -306,16 +292,4 @@ module ApplicationHelper
|
||||||
"http://#{request.host}:2#{site_number}00"
|
"http://#{request.host}:2#{site_number}00"
|
||||||
end
|
end
|
||||||
|
|
||||||
def sortable(column, title = nil, options = {})
|
|
||||||
options[:remote] ||= true
|
|
||||||
title ||= column.titleize
|
|
||||||
css_class = column.to_s == params[:sort] ? "current #{params[:direction]}" : 'asc'
|
|
||||||
direction = column.to_s == params[:sort] && params[:direction] == 'asc' ? 'desc' : 'asc'
|
|
||||||
link_to title, params.merge({direction: direction, sort: column, sort_options: column}), {:class => "#{css_class} sortable", :remote => options[:remote]}
|
|
||||||
end
|
|
||||||
|
|
||||||
def convert_array_param(key, array)
|
|
||||||
Array(array).collect{|t| "#{key}[]=#{t}"}.join("&")
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,19 +3,10 @@ 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
|
||||||
options = options || {}
|
if(method_ary.has_key?(field) and (switch == true))
|
||||||
options[:clicked_field_name] = field
|
|
||||||
if(method_ary.has_key?(field) and (switch.to_s == "true"))
|
|
||||||
url = case method_ary[field][:args]
|
url = case method_ary[field][:args]
|
||||||
when nil # no args
|
when nil # no args
|
||||||
get_data_link(method_ary[field][:method], options)
|
get_data_link(method_ary[field][:method], options)
|
||||||
|
@ -84,13 +75,4 @@ 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,5 +0,0 @@
|
||||||
module MemberHelper
|
|
||||||
def nl2br(val)
|
|
||||||
val.gsub(/\r\n/, '<br />').html_safe
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -8,7 +8,7 @@ module OrbitFormHelper
|
||||||
options[:icon_date] ||= 'icons-calendar'
|
options[:icon_date] ||= 'icons-calendar'
|
||||||
options[:icon_clear] ||= 'icons-cross-3'
|
options[:icon_clear] ||= 'icons-cross-3'
|
||||||
options[:input_class] ||= 'input-large'
|
options[:input_class] ||= 'input-large'
|
||||||
options[:value] ||= options[:object].send(method) if options[:object] && options[:object][method]
|
options[:value] ||= options[:object][method] if options[:object] && options[:object][method]
|
||||||
case options[:picker_type]
|
case options[:picker_type]
|
||||||
when 'date'
|
when 'date'
|
||||||
content_tag :div, :id => options[:id], :class => options[:class] do
|
content_tag :div, :id => options[:id], :class => options[:class] do
|
||||||
|
@ -22,7 +22,7 @@ module OrbitFormHelper
|
||||||
options[:label] ||= I18n.t('datetime_picker.separated.label')
|
options[:label] ||= I18n.t('datetime_picker.separated.label')
|
||||||
content_tag :div, :id => options[:id], :class => "separated_picker #{options[:class]}" do
|
content_tag :div, :id => options[:id], :class => "separated_picker #{options[:class]}" do
|
||||||
concat label_tag options[:label] unless options[:no_label]
|
concat label_tag options[:label] unless options[:no_label]
|
||||||
concat hidden_field(object_name, method, :value => options[:value])
|
concat hidden_field(object_name, method)
|
||||||
concat separated_picker(object_name, method, options)
|
concat separated_picker(object_name, method, options)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,24 +2,12 @@ class BackupServer
|
||||||
@queue = :high
|
@queue = :high
|
||||||
|
|
||||||
def self.perform()
|
def self.perform()
|
||||||
|
#CronMail.time_check("Going to backup Orbit").deliver
|
||||||
dbhost = Mongoid.config.database.connection.primary.join ':'
|
dbhost = Mongoid.config.database.connection.primary.join ':'
|
||||||
dbname = Mongoid.config.database.name
|
dbname = Mongoid.config.database.name
|
||||||
archive_db_list_path = OrbitSystemPreference::ArchiveDbListPath
|
|
||||||
dbdirectory = "#{Rails.root}/tmp/#{dbname}-"+Time.now.strftime("%Y-%m-%d-%H-%M")
|
dbdirectory = "#{Rails.root}/tmp/#{dbname}-"+Time.now.strftime("%Y-%m-%d-%H-%M")
|
||||||
%x[mongodump -h #{dbhost} -d #{dbname} -o #{dbdirectory} ]
|
%x[mongodump -h #{dbhost} -d #{dbname} -o #{dbdirectory} ]
|
||||||
|
|
||||||
Dir.foreach('tmp') do |item|
|
# %x[touch #{Rails.root}/tmp/restart]
|
||||||
date_str = item.to_s.gsub("#{dbname}-",'')
|
|
||||||
next if not date_str.match(/\d{4}-\d{2}-\d{2}-\d{2}-\d{2}/)
|
|
||||||
if Date.parse(date_str).to_time < Site.first.backup_keep_for_days.days.ago
|
|
||||||
OrbitLogger.info "Deleting #{date_str}"
|
|
||||||
%x[rm -rf tmp/#{item}]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
%x[rm -f #{archive_db_list_path}]
|
|
||||||
%x[cd tmp ; ls -l |grep #{dbname} | awk '{print $8}'|xargs du -h --block-size=1M --max-depth=0 |sort -h >> #{archive_db_list_path}]
|
|
||||||
OrbitLogger.info "DB backup done Path:#{dbdirectory}"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
class DashboardCounter < Resque::Plugins::RestrictionJob
|
|
||||||
extend OrbitApp::Module::VisitorCounterEval
|
|
||||||
|
|
||||||
@queue = :high
|
|
||||||
|
|
||||||
def self.perform(*args)
|
|
||||||
site = Site.first
|
|
||||||
obj = new(*args)
|
|
||||||
site.visitor_counters[:total] = display_visitors
|
|
||||||
site.visitor_counters[:today] = display_visitors_today
|
|
||||||
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
|
|
||||||
OrbitLogger.info "DashboardCounter done #{site.visitor_counters.to_s}"
|
|
||||||
|
|
||||||
#Notice this is mainly used at user dashbroad. however the code there is currentlly using realtime evaluation.
|
|
||||||
#and the site model will need a field call dashboard_counter to complete this job.
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,51 +0,0 @@
|
||||||
class DelayedImpressionist
|
|
||||||
def self.before_filter(*args)
|
|
||||||
return
|
|
||||||
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"])
|
|
||||||
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)
|
|
||||||
@try = 1
|
|
||||||
loop do
|
|
||||||
result = new_impression.save rescue false
|
|
||||||
break if (result || @try >= 10)
|
|
||||||
@try = @try + 1
|
|
||||||
puts "trying:#{@try}"
|
|
||||||
end
|
|
||||||
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
|
|
|
@ -1,42 +0,0 @@
|
||||||
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
|
|
|
@ -1,46 +0,0 @@
|
||||||
class GenerateSystemSummary
|
|
||||||
@queue = :high
|
|
||||||
|
|
||||||
def self.perform()
|
|
||||||
@site = Site.first
|
|
||||||
get_disk_free
|
|
||||||
get_git_log_list
|
|
||||||
get_package_info
|
|
||||||
@site.save
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_package_info
|
|
||||||
@info = {}
|
|
||||||
get_nginx_version
|
|
||||||
get_MongoDB_version
|
|
||||||
get_Linux_version
|
|
||||||
@site.system_package_info = @info
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_git_log_list
|
|
||||||
git_commit_list_path = OrbitSystemPreference::GitCommitListPath
|
|
||||||
%x[rm #{git_commit_list_path}]
|
|
||||||
%x[cd #{Rails.root};#{OrbitSystemPreference::GitLogCommend} >>#{git_commit_list_path} ]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_disk_free
|
|
||||||
@site.disk_space= %x[#{OrbitSystemPreference::DiskFree}]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_nginx_version
|
|
||||||
@info[:nginx] = %x[#{OrbitSystemPreference::SystemPackage::NginxVersion} ]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_MongoDB_version
|
|
||||||
@info[:mongodb] = %x[#{OrbitSystemPreference::SystemPackage::MongodbVersion} ]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_Linux_version
|
|
||||||
@info[:linux] = %x[#{OrbitSystemPreference::SystemPackage::SystemVersion} ]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.check_system_has_enough_space( limit =OrbitSystemPreference::DefaultDiskSpaceLimit )
|
|
||||||
binding.pry
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
class NccuCalendar
|
||||||
|
require 'open-uri'
|
||||||
|
require 'tempfile'
|
||||||
|
|
||||||
|
@queue = :high
|
||||||
|
|
||||||
|
def self.perform()
|
||||||
|
# temp_file = Tempfile.new('new_cal')
|
||||||
|
# open('http://events.nccu.edu.tw/Month').read{|data|
|
||||||
|
# temp_file << data
|
||||||
|
# }
|
||||||
|
|
||||||
|
open(File.join(Rails.root, 'public/static', 'nccu_calendar.xml'), 'wb') do |fo|
|
||||||
|
fo.print open('http://events.nccu.edu.tw/Month').read
|
||||||
|
end
|
||||||
|
|
||||||
|
# FileUtils.mv(temp_file, File.join(Rails.root, 'public/static', 'nccu_calendar.xml'))
|
||||||
|
|
||||||
|
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]NccuCalendar Synced #{File.join(Rails.root, 'public/static', 'nccu_calendar.xml')}"
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,8 +0,0 @@
|
||||||
class RestartServer
|
|
||||||
@queue = :high
|
|
||||||
|
|
||||||
def self.perform()
|
|
||||||
temp_directory = "#{Rails.root}/tmp/"
|
|
||||||
%x[touch #{temp_directory}restart.txt ]
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,10 +0,0 @@
|
||||||
class SendAskNoticeMail
|
|
||||||
@queue = :mail
|
|
||||||
|
|
||||||
def self.perform(ask_admin_id, ask_question_id)
|
|
||||||
ask_admin = AskAdmin.find(ask_admin_id)
|
|
||||||
ask_question = AskQuestion.find(ask_question_id)
|
|
||||||
AskMailer.notice(ask_admin, ask_question).deliver
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,9 +0,0 @@
|
||||||
class SendAskReplyMail
|
|
||||||
@queue = :mail
|
|
||||||
|
|
||||||
def self.perform(ask_question_id)
|
|
||||||
ask_question = AskQuestion.find(ask_question_id)
|
|
||||||
AskMailer.reply(ask_question).deliver
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
class SyncDb
|
||||||
|
|
||||||
|
@queue = :high
|
||||||
|
|
||||||
|
def self.perform()
|
||||||
|
puts "[ #{DateTime.now.strftime("%Y %D %H:%M") }]\t SyncDb Starting"
|
||||||
|
self.start_sync
|
||||||
|
self.set_admin
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.start_sync
|
||||||
|
task = 'mid_site:sync'
|
||||||
|
args = []
|
||||||
|
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
|
||||||
|
User.all.each{|ur| ur.create_dept_cache}
|
||||||
|
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]\tSyncDb Synced"
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.set_admin
|
||||||
|
task = 'mid_site:install_admin'
|
||||||
|
args = []
|
||||||
|
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
|
||||||
|
puts "[#{ DateTime.now.strftime("%Y %D %H:%M")}]\tAdmin done"
|
||||||
|
end
|
||||||
|
end
|
|
@ -3,8 +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.get_impressionist)
|
tag.update_attribute(:cloud_view_count, tag.impressionist_count(:created_at.gte => 14.days.ago, :created_at.lte => Time.now))
|
||||||
end
|
end
|
||||||
OrbitLogger.info "UpdateTagCloud Done"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,8 +0,0 @@
|
||||||
class UserActionRecoder
|
|
||||||
@queue = :low
|
|
||||||
def self.perform(user,params)
|
|
||||||
UserAction.create!(:user=>user,:params=>params,:page=>"#{params['controller']}##{params['action']}")
|
|
||||||
true
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,81 +0,0 @@
|
||||||
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
|
|
|
@ -2,8 +2,6 @@ class Asset
|
||||||
|
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
include OrbitTag::Taggable
|
|
||||||
taggable
|
|
||||||
|
|
||||||
mount_uploader :data, FileAssetUploader
|
mount_uploader :data, FileAssetUploader
|
||||||
|
|
||||||
|
@ -18,14 +16,18 @@ class Asset
|
||||||
|
|
||||||
belongs_to :asset_category
|
belongs_to :asset_category
|
||||||
belongs_to :assetable, polymorphic: true
|
belongs_to :assetable, polymorphic: true
|
||||||
# has_and_belongs_to_many :tags, :class_name => "AssetTag"
|
has_and_belongs_to_many :tags, :class_name => "AssetTag"
|
||||||
|
|
||||||
before_save :clean_tags
|
before_save :clean_tags
|
||||||
|
|
||||||
|
def sorted_tags
|
||||||
|
tags.order_by(I18n.locale, :asc)
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def clean_tags
|
def clean_tags
|
||||||
self.tagged_ids.delete('')
|
self.tag_ids.delete('')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Item
|
||||||
|
|
||||||
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
|
validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/
|
||||||
# validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
|
# validates :name, :exclusion => { :in => LIST[:forbidden_item_names] }
|
||||||
validates_uniqueness_of :name #, :scope => :parent_id
|
validates_uniqueness_of :name, :scope => :parent_id
|
||||||
validates_presence_of :name
|
validates_presence_of :name
|
||||||
validates_associated :parent, :children
|
validates_associated :parent, :children
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class Item
|
||||||
after_save :rebuild_children_path, :if => "path_changed?"
|
after_save :rebuild_children_path, :if => "path_changed?"
|
||||||
|
|
||||||
def enabled_for_lang(lang)
|
def enabled_for_lang(lang)
|
||||||
enabled_for.include?(lang) rescue false
|
enabled_for.include?(lang)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.find_by_name(item_name)
|
def self.find_by_name(item_name)
|
||||||
|
@ -65,10 +65,6 @@ class Item
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.structure_ordered_items
|
|
||||||
self.get_children(Item.root, [])
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def rebuild_path
|
def rebuild_path
|
||||||
|
@ -92,12 +88,4 @@ class Item
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.get_children(item, tree)
|
|
||||||
tree << item
|
|
||||||
item.children.each do |child|
|
|
||||||
self.get_children(child, tree)
|
|
||||||
end
|
|
||||||
tree
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
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
|
|
|
@ -1,13 +0,0 @@
|
||||||
class MailCronFile
|
|
||||||
|
|
||||||
include Mongoid::Document
|
|
||||||
include Mongoid::Timestamps
|
|
||||||
|
|
||||||
mount_uploader :file, AssetUploader
|
|
||||||
|
|
||||||
field :should_destroy, :type => Boolean
|
|
||||||
field :title
|
|
||||||
|
|
||||||
belongs_to :mail_cron
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,14 +0,0 @@
|
||||||
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
|
|
|
@ -8,8 +8,6 @@ class ModuleApp
|
||||||
field :title
|
field :title
|
||||||
field :sidebar_order,type: Integer,default: 0
|
field :sidebar_order,type: Integer,default: 0
|
||||||
|
|
||||||
has_many :tags, as: :module_tag, dependent: :destroy
|
|
||||||
|
|
||||||
def refetch_setting!(reg)
|
def refetch_setting!(reg)
|
||||||
# %w{module_label category base_url version organization author intro update_info create_date}.each do |field|
|
# %w{module_label category base_url version organization author intro update_info create_date}.each do |field|
|
||||||
# self[field.to_sym] = reg.send field
|
# self[field.to_sym] = reg.send field
|
||||||
|
@ -19,7 +17,6 @@ class ModuleApp
|
||||||
self[:get_widget_style] = reg.get_widgets
|
self[:get_widget_style] = reg.get_widgets
|
||||||
self[:using_default_widget] = !reg.get_default_widget.blank?
|
self[:using_default_widget] = !reg.get_default_widget.blank?
|
||||||
self[:widgets] = reg.get_widgets
|
self[:widgets] = reg.get_widgets
|
||||||
self[:has_tag] = reg.get_has_tags
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,6 +118,10 @@ class ModuleApp
|
||||||
|
|
||||||
has_one :app_auth,dependent: :delete
|
has_one :app_auth,dependent: :delete
|
||||||
|
|
||||||
|
def get_tags
|
||||||
|
get_registration.get_tags
|
||||||
|
end
|
||||||
|
|
||||||
def get_categories
|
def get_categories
|
||||||
get_registration.get_categories
|
get_registration.get_categories
|
||||||
end
|
end
|
||||||
|
@ -133,30 +134,4 @@ class ModuleApp
|
||||||
OrbitApp::Module::Registration.find_by_key(key)
|
OrbitApp::Module::Registration.find_by_key(key)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.find_by_key(key)
|
|
||||||
self.where(key: key)[0] rescue nil
|
|
||||||
end
|
|
||||||
|
|
||||||
def sorted_tags_for_cloud
|
|
||||||
temp_tags = {}
|
|
||||||
self.tags.each{ |tag|
|
|
||||||
temp_tags.merge!({tag => tag.cloud_view_count})
|
|
||||||
}
|
|
||||||
if !temp_tags.blank?
|
|
||||||
sorted_tags = temp_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
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
module Mongoid
|
|
||||||
module Sortable
|
|
||||||
extend ActiveSupport::Concern
|
|
||||||
|
|
||||||
included do
|
|
||||||
field :sort_number, type: Integer
|
|
||||||
|
|
||||||
after_initialize :set_sort_number
|
|
||||||
end
|
|
||||||
|
|
||||||
module ClassMethods
|
|
||||||
def default_sort(sorted = true)
|
|
||||||
if !sorted
|
|
||||||
asc(:sort_number)
|
|
||||||
else
|
|
||||||
asc
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def set_sort_number
|
|
||||||
if self.new? && self.sort_number.nil?
|
|
||||||
last_record = self.class.desc(:sort_number).first
|
|
||||||
if last_record && last_record.sort_number
|
|
||||||
self.sort_number = (last_record.sort_number + 10) / 10 * 10
|
|
||||||
else
|
|
||||||
self.sort_number = 10
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -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,9 +51,8 @@ class PrototypeAuth
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_operation(item,obj)
|
def remove_operation(item,obj)
|
||||||
item = (item.to_s.singularize == item.to_s) ? "#{item.to_s}_id" : "#{item.to_s.singularize}_ids"
|
if (self.send item).include? obj
|
||||||
if (self.send item).include? obj.id
|
(self.send item).delete obj
|
||||||
(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
|
||||||
|
|
|
@ -11,17 +11,9 @@ class Site
|
||||||
field :roaming_id
|
field :roaming_id
|
||||||
field :private_key, :type => Binary
|
field :private_key, :type => Binary
|
||||||
field :public_key, :type => Binary
|
field :public_key, :type => Binary
|
||||||
|
|
||||||
field :frontend_closed, :type => Boolean, :default => false
|
|
||||||
field :backend_openness_on, :type => Boolean, :default => false
|
|
||||||
|
|
||||||
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 :system_package_info, :type => Hash,:default=>{}
|
|
||||||
|
|
||||||
field :school
|
field :school
|
||||||
field :department
|
field :department
|
||||||
|
@ -29,11 +21,10 @@ class Site
|
||||||
mount_uploader :default_image, ImageUploader
|
mount_uploader :default_image, ImageUploader
|
||||||
|
|
||||||
field :search,:type => Hash
|
field :search,:type => Hash
|
||||||
field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit']
|
|
||||||
field :title, localize: true
|
field :title, localize: true
|
||||||
field :footer, localize: true
|
field :footer, localize: true
|
||||||
field :sub_menu, localize: true
|
field :sub_menu, localize: true
|
||||||
field :backup_keep_for_days,:type=>Integer,:default=> APP_CONFIG['backup_keep_for_days']
|
|
||||||
|
|
||||||
field :mobile_on, :type => Boolean, :default => false
|
field :mobile_on, :type => Boolean, :default => false
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
class SubRoleTag < ProtoTag
|
class SubRoleTag < ProtoTag
|
||||||
has_and_belongs_to_many :sub_roles
|
has_and_belongs_to_many :sub_roles
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,14 +8,35 @@ 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 :key
|
||||||
field :view_count, :type => Integer, :default => 0
|
field :view_count, :type => Integer, :default => 0
|
||||||
field :cloud_view_count, :type => Integer, :default => 0
|
field :cloud_view_count, :type => Integer, :default => 0
|
||||||
|
|
||||||
belongs_to :module_tag, polymorphic: true
|
#field :cloud_amper,:type: Integer,:default=> 0
|
||||||
has_many :taggings, dependent: :destroy
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
class Tagging
|
|
||||||
include Mongoid::Document
|
|
||||||
include Mongoid::Timestamps
|
|
||||||
|
|
||||||
field :to_destroy, default: false
|
|
||||||
|
|
||||||
belongs_to :tag
|
|
||||||
belongs_to :taggable, polymorphic: true
|
|
||||||
|
|
||||||
before_destroy :update_taggable_tag_ids
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def update_taggable_tag_ids
|
|
||||||
self.taggable.remove_id(self.tag.id)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -11,14 +11,9 @@ class Role < Attribute
|
||||||
|
|
||||||
has_many :sub_roles, :autosave => true, :dependent => :destroy
|
has_many :sub_roles, :autosave => true, :dependent => :destroy
|
||||||
has_many :users
|
has_many :users
|
||||||
# has_many :statuses, :autosave => true, :dependent => :destroy
|
has_many :statuses, :autosave => true, :dependent => :destroy
|
||||||
# has_many :attribute_fields, :autosave => true, :dependent => :destroy
|
# has_many :attribute_fields, :autosave => true, :dependent => :destroy
|
||||||
has_many :role_statuses, :autosave => true, :dependent => :destroy
|
|
||||||
has_many :role_categorys, :autosave => true, :dependent => :destroy
|
|
||||||
|
|
||||||
accepts_nested_attributes_for :sub_roles, :allow_destroy => true
|
accepts_nested_attributes_for :sub_roles, :allow_destroy => true
|
||||||
accepts_nested_attributes_for :role_statuses, :allow_destroy => true
|
|
||||||
accepts_nested_attributes_for :role_categorys, :allow_destroy => true
|
|
||||||
|
|
||||||
def is_built_in?
|
def is_built_in?
|
||||||
self.built_in
|
self.built_in
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
class RoleCategory < RoleFilter
|
|
||||||
|
|
||||||
has_and_belongs_to_many :users
|
|
||||||
belongs_to :role
|
|
||||||
|
|
||||||
def self.get_role_data(role_key)
|
|
||||||
|
|
||||||
@role = Role.where(:key =>role_key).first
|
|
||||||
|
|
||||||
return @role.id
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,26 +0,0 @@
|
||||||
class RoleFilter
|
|
||||||
|
|
||||||
include Mongoid::Document
|
|
||||||
include Mongoid::Timestamps
|
|
||||||
# include OrbitCoreLib::ObjectAuthable
|
|
||||||
include OrbitCoreLib::ObjectDisable
|
|
||||||
|
|
||||||
|
|
||||||
field :key
|
|
||||||
field :title, localize: true
|
|
||||||
|
|
||||||
# belongs_to :role
|
|
||||||
|
|
||||||
def pp_object
|
|
||||||
title
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.from_id(id)
|
|
||||||
RoleFilter.find(id) rescue nil
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.is_localized?(field_name)
|
|
||||||
self.fields[field_name.to_s].localized?
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -1,16 +0,0 @@
|
||||||
class RoleStatus < RoleFilter
|
|
||||||
|
|
||||||
has_and_belongs_to_many :users
|
|
||||||
belongs_to :role
|
|
||||||
|
|
||||||
scope :can_display,where(disable: false)
|
|
||||||
|
|
||||||
def self.get_role_data(role_key)
|
|
||||||
|
|
||||||
@role = Role.where(:key =>role_key).first
|
|
||||||
|
|
||||||
return @role.id
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
|
@ -3,19 +3,13 @@ class User
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
|
|
||||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable #, :timeoutable
|
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :validatable #, :timeoutable
|
||||||
|
|
||||||
mount_uploader :avatar, AvatarUploader
|
mount_uploader :avatar, AvatarUploader
|
||||||
|
|
||||||
field :admin, :type => Boolean, :default => true
|
field :admin, :type => Boolean, :default => true
|
||||||
field :active_role
|
field :active_role
|
||||||
field :user_id
|
|
||||||
field :sid
|
|
||||||
field :first_name, localize: true
|
|
||||||
field :last_name, localize: true
|
|
||||||
field :email
|
field :email
|
||||||
field :sex, :default => 'unknown'
|
|
||||||
field :office_tel
|
|
||||||
field :cache_dept,type: Hash
|
field :cache_dept,type: Hash
|
||||||
field :status_record,type: Hash
|
field :status_record,type: Hash
|
||||||
|
|
||||||
|
@ -31,23 +25,17 @@ class User
|
||||||
# has_many :papers, :autosave => true, :dependent => :destroy
|
# has_many :papers, :autosave => true, :dependent => :destroy
|
||||||
has_and_belongs_to_many :sub_role_tags
|
has_and_belongs_to_many :sub_role_tags
|
||||||
|
|
||||||
has_many :user_actions, :dependent => :destroy
|
has_and_belongs_to_many :statuses
|
||||||
|
|
||||||
# has_and_belongs_to_many :statuses
|
|
||||||
has_and_belongs_to_many :roles
|
has_and_belongs_to_many :roles
|
||||||
has_and_belongs_to_many :sub_roles
|
has_and_belongs_to_many :sub_roles
|
||||||
has_and_belongs_to_many :role_statuses
|
|
||||||
has_and_belongs_to_many :role_categorys
|
|
||||||
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
|
accepts_nested_attributes_for :attribute_values, :allow_destroy => true
|
||||||
|
|
||||||
before_create :initialize_desktop
|
before_create :initialize_desktop
|
||||||
before_save :rebuild_status_record
|
before_save :rebuild_status_record
|
||||||
|
before_save :save_roles
|
||||||
scope :remote_account, where(:nccu_id.ne => nil)
|
scope :remote_account, where(:nccu_id.ne => nil)
|
||||||
scope :not_guest_user, all_of(:name.ne => "guest")
|
scope :not_guest_user, all_of(:name.ne => "guest")
|
||||||
|
|
||||||
validates :user_id,
|
|
||||||
:presence => { :message => I18n.t("users.user_id_not_null") } ,
|
|
||||||
:length => {:minimum => 3, :maximum => 50, :message => I18n.t("users.user_id_length") }
|
|
||||||
# validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique")
|
# validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique")
|
||||||
|
|
||||||
# def new_attribute_values=(vars)
|
# def new_attribute_values=(vars)
|
||||||
|
@ -88,9 +76,9 @@ class User
|
||||||
var[:id].each do |id,val|
|
var[:id].each do |id,val|
|
||||||
# binding.pry if id == '5052c5b22b5c49ab02000004'
|
# binding.pry if id == '5052c5b22b5c49ab02000004'
|
||||||
if (val=="true")
|
if (val=="true")
|
||||||
self.role_ids.reject!{|t| t.to_s == id}
|
self.roles = self.roles.reject{|t| t.id.to_s==id}
|
||||||
elsif(val=="false")
|
elsif(val=="false")
|
||||||
self.role_ids += Array(id)
|
self.roles << Role.find(id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -105,32 +93,14 @@ class User
|
||||||
# binding.pry if id == '5052c5b22b5c49ab02000004'
|
# binding.pry if id == '5052c5b22b5c49ab02000004'
|
||||||
|
|
||||||
if ( self.roles.include?(@roid) == false or val=="true")
|
if ( self.roles.include?(@roid) == false or val=="true")
|
||||||
self.sub_role_ids.reject!{|t| t.to_s == id}
|
self.sub_roles = self.sub_roles.reject{|t| t.id.to_s==id}
|
||||||
elsif(val=="false")
|
elsif(val=="false")
|
||||||
self.sub_role_ids += Array(id)
|
self.sub_roles << SubRole.find(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def role_status=(var)
|
|
||||||
self.role_statuses = []
|
|
||||||
var[:id].each do |id,val|
|
|
||||||
if (val=="true")
|
|
||||||
self.role_statuses << RoleStatus.find(id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def role_category=(var)
|
|
||||||
self.role_categorys = []
|
|
||||||
var[:id].each do |id,val|
|
|
||||||
if (val=="true")
|
|
||||||
self.role_categorys << RoleCategory.find(id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def set_sub_role(sub_role_id,status_id)
|
def set_sub_role(sub_role_id,status_id)
|
||||||
|
@ -174,24 +144,6 @@ class User
|
||||||
}.uniq!
|
}.uniq!
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.get_member_list_attribute_field_name(role_type,field_key)
|
|
||||||
@attribute = ::Attribute.where(:key => role_type).first
|
|
||||||
return ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first.title
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_member_list_attribute_value(user_id,role_type,field_key)
|
|
||||||
@attribute = ::Attribute.where(:key => role_type).first
|
|
||||||
@AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first
|
|
||||||
return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.get_role_member_data_by_sort(role_status_id)
|
|
||||||
a = Array.new
|
|
||||||
where(:role_status_ids=>role_status_id).desc(:_id).collect{|t| a << [ get_member_list_attribute_value(t.id,"staff","job_title")['val'].to_i, t ] }
|
|
||||||
member_data = a.sort
|
|
||||||
member_data_tmp = member_data.collect {|v| v[1] }
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_dept_cache
|
def create_dept_cache
|
||||||
dept_hash = {}
|
dept_hash = {}
|
||||||
|
|
||||||
|
@ -218,30 +170,12 @@ class User
|
||||||
(query1 + query2).uniq
|
(query1 + query2).uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
# def name
|
|
||||||
# info = Class::Info.first(:conditions => {:key => 'profile'})
|
|
||||||
# if info
|
|
||||||
# first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
|
||||||
# last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
|
||||||
# full_name = "#{last_name} #{first_name}"
|
|
||||||
|
|
||||||
# if full_name.strip.empty?
|
|
||||||
# full_name = email
|
|
||||||
# end
|
|
||||||
|
|
||||||
# return full_name
|
|
||||||
# else
|
|
||||||
# return nil
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
def name
|
def name
|
||||||
info = Class::Info.first(:conditions => {:key => 'profile'})
|
info = Class::Info.first(:conditions => {:key => 'profile'})
|
||||||
if info
|
if info
|
||||||
# first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
first_name = get_attribute_values.detect {|value| value.key.to_s.eql?('first_name') }[I18n.locale.to_s] rescue nil
|
||||||
# last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
last_name = get_attribute_values.detect {|value| value.key.to_s.eql?('last_name') }[I18n.locale.to_s] rescue nil
|
||||||
# full_name = (I18n.locale != 'zh_tw') ? "#{self.last_name} #{self.first_name}" : "#{self.first_name} #{self.last_name}"
|
full_name = "#{last_name} #{first_name}"
|
||||||
full_name = (I18n.locale.to_s == 'zh_tw') ? "#{self.last_name} #{self.first_name}" : "#{self.first_name} #{self.last_name}"
|
|
||||||
|
|
||||||
if full_name.strip.empty?
|
if full_name.strip.empty?
|
||||||
full_name = email
|
full_name = email
|
||||||
|
@ -272,6 +206,11 @@ class User
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
def save_roles
|
||||||
|
# self.roles = self.sub_roles.collect{|t| t.role}.uniq
|
||||||
|
self.roles = self.roles.uniq
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def rebuild_status_record
|
def rebuild_status_record
|
||||||
self.status_record = {}
|
self.status_record = {}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
class UserAction
|
|
||||||
include Mongoid::Document
|
|
||||||
include Mongoid::Timestamps
|
|
||||||
|
|
||||||
belongs_to :user
|
|
||||||
field :params,:type => Hash
|
|
||||||
|
|
||||||
field :page
|
|
||||||
|
|
||||||
end
|
|
|
@ -17,7 +17,7 @@
|
||||||
<div class="label-group">
|
<div class="label-group">
|
||||||
<div class="label-td">
|
<div class="label-td">
|
||||||
<% asset.sorted_tags.each do |tag| %>
|
<% asset.sorted_tags.each do |tag| %>
|
||||||
<span class="label label-tags"><%= tag.name %></span>
|
<span class="label label-tags"><%= tag[I18n.locale] %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<% @tags.each do |tag| %>
|
<% @tags.each do |tag| %>
|
||||||
<%= content_tag :label, :class => "checkbox inline" do -%>
|
<%= content_tag :label, :class => "checkbox inline" do -%>
|
||||||
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %>
|
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %>
|
||||||
<%= tag.name %>
|
<%= tag[I18n.locale] %>
|
||||||
<%= hidden_field_tag 'asset[tag_ids][]', '' %>
|
<%= hidden_field_tag 'asset[tag_ids][]', '' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<% content_for :side_bar do %>
|
<% content_for :side_bar do %>
|
||||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<% content_for :side_bar do %>
|
<% content_for :side_bar do %>
|
||||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,8 +37,6 @@
|
||||||
<% if @attribute_type == 'role' %>
|
<% if @attribute_type == 'role' %>
|
||||||
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li>
|
<li><%= link_to t(:role_field), eval("admin_#{@attribute_type}_role_field_path(attribute)") %></li>
|
||||||
<li><%= link_to t(:sub_role), eval("admin_#{@attribute_type}_sub_role_path(attribute)") %></li>
|
<li><%= link_to t(:sub_role), eval("admin_#{@attribute_type}_sub_role_path(attribute)") %></li>
|
||||||
<li><%= link_to t(:status), eval("admin_role_statuses_path(:role_id=>attribute)") %></li>
|
|
||||||
<li><%= link_to t(:category), eval("admin_role_categorys_path(:role_id=>attribute)") %></li>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %></li>
|
<li><%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %></li>
|
||||||
<li><%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %></li>
|
<li><%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %></li>
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="item element">
|
<!-- <div class="item element">
|
||||||
<h3><i class="icons-"></i><a href=""><%= t(:member_) %></a></h3>
|
<h3><i class="icons-"></i><a href=""><%= t(:member) %></a></h3>
|
||||||
<div class="detail w-a h-a">
|
<div class="detail w-a h-a">
|
||||||
<p class="totle"><span><%= t(:all_member) %></span>2,217</p>
|
<p class="totle"><span><%= t(:all_member) %></span>2,217</p>
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
|
|
|
@ -8,5 +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(:upload), upload_package_admin_designs_path, :class => 'btn btn-primary pull-right' %>
|
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:add), new_admin_design_path, :class => 'btn btn-primary pull-right' %>
|
||||||
</div>
|
</div>
|
|
@ -1,8 +1,7 @@
|
||||||
<% content_for :side_bar do %>
|
<% content_for :side_bar do %>
|
||||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :side_bar_content => 'admin/sites/side_bar'} %>
|
<%= render 'admin/sites/side_bar' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<div class="main2">
|
<div class="main2">
|
||||||
<%= form_tag '',:multipart => true,:action=>"post" do |f| %>
|
<%= form_tag '',:multipart => true,:action=>"post" do |f| %>
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,5 @@
|
||||||
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
|
<%= render_node_and_children(Item.first(:conditions => {:parent_id => nil})) %>
|
||||||
</ol>
|
</ol>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$.ajaxSetup({
|
|
||||||
error: function(xhr, status, err) {
|
|
||||||
if (xhr.status == 401){
|
|
||||||
alert("<%= I18n.t('access.denied.ajax_401_error') %>");
|
|
||||||
window.location.href = '/';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
bindTreeDragHandle();
|
bindTreeDragHandle();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
<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>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<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 %>
|
|
|
@ -1,29 +0,0 @@
|
||||||
<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>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= 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 %>
|
|
|
@ -1 +0,0 @@
|
||||||
$("#<%= dom_id @mail_cron_log %>").remove();
|
|
|
@ -1,28 +0,0 @@
|
||||||
<% 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>
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue