Merge branch 'develop' into hjq_beidou
This commit is contained in:
commit
e9c7ad9337
2
Gemfile
2
Gemfile
|
@ -1,5 +1,5 @@
|
|||
source 'https://rubygems.org/'
|
||||
### 这里执行bundle config mirror.https://rubygems.org https://gems.ruby-china.org 切换到ruby-china源
|
||||
### <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD>bundle config mirror.https://rubygems.org https://gems.ruby-china.org <20>л<EFBFBD><D0BB><EFBFBD>ruby-chinaԴ
|
||||
|
||||
unless RUBY_PLATFORM =~ /w32/
|
||||
# unix-like only
|
||||
|
|
|
@ -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
|
|
@ -33,10 +33,10 @@ module Mobile
|
|||
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id)
|
||||
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id)
|
||||
page = params[:page] ? params[:page] : 0
|
||||
user_project_ids = (user.projects.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
||||
user_course_ids = (user.courses.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.map{|course| course.id}-shield_course_ids).join(",") + ")"
|
||||
user_project_ids = (user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
||||
user_course_ids = (user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.map{|course| course.id}-shield_course_ids).join(",") + ")"
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
project_types = "('Message','Issue','ProjectCreateInfo')"
|
||||
project_types = "('Message','Issue','Project')"
|
||||
principal_types = "JournalsForMessage"
|
||||
watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(','))
|
||||
user_ids = "(" + user.id.to_s + watched_user_ids + ")"
|
||||
|
|
|
@ -14,7 +14,7 @@ module Mobile
|
|||
else
|
||||
case f
|
||||
when :user_act
|
||||
if ac.act_type == "ProjectCreateInfo"
|
||||
if ac.act_type == "Project"
|
||||
ac unless ac.nil?
|
||||
else
|
||||
ac.act unless ac.nil? || ac.act.nil?
|
||||
|
@ -84,10 +84,10 @@ module Mobile
|
|||
elsif ac.container_type == "Project"
|
||||
case ac.act_type
|
||||
when "Issue"
|
||||
"项目缺陷"
|
||||
"项目问题"
|
||||
when "Message"
|
||||
"项目讨论区"
|
||||
when "ProjectCreateInfo"
|
||||
when "Project"
|
||||
"项目"
|
||||
end
|
||||
end
|
||||
|
@ -101,7 +101,7 @@ module Mobile
|
|||
expose :container_type #课程/项目/博客/个人
|
||||
expose :author, using: Mobile::Entities::User do |a, opt| #用户信息
|
||||
if a.is_a? ::UserActivity
|
||||
if a.act_type == "ProjectCreateInfo"
|
||||
if a.act_type == "Project"
|
||||
get_user(get_project(a.act_id).user_id)
|
||||
elsif !a.act.nil?
|
||||
if a.act_type == 'Issue' || a.act_type == 'News' || a.act_type == 'Message' || a.act_type == 'BlogComment'
|
||||
|
|
|
@ -363,7 +363,11 @@ class ApplicationController < ActionController::Base
|
|||
when "contest"
|
||||
return true
|
||||
when "Course"
|
||||
if @attachment.get_status_by_attach(User.current.id) == 2
|
||||
return true
|
||||
else
|
||||
allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false)
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
|
|
|
@ -68,7 +68,7 @@ class AtController < ApplicationController
|
|||
end
|
||||
|
||||
def find_project(id)
|
||||
return [] if id<0
|
||||
return [] if id.to_i<0
|
||||
at_persons = Project.find(id).users
|
||||
at_persons.delete_if { |u| u.id == User.current.id }
|
||||
end
|
||||
|
|
|
@ -162,6 +162,7 @@ class CoursesController < ApplicationController
|
|||
@subPage_title = l :label_student_list
|
||||
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
|
||||
# @is_remote = true
|
||||
@sort_type = 'score'
|
||||
@score_sort_by = "desc"
|
||||
q = "#{params[:name].strip}"
|
||||
if params[:incourse]
|
||||
|
@ -185,9 +186,11 @@ class CoursesController < ApplicationController
|
|||
group.course_id = @course.id
|
||||
group.save
|
||||
end
|
||||
@sort_type = 'score'
|
||||
@score_sort_by = "desc"
|
||||
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
@members = student_homework_score(0,0, 10,"desc")
|
||||
@members = student_homework_score(0,0, 10,@score_sort_by)
|
||||
@course_groups = @course.course_groups
|
||||
end
|
||||
|
||||
|
@ -196,7 +199,9 @@ class CoursesController < ApplicationController
|
|||
@subPage_title = l :label_student_list
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
|
||||
@sort_type = 'score'
|
||||
@score_sort_by = "desc"
|
||||
@members = student_homework_score(0,0, 10,@score_sort_by)
|
||||
@course_groups = @course.course_groups
|
||||
end
|
||||
|
||||
|
@ -281,6 +286,7 @@ class CoursesController < ApplicationController
|
|||
@render_file = 'new_member_list'
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
@sort_type = 'score'
|
||||
@score_sort_by = "desc"
|
||||
if params[:group_id] && params[:group_id] != "0"
|
||||
@group = CourseGroup.find(params[:group_id])
|
||||
|
@ -298,6 +304,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
@render_file = 'new_member_list'
|
||||
@score_sort_by = "desc"
|
||||
@sort_type = "score"
|
||||
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
|
||||
@role = params[:role].nil? ? '2':params[:role]
|
||||
@is_remote = true
|
||||
|
@ -312,7 +319,7 @@ class CoursesController < ApplicationController
|
|||
if @course.open_student == 1 || User.current.member_of_course?(@course)
|
||||
@subPage_title = l :label_student_list
|
||||
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||
@all_members = student_homework_score(0,page, 10,"desc")
|
||||
@all_members = student_homework_score(0,page, 10,@score_sort_by)
|
||||
@members = @all_members
|
||||
else
|
||||
render_403
|
||||
|
@ -334,7 +341,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
def export_course_member_excel
|
||||
@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)}";
|
||||
|
||||
respond_to do |format|
|
||||
|
@ -350,28 +357,29 @@ class CoursesController < ApplicationController
|
|||
@subPage_title = l :label_student_list
|
||||
@render_file = 'new_member_list'
|
||||
@is_remote = true
|
||||
@sort_type = params[:sort_type] if params[:sort_type]
|
||||
@score_sort_by = params[:sort_by] if params[:sort_by]
|
||||
@search_name = params[:search_name] if params[:search_name]
|
||||
group_id = params[:group_id]
|
||||
if !@search_name.nil?
|
||||
if group_id == '0'
|
||||
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||
@results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by), @search_name)
|
||||
@results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by,@sort_type), @search_name)
|
||||
@result_count = @results.count
|
||||
# @results = paginateHelper @results, 10
|
||||
else
|
||||
@group = CourseGroup.find(group_id)
|
||||
@results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by),@search_name)
|
||||
@results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by,@sort_type),@search_name)
|
||||
@result_count = @results.count
|
||||
# @results = paginateHelper @results, 10
|
||||
end
|
||||
else
|
||||
if group_id == '0'
|
||||
page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
|
||||
@results = student_homework_score(0,page, 10,@score_sort_by)
|
||||
@results = student_homework_score(0,page, 10,@score_sort_by,@sort_type)
|
||||
else
|
||||
@group = CourseGroup.find(group_id)
|
||||
@results = student_homework_score(group_id, 0, 0,@score_sort_by)
|
||||
@results = student_homework_score(group_id, 0, 0,@score_sort_by,@sort_type)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -384,6 +392,15 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# 显示每个学生的作业评分详情
|
||||
def show_member_act_score
|
||||
@member = Member.find(params[:member_id]) if params[:member_id]
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'course_base'}
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def handle_course courses, activities
|
||||
course_activity_count_array=activities.values()
|
||||
course_array=[]
|
||||
|
@ -1149,7 +1166,7 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def student_homework_score(groupid,start_from, nums, score_sort_by)
|
||||
def student_homework_score(groupid,start_from, nums, score_sort_by, sort_type = 'score')
|
||||
start_from = start_from * nums
|
||||
sql_select = ""
|
||||
if groupid == 0
|
||||
|
@ -1159,11 +1176,13 @@ class CoursesController < ApplicationController
|
|||
WHERE student_works.homework_common_id = homework_commons.id
|
||||
AND homework_commons.course_id = #{@course.id}
|
||||
AND student_works.user_id = members.user_id
|
||||
) AS score
|
||||
) 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 = #{@course.id} AND ccs.user_id = members.user_id
|
||||
) AS act_score
|
||||
FROM members
|
||||
JOIN students_for_courses
|
||||
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
|
||||
WHERE members.course_id = #{@course.id} ORDER BY score #{score_sort_by}"
|
||||
WHERE members.course_id = #{@course.id} ORDER BY #{sort_type} #{score_sort_by}"
|
||||
else
|
||||
sql_select = "SELECT members.*,(
|
||||
SELECT SUM(student_works.work_score)
|
||||
|
@ -1171,11 +1190,13 @@ class CoursesController < ApplicationController
|
|||
WHERE student_works.homework_common_id = homework_commons.id
|
||||
AND homework_commons.course_id = #{@course.id}
|
||||
AND student_works.user_id = members.user_id
|
||||
) AS score
|
||||
) 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 = #{@course.id} AND ccs.user_id = members.user_id
|
||||
) AS act_score
|
||||
FROM members
|
||||
JOIN students_for_courses
|
||||
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
|
||||
WHERE members.course_id = #{@course.id} AND members.course_group_id = #{groupid} ORDER BY score #{score_sort_by}"
|
||||
WHERE members.course_id = #{@course.id} AND members.course_group_id = #{groupid} ORDER BY #{sort_type} #{score_sort_by}"
|
||||
end
|
||||
sql = ActiveRecord::Base.connection()
|
||||
homework_scores = Member.find_by_sql(sql_select)
|
||||
|
@ -1225,8 +1246,7 @@ class CoursesController < ApplicationController
|
|||
sheet1[5,i+4] = "第"+(i+1).to_s+"次"
|
||||
end
|
||||
sheet1[5,homeworks.count+4] = "总成绩"
|
||||
sheet1[5,0] = "排名"
|
||||
sheet1[5,0] = "排名"
|
||||
sheet1[5,homeworks.count+5] = "活跃度"
|
||||
count_row = 6
|
||||
members.each_with_index do |member, i|
|
||||
sheet1[count_row,0]= i+1
|
||||
|
@ -1236,14 +1256,15 @@ class CoursesController < ApplicationController
|
|||
homeworks.each_with_index do |homework, j|
|
||||
student_works = homework.student_works.where("user_id = #{member.user.id}")
|
||||
if student_works.empty?
|
||||
sheet1[count_row,j+4] = format("%0.2f",0)
|
||||
sheet1[count_row,j+4] = 0
|
||||
else
|
||||
final_score = student_works.first.final_score.nil? ? 0 : student_works.first.final_score
|
||||
score = final_score - student_works.first.absence_penalty - student_works.first.late_penalty
|
||||
sheet1[count_row,j+4] = format("%0.2f",score <0 ? 0:score)
|
||||
sheet1[count_row,j+4] = score <0 ? 0:score.round(2)
|
||||
end
|
||||
end
|
||||
sheet1[count_row,homeworks.count+4] = format("%0.2f",member.score.nil? ? 0:member.score.to_s)
|
||||
sheet1[count_row,homeworks.count+4] = member.score.nil? ? 0:member.score.round(2)
|
||||
sheet1[count_row,homeworks.count+5] = member.act_score.nil? ? 0:member.act_score
|
||||
count_row += 1
|
||||
end
|
||||
|
||||
|
|
|
@ -20,15 +20,16 @@ class HomeworkCommonController < ApplicationController
|
|||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
|
||||
if @is_teacher
|
||||
@homeworks = @course.homework_commons.order("updated_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")
|
||||
else
|
||||
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_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")
|
||||
end
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
@is_new = params[:is_new]
|
||||
|
||||
@homeworks = paginateHelper @homework_commons,10
|
||||
#设置at已读
|
||||
@homeworks.each do |homework|
|
||||
homework.journals_for_messages.each do |j|
|
||||
|
@ -291,9 +292,9 @@ class HomeworkCommonController < ApplicationController
|
|||
|
||||
def open_student_works
|
||||
if @homework.is_open == 0
|
||||
@homework.update_attribute(:is_open, 1)
|
||||
@homework.update_column('is_open', 1)
|
||||
else
|
||||
@homework.update_attribute(:is_open, 0)
|
||||
@homework.update_column('is_open', 0)
|
||||
end
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@is_in_course = params[:is_in_course] if params[:is_in_course]
|
||||
|
@ -440,7 +441,7 @@ class HomeworkCommonController < ApplicationController
|
|||
puts time
|
||||
s_time = time
|
||||
if format_time(time) > format_time(h.updated_at)
|
||||
h.update_attribute(:updated_at, s_time)
|
||||
h.update_column('updated_at', s_time)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -103,6 +103,7 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
|
||||
def destroy
|
||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||
@org_sub_id = @org_document_comment.org_subfield_id
|
||||
org = @org_document_comment.organization
|
||||
if @org_document_comment.id == org.home_id
|
||||
org.update_attributes(:home_id => nil)
|
||||
|
|
|
@ -127,7 +127,7 @@ class OrganizationsController < ApplicationController
|
|||
case params[:type]
|
||||
when nil
|
||||
@org_activities = OrgActivity.where("(container_id =? and container_type =?) " +
|
||||
"or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')})) "+
|
||||
"or (container_type ='Project' and org_act_type in ('Issue','Message','Project') and container_id in (#{project_ids.join(',')})) "+
|
||||
"or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))",
|
||||
@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
when 'project_issue'
|
||||
|
|
|
@ -423,9 +423,13 @@ class PollController < ApplicationController
|
|||
# 将其他地方的问卷导出来
|
||||
def other_poll
|
||||
# 查作者是我,或者作者是当前课程的老师,且不在当前课程内的问卷 进行导入
|
||||
tea_ids = '('
|
||||
tea_ids << Course.find(params[:polls_group_id]).tea_id.to_s << ','<< User.current.id.to_s << ')'
|
||||
@polls = Poll.where("user_id in #{tea_ids} and polls_type = 'course' and polls_group_id != #{params[:polls_group_id]}")
|
||||
courses = User.current.courses.select { |course| User.current.allowed_to?(:as_teacher,course)}
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map { |course| course.id}.join(',') + ")"
|
||||
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]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -81,6 +81,7 @@ class StudentWorkController < ApplicationController
|
|||
#根据传入的tIndex确定是第几次测试
|
||||
#之后如果觉得很卡 可以改成将结果传回JS再以参数形式传回来
|
||||
def program_test_ex
|
||||
|
||||
tStarttime = Time.now
|
||||
|
||||
is_test = params[:is_test] == 'true'
|
||||
|
@ -106,11 +107,19 @@ class StudentWorkController < ApplicationController
|
|||
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} 毫秒"
|
||||
|
||||
#status 0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
|
||||
#status 0:答案正确 -5program_test_ex 函数出错 -4judge代码出错 -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)
|
||||
|
||||
rescue
|
||||
#-4 judge代码 出错
|
||||
logger.debug "program_test_error 1"
|
||||
resultObj[:status] = -4
|
||||
tmpstatus = -4
|
||||
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)
|
||||
end
|
||||
|
||||
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(" ","□")
|
||||
|
@ -204,13 +213,20 @@ class StudentWorkController < ApplicationController
|
|||
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
|
||||
rescue
|
||||
#-5 program_test_ex 函数出错
|
||||
logger.debug "program_test_error 2"
|
||||
resultObj[:status] = -5
|
||||
tmpstatus = -5
|
||||
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)
|
||||
end
|
||||
#渲染返回结果
|
||||
render :json => resultObj
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#找出该作业的所有提交作业
|
||||
def find_all_student_work_by_homeid()
|
||||
|
@ -360,6 +376,7 @@ class StudentWorkController < ApplicationController
|
|||
##################################################################################################################
|
||||
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
||||
@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_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
||||
@show_all = false
|
||||
|
@ -816,7 +833,7 @@ class StudentWorkController < ApplicationController
|
|||
stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
|
||||
@work.student_score = stu_score.first.score.try(:round, 2).to_f
|
||||
end
|
||||
@homework.update_attributes(:updated_at => Time.now)
|
||||
@homework.update_column('updated_at', Time.now)
|
||||
update_course_activity(@homework.class,@homework.id)
|
||||
update_user_activity(@homework.class,@homework.id)
|
||||
update_org_activity(@homework.class,@homework.id)
|
||||
|
|
|
@ -125,6 +125,8 @@ class SubDocumentCommentsController < ApplicationController
|
|||
def destroy
|
||||
@sub_document_comment = SubDocumentComment.find(params[:id])
|
||||
@sub_document_comment.destroy
|
||||
@sub_domain = @sub_document_comment.sub_domain
|
||||
@org_subfield = @sub_domain.org_subfield
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
respond_to do |format|
|
||||
# format.html{
|
||||
|
|
|
@ -645,7 +645,7 @@ class UsersController < ApplicationController
|
|||
new_homework.homework_detail_programing.save if new_homework.homework_detail_programing
|
||||
new_homework.homework_detail_group.save if new_homework.homework_detail_group
|
||||
end
|
||||
homework.update_attribute(:quotes, homework.quotes+1)
|
||||
homework.update_column(:quotes, homework.quotes+1)
|
||||
end
|
||||
@homework = homework
|
||||
respond_to do |format|
|
||||
|
@ -918,7 +918,7 @@ class UsersController < ApplicationController
|
|||
|
||||
student_work.save
|
||||
send_message_to_teacher(student_work)
|
||||
homework.update_attributes(:updated_at => Time.now)
|
||||
homework.update_column(:updated_at, Time.now)
|
||||
update_course_activity(homework.class,homework.id)
|
||||
update_user_activity(homework.class,homework.id)
|
||||
update_org_activity(homework.class,homework.id)
|
||||
|
@ -1006,7 +1006,7 @@ class UsersController < ApplicationController
|
|||
homework_detail_group.save if homework_detail_group
|
||||
if params[:quotes] && !params[:quotes].blank?
|
||||
quotes_homework = HomeworkCommon.find params[:quotes].to_i
|
||||
quotes_homework.update_attribute(:quotes, quotes_homework.quotes+1)
|
||||
quotes_homework.update_column(:quotes, quotes_homework.quotes+1)
|
||||
end
|
||||
if params[:is_in_course] == "1"
|
||||
redirect_to homework_common_index_path(:course => homework.course_id)
|
||||
|
@ -1429,7 +1429,7 @@ class UsersController < ApplicationController
|
|||
user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
||||
user_course_ids = (@user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
|
||||
project_types = "('Message','Issue','ProjectCreateInfo')"
|
||||
project_types = "('Message','Issue','Project')"
|
||||
principal_types = "JournalsForMessage"
|
||||
if params[:type].present?
|
||||
case params[:type]
|
||||
|
@ -2705,7 +2705,7 @@ class UsersController < ApplicationController
|
|||
|
||||
# 获取公共资源搜索
|
||||
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 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
|
||||
|
||||
# 获取我的资源
|
||||
|
|
|
@ -211,7 +211,7 @@ class WechatsController < ActionController::Base
|
|||
user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
||||
user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")"
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
project_types = "('Message','Issue','ProjectCreateInfo')"
|
||||
project_types = "('Message','Issue','Project')"
|
||||
principal_types = "JournalsForMessage"
|
||||
|
||||
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
|
||||
|
|
|
@ -49,6 +49,30 @@ module ApplicationHelper
|
|||
return result
|
||||
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.organization) ? true : false
|
||||
when "Principal"
|
||||
User.current.id == attachment.author_id ? true : false
|
||||
end
|
||||
end
|
||||
|
||||
# 判断某个私有资源是否可以发送下载权限
|
||||
# 结果为true不能下载,false可以下载
|
||||
def private_attachment_allow attachment_id
|
||||
attach = Attachment.find(attachment_id)
|
||||
# 条件取否,result结果为true则不能下载
|
||||
result = attach.is_public == 0 && attach.author != User.current && !attach.get_apply_resource_status(attach.id, User.current.id) && !attach_show_allow(attach)
|
||||
return result
|
||||
end
|
||||
|
||||
# Time 2015-03-24 15:27:29
|
||||
# Author lizanle
|
||||
# Description 从硬盘上删除对应的资源文件
|
||||
|
@ -2094,20 +2118,20 @@ module ApplicationHelper
|
|||
candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
|
||||
elsif attachment.container.is_a?(Project)
|
||||
project = attachment.container
|
||||
candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
|
||||
candown = User.current.member_of?(project) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
|
||||
elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board &&
|
||||
attachment.container.board.project
|
||||
project = attachment.container.board.project
|
||||
candown = User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
|
||||
elsif (attachment.container.has_attribute?(:course) ||attachment.container.has_attribute?(:course_id) ) && attachment.container.course
|
||||
course = attachment.container.course
|
||||
candown = User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1)
|
||||
candown = User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
|
||||
elsif attachment.container.is_a?(Course)
|
||||
course = attachment.container
|
||||
candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1)
|
||||
candown= User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
|
||||
elsif attachment.container.is_a?(OrgSubfield)
|
||||
org = attachment.container.organization
|
||||
candown = User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1)
|
||||
candown = User.current.member_of_org?(org) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
|
||||
elsif attachment.container.is_a?(OrgDocumentComment)
|
||||
org = attachment.container.organization
|
||||
candown = User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1)
|
||||
|
@ -3237,6 +3261,7 @@ def strip_html(text,len=0,endss="...")
|
|||
ss = ""
|
||||
if text.length>0
|
||||
ss=text.gsub(/<\/?.*?>/, '').strip
|
||||
ss = ss.gsub(/ /, ' ')
|
||||
|
||||
if len > 0 && ss.length > len
|
||||
ss = ss[0, len] + endss
|
||||
|
@ -3247,3 +3272,14 @@ def strip_html(text,len=0,endss="...")
|
|||
end
|
||||
return ss
|
||||
end
|
||||
|
||||
def get_hw_index(hw,is_teacher)
|
||||
if is_teacher
|
||||
homeworks = hw.course.homework_commons.order("created_at asc")
|
||||
else
|
||||
homeworks = hw.course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at asc")
|
||||
end
|
||||
hw_ids = homeworks.map{|hw| hw.id} if !homeworks.empty?
|
||||
index = hw_ids.index(hw.id)
|
||||
return index
|
||||
end
|
||||
|
|
|
@ -142,7 +142,8 @@ class Attachment < ActiveRecord::Base
|
|||
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)
|
||||
status = ApplyResource.where("attachment_id =? and user_id =?", attachment_id, author_id).first.try(:status)
|
||||
status == 2 ? true :false
|
||||
end
|
||||
|
||||
# add by nwb
|
||||
|
|
|
@ -5,8 +5,7 @@ class CourseActivity < ActiveRecord::Base
|
|||
belongs_to :course
|
||||
belongs_to :user
|
||||
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
|
||||
after_save :add_user_activity, :add_org_activity
|
||||
after_create :add_course_lead
|
||||
after_create :add_course_lead,:add_user_activity, :add_org_activity
|
||||
before_destroy :destroy_user_activity, :destroy_org_activity
|
||||
|
||||
#在个人动态里面增加当前动态
|
||||
|
|
|
@ -20,7 +20,7 @@ class ForgeActivity < ActiveRecord::Base
|
|||
validates :forge_act_id,presence: true
|
||||
validates :forge_act_type, presence: true
|
||||
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
|
||||
after_save :add_user_activity, :add_org_activity
|
||||
after_create :add_user_activity, :add_org_activity
|
||||
before_destroy :destroy_user_activity, :destroy_org_activity
|
||||
|
||||
#在个人动态里面增加当前动态
|
||||
|
|
|
@ -29,8 +29,8 @@ class HomeworkCommon < ActiveRecord::Base
|
|||
:description => :description,
|
||||
:author => :author,
|
||||
:url => Proc.new {|o| {:controller => 'student_work', :action => 'index', :homework => o.id}}
|
||||
after_create :act_as_activity, :send_mail
|
||||
after_update :update_activity
|
||||
after_create :act_as_activity, :send_mail,:act_as_course_message
|
||||
after_update :update_activity, :wechat_message
|
||||
after_save :act_as_course_activity
|
||||
after_destroy :delete_kindeditor_assets
|
||||
|
||||
|
@ -59,12 +59,12 @@ class HomeworkCommon < ActiveRecord::Base
|
|||
else
|
||||
self.course.members.each do |m|
|
||||
# if m.user_id != self.user_id
|
||||
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
||||
#count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
|
||||
#if count == 0
|
||||
# ws = WechatService.new
|
||||
# ws.homework_template(m.user_id, "homework", self.id, "#{l(:label_new_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59")
|
||||
#end
|
||||
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
ws.homework_template(m.user_id, "homework", self.id, "#{l(:label_new_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59")
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -164,7 +164,20 @@ class Issue < ActiveRecord::Base
|
|||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Project' and shield_id=#{self.project_id}").count
|
||||
if m.user_id != self.author_id && count == 0
|
||||
ws = WechatService.new
|
||||
content = strip_html self.project.name + " 有新缺陷了:" + self.subject.html_safe, 200
|
||||
str = " 有新缺陷了: "
|
||||
case self.tracker_id
|
||||
when 1
|
||||
str = " 有新缺陷了: "
|
||||
when 2
|
||||
str = " 有新功能了: "
|
||||
when 3
|
||||
str = " 有新支持了: "
|
||||
when 4
|
||||
str = " 有新任务了: "
|
||||
when 5
|
||||
str = " 有新周报了: "
|
||||
end
|
||||
content = strip_html self.project.name + str + self.subject.html_safe, 200
|
||||
ws.message_update_template m.user_id, "issues", self.id, "#{l(:label_new_issue_template)}", content, format_time(self.created_on)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -239,8 +239,10 @@ class Journal < ActiveRecord::Base
|
|||
|
||||
#缺陷回复微信模板消息
|
||||
def issue_wechat_message
|
||||
if !self.notes.nil? && self.notes.gsub(' ','') != ''
|
||||
ws = WechatService.new
|
||||
content = strip_html self.notes.html_safe, 200
|
||||
ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -259,8 +259,6 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
if self.m_parent_id.nil?
|
||||
if self.user_id != self.jour.user_id
|
||||
self.course_messages << CourseMessage.new(:user_id => self.jour.user_id,:course_id => self.jour.course.id, :viewed => false)
|
||||
end
|
||||
end
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
|
@ -269,6 +267,19 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||
end
|
||||
end
|
||||
else
|
||||
if self.user_id != self.parent.user_id
|
||||
self.course_messages << CourseMessage.new(:user_id => self.parent.user_id,:course_id => self.jour.course.id, :viewed => false)
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.parent.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
||||
content = strip_html self.notes.html_safe, 200
|
||||
ws.comment_template self.parent.user_id, "homework", self.jour_id, "#{l(:label_new_second_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ class Message < ActiveRecord::Base
|
|||
else # 回帖
|
||||
parent_author_id = Message.find(self.parent_id).author_id
|
||||
if parent_author_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息
|
||||
#self.course_messages << CourseMessage.new(:user_id => parent_author_id, :course_id => self.board.course_id, :viewed => false)
|
||||
self.course_messages << CourseMessage.new(:user_id => parent_author_id, :course_id => self.board.course_id, :viewed => false)
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{parent_author_id} and shield_type='Course' and shield_id=#{self.board.course_id}").count
|
||||
if count == 0
|
||||
content = strip_html self.content.html_safe, 200
|
||||
|
@ -297,7 +297,7 @@ class Message < ActiveRecord::Base
|
|||
else # 回帖
|
||||
parent_author_id = Message.find(self.parent_id).author_id
|
||||
if parent_author_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息
|
||||
#self.forge_messages << ForgeMessage.new(:user_id => parent_author_id, :project_id => self.board.project_id, :viewed => false)
|
||||
self.forge_messages << ForgeMessage.new(:user_id => parent_author_id, :project_id => self.board.project_id, :viewed => false)
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{parent_author_id} and shield_type='Project' and shield_id=#{self.board.project_id}").count
|
||||
if count == 0
|
||||
content = strip_html self.content.html_safe, 200
|
||||
|
|
|
@ -62,7 +62,7 @@ class News < ActiveRecord::Base
|
|||
:author_key => :author_id
|
||||
acts_as_watchable
|
||||
|
||||
after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score
|
||||
after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score, :act_as_system_message
|
||||
after_update :update_activity
|
||||
after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score
|
||||
|
||||
|
@ -169,12 +169,12 @@ class News < ActiveRecord::Base
|
|||
if self.course
|
||||
self.course.members.each do |m|
|
||||
if m.user_id != self.author_id
|
||||
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
||||
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
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
|
||||
|
|
|
@ -17,7 +17,7 @@ class Sso < ActiveRecord::Base
|
|||
sso.openid = opt["openid"]
|
||||
sso.email = opt["email"]
|
||||
sso.password = opt["password"]
|
||||
sso.school = Base64.decode64(opt["school"]).force_encoding('utf-8')
|
||||
sso.school = opt["school"]
|
||||
sso.sex = opt["sex"]
|
||||
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
<th style="width: 100px;">
|
||||
测试完成时间
|
||||
</th>
|
||||
<th style="width: 60px;">
|
||||
<span style="float:left; margin-left:20px;">答题状态</span>
|
||||
<th style="width: 80px;">
|
||||
<span style="float:left; margin-left:30px;">答题状态</span>
|
||||
</th>
|
||||
<th style="width: 50px;">
|
||||
<span style="float:left; margin-left:20px;">耗时</span>
|
||||
|
@ -76,6 +76,10 @@
|
|||
<%= "代码超时" %>
|
||||
<% elsif test.status == -3 %>
|
||||
<%= "请求超时" %>
|
||||
<% elsif test.status == -4 %>
|
||||
<%= "judge代码出错!" %>
|
||||
<% elsif test.status == -5 %>
|
||||
<%= "trustie代码出错!" %>
|
||||
<% else %>
|
||||
<%= "答题错误" %>
|
||||
<% end %>
|
||||
|
|
|
@ -141,6 +141,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||
|
@ -215,5 +216,6 @@
|
|||
var postContent = $("#message_description_<%= @article.id %>").html();
|
||||
postContent = postContent.replace(/ /g," ");
|
||||
$("#message_description_<%= @article.id %>").html(postContent);
|
||||
autoUrl('message_description_<%= @article.id %>');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新时间:<%= format_time(activity.updated_on) %></span>
|
||||
<span class="grayTxt">发布:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新:<%= format_time(activity.updated_on) %></span>
|
||||
<p class="list-info fr grayTxt">
|
||||
<span><%= count>0 ? "#{count}" :"0" %></span>
|
||||
<span>回复</span>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
|
||||
<p nhname='contentmsg_'></p>
|
||||
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10">取消</a>
|
||||
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="submit_feedback_course" >留言</a>
|
||||
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="new_message_submit_btn_" >留言</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -55,9 +55,6 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
$("#submit_feedback_course").one('click',function() {
|
||||
$("#course_feedback_new").submit();
|
||||
});
|
||||
KindEditor.ready(function(K){
|
||||
$("a[nhname='reply_btn']").live('click',function(){
|
||||
var params = {};
|
||||
|
@ -68,15 +65,18 @@
|
|||
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.submit_btn = $("input[nhname='submit_btn']",params.div_form);
|
||||
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||
params.height = 55;
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.editor = init_editor(params);
|
||||
init_form(params);
|
||||
params.cancel_btn.click(function(){
|
||||
nh_reset_form(params);
|
||||
});
|
||||
}
|
||||
params.submit_btn.one('click', function () {
|
||||
params.form.submit();
|
||||
});
|
||||
params.textarea.data('init',1);
|
||||
params.cancel_btn.click();
|
||||
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||
setTimeout(function(){
|
||||
|
@ -86,7 +86,6 @@
|
|||
params.textarea.hide();
|
||||
}
|
||||
},300);
|
||||
params.textarea.data('init',1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,16 +24,24 @@
|
|||
<ul class="st_box_top">
|
||||
<li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li>
|
||||
<li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li>
|
||||
<li style="padding-right: 55px; margin-left: 260px;"><a href="">分班</a></li>
|
||||
<li style="margin-left: 25px;">
|
||||
<%= link_to '作业积分', member_score_sort_course_path(: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%>
|
||||
<% if @score_sort_by == 'desc' %>
|
||||
<li style="padding-right: 55px; margin-left: 160px;"><a href="">分班</a></li>
|
||||
<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'%>
|
||||
<% if @sort_type == "score" && @score_sort_by == 'desc' %>
|
||||
<a id="pic" href="javascript:" class= "st_down"></a>
|
||||
<% else %>
|
||||
<% elsif @sort_type == "score" && @score_sort_by == 'asc' %>
|
||||
<a id="pic" href="javascript:" class= "st_up"></a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="ml50"><a href="javascript:void(0)" >加入时间</a></li>
|
||||
<li class="st_list_score">
|
||||
<%= link_to '活跃度', member_score_sort_course_path(:sort_type => 'act_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 => 'ml35'%>
|
||||
<% if @sort_type == "act_score" && @score_sort_by == 'desc' %>
|
||||
<a id="pic" href="javascript:" class= "st_down"></a>
|
||||
<% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %>
|
||||
<a id="pic" href="javascript:" class= "st_up"></a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="ml20"><a href="javascript:void(0)" >加入时间</a></li>
|
||||
</ul>
|
||||
<div class="cl"></div><!--st_box_top end-->
|
||||
|
||||
|
@ -61,21 +69,21 @@
|
|||
</ul>
|
||||
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
|
||||
<% if @course.course_groups.nil? || @group %>
|
||||
<div class="select-class-option fl" style="margin-left: 105px;">
|
||||
<div class="select-class-option fl" style="margin-left: 5px;">
|
||||
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
|
||||
<div class="select-class-option fl" style="margin-left: 105px;"><span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
<div class="select-class-option fl" style="margin-left: 5px;"><span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2 ml5"></a>
|
||||
</div>
|
||||
<%= select( :name,:group_id, course_group_option(@course),
|
||||
{ :include_blank => false,:selected => member.course_group_id},
|
||||
{:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w125 undis class-edit fl", :style => "margin-left: 105px;"}) %>
|
||||
{:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w125 undis class-edit fl", :style => "margin-left: 5px;"}) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="select-class-option fl" style="margin-left: 105px;">
|
||||
<div class="select-class-option fl" style="margin-left: 5px;">
|
||||
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -83,7 +91,12 @@
|
|||
:action => 'show_member_score',
|
||||
:member_id => member.id,
|
||||
:remote => true},
|
||||
:class => 'ml25 c_red' %>
|
||||
:class => 'st_list_score c_red' %>
|
||||
<%= link_to member.act_score.nil? ? 0 : member.act_score.to_s, {
|
||||
:action => 'show_member_act_score',
|
||||
:member_id => member.id,
|
||||
:remote => true},
|
||||
:class => 'st_list_score c_red' %>
|
||||
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
|
||||
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<style>
|
||||
.tscore_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; text-align: center; padding-top:5px;}
|
||||
.tscore_box li{ height:25px;}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="tscore_con" id="user_score">
|
||||
<% act_score = CourseContributorScore.where("user_id = ? and course_id = ?", member.user_id, member.course_id).first %>
|
||||
<h2><%= member.user.show_name %> 活跃度计算</h2>
|
||||
<% if act_score.nil? %>
|
||||
<div style="padding-left: 40px;padding-bottom: 2px;padding-right: 2px;padding-top: 10px;">
|
||||
资源发布数 x 5 = 0 x 5 = 0</br>
|
||||
问答发布数 x 2 = 0 x 2 = 0</br>
|
||||
通知发布数 x 1 = 0 x 1 = 0</br>
|
||||
问答回帖数 x 1 = 0 x 1 = 0</br>
|
||||
作业留言数 x 1 = 0 x 1 = 0</br>
|
||||
通知留言数 x 1 = 0 x 1 = 0</br>
|
||||
课程留言数 x 1 = 0 x 1 = 0</br>
|
||||
总得分:0
|
||||
</div>
|
||||
<% else %>
|
||||
<% total_score = act_score.resource_num.to_i * 5 + act_score.message_num.to_i * 2 +
|
||||
act_score.message_reply_num.to_i * 1 + act_score.journal_num.to_i * 1 +
|
||||
+ act_score.homework_journal_num.to_i * 1 + act_score.news_reply_num.to_i * 1 +
|
||||
act_score.news_num.to_i * 1 %>
|
||||
<div style="padding-left: 40px;padding-bottom: 2px;padding-right: 2px;padding-top: 10px;">
|
||||
资源发布数 x 5 = <%= act_score.resource_num.to_i %> x 5 = <%= act_score.resource_num.to_i * 5 %></br>
|
||||
问答发布数 x 2 = <%= act_score.message_num.to_i %> x 2 = <%= act_score.message_num.to_i * 2 %></br>
|
||||
通知发布数 x 1 = <%= act_score.news_num.to_i %> x 1 = <%= act_score.news_num.to_i %></br>
|
||||
问答回帖数 x 1 = <%= act_score.message_reply_num.to_i %> x 1 = <%= act_score.message_reply_num.to_i %></br>
|
||||
作业留言数 x 1 = <%= act_score.homework_journal_num.to_i %> x 1 = <%= act_score.homework_journal_num.to_i %></br>
|
||||
通知留言数 x 1 = <%= act_score.news_reply_num.to_i %> x 1 = <%= act_score.news_reply_num.to_i %></br>
|
||||
课程留言数 x 1 = <%= act_score.journal_num.to_i %> x 1 = <%= act_score.journal_num.to_i %></br>
|
||||
总得分:<%=total_score %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
|
@ -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_box{ width:350px; margin:15px auto;}
|
||||
.tscore_box{ width:370px; margin:15px auto;}
|
||||
.tscore_box li{ height:25px;}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="tscore_con" id="user_score">
|
||||
<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>
|
||||
<% @member_score.homework_common_list.each do |homework_common| %>
|
||||
<% @member_score.homework_common_list.each_with_index do |homework_common, index| %>
|
||||
<li>
|
||||
<span class="c_grey02 w280 hiddent">
|
||||
<%= homework_common.name %>
|
||||
作业<%=index + 1 %>:<%= homework_common.name %>
|
||||
</span>
|
||||
<span class="c_red w70">
|
||||
<% final_score = @member_score.homework_common_score(homework_common).first%>
|
||||
|
@ -28,7 +28,7 @@
|
|||
</span>
|
||||
</li>
|
||||
<% end %>
|
||||
<li><span class="c_blue03 w280">作业积分(总分)</span><span class="c_red w70"><%= format("%0.2f",(@member_score.student_work_score_sum).first.score) %></span></li>
|
||||
<li><span class="c_blue03 w280">作业积分(总分)</span><span class="c_red w70"><%= format("%0.2f",(@member_score.student_work_score_sum).first.score.nil? ? 0 : (@member_score.student_work_score_sum).first.score) %></span></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
|
|
@ -0,0 +1,7 @@
|
|||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'courses/show_member_act_score', :locals => {:member => @member}) %>');
|
||||
showModal('ajax-modal', '300px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span>" +
|
||||
"<a href='javascript:void(0)' onclick='hidden_homework_score_form();'><img src='/images/bid/close.png' width='26px' height='26px' style='margin-left: 275px;' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","40%").css("position","fixed").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("new-watcher");
|
|
@ -120,6 +120,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<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," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('message_description_<%= @article.id %>');
|
||||
});
|
||||
</script>
|
|
@ -25,57 +25,3 @@
|
|||
<%= render :partial => "student_table" %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @exercise_users_list.each do |exercise|%>
|
||||
<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>
|
||||
<ul class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||
<li class="ml5 mr5" style="width:28px; text-align:center;">1</li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(exercise.user)) %>
|
||||
</li>
|
||||
<li class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%=exercise.user.show_name %>
|
||||
</li><li class="hworkStID pl15 pr10" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<li class="hworkStID" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||
--
|
||||
</li>
|
||||
<li class="hworkList130 ml200 c_grey student_work_<%= exercise.id%>">
|
||||
<% if exercise.created_at%>
|
||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if @exercise.end_time <= exercise.created_at %>
|
||||
<span class="c_red">[未答]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 <%= score_color exercise.score%> student_final_scor_info">
|
||||
<%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
|
@ -0,0 +1,81 @@
|
|||
<div class="fl" style="padding-bottom:10px; width:720px;">
|
||||
<span class="c_dark f14 fb fl mr30">
|
||||
测验
|
||||
<font class="f12 c_red">
|
||||
(<%= @exercise_count%>人已交)
|
||||
</font>
|
||||
<% if !@is_teacher && @exercise_users_list.empty?%>
|
||||
<span class="f12 c_red">您尚未提交</span>
|
||||
<% elsif !@is_teacher && !@exercise_users_list.empty?%>
|
||||
<span class="f12 c_red">您已提交</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<%#if @is_teacher || @exercise.exercise_status == 3%>
|
||||
<!--<div class="hworkSearchBox">
|
||||
<input type="text" id="course_student_name" value="<%#= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%#= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%#= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
|
||||
</div>-->
|
||||
<%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
||||
<%# end%>
|
||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示测验信息 ]</a> </span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="fl">
|
||||
<%= render :partial => "student_table"%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @exercise_users_list.each do |exercise|%>
|
||||
<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>
|
||||
<ul class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||
<li class="ml5 mr5" style="width:28px; text-align:center;">1</li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(exercise.user)) %>
|
||||
</li>
|
||||
<li class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%=exercise.user.show_name %>
|
||||
</li><li class="hworkStID pl15 pr10" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<li class="hworkStID" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||
--
|
||||
</li>
|
||||
<li class="hworkList130 ml200 c_grey student_work_<%= exercise.id%>">
|
||||
<% if exercise.created_at%>
|
||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if @exercise.end_time <= exercise.created_at %>
|
||||
<span class="c_red">[未答]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 <%= score_color exercise.score%> student_final_scor_info">
|
||||
<%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
|
@ -1,23 +1,71 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList340 hworkH30 width530">
|
||||
<table class="hwork-table-wrap">
|
||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
||||
<th class="hworkList340 width530" colspan="6">
|
||||
<span class="c_dark f14 fb fl mr5">序号</span>
|
||||
<span class="c_dark f14 fb fl mr55"> </span>
|
||||
<span class="c_dark f14 fb fl mr60">姓名</span>
|
||||
<span class="c_dark f14 fb fl mr60">学号</span>
|
||||
<span class="c_dark f14 fb fl">班级</span>
|
||||
</li>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
</th>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间",'',:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<%# if @show_all && @order == "created_at"%>
|
||||
<%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<%# end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "成绩",'',:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<%# if @show_all && @order == "score"%>
|
||||
<%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<%# end%>
|
||||
</li>
|
||||
</ul>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<% @exercise_users_list.each do |exercise|%>
|
||||
<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%>">
|
||||
<td class="pl5 pr5" style="width:28px; text-align:center;">1</td>
|
||||
<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)) %>
|
||||
</td>
|
||||
<td class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
|
||||
<%=exercise.user.show_name %>
|
||||
</td>
|
||||
<td class="hworkStID 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>
|
||||
</td>
|
||||
<td class="hworkStID float-none" title="班级" id="student_class_<%= exercise.id%>" style="cursor:pointer;">
|
||||
--
|
||||
</td>
|
||||
<td width="200"> </td>
|
||||
<td class="hworkList130 c_grey student_work_<%= exercise.id%>">
|
||||
<% if exercise.created_at%>
|
||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if @exercise.end_time <= exercise.created_at %>
|
||||
<span class="c_red">[未答]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList50 <%= score_color exercise.score%> student_final_scor_info">
|
||||
<%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
|
||||
</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>
|
||||
<% end%>
|
||||
</table>
|
|
@ -0,0 +1,23 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList340 hworkH30 width530">
|
||||
<span class="c_dark f14 fb fl mr5">序号</span>
|
||||
<span class="c_dark f14 fb fl mr55"> </span>
|
||||
<span class="c_dark f14 fb fl mr60">姓名</span>
|
||||
<span class="c_dark f14 fb fl mr60">学号</span>
|
||||
<span class="c_dark f14 fb fl">班级</span>
|
||||
</li>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
<%= link_to "时间",'',:class => "c_dark f14 fb fl ml50" ,:remote => true%>
|
||||
<%# if @show_all && @order == "created_at"%>
|
||||
<%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<%# end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "成绩",'',:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<%# if @show_all && @order == "score"%>
|
||||
<%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<%# end%>
|
||||
</li>
|
||||
</ul>
|
|
@ -8,7 +8,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTitle break_word mt-4">
|
||||
<div class="homepagePostTitle break_word">
|
||||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= 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) %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTitle break_word mt-4">
|
||||
<div class="homepagePostTitle break_word">
|
||||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= 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) %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTitle break_word mt-4">
|
||||
<div class="homepagePostTitle break_word">
|
||||
<%# 如果有历史版本则提供历史版本下载 %>
|
||||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
<div style="padding-top: 10px">
|
||||
<% if memos.any? %>
|
||||
<% memos.each do |topic| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('postDetailDes_<%= topic.id %>');
|
||||
autoUrl('postDetailDes_<%= topic.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="postDetailRow">
|
||||
<div class="postDetailPortrait">
|
||||
<!--<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>
|
||||
</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>-->
|
||||
</div>
|
||||
<% author = topic.last_reply.try(:author)%>
|
||||
|
|
|
@ -73,6 +73,12 @@
|
|||
<% end%>
|
||||
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,: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>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<%= render :partial => 'action_menu' %>
|
||||
<div class="cl"></div>
|
||||
<% 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? %>
|
||||
<%#= 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 %>
|
||||
|
@ -44,3 +44,10 @@
|
|||
<%= render :partial => 'issues/attributes_show' %>
|
||||
<div class="cl"></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">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
autoUrl('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% 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 => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -94,12 +94,12 @@
|
|||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
<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>
|
||||
<script type="text/javascript">
|
||||
$(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();
|
||||
postContent = postContent.replace(/ /g," ");
|
||||
postContent= postContent.replace(/ {2}/g," ");
|
||||
|
@ -107,6 +107,7 @@
|
|||
postContent=postContent.replace(/ /g," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('activity_description_<%= reply.id %>');
|
||||
description_show_hide(<%= reply.id %>);
|
||||
});
|
||||
</script>
|
||||
|
@ -147,6 +148,7 @@
|
|||
postContent=postContent.replace(/ /g," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('activity_description_<%= @memo.id %>');
|
||||
description_show_hide(<%= @memo.id %>);
|
||||
});
|
||||
</script>
|
|
@ -109,6 +109,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||
|
@ -188,5 +189,6 @@
|
|||
postContent=postContent.replace(/ /g," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('message_description_<%= @topic.id %>');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -138,6 +138,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<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," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('message_description_<%= @topic.id %>');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -165,6 +165,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||
|
@ -245,5 +246,6 @@
|
|||
postContent=postContent.replace(/ /g," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('message_description_<%= @topic.id %>');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -115,6 +115,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<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," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('message_description_<%= @news.id %>');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -97,6 +97,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<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," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('message_description_<%= @news.id %>');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -107,6 +107,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<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," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('message_description_<%= @news.id %>');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//location.reload();
|
||||
<% if params[:detail_page] %>
|
||||
window.location.href = '<%= organization_org_document_comments_path(:organization_id => @org_document_comment.root.organization_id)%>';
|
||||
window.location.href = '<%= organization_path(params[:organization_id],:org_subfield_id => @org_sub_id )%>';
|
||||
<% else %>
|
||||
window.location.reload();
|
||||
<% end %>
|
|
@ -84,6 +84,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% user = User.find(reply.creator_id) %>
|
||||
|
@ -158,6 +159,7 @@
|
|||
postContent=postContent.replace(/ /g," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('intro_content_<%= @document.id %>');
|
||||
});
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
|
||||
<% if act.org_act_type == 'OrgDocumentComment' %>
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
@ -56,7 +56,7 @@
|
|||
<%= render :partial => 'organizations/org_project_issue', :locals => {:activity => Issue.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
<% when 'Project'%>
|
||||
<%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:teacher).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:teacher), user_url_in_org(activity.tea_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -210,9 +210,9 @@
|
|||
|
||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||
<% 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 %>
|
||||
<%= 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 %>
|
||||
<% com_time = project.project_score.commit_time %>
|
||||
<% time=project.updated_on %>
|
||||
|
@ -315,6 +315,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -100,6 +100,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
autoUrl('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
|
@ -108,7 +109,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -69,6 +69,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
|
@ -77,7 +78,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_url_in_org(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<%= render :partial => 'organizations/org_project_issue', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'organizations/project_message', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
<% when 'Project'%>
|
||||
<%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -80,6 +80,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
autoUrl('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i + 1 %>
|
||||
|
@ -88,7 +89,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_url_in_org(reply.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:user), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -105,6 +105,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
autoUrl('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
|
@ -113,7 +114,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -89,6 +89,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
|
@ -97,7 +98,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if user.try(:realname) == ' ' %>
|
||||
<%= link_to user, user_url_in_org(user.id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -79,6 +79,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
autoUrl('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
|
@ -87,7 +88,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
postContent=postContent.replace(/ /g," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('intro_content_<%= document.id %>');
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
|
|
|
@ -88,6 +88,12 @@
|
|||
<ul>
|
||||
<% reply_id = 0 %>
|
||||
<% 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 %>
|
||||
<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>
|
||||
|
@ -104,7 +110,7 @@
|
|||
</span>
|
||||
</div>
|
||||
<% 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 %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if user.try(:realname) == ' ' %>
|
||||
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
|
|
@ -80,6 +80,9 @@
|
|||
if(params.content.isEmpty()){
|
||||
params.contentmsg.html('内容不能为空');
|
||||
params.contentmsg.css({color:'#ff0000'});
|
||||
params.submit_btn.one('click', function(){
|
||||
params.form.submit();
|
||||
});
|
||||
}else{
|
||||
params.contentmsg.html('填写正确');
|
||||
params.contentmsg.css({color:'#008000'});
|
||||
|
@ -124,7 +127,9 @@
|
|||
issubmit:true,
|
||||
content:params.editor,
|
||||
contentmsg:params.contentmsg,
|
||||
textarea:params.textarea
|
||||
textarea:params.textarea,
|
||||
submit_btn:params.submit_btn,
|
||||
form:params.form
|
||||
});
|
||||
if(is_checked){
|
||||
if(flag){
|
||||
|
@ -161,13 +166,15 @@
|
|||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.submit_btn = $("input[nhname='submit_btn']",params.div_form);
|
||||
params.editor = init_editor(params);
|
||||
init_form(params);
|
||||
params.submit_btn.one('click', function () {
|
||||
params.form.submit();
|
||||
});
|
||||
params.cancel_btn.click(function(){
|
||||
nh_reset_form(params);
|
||||
});
|
||||
}
|
||||
params.cancel_btn.click();
|
||||
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||
setTimeout(function(){
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -69,6 +69,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
|
@ -77,7 +78,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -1,27 +1,39 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList30 hworkH30 ml5 mr5"><span class="c_dark f14 fb fl">序号</span></li>
|
||||
<li class="hworkList50 hworkH30"> </li>
|
||||
<li class="hworkList260 hworkH30">
|
||||
<span class="f14 fb fl">作品名称</span>
|
||||
</li>
|
||||
<table class="hwork-table-wrap">
|
||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<th class="hworkList260" style="text-align:left;">作品名称</th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkList80 hworkH30"><span class="HomeworkStuTitle f14 fb fl">姓名</span></li>
|
||||
<li class="hworkList80 hworkH30"><span class="HomeworkStuTitle f14 fb fl">学号</span></li>
|
||||
<th class="hworkList80">
|
||||
<span class="HomeworkStuTitle f14 fb fl">姓名</span>
|
||||
</th>
|
||||
<th class="hworkList80">
|
||||
<span class="HomeworkStuTitle f14 fb fl">学号</span>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkList160 hworkH30"><span class="HomeworkStuTitle f14 fb fl">关联项目</span></li>
|
||||
<th class="hworkList160">
|
||||
<span class="HomeworkStuTitle f14 fb fl">关联项目</span>
|
||||
</th>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList130 hworkH30 fb ml10">
|
||||
<th class="hworkList130 pl10">
|
||||
时间
|
||||
</li>
|
||||
|
||||
</th>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList50 hworkH30 fb">
|
||||
<th class="hworkList50">
|
||||
系统
|
||||
</li>
|
||||
</th>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList50 hworkH30 fb mr10 ml10">
|
||||
<th class="hworkList50 pr10 pl10" style="font-size:12px;">
|
||||
我的评分
|
||||
</li>
|
||||
</ul>
|
||||
</th>
|
||||
</tr>
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</table>
|
|
@ -0,0 +1,27 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList30 hworkH30 ml5 mr5"><span class="c_dark f14 fb fl">序号</span></li>
|
||||
<li class="hworkList50 hworkH30"> </li>
|
||||
<li class="hworkList260 hworkH30">
|
||||
<span class="f14 fb fl">作品名称</span>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkList80 hworkH30"><span class="HomeworkStuTitle f14 fb fl">姓名</span></li>
|
||||
<li class="hworkList80 hworkH30"><span class="HomeworkStuTitle f14 fb fl">学号</span></li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkList160 hworkH30"><span class="HomeworkStuTitle f14 fb fl">关联项目</span></li>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList130 hworkH30 fb ml10">
|
||||
时间
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList50 hworkH30 fb">
|
||||
系统
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList50 hworkH30 fb mr10 ml10" style="font-size:12px;">
|
||||
我的评分
|
||||
</li>
|
||||
</ul>
|
|
@ -1,73 +1,74 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList30 hworkH30 ml5 mr5"><span class="c_dark f14 fb fl">序号</span></li>
|
||||
<li class="hworkList50"> </li>
|
||||
<li class="<%= @homework.homework_type == 2 ? 'hworkList80 mr10' : 'hworkList130 mr10'%> hworkH30">
|
||||
<span class="c_dark f14 fb fl <%#= @homework.homework_type == 2 ? 'mr90 ml50' : 'mr150 ml50'%>">作品名称</span>
|
||||
</li>
|
||||
<table class="hwork-table-wrap">
|
||||
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
|
||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pr10' : 'hworkList130 pr10'%>" style="text-align:left;">作品名称</th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<!--<span class="c_dark f14 fb fl mr50">姓名</span>-->
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> hworkH30 mr10">
|
||||
<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%>
|
||||
<% 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%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> hworkH30 mr10">
|
||||
<!--<span class="c_dark f14 fb fl">学号</span>-->
|
||||
</th>
|
||||
<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%>
|
||||
<% 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%>
|
||||
<% end%>
|
||||
</li>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkList160 hworkH30">
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList220' : 'hworkList160'%>">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</li>
|
||||
</th>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
<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%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30" >
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
</th>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<th class="hworkList50">
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</th>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<th class="hworkList50">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</th>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<th class="hworkList50">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
||||
</th>
|
||||
</tr>
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</table>
|
|
@ -0,0 +1,73 @@
|
|||
<ul class="hworkUl">
|
||||
<li class="hworkList30 hworkH30 ml5 mr5"><span class="c_dark f14 fb fl">序号</span></li>
|
||||
<li class="hworkList50"> </li>
|
||||
<li class="<%= @homework.homework_type == 2 ? 'hworkList80 mr10' : 'hworkList130 mr10'%> hworkH30">
|
||||
<span class="c_dark f14 fb fl <%#= @homework.homework_type == 2 ? 'mr90 ml50' : 'mr150 ml50'%>">作品名称</span>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<!--<span class="c_dark f14 fb fl mr50">姓名</span>-->
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> hworkH30 mr10">
|
||||
<%= 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"%>
|
||||
<%= 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%>
|
||||
</li>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> hworkH30 mr10">
|
||||
<!--<span class="c_dark f14 fb fl">学号</span>-->
|
||||
<%= 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"%>
|
||||
<%= 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%>
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkList160 hworkH30">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList130 hworkH30">
|
||||
<%= 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%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30" >
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li class="hworkList50 hworkH30">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
|
@ -1,60 +1,58 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<a name="<%= student_work.id%>"></a>
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<td class="none"><a name="<%= student_work.id%>"></a></td>
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<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)) %>
|
||||
</li>
|
||||
<div class="student_work_<%= student_work.id%>">
|
||||
<li class="hworkName mt12 pr10 <%= @homework.homework_type == 2 ? '' : 'width130'%>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
</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)%>');">
|
||||
<% 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>
|
||||
</li>
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10" 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%>
|
||||
</li>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10" 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;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
</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;">
|
||||
<span style="width:80px;" class="hidden fl"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<li class="hworkPrName" 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))%>
|
||||
</li>
|
||||
</td>
|
||||
<% else %>
|
||||
<li class="hworkPrName" title="该项目是私有的">
|
||||
<td class="hworkPrName student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</li>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<li 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%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teacher_score%>">
|
||||
</td>
|
||||
<td class="hworkList50 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
|
||||
</td>
|
||||
<td class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</li>
|
||||
</td>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<td class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
</td>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<li class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<td class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
|
@ -71,7 +69,7 @@
|
|||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
|
@ -79,7 +77,7 @@
|
|||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% end %>
|
||||
<li class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<td class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
|
@ -97,9 +95,9 @@
|
|||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||
</tr>
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= student_work.id%>").mouseenter(function(){
|
||||
if($("#about_hwork_<%= student_work.id%>").html().trim() == "") {
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
<a name="<%= student_work.id%>"></a>
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||
</li>
|
||||
<div class="student_work_<%= student_work.id%>">
|
||||
<li class="hworkName mt12 pr10 <%= @homework.homework_type == 2 ? '' : '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>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.show_name%>
|
||||
</li>
|
||||
<li class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10" 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;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<li class="hworkPrName" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="hworkPrName" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<li 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%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</li>
|
||||
<li class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<li class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%=format("%.1f",student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
|
||||
</span>
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% end %>
|
||||
<li class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
|
@ -1,5 +1,6 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<td class="none"><a name="<%= student_work.id%>"></a></td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<% is_my_work = student_work.user == User.current%>
|
||||
<% else %>
|
||||
|
@ -8,81 +9,78 @@
|
|||
<% end %>
|
||||
|
||||
<% if is_my_work%>
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %>
|
||||
</li>
|
||||
<li class="hworkName mt12 pr10 w250 student_work_<%= student_work.id%>">
|
||||
</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>
|
||||
</li>
|
||||
<div class="student_work_<%= student_work.id%>">
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkStName w80" 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%>
|
||||
</li>
|
||||
<li class="hworkStID" 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;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
</td>
|
||||
<td class="hworkStID 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 class="hidden fl" style="width:80px;"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<li class="hworkPrName mr10 mt12" 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))%>
|
||||
</li>
|
||||
</td>
|
||||
<% else %>
|
||||
<li class="hworkPrName mr10 mt12" title="该项目是私有的">
|
||||
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</li>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else%>
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<td class="hworkList30 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait float-none pr10">
|
||||
<%= image_tag(url_to_avatar(""),width:"40", height: "40", style: "display:block;") %>
|
||||
</li>
|
||||
<li class="hworkName mt12 pr10 w250 student_work_<%= student_work.id%>">
|
||||
</td>
|
||||
<td class="hworkName float-none pr10 w250 student_work_<%= student_work.id%>">
|
||||
<div>
|
||||
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
</div>
|
||||
</li>
|
||||
</td>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkStName w80" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkStName float-none w80" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</li>
|
||||
<li class="hworkStID" title="学号">
|
||||
</td>
|
||||
<td class="hworkStID float-none" title="学号">
|
||||
--
|
||||
</li>
|
||||
</td>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkPrName mr10" title="项目名称" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkPrName mr10 float-none" title="项目名称" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</li>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<td class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
</li>
|
||||
</td>
|
||||
|
||||
<!-- 成绩 -->
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<td class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
</td>
|
||||
<% end%>
|
||||
|
||||
<% my_score = student_work_score(student_work,User.current) %>
|
||||
<li class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<td class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||
</tr>
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= student_work.id%>").mouseenter(function(){
|
||||
$("#work_click_<%= student_work.id%>").show();
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<% is_my_work = student_work.user == User.current%>
|
||||
<% else %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% is_my_work = pro && pro.student_work_id == student_work.id%>
|
||||
<% end %>
|
||||
|
||||
<% if is_my_work%>
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %>
|
||||
</li>
|
||||
<li class="hworkName mt12 pr10 w250 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>
|
||||
</li>
|
||||
<div class="student_work_<%= student_work.id%>">
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkStName w80" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= student_work.user.show_name%>
|
||||
</li>
|
||||
<li class="hworkStID" 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;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<li class="hworkPrName mr10 mt12" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="hworkPrName mr10 mt12" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else%>
|
||||
<li class="hworkList30 ml5 mr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></li>
|
||||
<li class="hworkPortrait mt15 mr10">
|
||||
<%= image_tag(url_to_avatar(""),width:"40", height: "40", style: "display:block;") %>
|
||||
</li>
|
||||
<li class="hworkName mt12 pr10 w250 student_work_<%= student_work.id%>">
|
||||
<div>
|
||||
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%>
|
||||
</div>
|
||||
</li>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<li class="hworkStName w80" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</li>
|
||||
<li class="hworkStID" title="学号">
|
||||
--
|
||||
</li>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li class="hworkPrName mr10" title="项目名称" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
匿名
|
||||
</li>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<li class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<!-- 成绩 -->
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList50 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<% my_score = student_work_score(student_work,User.current) %>
|
||||
<li class="hworkList50 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
|
||||
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
|
||||
</li>
|
||||
<li class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
|
||||
</ul>
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<div class="show_hwork_arrow"></div>
|
||||
<div class="showHwork">
|
||||
<ul>
|
||||
|
|
|
@ -37,17 +37,6 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<% if @is_evaluation%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id %>
|
||||
|
|
|
@ -11,9 +11,9 @@ var num = $("#work_num_<%= @work.id%>").html();
|
|||
$("#score_list_<%= @work.id%>").removeAttr("style");
|
||||
|
||||
<% if @is_teacher %>
|
||||
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("#work_num_<%= @work.id%>").html(num);
|
||||
<% else %>
|
||||
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("#work_num_<%= @work.id%>").html(num);
|
||||
<% end%>
|
||||
|
|
|
@ -69,16 +69,21 @@
|
|||
<ul class="menu_r">
|
||||
<li>
|
||||
<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 %>
|
||||
<%="作业 #{@homework_commons.count - index}" %>
|
||||
<%="作业 #{hcommons.count - index}" %>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</a>
|
||||
<ul>
|
||||
<% @homework_commons.each_with_index do |homework_common,index |%>
|
||||
<% hcommons.each_with_index do |homework_common,index |%>
|
||||
<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)%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
@ -170,6 +175,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<% if @homework.end_time && @homework.publish_time %>
|
||||
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %> 23:59</div>
|
||||
<% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 && @homework.anonymous_comment == 0 %>
|
||||
|
@ -178,6 +184,7 @@
|
|||
<% if @homework.homework_detail_manual.comment_status == 0 %>
|
||||
<div class="fontGrey2 db fl ml10">发布时间:<%= @homework.publish_time %> 00:00</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @homework.homework_detail_manual%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 1%>
|
||||
<% end_time = @homework.end_time.to_time.to_i + 24*60*60 - 1 %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//location.reload();
|
||||
<% if params[:detail_page] %>
|
||||
window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @subdomain.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 %>
|
||||
window.location.reload();
|
||||
<% end %>
|
|
@ -56,7 +56,7 @@
|
|||
<%= link_to "编辑文章", edit_org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 1), :class => "postOptionLink" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @organization.id, :detail_page => 1), :method => 'delete',
|
||||
<%= link_to "删除文章", org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 0, :detail_page=>1), :method => 'delete',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:remote => true, :class => 'postOptionLink' %>
|
||||
</li>
|
||||
|
@ -97,6 +97,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% user = User.find(reply.creator_id) %>
|
||||
|
@ -164,6 +165,7 @@
|
|||
postContent=postContent.replace(/ /g," ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('intro_content_<%= @document.id %>');
|
||||
var replyCount = $(".homepagePostReplyContainer").size();
|
||||
if (replyCount >3){
|
||||
for(var i= 3; i < replyCount+1; i++){
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= link_to image_tag(url_to_avatar(User.find(ma.apply_user_id)), :width => "30", :height => "30"), user_path(User.find(ma.apply_user_id)) %></div></a></li>
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= link_to image_tag(url_to_avatar(User.find(ma.apply_user_id)), :width => "30", :height => "30"), user_path(User.find(ma.apply_user_id)), :target => '_blank' %></div></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%= link_to User.find(ma.apply_user_id).show_name,
|
||||
user_path(User.find(ma.apply_user_id)), :class => "newsBlue homepageNewsPublisher" %>
|
||||
user_path(User.find(ma.apply_user_id)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<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.content.nil? ? '' : ':'+ ma.content.to_s %>
|
||||
<%= link_to User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}", student_work_index_path(:homework => ma.course_message.id), :title => User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}",:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
|
||||
<%= link_to User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}", student_work_index_path(:homework => ma.course_message.id), :title => User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}",:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}", :target => '_blank' %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
</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 == 1 ? '同意' : '拒绝'%>引用资源:</span>
|
||||
<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 == 1 ?
|
||||
<% 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) + '"的申请被婉拒' %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="orig_cont clearfix">
|
||||
<% unless comment.parent.nil? %>
|
||||
<div id="comment_reply_<%=comment.id %>">
|
||||
<div>
|
||||
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %></p>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<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(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>
|
||||
<% count=0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:teacher).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:teacher), user_path(activity.tea_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -216,9 +216,9 @@
|
|||
|
||||
<div class="mr10 mb10 mt10 fl w100 fontGrey2" style="text-align: center;">
|
||||
<% 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 %>
|
||||
<%= 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 %>
|
||||
<% com_time = project.project_score.commit_time %>
|
||||
<% time=project.updated_on %>
|
||||
|
@ -321,6 +321,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -56,6 +56,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -117,6 +117,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
autoUrl('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
|
@ -125,7 +126,7 @@
|
|||
<%= 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 class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if @ctivity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
|
@ -94,6 +94,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
|
@ -102,7 +103,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
|
|
|
@ -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>
|
||||
</div>
|
||||
<div class="ml15 mt10">
|
||||
<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(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>
|
||||
<% count=0 %>
|
||||
<% 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>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue