Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course
Conflicts: app/views/student_work/_evaluation_un_title.html.erb app/views/student_work/_evaluation_un_work.html.erb
This commit is contained in:
commit
3b55e9e39b
1
1234567
1
1234567
|
@ -1 +0,0 @@
|
||||||
{"access_token":"bFlabz0uBcoIBfWL7nBJkgpl26aOWDy-dyCOvH_MjUo_hMOOKG83WV1cCL1MG6H-AE-6eMI0iyLoOoAMv9Y3pFFsLYD-GAGr3UH9fT8OqeHMDlFhXyRTvHv9l2QPHGpcARUcCGANEH","expires_in":7200,"got_token_at":1462934760}
|
|
|
@ -0,0 +1,386 @@
|
||||||
|
GIT
|
||||||
|
remote: http://github.com/guange2015/wechat.git
|
||||||
|
revision: a18c3d6603cb1aa7bd1fe887b17f67426be01f35
|
||||||
|
specs:
|
||||||
|
wechat (0.7.1)
|
||||||
|
activerecord (>= 3.2, < 5.1.x)
|
||||||
|
http (~> 1.0, >= 1.0.1)
|
||||||
|
nokogiri (>= 1.6.0)
|
||||||
|
thor
|
||||||
|
|
||||||
|
PATH
|
||||||
|
remote: lib/gitlab-cli
|
||||||
|
specs:
|
||||||
|
gitlab (3.2.0)
|
||||||
|
httparty
|
||||||
|
terminal-table
|
||||||
|
|
||||||
|
PATH
|
||||||
|
remote: lib/grack
|
||||||
|
specs:
|
||||||
|
grack (2.0.2)
|
||||||
|
rack (~> 1.4.5)
|
||||||
|
|
||||||
|
PATH
|
||||||
|
remote: lib/rails_kindeditor
|
||||||
|
specs:
|
||||||
|
rails_kindeditor (0.4.5)
|
||||||
|
carrierwave
|
||||||
|
mini_magick
|
||||||
|
|
||||||
|
GEM
|
||||||
|
remote: https://ruby.taobao.org/
|
||||||
|
specs:
|
||||||
|
actionmailer (3.2.22.2)
|
||||||
|
actionpack (= 3.2.22.2)
|
||||||
|
mail (~> 2.5.4)
|
||||||
|
actionpack (3.2.22.2)
|
||||||
|
activemodel (= 3.2.22.2)
|
||||||
|
activesupport (= 3.2.22.2)
|
||||||
|
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.22.2)
|
||||||
|
activesupport (= 3.2.22.2)
|
||||||
|
builder (~> 3.0.0)
|
||||||
|
activerecord (3.2.22.2)
|
||||||
|
activemodel (= 3.2.22.2)
|
||||||
|
activesupport (= 3.2.22.2)
|
||||||
|
arel (~> 3.0.2)
|
||||||
|
tzinfo (~> 0.3.29)
|
||||||
|
activeresource (3.2.22.2)
|
||||||
|
activemodel (= 3.2.22.2)
|
||||||
|
activesupport (= 3.2.22.2)
|
||||||
|
activesupport (3.2.22.2)
|
||||||
|
i18n (~> 0.6, >= 0.6.4)
|
||||||
|
multi_json (~> 1.0)
|
||||||
|
acts-as-taggable-on (2.4.1)
|
||||||
|
rails (>= 3, < 5)
|
||||||
|
addressable (2.4.0)
|
||||||
|
ansi (1.5.0)
|
||||||
|
arel (3.0.3)
|
||||||
|
axiom-types (0.1.1)
|
||||||
|
descendants_tracker (~> 0.0.4)
|
||||||
|
ice_nine (~> 0.11.0)
|
||||||
|
thread_safe (~> 0.3, >= 0.3.1)
|
||||||
|
better_errors (1.1.0)
|
||||||
|
coderay (>= 1.0.0)
|
||||||
|
erubis (>= 2.6.6)
|
||||||
|
binding_of_caller (0.7.2)
|
||||||
|
debug_inspector (>= 0.0.1)
|
||||||
|
builder (3.0.0)
|
||||||
|
byebug (8.2.2)
|
||||||
|
carrierwave (0.10.0)
|
||||||
|
activemodel (>= 3.2.0)
|
||||||
|
activesupport (>= 3.2.0)
|
||||||
|
json (>= 1.7)
|
||||||
|
mime-types (>= 1.16)
|
||||||
|
chinese_pinyin (1.0.0)
|
||||||
|
climate_control (0.0.3)
|
||||||
|
activesupport (>= 3.0)
|
||||||
|
cocaine (0.5.8)
|
||||||
|
climate_control (>= 0.0.3, < 1.0)
|
||||||
|
coderay (1.1.1)
|
||||||
|
coercible (1.0.0)
|
||||||
|
descendants_tracker (~> 0.0.1)
|
||||||
|
coffee-rails (3.2.2)
|
||||||
|
coffee-script (>= 2.2.0)
|
||||||
|
railties (~> 3.2.0)
|
||||||
|
coffee-script (2.4.1)
|
||||||
|
coffee-script-source
|
||||||
|
execjs
|
||||||
|
coffee-script-source (1.10.0)
|
||||||
|
daemons (1.2.3)
|
||||||
|
debug_inspector (0.0.2)
|
||||||
|
delayed_job (4.1.1)
|
||||||
|
activesupport (>= 3.0, < 5.0)
|
||||||
|
delayed_job_active_record (4.1.0)
|
||||||
|
activerecord (>= 3.0, < 5)
|
||||||
|
delayed_job (>= 3.0, < 5)
|
||||||
|
descendants_tracker (0.0.4)
|
||||||
|
thread_safe (~> 0.3, >= 0.3.1)
|
||||||
|
diff-lcs (1.2.5)
|
||||||
|
domain_name (0.5.20160216)
|
||||||
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
|
elasticsearch (1.0.15)
|
||||||
|
elasticsearch-api (= 1.0.15)
|
||||||
|
elasticsearch-transport (= 1.0.15)
|
||||||
|
elasticsearch-api (1.0.15)
|
||||||
|
multi_json
|
||||||
|
elasticsearch-model (0.1.8)
|
||||||
|
activesupport (> 3)
|
||||||
|
elasticsearch (> 0.4)
|
||||||
|
hashie
|
||||||
|
elasticsearch-rails (0.1.8)
|
||||||
|
elasticsearch-transport (1.0.15)
|
||||||
|
faraday
|
||||||
|
multi_json
|
||||||
|
equalizer (0.0.11)
|
||||||
|
erubis (2.7.0)
|
||||||
|
execjs (2.6.0)
|
||||||
|
factory_girl (4.5.0)
|
||||||
|
activesupport (>= 3.0.0)
|
||||||
|
factory_girl_rails (4.6.0)
|
||||||
|
factory_girl (~> 4.5.0)
|
||||||
|
railties (>= 3.0.0)
|
||||||
|
faraday (0.9.2)
|
||||||
|
multipart-post (>= 1.2, < 3)
|
||||||
|
fastercsv (1.5.5)
|
||||||
|
grape (0.9.0)
|
||||||
|
activesupport
|
||||||
|
builder
|
||||||
|
hashie (>= 2.1.0)
|
||||||
|
multi_json (>= 1.3.2)
|
||||||
|
multi_xml (>= 0.5.2)
|
||||||
|
rack (>= 1.3.0)
|
||||||
|
rack-accept
|
||||||
|
rack-mount
|
||||||
|
virtus (>= 1.0.0)
|
||||||
|
grape-entity (0.4.8)
|
||||||
|
activesupport
|
||||||
|
multi_json (>= 1.3.2)
|
||||||
|
grape-swagger (0.10.4)
|
||||||
|
grape (>= 0.8.0)
|
||||||
|
grape-entity (< 0.5.0)
|
||||||
|
hashie (3.4.3)
|
||||||
|
hike (1.2.3)
|
||||||
|
htmlentities (4.3.4)
|
||||||
|
http (1.0.2)
|
||||||
|
addressable (~> 2.3)
|
||||||
|
http-cookie (~> 1.0)
|
||||||
|
http-form_data (~> 1.0.1)
|
||||||
|
http_parser.rb (~> 0.6.0)
|
||||||
|
http-cookie (1.0.2)
|
||||||
|
domain_name (~> 0.5)
|
||||||
|
http-form_data (1.0.1)
|
||||||
|
http_parser.rb (0.6.0)
|
||||||
|
httparty (0.13.7)
|
||||||
|
json (~> 1.8)
|
||||||
|
multi_xml (>= 0.5.2)
|
||||||
|
i18n (0.6.11)
|
||||||
|
ice_nine (0.11.2)
|
||||||
|
iconv (1.0.4)
|
||||||
|
journey (1.0.4)
|
||||||
|
jquery-rails (2.0.3)
|
||||||
|
railties (>= 3.1.0, < 5.0)
|
||||||
|
thor (~> 0.14)
|
||||||
|
json (1.8.3)
|
||||||
|
kaminari (0.16.3)
|
||||||
|
actionpack (>= 3.0.0)
|
||||||
|
activesupport (>= 3.0.0)
|
||||||
|
libv8 (3.16.14.13)
|
||||||
|
mail (2.5.4)
|
||||||
|
mime-types (~> 1.16)
|
||||||
|
treetop (~> 1.4.8)
|
||||||
|
method_source (0.8.2)
|
||||||
|
mime-types (1.25.1)
|
||||||
|
mini_magick (4.4.0)
|
||||||
|
mini_portile2 (2.0.0)
|
||||||
|
multi_json (1.11.2)
|
||||||
|
multi_xml (0.5.5)
|
||||||
|
multipart-post (2.0.0)
|
||||||
|
mysql2 (0.3.18)
|
||||||
|
net-ldap (0.3.1)
|
||||||
|
netrc (0.11.0)
|
||||||
|
nokogiri (1.6.7.2)
|
||||||
|
mini_portile2 (~> 2.0.0.rc2)
|
||||||
|
paperclip (3.5.4)
|
||||||
|
activemodel (>= 3.0.0)
|
||||||
|
activesupport (>= 3.0.0)
|
||||||
|
cocaine (~> 0.5.3)
|
||||||
|
mime-types
|
||||||
|
polyglot (0.3.5)
|
||||||
|
pry (0.10.3)
|
||||||
|
coderay (~> 1.1.0)
|
||||||
|
method_source (~> 0.8.1)
|
||||||
|
slop (~> 3.4)
|
||||||
|
pry-byebug (3.3.0)
|
||||||
|
byebug (~> 8.0)
|
||||||
|
pry (~> 0.10)
|
||||||
|
pry-rails (0.3.4)
|
||||||
|
pry (>= 0.9.10)
|
||||||
|
pry-stack_explorer (0.4.9.2)
|
||||||
|
binding_of_caller (>= 0.7)
|
||||||
|
pry (>= 0.9.11)
|
||||||
|
rack (1.4.7)
|
||||||
|
rack-accept (0.4.5)
|
||||||
|
rack (>= 0.4)
|
||||||
|
rack-cache (1.6.1)
|
||||||
|
rack (>= 0.4)
|
||||||
|
rack-cors (0.4.0)
|
||||||
|
rack-mount (0.8.3)
|
||||||
|
rack (>= 1.0.0)
|
||||||
|
rack-openid (1.4.2)
|
||||||
|
rack (>= 1.1.0)
|
||||||
|
ruby-openid (>= 2.1.8)
|
||||||
|
rack-raw-upload (1.1.1)
|
||||||
|
multi_json
|
||||||
|
rack-ssl (1.3.4)
|
||||||
|
rack
|
||||||
|
rack-test (0.6.3)
|
||||||
|
rack (>= 1.0)
|
||||||
|
rails (3.2.22.2)
|
||||||
|
actionmailer (= 3.2.22.2)
|
||||||
|
actionpack (= 3.2.22.2)
|
||||||
|
activerecord (= 3.2.22.2)
|
||||||
|
activeresource (= 3.2.22.2)
|
||||||
|
activesupport (= 3.2.22.2)
|
||||||
|
bundler (~> 1.0)
|
||||||
|
railties (= 3.2.22.2)
|
||||||
|
railties (3.2.22.2)
|
||||||
|
actionpack (= 3.2.22.2)
|
||||||
|
activesupport (= 3.2.22.2)
|
||||||
|
rack-ssl (~> 1.3.2)
|
||||||
|
rake (>= 0.8.7)
|
||||||
|
rdoc (~> 3.4)
|
||||||
|
thor (>= 0.14.6, < 2.0)
|
||||||
|
rake (10.5.0)
|
||||||
|
rdoc (3.12.2)
|
||||||
|
json (~> 1.4)
|
||||||
|
redis (3.2.2)
|
||||||
|
redis-actionpack (3.2.4)
|
||||||
|
actionpack (~> 3.2.0)
|
||||||
|
redis-rack (~> 1.4.4)
|
||||||
|
redis-store (~> 1.1.4)
|
||||||
|
redis-activesupport (3.2.5)
|
||||||
|
activesupport (~> 3.2.0)
|
||||||
|
redis-store (~> 1.1.0)
|
||||||
|
redis-rack (1.4.4)
|
||||||
|
rack (~> 1.4.0)
|
||||||
|
redis-store (~> 1.1.4)
|
||||||
|
redis-rails (3.2.4)
|
||||||
|
redis-actionpack (~> 3.2.4)
|
||||||
|
redis-activesupport (~> 3.2.4)
|
||||||
|
redis-store (~> 1.1.4)
|
||||||
|
redis-store (1.1.7)
|
||||||
|
redis (>= 2.2)
|
||||||
|
ref (2.0.0)
|
||||||
|
rest-client (1.8.0)
|
||||||
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
|
mime-types (>= 1.16, < 3.0)
|
||||||
|
netrc (~> 0.7)
|
||||||
|
rich (1.4.6)
|
||||||
|
jquery-rails
|
||||||
|
kaminari
|
||||||
|
mime-types
|
||||||
|
paperclip
|
||||||
|
rack-raw-upload
|
||||||
|
rails (>= 3.2.0)
|
||||||
|
sass-rails
|
||||||
|
rspec-core (3.4.3)
|
||||||
|
rspec-support (~> 3.4.0)
|
||||||
|
rspec-expectations (3.4.0)
|
||||||
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
rspec-support (~> 3.4.0)
|
||||||
|
rspec-mocks (3.4.1)
|
||||||
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
rspec-support (~> 3.4.0)
|
||||||
|
rspec-rails (3.4.2)
|
||||||
|
actionpack (>= 3.0, < 4.3)
|
||||||
|
activesupport (>= 3.0, < 4.3)
|
||||||
|
railties (>= 3.0, < 4.3)
|
||||||
|
rspec-core (~> 3.4.0)
|
||||||
|
rspec-expectations (~> 3.4.0)
|
||||||
|
rspec-mocks (~> 3.4.0)
|
||||||
|
rspec-support (~> 3.4.0)
|
||||||
|
rspec-support (3.4.1)
|
||||||
|
ruby-ole (1.2.12)
|
||||||
|
ruby-openid (2.1.8)
|
||||||
|
rubyzip (1.2.0)
|
||||||
|
sass (3.4.21)
|
||||||
|
sass-rails (3.2.6)
|
||||||
|
railties (~> 3.2.0)
|
||||||
|
sass (>= 3.1.10)
|
||||||
|
tilt (~> 1.3)
|
||||||
|
seems_rateable (1.0.13)
|
||||||
|
jquery-rails
|
||||||
|
rails
|
||||||
|
slop (3.6.0)
|
||||||
|
spreadsheet (1.1.1)
|
||||||
|
ruby-ole (>= 1.0)
|
||||||
|
sprockets (2.2.3)
|
||||||
|
hike (~> 1.2)
|
||||||
|
multi_json (~> 1.0)
|
||||||
|
rack (~> 1.0)
|
||||||
|
tilt (~> 1.1, != 1.3.0)
|
||||||
|
terminal-table (1.5.2)
|
||||||
|
therubyracer (0.12.2)
|
||||||
|
libv8 (~> 3.16.14.0)
|
||||||
|
ref
|
||||||
|
thor (0.19.1)
|
||||||
|
thread_safe (0.3.5)
|
||||||
|
tilt (1.4.1)
|
||||||
|
treetop (1.4.15)
|
||||||
|
polyglot
|
||||||
|
polyglot (>= 0.3.1)
|
||||||
|
tzinfo (0.3.46)
|
||||||
|
uglifier (2.7.2)
|
||||||
|
execjs (>= 0.3.0)
|
||||||
|
json (>= 1.8.0)
|
||||||
|
unf (0.1.4)
|
||||||
|
unf_ext
|
||||||
|
unf_ext (0.0.7.2)
|
||||||
|
virtus (1.0.5)
|
||||||
|
axiom-types (~> 0.1)
|
||||||
|
coercible (~> 1.0)
|
||||||
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
||||||
|
equalizer (~> 0.0, >= 0.0.9)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
acts-as-taggable-on (= 2.4.1)
|
||||||
|
ansi
|
||||||
|
better_errors (~> 1.1.0)
|
||||||
|
binding_of_caller
|
||||||
|
builder (= 3.0.0)
|
||||||
|
chinese_pinyin
|
||||||
|
coderay (~> 1.1.0)
|
||||||
|
coffee-rails (~> 3.2.1)
|
||||||
|
daemons
|
||||||
|
delayed_job_active_record
|
||||||
|
elasticsearch-model
|
||||||
|
elasticsearch-rails
|
||||||
|
factory_girl_rails
|
||||||
|
fastercsv (~> 1.5.0)
|
||||||
|
gitlab!
|
||||||
|
grack!
|
||||||
|
grape (~> 0.9.0)
|
||||||
|
grape-entity
|
||||||
|
grape-swagger
|
||||||
|
htmlentities
|
||||||
|
i18n (~> 0.6.0)
|
||||||
|
iconv
|
||||||
|
jquery-rails (~> 2.0.2)
|
||||||
|
kaminari
|
||||||
|
mysql2 (= 0.3.18)
|
||||||
|
net-ldap (~> 0.3.1)
|
||||||
|
paperclip (~> 3.5.4)
|
||||||
|
pry-byebug
|
||||||
|
pry-rails
|
||||||
|
pry-stack_explorer
|
||||||
|
rack-cors
|
||||||
|
rack-openid
|
||||||
|
rails (~> 3.2)
|
||||||
|
rails_kindeditor!
|
||||||
|
redis-rails
|
||||||
|
rest-client
|
||||||
|
rich (= 1.4.6)
|
||||||
|
rspec-rails (~> 3.0)
|
||||||
|
ruby-ole
|
||||||
|
ruby-openid (~> 2.1.4)
|
||||||
|
rubyzip
|
||||||
|
sass-rails (~> 3.2.3)
|
||||||
|
seems_rateable (~> 1.0.13)
|
||||||
|
spreadsheet
|
||||||
|
therubyracer
|
||||||
|
uglifier (>= 1.0.3)
|
||||||
|
wechat!
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.10.6
|
|
@ -0,0 +1,112 @@
|
||||||
|
source 'http://rubygems.org/'
|
||||||
|
### ÕâÀïÖ´ÐÐbundle config mirror.https://rubygems.org https://gems.ruby-china.org Çл»µ½ruby-chinaÔ´
|
||||||
|
|
||||||
|
unless RUBY_PLATFORM =~ /w32/
|
||||||
|
# unix-like only
|
||||||
|
gem 'iconv'
|
||||||
|
end
|
||||||
|
|
||||||
|
gem 'certified'
|
||||||
|
|
||||||
|
gem 'wechat',path: 'lib/wechat'
|
||||||
|
gem 'grack', path:'lib/grack'
|
||||||
|
gem 'gitlab', path: 'lib/gitlab-cli'
|
||||||
|
gem 'rest-client'
|
||||||
|
gem "mysql2", "= 0.3.18"
|
||||||
|
gem 'redis-rails'
|
||||||
|
gem 'rubyzip'
|
||||||
|
gem 'delayed_job_active_record'#, :group => :production
|
||||||
|
gem 'daemons'
|
||||||
|
gem 'grape', '~> 0.9.0'
|
||||||
|
gem 'grape-entity'
|
||||||
|
gem 'rack-cors', :require => 'rack/cors'
|
||||||
|
gem 'seems_rateable', '~> 1.0.13'
|
||||||
|
gem 'rails', '~> 3.2'
|
||||||
|
gem "jquery-rails", "~> 2.0.2"
|
||||||
|
gem "i18n", "~> 0.6.0"
|
||||||
|
gem 'coderay', '~> 1.1.0'
|
||||||
|
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
|
||||||
|
gem "builder", "3.0.0"
|
||||||
|
gem 'acts-as-taggable-on', '2.4.1'
|
||||||
|
gem 'spreadsheet'
|
||||||
|
gem 'ruby-ole'
|
||||||
|
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
|
||||||
|
#gem "rmagick", ">= 2.0.0"
|
||||||
|
gem 'binding_of_caller'
|
||||||
|
gem 'chinese_pinyin'
|
||||||
|
# gem 'sunspot_rails', '~> 1.3.3'
|
||||||
|
# gem 'sunspot_solr'
|
||||||
|
# gem 'sunspot'
|
||||||
|
# gem 'progress_bar'
|
||||||
|
gem 'ansi'
|
||||||
|
|
||||||
|
gem 'kaminari'
|
||||||
|
gem 'elasticsearch-model'
|
||||||
|
gem 'elasticsearch-rails'
|
||||||
|
|
||||||
|
|
||||||
|
### profile
|
||||||
|
#gem 'oneapm_rpm'
|
||||||
|
|
||||||
|
group :development do
|
||||||
|
gem 'grape-swagger'
|
||||||
|
gem 'better_errors', '~> 1.1.0'
|
||||||
|
# gem "query_reviewer"
|
||||||
|
# gem 'rack-mini-profiler', '~> 0.9.3'
|
||||||
|
if RUBY_PLATFORM =~ /w32/
|
||||||
|
gem 'win32console'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
group :development, :test do
|
||||||
|
unless RUBY_PLATFORM =~ /w32/
|
||||||
|
gem 'pry-rails'
|
||||||
|
if RUBY_VERSION >= '2.0.0'
|
||||||
|
gem 'pry-byebug'
|
||||||
|
end
|
||||||
|
gem 'pry-stack_explorer'
|
||||||
|
if RUBY_PLATFORM =~ /darwin/
|
||||||
|
gem 'puma'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
gem 'rspec-rails', '~> 3.0'
|
||||||
|
gem 'factory_girl_rails'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Gems used only for assets and not required
|
||||||
|
# in production environments by default.
|
||||||
|
group :assets do
|
||||||
|
gem 'sass-rails', '~> 3.2.3'
|
||||||
|
gem 'coffee-rails', '~> 3.2.1'
|
||||||
|
|
||||||
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
|
gem 'therubyracer', :platforms => :ruby
|
||||||
|
|
||||||
|
gem 'uglifier', '>= 1.0.3'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Optional gem for LDAP authentication
|
||||||
|
group :ldap do
|
||||||
|
gem "net-ldap", "~> 0.3.1"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# Optional gem for OpenID authentication
|
||||||
|
group :openid do
|
||||||
|
gem "ruby-openid", "~> 2.1.4", :require => "openid"
|
||||||
|
gem "rack-openid"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
|
||||||
|
if File.exist?(database_file)
|
||||||
|
else
|
||||||
|
warn("Please configure your config/database.yml first")
|
||||||
|
end
|
||||||
|
|
||||||
|
# Load plugins' Gemfiles
|
||||||
|
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
|
||||||
|
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
||||||
|
instance_eval File.read(file)
|
||||||
|
end
|
|
@ -84,7 +84,7 @@ module Mobile
|
||||||
elsif ac.container_type == "Project"
|
elsif ac.container_type == "Project"
|
||||||
case ac.act_type
|
case ac.act_type
|
||||||
when "Issue"
|
when "Issue"
|
||||||
"项目缺陷"
|
"项目问题"
|
||||||
when "Message"
|
when "Message"
|
||||||
"项目讨论区"
|
"项目讨论区"
|
||||||
when "Project"
|
when "Project"
|
||||||
|
|
|
@ -68,7 +68,7 @@ class AtController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_project(id)
|
def find_project(id)
|
||||||
return [] if id<0
|
return [] if id.to_i<0
|
||||||
at_persons = Project.find(id).users
|
at_persons = Project.find(id).users
|
||||||
at_persons.delete_if { |u| u.id == User.current.id }
|
at_persons.delete_if { |u| u.id == User.current.id }
|
||||||
end
|
end
|
||||||
|
|
|
@ -341,7 +341,7 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
def export_course_member_excel
|
def export_course_member_excel
|
||||||
@all_members = student_homework_score(0,0,0,"desc")
|
@all_members = student_homework_score(0,0,0,"desc")
|
||||||
@homeworks = @course.homework_commons.order("created_at asc")
|
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at asc")
|
||||||
filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}";
|
filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}";
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -1177,7 +1177,7 @@ class CoursesController < ApplicationController
|
||||||
AND homework_commons.course_id = #{@course.id}
|
AND homework_commons.course_id = #{@course.id}
|
||||||
AND student_works.user_id = members.user_id
|
AND student_works.user_id = members.user_id
|
||||||
) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
|
) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
|
||||||
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = 577 AND ccs.user_id = members.user_id
|
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id
|
||||||
) AS act_score
|
) AS act_score
|
||||||
FROM members
|
FROM members
|
||||||
JOIN students_for_courses
|
JOIN students_for_courses
|
||||||
|
@ -1191,7 +1191,7 @@ class CoursesController < ApplicationController
|
||||||
AND homework_commons.course_id = #{@course.id}
|
AND homework_commons.course_id = #{@course.id}
|
||||||
AND student_works.user_id = members.user_id
|
AND student_works.user_id = members.user_id
|
||||||
) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
|
) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 +
|
||||||
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = 577 AND ccs.user_id = members.user_id
|
resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id
|
||||||
) AS act_score
|
) AS act_score
|
||||||
FROM members
|
FROM members
|
||||||
JOIN students_for_courses
|
JOIN students_for_courses
|
||||||
|
|
|
@ -256,6 +256,13 @@ class FilesController < ApplicationController
|
||||||
@order = ""
|
@order = ""
|
||||||
@is_remote = false
|
@is_remote = false
|
||||||
if params[:project_id]
|
if params[:project_id]
|
||||||
|
# 更新资源申请消息为已读
|
||||||
|
# ar_ids = ApplyResource.where("user_id =? and container_id =? and container_type =?", User.current.id, params[:project_id].to_i, "Project").map{|ar| ar.id}
|
||||||
|
# cms = CourseMessage.where("course_message_type =? and user_id =? and course_message_id in (#{ar_ids.empty? ? '0': ar_ids.join(',')})", "ApplyResource", User.current.id)
|
||||||
|
# cms.each do |cm|
|
||||||
|
# cm.update_column(:viewed, true)
|
||||||
|
# end
|
||||||
|
# over
|
||||||
@page = params[:page] ? params[:page].to_i + 1 : 2
|
@page = params[:page] ? params[:page].to_i + 1 : 2
|
||||||
@container_type = 0
|
@container_type = 0
|
||||||
if params[:sort]
|
if params[:sort]
|
||||||
|
|
|
@ -14,6 +14,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
#unless params[:page]
|
#unless params[:page]
|
||||||
# update_homework_time(@course.homework_commons)
|
# update_homework_time(@course.homework_commons)
|
||||||
#end
|
#end
|
||||||
|
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||||
@new_homework = HomeworkCommon.new
|
@new_homework = HomeworkCommon.new
|
||||||
@new_homework.homework_detail_manual = HomeworkDetailManual.new
|
@new_homework.homework_detail_manual = HomeworkDetailManual.new
|
||||||
@new_homework.course = @course
|
@new_homework.course = @course
|
||||||
|
@ -21,10 +22,10 @@ class HomeworkCommonController < ApplicationController
|
||||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||||
if @is_teacher
|
if @is_teacher
|
||||||
#@homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10)
|
#@homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10)
|
||||||
@homework_commons = @course.homework_commons.order("created_at desc")
|
@homework_commons = @course.homework_commons.where("name like '%#{search}%'").order("created_at desc")
|
||||||
else
|
else
|
||||||
#@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10)
|
#@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10)
|
||||||
@homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc")
|
@homework_commons = @course.homework_commons.where("name like '%#{search}%' and publish_time <= '#{Date.today}'").order("created_at desc")
|
||||||
end
|
end
|
||||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||||
@is_new = params[:is_new]
|
@is_new = params[:is_new]
|
||||||
|
|
|
@ -102,13 +102,15 @@ class OrgDocumentCommentsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
@org_document_comment = SubDocumentComment.find(params[:id])
|
||||||
org = @org_document_comment.organization
|
@sub_domain = @org_document_comment.sub_domain
|
||||||
if @org_document_comment.id == org.home_id
|
@org_subfield = @sub_domain.org_subfield
|
||||||
org.update_attributes(:home_id => nil)
|
# org = @org_document_comment.organization
|
||||||
end
|
# if @org_document_comment.id == org.home_id
|
||||||
if @org_document_comment.destroy
|
# org.update_attributes(:home_id => nil)
|
||||||
end
|
# end
|
||||||
|
@org_document_comment.destroy
|
||||||
|
# end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
|
@ -164,7 +164,7 @@ class OrganizationsController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
q = params[:search].nil? ? "" : "#{params[:search].strip}"
|
q = params[:search].nil? ? "" : "#{params[:search].strip}"
|
||||||
@field = OrgSubfield.find(params[:org_subfield_id])
|
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comptec").first : OrgSubfield.find(params[:org_subfield_id])
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
if @type == "courses" || @type.nil?
|
if @type == "courses" || @type.nil?
|
||||||
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
|
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
|
||||||
|
|
|
@ -423,9 +423,13 @@ class PollController < ApplicationController
|
||||||
# 将其他地方的问卷导出来
|
# 将其他地方的问卷导出来
|
||||||
def other_poll
|
def other_poll
|
||||||
# 查作者是我,或者作者是当前课程的老师,且不在当前课程内的问卷 进行导入
|
# 查作者是我,或者作者是当前课程的老师,且不在当前课程内的问卷 进行导入
|
||||||
tea_ids = '('
|
courses = User.current.courses.select { |course| User.current.allowed_to?(:as_teacher,course)}
|
||||||
tea_ids << Course.find(params[:polls_group_id]).tea_id.to_s << ','<< User.current.id.to_s << ')'
|
course_ids = courses.empty? ? "(-1)" : "(" + courses.map { |course| course.id}.join(',') + ")"
|
||||||
@polls = Poll.where("user_id in #{tea_ids} and polls_type = 'course' and polls_group_id != #{params[:polls_group_id]}")
|
none_courses = User.current.courses.where("is_delete = 1 or #{Course.table_name}.id = #{params[:polls_group_id].to_i}")
|
||||||
|
none_course_ids = none_courses.empty? ? "(-1)" : "(" + none_courses.map { |course| course.id}.join(',') + ")"
|
||||||
|
#tea_ids = '('
|
||||||
|
#tea_ids << Course.find(params[:polls_group_id]).tea_id.to_s << ','<< User.current.id.to_s << ')'
|
||||||
|
@polls = Poll.where("(user_id = #{User.current.id} or polls_group_id in #{course_ids}) and polls_type = 'course' and polls_group_id not in #{none_course_ids}")
|
||||||
@polls_group_id = params[:polls_group_id]
|
@polls_group_id = params[:polls_group_id]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -25,14 +25,14 @@ class PraiseTreadController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@horizontal = params[:horizontal].downcase == "false" ? false:true if params[:horizontal]
|
@horizontal = params[:horizontal].downcase == "false" ? false:true if params[:horizontal]
|
||||||
if @obj.respond_to?("author_id")
|
# if @obj.respond_to?("author_id")
|
||||||
author_id = @obj.author_id
|
# author_id = @obj.author_id
|
||||||
elsif @obj.respond_to?("user_id")
|
# elsif @obj.respond_to?("user_id")
|
||||||
author_id = @obj.user_id
|
# author_id = @obj.user_id
|
||||||
end
|
# end
|
||||||
unless author_id == User.current.id
|
# unless author_id == User.current.id
|
||||||
praise_tread_plus(@obj_type,@obj_id,1)
|
praise_tread_plus(@obj_type,@obj_id,1)
|
||||||
end
|
# end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
|
@ -362,6 +362,8 @@ update
|
||||||
# project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
# project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
||||||
# ip = RepositoriesHelper::REPO_IP_ADDRESS
|
# ip = RepositoriesHelper::REPO_IP_ADDRESS
|
||||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
gitlab_address = Redmine::Configuration['gitlab_address']
|
||||||
|
# REDO:需优化,仅测试用
|
||||||
|
@zip_path = gitlab_address.to_s + "/api/v3/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=YTyCv4978MXmdL2B9C62"
|
||||||
if @repository.type.to_s == "Repository::Gitlab"
|
if @repository.type.to_s == "Repository::Gitlab"
|
||||||
@repos_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git"
|
@repos_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git"
|
||||||
else
|
else
|
||||||
|
|
|
@ -27,8 +27,10 @@ class SsosController < ApplicationController
|
||||||
## 加入组织
|
## 加入组织
|
||||||
@organization = Organization.find(82)
|
@organization = Organization.find(82)
|
||||||
unless @organization.org_members.exists?(user_id: sso.user_id)
|
unless @organization.org_members.exists?(user_id: sso.user_id)
|
||||||
member = OrgMember.new(:user_id => sso.user_id)
|
member = OrgMember.create(:user_id => sso.user_id, :created_at => Time.now)
|
||||||
|
# member = OrgMember.new(:user_id => sso.user_id)
|
||||||
@organization.org_members << member
|
@organization.org_members << member
|
||||||
|
OrgMemberRole.create(:org_member_id => member.id, :role_id => 12)
|
||||||
end
|
end
|
||||||
|
|
||||||
## 选择性跳转
|
## 选择性跳转
|
||||||
|
@ -55,10 +57,7 @@ class SsosController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse(auth)
|
def parse(auth)
|
||||||
crypted_str = Base64.decode64(base64_safe(auth))
|
content = decrypt(auth)
|
||||||
pkey = OpenSSL::PKey::RSA.new(File.new(File.join(Rails.root,"config/private.key")))
|
|
||||||
content = pkey.private_decrypt(crypted_str,OpenSSL::PKey::RSA::PKCS1_PADDING)
|
|
||||||
# content = pkey.private_decrypt(crypted_str)
|
|
||||||
ActiveSupport::JSON.decode(content)
|
ActiveSupport::JSON.decode(content)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -68,4 +67,20 @@ class SsosController < ApplicationController
|
||||||
sso
|
sso
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def decrypt(auth)
|
||||||
|
crypted_str = Base64.decode64(base64_safe(auth))
|
||||||
|
pkey = OpenSSL::PKey::RSA.new(File.new(File.join(Rails.root,"config/private.key")))
|
||||||
|
|
||||||
|
#to large
|
||||||
|
max_dec_len = 1024/8
|
||||||
|
size = (crypted_str.size + max_dec_len-1) / max_dec_len
|
||||||
|
|
||||||
|
content = ''
|
||||||
|
size.times do |time|
|
||||||
|
tmps = crypted_str[time*max_dec_len, max_dec_len]
|
||||||
|
content += pkey.private_decrypt(tmps,OpenSSL::PKey::RSA::PKCS1_PADDING)
|
||||||
|
end
|
||||||
|
content
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -81,6 +81,7 @@ class StudentWorkController < ApplicationController
|
||||||
#根据传入的tIndex确定是第几次测试
|
#根据传入的tIndex确定是第几次测试
|
||||||
#之后如果觉得很卡 可以改成将结果传回JS再以参数形式传回来
|
#之后如果觉得很卡 可以改成将结果传回JS再以参数形式传回来
|
||||||
def program_test_ex
|
def program_test_ex
|
||||||
|
|
||||||
tStarttime = Time.now
|
tStarttime = Time.now
|
||||||
|
|
||||||
is_test = params[:is_test] == 'true'
|
is_test = params[:is_test] == 'true'
|
||||||
|
@ -106,106 +107,123 @@ class StudentWorkController < ApplicationController
|
||||||
tEndtime = Time.now
|
tEndtime = Time.now
|
||||||
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
|
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
|
||||||
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
|
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
|
||||||
|
#status 0:答案正确 -5program_test_ex 函数出错 -4judge代码出错 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
||||||
#status 0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
resultObj[:status] = -3
|
||||||
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>-3,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
|
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>-3,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
|
||||||
|
rescue
|
||||||
end
|
#-4 judge代码 出错
|
||||||
if result["status"].to_i != -2
|
logger.debug "program_test_error 1"
|
||||||
#result["results"].first['output'] = result["results"].first['output'].gsub(" ","□")
|
resultObj[:status] = -4
|
||||||
#result["results"].first['result'] = result["results"].first['result'].gsub(" ","□")
|
tmpstatus = -4
|
||||||
space_replace_1(result["results"].first['output'])
|
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>0,:wait_time=>0,:student_work_id=>student_work.id)
|
||||||
space_replace_1(result["results"].first['result'])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
logger.debug result
|
begin
|
||||||
|
if resultObj[:status] != -3 && resultObj[:status] != -4
|
||||||
|
if result["status"].to_i != -2
|
||||||
|
#result["results"].first['output'] = result["results"].first['output'].gsub(" ","□")
|
||||||
|
#result["results"].first['result'] = result["results"].first['result'].gsub(" ","□")
|
||||||
|
space_replace_1(result["results"].first['output'])
|
||||||
|
space_replace_1(result["results"].first['result'])
|
||||||
|
end
|
||||||
|
|
||||||
#-1 默认值 0全部正确并结束 2 超时 -2 编译错误
|
logger.debug result
|
||||||
resultObj[:status] = -1
|
|
||||||
resultObj[:results] = result["results"].first #本次测试结果
|
|
||||||
result["error_msg"] = result["error_msg"][0..2047]
|
|
||||||
resultObj[:error_msg] = result["error_msg"] #编译错误时的信息
|
|
||||||
|
|
||||||
#该状态用于存入CodeTests
|
#-1 默认值 0全部正确并结束 2 超时 -2 编译错误
|
||||||
tmpstatus = -1
|
resultObj[:status] = -1
|
||||||
if result["status"].to_i == -2 #编译错误
|
resultObj[:results] = result["results"].first #本次测试结果
|
||||||
resultObj[:results] = result["error_msg"]
|
if result["status"].to_i == -2 #编译错误
|
||||||
resultObj[:status] = -2
|
result["error_msg"] = result["error_msg"][0..2047]
|
||||||
tmpstatus = -2
|
end
|
||||||
elsif result["results"][0]["status"].to_i == 2
|
resultObj[:error_msg] = result["error_msg"] #编译错误时的信息
|
||||||
resultObj[:status] = 2
|
|
||||||
tmpstatus = 2
|
|
||||||
end
|
|
||||||
|
|
||||||
if result["status"] == 0
|
#该状态用于存入CodeTests
|
||||||
tmpstatus = 0
|
tmpstatus = -1
|
||||||
end
|
if result["status"].to_i == -2 #编译错误
|
||||||
|
resultObj[:results] = result["error_msg"]
|
||||||
|
resultObj[:status] = -2
|
||||||
|
tmpstatus = -2
|
||||||
|
elsif result["results"][0]["status"].to_i == 2
|
||||||
|
resultObj[:status] = 2
|
||||||
|
tmpstatus = 2
|
||||||
|
end
|
||||||
|
|
||||||
unless student_work.save
|
if result["status"] == 0
|
||||||
resultObj[:status] = 200
|
tmpstatus = 0
|
||||||
else
|
end
|
||||||
student_work.name = params[:title]
|
|
||||||
student_work.description = params[:src]
|
|
||||||
|
|
||||||
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
unless student_work.save
|
||||||
student_work.late_penalty = @homework.late_penalty
|
resultObj[:status] = 200
|
||||||
else
|
else
|
||||||
student_work.late_penalty = 0
|
student_work.name = params[:title]
|
||||||
end
|
student_work.description = params[:src]
|
||||||
|
|
||||||
#每次从数据库取出上次的结果加上本次的结果再存入数据库
|
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||||
if result["status"].to_i != -2
|
student_work.late_penalty = @homework.late_penalty
|
||||||
result["results"].first['user_wait'] = tUsedtime
|
else
|
||||||
|
student_work.late_penalty = 0
|
||||||
|
end
|
||||||
|
|
||||||
if result["results"][0]["status"].to_i == 2
|
#每次从数据库取出上次的结果加上本次的结果再存入数据库
|
||||||
result["status"] = 2
|
if result["status"].to_i != -2
|
||||||
|
result["results"].first['user_wait'] = tUsedtime
|
||||||
|
|
||||||
|
if result["results"][0]["status"].to_i == 2
|
||||||
|
result["status"] = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
status = result["status"]
|
||||||
|
if index == 1
|
||||||
|
student_work_test = student_work.student_work_tests.build(status: status,
|
||||||
|
results: [resultObj[:results]],src: params[:src])
|
||||||
|
student_work_test.save!
|
||||||
|
resultObj[:testid] = student_work_test.id
|
||||||
|
else
|
||||||
|
#先从数据库取出result
|
||||||
|
student_work_test = StudentWorkTest.find(params[:testid])
|
||||||
|
results = student_work_test.results
|
||||||
|
results << resultObj[:results]
|
||||||
|
student_work_test.results = results
|
||||||
|
student_work_test.status = (result["status"] != 0 ? result["status"] : student_work_test.status)
|
||||||
|
student_work_test.save!
|
||||||
|
status = student_work_test.status
|
||||||
|
resultObj[:testid] = student_work_test.id
|
||||||
|
end
|
||||||
|
|
||||||
|
#超时或编译错误则直接返回了并存入数据库
|
||||||
|
if resultObj[:status] == 2 || resultObj[:status] == -2 || index == @homework.homework_tests.size
|
||||||
|
if status == 0
|
||||||
|
resultObj[:status] = 0
|
||||||
|
end
|
||||||
|
student_work.save!
|
||||||
|
resultObj[:time] = student_work_test.created_at.to_s(:db)
|
||||||
|
resultObj[:index] = student_work.student_work_tests.count
|
||||||
|
end
|
||||||
|
|
||||||
|
#将每次用户等待时间都存起来以便管理界面显示用
|
||||||
|
tEndtime = Time.now
|
||||||
|
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
|
||||||
|
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
|
||||||
|
|
||||||
|
time_used = 0
|
||||||
|
if result["status"].to_i != -2
|
||||||
|
#至少一毫秒
|
||||||
|
time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used']
|
||||||
|
end
|
||||||
|
#0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
||||||
|
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue
|
||||||
status = result["status"]
|
#-5 program_test_ex 函数出错
|
||||||
if index == 1
|
logger.debug "program_test_error 2"
|
||||||
student_work_test = student_work.student_work_tests.build(status: status,
|
resultObj[:status] = -5
|
||||||
results: [resultObj[:results]],src: params[:src])
|
tmpstatus = -5
|
||||||
student_work_test.save!
|
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>0,:wait_time=>0,:student_work_id=>student_work.id)
|
||||||
resultObj[:testid] = student_work_test.id
|
|
||||||
else
|
|
||||||
#先从数据库取出result
|
|
||||||
student_work_test = StudentWorkTest.find(params[:testid])
|
|
||||||
results = student_work_test.results
|
|
||||||
results << resultObj[:results]
|
|
||||||
student_work_test.results = results
|
|
||||||
student_work_test.status = (result["status"] != 0 ? result["status"] : student_work_test.status)
|
|
||||||
student_work_test.save!
|
|
||||||
status = student_work_test.status
|
|
||||||
resultObj[:testid] = student_work_test.id
|
|
||||||
end
|
|
||||||
|
|
||||||
#超时或编译错误则直接返回了并存入数据库
|
|
||||||
if resultObj[:status] == 2 || resultObj[:status] == -2 || index == @homework.homework_tests.size
|
|
||||||
if status == 0
|
|
||||||
resultObj[:status] = 0
|
|
||||||
end
|
|
||||||
student_work.save!
|
|
||||||
resultObj[:time] = student_work_test.created_at.to_s(:db)
|
|
||||||
resultObj[:index] = student_work.student_work_tests.count
|
|
||||||
end
|
|
||||||
|
|
||||||
#将每次用户等待时间都存起来以便管理界面显示用
|
|
||||||
tEndtime = Time.now
|
|
||||||
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
|
|
||||||
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
|
|
||||||
|
|
||||||
time_used = 0
|
|
||||||
if result["status"].to_i != -2
|
|
||||||
#至少一毫秒
|
|
||||||
time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used']
|
|
||||||
end
|
|
||||||
#0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
|
||||||
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
|
|
||||||
|
|
||||||
#渲染返回结果
|
|
||||||
render :json => resultObj
|
|
||||||
end
|
end
|
||||||
|
#渲染返回结果
|
||||||
|
render :json => resultObj
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -356,8 +374,9 @@ class StudentWorkController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
##################################################################################################################
|
##################################################################################################################
|
||||||
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group]
|
||||||
@homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc")
|
@homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc")
|
||||||
|
@all_homework_commons = @course.homework_commons.order("created_at desc")
|
||||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||||
@is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
@is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
||||||
@show_all = false
|
@show_all = false
|
||||||
|
|
|
@ -311,6 +311,28 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 处理资源引用请求
|
||||||
|
# status
|
||||||
|
def deal_with_apply_resource
|
||||||
|
@msg = CourseMessage.find(params[:msg_id])
|
||||||
|
ar = ApplyResource.where("id = ?", @msg.course_message_id).first
|
||||||
|
unless ar.nil?
|
||||||
|
case params[:agree]
|
||||||
|
when 'Y'
|
||||||
|
ar.update_column('status', 2)
|
||||||
|
@msg.update_attributes(:apply_result => 1, :viewed => 1)
|
||||||
|
ar.course_messages << CourseMessage.new(:user_id => ar.user_id, :course_id => -1, :viewed => false, :apply_result => 2, :status => 1)
|
||||||
|
when 'N'
|
||||||
|
ar.update_column('status', 3)
|
||||||
|
@msg.update_attributes(:apply_result => 2, :viewed => 1)
|
||||||
|
ar.course_messages << CourseMessage.new(:user_id => ar.user_id, :course_id => -1, :viewed => false, :apply_result => 3, :status => 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#处理引用作业的请求
|
#处理引用作业的请求
|
||||||
#status 1 同意 2 拒绝
|
#status 1 同意 2 拒绝
|
||||||
def dealwith_apply_homework
|
def dealwith_apply_homework
|
||||||
|
@ -419,6 +441,19 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
# 资源分享请求弹框
|
||||||
|
def apply_resource
|
||||||
|
if User.current.logged?
|
||||||
|
@attachment = Attachment.find params[:attachment_id]
|
||||||
|
@state = 2
|
||||||
|
else
|
||||||
|
@state = 1
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#引用作业请求弹框
|
#引用作业请求弹框
|
||||||
def apply_homework
|
def apply_homework
|
||||||
if User.current.logged?
|
if User.current.logged?
|
||||||
|
@ -432,6 +467,27 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 申请引用资源
|
||||||
|
def apply_for_resource
|
||||||
|
if User.current.logged?
|
||||||
|
@attachment = Attachment.where("id =?", params[:attachment_id].to_i).first
|
||||||
|
unless @attachment.nil?
|
||||||
|
ar = ApplyResource.where("user_id = ? and attachment_id = ?", User.current.id, params[:attacment_id].to_i)
|
||||||
|
if ar.empty?
|
||||||
|
ApplyResource.create(:user_id => params[:id].to_i, :attachment_id => params[:attachment_id].to_i, :status => true, :container_id => @attachment.container_id, :container_type => @attachment.container_type, :content => params[:content], :apply_user_id => @attachment.author_id)
|
||||||
|
@state = 2
|
||||||
|
else
|
||||||
|
@state = 3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@state = 1
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#申请引用非公开作业
|
#申请引用非公开作业
|
||||||
def apply_for_homework
|
def apply_for_homework
|
||||||
if User.current.logged?
|
if User.current.logged?
|
||||||
|
@ -671,21 +727,21 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_homework_detail
|
def show_homework_detail
|
||||||
homework = HomeworkCommon.find params[:homework].to_i
|
@homework = HomeworkCommon.find params[:homework].to_i
|
||||||
if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course) && User.current != homework.user
|
# if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course) && User.current != homework.user
|
||||||
ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:homework].to_i)
|
# ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:homework].to_i)
|
||||||
if ah.empty?
|
# if ah.empty?
|
||||||
@status = 2
|
# @status = 2
|
||||||
@homework = nil
|
# @homework = nil
|
||||||
elsif ah.first.status != 2
|
# elsif ah.first.status != 2
|
||||||
@status = ah.first.status
|
# @status = ah.first.status
|
||||||
@homework = nil
|
# @homework = nil
|
||||||
elsif ah.first.status == 2
|
# elsif ah.first.status == 2
|
||||||
@homework = homework
|
# @homework = homework
|
||||||
end
|
# end
|
||||||
else
|
# else
|
||||||
@homework = homework
|
# @homework = homework
|
||||||
end
|
# end
|
||||||
@is_import = params[:is_import]
|
@is_import = params[:is_import]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
@ -1886,7 +1942,7 @@ class UsersController < ApplicationController
|
||||||
# 将资源发送到对应的课程,分为发送单个,或者批量发送
|
# 将资源发送到对应的课程,分为发送单个,或者批量发送
|
||||||
def add_exist_file_to_course
|
def add_exist_file_to_course
|
||||||
@flag = true
|
@flag = true
|
||||||
if params[:send_id].present?
|
if params[:send_id].present?
|
||||||
send_id = params[:send_id]
|
send_id = params[:send_id]
|
||||||
@ori = Attachment.find_by_id(send_id)
|
@ori = Attachment.find_by_id(send_id)
|
||||||
course_ids = params[:course_ids]
|
course_ids = params[:course_ids]
|
||||||
|
@ -1933,14 +1989,14 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
send_ids.each do |send_id|
|
send_ids.each do |send_id|
|
||||||
quotes = 0
|
quotes = 0
|
||||||
ori = Attachment.find_by_id(send_id)
|
@ori = Attachment.find_by_id(send_id)
|
||||||
unless course_ids.nil?
|
unless course_ids.nil?
|
||||||
course_ids.each do |id|
|
course_ids.each do |id|
|
||||||
quotes = 0
|
quotes = 0
|
||||||
next if ori.blank?
|
next if @ori.blank?
|
||||||
@exist = false
|
@exist = false
|
||||||
Course.find(id).attachments.each do |att| #如果课程中包含该资源
|
Course.find(id).attachments.each do |att| #如果课程中包含该资源
|
||||||
if att.id == ori.id || (!att.copy_from.nil? && !ori.copy_from.nil? && att.copy_from == ori.copy_from) || att.copy_from == ori.id || att.id == ori.copy_from
|
if att.id == @ori.id || (!att.copy_from.nil? && !@ori.copy_from.nil? && att.copy_from == @ori.copy_from) || att.copy_from == @ori.id || att.id == @ori.copy_from
|
||||||
att.created_on = Time.now
|
att.created_on = Time.now
|
||||||
att.save
|
att.save
|
||||||
@exist = true
|
@exist = true
|
||||||
|
@ -1948,21 +2004,21 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
next if @exist
|
next if @exist
|
||||||
attach_copied_obj = ori.copy
|
attach_copied_obj = @ori.copy
|
||||||
attach_copied_obj.tag_list.add(ori.tag_list) # tag关联
|
attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联
|
||||||
attach_copied_obj.container = Course.find(id)
|
attach_copied_obj.container = Course.find(id)
|
||||||
attach_copied_obj.created_on = Time.now
|
attach_copied_obj.created_on = Time.now
|
||||||
attach_copied_obj.author_id = User.current.id
|
attach_copied_obj.author_id = User.current.id
|
||||||
attach_copied_obj.is_public = 0
|
attach_copied_obj.is_public = 0
|
||||||
attach_copied_obj.copy_from = ori.copy_from.nil? ? ori.id : ori.copy_from #发送要添加copy_from
|
attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from
|
||||||
if attach_copied_obj.attachtype == nil
|
if attach_copied_obj.attachtype == nil
|
||||||
attach_copied_obj.attachtype = 4
|
attach_copied_obj.attachtype = 4
|
||||||
end
|
end
|
||||||
if attach_copied_obj.save
|
if attach_copied_obj.save
|
||||||
# 更新引用次数
|
# 更新引用次数
|
||||||
quotes = ori.quotes.to_i + 1
|
quotes = @ori.quotes.to_i + 1
|
||||||
ori.update_attribute(:quotes, quotes) unless ori.nil?
|
@ori.update_attribute(:quotes, quotes) unless @ori.nil?
|
||||||
ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
@ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
||||||
end
|
end
|
||||||
@save_message = attach_copied_obj.errors.full_messages
|
@save_message = attach_copied_obj.errors.full_messages
|
||||||
end
|
end
|
||||||
|
@ -2002,6 +2058,18 @@ class UsersController < ApplicationController
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||||
end
|
end
|
||||||
|
elsif params[:type] == "2"
|
||||||
|
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||||
|
if params[:status] == "2"
|
||||||
|
resource_type = "'Course'"
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
resource_type = "'Project'"
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
resource_type = "'Principal'"
|
||||||
|
else
|
||||||
|
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||||
|
end
|
||||||
|
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||||
end
|
end
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
@limit = 25
|
@limit = 25
|
||||||
|
@ -2143,6 +2211,18 @@ class UsersController < ApplicationController
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||||
end
|
end
|
||||||
|
elsif params[:type] == "2"
|
||||||
|
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||||
|
if params[:status] == "2"
|
||||||
|
resource_type = "'Course'"
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
resource_type = "'Project'"
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
resource_type = "'Principal'"
|
||||||
|
else
|
||||||
|
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||||
|
end
|
||||||
|
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||||
end
|
end
|
||||||
@status = params[:status]
|
@status = params[:status]
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
|
@ -2272,6 +2352,18 @@ class UsersController < ApplicationController
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||||
end
|
end
|
||||||
|
elsif params[:type] == "2"
|
||||||
|
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||||
|
if params[:status] == "2"
|
||||||
|
resource_type = "'Course'"
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
resource_type = "'Project'"
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
resource_type = "'Principal'"
|
||||||
|
else
|
||||||
|
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||||
|
end
|
||||||
|
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||||
end
|
end
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
@limit = 25
|
@limit = 25
|
||||||
|
@ -2608,19 +2700,16 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# 获取公共资源
|
# 获取公共资源
|
||||||
def get_public_resources user_course_ids, user_project_ids, order, score
|
def get_public_resources user_course_ids, user_project_ids, order, score
|
||||||
attachments = Attachment.where("(is_publish = 1 and is_public =1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
|
attachments = Attachment.where("(is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取公共资源搜索
|
# 获取公共资源搜索
|
||||||
def get_public_resources_search user_course_ids, user_project_ids, order, score, search
|
def get_public_resources_search user_course_ids, user_project_ids, order, score, search
|
||||||
attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
attachments = Attachment.where("is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取我的资源
|
# 获取我的资源
|
||||||
def get_my_resources author_id, user_course_ids, user_project_ids, order, score
|
def get_my_resources author_id, user_course_ids, user_project_ids, order, score
|
||||||
unless author_id.to_i.to_s == author_id
|
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
end
|
|
||||||
attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('OrgSubfield','Principal','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
attachments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('OrgSubfield','Principal','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
||||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
||||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
|
@ -2628,7 +2717,6 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# 获取我的资源查询结果
|
# 获取我的资源查询结果
|
||||||
def get_my_resources_search (author_id, user_course_ids, user_project_ids, order, score, search)
|
def get_my_resources_search (author_id, user_course_ids, user_project_ids, order, score, search)
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
@attachments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
@attachments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
|
||||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}) and is_publish = 1 and container_id is not null)" +
|
||||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')}) and is_publish = 1 and container_id is not null)) and (filename like :p)" ,:p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
|
@ -2636,15 +2724,23 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# 获取我的课程资源
|
# 获取我的课程资源
|
||||||
def get_course_resources author_id, user_course_ids, order, score
|
def get_course_resources author_id, user_course_ids, order, score
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
|
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
|
||||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
|
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
|
||||||
and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 获取我的私有资源分享结果
|
||||||
|
def get_my_private_resources apply_ids, resource_type, order, score
|
||||||
|
attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
|
end
|
||||||
|
|
||||||
|
# 获取我的私有资源分享搜索结果
|
||||||
|
def get_my_private_resources_search apply_ids, resource_type, order, score, search
|
||||||
|
attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
|
end
|
||||||
|
|
||||||
# 获取我的课程资源中搜索结果
|
# 获取我的课程资源中搜索结果
|
||||||
def get_course_resources_search author_id, user_course_ids, order, score, search
|
def get_course_resources_search author_id, user_course_ids, order, score, search
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
|
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
|
||||||
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
|
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
|
||||||
and is_publish = 1 and container_id is not null)) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
and is_publish = 1 and container_id is not null)) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
|
@ -2652,17 +2748,16 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# 获取公共资源中课程资源
|
# 获取公共资源中课程资源
|
||||||
def get_course_resources_public user_course_ids, order, score
|
def get_course_resources_public user_course_ids, order, score
|
||||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("#{order.nil? ? 'created_on' : order} #{score}")
|
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1)").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取公共资源中课程资源搜索结果
|
# 获取公共资源中课程资源搜索结果
|
||||||
def get_course_resources_public_search user_course_ids, order, score, search
|
def get_course_resources_public_search user_course_ids, order, score, search
|
||||||
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取我的项目资源
|
# 获取我的项目资源
|
||||||
def get_project_resources author_id, user_project_ids, order, score
|
def get_project_resources author_id, user_project_ids, order, score
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
|
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
|
||||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
|
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
|
||||||
and is_publish = 1 and container_id is not null)").order("#{order.nil? ? 'created_on' : order} #{score}")
|
and is_publish = 1 and container_id is not null)").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
|
@ -2670,7 +2765,6 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# 获取我的项目资源搜索
|
# 获取我的项目资源搜索
|
||||||
def get_project_resources_search author_id, user_project_ids, order, score, search
|
def get_project_resources_search author_id, user_project_ids, order, score, search
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
|
attchments = Attachment.where("((author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
|
||||||
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
|
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
|
||||||
and is_publish = 1 and container_id is not null)) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
and is_publish = 1 and container_id is not null)) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
|
@ -2678,24 +2772,22 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# 获取公共资源的项目资源
|
# 获取公共资源的项目资源
|
||||||
def get_project_resources_public user_project_ids, order, score
|
def get_project_resources_public user_project_ids, order, score
|
||||||
attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
attchments = Attachment.where("container_type = 'Project' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取公共资源的项目资源搜索
|
# 获取公共资源的项目资源搜索
|
||||||
def get_project_resources_public_search user_project_ids, order, score, search
|
def get_project_resources_public_search user_project_ids, order, score, search
|
||||||
attchments = Attachment.where("(container_type = 'Project' and container_id is not null and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
attchments = Attachment.where("(container_type = 'Project' and container_id is not null) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取我上传的附件
|
# 获取我上传的附件
|
||||||
def get_attch_resources author_id, order, score
|
def get_attch_resources author_id, order, score
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
|
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
|
||||||
'Document','Message','News','StudentWorkScore','HomewCommon'))").order("#{order.nil? ? 'created_on' : order} #{score}")
|
'Document','Message','News','StudentWorkScore','HomewCommon'))").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取我上传的附件搜索结果
|
# 获取我上传的附件搜索结果
|
||||||
def get_attch_resources_search author_id, order, score, search
|
def get_attch_resources_search author_id, order, score, search
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
|
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course','Issue',
|
||||||
'Document','Message','News','StudentWorkScore','HomewCommon')) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
'Document','Message','News','StudentWorkScore','HomewCommon')) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
@ -2703,35 +2795,33 @@ class UsersController < ApplicationController
|
||||||
# 获取公共资源中我上传的附件
|
# 获取公共资源中我上传的附件
|
||||||
def get_attch_resources_public order, score
|
def get_attch_resources_public order, score
|
||||||
attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
|
attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
|
||||||
and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取公共资源中我上传的附件
|
# 获取公共资源中我上传的附件
|
||||||
def get_attch_resources_public_search order, score, search
|
def get_attch_resources_public_search order, score, search
|
||||||
attchments = Attachment.where("(container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
|
attchments = Attachment.where("(container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
|
||||||
and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取我的用户类型资源
|
# 获取我的用户类型资源
|
||||||
def get_principal_resources author_id, order, score
|
def get_principal_resources author_id, order, score
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
attchments = Attachment.where("author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Principal'").order("#{order.nil? ? 'created_on' : order} #{score}")
|
attchments = Attachment.where("author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Principal'").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取我的用户类型资源搜索
|
# 获取我的用户类型资源搜索
|
||||||
def get_principal_resources_search author_id, order, score, search
|
def get_principal_resources_search author_id, order, score, search
|
||||||
author_id = User.find_by_login(author_id).id
|
|
||||||
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Principal') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Principal') and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取我的用户类型资源
|
# 获取我的用户类型资源
|
||||||
def get_principal_resources_public order, score
|
def get_principal_resources_public order, score
|
||||||
attchments = Attachment.where("container_type = 'Principal'and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
|
attchments = Attachment.where("container_type = 'Principal' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取我的用户类型资源
|
# 获取我的用户类型资源
|
||||||
def get_principal_resources_public_search order, score, search
|
def get_principal_resources_public_search order, score, search
|
||||||
attchments = Attachment.where("(container_type = 'Principal'and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
attchments = Attachment.where("(container_type = 'Principal'and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# 资源库 分为全部 课程资源 项目资源 附件
|
# 资源库 分为全部 课程资源 项目资源 附件
|
||||||
|
@ -2746,7 +2836,7 @@ class UsersController < ApplicationController
|
||||||
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
|
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
|
||||||
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
|
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
|
||||||
# user_org_ids = User.current.organizations.map {|o| o.id}
|
# user_org_ids = User.current.organizations.map {|o| o.id}
|
||||||
if(params[:type].blank? || params[:type] == "1") # 我的资源
|
if( params[:type] == "1") # 我的资源
|
||||||
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
|
||||||
if params[:status] == "2"
|
if params[:status] == "2"
|
||||||
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
|
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
|
||||||
|
@ -2760,7 +2850,7 @@ class UsersController < ApplicationController
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
|
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
|
||||||
end
|
end
|
||||||
elsif params[:type] == "6" # 公共资源
|
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
|
||||||
if params[:status] == "2"
|
if params[:status] == "2"
|
||||||
@attachments = get_course_resources_public( user_course_ids, @order, @score)
|
@attachments = get_course_resources_public( user_course_ids, @order, @score)
|
||||||
elsif params[:status] == "3"
|
elsif params[:status] == "3"
|
||||||
|
@ -2773,6 +2863,18 @@ class UsersController < ApplicationController
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
|
||||||
end
|
end
|
||||||
|
elsif params[:type] == "2" # 私有资源
|
||||||
|
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||||
|
if params[:status] == "2"
|
||||||
|
resource_type = "'Course'"
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
resource_type = "'Project'"
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
resource_type = "'Principal'"
|
||||||
|
else
|
||||||
|
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||||
|
end
|
||||||
|
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
|
||||||
end
|
end
|
||||||
@status = params[:status]
|
@status = params[:status]
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
|
@ -2792,8 +2894,7 @@ class UsersController < ApplicationController
|
||||||
# 导入资源
|
# 导入资源
|
||||||
def import_resources
|
def import_resources
|
||||||
# 别人的资源库是没有权限去看的
|
# 别人的资源库是没有权限去看的
|
||||||
@user = User.find_by_login(params[:id])
|
if User.current.id != params[:id].to_i
|
||||||
if User.current != @user
|
|
||||||
render_403
|
render_403
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -2953,6 +3054,19 @@ class UsersController < ApplicationController
|
||||||
# 公共资源库:所有公开资源或者我上传的私有资源
|
# 公共资源库:所有公开资源或者我上传的私有资源
|
||||||
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
|
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
|
||||||
end
|
end
|
||||||
|
elsif params[:type] == "2" # 私有资源
|
||||||
|
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
|
||||||
|
if params[:status] == "2"
|
||||||
|
resource_type = "'Course'"
|
||||||
|
elsif params[:status] == "3"
|
||||||
|
resource_type = "'Project'"
|
||||||
|
elsif params[:status] == "5"
|
||||||
|
resource_type = "'Principal'"
|
||||||
|
else
|
||||||
|
resource_type = "'Project','OrgSubfield','Principal','Course'"
|
||||||
|
end
|
||||||
|
@attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search)
|
||||||
|
@attachments
|
||||||
end
|
end
|
||||||
@status = params[:status]
|
@status = params[:status]
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
|
|
|
@ -166,7 +166,7 @@ class WechatsController < ActionController::Base
|
||||||
raise "非法操作, code不存在" unless params[:code]
|
raise "非法操作, code不存在" unless params[:code]
|
||||||
openid = get_openid_from_code(params[:code])
|
openid = get_openid_from_code(params[:code])
|
||||||
raise "无法获取到openid" unless openid
|
raise "无法获取到openid" unless openid
|
||||||
raise "此微信号已绑定用户, 不能得复绑定" if user_binded?(openid)
|
raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid)
|
||||||
|
|
||||||
user, last_login_on = User.try_to_login(params[:username], params[:password])
|
user, last_login_on = User.try_to_login(params[:username], params[:password])
|
||||||
raise "用户名或密码错误,请重新登录" unless user
|
raise "用户名或密码错误,请重新登录" unless user
|
||||||
|
|
|
@ -34,13 +34,6 @@ module ApplicationHelper
|
||||||
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
|
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
|
||||||
|
|
||||||
|
|
||||||
def user_path(resource, parameters = {})
|
|
||||||
if Fixnum === resource
|
|
||||||
resource = User.find(resource)
|
|
||||||
end
|
|
||||||
super
|
|
||||||
end
|
|
||||||
|
|
||||||
# def user_blogs_path(resource,parameters={})
|
# def user_blogs_path(resource,parameters={})
|
||||||
# super
|
# super
|
||||||
# end
|
# end
|
||||||
|
@ -56,6 +49,21 @@ module ApplicationHelper
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 判断某个资源是否可以申请
|
||||||
|
def attach_show_allow attach_id
|
||||||
|
attachment = Attachment.find(attach_id)
|
||||||
|
case attachment.container_type
|
||||||
|
when "Project"
|
||||||
|
User.current.member_of?(attachment.container) ? true : false
|
||||||
|
when "Course"
|
||||||
|
User.current.member_of_course?(attachment.container) ? true : false
|
||||||
|
when "OrgSubfield"
|
||||||
|
User.current.member_of_org?(attachment.container) ? true : false
|
||||||
|
when "Principal"
|
||||||
|
User.current.id == attachment.author_id ? true : false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Time 2015-03-24 15:27:29
|
# Time 2015-03-24 15:27:29
|
||||||
# Author lizanle
|
# Author lizanle
|
||||||
# Description 从硬盘上删除对应的资源文件
|
# Description 从硬盘上删除对应的资源文件
|
||||||
|
@ -95,11 +103,13 @@ module ApplicationHelper
|
||||||
|
|
||||||
# 获取组织成员中文名字
|
# 获取组织成员中文名字
|
||||||
def get_org_member_role_name member
|
def get_org_member_role_name member
|
||||||
case member.roles[0].name
|
unless member.roles[0].nil?
|
||||||
when 'orgManager'
|
case member.roles[0].name
|
||||||
'管理人员'
|
when 'orgManager'
|
||||||
when 'orgMember'
|
'管理人员'
|
||||||
'组织成员'
|
when 'orgMember'
|
||||||
|
'组织成员'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -3094,6 +3104,10 @@ def host_with_protocol
|
||||||
return Setting.protocol + "://" + Setting.host_name
|
return Setting.protocol + "://" + Setting.host_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def secdomain_with_protocol secdomain
|
||||||
|
return Setting.protocol + "://" + secdomain + ".trustie.net"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
#获取回复的所有父节点
|
#获取回复的所有父节点
|
||||||
def get_reply_parents parents_rely, comment
|
def get_reply_parents parents_rely, comment
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
class ApplyResource < ActiveRecord::Base
|
||||||
|
# status:1. 等待回复 2.审核通过 3.已拒绝
|
||||||
|
attr_accessible :attachment_id, :status, :user_id, :container_type, :container_id, :apply_user_id, :content
|
||||||
|
belongs_to :user
|
||||||
|
belongs_to :attachment
|
||||||
|
has_many :course_messages, :class_name => 'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||||
|
after_create :act_as_apply_resource_message
|
||||||
|
|
||||||
|
def act_as_apply_resource_message
|
||||||
|
self.course_messages << CourseMessage.new(:user_id => self.apply_user_id, :course_id => -1, :viewed => false, :status => 0, )
|
||||||
|
# REDO:发送邮件
|
||||||
|
# Mailer.run.apply_for_resource_request(self.container_id, User.current)
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_attachment attachment_id
|
||||||
|
Attachment.find(attachment_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -35,6 +35,7 @@ class Attachment < ActiveRecord::Base
|
||||||
# end
|
# end
|
||||||
include UserScoreHelper
|
include UserScoreHelper
|
||||||
has_many :attachment_histories
|
has_many :attachment_histories
|
||||||
|
has_many :apply_resources, :dependent => :destroy
|
||||||
|
|
||||||
validates :filename, presence: true, length: {maximum: 254}
|
validates :filename, presence: true, length: {maximum: 254}
|
||||||
validates :author, presence: true
|
validates :author, presence: true
|
||||||
|
@ -139,6 +140,11 @@ class Attachment < ActiveRecord::Base
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_apply_resource_status attachment_id, author_id
|
||||||
|
ApplyResource.where("attachment_id =? and apply_user_id =?", attachment_id, author_id).first.try(:status)
|
||||||
|
end
|
||||||
|
|
||||||
# add by nwb
|
# add by nwb
|
||||||
# 公开的项目id列表
|
# 公开的项目id列表
|
||||||
def self.public_project_id
|
def self.public_project_id
|
||||||
|
@ -536,6 +542,11 @@ class Attachment < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 获取资源申请状态
|
||||||
|
def get_status_by_attach user_id
|
||||||
|
ApplyResource.where("user_id =? and attachment_id =?", user_id, self.id).first.try(:status)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Physically deletes the file from the file system
|
# Physically deletes the file from the file system
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
class CourseMessage < ActiveRecord::Base
|
class CourseMessage < ActiveRecord::Base
|
||||||
# status说明: status在课程不同的类型,区分不同的功能 status = 9 作品的提交记录
|
# status说明: status在课程不同的类型,区分不同的功能 status = 9 作品的提交记录
|
||||||
|
# ApplyResource status:
|
||||||
|
# 0: 发送申请 1:回复允许申请 2:拒绝申请消息
|
||||||
# HomeworkCommon:status:
|
# HomeworkCommon:status:
|
||||||
# nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败; 5:申请引用作业, 6:申请结果
|
# nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败; 5:申请引用作业, 6:申请结果
|
||||||
# apply_user_id: 申请者的用户id
|
# apply_user_id: 申请者的用户id
|
||||||
|
|
|
@ -174,7 +174,7 @@ class News < ActiveRecord::Base
|
||||||
if count == 0
|
if count == 0
|
||||||
ws = WechatService.new
|
ws = WechatService.new
|
||||||
content = strip_html self.author.try(:realname) + " 发布了通知:" + self.title.html_safe, 200
|
content = strip_html self.author.try(:realname) + " 发布了通知:" + self.title.html_safe, 200
|
||||||
ws.message_update_template m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.author.try(:realname) + " 发布了通知:" + content, format_time(self.created_on)
|
ws.message_update_template m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", content, format_time(self.created_on)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,4 +30,8 @@ class Organization < ActiveRecord::Base
|
||||||
def allow_set_teachers
|
def allow_set_teachers
|
||||||
self.allow_teacher.to_i == 1 ? true : false
|
self.allow_teacher.to_i == 1 ? true : false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def secdomain_name
|
||||||
|
Secdomain.where("sub_type=2 and pid=?", self.id).first.try(:subname)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
require 'base64'
|
||||||
|
|
||||||
class Sso < ActiveRecord::Base
|
class Sso < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
attr_accessible :email, :name, :openid, :password, :school, :sex, :user, :user_id
|
attr_accessible :email, :name, :openid, :password, :school, :sex, :user, :user_id
|
||||||
|
|
|
@ -109,6 +109,7 @@ class User < Principal
|
||||||
has_many :student_works_scores, :dependent => :destroy
|
has_many :student_works_scores, :dependent => :destroy
|
||||||
has_many :student_work_projects, :dependent => :destroy
|
has_many :student_work_projects, :dependent => :destroy
|
||||||
has_many :apply_homeworks, :dependent => :destroy
|
has_many :apply_homeworks, :dependent => :destroy
|
||||||
|
has_many :apply_resources, :dependent => :destroy
|
||||||
#end
|
#end
|
||||||
|
|
||||||
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
|
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
|
||||||
|
@ -1103,9 +1104,6 @@ class User < Principal
|
||||||
# super
|
# super
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_param
|
|
||||||
login
|
|
||||||
end
|
|
||||||
# Salts all existing unsalted passwords
|
# Salts all existing unsalted passwords
|
||||||
# It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password))
|
# It changes password storage scheme from SHA1(password) to SHA1(salt + SHA1(password))
|
||||||
# This method is used in the SaltPasswords migration and is to be kept as is
|
# This method is used in the SaltPasswords migration and is to be kept as is
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
<th style="width: 100px;">
|
<th style="width: 100px;">
|
||||||
测试完成时间
|
测试完成时间
|
||||||
</th>
|
</th>
|
||||||
<th style="width: 60px;">
|
<th style="width: 80px;">
|
||||||
<span style="float:left; margin-left:20px;">答题状态</span>
|
<span style="float:left; margin-left:30px;">答题状态</span>
|
||||||
</th>
|
</th>
|
||||||
<th style="width: 50px;">
|
<th style="width: 50px;">
|
||||||
<span style="float:left; margin-left:20px;">耗时</span>
|
<span style="float:left; margin-left:20px;">耗时</span>
|
||||||
|
@ -76,6 +76,10 @@
|
||||||
<%= "代码超时" %>
|
<%= "代码超时" %>
|
||||||
<% elsif test.status == -3 %>
|
<% elsif test.status == -3 %>
|
||||||
<%= "请求超时" %>
|
<%= "请求超时" %>
|
||||||
|
<% elsif test.status == -4 %>
|
||||||
|
<%= "judge代码出错!" %>
|
||||||
|
<% elsif test.status == -5 %>
|
||||||
|
<%= "trustie代码出错!" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= "答题错误" %>
|
<%= "答题错误" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -122,11 +122,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=@article.id %>">
|
<span id="praise_count_<%=@article.id %>">
|
||||||
<% if @article.author == User.current %>
|
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(@article) > 0 ? "(#{get_praise_num(@article)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%>
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
|
@ -141,6 +137,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
|
@ -161,12 +158,8 @@
|
||||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
</span>
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
|
||||||
<div class="fr mr10" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<div class="fr mr10" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_reply),
|
l(:button_reply),
|
||||||
|
@ -215,5 +208,6 @@
|
||||||
var postContent = $("#message_description_<%= @article.id %>").html();
|
var postContent = $("#message_description_<%= @article.id %>").html();
|
||||||
postContent = postContent.replace(/ /g," ");
|
postContent = postContent.replace(/ /g," ");
|
||||||
$("#message_description_<%= @article.id %>").html(postContent);
|
$("#message_description_<%= @article.id %>").html(postContent);
|
||||||
|
autoUrl('message_description_<%= @article.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
<% count=activity.children.count%>
|
<% count=activity.children.count%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li class="ml15">
|
<li class="ml15">
|
||||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
<span class="grayTxt">发布:<%= format_time(activity.created_on) %></span>
|
||||||
<span class="grayTxt">更新时间:<%= format_time(activity.updated_on) %></span>
|
<span class="grayTxt">更新:<%= format_time(activity.updated_on) %></span>
|
||||||
<p class="list-info fr grayTxt">
|
<p class="list-info fr grayTxt">
|
||||||
<span><%= count>0 ? "#{count}" :"0" %></span>
|
<span><%= count>0 ? "#{count}" :"0" %></span>
|
||||||
<span>回复</span>
|
<span>回复</span>
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
<div class="ping_disfoot f14">
|
<div class="ping_disfoot f14">
|
||||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||||
|
|
||||||
|
<span id="reply_praise_count_<%=journal.id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
|
||||||
|
</span>
|
||||||
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
|
<% if journal.user == User.current|| User.current.admin? || (@course && User.current.allowed_to?(:as_teacher,@course)) %>
|
||||||
<%= link_to(l(:label_bid_respond_delete),
|
<%= link_to(l(:label_bid_respond_delete),
|
||||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
|
|
||||||
<div class="st_box">
|
<div class="st_box">
|
||||||
<ul class="st_box_top">
|
<ul class="st_box_top">
|
||||||
<li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li>
|
<li class="ml50" style="padding-right: 5px;"><span class="fontGrey6 fb">姓名</span></li>
|
||||||
<li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li>
|
<li class="ml10" style="padding-right: 15px;"><span class="fontGrey6 fb">学号</span></li>
|
||||||
<li style="padding-right: 55px; margin-left: 160px;"><a href="">分班</a></li>
|
<li style="padding-right: 55px; margin-left: 160px;"><span class="fontGrey6 fb">分班</span></li>
|
||||||
<li class="st_list_score ml10">
|
<li class="st_list_score ml10">
|
||||||
<%= link_to '作业积分', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :class => 'ml25'%>
|
<%= link_to '作业积分', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :class => 'ml25'%>
|
||||||
<% if @sort_type == "score" && @score_sort_by == 'desc' %>
|
<% if @sort_type == "score" && @score_sort_by == 'desc' %>
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
<a id="pic" href="javascript:" class= "st_up"></a>
|
<a id="pic" href="javascript:" class= "st_up"></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class="ml20"><a href="javascript:void(0)" >加入时间</a></li>
|
<li class="ml20"><span class="fontGrey6 fb">加入时间</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="cl"></div><!--st_box_top end-->
|
<div class="cl"></div><!--st_box_top end-->
|
||||||
|
|
||||||
|
|
|
@ -8,19 +8,19 @@
|
||||||
|
|
||||||
|
|
||||||
.tscore_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; text-align: center; padding-top:5px;}
|
.tscore_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; text-align: center; padding-top:5px;}
|
||||||
.tscore_box{ width:350px; margin:15px auto;}
|
.tscore_box{ width:370px; margin:15px auto;}
|
||||||
.tscore_box li{ height:25px;}
|
.tscore_box li{ height:25px;}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<div class="tscore_con" id="user_score">
|
<div class="tscore_con" id="user_score">
|
||||||
<h2><%= @member_score.user.name %> 历次作业积分</h2>
|
<h2><%= @member_score.user.name %> 历次作业积分</h2>
|
||||||
<ul class="tscore_box">
|
<ul class="tscore_box" style="max-height: 400px; overflow: auto;">
|
||||||
<li ><span class="c_blue02 w280">作业名称</span><span class="c_blue02 w70">得分</span></li>
|
<li ><span class="c_blue02 w280">作业名称</span><span class="c_blue02 w70">得分</span></li>
|
||||||
<% @member_score.homework_common_list.each do |homework_common| %>
|
<% @member_score.homework_common_list.each_with_index do |homework_common, index| %>
|
||||||
<li>
|
<li>
|
||||||
<span class="c_grey02 w280 hiddent">
|
<span class="c_grey02 w280 hiddent">
|
||||||
<%= homework_common.name %>
|
作业<%=index + 1 %>:<%= homework_common.name %>
|
||||||
</span>
|
</span>
|
||||||
<span class="c_red w70">
|
<span class="c_red w70">
|
||||||
<% final_score = @member_score.homework_common_score(homework_common).first%>
|
<% final_score = @member_score.homework_common_score(homework_common).first%>
|
||||||
|
|
|
@ -120,6 +120,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
|
@ -214,5 +215,6 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('message_description_<%= @article.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -17,7 +17,7 @@
|
||||||
</div>-->
|
</div>-->
|
||||||
<%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
<%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
||||||
<%# end%>
|
<%# end%>
|
||||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示测验信息 ]</a> </span>
|
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" onclick="show_or_hide_info();" style="display: none">[ 显示测验信息 ]</a> </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
</div>-->
|
</div>-->
|
||||||
<%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
<%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
||||||
<%# end%>
|
<%# end%>
|
||||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示测验信息 ]</a> </span>
|
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" onclick="show_or_hide_info();" style="display: none">[ 显示测验信息 ]</a> </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
|
|
@ -15,46 +15,23 @@
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% @exercise_users_list.each do |exercise|%>
|
<% @exercise_users_list.each_with_index do |exercise, index|%>
|
||||||
<script type="text/javascript">
|
|
||||||
$(".student_work_<%= exercise.id%>").mouseenter(function(){
|
|
||||||
$("#work_click_<%= exercise.id%>").show();
|
|
||||||
}).mouseleave(function(){
|
|
||||||
$("#work_click_<%= exercise.id%>").hide();
|
|
||||||
});
|
|
||||||
$(function(){
|
|
||||||
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
|
|
||||||
$("#show_student_result_div_<%= exercise.id%>").on('click',function() {
|
|
||||||
window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>';
|
|
||||||
});
|
|
||||||
<% else %>
|
|
||||||
$("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
|
||||||
$("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
|
||||||
$("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
|
||||||
$("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
|
||||||
<% end %>
|
|
||||||
});
|
|
||||||
/*function show_result(id) {
|
|
||||||
window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
|
|
||||||
}*/
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<tr class="hworkListRow" id="student_work_<%= exercise.id%>">
|
<tr class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||||
<td class="pl5 pr5" style="width:28px; text-align:center;">1</td>
|
<td class="pl5 pr5" style="width:28px; text-align:center;"><%=index + 1 %></td>
|
||||||
<td class="hworkPortrait pr10 float-none">
|
<td class="hworkPortrait pr10 float-none">
|
||||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %>
|
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %>
|
||||||
</td>
|
</td>
|
||||||
<td class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
|
<td class="hworkStName student_work_<%= exercise.id%>" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
|
||||||
<%=exercise.user.show_name %>
|
<%=exercise.user.show_name %>
|
||||||
</td>
|
</td>
|
||||||
<td class="hworkStID pl15 pr10 float-none" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
|
<td class="hworkStID student_work_<%= exercise.id%> pl15 pr10 float-none" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
|
||||||
<span class="hidden fl" style="width:80px;"><%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%></span>
|
<span class="hidden fl" style="width:80px;"><%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%></span>
|
||||||
</td>
|
</td>
|
||||||
<td class="hworkStID float-none" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
<td class="hworkStID student_work_<%= exercise.id%> float-none" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||||
--
|
--
|
||||||
</td>
|
</td>
|
||||||
<td width="200"> </td>
|
<td width="200"> </td>
|
||||||
<td class="hworkList130 c_grey student_work_<%= exercise.id%>">
|
<td class="hworkList130 c_grey">
|
||||||
<% if exercise.created_at%>
|
<% if exercise.created_at%>
|
||||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||||
<% if @exercise.end_time <= exercise.created_at %>
|
<% if @exercise.end_time <= exercise.created_at %>
|
||||||
|
@ -67,5 +44,29 @@
|
||||||
</td>
|
</td>
|
||||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end%>
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(".student_work_<%= exercise.id%>").mouseenter(function(){
|
||||||
|
$("#work_click_<%= exercise.id%>").show();
|
||||||
|
}).mouseleave(function(){
|
||||||
|
$("#work_click_<%= exercise.id%>").hide();
|
||||||
|
}).mouse;
|
||||||
|
$(function(){
|
||||||
|
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
|
||||||
|
$("#student_name_<%= exercise.id%>,#student_id_<%= exercise.id%>,#student_class_<%= exercise.id%>").on('click',function() {
|
||||||
|
window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>';
|
||||||
|
});
|
||||||
|
<% else %>
|
||||||
|
//$("#show_student_result_div_<%#= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
<% end %>
|
||||||
|
});
|
||||||
|
/*function show_result(id) {
|
||||||
|
window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
|
||||||
|
}*/
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<% end%>
|
||||||
</table>
|
</table>
|
|
@ -5,8 +5,14 @@
|
||||||
$("#Container").css("width","1000px");
|
$("#Container").css("width","1000px");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function show_or_hide_info(){
|
||||||
|
$("#homeworkInformation").toggle();
|
||||||
|
$("#homework_info_hidden").toggle();
|
||||||
|
$("#homework_info_show").toggle();
|
||||||
|
}
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
$("#homework_info_hidden").click(function(){
|
/*$("#homework_info_hidden").click(function(){
|
||||||
$("#homeworkInformation").hide();
|
$("#homeworkInformation").hide();
|
||||||
$("#homework_info_hidden").hide();
|
$("#homework_info_hidden").hide();
|
||||||
$("#homework_info_show").show();
|
$("#homework_info_show").show();
|
||||||
|
@ -15,7 +21,7 @@
|
||||||
$("#homework_info_show").hide();
|
$("#homework_info_show").hide();
|
||||||
$("#homeworkInformation").show();
|
$("#homeworkInformation").show();
|
||||||
$("#homework_info_hidden").show();
|
$("#homework_info_hidden").show();
|
||||||
});
|
});*/
|
||||||
|
|
||||||
if($("#homework_description").height() > 54) {
|
if($("#homework_description").height() > 54) {
|
||||||
$("#homeworkDetailShow").show();
|
$("#homeworkDetailShow").show();
|
||||||
|
@ -88,7 +94,7 @@
|
||||||
<% elsif @exercise.exercise_status == 3 %>
|
<% elsif @exercise.exercise_status == 3 %>
|
||||||
<span class="grey_homework_btn_cir ml5">已截止</span>
|
<span class="grey_homework_btn_cir ml5">已截止</span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_hidden">[ 隐藏测验信息 ]</a> </span>
|
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" onclick="show_or_hide_info();" id="homework_info_hidden">[ 隐藏测验信息 ]</a> </span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="fontGrey2 db mb5">发布者:<%= @exercise.user.show_name %></div>
|
<div class="fontGrey2 db mb5">发布者:<%= @exercise.user.show_name %></div>
|
||||||
<div class="homeworkDetail upload_img break_word list_style max_h54" id="homeworkDetail">
|
<div class="homeworkDetail upload_img break_word list_style max_h54" id="homeworkDetail">
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTitle break_word mt-4">
|
<div class="homepagePostTitle break_word">
|
||||||
<%# 如果有历史版本则提供历史版本下载 %>
|
<%# 如果有历史版本则提供历史版本下载 %>
|
||||||
<% if file.attachment_histories.count == 0 %>
|
<% if file.attachment_histories.count == 0 %>
|
||||||
<%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
|
<%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTitle break_word mt-4">
|
<div class="homepagePostTitle break_word">
|
||||||
<%# 如果有历史版本则提供历史版本下载 %>
|
<%# 如果有历史版本则提供历史版本下载 %>
|
||||||
<% if file.attachment_histories.count == 0 %>
|
<% if file.attachment_histories.count == 0 %>
|
||||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTitle break_word mt-4">
|
<div class="homepagePostTitle break_word">
|
||||||
<%# 如果有历史版本则提供历史版本下载 %>
|
<%# 如果有历史版本则提供历史版本下载 %>
|
||||||
<% if file.attachment_histories.count == 0 %>
|
<% if file.attachment_histories.count == 0 %>
|
||||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
<div style="padding-top: 10px">
|
<div style="padding-top: 10px">
|
||||||
<% if memos.any? %>
|
<% if memos.any? %>
|
||||||
<% memos.each do |topic| %>
|
<% memos.each do |topic| %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('postDetailDes_<%= topic.id %>');
|
||||||
|
autoUrl('postDetailDes_<%= topic.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<div class="postDetailRow">
|
<div class="postDetailRow">
|
||||||
<div class="postDetailPortrait">
|
<div class="postDetailPortrait">
|
||||||
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="贴吧图片" /></a>-->
|
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="贴吧图片" /></a>-->
|
||||||
|
@ -16,7 +22,7 @@
|
||||||
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10 mt20" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
|
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10 mt20" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="postDetailDes"><%= topic.content.html_safe%>
|
<div class="postDetailDes" id = "postDetailDes_<%= topic.id %>"><%= topic.content.html_safe%>
|
||||||
<!--<a href="javascript:void(0);" class="linkBlue2 underline ml8">显示全部</a>-->
|
<!--<a href="javascript:void(0);" class="linkBlue2 underline ml8">显示全部</a>-->
|
||||||
</div>
|
</div>
|
||||||
<% author = topic.last_reply.try(:author)%>
|
<% author = topic.last_reply.try(:author)%>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:is_in_course => 1,:course_id => course_id} %>
|
||||||
|
|
||||||
|
<div style="width:210px; text-align:center; margin:0 auto;">
|
||||||
|
<ul class="wlist" style=" border:none; display:inline-block; float:none; margin-top:10px;">
|
||||||
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
|
@ -1,4 +1,4 @@
|
||||||
<%= form_tag( url_for(:controller => 'courses',:action => 'homework_search',:id=>course.id),
|
<%= form_tag( homework_common_index_url_in_org(course.id),
|
||||||
:remote=>true ,:method => 'get',:class=>'resourcesSearchloadBox',:id=>'resource_search_form') do %>
|
:remote=>true ,:method => 'get',:class=>'resourcesSearchloadBox',:id=>'resource_search_form') do %>
|
||||||
<input type="text" name="search" placeholder="输入作业名称进行搜索" class="searchResource" />
|
<input type="text" name="search" placeholder="输入作业名称进行搜索" class="searchResource" />
|
||||||
<%= submit_tag '',:class=>'homepageSearchIcon',:onfocus=>'this.blur();',:style=>'border-style:none' %>
|
<%= submit_tag '',:class=>'homepageSearchIcon',:onfocus=>'this.blur();',:style=>'border-style:none' %>
|
||||||
|
|
|
@ -71,13 +71,8 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
</div><!----HomeWork end-->
|
</div><!----HomeWork end-->
|
||||||
<% end%>
|
<% end%>
|
||||||
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0,:is_in_course => 1,:course_id => @course.id} %>
|
<div id="homework_index_list">
|
||||||
|
<%= render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id} %>
|
||||||
<div style="width:210px; text-align:center; margin:0 auto;">
|
|
||||||
<ul class="wlist" style=" border:none; display:inline-block; float:none; margin-top:10px;">
|
|
||||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
|
||||||
</ul>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id} )%>");
|
/*
|
||||||
|
$("#user_show_more_homework").replaceWith("<%#= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id} )%>");*/
|
||||||
|
|
||||||
|
$("#homework_index_list").html("<%=escape_javascript(render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id}) %>");
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<%= render :partial => 'action_menu' %>
|
<%= render :partial => 'action_menu' %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if @issue.description? || @issue.attachments.any? -%>
|
<% if @issue.description? || @issue.attachments.any? -%>
|
||||||
<div class="talk_info mb10 issue_desc" style="word-break:break-all;">
|
<div class="talk_info mb10 issue_desc" id="issue_desc_<%= @issue.id %>" style="word-break:break-all;">
|
||||||
<% if @issue.description? %>
|
<% if @issue.description? %>
|
||||||
<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
|
<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
|
||||||
<%= textAreailizable @issue, :description, :attachments => @issue.attachments %>
|
<%= textAreailizable @issue, :description, :attachments => @issue.attachments %>
|
||||||
|
@ -43,4 +43,11 @@
|
||||||
<!--属性-->
|
<!--属性-->
|
||||||
<%= render :partial => 'issues/attributes_show' %>
|
<%= render :partial => 'issues/attributes_show' %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('issue_desc_<%= @issue.id %>');
|
||||||
|
autoUrl('issue_desc_<%= @issue.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -3,6 +3,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
|
autoUrl('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i + 1 %>
|
<% replies_all_i=replies_all_i + 1 %>
|
||||||
|
@ -11,7 +12,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
scrollPic.speed = 10; //移动速度(单位毫秒,越小越快)
|
scrollPic.speed = 10; //移动速度(单位毫秒,越小越快)
|
||||||
scrollPic.space = 10; //每次移动像素(单位px,越大越快)
|
scrollPic.space = 10; //每次移动像素(单位px,越大越快)
|
||||||
scrollPic.autoPlay = true; //自动播放
|
scrollPic.autoPlay = false; //自动播放
|
||||||
scrollPic.autoPlayTime = 3; //自动播放间隔时间(秒)
|
scrollPic.autoPlayTime = 3; //自动播放间隔时间(秒)
|
||||||
|
|
||||||
scrollPic.initialize(); //初始化
|
scrollPic.initialize(); //初始化
|
||||||
|
@ -60,13 +60,12 @@
|
||||||
<!--内容开始-->
|
<!--内容开始-->
|
||||||
<header>
|
<header>
|
||||||
<div class="sn-header">
|
<div class="sn-header">
|
||||||
<%= render :partial => 'organizations/org_logined_header' %>
|
|
||||||
<div class="sn-row sn-bg-white">
|
<div class="sn-row sn-bg-white">
|
||||||
<div class="sn-logo">
|
<div class="sn-logo">
|
||||||
<% if @org_logo_attchment.blank? %>
|
<% if @org_logo_attchment.blank? || !User.current.logged? %>
|
||||||
<img src="/images/org_new_style/logo.jpg" width="367" height="63" class="sn-mt13" alt=""/>
|
<img src="/images/org_new_style/logo.jpg" width="367" height="63" class="sn-mt13 sn-fl" alt=""/>
|
||||||
<% else %>
|
<% else %>
|
||||||
<img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" width="367" height="63" class="sn-mt13" alt="">
|
<img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" width="367" height="63" class="sn-mt13 sn-fl" alt="">
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if User.current.admin_of_org?(@organization) %>
|
<% if User.current.admin_of_org?(@organization) %>
|
||||||
<a href="#" class="sn-logo-add" title="点击替换LOGO" onclick="org_new_files_upload();"></a>
|
<a href="#" class="sn-logo-add" title="点击替换LOGO" onclick="org_new_files_upload();"></a>
|
||||||
|
@ -74,6 +73,7 @@
|
||||||
<!--<a href="javascript:void(0);" class="sn-search-button sn-mt28"></a>-->
|
<!--<a href="javascript:void(0);" class="sn-search-button sn-mt28"></a>-->
|
||||||
|
|
||||||
<!--<input type="text" class="sn-search-input sn-mt28" placeholder="搜索" />-->
|
<!--<input type="text" class="sn-search-input sn-mt28" placeholder="搜索" />-->
|
||||||
|
<%= render :partial => 'organizations/org_logined_header' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--导航-->
|
<!--导航-->
|
||||||
|
|
|
@ -94,12 +94,12 @@
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
|
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
|
||||||
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= reply.content.html_safe%></div>
|
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= reply.content.html_safe%></div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
$("#activity_description_<%= reply.id %> p,#activity_description__<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
|
$("#activity_description_<%= reply.id %> p,#activity_description_<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
|
||||||
var postContent = $(this).html();
|
var postContent = $(this).html();
|
||||||
postContent = postContent.replace(/ /g," ");
|
postContent = postContent.replace(/ /g," ");
|
||||||
postContent= postContent.replace(/ {2}/g," ");
|
postContent= postContent.replace(/ {2}/g," ");
|
||||||
|
@ -107,6 +107,7 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('activity_description_<%= reply.id %>');
|
||||||
description_show_hide(<%= reply.id %>);
|
description_show_hide(<%= reply.id %>);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -147,6 +148,7 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('activity_description_<%= @memo.id %>');
|
||||||
description_show_hide(<%= @memo.id %>);
|
description_show_hide(<%= @memo.id %>);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -95,11 +95,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= @reply_count>0 ? "(#{@reply_count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= @reply_count>0 ? "(#{@reply_count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=@topic.id %>">
|
<span id="praise_count_<%=@topic.id %>">
|
||||||
<% if @topic.author == User.current %>
|
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(@topic) > 0 ? "(#{get_praise_num(@topic)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@topic, :user_activity_id=>@topic.id,:type=>"activity"}%>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@topic, :user_activity_id=>@topic.id,:type=>"activity"}%>
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -109,6 +105,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
|
@ -130,11 +127,7 @@
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr newsGrey" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_reply),
|
l(:button_reply),
|
||||||
|
@ -188,5 +181,6 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('message_description_<%= @topic.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -138,6 +138,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
|
@ -210,5 +211,6 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('message_description_<%= @topic.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -151,11 +151,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= @reply_count>0 ? "(#{@reply_count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= @reply_count>0 ? "(#{@reply_count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=@topic.id %>">
|
<span id="praise_count_<%=@topic.id %>">
|
||||||
<% if @topic.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@topic, :user_activity_id=>@topic.id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(@topic) > 0 ? "(#{get_praise_num(@topic)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@topic, :user_activity_id=>@topic.id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -165,6 +161,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
|
@ -186,11 +183,7 @@
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr newsGrey" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_reply),
|
l(:button_reply),
|
||||||
|
@ -245,5 +238,6 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('message_description_<%= @topic.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -101,11 +101,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= @comments.count>0 ? "(#{@comments.count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= @comments.count>0 ? "(#{@comments.count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=@news.id %>">
|
<span id="praise_count_<%=@news.id %>">
|
||||||
<% if @news.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@news, :user_activity_id=>@news.id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(@news) > 0 ? "(#{get_praise_num(@news)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@news, :user_activity_id=>@news.id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -115,6 +111,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
|
@ -136,11 +133,7 @@
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr newsGrey" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
<%= link_to_if_authorized_course(
|
<%= link_to_if_authorized_course(
|
||||||
l(:button_delete),
|
l(:button_delete),
|
||||||
|
@ -210,5 +203,6 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('message_description_<%= @news.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -97,6 +97,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
|
@ -185,5 +186,6 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('message_description_<%= @news.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -107,6 +107,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
|
@ -195,5 +196,6 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('message_description_<%= @news.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//location.reload();
|
//location.reload();
|
||||||
<% if params[:detail_page] %>
|
<% if params[:detail_page] %>
|
||||||
window.location.href = '<%= organization_org_document_comments_path(:organization_id => @org_document_comment.root.organization_id)%>';
|
window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @sub_domain.id)%>';
|
||||||
<% else %>
|
<% else %>
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
<% end %>
|
<% end %>
|
|
@ -71,11 +71,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=@document.id %>">
|
<span id="praise_count_<%=@document.id %>">
|
||||||
<% if @document.creator_id.to_i == User.current.id.to_i %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@document, :user_activity_id=>@document.id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(@document) > 0 ? "(#{get_praise_num(@document)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@document, :user_activity_id=>@document.id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -84,6 +80,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% user = User.find(reply.creator_id) %>
|
<% user = User.find(reply.creator_id) %>
|
||||||
|
@ -99,11 +96,7 @@
|
||||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||||
<%= format_time(reply.created_at) %>
|
<%= format_time(reply.created_at) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.creator_id.to_i == User.current.id.to_i %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
|
@ -158,6 +151,7 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('intro_content_<%= @document.id %>');
|
||||||
});
|
});
|
||||||
function expand_reply(container, btnid) {
|
function expand_reply(container, btnid) {
|
||||||
var target = $(container);
|
var target = $(container);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:teacher).try(:realname) == ' ' %>
|
<% if activity.try(:teacher).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:teacher), user_url_in_org(activity.tea_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:teacher), user_url_in_org(activity.tea_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -39,4 +39,4 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
user_card_show_hide();
|
user_card_show_hide();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:user), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:user), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -210,9 +210,9 @@
|
||||||
|
|
||||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_url_in_org(project.id),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_url_in_org(project.id),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% com_time = project.project_score.commit_time %>
|
<% com_time = project.project_score.commit_time %>
|
||||||
<% time=project.updated_on %>
|
<% time=project.updated_on %>
|
||||||
|
@ -290,12 +290,8 @@
|
||||||
<span class="reply_iconup" > ︿</span>
|
<span class="reply_iconup" > ︿</span>
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.user == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
</span>
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
<%if count>3 %>
|
<%if count>3 %>
|
||||||
|
@ -315,6 +311,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i = replies_all_i + 1 %>
|
<% replies_all_i = replies_all_i + 1 %>
|
||||||
|
@ -358,11 +355,7 @@
|
||||||
<div class="reply">
|
<div class="reply">
|
||||||
<span class="reply-right">
|
<span class="reply-right">
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
<% if comment.user == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
<span style="position: relative" class="fr mr20">
|
<span style="position: relative" class="fr mr20">
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -74,11 +74,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||||
|
@ -100,6 +96,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
|
autoUrl('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i+1 %>
|
<% replies_all_i=replies_all_i+1 %>
|
||||||
|
@ -108,7 +105,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -116,11 +113,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -44,12 +44,8 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
</span>
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
<%if count>3 %>
|
<%if count>3 %>
|
||||||
|
@ -69,6 +65,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i = replies_all_i + 1 %>
|
<% replies_all_i = replies_all_i + 1 %>
|
||||||
|
@ -77,7 +74,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -85,11 +82,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(comment.created_on) %>
|
<%= format_time(comment.created_on) %>
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
<% if comment.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:user), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:user), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -1,37 +1,31 @@
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<div class="sn-row sn-bg-grey">
|
<div class="navHomepageProfile" id="navHomepageProfile">
|
||||||
<div class="sn-login2">
|
<ul>
|
||||||
<div class="navHomepageProfile sn-mt4" id="navHomepageProfile">
|
<li class="homepageProfileMenuIcon fr sn-mt23" id="homepageProfileMenuIcon">
|
||||||
<ul>
|
<%= link_to "<div class='user-img' id='user_avatar'>#{image_tag(url_to_avatar(User.current), :class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe, user_activities_path(User.current.id) %>
|
||||||
<li class="homepageProfileMenuIcon fr" id="homepageProfileMenuIcon">
|
<%#= link_to image_tag(url_to_avatar(User.current)), user_url_in_org(User.current.id), :alt => '用户头像', :target => '_blank', :class => "fr user-img" %>
|
||||||
<%= link_to "<div class='mt5 mb8 user-img' id='user_avatar'>#{image_tag(url_to_avatar(User.current), :class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe, user_activities_path(User.current.id) %>
|
<ul class="topnav_login_list none sn-f12" id="topnav_login_list" style="text-align:left;">
|
||||||
<%#= link_to image_tag(url_to_avatar(User.current)), user_url_in_org(User.current.id), :alt => '用户头像', :target => '_blank', :class => "fr user-img" %>
|
<li>
|
||||||
<ul class="topnav_login_list none sn-f12" id="topnav_login_list" style="text-align:left;">
|
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
||||||
<li>
|
</li>
|
||||||
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
<li>
|
||||||
</li>
|
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
||||||
<li>
|
</li>
|
||||||
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
<li>
|
||||||
</li>
|
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
||||||
<li>
|
</li>
|
||||||
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||||
</li>
|
<li>
|
||||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
<%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%>
|
||||||
<li>
|
|
||||||
<%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</li>
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="sn-row sn-bg-grey">
|
<div class="sn-fr">
|
||||||
<div class="sn-login">
|
<a href="<%= signin_url_without_domain %>" class="sn-link-blue">登录</a> |
|
||||||
<a href="<%= signin_url_without_domain %>" class="sn-link-blue">登录</a> |
|
<a href="<%= register_url_without_domain %>" class="sn-link-blue">注册</a>
|
||||||
<a href="<%= register_url_without_domain %>" class="sn-link-blue">注册</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -55,11 +55,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
|
@ -80,6 +76,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
|
autoUrl('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i + 1 %>
|
<% replies_all_i=replies_all_i + 1 %>
|
||||||
|
@ -88,7 +85,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -96,11 +93,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.user == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
<% if is_default_field?(field) %>
|
<% if is_default_field?(field) %>
|
||||||
<% case field.name %>
|
<% case field.name %>
|
||||||
<% when 'course' %>
|
<% when 'course' %>
|
||||||
|
@ -26,7 +25,7 @@
|
||||||
<div class="sn-news-txt">
|
<div class="sn-news-txt">
|
||||||
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
|
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sn-read-more"><%=link_to "查看全文>>", activity.name.to_s, student_work_index_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
<div class="sn-read-more"><%=link_to "查看全文>>", student_work_index_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
||||||
</div>
|
</div>
|
||||||
<% elsif act.org_act_type == "Message" %>
|
<% elsif act.org_act_type == "Message" %>
|
||||||
<% activity = Message.find(act.org_act_id) %>
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
@ -44,7 +43,7 @@
|
||||||
<div class="sn-news-txt">
|
<div class="sn-news-txt">
|
||||||
<div class="sn-news-wrap"><%= activity.content.to_s.html_safe %></div>
|
<div class="sn-news-wrap"><%= activity.content.to_s.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sn-read-more"><%=link_to "查看全文>>", activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
<div class="sn-read-more"><%=link_to "查看全文>>", board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
||||||
</div>
|
</div>
|
||||||
<% elsif act.org_act_type == "News" %>
|
<% elsif act.org_act_type == "News" %>
|
||||||
<% activity = News.find(act.org_act_id) %>
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
@ -63,7 +62,7 @@
|
||||||
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
|
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sn-read-more"><%=link_to "查看全文>>", activity.title.to_s, news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
<div class="sn-read-more"><%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
||||||
</div>
|
</div>
|
||||||
<% elsif act.org_act_type == "Poll" %>
|
<% elsif act.org_act_type == "Poll" %>
|
||||||
<% activity = Poll.find(act.org_act_id) %>
|
<% activity = Poll.find(act.org_act_id) %>
|
||||||
|
@ -88,7 +87,7 @@
|
||||||
<div class="sn-news-txt">
|
<div class="sn-news-txt">
|
||||||
<div class="sn-news-wrap"><%= activity.polls_description.to_s.html_safe %></div>
|
<div class="sn-news-wrap"><%= activity.polls_description.to_s.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sn-read-more"><%=link_to "查看全文>>", poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
<div class="sn-read-more"><%=link_to "查看全文>>", Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -119,7 +118,7 @@
|
||||||
<div class="sn-news-txt">
|
<div class="sn-news-txt">
|
||||||
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
|
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sn-read-more"><%=link_to "查看全文>>", activity.subject.to_s, issue_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
<div class="sn-read-more"><%=link_to "查看全文>>", issue_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
||||||
</div>
|
</div>
|
||||||
<% elsif act.org_act_type == "Message" %>
|
<% elsif act.org_act_type == "Message" %>
|
||||||
<% activity = Message.find(act.org_act_id) %>
|
<% activity = Message.find(act.org_act_id) %>
|
||||||
|
@ -137,7 +136,7 @@
|
||||||
<div class="sn-news-txt">
|
<div class="sn-news-txt">
|
||||||
<div class="sn-news-wrap"><%= activity.content.to_s.html_safe %></div>
|
<div class="sn-news-wrap"><%= activity.content.to_s.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sn-read-more"><%=link_to "查看全文>>", activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
<div class="sn-read-more"><%=link_to "查看全文>>", board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
||||||
</div>
|
</div>
|
||||||
<% elsif act.org_act_type == "News" %>
|
<% elsif act.org_act_type == "News" %>
|
||||||
<% activity = News.find(act.org_act_id) %>
|
<% activity = News.find(act.org_act_id) %>
|
||||||
|
@ -217,7 +216,7 @@
|
||||||
<div class="sn-news-txt">
|
<div class="sn-news-txt">
|
||||||
<div class="sn-news-wrap"><%= content.to_s.html_safe %></div>
|
<div class="sn-news-wrap"><%= content.to_s.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sn-read-more"><%=link_to "查看全文>>", message.parent_id.nil? ? message.subject.to_s.html_safe : message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
<div class="sn-read-more"><%=link_to "查看全文>>", board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="sn-news-bigbox fl">
|
<div class="sn-news-bigbox fl">
|
||||||
|
@ -239,9 +238,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="sn-read-more">
|
<div class="sn-read-more">
|
||||||
<% if message.parent_id.nil? %>
|
<% if message.parent_id.nil? %>
|
||||||
<%=link_to "查看全文>>", message.subject.to_s.html_safe, board_message_path(message.board,message), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
|
<%=link_to "查看全文>>", board_message_path(message.board,message), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%=link_to "查看全文>>", message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
|
<%=link_to "查看全文>>", board_message_path(message.board,activity), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -263,7 +262,7 @@
|
||||||
<div class="sn-news-txt">
|
<div class="sn-news-txt">
|
||||||
<div class="sn-news-wrap"><%= news.description.to_s.html_safe %></div>
|
<div class="sn-news-wrap"><%= news.description.to_s.html_safe %></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sn-read-more"><%=link_to "查看全文>>", news.title.to_s, news_path(news), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
<div class="sn-read-more"><%=link_to "查看全文>>", news_path(news), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -84,11 +84,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<%if count>3 %>
|
<%if count>3 %>
|
||||||
|
@ -105,6 +101,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
|
autoUrl('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i+1 %>
|
<% replies_all_i=replies_all_i+1 %>
|
||||||
|
@ -113,7 +110,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -121,11 +118,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -64,11 +64,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%= user_activity_id %>">
|
<span id="praise_count_<%= user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
|
@ -89,6 +85,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i = replies_all_i + 1 %>
|
<% replies_all_i = replies_all_i + 1 %>
|
||||||
|
@ -97,7 +94,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -105,11 +102,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(comment.created_on) %>
|
<%= format_time(comment.created_on) %>
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
<% if comment.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if user.try(:realname) == ' ' %>
|
<% if user.try(:realname) == ' ' %>
|
||||||
<%= link_to user, user_url_in_org(user.id), :class => "newsBlue mr15" %>
|
<%= link_to user, user_url_in_org(user.id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -41,4 +41,4 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
user_card_show_hide();
|
user_card_show_hide();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -57,11 +57,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||||
|
@ -79,6 +75,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
|
autoUrl('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i+1 %>
|
<% replies_all_i=replies_all_i+1 %>
|
||||||
|
@ -87,7 +84,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -95,11 +92,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('intro_content_<%= document.id %>');
|
||||||
function expand_reply(container, btnid) {
|
function expand_reply(container, btnid) {
|
||||||
var target = $(container);
|
var target = $(container);
|
||||||
var btn = $(btnid);
|
var btn = $(btnid);
|
||||||
|
|
|
@ -69,11 +69,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=document.id %>">
|
<span id="praise_count_<%=document.id %>">
|
||||||
<% if document.creator_id.to_i == User.current.id.to_i %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "(#{get_praise_num(document)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<% if count > 3 %>
|
<% if count > 3 %>
|
||||||
|
@ -88,6 +84,12 @@
|
||||||
<ul>
|
<ul>
|
||||||
<% reply_id = 0 %>
|
<% reply_id = 0 %>
|
||||||
<% comments_for_doc.each do |comment| %>
|
<% comments_for_doc.each do |comment| %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<% reply_id += 1 %>
|
<% reply_id += 1 %>
|
||||||
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
|
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
|
||||||
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
|
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
|
||||||
|
@ -96,15 +98,11 @@
|
||||||
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
|
||||||
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
|
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
<% if comment.creator_id.to_i == User.current.id.to_i %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<% unless comment.content.blank? %>
|
<% unless comment.content.blank? %>
|
||||||
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
|
<div class="homepagePostReplyContent" id="reply_content_<%= comment.id %>"><%= comment.content.html_safe %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -109,9 +109,14 @@
|
||||||
<div class="fr orgMemContainer">
|
<div class="fr orgMemContainer">
|
||||||
<div class="orgMemberAdd">
|
<div class="orgMemberAdd">
|
||||||
<p class="fontBlue fb mb5">添加成员</p>
|
<p class="fontBlue fb mb5">添加成员</p>
|
||||||
<%= form_tag url_for(:controller => 'org_member',:action => 'create',:org=>@organization),:id=>'org_member_add_form',:remote=>true do |f|%>
|
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%>
|
||||||
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
|
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
|
||||||
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
<%# if @organization.secdomain_name.nil? %>
|
||||||
|
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||||
|
<%# else %>
|
||||||
|
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||||
|
<%# end %>
|
||||||
|
|
||||||
<div id="principals_for_new_member">
|
<div id="principals_for_new_member">
|
||||||
<%= find_user_not_in_current_org_by_name(@project) %>
|
<%= find_user_not_in_current_org_by_name(@project) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,8 +9,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="resources mt10">
|
<div class="resources mt10">
|
||||||
<div class="function-row" id="org_teacher_search">
|
<div class="function-row" id="org_teacher_search">
|
||||||
<%= form_tag( url_for(:controller => 'organizations', :action => 'teachers', :type => @type),
|
<%= form_tag(url_for(:controller => 'organizations', :action => 'teachers', :type => @type), :remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
||||||
:remote => true , :method => 'get', :id => 'resource_search_form') do %>
|
|
||||||
<input type="text" name="search" placeholder="输入教师名进行搜索" class="teacher-list-search fl" />
|
<input type="text" name="search" placeholder="输入教师名进行搜索" class="teacher-list-search fl" />
|
||||||
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %>
|
<%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %>
|
||||||
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
|
<!--<a href="javascript:void(0);" onclick='this.parent.submit();return false;' class="searchIcon"></a>-->
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="ping_disfoot f14">
|
<div class="ping_disfoot f14">
|
||||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||||
|
<span id="reply_praise_count_<%=journal.id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
|
||||||
|
</span>
|
||||||
<% if journal.user == User.current|| User.current.admin? %>
|
<% if journal.user == User.current|| User.current.admin? %>
|
||||||
<%= link_to(l(:label_bid_respond_delete),
|
<%= link_to(l(:label_bid_respond_delete),
|
||||||
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
|
||||||
|
@ -26,7 +29,6 @@
|
||||||
<%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %>
|
<%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
<% ids = 'project_respond_form_'+ journal.id.to_s%>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if user.try(:realname) == ' ' %>
|
<% if user.try(:realname) == ' ' %>
|
||||||
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
|
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -41,4 +41,4 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
user_card_show_hide();
|
user_card_show_hide();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -44,11 +44,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
|
@ -69,6 +65,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i = replies_all_i + 1 %>
|
<% replies_all_i = replies_all_i + 1 %>
|
||||||
|
@ -77,7 +74,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -85,11 +82,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(comment.created_on) %>
|
<%= format_time(comment.created_on) %>
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
<% if comment.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
@ -125,4 +118,4 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
user_card_show_hide();
|
user_card_show_hide();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
|
<%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
|
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
|
||||||
<!--<a href="javascript:void(0);" class="btn_zipdown fr" onclick="">ZIP下载</a>-->
|
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="repository_con" style="line-height:1.9;">
|
<div class="repository_con" style="line-height:1.9;">
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
||||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||||
<th class="hworkList50"> </th>
|
<th class="hworkList50"> </th>
|
||||||
<th class="hworkList260" style="text-align:left;">作品名称</th>
|
|
||||||
<% if @homework.homework_type != 3 %>
|
<% if @homework.homework_type != 3 %>
|
||||||
|
<th class="hworkList260" style="text-align:left;">作品名称</th>
|
||||||
<th class="hworkList80">
|
<th class="hworkList80">
|
||||||
<span class="HomeworkStuTitle f14 fb fl">姓名</span>
|
<span class="HomeworkStuTitle f14 fb fl">姓名</span>
|
||||||
</th>
|
</th>
|
||||||
|
@ -11,9 +11,12 @@
|
||||||
<span class="HomeworkStuTitle f14 fb fl">学号</span>
|
<span class="HomeworkStuTitle f14 fb fl">学号</span>
|
||||||
</th>
|
</th>
|
||||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||||
|
<th class="hworkList260" style="text-align:left;">作品名称</th>
|
||||||
<th class="hworkList160">
|
<th class="hworkList160">
|
||||||
<span class="HomeworkStuTitle f14 fb fl">关联项目</span>
|
<span class="HomeworkStuTitle f14 fb fl">关联项目</span>
|
||||||
</th>
|
</th>
|
||||||
|
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||||
|
<th class="hworkList420" style="text-align:left;">作品名称</th>
|
||||||
<% end %>
|
<% end %>
|
||||||
<th class="hworkList130 pl10">
|
<th class="hworkList130 pl10">
|
||||||
时间
|
时间
|
||||||
|
|
|
@ -1,25 +1,28 @@
|
||||||
<table class="hwork-table-wrap" id="homework_table" onmouseenter="resizeable_table(2,4,11,11)">
|
<table class="hwork-table-wrap">
|
||||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
||||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||||
<th class="hworkList50"> </th>
|
<th class="hworkList50"> </th>
|
||||||
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pr10 hide-text' : 'hworkList130 pr10 hide-text'%>" style="text-align:left;">作品名称</th>
|
|
||||||
<% if @homework.homework_type != 3 %>
|
<% if @homework.homework_type != 3 %>
|
||||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pr10 hide-text">
|
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pr10' : 'hworkList130 pr10'%>" style="text-align:left;">作品名称</th>
|
||||||
|
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pr10">
|
||||||
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,:remote => true%>
|
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,:remote => true%>
|
||||||
<% if @show_all && @order == "lastname"%>
|
<% if @show_all && @order == "lastname"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</th>
|
</th>
|
||||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pr10 hide-text">
|
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pr10">
|
||||||
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,:remote => true%>
|
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,:remote => true%>
|
||||||
<% if @show_all && @order == "student_id"%>
|
<% if @show_all && @order == "student_id"%>
|
||||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</th>
|
</th>
|
||||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList210' : 'hworkList160'%>">
|
<th class="hworkList130 pr10" style="text-align:left;">作品名称</th>
|
||||||
|
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList220' : 'hworkList160'%>">
|
||||||
<span class="c_dark f14 fb">关联项目</span>
|
<span class="c_dark f14 fb">关联项目</span>
|
||||||
</th>
|
</th>
|
||||||
|
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||||
|
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList340' : 'hworkList290' %> pr10" style="text-align:left;">作品名称</th>
|
||||||
<% end %>
|
<% end %>
|
||||||
<th class="hworkList130">
|
<th class="hworkList130">
|
||||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||||
|
|
|
@ -5,20 +5,26 @@
|
||||||
<td class="hworkPortrait pr10 float-none">
|
<td class="hworkPortrait pr10 float-none">
|
||||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||||
</td>
|
</td>
|
||||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%= @homework.homework_type == 2 ? '' : 'width130'%>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
<% if @homework.homework_type != 3 %>
|
||||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%= @homework.homework_type == 2 ? '' : 'width130'%>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||||
<div>
|
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||||
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
<div>
|
||||||
</div>
|
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||||
</td>
|
</div>
|
||||||
<% if @homework.homework_type != 3 %>
|
</td>
|
||||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10 student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||||
<%= student_work.user.show_name%>
|
<%= student_work.user.show_name%>
|
||||||
</td>
|
</td>
|
||||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||||
<span style="width:80px;" class="hidden fl"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
<span style="width:80px;" class="hidden fl"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
||||||
</td>
|
</td>
|
||||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||||
|
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||||
|
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||||
|
<div>
|
||||||
|
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称">
|
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称">
|
||||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||||
|
@ -28,7 +34,14 @@
|
||||||
<%= student_work.project.name %>
|
<%= student_work.project.name %>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||||
|
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width340' : 'width290' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||||
|
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||||
|
<div>
|
||||||
|
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<% end %>
|
||||||
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||||
<% if student_work.created_at && @homework.end_time%>
|
<% if student_work.created_at && @homework.end_time%>
|
||||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||||
<td class="hworkPortrait pr10 float-none">
|
<td class="hworkPortrait pr10 float-none">
|
||||||
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %>
|
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %>
|
||||||
</td>
|
|
||||||
<td class="hworkName pr10 w250 float-none student_work_<%= student_work.id%>">
|
|
||||||
<div>
|
|
||||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
|
||||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
|
||||||
</div>
|
|
||||||
</td>
|
</td>
|
||||||
<% if @homework.homework_type != 3 %>
|
<% if @homework.homework_type != 3 %>
|
||||||
|
<td class="hworkName pr10 w250 float-none student_work_<%= student_work.id%>">
|
||||||
|
<div>
|
||||||
|
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||||
|
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td class="hworkStName float-none w80 student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
<td class="hworkStName float-none w80 student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||||
<%= student_work.user.show_name%>
|
<%= student_work.user.show_name%>
|
||||||
</td>
|
</td>
|
||||||
|
@ -27,6 +27,12 @@
|
||||||
<span class="hidden fl" style="width:80px;"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
<span class="hidden fl" style="width:80px;"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
||||||
</td>
|
</td>
|
||||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||||
|
<td class="hworkName pr10 w250 float-none student_work_<%= student_work.id%>">
|
||||||
|
<div>
|
||||||
|
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||||
|
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||||
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="项目名称">
|
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="项目名称">
|
||||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||||
|
@ -36,6 +42,13 @@
|
||||||
<%= student_work.project.name %>
|
<%= student_work.project.name %>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||||
|
<td class="hworkName pr10 w410 float-none student_work_<%= student_work.id%>">
|
||||||
|
<div>
|
||||||
|
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||||
|
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else%>
|
<% else%>
|
||||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %>
|
<%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end%>
|
<% end%>
|
||||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示作业信息 ]</a> </span>
|
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" onclick="show_or_hide_info();" style="display: none">[ 显示作业信息 ]</a> </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
@ -39,6 +39,10 @@
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
|
if($("#homework_info_hidden").is(":hidden"))
|
||||||
|
{
|
||||||
|
$("#homework_info_show").show();
|
||||||
|
}
|
||||||
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id %>
|
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id %>
|
||||||
<% if @message_student_work_id %>
|
<% if @message_student_work_id %>
|
||||||
<% work = @homework.student_works.where("id =?", @message_student_work_id).first %>
|
<% work = @homework.student_works.where("id =?", @message_student_work_id).first %>
|
||||||
|
|
|
@ -34,8 +34,14 @@
|
||||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
|
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function show_or_hide_info(){
|
||||||
|
$("#homeworkInformation").toggle();
|
||||||
|
$("#homework_info_hidden").toggle();
|
||||||
|
$("#homework_info_show").toggle();
|
||||||
|
}
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
$("#homework_info_hidden").click(function(){
|
/*$("#homework_info_hidden").click(function(){
|
||||||
$("#homeworkInformation").hide();
|
$("#homeworkInformation").hide();
|
||||||
$("#homework_info_hidden").hide();
|
$("#homework_info_hidden").hide();
|
||||||
$("#homework_info_show").show();
|
$("#homework_info_show").show();
|
||||||
|
@ -44,7 +50,7 @@
|
||||||
$("#homework_info_show").hide();
|
$("#homework_info_show").hide();
|
||||||
$("#homeworkInformation").show();
|
$("#homeworkInformation").show();
|
||||||
$("#homework_info_hidden").show();
|
$("#homework_info_hidden").show();
|
||||||
});
|
});*/
|
||||||
|
|
||||||
if($("#homework_description").height() > 54) {
|
if($("#homework_description").height() > 54) {
|
||||||
$("#homeworkDetailShow").show();
|
$("#homeworkDetailShow").show();
|
||||||
|
@ -70,16 +76,21 @@
|
||||||
<ul class="menu_r">
|
<ul class="menu_r">
|
||||||
<li>
|
<li>
|
||||||
<a href="javascript:void(0);" class="parent">
|
<a href="javascript:void(0);" class="parent">
|
||||||
<% @homework_commons.each_with_index do |homework_common,index |%>
|
<% if @is_teacher %>
|
||||||
|
<% hcommons = @all_homework_commons %>
|
||||||
|
<% else %>
|
||||||
|
<% hcommons = @homework_commons %>
|
||||||
|
<% end %>
|
||||||
|
<% hcommons.each_with_index do |homework_common,index |%>
|
||||||
<% if homework_common.id == @homework.id %>
|
<% if homework_common.id == @homework.id %>
|
||||||
<%="作业 #{@homework_commons.count - index}" %>
|
<%="作业 #{hcommons.count - index}" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end%>
|
<% end%>
|
||||||
</a>
|
</a>
|
||||||
<ul>
|
<ul>
|
||||||
<% @homework_commons.each_with_index do |homework_common,index |%>
|
<% hcommons.each_with_index do |homework_common,index |%>
|
||||||
<li class="pr10">
|
<li class="pr10">
|
||||||
<%= link_to "作业#{@homework_commons.count - index}:#{homework_common.name}",student_work_index_path(:homework => homework_common.id)%>
|
<%= link_to "作业#{hcommons.count - index}:#{homework_common.name}",student_work_index_path(:homework => homework_common.id)%>
|
||||||
<%#= link_to "第#{@homework_commons.count - index}次作业",student_work_index_path(:homework => homework_common.id)%>
|
<%#= link_to "第#{@homework_commons.count - index}次作业",student_work_index_path(:homework => homework_common.id)%>
|
||||||
</li>
|
</li>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
@ -157,7 +168,7 @@
|
||||||
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<% end%>
|
<% end%>
|
||||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_hidden">[ 隐藏作业信息 ]</a> </span>
|
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" onclick="show_or_hide_info();" id="homework_info_hidden">[ 隐藏作业信息 ]</a> </span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="fontGrey2 db mb5">发布者:<%= @homework.user.show_name %></div>
|
<div class="fontGrey2 db mb5">发布者:<%= @homework.user.show_name %></div>
|
||||||
<div class="homeworkDetail upload_img break_word list_style max_h54" id="homeworkDetail">
|
<div class="homeworkDetail upload_img break_word list_style max_h54" id="homeworkDetail">
|
||||||
|
@ -171,13 +182,15 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
|
<% if @homework.end_time && @homework.publish_time %>
|
||||||
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %> 23:59</div>
|
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
|
||||||
<% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 && @homework.anonymous_comment == 0 %>
|
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %> 23:59</div>
|
||||||
<div class="fontGrey2 db fl">匿评截止时间:<%= @homework.homework_detail_manual.evaluation_end %> 23:59</div>
|
<% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 && @homework.anonymous_comment == 0 %>
|
||||||
<% end %>
|
<div class="fontGrey2 db fl">匿评截止时间:<%= @homework.homework_detail_manual.evaluation_end %> 23:59</div>
|
||||||
<% if @homework.homework_detail_manual.comment_status == 0 %>
|
<% end %>
|
||||||
<div class="fontGrey2 db fl ml10">发布时间:<%= @homework.publish_time %> 00:00</div>
|
<% if @homework.homework_detail_manual.comment_status == 0 %>
|
||||||
|
<div class="fontGrey2 db fl ml10">发布时间:<%= @homework.publish_time %> 00:00</div>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @homework.homework_detail_manual%>
|
<% if @homework.homework_detail_manual%>
|
||||||
<% if @homework.homework_detail_manual.comment_status == 1%>
|
<% if @homework.homework_detail_manual.comment_status == 1%>
|
||||||
|
|
|
@ -97,6 +97,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||||
|
autoUrl('reply_message_description_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% user = User.find(reply.creator_id) %>
|
<% user = User.find(reply.creator_id) %>
|
||||||
|
@ -164,6 +165,7 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('intro_content_<%= @document.id %>');
|
||||||
var replyCount = $(".homepagePostReplyContainer").size();
|
var replyCount = $(".homepagePostReplyContainer").size();
|
||||||
if (replyCount >3){
|
if (replyCount >3){
|
||||||
for(var i= 3; i < replyCount+1; i++){
|
for(var i= 3; i < replyCount+1; i++){
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<div>
|
||||||
|
<div class="ni_con">
|
||||||
|
<p class="mt30">
|
||||||
|
<% if state == 2 %>
|
||||||
|
请求已发送至<%= attachment.author.show_name %>,希望他同意与你分享:)
|
||||||
|
<% elsif state == 3 %>
|
||||||
|
您已发送过分享请求,请勿重复发送。
|
||||||
|
<% end %>
|
||||||
|
</p>
|
||||||
|
<div class="ni_btn">
|
||||||
|
<a href="javascript:" class="tijiao" onclick="hideModal();" style="margin-bottom: 10px; margin-left: 60px; color: #fff;" >
|
||||||
|
确 定
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,28 @@
|
||||||
|
<div>
|
||||||
|
<div class="ni_con">
|
||||||
|
<%= form_tag(apply_for_resource_user_path(:id => User.current.id, :attachment_id => attachment.id), :multipart => true, :remote => true, :name=>"apply_for_homework_form", :id=>'apply_for_homework_form') do %>
|
||||||
|
<h2>申请分享</h2>
|
||||||
|
<p style="color: #000;">
|
||||||
|
申请说明(必选):
|
||||||
|
<textarea type="text" name="content" id="apply_content" placeholder="请附言,以增加分享的成功机率。" class="apply_content mt10" style="outline:none;"></textarea>
|
||||||
|
</p>
|
||||||
|
<span class="c_red ml5 f12" style="display: none" id="apply_content_notice">为增加分享的成功机率,请务必填写申请说明。</span>
|
||||||
|
<div class="ni_btn">
|
||||||
|
<a href="javascript:" class="tijiao" onclick="submit_apply_resource();" style="margin-bottom: 20px; margin-left: 60px; color: #fff">
|
||||||
|
确 定
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="application/javascript">
|
||||||
|
var first_click_apply = true;
|
||||||
|
function submit_apply_resource(){
|
||||||
|
if($.trim($("#apply_content").val()) == ""){
|
||||||
|
$("#apply_content_notice").show();
|
||||||
|
} else if(first_click_apply) {
|
||||||
|
first_click_apply = false;
|
||||||
|
$('#apply_for_homework_form').submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,38 @@
|
||||||
|
<li class="homepageNewsPortrait fl">
|
||||||
|
<div class="navHomepageLogo fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsPubType fl">
|
||||||
|
<%= link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||||
|
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">申请引用资源:</span>
|
||||||
|
</li>
|
||||||
|
<li class="<%=(ma.apply_result == 0 || ma.apply_result.nil?) ? 'homepageHomeworkContent2' : 'homepageHomeworkContent' %> fl">
|
||||||
|
<% content = ma.course_message.content.nil? ? '' : ':'+ ma.course_message.content.to_s %>
|
||||||
|
<% show_content = ma.course_message.user.show_name + "申请引用资源\""+"#{ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)}"+"\"#{content}" %>
|
||||||
|
<% if ma.course_message.container_type == "Course" %>
|
||||||
|
<%= link_to show_content, course_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||||
|
<% elsif ma.course_message.container_type == "Project" %>
|
||||||
|
<%= link_to show_content, project_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||||
|
<% elsif ma.course_message.container_type == "OrgSubfield" %>
|
||||||
|
<%= link_to show_content, org_subfield_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||||
|
<% else %>
|
||||||
|
<a title="<%= show_content %>" class = "<%= ma.viewed == 0 ? "newsBlack" : "newsGrey "%>">
|
||||||
|
<%= show_content %>
|
||||||
|
</a>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="<%=(ma.apply_result == 0 || ma.apply_result.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">
|
||||||
|
<span id="deal_info_<%= ma.id %>">
|
||||||
|
<% if ma.apply_result == 0 || ma.apply_result.nil? %>
|
||||||
|
<%= link_to '同意', deal_with_apply_resource_user_path(User.current, :agree => 'Y', :msg_id => ma.id, :apply_user_id => ma.course_message.apply_user_id), :remote => 'true' %> |
|
||||||
|
<%= link_to '拒绝', deal_with_apply_resource_user_path(User.current, :agree => 'N', :msg_id => ma.id, :apply_user_id => ma.course_message.apply_user_id), :remote => 'true' %>
|
||||||
|
<% elsif ma.apply_result == 1 %>
|
||||||
|
您已经同意了该申请
|
||||||
|
<% elsif ma.apply_result == 2 %>
|
||||||
|
您已经拒绝了该申请
|
||||||
|
<%end %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
|
@ -0,0 +1,34 @@
|
||||||
|
<ul class="homepageNewsList fl">
|
||||||
|
<li class="homepageNewsPortrait fl">
|
||||||
|
<% owner = User.find(ma.course_message.apply_user_id) %>
|
||||||
|
<div class="navHomepageLogo fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(owner), :width => "30", :height => "30", class: "mt3"), user_path(owner) %>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsPubType fl">
|
||||||
|
<%= link_to owner.show_name, user_path(owner), :class => "newsBlue homepageNewsPublisher" %>
|
||||||
|
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:</span>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||||
|
<% link_str = ma.apply_result == 2 ?
|
||||||
|
'您申请引用资源"'+ ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename) + '"的申请已通过'
|
||||||
|
:
|
||||||
|
'您申请引用资源"'+ ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename) + '"的申请被婉拒' %>
|
||||||
|
<% if ma.course_message.container_type == "Course" %>
|
||||||
|
<%= link_to link_str, course_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||||
|
<% elsif ma.course_message.container_type == "Project" %>
|
||||||
|
<%= link_to link_str, project_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||||
|
<% elsif ma.course_message.container_type == "OrgSubfield" %>
|
||||||
|
<%= link_to link_str, org_subfield_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||||
|
<% else %>
|
||||||
|
<a title="<%= link_str %>" class = "<%= ma.viewed == 0 ? "newsBlack" : "newsGrey "%>">
|
||||||
|
<%= link_str %>
|
||||||
|
</a>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<%= link_to link_str, user_resource_user_path(User.current, :type => 2), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
|
</ul>
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -43,4 +43,4 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
user_card_show_hide();
|
user_card_show_hide();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -45,8 +45,8 @@
|
||||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %></p>
|
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml15 mt10">
|
<div class="ml15 mt10">
|
||||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
<span class="grayTxt">发帖:<%= format_time(activity.created_on) %></span>
|
||||||
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
<span class="grayTxt">更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||||
<% count=0 %>
|
<% count=0 %>
|
||||||
<% if activity.parent %>
|
<% if activity.parent %>
|
||||||
<% count=activity.parent.children.count%>
|
<% count=activity.parent.children.count%>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:teacher).try(:realname) == ' ' %>
|
<% if activity.try(:teacher).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:teacher), user_path(activity.tea_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:teacher), user_path(activity.tea_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -39,4 +39,4 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
user_card_show_hide();
|
user_card_show_hide();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -216,9 +216,9 @@
|
||||||
|
|
||||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||||
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
|
||||||
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% com_time = project.project_score.commit_time %>
|
<% com_time = project.project_score.commit_time %>
|
||||||
<% time=project.updated_on %>
|
<% time=project.updated_on %>
|
||||||
|
@ -296,11 +296,7 @@
|
||||||
<span class="reply_iconup" > ︿</span>
|
<span class="reply_iconup" > ︿</span>
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.user == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
|
@ -321,6 +317,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i = replies_all_i + 1 %>
|
<% replies_all_i = replies_all_i + 1 %>
|
||||||
|
@ -364,11 +361,7 @@
|
||||||
<div class="reply">
|
<div class="reply">
|
||||||
<span class="reply-right">
|
<span class="reply-right">
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
<% if comment.user == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
<span style="position: relative" class="fr mr20">
|
<span style="position: relative" class="fr mr20">
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -33,10 +33,12 @@
|
||||||
</div>
|
</div>
|
||||||
<% count = fetch_user_leaveWord_reply(activity).count %>
|
<% count = fetch_user_leaveWord_reply(activity).count %>
|
||||||
<div class="homepagePostReply">
|
<div class="homepagePostReply">
|
||||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
<div class="homepagePostReplyBanner">
|
||||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<div class="homepagePostReplyBannerCount">
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
回复(<%= count %>)
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"></div>
|
<div class="homepagePostReplyBannerTime"></div>
|
||||||
<%if count>3 %>
|
<%if count>3 %>
|
||||||
|
@ -56,6 +58,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i = replies_all_i + 1 %>
|
<% replies_all_i = replies_all_i + 1 %>
|
||||||
|
@ -71,6 +74,9 @@
|
||||||
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(comment.created_on) %>
|
<%= format_time(comment.created_on) %>
|
||||||
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
<%= comment.notes.html_safe %>
|
<%= comment.notes.html_safe %>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -91,11 +91,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||||
|
@ -117,6 +113,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= reply.id %>');
|
showNormalImage('reply_content_<%= reply.id %>');
|
||||||
|
autoUrl('reply_content_<%= reply.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i=replies_all_i+1 %>
|
<% replies_all_i=replies_all_i+1 %>
|
||||||
|
@ -125,7 +122,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -133,11 +130,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<span id="reply_praise_count_<%=reply.id %>">
|
<span id="reply_praise_count_<%=reply.id %>">
|
||||||
<% if reply.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -179,4 +172,4 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
user_card_show_hide();
|
user_card_show_hide();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -69,11 +69,7 @@
|
||||||
<div class="homepagePostReplyBannerCount">回复
|
<div class="homepagePostReplyBannerCount">回复
|
||||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||||
<span id="praise_count_<%=user_activity_id %>">
|
<span id="praise_count_<%=user_activity_id %>">
|
||||||
<% if activity.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||||
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "(#{get_praise_num(activity)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
|
@ -94,6 +90,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
showNormalImage('reply_content_<%= comment.id %>');
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
autoUrl('reply_content_<%= comment.id %>');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% replies_all_i = replies_all_i + 1 %>
|
<% replies_all_i = replies_all_i + 1 %>
|
||||||
|
@ -102,7 +99,7 @@
|
||||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher mt-4">
|
<div class="homepagePostReplyPublisher">
|
||||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -110,11 +107,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= format_time(comment.created_on) %>
|
<%= format_time(comment.created_on) %>
|
||||||
<span id="reply_praise_count_<%=comment.id %>">
|
<span id="reply_praise_count_<%=comment.id %>">
|
||||||
<% if comment.author == User.current %>
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
||||||
<% else %>
|
|
||||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
||||||
<% end %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100} %></p>
|
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100} %></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml15 mt10">
|
<div class="ml15 mt10">
|
||||||
<span class="grayTxt">发布时间:<%= format_time(activity.created_on) %></span>
|
<span class="grayTxt">发布:<%= format_time(activity.created_on) %></span>
|
||||||
<span class="grayTxt">更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
<span class="grayTxt">更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
||||||
<% count=0 %>
|
<% count=0 %>
|
||||||
<% count=activity.comments.count %>
|
<% count=activity.comments.count %>
|
||||||
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="subjectDetail fl mt10">
|
<div class="subjectDetail fl mt10">
|
||||||
<div class="subjectInfo">题目信息</div>
|
<div class="subjectInfo">题目信息</div>
|
||||||
<div class="subject-content-wrapper">
|
<div class="subject-content-wrapper">
|
||||||
<% if homework.nil? && status == 0 %>
|
<% if homework.nil? %>
|
||||||
<span id="homework_notice_span"><span class="center db">本题库遵循创作共用许可证</span><br>
|
<span id="homework_notice_span"><span class="center db">本题库遵循创作共用许可证</span><br>
|
||||||
|
|
||||||
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
|
教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:<br/><br/>
|
||||||
|
@ -14,14 +14,14 @@
|
||||||
|
|
||||||
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!
|
对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!
|
||||||
</span>
|
</span>
|
||||||
<% elsif homework.nil? && status == 1 %>
|
<!-- <%# elsif homework.nil? && status == 1 %>
|
||||||
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已发送至老师,请耐心等待老师的同意。</span>
|
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已发送至老师,请耐心等待老师的同意。</span>
|
||||||
<% elsif homework.nil? && status == 2 %>
|
<%# elsif homework.nil? && status == 2 %>
|
||||||
<span class="c_red">您选中的作业目前为私有作业,请点击“请求分享”按钮向题目的作者发送分享请求吧!<br/>
|
<span class="c_red">您选中的作业目前为私有作业,请点击“请求分享”按钮向题目的作者发送分享请求吧!<br/>
|
||||||
祝您成功:)
|
祝您成功:)
|
||||||
</span>
|
</span>
|
||||||
<% elsif homework.nil? && status == 3 %>
|
<%# elsif homework.nil? && status == 3 %>
|
||||||
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已被老师拒绝,暂时不可查看作业详情。</span>
|
<span class="c_red">您选中的作业目前为私有作业,您的分享请求已被老师拒绝,暂时不可查看作业详情。</span>-->
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="subjectIntro mb15">标题:<%=homework.name %><br />
|
<div class="subjectIntro mb15">标题:<%=homework.name %><br />
|
||||||
来源:<%=homework.course.name %><br />
|
来源:<%=homework.course.name %><br />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth lh18" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img maxh360 table_maxWidth " id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<%= content.to_s.html_safe%>
|
<%= content.to_s.html_safe %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
postContent=postContent.replace(/ /g," ");
|
postContent=postContent.replace(/ /g," ");
|
||||||
$(this).html(postContent);
|
$(this).html(postContent);
|
||||||
});
|
});
|
||||||
|
autoUrl('intro_content_<%= user_activity_id%>');
|
||||||
description_show_hide(<%=user_activity_id %>);
|
description_show_hide(<%=user_activity_id %>);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -5,7 +5,7 @@
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word">
|
||||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -43,4 +43,4 @@
|
||||||
$(function(){
|
$(function(){
|
||||||
user_card_show_hide();
|
user_card_show_hide();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue