diff --git a/.gitignore b/.gitignore index 0727a920a..38f29a661 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,6 @@ vendor/cache /public/files /tags /config/initializers/gitlab_config.rb +/config/wechat.yml +/config/menu.yml 1234567 diff --git a/Client.html b/Client.html deleted file mode 100644 index fbb7cec52..000000000 --- a/Client.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - -Client - - - - -
-

这是一张图片

-

photo Share A

-
- -

这是一段视频

-

Text Share B

-
- -

这是一篇文章

-

Text Share C

-
- - - - \ No newline at end of file diff --git a/Gemfile.lock~ b/Gemfile.lock~ deleted file mode 100644 index 7d6563465..000000000 --- a/Gemfile.lock~ +++ /dev/null @@ -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 diff --git a/Gemfile~ b/Gemfile~ deleted file mode 100644 index 24869e72b..000000000 --- a/Gemfile~ +++ /dev/null @@ -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 diff --git a/app/api/mobile/entities/activity.rb b/app/api/mobile/entities/activity.rb index 3ba82bcb9..a90ff323d 100644 --- a/app/api/mobile/entities/activity.rb +++ b/app/api/mobile/entities/activity.rb @@ -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? diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 9da4b90b9..376f8d5c2 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -14,6 +14,7 @@ class HomeworkCommonController < ApplicationController #unless params[:page] # update_homework_time(@course.homework_commons) #end + search = "%#{params[:search].to_s.strip.downcase}%" @new_homework = HomeworkCommon.new @new_homework.homework_detail_manual = HomeworkDetailManual.new @new_homework.course = @course @@ -21,10 +22,10 @@ class HomeworkCommonController < ApplicationController @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) if @is_teacher #@homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) - @homework_commons = @course.homework_commons.order("created_at desc") + @homework_commons = @course.homework_commons.where("name like '%#{search}%'").order("created_at desc") else #@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) - @homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc") + @homework_commons = @course.homework_commons.where("name like '%#{search}%' and publish_time <= '#{Date.today}'").order("created_at desc") end @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_new = params[:is_new] diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index b012ba901..dd237de17 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -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' @@ -102,6 +103,13 @@ 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 = OrgDocumentComment.find(params[:id]) @org_sub_id = @org_document_comment.org_subfield_id diff --git a/app/controllers/praise_tread_controller.rb b/app/controllers/praise_tread_controller.rb index 96eeab884..0c665341a 100644 --- a/app/controllers/praise_tread_controller.rb +++ b/app/controllers/praise_tread_controller.rb @@ -25,14 +25,14 @@ class PraiseTreadController < ApplicationController return end @horizontal = params[:horizontal].downcase == "false" ? false:true if params[:horizontal] - if @obj.respond_to?("author_id") - author_id = @obj.author_id - elsif @obj.respond_to?("user_id") - author_id = @obj.user_id - end - unless author_id == User.current.id - praise_tread_plus(@obj_type,@obj_id,1) - end + # if @obj.respond_to?("author_id") + # author_id = @obj.author_id + # elsif @obj.respond_to?("user_id") + # author_id = @obj.user_id + # end + # unless author_id == User.current.id + praise_tread_plus(@obj_type,@obj_id,1) + # end respond_to do |format| format.js end diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index f518f81da..dd178a1ce 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -374,7 +374,7 @@ class StudentWorkController < ApplicationController end end ################################################################################################################## - @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group] + @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group] @homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc") @all_homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? diff --git a/app/controllers/sub_document_comments_controller.rb b/app/controllers/sub_document_comments_controller.rb index cdf153a20..80c14f004 100644 --- a/app/controllers/sub_document_comments_controller.rb +++ b/app/controllers/sub_document_comments_controller.rb @@ -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' @@ -207,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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index da1fffde0..52c5f70bc 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -722,21 +722,21 @@ class UsersController < ApplicationController end def show_homework_detail - homework = HomeworkCommon.find params[:homework].to_i - if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course) && User.current != homework.user - ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:homework].to_i) - if ah.empty? - @status = 2 - @homework = nil - elsif ah.first.status != 2 - @status = ah.first.status - @homework = nil - elsif ah.first.status == 2 - @homework = homework - end - else - @homework = homework - end + @homework = HomeworkCommon.find params[:homework].to_i + # if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course) && User.current != homework.user + # ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:homework].to_i) + # if ah.empty? + # @status = 2 + # @homework = nil + # elsif ah.first.status != 2 + # @status = ah.first.status + # @homework = nil + # elsif ah.first.status == 2 + # @homework = homework + # end + # else + # @homework = homework + # end @is_import = params[:is_import] respond_to do |format| format.js @@ -1090,22 +1090,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 @@ -1977,7 +1982,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 @@ -2095,7 +2100,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 @@ -2128,7 +2134,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 @@ -2275,7 +2281,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 @@ -3116,6 +3122,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] diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 7ee0552fb..a37b5aaa2 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -139,98 +139,127 @@ 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 - def get_open_id - begin - raise "非法操作, code不存在" unless 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} - 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) - user, last_login_on = User.try_to_login(params[:username], params[:password]) - raise "用户名或密码错误,请重新登录" unless user - #补全用户信息 + ### controller method + - raise "此用户已经绑定了公众号" if user.user_wechat + module Controllers + def get_open_id + begin - UserWechat.create!( - openid: openid, - user: user - ) - render :json => {status:0, msg: "绑定成功"} - rescue Exception=>e - render :json => {status: -1, msg: e.message} + 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 - end - def login - @code = params[:code] #TODO 安全性 - render 'wechats/login', layout: 'base_wechat' - end + def bind + begin - 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 + code = params[:code] || session[:wechat_code] + openid = get_openid_from_code(code) - def user_binded?(openid) - uw = UserWechat.where(openid: openid).first - end + raise "无法获取到openid" unless openid + raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid) - 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" + user, last_login_on = User.try_to_login(params[:username], params[:password]) + raise "用户名或密码错误,请重新登录" unless user + #补全用户信息 - 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) + raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat + UserWechat.create!( + openid: openid, + user: user + ) + render :json => {status:0, msg: "绑定成功"} + rescue Exception=>e + render :json => {status: -1, msg: e.message} + end + end - end + def login + session[:wechat_code] = params[:code] if params[:code] + render 'wechats/login', layout: 'base_wechat' + end + + private + def get_openid_from_code(code) + openid = session[:wechat_openid] - 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 + + 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}"] + end + end end end + + + include Controllers + end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ce6d2259c..a2285a678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2097,12 +2097,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 diff --git a/app/models/message.rb b/app/models/message.rb index fdc3c6bdc..cf9adab4e 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -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| @@ -308,6 +308,22 @@ class Message < ActiveRecord::Base 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的为发帖 diff --git a/app/models/news.rb b/app/models/news.rb index 877d799bf..0b03dcc48 100644 --- a/app/models/news.rb +++ b/app/models/news.rb @@ -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 @@ -169,7 +169,7 @@ class News < ActiveRecord::Base if self.course self.course.members.each do |m| if m.user_id != self.author_id - # self.delay.send_message(m.user_id, self.course_id) + #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count if count == 0 ws = WechatService.new @@ -189,9 +189,19 @@ class News < ActiveRecord::Base end end - # def send_message user_id, course_id - # self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => course_id, :viewed => false) - # 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 diff --git a/app/views/attachments/attachment_versions.js.erb b/app/views/attachments/attachment_versions.js.erb index a5bb6672b..ff704a869 100644 --- a/app/views/attachments/attachment_versions.js.erb +++ b/app/views/attachments/attachment_versions.js.erb @@ -2,6 +2,6 @@ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'attachments/sh showModal('ajax-modal', '452px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before(""); -$('#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"); \ No newline at end of file diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index d3763abf3..9617b7f76 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -122,11 +122,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if @article.author == User.current %> - - <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%> - <% end %>
@@ -162,12 +158,8 @@
<%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> +
diff --git a/app/views/exercise/_student_exercise_archive.html.erb b/app/views/exercise/_student_exercise_archive.html.erb index abc604b73..3afac2dc2 100644 --- a/app/views/exercise/_student_exercise_archive.html.erb +++ b/app/views/exercise/_student_exercise_archive.html.erb @@ -17,7 +17,7 @@
--> <%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %> <%# end%> - +
diff --git a/app/views/exercise/_student_table.html.erb b/app/views/exercise/_student_table.html.erb index 3022b83a6..cbb56025e 100644 --- a/app/views/exercise/_student_table.html.erb +++ b/app/views/exercise/_student_table.html.erb @@ -15,46 +15,23 @@ - <% @exercise_users_list.each do |exercise|%> - - + <% @exercise_users_list.each_with_index do |exercise, index|%> - 1 + <%=index + 1 %> <%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;", :class => "mt15"),user_activities_path(exercise.user)) %> - + <%=exercise.user.show_name %> - + - + --   - + <% if exercise.created_at%> <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>  <% if @exercise.end_time <= exercise.created_at %> @@ -67,5 +44,29 @@
- <% end%> + + + +<% end%> \ No newline at end of file diff --git a/app/views/exercise/student_exercise_list.html.erb b/app/views/exercise/student_exercise_list.html.erb index c96f8156a..02f161589 100644 --- a/app/views/exercise/student_exercise_list.html.erb +++ b/app/views/exercise/student_exercise_list.html.erb @@ -5,8 +5,14 @@ $("#Container").css("width","1000px"); }); + function show_or_hide_info(){ + $("#homeworkInformation").toggle(); + $("#homework_info_hidden").toggle(); + $("#homework_info_show").toggle(); + } + $(function(){ - $("#homework_info_hidden").click(function(){ + /*$("#homework_info_hidden").click(function(){ $("#homeworkInformation").hide(); $("#homework_info_hidden").hide(); $("#homework_info_show").show(); @@ -15,7 +21,7 @@ $("#homework_info_show").hide(); $("#homeworkInformation").show(); $("#homework_info_hidden").show(); - }); + });*/ if($("#homework_description").height() > 54) { $("#homeworkDetailShow").show(); @@ -88,7 +94,7 @@ <% elsif @exercise.exercise_status == 3 %> 已截止 <% end%> - [ 隐藏测验信息 ] + [ 隐藏测验信息 ]
发布者:<%= @exercise.user.show_name %>
diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb new file mode 100644 index 000000000..9b11017e8 --- /dev/null +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -0,0 +1,8 @@ +<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:is_in_course => 1,:course_id => course_id} %> + +
+ +
+
\ No newline at end of file diff --git a/app/views/homework_common/_homework_search_form.html.erb b/app/views/homework_common/_homework_search_form.html.erb index f71cec9a5..250d72467 100644 --- a/app/views/homework_common/_homework_search_form.html.erb +++ b/app/views/homework_common/_homework_search_form.html.erb @@ -1,4 +1,4 @@ -<%= form_tag( url_for(:controller => 'courses',:action => 'homework_search',:id=>course.id), +<%= form_tag( homework_common_index_url_in_org(course.id), :remote=>true ,:method => 'get',:class=>'resourcesSearchloadBox',:id=>'resource_search_form') do %> <%= submit_tag '',:class=>'homepageSearchIcon',:onfocus=>'this.blur();',:style=>'border-style:none' %> diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 29cff8933..35f4658f9 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -71,13 +71,8 @@ <% end%>
<% end%> - <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homeworks,:page => 0,:is_in_course => 1,:course_id => @course.id} %> - -
- -
+
+ <%= render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id} %>
diff --git a/app/views/homework_common/index.js.erb b/app/views/homework_common/index.js.erb index 7a038eb5c..4a9ec6ad3 100644 --- a/app/views/homework_common/index.js.erb +++ b/app/views/homework_common/index.js.erb @@ -1 +1,4 @@ -$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id} )%>"); \ No newline at end of file +/* +$("#user_show_more_homework").replaceWith("<%#= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id} )%>");*/ + +$("#homework_index_list").html("<%=escape_javascript(render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id}) %>"); diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index 30f527595..c04c2effb 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -20,9 +20,9 @@
- +
- + <%= @course.name %> diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 443440455..746881bdc 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -95,11 +95,7 @@
回复 <%= @reply_count>0 ? "(#{@reply_count})" : "" %> - <% if @topic.author == User.current %> - - <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@topic, :user_activity_id=>@topic.id,:type=>"activity"}%> - <% end %>
@@ -131,11 +127,7 @@ <%= format_time(reply.created_on) %> @@ -187,11 +183,7 @@ <%= format_time(reply.created_on) %> @@ -137,11 +133,7 @@ <%= format_time(reply.created_on) %> @@ -100,11 +96,7 @@
<%= format_time(reply.created_at) %> - <% if reply.creator_id.to_i == User.current.id.to_i %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
<%if count>3 %> @@ -359,11 +355,7 @@
- <% if comment.user == User.current %> - - <% 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"}%> <%= link_to( diff --git a/app/views/organizations/_org_course_message.html.erb b/app/views/organizations/_org_course_message.html.erb index e68745f7a..03e986716 100644 --- a/app/views/organizations/_org_course_message.html.erb +++ b/app/views/organizations/_org_course_message.html.erb @@ -74,11 +74,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
<%#=format_date(activity.updated_on)%>
@@ -117,11 +113,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_org_course_news.html.erb b/app/views/organizations/_org_course_news.html.erb index acf0f0377..8c260c21c 100644 --- a/app/views/organizations/_org_course_news.html.erb +++ b/app/views/organizations/_org_course_news.html.erb @@ -44,12 +44,8 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%> +
<%#= format_date(activity.updated_on) %>
<%if count>3 %> @@ -86,11 +82,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% 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"}%>
diff --git a/app/views/organizations/_org_member_list.html.erb b/app/views/organizations/_org_member_list.html.erb index fb22716ff..0059a2be5 100644 --- a/app/views/organizations/_org_member_list.html.erb +++ b/app/views/organizations/_org_member_list.html.erb @@ -1,6 +1,6 @@ <% members.each do |member|%>
    -
  • <%= User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname %>
  • +
  • <%= get_org_member_role_name member %> <%= form_for(member, {:as => :org_member, :remote => true, :url => Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s, diff --git a/app/views/organizations/_org_project_issue.html.erb b/app/views/organizations/_org_project_issue.html.erb index 9ca10c91d..94eb2820a 100644 --- a/app/views/organizations/_org_project_issue.html.erb +++ b/app/views/organizations/_org_project_issue.html.erb @@ -55,11 +55,7 @@
    回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
    <%#= format_date(activity.updated_on) %>
    @@ -97,11 +93,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_org_subfield_leftMD.html.erb b/app/views/organizations/_org_subfield_leftMD.html.erb index d0439439a..afa7d0716 100644 --- a/app/views/organizations/_org_subfield_leftMD.html.erb +++ b/app/views/organizations/_org_subfield_leftMD.html.erb @@ -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" %>
- <%=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" %>
<%#= link_to "更多", student_work_index_url_in_org(activity.id), :class => "more-btn", :target => "_blank" %> @@ -50,7 +50,7 @@ <% end %>
- <%=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" %>
@@ -67,7 +67,7 @@ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %>
- <%=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" %>
<%#= 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" %>
- <%=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" %>
@@ -151,7 +151,7 @@ <% end %>
- <%=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" %>
@@ -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" %>
- <%=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" %>
<%#= 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" %>
- <%=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" %>
<%#= link_to "更多", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => "more-btn", :target => "_blank" %> @@ -244,7 +244,7 @@ <% end %>
- <%= 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" %>
<%#= link_to "更多", board_message_url_in_org(message.board.id,message.id), :class => "more-btn", :target => "_blank" %> @@ -264,7 +264,7 @@ <% end %>
- <%= 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" %>
<%#= link_to "更多", board_message_path(message.board,activity), :class => "more-btn", :target => "_blank" %> @@ -285,7 +285,7 @@
<%#= 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} %>
<%#= link_to "更多", news_path(news), :class => "more-btn", :target => "_blank" %> diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb index 61bc5bc7f..bcc43610e 100644 --- a/app/views/organizations/_org_subfield_message.html.erb +++ b/app/views/organizations/_org_subfield_message.html.erb @@ -84,11 +84,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
<%if count>3 %> @@ -122,11 +118,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - <%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %> - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_org_subfield_news.html.erb b/app/views/organizations/_org_subfield_news.html.erb index 5d6c38542..662a965e9 100644 --- a/app/views/organizations/_org_subfield_news.html.erb +++ b/app/views/organizations/_org_subfield_news.html.erb @@ -64,11 +64,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
<%#= format_date(activity.updated_on) %>
@@ -106,11 +102,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% 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"}%>
diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index e1b000c70..4407d86bd 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -57,11 +57,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
<%#=format_date(activity.updated_on)%>
@@ -96,11 +92,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index e8f531206..3042ca9ae 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -69,11 +69,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if document.creator_id.to_i == User.current.id.to_i %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
<% if count > 3 %> @@ -102,11 +98,7 @@ <%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %> <%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %> - <% if comment.creator_id.to_i == User.current.id.to_i %> - - <% 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"}%>
<% unless comment.content.blank? %> diff --git a/app/views/projects/_history.html.erb b/app/views/projects/_history.html.erb index b31445fdc..4f7fb7f4a 100644 --- a/app/views/projects/_history.html.erb +++ b/app/views/projects/_history.html.erb @@ -10,10 +10,15 @@ <%= format_time(journal.created_on) %>
-

<%=journal.notes.html_safe%> +

+

<%=journal.notes.html_safe%>

+
<% ids = 'project_respond_form_'+ journal.id.to_s%> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> + <% if journal.user == User.current|| User.current.admin? %> <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, @@ -26,7 +31,6 @@ <%= link_to l(:label_bid_respond_quote),'javascript:;', {:nhname=>"reply_btn"} %> <% end %> -
<% ids = 'project_respond_form_'+ journal.id.to_s%> @@ -42,6 +46,12 @@
+ <% end %> <% end %> diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb index 6d97b252d..7baf93e4f 100644 --- a/app/views/projects/_project_news.html.erb +++ b/app/views/projects/_project_news.html.erb @@ -44,11 +44,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
<%#= format_date(activity.updated_on) %>
@@ -86,11 +82,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - <%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %> - <% 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"}%>
diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb index 064444f04..b2bf0bd59 100644 --- a/app/views/student_work/_evaluation_title.html.erb +++ b/app/views/student_work/_evaluation_title.html.erb @@ -2,8 +2,8 @@ 序号   - 作品名称 <% if @homework.homework_type != 3 %> + 作品名称 姓名 @@ -11,9 +11,12 @@ 学号 <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> + 作品名称 关联项目 + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %> + 作品名称 <% end %> 时间 diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index 98e9f1f64..1a3220df6 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -2,9 +2,9 @@ 序号   - 作品名称 <% if @homework.homework_type != 3 %> - + 作品名称 + <%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,:remote => true%> <% if @show_all && @order == "lastname"%> <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%> @@ -17,9 +17,12 @@ <% end%> <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> + 作品名称 关联项目 + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %> + 作品名称 <% end %> <%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%> diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index ecdde77d8..688e31451 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -5,20 +5,26 @@ <%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %> - - <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> -
- <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> -
- - <% if @homework.homework_type != 3 %> + <% if @homework.homework_type != 3 %> + + <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> +
+ <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> +
+ <%= student_work.user.show_name%> " onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;"> - <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> + + <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> +
+ <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> +
+ <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> <%= link_to( student_work.project.name, project_path(student_work.project.id))%> @@ -28,7 +34,14 @@ <%= student_work.project.name %> <% end %> - <% end %> + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %> + + <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> +
+ <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%> +
+ + <% end %> <% if student_work.created_at && @homework.end_time%> <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>  diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 0259fddf7..ba017af5f 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -12,14 +12,14 @@ <%=index + 1 %> <%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40", style: "display:block;") %> - - -
- <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> - <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%> -
<% if @homework.homework_type != 3 %> + +
+ <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> + <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%> +
+ <%= student_work.user.show_name%> @@ -27,6 +27,12 @@ <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> + +
+ <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> + <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%> +
+ <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> <%= link_to( student_work.project.name, project_path(student_work.project.id))%> @@ -36,6 +42,13 @@ <%= student_work.project.name %> <% end %> + <% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %> + +
+ <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> + <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word w250"%> +
+ <% end %> <% else%> <%=index + 1 %> diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index 1c699d331..eaf6b9304 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -24,7 +24,7 @@ <%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %> <% end %> <% end%> - +
@@ -39,6 +39,10 @@ \ No newline at end of file diff --git a/app/views/users/_org_file_form.html.erb b/app/views/users/_org_file_form.html.erb index 348a68c00..b4a7bc6ef 100644 --- a/app/views/users/_org_file_form.html.erb +++ b/app/views/users/_org_file_form.html.erb @@ -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) %>
diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb index 25fd675fb..fe7bc03f2 100644 --- a/app/views/users/_project_boardlist.html.erb +++ b/app/views/users/_project_boardlist.html.erb @@ -31,9 +31,6 @@ <% end %> <% u = User.where("id=?",activity.author_id).first%> - - 发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> -
@@ -42,11 +39,13 @@ <% else %> <% content = activity.parent.content %> <% end %> -

<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %>

+

<%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %>

- 发帖:<%= format_time(activity.created_on) %> - 更新:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> + + 发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> + + 更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %> <% count=0 %> <% if activity.parent %> <% count=activity.parent.children.count%> diff --git a/app/views/users/_project_file_form.html.erb b/app/views/users/_project_file_form.html.erb index 74e8fecc2..413ffa17a 100644 --- a/app/views/users/_project_file_form.html.erb +++ b/app/views/users/_project_file_form.html.erb @@ -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' %>
<%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_ids, send_ids) %> diff --git a/app/views/users/_project_issue_reply.html.erb b/app/views/users/_project_issue_reply.html.erb index 5323b76b6..2b43d8acf 100644 --- a/app/views/users/_project_issue_reply.html.erb +++ b/app/views/users/_project_issue_reply.html.erb @@ -4,11 +4,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
<%#= format_date(activity.updated_on) %>
@@ -46,12 +42,8 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> - + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> +
<% if reply.details.any? %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index b6e3f9a94..b3c2fea59 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -90,11 +90,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
<%#=format_date(activity.updated_on)%>
@@ -129,11 +125,7 @@ <% end %> <%= format_time(reply.created_on) %> - <% if reply.author == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
diff --git a/app/views/users/_resource_share_for_orgs.html.erb b/app/views/users/_resource_share_for_orgs.html.erb index 54ff83684..6788161f0 100644 --- a/app/views/users/_resource_share_for_orgs.html.erb +++ b/app/views/users/_resource_share_for_orgs.html.erb @@ -1,13 +1,16 @@
发送到
-
- <%= 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 @@
- <%= 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} %>
diff --git a/app/views/users/_resource_share_for_project_popup.html.erb b/app/views/users/_resource_share_for_project_popup.html.erb index c758ef492..07f4abe38 100644 --- a/app/views/users/_resource_share_for_project_popup.html.erb +++ b/app/views/users/_resource_share_for_project_popup.html.erb @@ -2,7 +2,10 @@
发送到
- @@ -12,7 +15,7 @@
- <%= 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) %> diff --git a/app/views/users/_resource_share_popup.html.erb b/app/views/users/_resource_share_popup.html.erb index 3895446f1..68c059a1d 100644 --- a/app/views/users/_resource_share_popup.html.erb +++ b/app/views/users/_resource_share_popup.html.erb @@ -4,7 +4,10 @@
发送到
- @@ -14,10 +17,9 @@
- <%= 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) %> diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 2fe7315d5..432074191 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -5,24 +5,24 @@ $(document).ready(function(){ $("#relateProject,.relatePInfo").mouseover(function(){ $(".relatePInfo").css("display","block"); - }) + }); $("#relateProject,.relatePInfo").mouseout(function(){ $(".relatePInfo").css("display","none"); - }) + }); $(".coursesLineGrey").mouseover(function(){ $(this).css("color","#ffffff"); - }) + }); $(".coursesLineGrey").mouseout(function(){ $(this).css("color","#808080"); - }) + }); $(".homepagePostSetting,.coursesLineGrey").mouseover(function(){ $(this).prev().css("color","#ffffff"); $(this).css("z-index", "9999"); - }) + }); $(".homepagePostSetting").mouseout(function(){ $(this).prev().css("color","#808080"); $(this).css("z-index", "1"); - }) + }); }) diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index de5ffc31f..522bdc835 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -50,11 +50,7 @@
回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.author == User.current %> - - <% 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"}%>
<%#= format_date(activity.updated_on) %>
@@ -92,11 +88,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.author == User.current %> - - <% 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"}%>
diff --git a/app/views/users/_user_course_list.html.erb b/app/views/users/_user_course_list.html.erb index 5e3f48963..ea8f3fc40 100644 --- a/app/views/users/_user_course_list.html.erb +++ b/app/views/users/_user_course_list.html.erb @@ -24,7 +24,7 @@ <% teacher = User.where("id=?",course.tea_id).first%> <%='主讲老师:'+(teacher.try(:realname) != " " ? teacher.lastname + teacher.firstname : teacher.try(:login)) %> - +
  • diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index 48c303a29..681f158e7 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -10,7 +10,7 @@
  • 提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计。

    diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 9f9aea60f..669e7aa91 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -70,7 +70,7 @@
    上传附件 - <%= link_to "资源库",{:controller => 'users', :action => 'user_ref_resource_search', :id => User.current.id, :homework_id => container.id, :type => nil}, :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 %>
    编程 diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index f81fbabf5..a01418d2f 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -201,7 +201,7 @@ <% end %> <% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 %> - <% projects = homework_common.student_work_projects.where("is_leader = 1") %> + <% projects = homework_common.student_work_projects.where("is_leader = 1 and project_id != -1") %> <% unless projects.empty? %> <% sort_projects = project_sort_update projects %>
    @@ -306,11 +306,7 @@ ︿ <%= count>0 ? "(#{count})" : "" %> - <% if homework_common.user == User.current %> - - <% else %> - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%> - <% end %> + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%>
    @@ -379,11 +375,7 @@
    - <% if comment.user == User.current %> - - <% 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"}%> <%= link_to( diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index 47d5145ac..6967bb398 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -64,11 +64,7 @@
    回复 <%= count>0 ? "(#{count})" : "" %> - <% if activity.user == User.current %> - - <% 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"}%>
    @@ -106,11 +102,7 @@ <% end %> <%= format_time(comment.created_on) %> - <% if comment.user == User.current %> - - <% 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"}%>
    - <%=render :partial => 'homework_repository_detail', :locals => {:homework => nil, :status => 0} %> + <%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
    diff --git a/app/views/users/user_homeworks.js.erb b/app/views/users/user_homeworks.js.erb index 5579d8a92..ce1bb65e2 100644 --- a/app/views/users/user_homeworks.js.erb +++ b/app/views/users/user_homeworks.js.erb @@ -1,4 +1,4 @@ /*$("#homework_repository").html('<%#= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');*/ $("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => 0,:property => @property,:search=>''})%>'); $("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil, :status => 0}) %>"); +$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>"); diff --git a/app/views/users/user_search_homeworks.js.erb b/app/views/users/user_search_homeworks.js.erb index 807dcc7d0..29d490960 100644 --- a/app/views/users/user_search_homeworks.js.erb +++ b/app/views/users/user_search_homeworks.js.erb @@ -5,5 +5,5 @@ $("#homework_detail_information").html("<%=escape_javascript(render :partial => <% else %> $("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>@search})%>'); $("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil, :status => 0}) %>"); +$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>"); <% end %> \ No newline at end of file diff --git a/app/views/wechats/create.html.erb b/app/views/wechats/create.html.erb deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/views/wechats/login.html.erb b/app/views/wechats/login.html.erb index 0e6fd8695..c7ab519f2 100644 --- a/app/views/wechats/login.html.erb +++ b/app/views/wechats/login.html.erb @@ -12,19 +12,16 @@
    - -
    +
    - +
    - - diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index db848d2cd..dc7cdc5fc 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -20,15 +20,25 @@ <% else %> <%= l(:label_anonymous) %> <% end %> - -

    - <%= reply.notes.html_safe %> -

    +
    +

    + <%= reply.notes.html_safe %> +

    +
    +
    <%= format_time reply.created_on %>
    -<% end %> \ No newline at end of file +<% end %> diff --git a/config/menu.yml b/config/menu.yml index 0c0e5c17d..de1952503 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -2,7 +2,7 @@ button: - type: "view" name: "最新动态" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&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/assets/wechat/app.html#/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" \ No newline at end of file + url: "https://test.course.trustie.net/organizations/1/downloads" \ No newline at end of file diff --git a/config/wechat.yml b/config/wechat.yml index 53141df40..5b528487b 100644 --- a/config/wechat.yml +++ b/config/wechat.yml @@ -3,8 +3,8 @@ default: &default # corpsecret: "corpsecret" # agentid: 1 # Or if using public account, only need above two line - appid: "wx8e1ab05163a28e37" - secret: "beb4d3bc4b32b3557811680835357841" + appid: "wxc09454f171153c2d" + secret: "dff5b606e34dcafe24163ec82c2715f8" token: "123456" access_token: "1234567" encrypt_mode: false # if true must fill encoding_aes_key diff --git a/db/migrate/20160526093715_delete_anonymous_reply.rb b/db/migrate/20160526093715_delete_anonymous_reply.rb new file mode 100644 index 000000000..443a07999 --- /dev/null +++ b/db/migrate/20160526093715_delete_anonymous_reply.rb @@ -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 diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index a8c17345b..6b0f1621b 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -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(/(

    \s*<\/h1>)|(

    \s*<\/h2>)|(

    \s*<\/h3>)|(

    \s*<\/h4>)/g,""); + self.select().html(val); + self.select(); + } } }); }); diff --git a/public/assets/kindeditor/plugins/autoheight/autoheight.js b/public/assets/kindeditor/plugins/autoheight/autoheight.js index 82928ff0c..cdd3f94f8 100644 --- a/public/assets/kindeditor/plugins/autoheight/autoheight.js +++ b/public/assets/kindeditor/plugins/autoheight/autoheight.js @@ -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)); } diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index 65c75d6ea..cf9c219e9 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -1,7 +1,7 @@ .ke-content { - font-size: 12px; - font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢���ź�, ����; - 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;} \ No newline at end of file +.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;} diff --git a/public/assets/kindeditor/plugins/table/table.js b/public/assets/kindeditor/plugins/table/table.js index be386f7cc..74b14b118 100644 --- a/public/assets/kindeditor/plugins/table/table.js +++ b/public/assets/kindeditor/plugins/table/table.js @@ -257,6 +257,7 @@ KindEditor.plugin('table', function(K) { style += 'border-color:'+borderColor+';'; } style += 'table-layout: '+'fixed;'; + style += 'border-collapse: collapse;'; var html = '') + ''; + html += '' + (K.IE ? ' ' : '
    ') + ''; } html += ''; } diff --git a/public/assets/wechat/activities.html b/public/assets/wechat/activities.html index 3391506f2..1bab8dfb4 100644 --- a/public/assets/wechat/activities.html +++ b/public/assets/wechat/activities.html @@ -8,30 +8,32 @@
    -
    - - -
    - -
    -
    - 迟交扣分:{{act.homework_common_detail.late_penalty}}分 匿评开启时间:{{act.homework_common_detail.evaluation_start}}
    - 缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品 匿评关闭时间:{{act.homework_common_detail.evaluation_end}} +
    +
    + + +
    + +
    +
    + 迟交扣分:{{act.homework_common_detail.late_penalty}}分 匿评开启时间:{{act.homework_common_detail.evaluation_start}}
    + 缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品 匿评关闭时间:{{act.homework_common_detail.evaluation_end}} +
    + +
    - -
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} -
    -
    {{act.praise_count}}
    -
    {{act.praise_count}}
    + 回复 + {{act.reply_count}} +
    +
    {{act.praise_count}}
    +
    {{act.praise_count}}
    @@ -42,23 +44,25 @@
    -
    - - -
    - -
    -
    + - -
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} -
    -
    {{act.praise_count}}
    -
    {{act.praise_count}}
    + 回复 + {{act.reply_count}} +
    +
    {{act.praise_count}}
    +
    {{act.praise_count}}
    @@ -69,23 +73,25 @@
    -
    - - -
    - -
    -
    + - -
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} -
    -
    {{act.praise_count}}
    -
    {{act.praise_count}}
    + 回复 + {{act.reply_count}} +
    +
    {{act.praise_count}}
    +
    {{act.praise_count}}
    @@ -112,25 +118,27 @@
    -
    - - -
    - -
    -
    - 状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
    - 指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}% +
    +
    + + +
    + +
    +
    + 状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
    + 指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}% +
    + +
    - -
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} -
    -
    {{act.praise_count}}
    -
    {{act.praise_count}}
    + 回复 + {{act.reply_count}} +
    +
    {{act.praise_count}}
    +
    {{act.praise_count}}
    @@ -142,23 +150,25 @@
    -
    - - -
    - -
    -
    + - -
    {{act.activity_type_name}} {{act.latest_update}} - - {{act.reply_count}} -
    -
    {{act.praise_count}}
    -
    {{act.praise_count}}
    + 回复 + {{act.reply_count}} +
    +
    {{act.praise_count}}
    +
    {{act.praise_count}}
    @@ -184,22 +194,24 @@
    -
    - - -
    -
    -
    -

    +
    +
    + + +
    +
    +
    +
    +
    + +
    - -
    {{act.latest_update}} - - {{act.reply_count}} -
    -
    {{act.praise_count}}
    -
    {{act.praise_count}}
    + 回复 + {{act.reply_count}} +
    +
    {{act.praise_count}}
    +
    {{act.praise_count}}
    @@ -211,22 +223,24 @@
    -
    - - -
    - -
    -
    + - -
    {{act.latest_update}} - - {{act.reply_count}} -
    -
    {{act.praise_count}}
    -
    {{act.praise_count}}
    + 回复 + {{act.reply_count}} +
    +
    {{act.praise_count}}
    +
    {{act.praise_count}}
    diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html index d9944fc7d..fa3a9f341 100644 --- a/public/assets/wechat/blog_detail.html +++ b/public/assets/wechat/blog_detail.html @@ -1,46 +1,48 @@ -
    -
    -
    -
    {{blog.title}}      
    -
    {{blog.user.realname}}发表博客
    -
    -
    -
    +
    +
    +
    +
    +
    {{blog.title}}
    +
    {{blog.user.realname}}发表博客
    +
    +
    +
    +
    +
    + {{blog.created_at}} +
    -
    - {{blog.created_at}} -
    -
    -
    -
    回复 ({{blog.comment_count}})
    -
    已赞 ({{blog.praise_count}})
    -
    赞 ({{blog.praise_count}})
    -
    -
    -
    -
    -
    -
    - -
    -
    {{journal.lasted_comment}}
    -
    回复
    +
    +
    回复 ({{blog.comment_count}})
    +
    已赞 ({{blog.praise_count}})
    +
    赞 ({{blog.praise_count}})
    +
    +
    +
    +
    +
    +
    + +
    
    +                            
    {{journal.lasted_comment}}
    +
    回复
    +
    +
    -
    -
    -
    -
    - -
    - - +
    +
    + +
    + + +
    + +
    - -
    diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 42facd960..d1b65e629 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -1,52 +1,55 @@ -
    -
    -
    -
    {{discussion.subject}}      
    - - - - - - - -
    发布者:{{discussion.user.realname}}
    来   源:{{discussion.course_project_name}}  |  课程问答区
    -
    -
    -
    -
    - {{discussion.created_on}} -
    -
    -
    -
    回复 ({{discussion.replies_count}})
    -
    已赞 ({{discussion.praise_count}})
    -
    赞 ({{discussion.praise_count}})
    -
    -
    -
    -
    -
    -
    - -
    -
    {{journal.lasted_comment}}
    -
    回复
    +
    +
    +
    +
    +
    +
    {{discussion.subject}}
    + + + + + + + +
    发布者:{{discussion.user.realname}}
    来   源:{{discussion.course_project_name}}  |  课程问答区
    +
    +
    + {{discussion.created_on}} +
    -
    -
    -
    -
    - -
    - - +
    +
    回复 ({{discussion.replies_count}})
    +
    已赞 ({{discussion.praise_count}})
    +
    赞 ({{discussion.praise_count}})
    +
    +
    +
    +
    +
    +
    + +
    
    +                            
    {{journal.lasted_comment}}
    +
    回复
    +
    +
    +
    +
    +
    +
    +
    + +
    + + +
    + +
    - -
    diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html index 18f62be1e..c10763bf8 100644 --- a/public/assets/wechat/course_notice.html +++ b/public/assets/wechat/course_notice.html @@ -1,5 +1,6 @@ +
    @@ -30,7 +31,7 @@
    -
    +
    
                             
    {{comments.created_on}}
    回复
    @@ -51,3 +52,4 @@
    +
    \ No newline at end of file diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html index 5efa7c54d..2783bd317 100644 --- a/public/assets/wechat/homework_detail.html +++ b/public/assets/wechat/homework_detail.html @@ -1,5 +1,6 @@ +
    @@ -36,7 +37,7 @@
    -
    +
    
                             
    {{journal.lasted_comment}}
    回复
    @@ -56,4 +57,5 @@
    -
    \ No newline at end of file +
    +
    \ No newline at end of file diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 20c35c664..035a7c98d 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -1,5 +1,6 @@ +
    @@ -34,7 +35,7 @@
    -
    +
    
                             
    {{journal.created_on}}
    回复
    @@ -55,3 +56,4 @@
    +
    \ No newline at end of file diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html index f9aebd632..5ccbf6248 100644 --- a/public/assets/wechat/jour_message_detail.html +++ b/public/assets/wechat/jour_message_detail.html @@ -1,44 +1,46 @@ -
    -
    -
    -
    {{message.user.realname}}给您留言了
    -
    {{message.created_on}}
    -
    -
    -
    +
    +
    +
    +
    +
    {{message.user.realname}}给您留言了
    +
    {{message.created_on}}
    +
    +
    +
    +
    +
    -
    -
    -
    -
    回复 ({{message.reply_count}})
    -
    已赞 ({{message.praise_count}})
    -
    赞 ({{message.praise_count}})
    -
    -
    +
    +
    回复 ({{message.reply_count}})
    +
    已赞 ({{message.praise_count}})
    +
    赞 ({{message.praise_count}})
    +
    +
    -
    -
    -
    -
    - -
    -
    {{journal.lasted_comment}}
    -
    回复
    +
    +
    +
    +
    + +
    
    +                            
    {{journal.lasted_comment}}
    +
    回复
    +
    +
    -
    -
    -
    -
    - -
    - - +
    +
    + +
    + + +
    + +
    - -
    diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 1f2f7ce72..be639c1a0 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -1,9 +1,10 @@ +
    -
    {{discussion.subject}}      
    +
    {{discussion.subject}}
    @@ -30,7 +31,7 @@
    -
    +
    
                                 
    {{journal.lasted_comment}}
    回复
    @@ -38,7 +39,7 @@ -
    +
    @@ -50,4 +51,5 @@
    -
    \ No newline at end of file + + \ No newline at end of file diff --git a/public/images/nav_icon.png b/public/images/nav_icon.png index 1b4e61aec..c9144e074 100644 Binary files a/public/images/nav_icon.png and b/public/images/nav_icon.png differ diff --git a/public/images/wechat/icon.png b/public/images/wechat/icon.png new file mode 100755 index 000000000..afc7aa639 Binary files /dev/null and b/public/images/wechat/icon.png differ diff --git a/public/images/wechat/icon_list.gif b/public/images/wechat/icon_list.gif new file mode 100755 index 000000000..8b38366c6 Binary files /dev/null and b/public/images/wechat/icon_list.gif differ diff --git a/public/images/wechat/icon_list2.gif b/public/images/wechat/icon_list2.gif new file mode 100755 index 000000000..1d7dcb061 Binary files /dev/null and b/public/images/wechat/icon_list2.gif differ diff --git a/public/images/wechat/loading.gif b/public/images/wechat/loading.gif deleted file mode 100755 index b806bf34c..000000000 Binary files a/public/images/wechat/loading.gif and /dev/null differ diff --git a/public/images/wechat/w_praise.png b/public/images/wechat/w_praise.png new file mode 100755 index 000000000..6c0a5f7eb Binary files /dev/null and b/public/images/wechat/w_praise.png differ diff --git a/public/images/wechat/w_praised.png b/public/images/wechat/w_praised.png new file mode 100755 index 000000000..3b80c9c0b Binary files /dev/null and b/public/images/wechat/w_praised.png differ diff --git a/public/images/wechat/w_reply.png b/public/images/wechat/w_reply.png new file mode 100755 index 000000000..d18e19508 Binary files /dev/null and b/public/images/wechat/w_reply.png differ diff --git a/public/images/weixin_pic.jpg b/public/images/weixin_pic.jpg new file mode 100644 index 000000000..b9696dfa3 Binary files /dev/null and b/public/images/weixin_pic.jpg differ diff --git a/public/javascripts/application.js b/public/javascripts/application.js index aec0af070..303fc3ac9 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -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 = ""+full+""; + reStr = ""+full+""; } else{ - reStr = ""+full+""; + reStr = ""+full+""; } } 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 = ""+full+""; + reStr = ""+full+""; } else{ - reStr = ""+full+""; + reStr = ""+full+""; } } return reStr ; diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 0bba3264b..7cfad6005 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -73,79 +73,79 @@ function hidden_homework_score_form() /////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////新建课程相关 //验证课程名称 -function regex_course_name() +function regex_course_name(str) { - var name = $.trim($("#course_name").val()); + var name = $.trim($("#"+str+"_course_name").val()); if(name.length < 2) { - $("#course_name_notice").show(); + $("#"+str+"_course_name_notice").show(); return false; } else { - $("#course_name_notice").hide(); + $("#"+str+"_course_name_notice").hide(); return true; } } //验证课程学时 -function regex_course_class_period() +function regex_course_class_period(str) { - var class_period = $.trim($("#class_period").val()); + var class_period = $.trim($("#"+str+"_class_period").val()); var regex = /^\d*$/; if(class_period.length == 0) { - $("#course_class_period_notice").html("学时总数不能为空"); - $("#course_class_period_notice").show(); + $("#"+str+"_course_class_period_notice").html("学时总数不能为空"); + $("#"+str+"_course_class_period_notice").show(); return false; } else if (regex.test(class_period)) { if(parseInt(class_period) > 0) { - $("#course_class_period_notice").html(""); - $("#course_class_period_notice").hide(); + $("#"+str+"_course_class_period_notice").html(""); + $("#"+str+"_course_class_period_notice").hide(); return true; } else { - $("#course_class_period_notice").html("学时总数必须大于0"); - $("#course_class_period_notice").show(); + $("#"+str+"_course_class_period_notice").html("学时总数必须大于0"); + $("#"+str+"_course_class_period_notice").show(); return false; } } else { - $("#course_class_period_notice").html("学时总数必须为正整数"); - $("#course_class_period_notice").show(); + $("#"+str+"_course_class_period_notice").html("学时总数必须为正整数"); + $("#"+str+"_course_class_period_notice").show(); return false; } } //验证开始学期和结束学期 -function regex_time_term(){ - var obj_time = document.getElementById("time"); - var obj_end_time = document.getElementById("end_time"); - var obj_term = document.getElementById("term"); - var obj_end_term = document.getElementById("end_term"); +function regex_time_term(str){ + var obj_time = document.getElementById(str+"_time"); + var obj_end_time = document.getElementById(str+"_end_time"); + var obj_term = document.getElementById(str+"_term"); + var obj_end_term = document.getElementById(str+"_end_term"); var time = obj_time.options[obj_time.selectedIndex]; var end_time = obj_end_time.options[obj_end_time.selectedIndex]; var term = obj_term.options[obj_term.selectedIndex]; var end_term = obj_end_term.options[obj_end_term.selectedIndex]; if(time.value == end_time.value) { if(set_term_val(term.value) > set_term_val(end_term.value)) { - $("#course_time_term_notice").html("开始学期不能晚于结束学期"); - $("#course_time_term_notice").show(); + $("#"+str+"_course_time_term_notice").html("开始学期不能晚于结束学期"); + $("#"+str+"_course_time_term_notice").show(); return false; } else { - $("#course_time_term_notice").html(""); - $("#course_time_term_notice").hide(); + $("#"+str+"_course_time_term_notice").html(""); + $("#"+str+"_course_time_term_notice").hide(); return true; } } else if(time.value < end_time.value) { - $("#course_time_term_notice").html(""); - $("#course_time_term_notice").hide(); + $("#"+str+"_course_time_term_notice").html(""); + $("#"+str+"_course_time_term_notice").hide(); return true; } else { - $("#course_time_term_notice").html("开始学期不能晚于结束学期"); - $("#course_time_term_notice").show(); + $("#"+str+"_course_time_term_notice").html("开始学期不能晚于结束学期"); + $("#"+str+"_course_time_term_notice").show(); return false; } } @@ -160,32 +160,32 @@ function set_term_val(val) { } } //验证密码 -function regex_course_password() +function regex_course_password(str) { - var class_period = $.trim($("#course_course_password").val()); + var class_period = $.trim($("#"+str+"_course_course_password").val()); var regex = /^\w+$/; if(class_period.length == 0) { - $("#course_course_password_notice").html("课程密码不能为空"); - $("#course_course_password_notice").show(); + $("#"+str+"_course_course_password_notice").html("课程密码不能为空"); + $("#"+str+"_course_course_password_notice").show(); return false; } else if (regex.test(class_period)) { - $("#course_course_password_notice").html(""); - $("#course_course_password_notice").hide(); + $("#"+str+"_course_course_password_notice").html(""); + $("#"+str+"_course_course_password_notice").hide(); return true; } else { - $("#course_course_password_notice").html("课程密码有非法字符"); - $("#course_course_password_notice").show(); + $("#"+str+"_course_course_password_notice").html("课程密码有非法字符"); + $("#"+str+"_course_course_password_notice").show(); return false; } } //提交新建课程 function submit_new_course() { - if(regex_course_name()&®ex_course_class_period()&®ex_time_term()&®ex_course_password()) + if(regex_course_name('new')&®ex_course_class_period('new')&®ex_time_term('new')&®ex_course_password('new')) { $("#new_course").submit(); } @@ -193,7 +193,7 @@ function submit_new_course() function submit_edit_course(id) { - if(regex_course_name()&®ex_course_class_period()&®ex_time_term()&®ex_course_password()) + if(regex_course_name('edit')&®ex_course_class_period('edit')&®ex_time_term('edit')&®ex_course_password('edit')) { $("#edit_course_"+id).submit(); } diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js index 2ff5336e1..d6fc52a8d 100644 --- a/public/javascripts/create_kindeditor.js +++ b/public/javascripts/create_kindeditor.js @@ -25,7 +25,7 @@ function sd_create_editor(params){ var edit = this.edit; var body = edit.doc.body; edit.iframe.height(paramsHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight)); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight+7)) , paramsHeight)); }, afterBlur:function(){ //params.toolbar_container.hide(); diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index 45d8de48b..e9ef7ad6c 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -487,6 +487,7 @@ int main()\n\ '; } else if(language==3){ src = '\ +#-*-coding:utf-8-*-\n\ #注意\n\ #1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ #2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index b72d39c40..8f00a2b96 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -136,7 +136,7 @@ app.factory('common', function($http, auth, $routeParams){ url: apiUrl+ "new_comment/"+id, data: userInfo }).then(function successCallback(response) { - alert("提交成功"); + //alert("提交成功"); //数据提交完成,回复按钮启用 data.disabled = false; if(typeof cb === 'function'){ @@ -446,11 +446,16 @@ app.directive('inputAuto',function(){ scope: {}, link: function(scope, element){ var copyContainer = element.parent().children().eq(0); + var sendButton = element.parent().next(); element.on('input',function(){ + console.log(sendButton); copyContainer.html(element[0].value); var textHeight = copyContainer[0].scrollHeight; element.css('height', textHeight + 'px'); }); + sendButton.on('click',function(){ + element.css('height','28px'); + }); } } }); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index a55755740..8d27be744 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -61,6 +61,9 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} .hworkList160 {width:160px; text-align:center;} .hworkList220 {width:220px; text-align:center;} .hworkList260 {width:260px; text-align:left;} +.hworkList290 {width:290px; text-align:left;} +.hworkList340 {width:340px; text-align:left;} +.hworkList420 {width:420px; text-align:left;} .codeList{ float:right; font-size:12px; color:#484848; padding:0px 3px; width:714px; margin-bottom:10px; } .hworkName {width:80px; float:left; line-height:18px;} .hworkName div{max-height: 36px;overflow: hidden;} @@ -91,6 +94,8 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re .width130{width: 130px;} .width165{width: 165px;} .width180{width: 180px;} +.width290{width: 290px;} +.width340{width: 340px;} .width525{width: 525px;} .width285{width: 285px;} .width255{width: 255px;} @@ -139,7 +144,6 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostDes {float:left; width:655px; margin-left:15px;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} -.homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} @@ -147,7 +151,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} - +.homepagePostIntro a{color: #15bccf;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} .homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} @@ -189,6 +193,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} .homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.homepagePostReplyContent a{color: #15bccf;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} @@ -436,9 +441,11 @@ a:hover.ping_sub{ background:#14a8b9;} .ping_dispic a{ display:block; height:46px; width:46px; border:1px solid #CCC; padding:1px; float:left;} .ping_dispic a:hover{border:1px solid #15bccf;} .ping_discon{ float:left; width:610px; margin-left:10px; } +.ping_journal a{color: #15bccf;} /*.ping_distop span{ float:left;}*/ .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} +.ping_disfoot span a span{ color: #6883b6;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ .list_style ol li{list-style-type: decimal;margin-left: 40px;} .list_style ul li{list-style-type: disc;margin-left: 40px;} @@ -1132,7 +1139,8 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} .postDetailDes ul li{list-style-type: disc;margin-left: 40px;} -.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;} +.postDetailDes a{color: #15bccf;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; } .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 3e21a5fda..74a9d9aaf 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -123,7 +123,7 @@ a:hover.ping_sub{ background:#14a8b9;} .list_style ol li{list-style-type: decimal;margin-left: 40px;} .list_style ul li{list-style-type: disc;margin-left: 40px;} .ping_distop span a{ float:right; /*width:20px;*/ height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;} - +.ping_journal a{color: #15bccf;} /* 创建作业 */ .Newwork{ width:940px; border:1px solid #c3c3c3;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index cfdf12153..0231f6a8a 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -672,7 +672,6 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostDes {float:left; width:655px; margin-left:15px; overflow:hidden;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} -.homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} @@ -683,6 +682,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} +.homepagePostIntro a{color: #15bccf;} .homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;} .borderBottomNone {border-bottom:none !important;} .homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} @@ -722,6 +722,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;} .homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.homepagePostReplyContent a{color: #15bccf;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} @@ -866,6 +867,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} .postDetailDes ul li{list-style-type: disc;margin-left: 40px;} .postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;} +.postDetailDes a{color: #15bccf;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; } /*line-height: 18px !important;*/ .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index c5d6da994..3e3f59f18 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -18,14 +18,14 @@ .orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;} a.saveBtn {padding:2px 10px; background-color:#269ac9; color:#ffffff;} a.saveBtn:hover {background-color:#297fb8;} -.orgMemberList {width:480px; float:left;} +.orgMemberList {width:420px; float:left;} .orgColumnList {width:688px; float:left;} .orgListUser {width:110px; float:left;padding-right: 10px;} .orgListRole {width:180px; float:left;} .orgOrder {width:70px; float:left; text-align:center;} .orgSubNum {width:30px; float:left; text-align:center;} .subNumBlock {cursor:pointer;background-color:#fffce6;color: #0d90c3; width:30px; height:17px; line-height:17px; margin:7px 0; vertical-align:middle;} -.orgMemContainer {width:208px;} +.orgMemContainer {width:268px;} .orgMemberAdd {float:right;} .orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;} .undis {display:none;} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 09f7075f7..f5690a12c 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -332,6 +332,8 @@ a:hover.ping_sub{ background:#14a8b9;} /*.ping_distop span{ float:left;}*/ .ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;} .ping_disfoot a{ float:right; color: #6883b6; margin-left:5px; margin-bottom:5px;} +.ping_disfoot span a span{ color: #6883b6;} +.ping_journal a{color: #15bccf;} /*.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}*/ .list_style ol li{list-style-type: decimal;margin-left: 40px;} .list_style ul li{list-style-type: disc;margin-left: 40px;} @@ -974,6 +976,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} +.homepagePostIntro a{color: #15bccf;} .topBorder { border-top: 1px solid #E4E4E4; } @@ -1114,7 +1117,8 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} .postDetailDes ol li{list-style-type: decimal;margin-left: 40px;} .postDetailDes ul li{list-style-type: disc;margin-left: 40px;} -.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;} +.postDetailDes a{color: #15bccf;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 115e48223..9c5761079 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -24,9 +24,9 @@ table{ background:#fff;} a.btn_message_free{ background:#ff5722; display:block; text-align:center; color:#fff; padding:3px 0; width:80px; margin-bottom:10px;} .db {display:block;} /* font & color */ -h2{ font-size:18px; color:#15bccf;} -h3{ font-size:14px; color:#e8770d;} -h4{ font-size:14px; color:#3b3b3b;} +h2{ font-size:18px; } +h3{ font-size:14px; } +h4{ font-size:14px; } .f12{font-size:12px; font-weight:normal;} .f14{font-size:14px;} .f16{font-size:16px;} @@ -159,6 +159,7 @@ h4{ font-size:14px; color:#3b3b3b;} .w230{width:230px !important;} .w235{ width:235px !important;} .w250{ width:250px !important;} +.w410{ width:410px !important;} .w280{ width:280px;} .w265{ width: 265px;} .w270{ width: 270px;} @@ -243,6 +244,7 @@ a.c_green{ color:#28be6c;} .fontGrey3 {color:#484848;} .fontGrey4{color:#999999;} .fontGrey5 {color:#a1a1a1;} +.fontGrey6 {color:#7a7a7a;} .fontBlue {color:#3498db;} .fontBlue2 {color:#269ac9 !important;} a.underline {text-decoration:underline;} @@ -613,6 +615,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;} .homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} +.homepagePostIntro a{color: #15bccf;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} .homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;} @@ -649,6 +652,7 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 40px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;} .homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} +.homepagePostReplyContent a{color: #15bccf;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#15bccf;} diff --git a/public/stylesheets/public_new.css b/public/stylesheets/public_new.css index 56c867829..ec0290918 100644 --- a/public/stylesheets/public_new.css +++ b/public/stylesheets/public_new.css @@ -22,9 +22,9 @@ table{ background:#fff;} .none{display: none;} /* font & color */ -h2{ font-size:18px; color:#15bccf;} -h3{ font-size:14px; color:#e8770d;} -h4{ font-size:14px; color:#3b3b3b;} +h2{ font-size:18px; } +h3{ font-size:14px; } +h4{ font-size:14px; } .f12{font-size:12px; font-weight:normal;} .f14{font-size:14px;} .f16{font-size:16px;} diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index 30023f606..ba3eac3df 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -3,7 +3,7 @@ /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";} -h1,h2,h3,h4,h5,p {padding:0px; margin:0px;} +h1,h2,h3,h4,h5,p,pre {padding:0px; margin:0px;} .f12 {font-size:12px;} .f13 {font-size:13px;} .f15 {font-size:15px;} @@ -52,7 +52,7 @@ a.underline {text-decoration:underline;} .fl {float:left;} .fr {float:right;} .cl {clear:both; overflow:hidden;} -.post-content {width:100%; font-size:13px; height:90px; overflow:hidden; word-break:break-all; word-wrap:break-word;} +.post-content {width:100%; font-size:13px; line-height:18px; height:90px; overflow:hidden; word-break:break-all; word-wrap:break-word;} .post-content img {max-width:100%;} .post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;} .post-interactive-column, @@ -70,11 +70,11 @@ a.underline {text-decoration:underline;} .post-reply-date, .post-reply-trigger {font-size:13px;} .post-input-container {padding-right:2px;} .copy-input {width:100%; height:28px; line-height:28px; border-radius:3px; position:absolute; left:-9999em;} -.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:hidden; resize:none;} +.post-reply-input {width:100%; height:28px; max-height:84px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px; overflow-y:auto; resize:none;} .post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} -.reply-icon {background:url(/images/wechat/wechat_icon.gif) -100px 1px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.praise-icon {background:url(/images/wechat/wechat_icon.gif) -100px -38px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} -.praised-icon {background:url(/images/wechat/wechat_icon.gif) -100px -76px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.reply-icon {background:url(/images/wechat/icon_list.gif) -150px -155px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praise-icon {background:url(/images/wechat/icon_list.gif) -36px -88px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} +.praised-icon {background:url(/images/wechat/icon_list.gif) -152px -86px no-repeat; width:20px; height:20px; display:inline-block; vertical-align:middle;} /* loading 弹框*/ .loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(206, 206, 206, 0.3); overflow:hidden;}
    发布者: {{discussion.user.realname}}