Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course

This commit is contained in:
Tim 2016-06-07 09:01:53 +08:00
commit 253d9da345
111 changed files with 1472 additions and 1515 deletions

View File

@ -1,25 +0,0 @@
<html>
<head>
<title>
Client
</title>
</head>
<body>
<hr />
<h2>这是一张图片</h2>
<p>photo<a href="http://10.0.47.15:3000/shares/new?access_token='2d3dda45dsd'&comment='verygood'&title=davide&share_type=1&url=http://www.baidu.com"> Share A </a></p>
<hr />
<h2>这是一段视频</h2>
<p>Text<a href="http://10.0.47.15:3000/shares/new?access_token=2d3dda45dsd&comment=verygood&title=kaka&share_type=2&url=http://www.sina.com"> Share B </a></p>
<hr />
<h2>这是一篇文章</h2>
<p>Text<a href="http://10.0.47.15:3000/shares/new?access_token=2d3dda45dsd&comment=verygood&title=pepe&share_type=3&url=http://www.sina.com"> Share C </a></p>
<hr />
</body>
</html>

View File

@ -1,386 +0,0 @@
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

112
Gemfile~
View File

@ -1,112 +0,0 @@
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

View File

@ -13,34 +13,18 @@ module Mobile
end
post do
user = UserWechat.find_by_openid(params[:openid]).user
=begin
shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.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.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')"
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(','))+")"
activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc')
=end
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.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(",") + ")"
user_project_ids = (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).join(",") + ")"
user_course_ids = (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
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 + ")"
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
blog_ids = "(" + watched_user_blog_ids + ")"
activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +

View File

@ -41,11 +41,11 @@ module Mobile
end
when :description
if ac.act_type == "HomeworkCommon" || ac.act_type == "Issue" || ac.act_type == "News"
ac.act.description unless ac.nil? || ac.act.nil?
strip_html(ac.act.description) unless ac.nil? || ac.act.nil?
elsif ac.act_type == "Message" || ac.act_type == "BlogComment"
ac.act.content unless ac.nil? || ac.act.nil?
strip_html(ac.act.content) unless ac.nil? || ac.act.nil?
elsif ac.act_type == "JournalsForMessage"
ac.act.notes unless ac.nil? || ac.act.nil?
strip_html(ac.act.notes) unless ac.nil? || ac.act.nil?
end
when :latest_update
time_from_now ac.updated_at unless ac.nil?
@ -98,6 +98,7 @@ module Mobile
end
expose :act_type #缺陷/作业/讨论区/留言等类型
expose :act_id
expose :id
expose :container_type #课程/项目/博客/个人
expose :author, using: Mobile::Entities::User do |a, opt| #用户信息
if a.is_a? ::UserActivity

View File

@ -363,7 +363,11 @@ class ApplicationController < ActionController::Base
when "contest"
return true
when "Course"
allowed = User.current.allowed_to?(:course_attachments_download, @course, :global => false)
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

View File

@ -304,7 +304,7 @@ class CoursesController < ApplicationController
@render_file = 'new_member_list'
@score_sort_by = "desc"
@sort_type = "score"
@sort_type = params[:sort_type] ? params[:sort_type] : "score"
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
@role = params[:role].nil? ? '2':params[:role]
@is_remote = true
@ -319,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,@score_sort_by)
@all_members = student_homework_score(0,page, 10,@score_sort_by,@sort_type)
@members = @all_members
else
render_403

View File

@ -304,7 +304,7 @@ class MessagesController < ApplicationController
@content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
@temp = Message.new
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @message.author)} <br/>#{@message.content.html_safe}</blockquote>".html_safe
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @message.author.show_name)} <br/>#{@message.content.html_safe}</blockquote>".html_safe
end
def preview

View File

@ -1,5 +1,6 @@
class OrgDocumentCommentsController < ApplicationController
before_filter :find_organization, :only => [:new, :create, :show, :index]
before_filter :authorize_allowed, :only => [:create, :add_reply]
helper :attachments,:organizations
layout 'base_org'
@ -101,16 +102,22 @@ class OrgDocumentCommentsController < ApplicationController
@organization = Organization.find(params[:organization_id])
end
def authorize_allowed
unless User.current.logged?
redirect_to signin_url
return
end
end
def destroy
@org_document_comment = SubDocumentComment.find(params[:id])
@sub_domain = @org_document_comment.sub_domain
@org_subfield = @sub_domain.org_subfield
# org = @org_document_comment.organization
# if @org_document_comment.id == org.home_id
# org.update_attributes(:home_id => nil)
# end
@org_document_comment.destroy
# end
@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)
end
if @org_document_comment.destroy
end
respond_to do |format|
format.js
end

View File

@ -390,7 +390,7 @@ class StudentWorkController < ApplicationController
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
end
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
if @order == 'lastname'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
@ -456,7 +456,7 @@ class StudentWorkController < ApplicationController
@student_work_count = (search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count
else
if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
if @order == 'lastname'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'

View File

@ -1,6 +1,7 @@
class SubDocumentCommentsController < ApplicationController
before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy, :edit]
before_filter :find_subfield_content, :only => [:show, :index]
before_filter :authorize_allowed, :only => [:create, :add_reply]
helper :attachments,:organizations
layout 'base_sub_domain'
@ -125,6 +126,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{
@ -205,4 +208,11 @@ class SubDocumentCommentsController < ApplicationController
def find_subfield_content
@subfield_content = @organization.org_subfields.order("priority")
end
def authorize_allowed
unless User.current.logged?
redirect_to signin_url
return
end
end
end

View File

@ -320,7 +320,7 @@ class UsersController < ApplicationController
case params[:agree]
when 'Y'
ar.update_column('status', 2)
@msg.update_attributes(:apply_result => 1, :viewed => 1)
@msg.update_attributes(:apply_result => 1, :viewed => 1)
ar.course_messages << CourseMessage.new(:user_id => ar.user_id, :course_id => -1, :viewed => false, :apply_result => 2, :status => 1)
when 'N'
ar.update_column('status', 3)
@ -539,28 +539,28 @@ class UsersController < ApplicationController
end
def student_homeworks
if User.current == @user
@page = params[:page] ? params[:page].to_i + 1 : 0
user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
if User.current == @user
@page = params[:page] ? params[:page].to_i + 1 : 0
user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
#判断当前用户在当前课程的身份
visibleCourse = @user.courses.empty? ? [] : @user.courses.where("is_delete = 0").visible
homework_ids = []
visibleCourse.each do |course|
homeworks = HomeworkCommon.where("course_id = #{course.id} and publish_time <= '#{Date.today}'")
homework_ids << homeworks.pluck(:id) unless homeworks.empty?
end
visible_homework_ids = homework_ids.size == 0 ? "(-1)" :"(" + homework_ids.join(",") + ")"
@homework_commons = HomeworkCommon.where("id in #{visible_homework_ids}").order("created_at desc").limit(10).offset(@page * 10)
@is_teacher = User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)
@is_in_course = params[:is_in_course].to_i || 0
respond_to do |format|
format.js
format.html {render :layout => 'new_base_user'}
end
else
render_403
#判断当前用户在当前课程的身份
visibleCourse = @user.courses.empty? ? [] : @user.courses.where("is_delete = 0").visible
homework_ids = []
visibleCourse.each do |course|
homeworks = HomeworkCommon.where("course_id = #{course.id} and publish_time <= '#{Date.today}'")
homework_ids << homeworks.pluck(:id) unless homeworks.empty?
end
visible_homework_ids = homework_ids.size == 0 ? "(-1)" :"(" + homework_ids.join(",") + ")"
@homework_commons = HomeworkCommon.where("id in #{visible_homework_ids}").order("created_at desc").limit(10).offset(@page * 10)
@is_teacher = User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)
@is_in_course = params[:is_in_course].to_i || 0
respond_to do |format|
format.js
format.html {render :layout => 'new_base_user'}
end
else
render_403
end
end
def choose_user_course
@ -575,7 +575,7 @@ class UsersController < ApplicationController
end
if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%"
@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)}
@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id} and (#{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p)",:p=>search).select { |course| @user.allowed_to?(:as_teacher,course)}
else
@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)}
end
@ -1095,22 +1095,27 @@ class UsersController < ApplicationController
#引入资源列表根据关键词过滤
def user_ref_resource_search
search = params[:search].to_s.strip.downcase
if(params[:type].blank? || params[:type] == "1") #全部
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询
@attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
" or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like '%#{search}%') ").order("created_on desc")
elsif params[:type] == "2" #课程资源
if User.current.id.to_i != params[:id].to_i
render_403
return
end
@resource_id = params[:mul_id]
@resource_type = params[:mul_type]
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
@score = @b_sort == "desc" ? "asc" : "desc"
@user = User.current
@switch_search = params[:search].nil? ? " " : params[:search]
search = "%#{@switch_search.strip.downcase}%"
# 别人的资源库是没有权限去看的
if(params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like '%#{search}%') ").order("created_on desc")
elsif params[:type] == "3" #项目资源
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc")
elsif params[:type] == "4" #附件
@attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc")
elsif params[:type] == "5" #用户资源
@attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc")
elsif params[:type] == "6" #公共资源
@attachments = Attachment.where("(is_public =1 and is_publish = 1 and container_id is not null)" + "or (author_id = #{params[:id]} and is_publish = 0)").order("created_on desc")
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
# user_org_ids = User.current.organizations.map {|o| o.id}
@attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search)
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
end
@type = params[:type]
@limit = 7
@ -1982,7 +1987,7 @@ class UsersController < ApplicationController
end
end
elsif params[:send_ids].present?
send_ids = params[:send_ids].split(" ")
send_ids = params[:send_ids].split(",")
course_ids = params[:course_ids]
if course_ids.nil?
@flag = false
@ -2058,18 +2063,18 @@ class UsersController < ApplicationController
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
end
elsif params[:type] == "2"
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
if params[:status] == "2"
resource_type = "'Course'"
elsif params[:status] == "3"
resource_type = "'Project'"
elsif params[:status] == "5"
resource_type = "'Principal'"
else
resource_type = "'Project','OrgSubfield','Principal','Course'"
end
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
# elsif params[:type] == "2"
# apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
# if params[:status] == "2"
# resource_type = "'Course'"
# elsif params[:status] == "3"
# resource_type = "'Project'"
# elsif params[:status] == "5"
# resource_type = "'Principal'"
# else
# resource_type = "'Project','OrgSubfield','Principal','Course'"
# end
# @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
end
@type = params[:type]
@limit = 25
@ -2100,7 +2105,8 @@ class UsersController < ApplicationController
project_ids.each do |project_id|
next if ori.blank?
@exist = false
Project.find(project_id).attachments.each do |att| #如果课程中包含该资源
# 如果对象中包含该资源
Project.find(project_id).attachments.each do |att|
if att.id == ori.id || (!att.copy_from.nil? && !ori.copy_from.nil? && att.copy_from == ori.copy_from) || att.copy_from == ori.id || att.id == ori.copy_from
att.created_on = Time.now
att.save
@ -2133,7 +2139,7 @@ class UsersController < ApplicationController
@ori = ori
end
elsif params[:send_ids].present?
send_ids = params[:send_ids].split(" ")
send_ids = params[:send_ids].split(",")
project_ids = params[:projects_ids]
if project_ids.nil?
@flag = false
@ -2211,18 +2217,18 @@ class UsersController < ApplicationController
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
end
elsif params[:type] == "2"
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
if params[:status] == "2"
resource_type = "'Course'"
elsif params[:status] == "3"
resource_type = "'Project'"
elsif params[:status] == "5"
resource_type = "'Principal'"
else
resource_type = "'Project','OrgSubfield','Principal','Course'"
end
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
# elsif params[:type] == "2"
# apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
# if params[:status] == "2"
# resource_type = "'Course'"
# elsif params[:status] == "3"
# resource_type = "'Project'"
# elsif params[:status] == "5"
# resource_type = "'Principal'"
# else
# resource_type = "'Project','OrgSubfield','Principal','Course'"
# end
# @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
end
@status = params[:status]
@type = params[:type]
@ -2280,7 +2286,7 @@ class UsersController < ApplicationController
end
@ori = ori
elsif params[:send_ids].present?
send_ids = params[:send_ids].split(" ")
send_ids = params[:send_ids].split(",")
subfield_id = params[:subfield]
if subfield_id.nil?
@flag = false
@ -2352,18 +2358,18 @@ class UsersController < ApplicationController
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
end
elsif params[:type] == "2"
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
if params[:status] == "2"
resource_type = "'Course'"
elsif params[:status] == "3"
resource_type = "'Project'"
elsif params[:status] == "5"
resource_type = "'Principal'"
else
resource_type = "'Project','OrgSubfield','Principal','Course'"
end
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
# elsif params[:type] == "2"
# apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
# if params[:status] == "2"
# resource_type = "'Course'"
# elsif params[:status] == "3"
# resource_type = "'Project'"
# elsif params[:status] == "5"
# resource_type = "'Principal'"
# else
# resource_type = "'Project','OrgSubfield','Principal','Course'"
# end
# @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
end
@type = params[:type]
@limit = 25
@ -2700,7 +2706,7 @@ class UsersController < ApplicationController
# 获取公共资源
def get_public_resources user_course_ids, user_project_ids, order, score
attachments = Attachment.where("(is_publish = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
attachments = Attachment.where("(is_publish = 1 and is_public = 1 and container_id is not null and container_type in('Project','OrgSubfield','Principal','Course')) ").order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取公共资源搜索
@ -2725,19 +2731,19 @@ class UsersController < ApplicationController
# 获取我的课程资源
def get_course_resources author_id, user_course_ids, order, score
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Course')"+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})
and is_publish = 1 and container_id is not null)" ).order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我的私有资源分享结果
def get_my_private_resources apply_ids, resource_type, order, score
attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我的私有资源分享搜索结果
def get_my_private_resources_search apply_ids, resource_type, order, score, search
attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
end
# # 获取我的私有资源分享结果
# def get_my_private_resources apply_ids, resource_type, order, score
# attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type})").order("#{order.nil? ? 'created_on' : order} #{score}")
# end
#
# # 获取我的私有资源分享搜索结果
# def get_my_private_resources_search apply_ids, resource_type, order, score, search
# attachments = Attachment.where("id in (#{apply_ids.empty? ? '0': apply_ids.join(',')}) and container_type in(#{resource_type}) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
# end
# 获取我的课程资源中搜索结果
def get_course_resources_search author_id, user_course_ids, order, score, search
@ -2748,18 +2754,18 @@ class UsersController < ApplicationController
# 获取公共资源中课程资源
def get_course_resources_public user_course_ids, order, score
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1)").order("#{order.nil? ? 'created_on' : order} #{score}")
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1)").order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取公共资源中课程资源搜索结果
def get_course_resources_public_search user_course_ids, order, score, search
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
attchments = Attachment.where("(container_type = 'Course'and container_id is not null and is_publish = 1 and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我的项目资源
def get_project_resources author_id, user_project_ids, order, score
attchments = Attachment.where("(author_id = #{author_id} and is_publish = 1 and container_id is not null and container_type = 'Project') "+
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
"or (container_type = 'Project' and container_id in (#{user_project_ids.empty? ? '0': user_project_ids.join(',')})
and is_publish = 1 and container_id is not null)").order("#{order.nil? ? 'created_on' : order} #{score}")
end
@ -2772,12 +2778,12 @@ class UsersController < ApplicationController
# 获取公共资源的项目资源
def get_project_resources_public user_project_ids, order, score
attchments = Attachment.where("container_type = 'Project' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
attchments = Attachment.where("container_type = 'Project' and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取公共资源的项目资源搜索
def get_project_resources_public_search user_project_ids, order, score, search
attchments = Attachment.where("(container_type = 'Project' and container_id is not null) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
attchments = Attachment.where("(container_type = 'Project' and container_id is not null and is_public =1) and (filename like :p)", :p => search ).order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我上传的附件
@ -2795,13 +2801,13 @@ class UsersController < ApplicationController
# 获取公共资源中我上传的附件
def get_attch_resources_public order, score
attchments = Attachment.where("container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
and container_id is not null and is_public =1").order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取公共资源中我上传的附件
def get_attch_resources_public_search order, score, search
attchments = Attachment.where("(container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')
and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我的用户类型资源
@ -2816,12 +2822,12 @@ class UsersController < ApplicationController
# 获取我的用户类型资源
def get_principal_resources_public order, score
attchments = Attachment.where("container_type = 'Principal' and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
attchments = Attachment.where("container_type = 'Principal' and is_public =1 and container_id is not null").order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 获取我的用户类型资源
def get_principal_resources_public_search order, score, search
attchments = Attachment.where("(container_type = 'Principal'and container_id is not null) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
attchments = Attachment.where("(container_type = 'Principal'and container_id is not null and is_public =1) and (filename like :p)", :p => search).order("#{order.nil? ? 'created_on' : order} #{score}")
end
# 资源库 分为全部 课程资源 项目资源 附件
@ -2863,18 +2869,18 @@ class UsersController < ApplicationController
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
end
elsif params[:type] == "2" # 私有资源
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
if params[:status] == "2"
resource_type = "'Course'"
elsif params[:status] == "3"
resource_type = "'Project'"
elsif params[:status] == "5"
resource_type = "'Principal'"
else
resource_type = "'Project','OrgSubfield','Principal','Course'"
end
@attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
# elsif params[:type] == "2" # 私有资源
# apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
# if params[:status] == "2"
# resource_type = "'Course'"
# elsif params[:status] == "3"
# resource_type = "'Project'"
# elsif params[:status] == "5"
# resource_type = "'Principal'"
# else
# resource_type = "'Project','OrgSubfield','Principal','Course'"
# end
# @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score)
end
@status = params[:status]
@type = params[:type]
@ -3052,21 +3058,21 @@ class UsersController < ApplicationController
@attachments = get_principal_resources_public_search(@order, @score, search)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
end
elsif params[:type] == "2" # 私有资源
apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
if params[:status] == "2"
resource_type = "'Course'"
elsif params[:status] == "3"
resource_type = "'Project'"
elsif params[:status] == "5"
resource_type = "'Principal'"
else
resource_type = "'Project','OrgSubfield','Principal','Course'"
end
@attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search)
@attachments
# elsif params[:type] == "2" # 私有资源
# apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id}
# if params[:status] == "2"
# resource_type = "'Course'"
# elsif params[:status] == "3"
# resource_type = "'Project'"
# elsif params[:status] == "5"
# resource_type = "'Principal'"
# else
# resource_type = "'Project','OrgSubfield','Principal','Course'"
# end
# @attachments = get_my_private_resources_search(apply_ids, resource_type, @order, @score, search)
# @attachments
end
@status = params[:status]
@type = params[:type]
@ -3121,6 +3127,7 @@ class UsersController < ApplicationController
@orgs = @user.organizations.select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
end
end
@type = params[:type]
@search = params[:search]
#这里仅仅是传递需要发送的资源id
@send_id = params[:send_id]

View File

@ -139,99 +139,110 @@ class WechatsController < ActionController::Base
end
def sendBind(request)
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "您还未绑定确实的用户,请先绑定." } }
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台
" } }
request.reply.news(news) do |article, n, index| # article is return object
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{login_wechat_url}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
pic_url = "#{Setting.protocol}://#{Setting.host_name}/images/weixin_pic.jpg"
article.item title: "#{n[:title]}",
description: n[:content],
pic_url: 'https://www.trustie.net/images/trustie_logo2.png',
pic_url: pic_url,
url: url
end
end
### controller method
module Controllers
def get_open_id
begin
def get_open_id
begin
raise "非法操作, code不存在" unless params[:code]
code = params[:code] || session[:wechat_code]
openid = get_openid_from_code(code)
raise "无法获取到微信openid" unless openid
render :json => {status:0, openid: openid}
rescue Exception=>e
render :json => {status: -1, msg: e.message}
end
end
def bind
begin
code = params[:code] || session[:wechat_code]
openid = get_openid_from_code(code)
raise "无法获取到openid" unless openid
raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid)
user, last_login_on = User.try_to_login(params[:username], params[:password])
raise "用户名或密码错误,请重新登录" unless user
#补全用户信息
raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat
UserWechat.create!(
openid: openid,
user: user
)
ws = WechatService.new
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now))
render :json => {status:0, msg: "绑定成功"}
rescue Exception=>e
render :json => {status: -1, msg: e.message}
end
end
def login
session[:wechat_code] = params[:code] if params[:code]
openid = get_openid_from_code(params[:code])
raise "无法获取到openid" unless openid
render :json => {status:0, openid: openid}
rescue Exception=>e
render :json => {status: -1, msg: e.message}
@wechat_user = user_binded?(openid)
render 'wechats/login', layout: 'base_wechat'
end
end
def bind
begin
raise "非法操作, code不存在" unless params[:code]
openid = get_openid_from_code(params[:code])
raise "无法获取到openid" unless openid
raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid)
def user_activities
session[:wechat_code] = params[:code] if params[:code]
code = params[:code] || session[:wechat_code]
openid = get_openid_from_code(code)
@wechat_user = user_binded?(openid)
unless @wechat_user
redirect_to login_wechat_path
return
end
user, last_login_on = User.try_to_login(params[:username], params[:password])
raise "用户名或密码错误,请重新登录" unless user
#补全用户信息
raise "此用户已经绑定了公众号" if user.user_wechat
UserWechat.create!(
openid: openid,
user: user
)
request.reply.text "欢迎加入Trustie创新实践社区"
render :json => {status:0, msg: "绑定成功"}
rescue Exception=>e
render :json => {status: -1, msg: e.message}
render 'wechats/user_activities', layout: nil
end
end
def login
@code = params[:code] #TODO 安全性
render 'wechats/login', layout: 'base_wechat'
end
private
def get_openid_from_code(code)
openid = session[:wechat_openid]
private
def get_openid_from_code(code)
url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=#{Wechat.config.appid}&secret=#{Wechat.config.secret}&code=#{code}&grant_type=authorization_code"
logger.debug url
body = URI.parse(url).read
logger.debug body
JSON.parse(body)["openid"]
end
def user_binded?(openid)
uw = UserWechat.where(openid: openid).first
end
def user_activity(user)
@user = user
shield_project_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
@page = params[:page] ? params[:page].to_i + 1 : 0
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','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(','))+")"
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc').limit(10).offset(@page * 10)
end
def process_activity(user_activity)
act= user_activity.act
case user_activity.container_type.to_s
when 'Course'
when 'Project'
case user_activity.act_type.to_s
when 'Issue'
[act.project.name.to_s+" | 项目问题", act.subject.to_s, url_to_avatar(act.author),"http://wechat.trustie.net/app.html#/issue/#{act.id}"]
unless openid
if code
openid = wechat.web_access_token(code)["openid"]
end
end
if openid
session[:wechat_openid] = openid
end
return openid
end
def user_binded?(openid)
uw = UserWechat.where(openid: openid).first
end
end
include Controllers
end

View File

@ -10,14 +10,14 @@ class ZipdownController < ApplicationController
#勿删 before_filter :authorize, :only => [:assort,:download_user_homework]
SAVE_FOLDER = "#{Rails.root}/files"
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
MAX_PATH = 50
#统一下载功能
def download
if User.current.logged?
begin
if params[:base64file]
file = Base64.decode64(params[:base64file])
file = file.sub('*', '+')
file = decode64(params[:base64file])
send_file "#{OUTPUT_FOLDER}/#{file}", :filename => filename_for_content_disposition(file), :type => detect_content_type(file)
else
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file])
@ -125,7 +125,11 @@ class ZipdownController < ApplicationController
end
def encode64(str)
Base64.encode64(str).sub('+', '*')
Base64.urlsafe_encode64(str)
end
def decode64(str)
Base64.urlsafe_decode64(str)
end
def zip_homework_common homework_common
@ -242,6 +246,12 @@ class ZipdownController < ApplicationController
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[])
rename_zipfile = zip_name_refer ||= "#{Time.now.to_i.to_s}.zip"
# 文件名过长
if rename_zipfile.size > MAX_PATH
rename_zipfile = rename_zipfile[0,rename_zipfile.size-4][0,MAX_PATH-4] + rename_zipfile[-4,4]
end
zipfile_name = "#{output_path}/#{rename_zipfile}"
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))

View File

@ -182,7 +182,7 @@ module ApiHelper
timeIntoFormat = 0
updateAtValue = ""
if timePassed < 0
updateAtValue = "时间有问题"
updateAtValue = "刚刚"
elsif timePassed < ONE_MINUTE
updateAtValue = "1分钟前"
elsif timePassed < ONE_HOUR

View File

@ -58,12 +58,21 @@ module ApplicationHelper
when "Course"
User.current.member_of_course?(attachment.container) ? true : false
when "OrgSubfield"
User.current.member_of_org?(attachment.container) ? true : false
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 从硬盘上删除对应的资源文件
@ -2089,12 +2098,12 @@ module ApplicationHelper
def attachment_history_candown attachment_history
if attachment_history.container_type == "Course"
course = Course.find(attachment_history.container_id)
candown = User.current.member_of?(course) || (course.is_public && attachment_history.is_public == 1)
candown = User.current.member_of_course?(course) || (course.is_public && attachment_history.is_public == 1)
elsif attachment_history.container_type == "Project"
project = Project.find(attachment_history.container_id)
candown = User.current.member_of?(project) || (project.is_public && attachment_history.is_public == 1)
elsif attachment_history.container_type == "OrgSubfield"
org = OrgSubfield.find(attachment_history.container_id)
org = OrgSubfield.find(attachment_history.container_id).organization
candown = User.current.member_of_org?(org) || (org.organization.is_public && attachment_history.is_public == 1 && (User.current.logged? || org.organization.allow_guest_download?))
end
end
@ -2109,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)

View File

@ -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

View File

@ -77,16 +77,16 @@ class BlogComment < ActiveRecord::Base
end
#博客回复微信模板消息
def blog_wechat_message
ws = WechatService.new
if self.parent_id.nil?
self.author.watcher_users.each do |watcher|
content = strip_html self.author.try(:realname) + " 发表了博客:" + self.title.html_safe, 200
ws.message_update_template watcher.id, "blog_comment", self.id, "#{l(:label_new_blog_template)}", content, format_time(self.created_at)
end
else
content = strip_html self.content.html_safe, 200
ws.comment_template self.parent.author_id, "blog_comment", self.parent_id, "#{l(:label_blog_comment_template)}", self.author.try(:realname), format_time(self.created_at), content
end
end
# def blog_wechat_message
# ws = WechatService.new
# if self.parent_id.nil?
# self.author.watcher_users.each do |watcher|
# content = strip_html self.author.try(:realname) + " 发表了博客:" + self.title.html_safe, 200
# ws.message_update_template watcher.id, "blog_comment", self.id, "#{l(:label_new_blog_template)}", content, format_time(self.created_at)
# end
# else
# content = strip_html self.content.html_safe, 200
# ws.comment_template self.parent.author_id, "blog_comment", self.parent_id, "#{l(:label_blog_comment_template)}", self.author.try(:realname), format_time(self.created_at), content
# end
# end
end

View File

@ -41,15 +41,15 @@ class Comment < ActiveRecord::Base
after_destroy :down_course_score
def act_as_system_message
ws = WechatService.new
#ws = WechatService.new
if self.commented.course
if self.author_id != self.commented.author_id
self.course_messages << CourseMessage.new(:user_id => self.commented.author_id, :course_id => self.commented.course.id, :viewed => false)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.commented.author_id} and shield_type='Course' and shield_id=#{self.commented.course.id}").count
if count == 0
content = strip_html self.comments.html_safe, 200
ws.comment_template self.commented.author_id, "course_notice", self.id, "#{l(:label_notice_comment_template)}", self.author.try(:realname), format_time(self.created_on), content
end
# count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.commented.author_id} and shield_type='Course' and shield_id=#{self.commented.course.id}").count
# if count == 0
# content = strip_html self.comments.html_safe, 200
# ws.comment_template self.commented.author_id, "course_notice", self.id, "#{l(:label_notice_comment_template)}", self.author.try(:realname), format_time(self.created_on), content
# end
end
else # 项目相关
if self.author_id != self.commented.author_id

View File

@ -63,7 +63,7 @@ class HomeworkCommon < ActiveRecord::Base
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")
ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name}#{l(:label_new_homework_template)}", self.course.name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。")
end
# end
end
@ -108,15 +108,15 @@ class HomeworkCommon < ActiveRecord::Base
end
#修改作业后发送微信模板消息
def wechat_message
self.course.members.each do |member|
count = ShieldWechatMessage.where("container_type='User' and container_id=#{member.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
if count == 0
ws = WechatService.new
ws.homework_template(member.user_id, "homework", self.id, "#{l(:label_update_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59")
end
end
end
# def wechat_message
# self.course.members.each do |member|
# count = ShieldWechatMessage.where("container_type='User' and container_id=#{member.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
# if count == 0
# ws = WechatService.new
# ws.homework_template(member.user_id, "homework", self.id, "#{l(:label_update_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59")
# end
# end
# end
delegate :language_name, :language, :to => :homework_detail_programing

View File

@ -160,27 +160,27 @@ class Issue < ActiveRecord::Base
unless self.author_id == self.assigned_to_id
self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false)
end
self.project.members.each do |m|
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
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
# self.project.members.each do |m|
# 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
# 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
if self.tracker_id == 5
self.project.members.each do |m|
if m.roles.first.to_s.include?("Manager") && m.user_id != self.author_id && m.user_id != self.assigned_to_id

View File

@ -238,11 +238,11 @@ class Journal < ActiveRecord::Base
end
#缺陷回复微信模板消息
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
# 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

View File

@ -259,24 +259,24 @@ 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)
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
#content = truncate(strip_tags(self.notes.to_s), length: 200)
content = strip_html self.notes.html_safe, 200
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
# 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
# #content = truncate(strip_tags(self.notes.to_s), length: 200)
# content = strip_html self.notes.html_safe, 200
# 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
# 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
@ -293,7 +293,7 @@ class JournalsForMessage < ActiveRecord::Base
if self.user_id != self.jour_id # 过滤自己给自己的留言消息
receivers << self.jour
content = strip_html self.notes, 200
ws.message_update_template self.jour_id, "journal_for_message", self.id, "#{l(:label_new_journals_template)}", content, format_time(self.created_on)
ws.journal_notice self.jour_id, "journal_for_message", self.id, "#{l(:label_new_journals_template)}", self.user.show_name, format_time(self.created_on),content
end
else # 留言回复
reply_to = User.find(self.reply_id)
@ -303,8 +303,8 @@ class JournalsForMessage < ActiveRecord::Base
if self.user_id != self.parent.jour_id && self.reply_id != self.parent.jour_id # 给东家发信息,如果回复的对象是东家则不发
receivers << self.parent.jour
end
content = strip_html self.notes, 200
ws.comment_template self.reply_id, "journal_for_message", self.parent.id, "#{l(:label_journals_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
#content = strip_html self.notes, 200
#ws.comment_template self.reply_id, "journal_for_message", self.parent.id, "#{l(:label_journals_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
end
receivers.each do |r|
self.user_feedback_messages << UserFeedbackMessage.new(:user_id => r.id, :journals_for_message_id => self.id, :journals_for_message_type => "Principal", :viewed => false)

View File

@ -83,7 +83,7 @@ class Message < ActiveRecord::Base
# after_create :add_author_as_watcher, :reset_counters!, :add_boards_count
after_update :update_messages_board, :update_activity
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets, :decrease_boards_count, :down_course_score
after_create :act_as_course_activity, :act_as_forge_activity, :act_as_student_score, act_as_at_message(:content, :author_id), :add_author_as_watcher, :reset_counters!, :add_boards_count, :act_as_system_message
after_create :act_as_course_activity, :act_as_forge_activity, :act_as_student_score, act_as_at_message(:content, :author_id), :add_author_as_watcher, :reset_counters!, :add_boards_count, :act_as_system_message, :delay_message_send
#before_save :be_user_score
scope :visible, lambda {|*args|
@ -258,28 +258,28 @@ class Message < ActiveRecord::Base
# 主贴项目成员都能收到
# 回帖:帖子的发布人收到
def act_as_system_message
ws = WechatService.new
#ws = WechatService.new
if self.course
if self.parent_id.nil? # 主贴
self.course.members.includes(:user).each do |m|
if self.author.allowed_to?(:as_teacher, self.course) && m.user_id != self.author_id # 老师 自己的帖子不给自己发送消息
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.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
content = strip_html self.subject, 200
ws.topic_publish_template m.user_id, "course_discussion", self.id, "#{l(:label_course_topic_template)}", content, self.author.try(:realname), format_time(self.created_on)
end
# 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
# content = strip_html self.subject, 200
# ws.topic_publish_template m.user_id, "course_discussion", self.id, "#{l(:label_course_topic_template)}", content, self.author.try(:realname), format_time(self.created_on)
# end
end
end
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)
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
ws.comment_template parent_author_id, "course_discussion", self.parent_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), content
end
# 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
# ws.comment_template parent_author_id, "course_discussion", self.parent_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), content
# end
end
end
elsif self.project # 项目相关
@ -287,27 +287,43 @@ class Message < ActiveRecord::Base
self.project.members.includes(:user).each do |m|
if m.user_id != self.author_id
#self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.board.project_id, :viewed => false)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Project' and shield_id=#{self.project.id}").count
if count == 0
content = strip_html self.subject, 200
ws.topic_publish_template m.user_id, "project_discussion", self.id, "#{l(:label_project_topic_template)}", content, self.author.try(:realname), format_time(self.created_on)
end
# count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Project' and shield_id=#{self.project.id}").count
# if count == 0
# content = strip_html self.subject, 200
# ws.topic_publish_template m.user_id, "project_discussion", self.id, "#{l(:label_project_topic_template)}", content, self.author.try(:realname), format_time(self.created_on)
# end
end
end
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)
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
ws.comment_template parent_author_id, "project_discussion", self.parent_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), content
end
# 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
# ws.comment_template parent_author_id, "project_discussion", self.parent_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), content
# end
end
end
end
end
def delay_message_send
if self.course
if self.parent_id.nil? # 发帖
self.delay.contain_messages_message
end
end
end
def contain_messages_message
self.course.members.includes(:user).each do |m|
if self.author.allowed_to?(:as_teacher, self.course) && m.user_id != self.author_id # 老师 自己的帖子不给自己发送消息
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.course_id, :viewed => false)
end
end
end
#更新用户分数 -by zjc
def be_user_score
#新建message且无parent的为发帖

View File

@ -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, :act_as_system_message
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, :delay_news_send
after_update :update_activity
after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score
@ -163,8 +163,8 @@ class News < ActiveRecord::Base
end
end
#课程/项目通知 消息发送
#消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒
# 课程/项目通知 消息发送
# 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒
def act_as_system_message
if self.course
self.course.members.each do |m|
@ -174,7 +174,7 @@ class News < ActiveRecord::Base
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)}", content, format_time(self.created_on)
ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情"
end
end
end
@ -189,6 +189,20 @@ class News < ActiveRecord::Base
end
end
def delay_news_send
if self.course
self.delay.contain_news_message
end
end
def contain_news_message
self.course.members.each do |m|
if m.user_id != self.author_id
self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => container_id, :viewed => false)
end
end
end
# Time 2015-03-31 13:50:54
# Author lizanle
# Description 删除news后删除对应的资源

View File

@ -5,7 +5,7 @@ class WechatService
data = {
touser:openid,
template_id:template_id,
url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect",
url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect",
topcolor:"#FF0000",
data:{
first: {
@ -44,7 +44,6 @@ class WechatService
end
Rails.logger.info "send over. #{req}"
end
Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect"
end
def topic_publish_template(user_id, type, id, first, key1, key2, key3, remark="")
@ -59,7 +58,6 @@ class WechatService
end
Rails.logger.info "send over. #{req}"
end
Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect"
end
def comment_template(user_id,type, id, first, key1, key2, key3, remark="")
@ -74,7 +72,6 @@ class WechatService
end
Rails.logger.info "send over. #{req}"
end
Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect"
end
def message_update_template(user_id, type, id, first, key1, key2, remark="")
@ -83,7 +80,7 @@ class WechatService
data = {
touser:uw.openid,
template_id:"YTyNPZnQD8uZFBFq-Q6cCOWaq5LA9vL6RFlF2JuD5Cg",
url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect",
url:"https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect",
topcolor:"#FF0000",
data:{
first: {
@ -112,6 +109,145 @@ class WechatService
end
Rails.logger.info "send over. #{req}"
end
Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect"
end
def two_keys_template(openid, template_id, type, id, first, key1, key2, remark="")
data = {
touser:openid,
template_id:template_id,
url:"#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}",
topcolor:"#FF0000",
data:{
first: {
value:first,
color:"#707070"
},
keyword1:{
value:key1,
color:"#707070"
},
keyword2:{
value:key2,
color:"#707070"
},
remark:{
value:remark,
color:"#707070"
}
}
}
data
end
def four_keys_template(openid, template_id, type, id, first, key1, key2, key3, key4, remark="")
data = {
touser:openid,
template_id:template_id,
url:"#{Setting.protocol}://#{Setting.host_name}/assets/wechat/app.html#/#{type}/#{id}",
topcolor:"#FF0000",
data:{
first: {
value:first,
color:"#707070"
},
keyword1:{
value:key1,
color:"#707070"
},
keyword2:{
value:key2,
color:"#707070"
},
keyword3:{
value:key3,
color:"#707070"
},
keyword4:{
value:key4,
color:"#707070"
},
remark:{
value:remark,
color:"#707070"
}
}
}
data
end
def binding_succ_notice(user_id, first, key1, key2)
uw = UserWechat.where(user_id: user_id).first
unless uw.nil?
data = {
touser:uw.openid,
template_id:Wechat.config.binding_succ_notice,
url:"#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities",
topcolor:"#FF0000",
data:{
first: {
value:first,
color:"#707070"
},
keyword1:{
value:key1,
color:"#707070"
},
keyword2:{
value:key2,
color:"#707070"
},
remark:{
value:"绑定成功后可使用微信查看Trustie平台最新动态",
color:"#707070"
}
}
}
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
Rails.logger.error "[homework] ===> #{e}"
end
Rails.logger.info "send over. #{req}"
end
end
def journal_notice(user_id, type, id, first, key1, key2, remark="")
uw = UserWechat.where(user_id: user_id).first
unless uw.nil?
data = two_keys_template uw.openid,Wechat.config.journal_notice, type, id, first, key1, key2, remark
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
Rails.logger.error "[homework] ===> #{e}"
end
Rails.logger.info "send over. #{req}"
end
end
def homework_message_notice(user_id, type, id, first, key1, key2, remark="")
uw = UserWechat.where(user_id: user_id).first
unless uw.nil?
data = two_keys_template uw.openid,Wechat.config.homework_message_notice, type, id, first, key1, key2, remark
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
Rails.logger.error "[homework] ===> #{e}"
end
Rails.logger.info "send over. #{req}"
end
end
def class_notice(user_id, type, id, first, key1, key2, key3, key4, remark="")
uw = UserWechat.where(user_id: user_id).first
unless uw.nil?
data = four_keys_template uw.openid,Wechat.config.class_notice, type, id, first, key1, key2, key3, key4, remark
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
Rails.logger.error "[homework] ===> #{e}"
end
Rails.logger.info "send over. #{req}"
end
end
end

View File

@ -2,6 +2,6 @@ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'attachments/sh
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().css("top","40%").css("left","50%").css("position","fixed");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");

View File

@ -207,6 +207,9 @@
$(function(){
var postContent = $("#message_description_<%= @article.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$("#message_description_<%= @article.id %>").html(postContent);
autoUrl('message_description_<%= @article.id %>');
});

View File

@ -1,17 +1,17 @@
<script type="text/javascript">
function submit_copy_course() {
if(regex_course_name()&&regex_course_class_period()&&regex_time_term()&&regex_course_password())
if(regex_course_name('new')&&regex_course_class_period('new')&&regex_time_term('new')&&regex_course_password('new'))
{
$("#new_course").submit();
document.getElementById("submit_copy_course").onclick = "";
}
}
$(document).ready(function(){
$("#time").change(function(){
document.getElementById("end_time").options[document.getElementById("time").selectedIndex].selected = true;
$("#new_time").change(function(){
document.getElementById("new_end_time").options[document.getElementById("new_time").selectedIndex].selected = true;
});
$("#term").change(function(){
document.getElementById("end_term").options[document.getElementById("term").selectedIndex].selected = true;
$("#new_term").change(function(){
document.getElementById("new_end_term").options[document.getElementById("new_term").selectedIndex].selected = true;
});
var popupHeight = $(".referenceResourcesPopup").outerHeight(true);
@ -56,35 +56,35 @@
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="course_name" class="courses_input grey_border" maxlength="100" onkeyup="regex_course_name();" value="<%=@course.name %>">
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
<input type="text" name="course[name]" id="new_course_name" class="courses_input grey_border" maxlength="100" onkeyup="regex_course_name('new');" value="<%=@course.name %>">
<span class="c_red" id="new_course_name_notice" style="display: none;">课程名称不能为空</span>
<div class="cl"></div>
<li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>
<input type="text" name="class_period" id="class_period" class="hwork_input02 grey_border" onkeyup="regex_course_class_period();" maxlength="6" value="<%=@course.class_period %>">
<span class="c_red" id="course_class_period_notice" style="display: none;"></span>
<input type="text" name="class_period" id="new_class_period" class="hwork_input02 grey_border" onkeyup="regex_course_class_period('new');" maxlength="6" value="<%=@course.class_period %>">
<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</label>
<%= select_tag :time,options_for_select(course_time_option(@new_course.time),@new_course.time), {} %>
<%= select_tag :term,options_for_select(course_term_option,@new_course.term || cur_course_term),{} %>
<span class="c_red" id="course_time_term_notice"></span>
<%= select_tag :time,options_for_select(course_time_option(@new_course.time),@new_course.time), {:id=>"new_time"} %>
<%= select_tag :term,options_for_select(course_term_option,@new_course.term || cur_course_term),{:id=>"new_term"} %>
<span class="c_red" id="new_course_time_term_notice"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label>
<%= select_tag :end_time,options_for_select(course_time_option(@new_course.end_time),@new_course.end_time), {} %>
<%= select_tag :end_term,options_for_select(course_term_option,@new_course.end_term || cur_course_term),{} %>
<%= select_tag :end_time,options_for_select(course_time_option(@new_course.end_time),@new_course.end_time), {:id=>"new_end_time"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@new_course.end_term || cur_course_term),{:id=>"new_end_term"} %>
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</label>
<input type="text" style="display: none;">
<input type="text" name="course[password]" id="course_course_password" class="hwork_input02 grey_border" onkeyup="regex_course_password();" value="<%=@course.password %>">
<input type="text" name="course[password]" id="new_course_course_password" class="hwork_input02 grey_border" onkeyup="regex_course_password('new');" value="<%=@course.password %>">
<!--<a id="psw_btn" href="javascript:void(0)">显示明码</a>-->
<span class="c_red" id="course_course_password_notice"></span>
<span class="c_red" id="new_course_course_password_notice"></span>
<div class="cl"></div>
<span class="ml95 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>

View File

@ -1,6 +1,11 @@
<% unless contributor_course_scor(course.id).count == 0 %>
<ul class="rankList">
<h4>课程活跃度
<h4>
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "课程活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => '' %>
<% else %>
课程活跃度
<% end %>
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
</h4>
<div class="numIntro undis" style="cursor:pointer;">

View File

@ -1,7 +1,12 @@
<% hero_homework_scores = hero_homework_score(course, "desc") %>
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
<ul class="rankList">
<h4><span>课程英雄榜</span>
<h4>
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
<%= link_to "课程英雄榜", course_member_path(course, :role => 2), :class => '' %>
<% else %>
<span>课程英雄榜</span>
<% end %>
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor:pointer;">积分规则</a></h4>
<div style="cursor:pointer;" class="numIntro undis">
<div class="hero-degree-rule">积分规则<br/>

View File

@ -9,15 +9,17 @@
<div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span>
<%= link_to "#{journal.user.show_name}(#{journal.user.login})", user_path(journal.user),:class => 'c_blue fb fl mb10 f14', :target => "_blank"%>
<%= link_to journal.user.show_name, user_path(journal.user),:class => 'c_blue fb fl mb10 f14', :target => "_blank"%>
</span>
<span class="c_grey fr f14">
<%= format_time(journal.created_on) %>
</span>
<div class="cl"></div>
<p>
<%= journal.notes.html_safe %>
</p>
<div class = "ping_journal" id="journal_<%= journal.id %>">
<p>
<%= journal.notes.html_safe %>
</p>
</div>
<div class="cl"></div>
</div>
<div class="ping_disfoot f14">
@ -52,6 +54,12 @@
</div>
<div class="cl"></div>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('journal_<%= journal.id %>');
autoUrl('journal_<%= journal.id %>');
});
</script>
<% end %>
<% end %>

View File

@ -26,7 +26,7 @@
<li class="ml10" style="padding-right: 15px;"><span class="fontGrey6 fb">学号</span></li>
<li style="padding-right: 55px; margin-left: 160px;"><span class="fontGrey6 fb">分班</span></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'%>
<%= 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 => 'ml35'%>
<% if @sort_type == "score" && @score_sort_by == 'desc' %>
<a id="pic" href="javascript:" class= "st_down"></a>
<% elsif @sort_type == "score" && @score_sort_by == 'asc' %>
@ -51,17 +51,9 @@
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<ul>
<% if @canShowCode %>
<li>
<% if member.user.show_name == ''%>
<%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.name}</span>".html_safe,user_path(member.user)) %>
<% else%>
<%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.show_name}</span>".html_safe,user_path(member.user)) %>
<%end%>
</li>
<% else %>
<li><%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.name}</span>".html_safe, user_path(member.user)) %></li>
<% end %>
<li>
<%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.show_name}</span>".html_safe,user_path(member.user)) %>
</li>
<br/>
<% unless member.user.user_extensions.student_id == ''%>
<li><%= link_to("#{l(:label_bidding_user_studentcode)}<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>

View File

@ -8,36 +8,36 @@
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name();">
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空且至少有两个字符</span>
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name('new');">
<span class="c_red" id="new_course_name_notice" style="display: none;">课程名称不能为空且至少有两个字符</span>
</li>
<div class="cl"></div>
<li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>
<input type="text" name="class_period" id="class_period" class="hwork_input02" onkeyup="regex_course_class_period();" maxlength="6">
<span class="c_red" id="course_class_period_notice" style="display: none;"></span>
<input type="text" name="class_period" id="new_class_period" class="hwork_input02" onkeyup="regex_course_class_period('new');" maxlength="6">
<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</label>
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %>
<span class="c_red" id="course_time_term_notice"></span>
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"new_time"} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"new_term"} %>
<span class="c_red" id="new_course_time_term_notice"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{} %>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"new_end_time"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"new_end_term"} %>
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则不用修改。</span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</label>
<input type="text" style="display: none;">
<input type="password" name="course[password]" id="course_course_password" class="hwork_input02" onkeyup="regex_course_password();">
<input type="password" name="course[password]" id="new_course_course_password" class="hwork_input02" onkeyup="regex_course_password('new');">
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
<span class="c_red" id="course_course_password_notice"></span>
<span class="c_red" id="new_course_course_password_notice"></span>
<div class="cl"></div>
<span class="ml80 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>
@ -75,11 +75,11 @@
<div class="cl"></div>
<script>
$(function(){
$("#time").change(function(){
document.getElementById("end_time").options[document.getElementById("time").selectedIndex].selected = true;
$("#new_time").change(function(){
document.getElementById("new_end_time").options[document.getElementById("new_time").selectedIndex].selected = true;
});
$("#term").change(function(){
document.getElementById("end_term").options[document.getElementById("term").selectedIndex].selected = true;
$("#new_term").change(function(){
document.getElementById("new_end_term").options[document.getElementById("new_term").selectedIndex].selected = true;
});
});
</script>

View File

@ -33,35 +33,35 @@
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name();" value="<%= @course.name%>">
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
<input type="text" name="course[name]" id="edit_course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name('edit');" value="<%= @course.name%>">
<span class="c_red" id="edit_course_name_notice" style="display: none;">课程名称不能为空</span>
<input type="password" style="top: -100000px;position: fixed;">
</li>
<div class="cl"></div>
<li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>
<input type="text" name="class_period" id="class_period" class="hwork_input02" onkeyup="regex_course_class_period();" maxlength="6" value="<%= @course.class_period%>">
<span class="c_red" id="course_class_period_notice" style="display: none;"></span>
<input type="text" name="class_period" id="edit_class_period" class="hwork_input02" onkeyup="regex_course_class_period('edit');" maxlength="6" value="<%= @course.class_period%>">
<span class="c_red" id="edit_course_class_period_notice" style="display: none;"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</label>
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"time"} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"term"} %>
<%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {:id=>"edit_time"} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"edit_term"} %>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"end_time"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"end_term"} %>
<span class="c_red" id="course_time_term_notice"></span>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),@course.end_time), {:id=>"edit_end_time"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"edit_end_term"} %>
<span class="c_red" id="edit_course_time_term_notice"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_new_course_password)%>&nbsp;&nbsp;</label>
<input type="password" name="course[password]" id="course_course_password" class="hwork_input02" value="<%= @course.password%>" onkeyup="regex_course_password();">
<input type="password" name="course[password]" id="edit_course_course_password" class="hwork_input02" value="<%= @course.password%>" onkeyup="regex_course_password('edit');">
<a id="psw_btn" href="javascript:void(0)">显示明码</a>
<span class="c_red" id="course_course_password_notice"></span>
<span class="c_red" id="edit_course_course_password_notice"></span>
<div class="cl"></div>
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>

View File

@ -1,10 +1,20 @@
<div id="popbox02">
<div class="ni_con">
<% if @homework.is_open == 0 %>
<% if @homework.is_open == 0 && @homework.course.is_public == 1 %>
<h2>公开作品</h2>
<p>
本次作业的所有作品将对Trustie平台所有注册用户开放请问是否确定公开作品
</p>
<% elsif @homework.is_open == 0 && @homework.course.is_public == 0 %>
<h2>公开作品</h2>
<p>
该作业是私有课程的作业,公开作品后本次作业的所有作品将对课程内的所有学生开放,请问是否确定公开作品?
</p>
<% elsif @homework.is_open == 1 && @homework.course.is_public == 0 %>
<h2>取消公开作品</h2>
<p>
您将取消“公开作品”的功能,该私有作业的作品将只在作业截止后对已提交作品的学生开放,请问是否确定?
</p>
<% else %>
<h2>取消公开作品</h2>
<p>

View File

@ -6,15 +6,15 @@
<p class="pro_page_tit" style="word-break:break-all;">
<% case @issue.tracker_id %>
<% when 1%>
<span class="issues fl" title="缺陷"></span>
<span class="fl" title="缺陷">【缺陷】</span>
<% when 2%>
<span class="issues-function fl" title="功能"></span>
<span class="fl" title="功能">【功能】</span>
<% when 3%>
<span class="support fl" title="支持"></span>
<span class="fl" title="支持">【支持】</span>
<% when 4%>
<span class="duty fl" title="任务"></span>
<span class="fl" title="任务">【任务】</span>
<% when 5%>
<span class="weekly fl" title="周报"></span>
<span class="fl" title="周报">【周报】</span>
<% end %>
</span> <span style="padding-left: 5px;"><%= @issue.subject %></span>
<span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span></p>

View File

@ -157,9 +157,9 @@
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
<%= l(:label_expend_information)%>
<label id="expend_more_information" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img src="/images/jiantou.jpg" width="12" height="6" />
<img id="arrow" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
</div><!--项目简介 end-->

View File

@ -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 => @sub_domain.id)%>';
window.location.href = '<%= organization_path(params[:organization_id],:org_subfield_id => @org_sub_id )%>';
<% else %>
window.location.reload();
<% end %>

View File

@ -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 %>

View File

@ -28,7 +28,7 @@
<%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
</h3>
<div class="resources-tagbox">
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %>
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to activity.description.to_s.html_safe, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
</div>
<%#= link_to "更多", student_work_index_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %>
@ -50,7 +50,7 @@
<% end %>
</h3>
<div class="resources-tagbox">
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28} %>
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
</div>
</div>
@ -67,7 +67,7 @@
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
</h3>
<div class="resources-tagbox">
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %>
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
</div>
<%#= link_to "更多", news_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %>
@ -130,7 +130,7 @@
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
</h3>
<div class="resources-tagbox">
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %>
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to activity.description.to_s.html_safe, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
</div>
</div>
@ -151,7 +151,7 @@
<% end %>
</h3>
<div class="resources-tagbox">
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28} %>
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
</div>
</div>
@ -168,7 +168,7 @@
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
</h3>
<div class="resources-tagbox">
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28} %>
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => activity.id, :content=> activity.description, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to activity.content.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
</div>
<%#= link_to "更多", news_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %>
@ -214,7 +214,7 @@
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-title sn-hidden" %>
</h3>
<div class="resources-tagbox">
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight=>54, :maxwordsnum => 28} %>
<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to document.content.to_s.html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-tag" %>
</div>
<%#= link_to "更多", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => "more-btn", :target => "_blank" %>
@ -244,7 +244,7 @@
<% end %>
</h3>
<div class="resources-tagbox">
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %>
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %>
</div>
<%#= link_to "更多", board_message_url_in_org(message.board.id,message.id), :class => "more-btn", :target => "_blank" %>
@ -264,7 +264,7 @@
<% end %>
</h3>
<div class="resources-tagbox">
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %>
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28, :maxwidth=>0} %>
<%#= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %>
</div>
<%#= link_to "更多", board_message_path(message.board,activity), :class => "more-btn", :target => "_blank" %>
@ -285,7 +285,7 @@
</h3>
<div class="resources-tagbox">
<%#= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %>
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => news.id, :content=> news.description, :maxheight=>54, :maxwordsnum => 28, :maxwordsnum => 28} %>
<%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => news.id, :content=> news.description, :maxheight=>54, :maxwordsnum => 28, :maxwordsnum => 28, :maxwidth=>0} %>
</div>
<%#= link_to "更多", news_path(news), :class => "more-btn", :target => "_blank" %>
</div>

View File

@ -6,11 +6,13 @@
<div class="ping_discon" style="width: 610px;">
<div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %>
<span><%= link_to journal.user.show_name, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %>
</span><span class="c_grey fr f14"><%= format_time(journal.created_on) %></span>
<div class="cl"></div>
<!--<p><%#= textilizable journal.notes%></p>-->
<p><%=journal.notes.html_safe%>
<div class = "ping_journal" id="journal_<%= journal.id %>">
<p><%=journal.notes.html_safe%></p>
</div>
</div>
<div class="ping_disfoot f14">
<% ids = 'project_respond_form_'+ journal.id.to_s%>
@ -44,6 +46,12 @@
</div>
<div class="cl"></div>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('journal_<%= journal.id %>');
autoUrl('journal_<%= journal.id %>');
});
</script>
<% end %>
<% end %>

View File

@ -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 %>

View File

@ -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>

View File

@ -31,9 +31,6 @@
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
<% end %>
<% u = User.where("id=?",activity.author_id).first%>
<span class="fr grayTxt">
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
</span>
<div class="cl"></div>
</div>
<div class="massages-content ml15">
@ -42,11 +39,13 @@
<% else %>
<% content = activity.parent.content %>
<% end %>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %></p>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %></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">
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
</span>
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
<% count=0 %>
<% if activity.parent %>
<% count=activity.parent.children.count%>

View File

@ -24,16 +24,15 @@
<span class="fl ml10 red-cir-btn">顶</span>
<% end%>
<% u = User.where("id=?",activity.author_id).first%>
<span class="fr grayTxt">
发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
</span>
<div class="cl"></div>
</div>
<div class="massages-content ml15">
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100} %></p>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100, :maxwidth=>563} %></p>
</div>
<div class="ml15 mt10">
<span class="grayTxt">发布:<%= format_time(activity.created_on) %></span>
<span class="grayTxt">
发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
</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 %>

View File

@ -12,6 +12,11 @@
$("#activity_description_<%= user_activity_id%>").css("max-height", heightType + "px");
}
var maxWidth = <%= maxwidth %>
if (maxWidth > 0) {
$("#intro_content_<%= user_activity_id%>").css("max-width", maxWidth + "px");
}
description_showwords_ellipsis(<%=user_activity_id %>,<%= maxwordsnum %>);
});
</script>

View File

@ -1,4 +1,4 @@
<%= form_tag add_exist_file_to_org_user_path(user, :type => defined?(type) ? type : "6" ),:remote=>true,:id=>'orgs_list_form' do %>
<%= form_tag add_exist_file_to_org_user_path(user, :type => @type ),:remote=>true,:id=>'orgs_list_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<div class="sectionWrap fl mr15">

View File

@ -31,9 +31,6 @@
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
<% end %>
<% u = User.where("id=?",activity.author_id).first%>
<span class="fr grayTxt">
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
</span>
<div class="cl"></div>
</div>
<div class="massages-content ml15">
@ -42,11 +39,13 @@
<% else %>
<% content = activity.parent.content %>
<% end %>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %></p>
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %></p>
</div>
<div class="ml15 mt10 f12">
<span class="grayTxt">发帖:<%= format_time(activity.created_on) %></span>
<span class="grayTxt">更新:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %></span>
<span class="grayTxt">
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
</span>
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
<% count=0 %>
<% if activity.parent %>
<% count=activity.parent.children.count%>

View File

@ -1,4 +1,4 @@
<%= form_tag add_exist_file_to_project_user_path(user, :type => defined?(type) ? type : "6" ), :remote => true, :id => 'projects_list_form' %>
<%= form_tag add_exist_file_to_project_user_path(user, :type => @type ), :remote => true, :id => 'projects_list_form' %>
<div>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>

View File

@ -38,16 +38,16 @@
</div>
<div class="homepagePostTitle break_word">
<% case activity.tracker_id %>
<% when 1%>
<span class="issues fl" title="缺陷"></span>
<% when 1%>
<span class="fl" title="缺陷">【缺陷】</span>
<% when 2%>
<span class="issues-function fl" title="功能"></span>
<span class="fl" title="功能">【功能】</span>
<% when 3%>
<span class="support fl" title="支持"></span>
<span class="fl" title="支持">【支持】</span>
<% when 4%>
<span class="duty fl" title="任务"></span>
<span class="fl" title="任务">【任务】</span>
<% when 5%>
<span class="weekly fl" title="周报"></span>
<span class="fl" title="周报">【周报】</span>
<% end %>
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5" %>
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
@ -100,4 +100,4 @@
$(function(){
user_card_show_hide();
});
</script>
</script>

View File

@ -66,11 +66,7 @@
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=user_activity_id %>">
<% if activity.author == User.current %>
<span class="ml15 likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
<% end %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
</span>
</div>
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
@ -108,11 +104,7 @@
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<% if comment.author == User.current %>
<span class="fr likeButton"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<% else %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<% end %>
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">

View File

@ -1,13 +1,16 @@
<div >
<div class="relateText fl mb10 mr5">发送到</div>
<div class="resourcesSendTo mr15">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','file');">
<% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">课程</option>
<option value="2">项目</option>
<option value="3" selected>组织</option>
</select>
</div>
<%= form_tag search_user_org_user_path(user),:method => 'get',
<%= form_tag search_user_org_user_path(user, :type => @type),:method => 'get',
:remote=>true,:id=>'search_user_org_form' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
@ -19,5 +22,5 @@
<div class="cl"></div>
</div>
<div id="org_file_form">
<%= render :partial => 'users/org_file_form', :locals => {:user => user, :orgs => @orgs, :send_id => send_id, :send_ids => send_ids, :type => type} %>
<%= render :partial => 'users/org_file_form', :locals => {:user => user, :orgs => @orgs, :send_id => send_id, :send_ids => send_ids, :type => @type} %>
</div>

View File

@ -2,7 +2,10 @@
<div>
<div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file');">
<% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">课程</option>
<option value="2" selected>项目</option>
<option value="3">组织</option>
@ -12,7 +15,7 @@
</div>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div class="fl">
<%= form_tag search_user_project_user_path(user),:method => 'get',
<%= form_tag search_user_project_user_path(user, :type => @type),:method => 'get',
:remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>

View File

@ -4,7 +4,10 @@
<div>
<div class="sendText fl mr10" style="width: auto">发送到</div>
<div class="resourcesSendTo">
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','file');">
<% unless send_ids.blank? %>
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
<% end %>
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>', '<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
<option value="1">课程</option>
<option value="2">项目</option>
<option value="3">组织</option>
@ -14,10 +17,9 @@
</div>
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
<div class="fl">
<%= form_tag search_user_course_user_path(user),:method => 'get',
:remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<%= form_tag search_user_course_user_path(user),:method => 'get', :remote=>true, :id=> 'search_user_course_form', :class=> 'resourcesSearchBox' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入课程ID或者名称搜索" class="searchResourcePopup" />
<script>
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','file')

View File

@ -6,50 +6,20 @@
<% attachments.each do |attach| %>
<ul class="resource-list" onmouseover="if($('#contextMenu').css('display') != 'block')$(this).children().css('background-color', '#e1e1e1')" onmouseout=" if($('#contextMenu').css('display') == 'none')$(this).children().css('background-color', 'white')">
<li class="resource-list-checkbox fl">
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 && !attach_show_allow(attach) %>
<input name="checkbox1[]" type="checkbox" disabled="disabled" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
<% else %>
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
<% end %>
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="resourcesCheckbox" />
<!--<input name="checkbox2" type="checkbox" value="" class="resourcesCheckbox" />-->
</li>
<li class="resource-list-name fl">
<% if attach.is_public == 0 && !attach_show_allow(attach) && attach.get_apply_resource_status(attach.id, attach.author_id) != "2" %>
<a style="cursor: default" class = "resourcesBlack resource-list-middle hidden mw280" title="<%= attach.filename %>"><%= attach.filename %> </a>
<% else %>
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %>
<% end %>
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current %>
<img src="/images/locked.png" alt="私有" title="私有" class="resource-list-middle" height="16" width="16">
<% end %>
</li>
<li class="resource-list-apply fr" id="resource_apply_status_<%=attach.id %>">
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && !attach_show_allow(attach) %>
<% ah = attach.get_status_by_attach(User.current.id) %>
<% if ah.nil? %>
<%= link_to("请求分享", apply_resource_user_path(User.current.id, :attachment_id => attach.id), :class => 'green_btn_share c_white', :remote => true) %>
<% elsif ah == 1 %>
等待回复
<% elsif ah == 2 %>
可引用
<% elsif ah == 3 %>
已拒绝
<% end %>
<% else %>
--
<% end %>
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %>
</li>
<li class="resource-list-time fr"><%= format_date(attach.created_on) %></li>
<li class="resource-list-quote fr"><%= attach.quotes.nil? ? 0 : attach.quotes %></li>
<li class="resource-list-download fr"><%= attach.downloads %></li>
<li style="display: none"><%= attach.author_id %></li>
<li class="resource-list-size fr"><%= (number_to_human_size(attach.filesize)).gsub("ytes", "") %></li>
<li class="resource-list-uploader fr hidden"><%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
<li class="resource-list-uploader fr hidden"><%= User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %></li>
<li class="resource-list-type fr"><%= get_resource_type(attach.container_type)%></li>
<li class="resource-list-from fr hidden" title="<%= get_resource_origin(attach) %>"><%= get_resource_origin(attach) %></li>
<li style="display: none"><%= attach.is_public %></li>
<li style="display: none"><%= attach.get_apply_resource_status(attach.id, attach.author_id) %></li>
<li style="display: none"><%= attach_show_allow(attach) == true ? 0 : 1 %></li>
<li style="display: none"><%= attach.id %></li>
</ul>
<div class="cl"></div>
@ -72,7 +42,7 @@
function batch_delete(){
var data = $("#resources_list_form").serialize();
if($("input[type=checkbox][data-deleteble=N]:checked").length != 0){
alert("您只能删除自己上传的资源,请重新选择后再删除。");
alert("您无法删除此资源!");
return;
}
if($("input[type=checkbox][data-has-history=Y]:checked").length != 0){
@ -99,11 +69,9 @@
document.oncontextmenu = function() {return true;}
line.children().css("background-color",'white');
id = line.children().last().html();
is_public = line.children().eq(11).html();
user_id = line.children().eq(6).html();
apply_status = line.children().eq(12).html();
user_id = line.children().eq(5).html();
allow = line.children().eq(13).html();
if(is_public == 0 && user_id != '<%= User.current.id %>' && apply_status != 2 && allow == 1){
if( allow == 0){
alert('您无权发送私有资源')
}else{
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
@ -131,13 +99,26 @@
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current.id)%>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type%>",
url: '<%= search_user_project_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}else{
}else if (lastSendType === '1'){
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type%>",
url: '<%= search_user_course_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}else if (lastSendType === '3'){
$.ajax({
type: 'get',
url: '<%= search_user_org_user_path(User.current.id) %>' + '?' + $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
}
else{
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(User.current.id)%>' + '?'+ $("#resources_list_form").serialize() + "&type=<%= @type %>",
data:{send_type:'file'}
});
@ -216,7 +197,7 @@
}
line.children().css("background-color", 'white');
id = line.children().last().html();
user_id = line.children().eq(6).html();
user_id = line.children().eq(5).html();
if(user_id === '<%= User.current.id%>') {
if(line.children().first().children().data('hasHistory') == 'Y'){
alert('该资源存在历史版本,不能删除');
@ -225,7 +206,7 @@
if (confirm('确定要删除资源"' + line.children().eq(1).children().attr('title').trim() + '"么?')) {
$.ajax({
type: 'post',
url: '<%= user_resource_delete_user_path(User.current.id)%>' + '?resource_id=' + id + '&type=<%=@type %>&status=<%=@status %>'
url: '<%= user_resource_delete_user_path(User.current.id) %>' + '?resource_id=' + id + '&type=<%= @type %>&status=<%= @status %>'
});
}

View File

@ -10,11 +10,16 @@
// });
$(document).ready(function(){
<% if type == "1" %>
$("#my_resources_choose_homework").addClass("referenceTypeActive");
$("#public_resources_choose_homework").removeClass("referenceTypeActive");
<% else %>
$(".referenceTypeBlock").click(function(){
var activeBlock = $(".referenceResourceType").children(".referenceTypeActive");
activeBlock.removeClass("referenceTypeActive");
$(this).addClass("referenceTypeActive");
});
<% end %>
});
// 点击 checkbox选中引用的资源的时候保存该资源的id到session里去
@ -36,14 +41,12 @@ function store_seleted_resource(dom){
</div>
<div>
<div class="referenceResourceType fl">
<a href="<%= user_resource_type_user_path(user)%>" class="referenceTypeBlock referenceTypeActive" data-remote="true" >资源库</a>
<a href="<%= user_resource_type_user_path(user,:type=>'2')%>" class="referenceTypeBlock" data-remote="true">课程资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'3')%>" class="referenceTypeBlock" data-remote="true">项目资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'5')%>" class="referenceTypeBlock" data-remote="true">用户资源</a>
<a href="<%= user_resource_type_user_path(user,:type=>'4')%>" class="referenceTypeBlock" data-remote="true">附件</a> </div>
<a href="<%= user_ref_resource_search_user_path(User.current, :type => '6') %>" id="public_resources_choose_homework" class="referenceTypeBlock referenceTypeActive" data-remote="true">公共资源</a>
<a href="<%= user_ref_resource_search_user_path(User.current, :type => '1') %>" id="my_resources_choose_homework" class="referenceTypeBlock" data-remote="true">我的资源</a>
</div>
<div class="fr">
<!--<form class="referenceSearchBox">-->
<%= form_tag(user_ref_resource_search_user_path(user),:method => 'get',:remote=>'true',:class=>'referenceSearchBox') do%>
<%= form_tag(user_ref_resource_search_user_path(user, :type => @type),:method => 'get',:remote=>'true',:class=>'referenceSearchBox') do%>
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="searchReferencePopup" />
<a href="javascript:void(0);" onclick="$(this).parent().submit();" class="referenceSearchIcon"></a>
<% end %>

View File

@ -24,7 +24,7 @@
<% teacher = User.where("id=?",course.tea_id).first%>
<span class="fr grayTxt">
<%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %>
</span>
</span>
</li>
<div class="cl"></div>
<li class="ml15">

View File

@ -70,7 +70,7 @@
<div class="mt5 fl">
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
<%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr15",:title=>"请从资源库中选择文件作为作品的附件",:remote => true%>
<%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %>
<% if defined?(has_program) && has_program %>
<div id="program_setting" class="fl">
<a href="javascript:void(0);" class="ProBtn fl mt3"title="请设置编程语言和输入测试集">编程</a>

View File

@ -1,27 +1,15 @@
<%= form_tag( url_for({:controller => 'users', :action => 'import_into_container',
:mul_id => @resource_id,
:mul_type => @resource_type}),
:method => 'post', :id => 'resource_import_container_form') do %>
:mul_id => @resource_id,
:mul_type => @resource_type}),
:method => 'post', :id => 'resource_import_container_form') do %>
<% @attachments.each do |attach| %>
<ul class="subjectRow">
<li class="subjectName fl hidden">
<label>
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 && !attach_show_allow(attach)%>
<input name="checkbox1[]" type="checkbox" disabled="disabled" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="mr5" style="vertical-align:middle;" />
<% else %>
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="mr5" style="vertical-align:middle;" />
<% end %>
<input name="checkbox1[]" type="checkbox" data-has-history="<%= attach.attachment_histories.count == 0 ? 'N' : 'Y' %>" data-deleteble="<%= User.current.id ==attach.author_id ? 'Y' : 'N' %>" onclick="checkAllBox($(this));" value="<%= attach.id%>" class="mr5" style="vertical-align:middle;" />
<span>
<% if attach.is_public == 0 && !attach_show_allow(attach) && attach.get_apply_resource_status(attach.id, attach.author_id) != 2 %>
<a href="" style="cursor: default" title="<%= attach.filename %>"><%= attach.filename %> </a>
<% else %>
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename%>
<% end %>
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename%>
</span>
<% if attach.is_public == 0 && (@type == "6" || @type == "2") && attach.author != User.current %>
<img src="/images/locked.png" alt="私有" title="私有" class="resource-list-middle" height="16" width="16">
<% end %>
</label>
</li>
<li class="subjectType fl"><%= get_resource_type(attach.container_type)%></li>

View File

@ -1,6 +1,6 @@
<div id="users_setting">
<div id="upload_private_resource">
<%= render :partial => "show_new_upload", :locals => {:type => @type, :status => @status} %>
<%= render :partial => "show_new_upload", :locals => {:type => @type, :status => @status} %>
</div>
<div id="search_div">
<%= render :partial => 'users/resource_search_form',:locals => {:user => @user, :type => @type, :order => @order, :sort => @score, :status => @status} %>
@ -11,7 +11,7 @@
<div class="cl"></div>
<form id="resources_list_form">
<div id="resources_list">
<%= render :partial => 'users/resources_list' , :locals => { :attachments => @attachments} %>
<%= render :partial => 'users/resources_list' , :locals => { :attachments => @attachments, :type => @type} %>
</div>
<div class="cl"></div>
@ -19,13 +19,13 @@
<div class="resource-check-all">
<input id="checkboxAll" type="checkbox" value="" onclick="all_select();" class="resourcesCheckbox" />
</div>
<!--<a href="javascript:void(0);" class="replyGrey mr15" onclick="all_select();">全选</a> -->
<a href="javascript:void(0);" class="replyGrey mr15" onclick="all_select();">全选</a>
<a href="javascript:void(0);" class="replyGrey" onclick="batch_delete();">删除</a> </div>
<div class="cl"></div>
<div class="resourcesSelectSend mt10 fl">
<!--<div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send();">-->
<!--&lt;!&ndash;<a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>&ndash;&gt;-->
<!--</div>-->
<div class="resourcesSelectSendButton fl mr15 inactive-border" onclick="batch_send();">
<a href="javascript:void(0);" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<div class="fl">选择&nbsp;<span class="c_red" id="res_count">0</span>&nbsp;个资源</div>
</div>
@ -215,7 +215,7 @@
document.oncontextmenu = function() {return true;}
line.children().css("background-color",'white');
id = line.children().last().html();
user_id = line.children().eq(6).html();
user_id = line.children().eq(5).html();
if(user_id === '<%= User.current.id %>') {
res_name = line.children().eq(1).children().attr('title');
res_link = line.children().eq(1).html();
@ -232,7 +232,7 @@
}
}
//发送至按钮控制
//发送至按钮控制
$("input[name='checkbox1[]']").click(function(){
if($("input[name='checkbox1[]']:checked").length >= 1){
$(".resourcesSelectSendButton").removeClass("inactive-border");

View File

@ -1,7 +1,7 @@
<ul class="resource-list-tab mt10" id="resource_tip_list">
<li class="resource-list-checkbox fl"> </li>
<li class="resource-list-name fl">资源名称</li>
<li class="resource-list-apply fr">操作</li>
<!--<li class="resource-list-apply fr">操作</li>-->
<li class="resource-list-time fr">
<%= link_to "上传时间", resource_search_user_path(:type => @type, :status => @status, :sort => @score, :order => "created_on", :search => " "), :class => "fl", :remote => true %>
<% if @order == "created_on" %>

View File

@ -1,5 +1,3 @@
<% if params[:is_observe].nil? %>
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');

View File

@ -1,4 +1,4 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user,:homework_id=>@homework_id,:seleted_resources=>@seleted_resources}) %>');
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user, :homework_id => @homework_id, :seleted_resources=> @seleted_resources, :type => @type}) %>');
showModal('ajax-modal', '730px');
$('#ajax-modal').css('height','500px').css("width","730px");
$('#ajax-modal').siblings().remove();

View File

@ -1,2 +1,11 @@
$("#user_ref_resources").html('<%= escape_javascript(render :partial => 'homework_ref_resources_list',:locals=>{:attachments => @attachments,:seleted_resources=>@seleted_resources})%>');
$("#resource_ref_pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_resource',:locals => {:user => @user, :homework_id => @homework_id, :seleted_resources=> @seleted_resources, :type => @type}) %>');
showModal('ajax-modal', '730px');
$('#ajax-modal').css('height','auto').css("width","730px");
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<div class='resourcePopupClose mt5 mr-5'>" + "<a href='javascript:void(0)' class='resourceClose' onclick='hideResource();'></a></div>");
$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed");
$('#ajax-modal').parent().addClass("popbox").addClass("referenceResourcesPopup");
$("#public_resources_choose_homework").attr('href','<%= user_ref_resource_search_user_path(@user, :type => '6') %>');
$("#my_resources_choose_homework").attr('href','<%= user_ref_resource_search_user_path(@user, :type => '1') %>');

View File

@ -8,11 +8,11 @@
}
$(document).ready(function(){
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
$(".resource-switch").click(function(){
$(".resource-switch").children().removeClass("resource-tab-active");
$(this).children().addClass("resource-tab-active");
});
});
function remote_search(){
$("#resource_search_form").submit();
}
@ -55,10 +55,10 @@
<li class="fl resource-switch">
<a href="<%= user_resource_user_path(@user, :type => '1', :status => 6) %>" class="resource-tab" id="my_resource_list" data-remote="true">我的资源</a>
</li>
<li class="fl resource-switch">
<a href="<%= user_resource_user_path(@user, :type => '2', :status => 6) %>" class="resource-tab" id="private_resource_list" data-remote="true">私有资源</a>
</li>
<li class="fl w680 border-bottom h34">&nbsp;</li>
<!--<li class="fl resource-switch">-->
<!--<a href="<%#= user_resource_user_path(@user, :type => '2', :status => 6) %>" class="resource-tab" id="private_resource_list" data-remote="true">申请资源</a>-->
<!--</li>-->
<li class="fl w770 border-bottom h34">&nbsp;</li>
<li class="fr resource-banner-li border-bottom h34">
<div id="user_resource_type_filter">
<%= render :partial => 'user_resource_type_filter' %>

View File

@ -1,4 +1,22 @@
<% if @wechat_user %>
<div class="page">
<div class="weui_msg">
<div class="weui_icon_area"><i class="weui_icon_success weui_icon_msg"></i></div>
<div class="weui_text_area">
<h2 class="weui_msg_title">操作成功</h2>
<p class="weui_msg_desc">您已经绑定过微信了,用户名: (<%= @wechat_user.user.login %>)</p>
</div>
<div class="weui_opr_area">
<p class="weui_btn_area">
<a onclick="WeixinJSBridge.call('closeWindow');" class="weui_btn weui_btn_primary">确定</a>
</p>
</div>
</div>
</div>
<% else %>
<div class="loginIn">
<div>
<p class="weui_cells_title wechat-error">
@ -12,19 +30,16 @@
<div class="weui_cell">
<div class="weui_cell_hd"><label class="weui_label">用户名</label></div>
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" autocapitalize="off" type="text" name="username" placeholder="请输入邮箱地址或昵称"/>
</div>
<input class="weui_input" autocapitalize="off" type="text" name="username" placeholder="请输入邮箱/登录名"/> </div>
</div>
<div class="weui_cell">
<div class="weui_cell_hd"><label class="weui_label">密码</label></div>
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" type="password" name="password" placeholder="请输密码"/>
<input class="weui_input" type="password" name="password" placeholder="请输密码"/>
</div>
</div>
<input type="hidden" value="<%=@code%>" name="code">
<div class="weui_btn_area">
<a class="weui_btn weui_btn_primary" id="submitForm">确定</a>
</div>
@ -65,4 +80,7 @@
})
});
</script>
</script>
<% end %>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html ng-app="wechat">
<head>
<title>最新动态</title>
<meta charset='utf-8' />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="apple-mobile-web-app-capable" content="no">
<meta content='True' name='HandheldFriendly' />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link type="text/css" rel="stylesheet" href="/stylesheets/weui/weixin.css" />
<script type="text/javascript">
window.g_openid = '<%= @wechat_user.openid %>';
</script>
</head>
<body>
<div ng-view>
</div>
<script src="/javascripts/wechat/angular.js"></script>
<script src="/javascripts/wechat/angular-route.js"></script>
<script src="/javascripts/wechat/angular-sanitize.min.js"></script>
<script src="/javascripts/wechat/angular-cookies.js"></script>
<script src="/javascripts/jquery-1.3.2.js"></script>
<script src="/javascripts/wechat/app.js"></script>
</body>
</html>

View File

@ -13,17 +13,24 @@
</div>
<div class="recall_con f14">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to "#{reply.user.show_name}(#{reply.user.login})", user_path(reply.user) %>
<%= link_to reply.user.show_name, user_path(reply.user) %>
<%= l(:label_reply_to)%>
<% if show_name %>
<%= link_to "#{parent_jour.user.show_name}(#{parent_jour.user.login})", user_path(parent_jour.user) %>
<%= link_to parent_jour.user.show_name, user_path(parent_jour.user) %>
<% else %>
<%= l(:label_anonymous) %>
<% end %>
<p>
<%= reply.notes.html_safe %>
</p>
<div id="reply_<%= reply.id %>">
<p>
<%= reply.notes.html_safe %>
</p>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('reply__<%= reply.id %>');
autoUrl('reply_<%= reply.id %>');
});
</script>
<div class="cl"></div>
<span class="c_grey fl">
<%= format_time reply.created_on %>
@ -55,4 +62,4 @@
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>

View File

@ -2128,7 +2128,7 @@ zh:
label_resource_belongs_project: 所属项目
#微信模板消息
label_new_homework_template: 的课程有新作业了
label_new_homework_template: 有新作业了
label_update_homework_template: 您的作业已被修改
label_course_topic_template: 课程问答区有新帖子发布了
label_topic_comment_template: 您的帖子有新回复了

View File

@ -2,7 +2,7 @@ button:
-
type: "view"
name: "最新动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/activities?response_type=code&scope=snsapi_base&state=123#wechat_redirect"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.course.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
-
type: "click"
name: "意见反馈"
@ -13,8 +13,8 @@ button:
-
type: "view"
name: "进入网站"
url: "https://www.trustie.net/"
url: "https://test.course.trustie.net/"
-
type: "view"
name: "使用手册"
url: "https://www.trustie.net/organizations/1/downloads"
url: "https://test.course.trustie.net/organizations/1/downloads"

View File

@ -1237,6 +1237,7 @@ RedmineApp::Application.routes.draw do
resource :wechat, only:[:show, :create] do
collection do
get :login
get :user_activities
post :bind
post :get_open_id
end

View File

@ -11,6 +11,12 @@ default: &default
encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6"
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#template
binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU"
journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE"
homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ"
class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk"
production:
<<: *default

View File

@ -0,0 +1,11 @@
class DeleteAnonymousReply < ActiveRecord::Migration
def up
anonymous_replys = OrgDocumentComment.where("organization_id = 23 AND creator_id = 2")
if anonymous_replys
anonymous_replys.destroy_all
end
end
def down
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160519070718) do
ActiveRecord::Schema.define(:version => 20160526093715) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -77,6 +77,18 @@ ActiveRecord::Schema.define(:version => 20160519070718) do
t.datetime "updated_at", :null => false
end
create_table "apply_resources", :force => true do |t|
t.integer "status"
t.integer "user_id"
t.integer "attachment_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "container_id"
t.string "container_type"
t.text "content"
t.integer "apply_user_id"
end
create_table "at_messages", :force => true do |t|
t.integer "user_id"
t.integer "at_message_id"
@ -1107,23 +1119,6 @@ ActiveRecord::Schema.define(:version => 20160519070718) do
t.integer "viewed_count", :default => 0
end
create_table "mess", :id => false, :force => true do |t|
t.string "课程名"
t.integer "课程ID", :default => 0, :null => false
t.string "教师姓", :default => "", :null => false
t.string "教师名", :limit => 30, :default => "", :null => false
t.string "主贴名", :default => "", :null => false
t.integer "主贴或回帖ID", :default => 0, :null => false
t.integer "回帖对应主贴ID"
t.integer "帖子点赞数"
t.integer "主贴回复数", :default => 0, :null => false
t.text "主贴或回帖内容"
t.datetime "发帖时间", :null => false
t.integer "发帖或回帖用户ID", :default => 0, :null => false
t.string "发帖或回帖用户姓", :default => "", :null => false
t.string "发帖或回帖用户名", :limit => 30, :default => "", :null => false
end
create_table "message_alls", :force => true do |t|
t.integer "user_id"
t.integer "message_id"

View File

@ -1,3 +1,4 @@
#coding=utf-8
#!/usr/bin/env ruby
lib = File.expand_path(File.dirname(__FILE__) + '/../lib')

View File

@ -297,7 +297,7 @@ K.options = {
'td,th': [
'id', 'class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
'.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
'.font-style', '.text-decoration', '.vertical-align', '.background', '.border', '.text-overflow','.overflow','.white-space'
'.font-style', '.text-decoration', '.vertical-align', '.background', '.border','.border-color', '.text-overflow','.overflow','.white-space'
],
a : ['id', 'class', 'href', 'target', 'name'],
embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
@ -2539,7 +2539,8 @@ function _nativeCommand(doc, key, val) {
function _nativeCommandValue(doc, key) {
var val = '';
try {
val = doc.query_nativeCommand(self.doc, name, val);Value(key);
// val = doc.query_nativeCommand(self.doc, name, val);Value(key);
val = doc.queryCommandValue(key);
} catch (e) {}
if (typeof val !== 'string') {
val = '';
@ -3310,6 +3311,7 @@ _each(('formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull
if (!_IERANGE || _inArray(name, 'formatblock,selectall,insertorderedlist,insertunorderedlist'.split(',')) >= 0) {
self.selection();
}
return self;
};
});
@ -5751,7 +5753,7 @@ _plugin('core', function(K) {
h2 : 24,
h3 : 18,
H4 : 14,
p : 12
p : 12
},
curVal = self.cmd.val('formatblock'),
menu = self.createMenu({
@ -5769,6 +5771,14 @@ _plugin('core', function(K) {
checked : (curVal === key || curVal === val),
click : function() {
self.select().exec('formatblock', '<' + key + '>').hideMenu();
//by yk利用html的特性使h1 h2 h3 h4标签之间不能相互包含 并将空的标签去掉
if (key != "p"){
var val = self.select().html();
self.select().html(val);
val = self.select().html().replace(/(<h1>\s*<\/h1>)|(<h2>\s*<\/h2>)|(<h3>\s*<\/h3>)|(<h4>\s*<\/h4>)/g,"");
self.select().html(val);
self.select();
}
}
});
});

View File

@ -41,7 +41,7 @@ KindEditor.plugin('autoheight', function(K) {
var body = edit.doc.body;
edit.iframe.height(minHeight);
self.resize(null, Math.max(
((K.IE ? body.scrollHeight : body.offsetHeight) > 500 ? 500 : (K.IE ? body.scrollHeight : body.offsetHeight)) //限制初始化太高的情况
((K.IE ? body.scrollHeight : body.offsetHeight) > 250 ? 250 : (K.IE ? body.scrollHeight : body.offsetHeight)) //限制初始化太高的情况
+ 33, minHeight));
}

View File

@ -1,7 +1,7 @@
.ke-content {
font-size: 12px;
font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢<EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
font-family:Tahoma;
font-size: 14px;
/*font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;*/
font-family: "微软雅黑","宋体";
}
.ke-content pre {
font-size:9pt;
@ -53,4 +53,6 @@ span.at a{color:#269ac9;text-decoration: none;}
/*yk*/
.ke-content ol li{list-style-type: decimal;}
.ke-content ul li{list-style-type: disc;}
.ke-content ol,.ke-content ul{margin-top:0;margin-bottom: 0;}
.ke-content ol,.ke-content ul,.ke-content h1,.ke-content h2,.ke-content h3,.ke-content h4{margin-top:0;margin-bottom: 0;}
.ke-content a{color: #15bccf;}
.ke-content a:link,.ke-content a:visited{text-decoration:none;}

View File

@ -257,6 +257,7 @@ KindEditor.plugin('table', function(K) {
style += 'border-color:'+borderColor+';';
}
style += 'table-layout: '+'fixed;';
style += 'border-collapse: collapse;';
var html = '<table';
if (style !== '') {
html += ' style="' + style + '"';
@ -283,7 +284,7 @@ KindEditor.plugin('table', function(K) {
for (var i = 0; i < rows; i++) {
html += '<tr>';
for (var j = 0; j < cols; j++) {
html += '<td style="text-overflow:inherit;overflow: hidden;white-space: nowrap" >' + (K.IE ? '&nbsp;' : '<br />') + '</td>';
html += '<td style="border:'+ border+'px solid;border-color:' + borderColor+';text-overflow:inherit;overflow: hidden;white-space: nowrap" >' + (K.IE ? '&nbsp;' : '<br />') + '</td>';
}
html += '</tr>';
}

View File

@ -8,30 +8,32 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5">
<a herf="javascript:void(0);">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
</a></div>
<div class="post-title hidden">
<a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title mt5 hidden"><a ng-href="#/homework/{{act.act_id}}" class="c-grey3 f15 fb">{{act.subject|safeHtml}}</a></div>
<div class="post-content c-grey2">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br />
<span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span>
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('homework',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5">
<a herf="javascript:void(0);">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
</a></div>
<div class="post-title hidden">
<a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title mt5 mb5 hidden"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey3">
<div class="post-all-content mb5" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15 f13 c-grey2">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br />
<span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15 f13 c-grey2">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f12 fl">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-href="#/homework/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a ng-if="act.reply_count" ng-href="#/homework/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
<span class="c-grey f12 fl mt2">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div>
</div>
@ -42,23 +44,25 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="f13 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title hidden mt5"><a ng-href="#/course_notice/{{act.act_id}}" class="c-grey3 f15 fb">{{act.subject|safeHtml}}</a></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('course_notice',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="f13 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey3">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-href="#/course_notice/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a ng-if="act.reply_count" ng-href="#/course_notice/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div>
</div>
@ -69,23 +73,25 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title hidden mt5"><a ng-href="#/course_discussion/{{act.act_id}}" class="c-grey3 f15 fb">{{act.subject|safeHtml}}</a></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('course_discussion',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey3">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-href="#/course_discussion/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a ng-if="act.reply_count" ng-href="#/course_discussion/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div>
</div>
@ -112,25 +118,27 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title hidden mt5"><a ng-href="#/issues/{{act.act_id}}" class="c-grey3 f15 fb">{{act.subject|safeHtml}}</a></div>
<div class="post-content c-grey2">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15">优先级:{{act.issue_detail.issue_priority}}</span> <br />
<span class="mr15">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15">完成度:{{act.issue_detail.done_ratio}}%</span>
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('issues',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey3">
<div class="post-all-content mb5" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15 f13 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f13 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
<span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-href="#/issues/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a ng-if="act.reply_count" ng-href="#/issues/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div>
</div>
@ -142,30 +150,32 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title hidden mt5"><a ng-href="#/project_discussion/{{act.act_id}}" class="c-grey3 f15 fb">{{act.subject|safeHtml}}</a></div>
<div class="post-content c-grey2">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('project_discussion',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey3">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div>
<span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-href="#/project_discussion/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a ng-if="act.reply_count" ng-href="#/project_discussion/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<span class="c-grey f12 fl mr15 mt2">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='ProjectCreateInfo'">
<div ng-if="act.act_type=='Project'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
@ -184,22 +194,24 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a></div>
<div class="post-title hidden"><span class="f12 c-grey">留言</span></div>
<div class="cl"></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt5">
<p class="post-all-content" ng-bind-html="act.description|safeHtml"></p>
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('journal_for_message',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a></div>
<div class="post-title hidden"><span class="f12 c-grey">留言</span></div>
<div class="cl"></div>
<div class="cl"></div>
<div class="post-content c-grey3 mt5 mb5">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-href="#/journal_for_message/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a ng-if="act.reply_count" ng-href="#/journal_for_message/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('journal_for_message',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div>
</div>
@ -211,22 +223,24 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><span class="f12 c-grey">博客</span></div>
<div class="cl"></div>
<div class="post-title hidden mt5"><a ng-href="#/blog_comment/{{act.act_id}}" class="c-grey3 f15 fb">{{act.subject|safeHtml}}</a></div>
<div class="post-content c-grey2">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<div class="mb5" dataID = "{{act.act_id}}" ng-click="goDetail('blog_comment',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><span class="f12 c-grey">博客</span></div>
<div class="cl"></div>
<div class="post-title hidden mt5 mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey3">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-href="#/blog_comment/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a ng-if="act.reply_count" ng-href="#/blog_comment/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<span class="c-grey f13 fl mt2">{{act.latest_update}}</span>
<a ng-if="!act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('blog_comment',act.act_id, act.id)" class="c-grey2 fr f12"><img src="/images/wechat/w_reply.png" height="15" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
<div class="c-grey fr f12 mr25" ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;"></span></div>
<div class="c-grey fr f12 mr25" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="c-grey fr f12 mr25" ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" height="15" /><span style="vertical-align:top;">{{act.praise_count}}</span></div>
<div class="cl"></div>
</div>
</div>
@ -235,8 +249,8 @@
</div>
<div ng-if="(count + page * 10) < all_count">
<div id="more_activities" class="more-events mt10" ng-click="loadActData(current_page+1);">更多</div>
<div ng-if="has_more">
<div id="more_activities" class="more-events mt10" ng-click="loadActData(page+1);">更多</div>
</div>
</div>

View File

@ -1,46 +1,49 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{blog.title}}</span><span ng-if="blog.locked" class="locked_btn_cir ml10" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div class="post-title"><a herf="javascript:void(0);" class="mr10">{{blog.user.realname}}</a>发表博客</div>
<div class="cl"></div>
<div class="post-content" style="height:auto;">
<div class="post-all-content c-grey3 mt10" ng-bind-html="blog.content|safeHtml"></div>
<div loading-spinner></div>
<div ng-if="blog.act_type == 'BlogComment'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{blog.title}}</span></div>
<div class="post-title"><a herf="javascript:void(0);" class="mr10">{{blog.user.realname}}</a>发表博客</div>
<div class="cl"></div>
<div class="f13 c-grey3 mt10" ng-bind-html="blog.content|safeHtml"></div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{blog.created_at}}</span>
<div class="cl"></div>
</div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{blog.created_at}}</span>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{blog.comment_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="blog.has_praise" ng-click="decreasePraise(blog);">已赞 ({{blog.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!blog.has_praise" ng-click="addPraise(blog);">赞 ({{blog.praise_count}})</div>
</div>
<div id="all_blog_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in blog.blog_comment_children">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></div>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{blog.comment_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="blog.has_praise" ng-click="decreasePraise(blog);">已赞 ({{blog.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!blog.has_praise" ng-click="addPraise(blog);">赞 ({{blog.praise_count}})</div>
</div>
<div id="all_blog_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in blog.blog_comment_children">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<pre class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></pre>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addBlogReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
<div ng-if="!blog.locked" class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addBlogReply(formData)" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>

View File

@ -1,51 +1,55 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span><span ng-if="discussion.locked" class="locked_btn_cir ml10" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{discussion.user.realname}}</td>
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程问答区</td>
</tr></table>
<div class="post-content c-grey3 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
</div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{discussion.replies_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div>
</div>
<div id="all_course_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></div>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
<div loading-spinner></div>
<div ng-if="discussion.act_type == 'Message'">
<div class="post-container">
<div loading-spinner></div>
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{discussion.user.realname}}</td>
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程问答区</td>
</tr></table>
<div class="f13 c-grey3 mt10" ng-bind-html="discussion.content|safeHtml"></div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span>
<div class="cl"></div>
</div>
</div>
</div>
<div ng-if="!discussion.locked" class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{discussion.replies_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div>
</div>
<div id="all_course_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<pre class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></pre>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addDiscussionReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
<button ng-click="addDiscussionReply(formData)" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>

View File

@ -1,5 +1,7 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div>
<div ng-if="news.act_type == 'News'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
@ -12,9 +14,7 @@
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{news.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程通知</td>
</tr></table>
<div class="post-content c-grey3 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="news.description|safeHtml"></div>
</div>
<div class="f13 c-grey3 mt10" ng-bind-html="news.description|safeHtml"></div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{news.created_on}}</span>
<div class="cl"></div>
@ -30,7 +30,7 @@
<div class="post-reply-avatar fl"><img ng-src="{{comments.author.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{comments.author.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="comments.comments|safeHtml"></div>
<pre class="post-reply-content c-grey2 mb10" ng-bind-html="comments.comments|safeHtml"></pre>
<div class="post-reply-date fl">{{comments.created_on}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
@ -42,11 +42,14 @@
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addNoticeReply(formData)" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-click="addNoticeReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,5 +1,7 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div>
<div ng-if="homework.act_type == 'HomeworkCommon'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
@ -14,13 +16,11 @@
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{homework.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程作业</td>
</tr></table>
<div class="post-content c-grey3 mt10" style="height:auto;">
<div class="post-all-content mb10" ng-bind-html="homework.description|safeHtml"></div>
<span class="c-grey">迟交扣分:{{homework.late_penalty}}分</span><br/>
<span ng-if="!homework.anonymous_comment" class="c-grey">缺评扣分:{{homework.absence_penalty}}分/作品<br /></span>
<span ng-if="!homework.anonymous_comment" class="c-grey">匿评开启时间:{{homework.evaluation_start}}<br /></span>
<span ng-if="!homework.anonymous_comment" class="c-grey">匿评关闭时间:{{homework.evaluation_end}}</span>
</div>
<div class="f13 c-grey3 mt10 mb10" ng-bind-html="homework.description|safeHtml"></div>
<span class="c-grey f13">迟交扣分:{{homework.late_penalty}}分</span><br/>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">缺评扣分:{{homework.absence_penalty}}分/作品<br /></span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评开启时间:{{homework.evaluation_start}}<br /></span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评关闭时间:{{homework.evaluation_end}}</span>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{homework.publish_time}}</span>
<div class="cl"></div>
@ -36,7 +36,7 @@
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div>
<pre class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></pre>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
@ -48,11 +48,14 @@
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment"></textarea>
</div>
<button ng-click="addHomeworkReply(formData)" ng-disabled="formData.disabled" value="回复" class="post-reply-submit fr mt10">回复</button>
<button ng-click="addHomeworkReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,5 +1,7 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div>
<div ng-if="issue.act_type == 'Issue'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
@ -12,13 +14,11 @@
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{issue.project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目问题</td>
</tr></table>
<div class="post-content" style="height:auto;">
<div class="post-all-content c-grey3 mt10 mb10" ng-bind-html="issue.description|safeHtml"></div>
<span class="c-grey">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}<br>
优先级:{{issue.issue_priority}}<br />
指派给:{{issue.issue_assigned_to}}<br />
完成度:{{issue.done_ratio}}%</span>
</div>
<div class="f13 c-grey3 mt10 mb10" ng-bind-html="issue.description|safeHtml"></div>
<span class="c-grey f13">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}<br>
优先级:{{issue.issue_priority}}<br />
指派给:{{issue.issue_assigned_to}}<br />
完成度:{{issue.done_ratio}}%</span>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{issue.created_on}}</span>
<div class="cl"></div>
@ -34,7 +34,7 @@
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div>
<pre class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></pre>
<div class="post-reply-date fl">{{journal.created_on}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
@ -46,11 +46,14 @@
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addIssueReply(formData)" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
<button ng-click="addIssueReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,44 +1,47 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><a herf="javascript:void(0);" class="mr10">{{message.user.realname}}</a><span style="vertical-align:top;">给您留言了</span><br /></div>
<div class="post-title">{{message.created_on}}</div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="message.notes|safeHtml"></div>
<div loading-spinner></div>
<div ng-if="message.act_type == 'JournalsForMessage'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><a herf="javascript:void(0);" class="mr10">{{message.user.realname}}</a><span style="vertical-align:top;">给您留言了</span><br /></div>
<div class="post-title">{{message.created_on}}</div>
<div class="cl"></div>
<div class="f13 c-grey3 mt10" ng-bind-html="message.notes|safeHtml"></div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{message.reply_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="message.has_praise" ng-click="decreasePraise(message);">已赞 ({{message.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!message.has_praise" ng-click="addPraise(message);">赞 ({{message.praise_count}})</div>
</div>
<div id="all_message_reply">
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{message.reply_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="message.has_praise" ng-click="decreasePraise(message);">已赞 ({{message.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!message.has_praise" ng-click="addPraise(message);">赞 ({{message.praise_count}})</div>
</div>
<div id="all_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in message.child_reply">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
<div class="post-reply-wrap border-bottom" ng-repeat="journal in message.child_reply">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<pre class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></pre>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addJournalReply(formData)" ng-hide="formData.disabled" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addJournalReply(formData)" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>

View File

@ -1,9 +1,11 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div>
<div ng-if="discussion.act_type == 'Message'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span><span ng-if="discussion.locked" class="locked_btn_cir ml10" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{discussion.user.realname}}</td>
@ -12,9 +14,7 @@
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目讨论区</td>
</tr></table>
<div class="post-content c-grey3 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
</div>
<div class="f13 c-grey3 mt10" ng-bind-html="discussion.content|safeHtml"></div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span>
<div class="cl"></div>
@ -30,7 +30,7 @@
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></div>
<pre class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></pre>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
@ -38,15 +38,18 @@
</div>
</div>
</div>
<div ng-if="!discussion.locked" class="post-input-wrap">
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addDiscussionReply(formData)" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-click="addDiscussionReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 17 KiB

BIN
public/images/wechat/icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

BIN
public/images/wechat/w_praise.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
public/images/wechat/w_reply.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -1178,6 +1178,37 @@ function chooseSendType(res_id,res_ids, user_id, send_type){
lastSendType = sendType;
}
function chooseSendType2(res_id,res_ids, user_id, send_type, type){
console.log(res_ids);
sendType = $(".resourcesSendType").val();
if (sendType === lastSendType) {
return;
} else if(lastSendType != null) { //不是第一次点击的时候
if (sendType == '1') {
$.ajax({
type: 'get',
url: '/users/' + user_id + '/search_user_course' + '?' + "&type=" + type,
data:{send_id:res_id, send_ids:res_ids ,send_type:send_type}
});
} else if(sendType == '2') {
console.log(res_ids);
$.ajax({
type: 'get',
url: '/users/' + user_id + '/search_user_project' + '?' + "&type=" + type,
data:{send_id:res_id, send_ids:res_ids, send_type:send_type}
});
}else if(sendType == '3'){
$.ajax({
type: 'get',
url: '/users/' + user_id + '/search_user_org' + '?' + "&type=" + type,
data:{send_id:res_id, send_ids:res_ids, send_type:send_type}
});
}
}
lastSendType = sendType;
}
//组织新建和配置中选择组织为私有后disbled掉允许游客下载选项
function disable_down(source, des, hint){
if (source.attr("checked")){
@ -1322,15 +1353,15 @@ function autoUrl(id){
$("#"+id+" p,#"+ id +" span,#"+id+" em,#"+id+" h1,#"+id+" h2,#"+id+" h3,#"+id+" h4,#"+id+" strong,#"+id+" b,#"+id+" font,#"+id+" i").each(function(){
if ($(this).children().length == 0){
var html = $(this).text();
html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+([a-z]{3}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) {
html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+(aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) {
//没有://的都加上http://
var reStr = full;
if (full.length > 0){
if (full.indexOf("://") >= 0){
reStr = "<a target='_Blank' href="+"'"+full+"'"+">"+full+"</a>";
reStr = "<a style='color:#15bccf' target='_Blank' href="+"'"+full+"'"+">"+full+"</a>";
}
else{
reStr = "<a target='_Blank' href="+"'http://"+full+"'"+">"+full+"</a>";
reStr = "<a style='color:#15bccf' target='_Blank' href="+"'http://"+full+"'"+">"+full+"</a>";
}
}
return reStr ;
@ -1341,15 +1372,15 @@ function autoUrl(id){
}
else{
var html = $("#"+id).text();
html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+([a-z]{3}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) {
html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+(aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) {
//没有://的都加上http://
var reStr = full;
if (full.length > 0){
if (full.indexOf("://") >= 0){
reStr = "<a target='_Blank' href="+"'"+full+"'"+">"+full+"</a>";
reStr = "<a style='color:#15bccf' target='_Blank' href="+"'"+full+"'"+">"+full+"</a>";
}
else{
reStr = "<a target='_Blank' href="+"'http://"+full+"'"+">"+full+"</a>";
reStr = "<a style='color:#15bccf' target='_Blank' href="+"'http://"+full+"'"+">"+full+"</a>";
}
}
return reStr ;

Some files were not shown because too many files have changed in this diff Show More